abbozzata gestione deroga/rimozione deroga (va creato attributo e creata/testata)

This commit is contained in:
Samuele E. Locatelli
2015-06-30 19:19:10 +02:00
parent cb1c03703b
commit 2de85e5fa4
13 changed files with 104 additions and 32 deletions
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+46 -24
View File
@@ -87,7 +87,7 @@ namespace GMW.WebUserControls
{
case tipoCodiceBarcode.Comando:
// verifico se contenga uno dei 3 tipi di selezione operativa...
string RNC_Mode = barcodeIn.Replace(memLayer.ML.confReadString("prefComandi"),"");
string RNC_Mode = barcodeIn.Replace(memLayer.ML.confReadString("prefComandi"), "");
if (RNC_Mode != "")
{
Response.Redirect(string.Format("{0}?RNC_Mode={1}", user_std.pagCorrente, RNC_Mode));
@@ -95,29 +95,24 @@ namespace GMW.WebUserControls
doUpdate();
break;
case tipoCodiceBarcode.UDC:
// verifico UDC
//if (checkUDC(barcodeIn))
//{
// string AL = "";
// // recupero da UDC
// try
// {
// AL = MagClass.magazzino.taAL2UDC.getByUDC(barcodeIn)[0].AL;
// }
// catch
// {
// Postazione.warningText = traduci("ErroreUdcNonAl");
// Postazione.CssClass = "stileComandoKo";
// }
// if (AL != "")
// {
// // verifico AL
// if (checkAL(AL))
// {
// sourceAL = AL;
// }
// }
//}
// verifico UDC a seconda di azione richiesta...
string attrRes = "";
string attr2chk = "";
if (memLayer.ML.QSS("RNC_Mode") == "rem")
{
attrRes = "NC";
attr2chk = "DE";
}
else
{
attrRes = "DE";
attr2chk = "NC";
}
if (checkUDC(barcodeIn, attrRes, attr2chk))
{
// proseguo assegnado/togliendo attributo...
// !!!FARE!!!
}
doUpdate();
break;
default:
@@ -146,5 +141,32 @@ namespace GMW.WebUserControls
txtBarcode.Focus();
}
/// <summary>
/// Verifica l'UDC se sia ok x procedere:
/// - esista
/// - abbia una NC (successiva all'ultima DElibera)
/// </summary>
/// <param name="UDC"></param>
/// <param name="AttrRes"></param>
/// <param name="AttrCheck"></param>
/// <returns></returns>
protected bool checkUDC(string UDC, string AttrRes, string AttrCheck)
{
bool answ = false;
//faccio 3 controlli...
bool udcOk = MagClass.magazzino.checkUDC(UDC);
bool udcHasNC = (DataProxy.obj.taUDC2NC.getNcPending(UDC, AttrRes, AttrCheck).Rows.Count > 0);
// condizioni tutte soddisfatte?
answ = (udcOk && udcHasNC);
if (!answ)
{
Postazione.warningText = traduci("ErroreUdcRNC");
}
else
{
Postazione.warningText = "";
}
return answ;
}
}
}
BIN
View File
Binary file not shown.
Binary file not shown.
Binary file not shown.
+42 -5
View File
@@ -27017,7 +27017,7 @@ SELECT IdxNC, CodNC, DescrNC, TipoCart, DataFrom, DataTo, SearchNote, DtCreaz, I
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
private void InitCommandCollection() {
this._commandCollection = new global::System.Data.SqlClient.SqlCommand[4];
this._commandCollection = new global::System.Data.SqlClient.SqlCommand[5];
this._commandCollection[0] = new global::System.Data.SqlClient.SqlCommand();
this._commandCollection[0].Connection = this.Connection;
this._commandCollection[0].CommandText = "SELECT *\r\nFROM v_UDC_NC";
@@ -27041,12 +27041,20 @@ SELECT IdxNC, CodNC, DescrNC, TipoCart, DataFrom, DataTo, SearchNote, DtCreaz, I
this._commandCollection[2].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@IdxNC", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.Input, 10, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
this._commandCollection[3] = new global::System.Data.SqlClient.SqlCommand();
this._commandCollection[3].Connection = this.Connection;
this._commandCollection[3].CommandText = "dbo.stp_ENC2U_toggle";
this._commandCollection[3].CommandText = "dbo.stp_ENC2U_getNcPending";
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("@IdxNC", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.Input, 10, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
this._commandCollection[3].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@UDC", 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("@IsSel", 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("@attrRes", global::System.Data.SqlDbType.NVarChar, 2, 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("@attr2chk", global::System.Data.SqlDbType.NVarChar, 2, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
this._commandCollection[4] = new global::System.Data.SqlClient.SqlCommand();
this._commandCollection[4].Connection = this.Connection;
this._commandCollection[4].CommandText = "dbo.stp_ENC2U_toggle";
this._commandCollection[4].CommandType = global::System.Data.CommandType.StoredProcedure;
this._commandCollection[4].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[4].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@IdxNC", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.Input, 10, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
this._commandCollection[4].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@UDC", global::System.Data.SqlDbType.NVarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
this._commandCollection[4].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@IsSel", global::System.Data.SqlDbType.Bit, 1, global::System.Data.ParameterDirection.Input, 1, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", ""));
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
@@ -27137,11 +27145,40 @@ SELECT IdxNC, CodNC, DescrNC, TipoCart, DataFrom, DataTo, SearchNote, DtCreaz, I
return dataTable;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
[global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
[global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Select, false)]
public virtual DS_Applicazione.UDC_NCDataTable getNcPending(string UDC, string attrRes, string attr2chk) {
this.Adapter.SelectCommand = this.CommandCollection[3];
if ((UDC == null)) {
this.Adapter.SelectCommand.Parameters[1].Value = global::System.DBNull.Value;
}
else {
this.Adapter.SelectCommand.Parameters[1].Value = ((string)(UDC));
}
if ((attrRes == null)) {
this.Adapter.SelectCommand.Parameters[2].Value = global::System.DBNull.Value;
}
else {
this.Adapter.SelectCommand.Parameters[2].Value = ((string)(attrRes));
}
if ((attr2chk == null)) {
this.Adapter.SelectCommand.Parameters[3].Value = global::System.DBNull.Value;
}
else {
this.Adapter.SelectCommand.Parameters[3].Value = ((string)(attr2chk));
}
DS_Applicazione.UDC_NCDataTable dataTable = new DS_Applicazione.UDC_NCDataTable();
this.Adapter.Fill(dataTable);
return dataTable;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
[global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
public virtual int toggleSel(global::System.Nullable<int> IdxNC, string UDC, global::System.Nullable<bool> IsSel) {
global::System.Data.SqlClient.SqlCommand command = this.CommandCollection[3];
global::System.Data.SqlClient.SqlCommand command = this.CommandCollection[4];
if ((IdxNC.HasValue == true)) {
command.Parameters[1].Value = ((int)(IdxNC.Value));
}
+14 -1
View File
@@ -4,7 +4,7 @@
<xs:appinfo source="urn:schemas-microsoft-com:xml-msdatasource">
<DataSource DefaultConnectionIndex="0" FunctionsComponentName="SPF" GeneratorFunctionsComponentClassName="SPF" Modifier="AutoLayout, AnsiClass, Class, Public" SchemaSerializationMode="IncludeSchema" UserFunctionsComponentName="SPF" xmlns="urn:schemas-microsoft-com:xml-msdatasource">
<Connections>
<Connection AppSettingsObjectName="Settings" AppSettingsPropertyName="GMWConnectionString" IsAppSettingsProperty="true" Modifier="Assembly" Name="GMWConnectionString (Settings)" ParameterPrefix="@" PropertyReference="ApplicationSettings.GMW_data.Properties.Settings.GlobalReference.Default.GMWConnectionString" Provider="System.Data.SqlClient" />
<Connection AppSettingsObjectName="Settings" AppSettingsPropertyName="GMWConnectionString" ConnectionStringObject="" IsAppSettingsProperty="true" Modifier="Assembly" Name="GMWConnectionString (Settings)" ParameterPrefix="@" PropertyReference="ApplicationSettings.GMW_data.Properties.Settings.GlobalReference.Default.GMWConnectionString" Provider="System.Data.SqlClient" />
</Connections>
<Tables>
<TableAdapter BaseClass="System.ComponentModel.Component" DataAccessorModifier="AutoLayout, AnsiClass, Class, Public" DataAccessorName="AnagStatiTableAdapter" GeneratorDataComponentClassName="AnagStatiTableAdapter" Name="AnagStati" UserDataComponentName="AnagStatiTableAdapter">
@@ -2057,6 +2057,19 @@ FROM v_UDC_NC</CommandText>
</DbCommand>
</SelectCommand>
</DbSource>
<DbSource ConnectionRef="GMWConnectionString (Settings)" DbObjectName="TK_GMW.dbo.stp_ENC2U_getNcPending" DbObjectType="StoredProcedure" GenerateMethods="Get" GenerateShortCommands="true" GeneratorGetMethodName="getNcPending" GetMethodModifier="Public" GetMethodName="getNcPending" QueryType="Rowset" ScalarCallRetval="System.Object, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="true" UserGetMethodName="getNcPending" UserSourceName="getNcPending">
<SelectCommand>
<DbCommand CommandType="StoredProcedure" ModifiedByUser="false">
<CommandText>dbo.stp_ENC2U_getNcPending</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="@UDC" Precision="0" ProviderType="NVarChar" Scale="0" Size="50" SourceColumnNullMapping="false" SourceVersion="Current" />
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DataTypeServer="nvarchar" DbType="String" Direction="Input" ParameterName="@attrRes" Precision="0" ProviderType="NVarChar" Scale="0" Size="2" SourceColumnNullMapping="false" SourceVersion="Current" />
<Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DataTypeServer="nvarchar" DbType="String" Direction="Input" ParameterName="@attr2chk" Precision="0" ProviderType="NVarChar" Scale="0" Size="2" SourceColumnNullMapping="false" SourceVersion="Current" />
</Parameters>
</DbCommand>
</SelectCommand>
</DbSource>
<DbSource ConnectionRef="GMWConnectionString (Settings)" DbObjectName="TK_GMW.dbo.stp_ENC2U_toggle" DbObjectType="StoredProcedure" GenerateShortCommands="true" GeneratorSourceName="toggleSel" Modifier="Public" Name="toggleSel" QueryType="NoData" ScalarCallRetval="System.Object, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="true" UserGetMethodName="GetDataBy" UserSourceName="toggleSel">
<SelectCommand>
<DbCommand CommandType="StoredProcedure" ModifiedByUser="false">
+2 -2
View File
@@ -27,8 +27,8 @@
<Shape ID="DesignTable:stp_prtCartLiquidiF18ByUDC" ZOrder="9" X="291" Y="196" Height="147" Width="158" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="79" />
<Shape ID="DesignTable:v_RapQualNote" ZOrder="7" X="85" Y="1082" Height="343" Width="300" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="254" />
<Shape ID="DesignTable:ElencoNC" ZOrder="3" X="809" Y="894" Height="400" Width="291" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="197" />
<Shape ID="DesignTable:UDC_NC" ZOrder="2" X="446" Y="1130" Height="324" Width="300" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="216" />
<Shape ID="DesignTable:UNC_tree" ZOrder="1" X="1164" Y="1294" Height="172" Width="228" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="83" />
<Shape ID="DesignTable:UDC_NC" ZOrder="1" X="446" Y="1130" Height="343" Width="300" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="216" />
<Shape ID="DesignTable:UNC_tree" ZOrder="2" X="1164" Y="1294" Height="172" Width="228" AdapterExpanded="true" DataTableExpanded="true" OldAdapterHeight="0" OldDataTableHeight="0" SplitterPosition="83" />
</Shapes>
<Connectors>
<Connector ID="DesignRelation:FK_AnagImpianti_AnagCompanySito" ZOrder="28" LineWidth="11">