Creata vista, funzione e stored x stato collaudi
Abbozzato controllo x mostrare stato collaudi
This commit is contained in:
@@ -0,0 +1,69 @@
|
||||
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="mod_StatoCollaudi.ascx.cs" Inherits="CMS_SC.WebUserControls.mod_StatoCollaudi" %>
|
||||
<asp:GridView ID="grView" runat="server" AutoGenerateColumns="False" DataKeyNames="IdxDossier,CodScheda,Vers,NumScheda" DataSourceID="ods" CssClass="table table-striped" AllowPaging="True" AllowSorting="True" OnSelectedIndexChanged="grView_SelectedIndexChanged" OnRowDataBound="grView_RowDataBound">
|
||||
<EmptyDataTemplate>
|
||||
<asp:Label runat="server" ID="lblNoRecord" Text='<%# traduci("NoRecords") %>' />
|
||||
</EmptyDataTemplate>
|
||||
<Columns>
|
||||
<asp:TemplateField ShowHeader="False" ItemStyle-Wrap="false">
|
||||
<EditItemTemplate>
|
||||
<asp:LinkButton ID="lbUpdate" runat="server" CausesValidation="True" CommandName="Update" ToolTip="Update" CssClass="fa fa-check fa-2x" />
|
||||
<asp:LinkButton ID="lbCancel" runat="server" CausesValidation="False" CommandName="Cancel" ToolTip="Cancel" CssClass="fa fa-undo fa-2x" />
|
||||
</EditItemTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton ID="lbEdit" runat="server" CausesValidation="False" CommandName="Edit" ToolTip="Edit" CssClass="fa fa-edit fa-2x" Visible='<%# isWriteEnabled %>' />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:BoundField DataField="CodScheda" HeaderText="CodScheda" ReadOnly="True" SortExpression="CodScheda" />
|
||||
<asp:BoundField DataField="Vers" HeaderText="Vers" ReadOnly="True" SortExpression="Vers" />
|
||||
<asp:BoundField DataField="NumScheda" HeaderText="#" ReadOnly="True" SortExpression="NumScheda" />
|
||||
<asp:TemplateField ShowHeader="False" ItemStyle-Width="60px">
|
||||
<HeaderTemplate>
|
||||
<%# traduci("moveMis") %>
|
||||
</HeaderTemplate>
|
||||
<EditItemTemplate>
|
||||
</EditItemTemplate>
|
||||
<ItemTemplate>
|
||||
<div class="col-xs-6">
|
||||
<asp:LinkButton ID="lbMoveUp" runat="server" CausesValidation="False" CommandName="Select" CommandArgument="moveUp" OnClick="lb_Click" ToolTip="Move Up" CssClass="fa fa-arrow-up" Visible='<%# arrowVisible("UP", Eval("Ordinale")) %>' />
|
||||
</div>
|
||||
<div class="col-xs-6">
|
||||
<asp:LinkButton ID="lbMoveDown" runat="server" CausesValidation="False" CommandName="Select" CommandArgument="moveDown" OnClick="lb_Click" ToolTip="Move Down" CssClass="fa fa-arrow-down" Visible='<%# arrowVisible("DOWN", Eval("Ordinale")) %>' />
|
||||
</div>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:BoundField DataField="opz" HeaderText="opz" SortExpression="opz" ControlStyle-Width="2em" />
|
||||
<asp:BoundField DataField="Descrizione" HeaderText="Descrizione" SortExpression="Descrizione" ControlStyle-Width="50em" />
|
||||
<asp:BoundField DataField="FasiEnab" HeaderText="FasiEnab" SortExpression="FasiEnab" ControlStyle-Width="12em" />
|
||||
<asp:TemplateField ShowHeader="False" ItemStyle-Wrap="false">
|
||||
<HeaderTemplate>
|
||||
</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton ID="lbDelete" runat="server" CausesValidation="False" CommandName="Delete" ToolTip="Delete" OnClientClick='<%# SteamWare.jsUtils.getCBE("confermaDel") %>' CssClass="fa fa-trash fa-2x" Visible='<%# isWriteEnabled %>' />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
</Columns>
|
||||
<PagerStyle CssClass="active GridPager" />
|
||||
<PagerSettings Mode="NumericFirstLast" />
|
||||
<SelectedRowStyle CssClass="info" />
|
||||
</asp:GridView>
|
||||
<asp:ObjectDataSource ID="ods" runat="server" OldValuesParameterFormatString="Original_{0}" SelectMethod="getByDossier" TypeName="CMS_SC_Data.DS_ApplicazioneTableAdapters.SchemaCollMaccTableAdapter" DeleteMethod="deleteQuery" UpdateMethod="updateQuery">
|
||||
<DeleteParameters>
|
||||
<asp:Parameter Name="Original_IdxDossier" Type="Int32" />
|
||||
<asp:Parameter Name="Original_CodScheda" Type="String" />
|
||||
<asp:Parameter Name="Original_Vers" Type="Int32" />
|
||||
<asp:Parameter Name="Original_NumScheda" Type="Int32" />
|
||||
</DeleteParameters>
|
||||
<SelectParameters>
|
||||
<asp:ControlParameter ControlID="hfIdxDossier" Name="IdxDossier" PropertyName="Value" Type="Int32" />
|
||||
</SelectParameters>
|
||||
<UpdateParameters>
|
||||
<asp:Parameter Name="Descrizione" Type="String" />
|
||||
<asp:Parameter Name="opz" Type="String" />
|
||||
<asp:Parameter Name="FasiEnab" Type="String" />
|
||||
<asp:Parameter Name="Original_IdxDossier" Type="Int32" />
|
||||
<asp:Parameter Name="Original_CodScheda" Type="String" />
|
||||
<asp:Parameter Name="Original_Vers" Type="Int32" />
|
||||
<asp:Parameter Name="Original_NumScheda" Type="Int32" />
|
||||
</UpdateParameters>
|
||||
</asp:ObjectDataSource>
|
||||
<asp:HiddenField runat="server" ID="hfIdxDossier" />
|
||||
@@ -0,0 +1,151 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
using CMS_SC_Data;
|
||||
using SteamWare;
|
||||
|
||||
namespace CMS_SC.WebUserControls
|
||||
{
|
||||
public partial class mod_StatoCollaudi : SteamWare.UserControl
|
||||
{
|
||||
/// <summary>
|
||||
/// selezione valore in DettScheda
|
||||
/// </summary>
|
||||
public event EventHandler eh_selezioneValore;
|
||||
/// <summary>
|
||||
/// sollevo evento selezione
|
||||
/// </summary>
|
||||
protected void raiseEvent()
|
||||
{
|
||||
// sollevo evento nuovo valore...
|
||||
if (eh_selezioneValore != null)
|
||||
{
|
||||
eh_selezioneValore(this, new EventArgs());
|
||||
}
|
||||
}
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
/// <summary>
|
||||
/// dimensione pagina grid view
|
||||
/// </summary>
|
||||
public int pageSize
|
||||
{
|
||||
get
|
||||
{
|
||||
return grView.PageSize;
|
||||
}
|
||||
set
|
||||
{
|
||||
grView.PageSize = value;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// dossier selezionato
|
||||
/// </summary>
|
||||
public string idxDossier
|
||||
{
|
||||
get
|
||||
{
|
||||
return hfIdxDossier.Value;
|
||||
}
|
||||
set
|
||||
{
|
||||
hfIdxDossier.Value = value;
|
||||
grView.DataBind();
|
||||
}
|
||||
}
|
||||
public void doUpdate()
|
||||
{
|
||||
grView.DataBind();
|
||||
}
|
||||
/// <summary>
|
||||
/// selezione scheda...
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void grView_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
// verifico se ho un argomento di tipo moveUp / moveDown... quale comando?
|
||||
string _comando = "";
|
||||
string CodSchedaVersNum = "";
|
||||
if (SteamWare.memLayer.ML.isInSessionObject("nextObjCommand"))
|
||||
{
|
||||
_comando = SteamWare.memLayer.ML.StringSessionObj("nextObjCommand");
|
||||
SteamWare.memLayer.ML.emptySessionVal("nextObjCommand");
|
||||
}
|
||||
if (_comando != "")
|
||||
{
|
||||
CodSchedaVersNum = string.Format("{0}.{1}.{2}", grView.SelectedDataKey["CodScheda"], grView.SelectedDataKey["Vers"], grView.SelectedDataKey["NumScheda"]);
|
||||
// SE c'era comando eseguo move...
|
||||
switch (_comando)
|
||||
{
|
||||
case "moveUp":
|
||||
case "moveDown":
|
||||
DtProxy.man.taSCM.moveUpDown(_comando, Convert.ToInt32(idxDossier), CodSchedaVersNum);
|
||||
break;
|
||||
//case "clone":
|
||||
// DtProxy.man.taDS.clone(memLayer.ML.QSS("CodSchedaVers"), grView.SelectedDataKey["CodMisura"].ToString());
|
||||
// break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
resetSelezione();
|
||||
}
|
||||
else
|
||||
{
|
||||
raiseEvent();
|
||||
}
|
||||
}
|
||||
protected void btnReset_Click(object sender, EventArgs e)
|
||||
{
|
||||
resetSelezione();
|
||||
}
|
||||
/// <summary>
|
||||
/// resetto selezione
|
||||
/// </summary>
|
||||
private void resetSelezione()
|
||||
{
|
||||
grView.SelectedIndex = -1;
|
||||
grView.DataBind();
|
||||
raiseEvent();
|
||||
}
|
||||
/// <summary>
|
||||
/// determina visibilità frecce spostamento
|
||||
/// </summary>
|
||||
/// <param name="direction">direzione: UP / DOWN</param>
|
||||
/// <param name="_Ordinale">Ordinale</param>
|
||||
/// <returns></returns>
|
||||
public bool arrowVisible(object _direction, object _Ordinale)
|
||||
{
|
||||
bool answ = false;
|
||||
string direction = _direction.ToString();
|
||||
int Ordinale = Convert.ToInt32(_Ordinale.ToString());
|
||||
switch (direction)
|
||||
{
|
||||
case "UP":
|
||||
answ = Ordinale > 1;
|
||||
break;
|
||||
case "DOWN":
|
||||
answ = Ordinale < DtProxy.man.taSCM.getByDossier(Convert.ToInt32(idxDossier)).Rows.Count;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
/// <summary>
|
||||
/// salvo in session il prox comando
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void lb_Click(object sender, EventArgs e)
|
||||
{
|
||||
SteamWare.memLayer.ML.setSessionVal("nextObjCommand", ((LinkButton)sender).CommandArgument);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace CMS_SC.WebUserControls {
|
||||
|
||||
|
||||
public partial class mod_StatoCollaudi {
|
||||
|
||||
/// <summary>
|
||||
/// grView control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.GridView grView;
|
||||
|
||||
/// <summary>
|
||||
/// ods control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.ObjectDataSource ods;
|
||||
|
||||
/// <summary>
|
||||
/// hfIdxDossier control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.HiddenField hfIdxDossier;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user