Completo aggiunta gestione AnagTagFasi
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
|
||||
<div class="row small">
|
||||
<div class="col-12">
|
||||
<asp:GridView runat="server" AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False" DataKeyNames="gruppo" DataSourceID="ods" CssClass="table table-striped table-sm table-bordered small" ID="grView" OnDataBound="grView_DataBound" OnSelectedIndexChanged="grView_SelectedIndexChanged">
|
||||
<asp:GridView runat="server" AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False" DataKeyNames="CodTagFase" DataSourceID="ods" CssClass="table table-striped table-sm table-bordered small" ID="grView" OnDataBound="grView_DataBound" OnSelectedIndexChanged="grView_SelectedIndexChanged">
|
||||
<EditRowStyle CssClass="table-primary" />
|
||||
<SelectedRowStyle CssClass="table-info" />
|
||||
<Columns>
|
||||
@@ -24,23 +24,17 @@
|
||||
<ItemStyle HorizontalAlign="Center"></ItemStyle>
|
||||
<HeaderStyle HorizontalAlign="Center"></HeaderStyle>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="gruppo" SortExpression="gruppo">
|
||||
<EditItemTemplate>
|
||||
<asp:TextBox ID="txtgruppo" runat="server" Text='<%# Bind("gruppo") %>'></asp:TextBox>
|
||||
</EditItemTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lblgruppo" runat="server" Text='<%# Eval("gruppo") %>'></asp:Label>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:BoundField DataField="descrGruppo" HeaderText="descrGruppo" SortExpression="descrGruppo" />
|
||||
<asp:BoundField DataField="codExt" HeaderText="codExt" SortExpression="codExt" />
|
||||
<asp:CheckBoxField DataField="exportEnab" HeaderText="exportEnab" SortExpression="exportEnab" />
|
||||
<asp:TemplateField ShowHeader="False">
|
||||
<asp:BoundField DataField="CodTagFase" HeaderText="CodTagFase" SortExpression="CodTagFase" />
|
||||
<asp:BoundField DataField="CodGruppo" HeaderText="CodGruppo" SortExpression="CodGruppo" />
|
||||
<asp:BoundField DataField="Descrizione" HeaderText="Descrizione" SortExpression="Descrizione" />
|
||||
<asp:CheckBoxField DataField="Enabled" HeaderText="Enabled" SortExpression="Enabled" />
|
||||
<asp:BoundField DataField="NumFasi" HeaderText="NumFasi" SortExpression="NumFasi" ReadOnly="true" />
|
||||
<asp:TemplateField>
|
||||
<HeaderTemplate>
|
||||
<asp:LinkButton runat="server" ID="lbt" CssClass="btn btn-sm btn-success" OnClick="btnNew_Click" ToolTip='<%# traduci("New") %>' Visible='<%# chkLicOk %>'><i class="fa fa-plus" aria-hidden="true"></i></asp:LinkButton>
|
||||
</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton runat="server" ID="lbtDelete" CssClass="btn btn-sm btn-danger" CausesValidation="False" CommandArgument='<%# Eval("gruppo") %>' CommandName="Delete" ToolTip='<%# traduci("Delete") %>' Visible='<%# delEnabled(Eval("gruppo")) %>'><i class="fa fa-trash" aria-hidden="true"></i></asp:LinkButton>
|
||||
<asp:LinkButton runat="server" ID="lbtDelete" CssClass="btn btn-sm btn-danger" CausesValidation="False" CommandArgument='<%# Eval("CodTagFase") %>' CommandName="Delete" ToolTip='<%# traduci("Delete") %>' Visible='<%# Eval("NumFasi").ToString() == "0" %>'><i class="fa fa-trash" aria-hidden="true"></i></asp:LinkButton>
|
||||
<asp:ConfirmButtonExtender ID="cbeDelete" runat="server" ConfirmText='<%# traduci("confermaDel")%>' TargetControlID="lbtDelete"></asp:ConfirmButtonExtender>
|
||||
</ItemTemplate>
|
||||
<EditItemTemplate>
|
||||
@@ -50,23 +44,24 @@
|
||||
</asp:TemplateField>
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
<asp:ObjectDataSource runat="server" ID="ods" OldValuesParameterFormatString="Original_{0}" SelectMethod="GetData" TypeName="GPW_data.DS_ApplicazioneTableAdapters.AnagGruppiTableAdapter" OnUpdating="ods_Updating" DeleteMethod="deleteQuery" InsertMethod="insertQuery" UpdateMethod="updateQuery">
|
||||
<asp:ObjectDataSource runat="server" ID="ods" OldValuesParameterFormatString="Original_{0}" SelectMethod="GetData" TypeName="GPW_data.DS_ApplicazioneTableAdapters.AnagTagFasiTableAdapter" OnUpdating="ods_Updating" DeleteMethod="deleteQuery" InsertMethod="insertQuery" UpdateMethod="updateQuery">
|
||||
<DeleteParameters>
|
||||
<asp:Parameter Name="Original_gruppo" Type="String" />
|
||||
<asp:Parameter Name="Original_CodTagFase" Type="String"></asp:Parameter>
|
||||
</DeleteParameters>
|
||||
<InsertParameters>
|
||||
<asp:Parameter Name="gruppo" Type="String" />
|
||||
<asp:Parameter Name="descrGruppo" Type="String" />
|
||||
<asp:Parameter Name="codExt" Type="String" />
|
||||
<asp:Parameter Name="exportEnab" Type="Boolean" />
|
||||
<asp:Parameter Name="CodTagFase" Type="String"></asp:Parameter>
|
||||
<asp:Parameter Name="Descrizione" Type="String"></asp:Parameter>
|
||||
<asp:Parameter Name="Enabled" Type="Boolean"></asp:Parameter>
|
||||
<asp:Parameter Name="CodGruppo" Type="String"></asp:Parameter>
|
||||
</InsertParameters>
|
||||
<UpdateParameters>
|
||||
<asp:Parameter Name="gruppo" Type="String" />
|
||||
<asp:Parameter Name="descrGruppo" Type="String" />
|
||||
<asp:Parameter Name="codExt" Type="String" />
|
||||
<asp:Parameter Name="exportEnab" Type="Boolean" />
|
||||
<asp:Parameter Name="Original_gruppo" Type="String" />
|
||||
<asp:Parameter Name="CodTagFase" Type="String"></asp:Parameter>
|
||||
<asp:Parameter Name="Descrizione" Type="String"></asp:Parameter>
|
||||
<asp:Parameter Name="Enabled" Type="Boolean"></asp:Parameter>
|
||||
<asp:Parameter Name="CodGruppo" Type="String"></asp:Parameter>
|
||||
<asp:Parameter Name="Original_CodTagFase" Type="String"></asp:Parameter>
|
||||
</UpdateParameters>
|
||||
|
||||
</asp:ObjectDataSource>
|
||||
<asp:Label ID="lblNumRec" runat="server" CssClass="txtMini" />
|
||||
</div>
|
||||
|
||||
@@ -12,22 +12,25 @@ namespace GPW_Admin.WebUserControls
|
||||
{
|
||||
public partial class cmp_gestTagFasi : BaseUserControl
|
||||
{
|
||||
#region Public Properties
|
||||
#region Public Methods
|
||||
|
||||
public string gruppoSel
|
||||
public void doUpdate()
|
||||
{
|
||||
get
|
||||
{
|
||||
string answ = "";
|
||||
if (grView.SelectedIndex >= 0)
|
||||
{
|
||||
answ = $"{grView.SelectedValue}";
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
grView.PageSize = utils.pageSize;
|
||||
grView.DataBind();
|
||||
}
|
||||
|
||||
#endregion Public Properties
|
||||
/// <summary>
|
||||
/// resetta la selezione dei valori in caso di modifiche su altri controlli
|
||||
/// </summary>
|
||||
public void resetSelezione()
|
||||
{
|
||||
grView.SelectedIndex = -1;
|
||||
grView.DataBind();
|
||||
raiseReset();
|
||||
}
|
||||
|
||||
#endregion Public Methods
|
||||
|
||||
#region Protected Methods
|
||||
|
||||
@@ -38,7 +41,7 @@ namespace GPW_Admin.WebUserControls
|
||||
/// <param name="e"></param>
|
||||
protected void btnNew_Click(object sender, EventArgs e)
|
||||
{
|
||||
DataProxy.DP.taGruppi.insertQuery("_New GROUP", "Descrizione", "", true);
|
||||
DataProxy.DP.taATF.insertQuery("NEW TAG", "Descrizione", true, "");
|
||||
resetSelezione();
|
||||
}
|
||||
|
||||
@@ -149,65 +152,5 @@ namespace GPW_Admin.WebUserControls
|
||||
}
|
||||
|
||||
#endregion Protected Methods
|
||||
|
||||
#region Public Methods
|
||||
|
||||
/// <summary>
|
||||
/// determina se sia eliminabile il record (=non usato)
|
||||
/// </summary>
|
||||
/// <param name="idxMaker"></param>
|
||||
/// <returns></returns>
|
||||
public bool delEnabled(object gruppo)
|
||||
{
|
||||
bool answ = true;
|
||||
// solo se ha diritti scrittura controllo
|
||||
if (gruppo != null)
|
||||
{
|
||||
answ = !hasChildObj($"{gruppo}");
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
|
||||
public void doUpdate()
|
||||
{
|
||||
grView.PageSize = utils.pageSize;
|
||||
grView.DataBind();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Determina se abbia child obj --> NON eliminabile
|
||||
/// </summary>
|
||||
/// <param name="gruppo"></param>
|
||||
/// <returns></returns>
|
||||
public bool hasChildObj(string gruppo)
|
||||
{
|
||||
bool answ = false;
|
||||
string redKey = memLayer.ML.redHash($"gruppoHasChildObj:{gruppo}");
|
||||
// cerco inc ache redis...
|
||||
string rawData = memLayer.ML.getRSV(redKey);
|
||||
if (rawData == null)
|
||||
{
|
||||
int trovati = DataProxy.DP.taVSD.getByGruppo(gruppo, false).Rows.Count;
|
||||
answ = (trovati > 0);
|
||||
memLayer.ML.setRSV(redKey, $"{answ}", 60 * 5);
|
||||
}
|
||||
else
|
||||
{
|
||||
bool.TryParse(rawData, out answ);
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// resetta la selezione dei valori in caso di modifiche su altri controlli
|
||||
/// </summary>
|
||||
public void resetSelezione()
|
||||
{
|
||||
grView.SelectedIndex = -1;
|
||||
grView.DataBind();
|
||||
raiseReset();
|
||||
}
|
||||
|
||||
#endregion Public Methods
|
||||
}
|
||||
}
|
||||
Generated
+19
-12
@@ -39869,6 +39869,7 @@ SELECT IdxRegMal, DtInizio, NumGG, CodCert FROM RegistroMalattie WHERE (IdxRegMa
|
||||
this._commandCollection[3].CommandText = "dbo.stp_ATF_updateQuery";
|
||||
this._commandCollection[3].CommandType = global::System.Data.CommandType.StoredProcedure;
|
||||
this._commandCollection[3].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@RETURN_VALUE", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.ReturnValue, 10, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
|
||||
this._commandCollection[3].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@CodTagFase", global::System.Data.SqlDbType.NVarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
|
||||
this._commandCollection[3].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Descrizione", global::System.Data.SqlDbType.NVarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
|
||||
this._commandCollection[3].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Enabled", global::System.Data.SqlDbType.Bit, 1, global::System.Data.ParameterDirection.Input, 1, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
|
||||
this._commandCollection[3].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@CodGruppo", global::System.Data.SqlDbType.NVarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
|
||||
@@ -39976,31 +39977,37 @@ SELECT IdxRegMal, DtInizio, NumGG, CodCert FROM RegistroMalattie WHERE (IdxRegMa
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
|
||||
[global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
|
||||
public virtual int updateQuery(string Descrizione, global::System.Nullable<bool> Enabled, string CodGruppo, string Original_CodTagFase) {
|
||||
public virtual int updateQuery(string CodTagFase, string Descrizione, global::System.Nullable<bool> Enabled, string CodGruppo, string Original_CodTagFase) {
|
||||
global::System.Data.SqlClient.SqlCommand command = this.CommandCollection[3];
|
||||
if ((Descrizione == null)) {
|
||||
if ((CodTagFase == null)) {
|
||||
command.Parameters[1].Value = global::System.DBNull.Value;
|
||||
}
|
||||
else {
|
||||
command.Parameters[1].Value = ((string)(Descrizione));
|
||||
command.Parameters[1].Value = ((string)(CodTagFase));
|
||||
}
|
||||
if ((Enabled.HasValue == true)) {
|
||||
command.Parameters[2].Value = ((bool)(Enabled.Value));
|
||||
}
|
||||
else {
|
||||
if ((Descrizione == null)) {
|
||||
command.Parameters[2].Value = global::System.DBNull.Value;
|
||||
}
|
||||
if ((CodGruppo == null)) {
|
||||
command.Parameters[3].Value = global::System.DBNull.Value;
|
||||
else {
|
||||
command.Parameters[2].Value = ((string)(Descrizione));
|
||||
}
|
||||
if ((Enabled.HasValue == true)) {
|
||||
command.Parameters[3].Value = ((bool)(Enabled.Value));
|
||||
}
|
||||
else {
|
||||
command.Parameters[3].Value = ((string)(CodGruppo));
|
||||
command.Parameters[3].Value = global::System.DBNull.Value;
|
||||
}
|
||||
if ((Original_CodTagFase == null)) {
|
||||
if ((CodGruppo == null)) {
|
||||
command.Parameters[4].Value = global::System.DBNull.Value;
|
||||
}
|
||||
else {
|
||||
command.Parameters[4].Value = ((string)(Original_CodTagFase));
|
||||
command.Parameters[4].Value = ((string)(CodGruppo));
|
||||
}
|
||||
if ((Original_CodTagFase == null)) {
|
||||
command.Parameters[5].Value = global::System.DBNull.Value;
|
||||
}
|
||||
else {
|
||||
command.Parameters[5].Value = ((string)(Original_CodTagFase));
|
||||
}
|
||||
global::System.Data.ConnectionState previousConnectionState = command.Connection.State;
|
||||
if (((command.Connection.State & global::System.Data.ConnectionState.Open)
|
||||
|
||||
@@ -3647,6 +3647,7 @@ FROM v_AnagTagFasi</CommandText>
|
||||
<CommandText>dbo.stp_ATF_updateQuery</CommandText>
|
||||
<Parameters>
|
||||
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DataTypeServer="int" DbType="Int32" Direction="ReturnValue" ParameterName="@RETURN_VALUE" Precision="10" ProviderType="Int" Scale="0" Size="4" SourceColumnNullMapping="false" SourceVersion="Current" />
|
||||
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DataTypeServer="nvarchar" DbType="String" Direction="Input" ParameterName="@CodTagFase" Precision="0" ProviderType="NVarChar" Scale="0" Size="50" SourceColumnNullMapping="false" SourceVersion="Current" />
|
||||
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DataTypeServer="nvarchar" DbType="String" Direction="Input" ParameterName="@Descrizione" Precision="0" ProviderType="NVarChar" Scale="0" Size="50" SourceColumnNullMapping="false" SourceVersion="Current" />
|
||||
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DataTypeServer="bit" DbType="Boolean" Direction="Input" ParameterName="@Enabled" Precision="1" ProviderType="Bit" Scale="0" Size="1" SourceColumnNullMapping="false" SourceVersion="Current" />
|
||||
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DataTypeServer="nvarchar" DbType="String" Direction="Input" ParameterName="@CodGruppo" Precision="0" ProviderType="NVarChar" Scale="0" Size="50" SourceColumnNullMapping="false" SourceVersion="Current" />
|
||||
|
||||
@@ -27,6 +27,7 @@ namespace GPW_data
|
||||
public static DataProxy DP = new DataProxy();
|
||||
|
||||
public DS_ApplicazioneTableAdapters.AnagFasiTableAdapter taAF;
|
||||
public DS_ApplicazioneTableAdapters.AnagTagFasiTableAdapter taATF;
|
||||
public DS_UtilityTableAdapters.AnagKeyValueTableAdapter taAKV;
|
||||
public DS_ApplicazioneTableAdapters.AnagDevicesTableAdapter taAnagDev;
|
||||
public DS_ApplicazioneTableAdapters.AnagClientiTableAdapter taAnCli;
|
||||
@@ -192,6 +193,7 @@ namespace GPW_data
|
||||
taDip2Ruoli = new DS_ApplicazioneTableAdapters.Dipendenti2RuoliTableAdapter();
|
||||
taAP = new DS_ApplicazioneTableAdapters.AnagProgettiTableAdapter();
|
||||
taAF = new DS_ApplicazioneTableAdapters.AnagFasiTableAdapter();
|
||||
taATF = new DS_ApplicazioneTableAdapters.AnagTagFasiTableAdapter();
|
||||
taLCU = new DS_ApplicazioneTableAdapters.v_logCommUtTableAdapter();
|
||||
taRA = new DS_ApplicazioneTableAdapters.RegAttivitaTableAdapter();
|
||||
taRAExpl = new DS_ApplicazioneTableAdapters.regAttDayExplTableAdapter();
|
||||
@@ -233,6 +235,7 @@ namespace GPW_data
|
||||
taDip2Ruoli.Connection.ConnectionString = connGPW;
|
||||
taAP.Connection.ConnectionString = connGPW;
|
||||
taAF.Connection.ConnectionString = connGPW;
|
||||
taATF.Connection.ConnectionString = connGPW;
|
||||
taLCU.Connection.ConnectionString = connGPW;
|
||||
taRA.Connection.ConnectionString = connGPW;
|
||||
taRAExpl.Connection.ConnectionString = connGPW;
|
||||
|
||||
Reference in New Issue
Block a user