diff --git a/MP-ADM/BaseUserControl.cs b/MP-ADM/BaseUserControl.cs index 192963ad..5000f88c 100644 --- a/MP-ADM/BaseUserControl.cs +++ b/MP-ADM/BaseUserControl.cs @@ -147,6 +147,18 @@ namespace MP_ADM #region Public Methods + /// + /// Conversione a bool del valore + /// + /// + /// + public bool getBool(object value) + { + bool answ = false; + bool.TryParse(value.ToString(), out answ); + return answ; + } + /// /// formatta in minuti/sec partendo da min.cent /// diff --git a/MP-ADM/WebUserControls/cmp_TechSheetArt.ascx b/MP-ADM/WebUserControls/cmp_TechSheetArt.ascx index c0bf2636..bc6d61d7 100644 --- a/MP-ADM/WebUserControls/cmp_TechSheetArt.ascx +++ b/MP-ADM/WebUserControls/cmp_TechSheetArt.ascx @@ -1,12 +1,29 @@ <%@ Control Language="C#" AutoEventWireup="true" CodeBehind="cmp_TechSheetArt.ascx.cs" Inherits="MP_ADM.WebUserControls.cmp_TechSheetArt" %> -
-
- Ricerca articolo +
+
+
+
+ Ricerca [ALT-T] +
+ +
+ +
+
- -
- +
+ + + + +
+
+ NUOVA + Approva +
+
+ cod art + btnNew
@@ -34,11 +51,18 @@ <%-- --%> + + + + + + +
\ No newline at end of file diff --git a/MP-ADM/WebUserControls/cmp_TechSheetArt.ascx.cs b/MP-ADM/WebUserControls/cmp_TechSheetArt.ascx.cs index 1b1d6fe2..0ff2544d 100644 --- a/MP-ADM/WebUserControls/cmp_TechSheetArt.ascx.cs +++ b/MP-ADM/WebUserControls/cmp_TechSheetArt.ascx.cs @@ -26,11 +26,35 @@ namespace MP_ADM.WebUserControls #endregion Public Properties + #region Private Methods + + private void checkVisibility() + { + bool selected = grView.SelectedIndex >= 0; + lbtAddNew.Visible = !selected; + lbtApprove.Visible = selected; + // se selezionato --> verifico stato + if (selected) + { + bool doShow = false; + var tabSTA = DataLayerObj.taSTA.getByKey(IdxStSel); + if (tabSTA.Rows.Count > 0) + { + doShow = !tabSTA[0].IsValidated; + } + // controllo ANCHE che NON sia stato già approvato... + lbtApprove.Visible = doShow; + } + } + + #endregion Private Methods + #region Protected Methods protected void grView_SelectedIndexChanged(object sender, EventArgs e) { raiseSelNew(); + checkVisibility(); } /// @@ -41,6 +65,7 @@ namespace MP_ADM.WebUserControls protected void lbtReset_Click(object sender, EventArgs e) { resetSelezione(); + checkVisibility(); } protected void lbtSearchReset_Click(object sender, EventArgs e) @@ -50,6 +75,7 @@ namespace MP_ADM.WebUserControls protected void Page_Load(object sender, EventArgs e) { + checkVisibility(); } protected void txtSearchArt_TextChanged(object sender, EventArgs e) diff --git a/MP-ADM/WebUserControls/cmp_TechSheetArt.ascx.designer.cs b/MP-ADM/WebUserControls/cmp_TechSheetArt.ascx.designer.cs index 7c4e11cb..fe509837 100644 --- a/MP-ADM/WebUserControls/cmp_TechSheetArt.ascx.designer.cs +++ b/MP-ADM/WebUserControls/cmp_TechSheetArt.ascx.designer.cs @@ -32,6 +32,42 @@ namespace MP_ADM.WebUserControls /// protected global::System.Web.UI.WebControls.LinkButton lbtSearchReset; + /// + /// Controllo ddlTipo. + /// + /// + /// Campo generato automaticamente. + /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. + /// + protected global::System.Web.UI.WebControls.DropDownList ddlTipo; + + /// + /// Controllo odsTipo. + /// + /// + /// Campo generato automaticamente. + /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. + /// + protected global::System.Web.UI.WebControls.ObjectDataSource odsTipo; + + /// + /// Controllo lbtAddNew. + /// + /// + /// Campo generato automaticamente. + /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. + /// + protected global::System.Web.UI.WebControls.LinkButton lbtAddNew; + + /// + /// Controllo lbtApprove. + /// + /// + /// Campo generato automaticamente. + /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. + /// + protected global::System.Web.UI.WebControls.LinkButton lbtApprove; + /// /// Controllo grView. /// diff --git a/MapoDb/DS_SheetTech.Designer.cs b/MapoDb/DS_SheetTech.Designer.cs index a31a7678..19827126 100644 --- a/MapoDb/DS_SheetTech.Designer.cs +++ b/MapoDb/DS_SheetTech.Designer.cs @@ -538,6 +538,10 @@ namespace MapoDb { private global::System.Data.DataColumn columnDescTempl; + private global::System.Data.DataColumn columnUserLogin; + + private global::System.Data.DataColumn columnIsValidated; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] public ST_ActualDataTable() { @@ -627,6 +631,22 @@ namespace MapoDb { } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] + public global::System.Data.DataColumn UserLoginColumn { + get { + return this.columnUserLogin; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] + public global::System.Data.DataColumn IsValidatedColumn { + get { + return this.columnIsValidated; + } + } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] [global::System.ComponentModel.Browsable(false)] @@ -664,7 +684,7 @@ namespace MapoDb { [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] - public ST_ActualRow AddST_ActualRow(ST_TemplateRow parentST_TemplateRowByST_Template_ST_Actual, string CodArticolo, int MatrOpr, System.DateTime DtMod, string DescArticolo, string DescTempl) { + public ST_ActualRow AddST_ActualRow(ST_TemplateRow parentST_TemplateRowByST_Template_ST_Actual, string CodArticolo, int MatrOpr, System.DateTime DtMod, string DescArticolo, string DescTempl, string UserLogin, bool IsValidated) { ST_ActualRow rowST_ActualRow = ((ST_ActualRow)(this.NewRow())); object[] columnValuesArray = new object[] { null, @@ -673,7 +693,9 @@ namespace MapoDb { MatrOpr, DtMod, DescArticolo, - DescTempl}; + DescTempl, + UserLogin, + IsValidated}; if ((parentST_TemplateRowByST_Template_ST_Actual != null)) { columnValuesArray[1] = parentST_TemplateRowByST_Template_ST_Actual[0]; } @@ -713,6 +735,8 @@ namespace MapoDb { this.columnDtMod = base.Columns["DtMod"]; this.columnDescArticolo = base.Columns["DescArticolo"]; this.columnDescTempl = base.Columns["DescTempl"]; + this.columnUserLogin = base.Columns["UserLogin"]; + this.columnIsValidated = base.Columns["IsValidated"]; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] @@ -732,6 +756,10 @@ namespace MapoDb { base.Columns.Add(this.columnDescArticolo); this.columnDescTempl = new global::System.Data.DataColumn("DescTempl", typeof(string), null, global::System.Data.MappingType.Element); base.Columns.Add(this.columnDescTempl); + this.columnUserLogin = new global::System.Data.DataColumn("UserLogin", typeof(string), null, global::System.Data.MappingType.Element); + base.Columns.Add(this.columnUserLogin); + this.columnIsValidated = new global::System.Data.DataColumn("IsValidated", typeof(bool), null, global::System.Data.MappingType.Element); + base.Columns.Add(this.columnIsValidated); this.Constraints.Add(new global::System.Data.UniqueConstraint("Constraint1", new global::System.Data.DataColumn[] { this.columnIdxST}, true)); this.columnIdxST.AutoIncrement = true; @@ -750,6 +778,9 @@ namespace MapoDb { this.columnDescArticolo.MaxLength = 250; this.columnDescTempl.AllowDBNull = false; this.columnDescTempl.MaxLength = 250; + this.columnUserLogin.AllowDBNull = false; + this.columnUserLogin.MaxLength = 50; + this.columnIsValidated.AllowDBNull = false; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] @@ -3077,6 +3108,28 @@ namespace MapoDb { } } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] + public string UserLogin { + get { + return ((string)(this[this.tableST_Actual.UserLoginColumn])); + } + set { + this[this.tableST_Actual.UserLoginColumn] = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] + public bool IsValidated { + get { + return ((bool)(this[this.tableST_Actual.IsValidatedColumn])); + } + set { + this[this.tableST_Actual.IsValidatedColumn] = value; + } + } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] public ST_TemplateRow ST_TemplateRow { @@ -4105,6 +4158,8 @@ namespace MapoDb.DS_SheetTechTableAdapters { tableMapping.ColumnMappings.Add("DtMod", "DtMod"); tableMapping.ColumnMappings.Add("DescArticolo", "DescArticolo"); tableMapping.ColumnMappings.Add("DescTempl", "DescTempl"); + tableMapping.ColumnMappings.Add("UserLogin", "UserLogin"); + tableMapping.ColumnMappings.Add("IsValidated", "IsValidated"); this._adapter.TableMappings.Add(tableMapping); } @@ -4118,17 +4173,24 @@ namespace MapoDb.DS_SheetTechTableAdapters { [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] private void InitCommandCollection() { - this._commandCollection = new global::System.Data.SqlClient.SqlCommand[2]; + this._commandCollection = new global::System.Data.SqlClient.SqlCommand[3]; this._commandCollection[0] = new global::System.Data.SqlClient.SqlCommand(); this._commandCollection[0].Connection = this.Connection; this._commandCollection[0].CommandText = "SELECT *\r\nFROM v_ST_Actual"; this._commandCollection[0].CommandType = global::System.Data.CommandType.Text; this._commandCollection[1] = new global::System.Data.SqlClient.SqlCommand(); this._commandCollection[1].Connection = this.Connection; - this._commandCollection[1].CommandText = "dbo.stp_ST_A_getBySearch"; + this._commandCollection[1].CommandText = "dbo.stp_ST_A_getByKey"; this._commandCollection[1].CommandType = global::System.Data.CommandType.StoredProcedure; this._commandCollection[1].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[1].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@SearchCodArt", global::System.Data.SqlDbType.NVarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[1].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@IdxST", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.Input, 10, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[2] = new global::System.Data.SqlClient.SqlCommand(); + this._commandCollection[2].Connection = this.Connection; + this._commandCollection[2].CommandText = "dbo.stp_ST_A_getBySearch"; + this._commandCollection[2].CommandType = global::System.Data.CommandType.StoredProcedure; + this._commandCollection[2].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[2].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@SearchCodArt", global::System.Data.SqlDbType.NVarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[2].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@CodTempl", global::System.Data.SqlDbType.NVarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] @@ -4159,14 +4221,37 @@ namespace MapoDb.DS_SheetTechTableAdapters { [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Select, false)] - public virtual DS_SheetTech.ST_ActualDataTable getBySearchArt(string SearchCodArt) { + public virtual DS_SheetTech.ST_ActualDataTable getByKey(global::System.Nullable IdxST) { this.Adapter.SelectCommand = this.CommandCollection[1]; + if ((IdxST.HasValue == true)) { + this.Adapter.SelectCommand.Parameters[1].Value = ((int)(IdxST.Value)); + } + else { + this.Adapter.SelectCommand.Parameters[1].Value = global::System.DBNull.Value; + } + DS_SheetTech.ST_ActualDataTable dataTable = new DS_SheetTech.ST_ActualDataTable(); + this.Adapter.Fill(dataTable); + return dataTable; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "16.0.0.0")] + [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] + [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Select, false)] + public virtual DS_SheetTech.ST_ActualDataTable getBySearchArt(string SearchCodArt, string CodTempl) { + this.Adapter.SelectCommand = this.CommandCollection[2]; if ((SearchCodArt == null)) { this.Adapter.SelectCommand.Parameters[1].Value = global::System.DBNull.Value; } else { this.Adapter.SelectCommand.Parameters[1].Value = ((string)(SearchCodArt)); } + if ((CodTempl == null)) { + this.Adapter.SelectCommand.Parameters[2].Value = global::System.DBNull.Value; + } + else { + this.Adapter.SelectCommand.Parameters[2].Value = ((string)(CodTempl)); + } DS_SheetTech.ST_ActualDataTable dataTable = new DS_SheetTech.ST_ActualDataTable(); this.Adapter.Fill(dataTable); return dataTable; diff --git a/MapoDb/DS_SheetTech.xsd b/MapoDb/DS_SheetTech.xsd index 29c011cf..f5caa0b9 100644 --- a/MapoDb/DS_SheetTech.xsd +++ b/MapoDb/DS_SheetTech.xsd @@ -9,7 +9,7 @@ - + SELECT * @@ -27,8 +27,21 @@ FROM v_ST_Actual + + + + + + dbo.stp_ST_A_getByKey + + + + + + + @@ -36,6 +49,7 @@ FROM v_ST_Actual + @@ -559,7 +573,7 @@ SELECT CodTempl, Label, Oggetto, Num, CodGruppo, CodTipo, Value, CheckType, Requ - + @@ -593,10 +607,18 @@ SELECT CodTempl, Label, Oggetto, Num, CodGruppo, CodTipo, Value, CheckType, Requ + + + + + + + + - + @@ -669,7 +691,7 @@ SELECT CodTempl, Label, Oggetto, Num, CodGruppo, CodTipo, Value, CheckType, Requ - + @@ -709,7 +731,7 @@ SELECT CodTempl, Label, Oggetto, Num, CodGruppo, CodTipo, Value, CheckType, Requ - + @@ -730,7 +752,7 @@ SELECT CodTempl, Label, Oggetto, Num, CodGruppo, CodTipo, Value, CheckType, Requ - + @@ -750,7 +772,7 @@ SELECT CodTempl, Label, Oggetto, Num, CodGruppo, CodTipo, Value, CheckType, Requ - + @@ -770,7 +792,7 @@ SELECT CodTempl, Label, Oggetto, Num, CodGruppo, CodTipo, Value, CheckType, Requ - + @@ -869,11 +891,11 @@ SELECT CodTempl, Label, Oggetto, Num, CodGruppo, CodTipo, Value, CheckType, Requ - - - - - + + + + + \ No newline at end of file diff --git a/MapoDb/DS_SheetTech.xss b/MapoDb/DS_SheetTech.xss index a48aaa0a..5fddff0d 100644 --- a/MapoDb/DS_SheetTech.xss +++ b/MapoDb/DS_SheetTech.xss @@ -4,10 +4,10 @@ Changes to this file may cause incorrect behavior and will be lost if the code is regenerated. --> - + - - + + @@ -18,12 +18,12 @@ - 455 - 734 + 452 + 724 - 455 - 789 + 452 + 805 @@ -67,15 +67,15 @@ - + 727 - 564 + 547 - 615 - 564 + 643 + 547 diff --git a/MapoDb/DataLayer.cs b/MapoDb/DataLayer.cs index 15d1b40e..994d5a5c 100644 --- a/MapoDb/DataLayer.cs +++ b/MapoDb/DataLayer.cs @@ -75,6 +75,7 @@ namespace MapoDb public DS_UtilityTableAdapters.v_selMacchineTableAdapter taSelMacc; public DS_UtilityTableAdapters.v_selODLTableAdapter taSelOdlFree; public DS_applicazioneTableAdapters.SignalLogTableAdapter taSigLog; + public DS_SheetTechTableAdapters.ST_ActualTableAdapter taSTA; public DS_SheetTechTableAdapters.ST_ActualRowTableAdapter taSTAR; public DS_applicazioneTableAdapters.DiarioDiBordoTableAdapter taStati; public DS_applicazioneTableAdapters.StatoMacchineTableAdapter taStatoMacchine; @@ -527,6 +528,7 @@ namespace MapoDb taSelMacc = new DS_UtilityTableAdapters.v_selMacchineTableAdapter(); taSelOdlFree = new DS_UtilityTableAdapters.v_selODLTableAdapter(); taSigLog = new DS_applicazioneTableAdapters.SignalLogTableAdapter(); + taSTA = new DS_SheetTechTableAdapters.ST_ActualTableAdapter(); taSTAR = new DS_SheetTechTableAdapters.ST_ActualRowTableAdapter(); taStati = new DS_applicazioneTableAdapters.DiarioDiBordoTableAdapter(); taStatoMacchine = new DS_applicazioneTableAdapters.StatoMacchineTableAdapter(); @@ -592,6 +594,7 @@ namespace MapoDb taSelMacc.Connection.ConnectionString = connectionString; taSelOdlFree.Connection.ConnectionString = connectionString; taSigLog.Connection.ConnectionString = connectionString; + taSTA.Connection.ConnectionString = connectionString; taSTAR.Connection.ConnectionString = connectionString; taStati.Connection.ConnectionString = connectionString; taStatoMacchine.Connection.ConnectionString = connectionString;