ok selezione lotti IN con ricerca a sx

This commit is contained in:
Samuele E. Locatelli
2020-03-14 11:57:49 +01:00
parent 0f3eacda75
commit 9a278554a8
10 changed files with 298 additions and 52 deletions
+1 -18
View File
@@ -6,22 +6,5 @@
<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
<div class="row m-0">
<div class="col-4 text-left">
Elenco Lotti IN
</div>
<div class="col-4 text-center">
<uc1:cmp_prtSemilav runat="server" id="cmp_prtSemilav" />
</div>
<div class="col-4 text-right">
Lotto OUT
<hr />
elenco UDC stampati? numero?
</div>
<div class="col-12 text-center">
note?
<br />
btn stampa
</div>
</div>
<uc1:cmp_prtSemilav runat="server" ID="cmp_prtSemilav" />
</asp:Content>
+1
View File
@@ -26,6 +26,7 @@
<add key="ttlPrintCount" value="5" />
<!--conf DB-->
<add key="MagDataConnectionString" value="Data Source=SQL2016DEV;Initial Catalog=MoonPro_MAG;Persist Security Info=True;User ID=sa;Password=keyhammer16;" />
<add key="DbConfConnectionString" value="Data Source=SQL2016DEV;Initial Catalog=MoonPro_MAG;Persist Security Info=True;User id=sa;Password=keyhammer16;" />
</appSettings>
<connectionStrings>
<add name="MagData.Properties.Settings.MoonPro_MAGConnectionString" connectionString="Data Source=SQL2016DEV;Initial Catalog=MoonPro_MAG;Persist Security Info=True;User ID=sa;Password=keyhammer16;" providerName="System.Data.SqlClient" />
+1 -1
View File
@@ -53,7 +53,7 @@
</div>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="CodStato" SortExpression="CodStato">
<asp:TemplateField HeaderText="Cod" SortExpression="CodStato">
<ItemTemplate>
<asp:Label ID="Label1" runat="server" Text='<%# Eval("CodStato") %>' ToolTip='<%# Eval("DescStato") %>' />
</ItemTemplate>
+1 -1
View File
@@ -45,7 +45,7 @@
</div>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="CodStato" SortExpression="CodStato">
<asp:TemplateField HeaderText="Cod" SortExpression="CodStato">
<ItemTemplate>
<asp:Label ID="Label1" runat="server" Text='<%# Eval("CodStato") %>' ToolTip='<%# Eval("DescStato") %>' />
</ItemTemplate>
+112 -4
View File
@@ -2,9 +2,117 @@
<%@ Register Src="~/WebUserControls/cmp_barcode.ascx" TagPrefix="uc1" TagName="cmp_barcode" %>
<div class="row m-0">
<div class="col-4 text-left">
<div class="card border border-info rounded">
<div class="card-header bg-info text-light">
<div class="row">
<div class="col-10">
<h5>Elenco Lotti IN</h5>
</div>
<div class="col-2">
<asp:LinkButton runat="server" ID="lbtResetLottoIn" CssClass="btn btn-dark" OnClick="lbtResetLottoIn_Click"><i class="fas fa-sync-alt"></i></asp:LinkButton>
</div>
</div>
</div>
<div class="card-body small px-0 py-1">
<asp:GridView ID="grViewLottoIn" runat="server" AutoGenerateColumns="False" DataKeyNames="Lotto" DataSourceID="odsLottiIn" CssClass="table table-striped table-condensed table-sm small" AllowPaging="True">
<HeaderStyle CssClass="default" />
<PagerStyle CssClass="active GridPager" />
<PagerSettings Mode="NumericFirstLast" />
<SelectedRowStyle CssClass="table-info" />
<EmptyDataTemplate>
Nessun Risultato
</EmptyDataTemplate>
<Columns>
<%--<asp:TemplateField ShowHeader="False">
<HeaderTemplate>
<asp:LinkButton ID="lbtReset" runat="server" OnClick="lbtReset_Click" CssClass="btn btn-sm btn-primary" Visible="true" ToolTip="Reset"><i class="fas fa-sync"></i></asp:LinkButton>
</HeaderTemplate>
<ItemTemplate>
<asp:LinkButton ID="lbtSel" runat="server" CausesValidation="False" CommandName="Select" Text="Seleziona" CssClass="btn btn-sm btn-info"><i class="fas fa-search"></i></asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>--%>
<asp:BoundField DataField="Lotto" HeaderText="Lotto" ReadOnly="True" SortExpression="Lotto" />
<asp:TemplateField HeaderText="Tipo" SortExpression="TipoLotto">
<ItemTemplate>
<asp:Label ID="Label3" runat="server" Text='<%# Eval("TipoLotto") %>' ToolTip='<%# Eval("Origine") %>' />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Articolo" SortExpression="CodArt">
<ItemTemplate>
<div class="row">
<div class="col-6 font-weight-bold">
<asp:Label ID="Label2" runat="server" Text='<%# Eval("CodArt") %>' />
</div>
<div class="col-6 text-right">
<asp:Label ID="Label4" runat="server" Text='<%# Eval("CodArtExt") %>' />
</div>
<div class="col-12 small">
<i>
<asp:Label ID="Label5" runat="server" Text='<%# Eval("DescrArt") %>' /></i>
</div>
</div>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Cod" SortExpression="CodStato">
<ItemTemplate>
<asp:Label ID="Label1" runat="server" Text='<%# Eval("CodStato") %>' ToolTip='<%# Eval("DescStato") %>' />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Data" SortExpression="DtCrea">
<ItemTemplate>
<div>
<asp:Label ID="Label7" runat="server" Text='<%# Eval("DtCrea", "{0:yyyy.MM.dd}") %>' />
</div>
<div class="small">
<i>
<asp:Label ID="Label8" runat="server" Text='<%# Eval("Note") %>' /></i>
</div>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Qta" SortExpression="QtaOrig">
<ItemTemplate>
<b>
<asp:Label ID="Label9" runat="server" Text='<%# Eval("QtaCurr", "{0:N0}") %>' /></b>
/
<asp:Label ID="Label6" runat="server" Text='<%# Eval("QtaOrig", "{0:N0}") %>' />
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="NumUdc" HeaderText="#" SortExpression="NumUdc" />
<asp:TemplateField HeaderText="Attivo" SortExpression="Attivo">
<ItemTemplate>
<asp:CheckBox ID="CheckBox1" runat="server" Checked='<%# Eval("Attivo") %>' Enabled="false" ToolTip='<%# Eval("DtMod", "mod: {0:yyyy.MM.dd HH:mm:ss}") %>' />
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
<asp:ObjectDataSource ID="odsLottiIn" runat="server" OldValuesParameterFormatString="original_{0}" SelectMethod="getByHashList" TypeName="MagData.DS_MagTableAdapters.ElencoLottiTableAdapter">
<SelectParameters>
<asp:ControlParameter ControlID="hfHashList" DefaultValue="#" Name="elLotti" PropertyName="Value" Type="String" />
</SelectParameters>
</asp:ObjectDataSource>
<asp:HiddenField runat="server" ID="hfHashList" />
</div>
</div>
<asp:HiddenField runat="server" ID="hfJsonLotti" />
</div>
<div class="col-4 text-center">
<asp:HiddenField runat="server" ID="hfLastBCode" />
<asp:HiddenField runat="server" ID="hfLastValidBCode" />
<uc1:cmp_barcode runat="server" ID="cmp_barcode" />
<asp:Label runat="server" ID="lblDecodedData" />
</div>
<div class="col-4 text-right">
Lotto OUT
<hr />
elenco UDC stampati? numero?
</div>
<div class="col-12 text-center">
note?
<br />
btn stampa
</div>
</div>
<asp:HiddenField runat="server" ID="hfLastBCode" />
<asp:HiddenField runat="server" ID="hfLastValidBCode" />
<uc1:cmp_barcode runat="server" ID="cmp_barcode" />
<asp:Label runat="server" ID="lblDecodedData" />
+70 -14
View File
@@ -1,4 +1,5 @@
using MagData;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
@@ -43,8 +44,45 @@ namespace MP_MAG.WebUserControls
}
}
}
/// <summary>
/// Elenco dei lotti selezionati
/// </summary>
protected List<string> lottiSel
{
get
{
List<string> answ = null;
string rawVal = hfJsonLotti.Value;
try
{
answ = JsonConvert.DeserializeObject<List<string>>(rawVal);
}
catch
{ }
if (answ == null)
{
answ = new List<string>();
}
return answ;
}
set
{
string rawVal = JsonConvert.SerializeObject(value);
hfJsonLotti.Value = rawVal;
// salvo ANCHE elenco in formato #lotto#lotto#
string eliString = $"#{string.Join("#", value)}#";
hfHashList.Value = eliString;
// update grView...
grViewLottoIn.DataBind();
}
}
protected void Page_Load(object sender, EventArgs e)
{
if(!Page.IsPostBack)
{
lottiSel = new List<string>();
}
cmp_barcode.eh_doRefresh += Cmp_barcode_eh_doRefresh;
cmp_barcode.eh_doReset += Cmp_barcode_eh_doReset;
}
@@ -93,13 +131,13 @@ namespace MP_MAG.WebUserControls
switch (decoData.codeType)
{
case codeType.UNK:
cmp_barcode.showOutput("text-danger", $"Unknown Data: {decoData.rawData} --> no action");
cmp_barcode.showOutput("text-danger", $"Codice sconosciuto: {decoData.rawData} --> ignoro");
resetSelection(false);
doRaiseEv = true;
break;
case codeType.Lotto:
cmp_barcode.showOutput("badge badge-success", $"{decoData.description}");
//processItemSuggestion(decoData.codeType, decoData.rawData, decoData.codeInt);
processSuggestion(decoData.codeType, decoData.rawData, decoData.codeInt);
break;
case codeType.LottoInt:
cmp_barcode.showOutput("badge badge-success", $"{decoData.description}");
@@ -107,11 +145,11 @@ namespace MP_MAG.WebUserControls
break;
case codeType.Date:
cmp_barcode.showOutput("badge badge-success", $"{decoData.description}");
//processItemSuggestion(decoData.codeType, decoData.rawData, decoData.codeInt);
//processLottoSuggestion(decoData.codeType, decoData.rawData, decoData.codeInt);
break;
case codeType.PartNumber:
cmp_barcode.showOutput("badge badge-success", $"{decoData.description}");
//processItemSuggestion(decoData.codeType, decoData.rawData, decoData.codeInt);
//processLottoSuggestion(decoData.codeType, decoData.rawData, decoData.codeInt);
break;
case codeType.Quantity:
cmp_barcode.showOutput("badge badge-success", $"{decoData.description}");
@@ -127,38 +165,46 @@ namespace MP_MAG.WebUserControls
// break;
//case codeType.Cart:
// cmp_barcode.showOutput("badge badge-success", $"Valid CR Code: {decoData.description}");
// processItemSuggestion(decoData.codeType, decoData.rawData, decoData.codeInt);
// processLottoSuggestion(decoData.codeType, decoData.rawData, decoData.codeInt);
// break;
//case codeType.Bin:
// cmp_barcode.showOutput("badge badge-success", $"Valid BN Code: {decoData.description}");
// processItemSuggestion(decoData.codeType, decoData.rawData, decoData.codeInt);
// processLottoSuggestion(decoData.codeType, decoData.rawData, decoData.codeInt);
// break;
//default:
// cmp_barcode.showOutput("text-danger", $"Unknown Data: {decoData.rawData} --> no action");
// resetSelection(false);
// break;
}
}
return doRaiseEv;
}
/// <summary>
/// Processo il DataMatrix letto
/// Processo il codice letto
/// </summary>
/// <param name="tipoCod"></param>
/// <param name="rawData"></param>
/// <param name="codeInt"></param>
private void processItemSuggestion(codeType tipoCod, string rawData, int codeInt)
private void processSuggestion(codeType tipoCod, string rawData, int codeInt)
{
//DS_App.ItemListDataTable tabItem = null;
// processo suggerimenti x ITEM / cart / bin dato suo RawData (Dtmx) e Cod univoco (intero)
switch (tipoCod)
{
case codeType.Lotto:
//var tabOtherItem = DataLayer.man.taOtItem.getByKey(codeInt);
//if (tabOtherItem.Count == 1)
//{
// showOtherItemDetail(true, tabOtherItem[0], false);
//}
// IN PRIMIS cerco lotto valido
DS_Mag.ElencoLottiDataTable tabLotti;
tabLotti = MagDataLayer.man.taEL.getByKey(rawData, "E");
if (tabLotti.Count == 1)
{
// se trovato cerco in elenco --> aggiungo in lista se non c'è
var currLotti = lottiSel;
if (!currLotti.Contains(rawData))
{
currLotti.Add(rawData);
lottiSel = currLotti;
}
}
break;
//case codeType.Item:
// tabItem = DataLayer.man.taIL.getBySearch(codeInt, rawData, 0, 999);
@@ -393,5 +439,15 @@ namespace MP_MAG.WebUserControls
lbtResetSel.Visible = (itemIdSelected != 0);
#endif
}
/// <summary>
/// reset sel lottoIn
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void lbtResetLottoIn_Click(object sender, EventArgs e)
{
// resetto
lottiSel = new List<string>();
}
}
}
+45
View File
@@ -14,6 +14,51 @@ namespace MP_MAG.WebUserControls
public partial class cmp_prtSemilav
{
/// <summary>
/// Controllo lbtResetLottoIn.
/// </summary>
/// <remarks>
/// Campo generato automaticamente.
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
/// </remarks>
protected global::System.Web.UI.WebControls.LinkButton lbtResetLottoIn;
/// <summary>
/// Controllo grViewLottoIn.
/// </summary>
/// <remarks>
/// Campo generato automaticamente.
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
/// </remarks>
protected global::System.Web.UI.WebControls.GridView grViewLottoIn;
/// <summary>
/// Controllo odsLottiIn.
/// </summary>
/// <remarks>
/// Campo generato automaticamente.
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
/// </remarks>
protected global::System.Web.UI.WebControls.ObjectDataSource odsLottiIn;
/// <summary>
/// Controllo hfHashList.
/// </summary>
/// <remarks>
/// Campo generato automaticamente.
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
/// </remarks>
protected global::System.Web.UI.WebControls.HiddenField hfHashList;
/// <summary>
/// Controllo hfJsonLotti.
/// </summary>
/// <remarks>
/// Campo generato automaticamente.
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
/// </remarks>
protected global::System.Web.UI.WebControls.HiddenField hfJsonLotti;
/// <summary>
/// Controllo hfLastBCode.
/// </summary>
+31 -8
View File
@@ -2470,7 +2470,7 @@ namespace MagData.DS_MagTableAdapters {
[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[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_ElencoLotti\r\n";
@@ -2483,17 +2483,23 @@ namespace MagData.DS_MagTableAdapters {
this._commandCollection[1].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@LottoOut", global::System.Data.SqlDbType.NVarChar, 50, global::System.Data.ParameterDirection.Input, 0, 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_EL_getByKey";
this._commandCollection[2].CommandText = "dbo.stp_EL_getByHashList";
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("@Lotto", 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("@TipoLotto", 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("@elLotti", global::System.Data.SqlDbType.NVarChar, 500, global::System.Data.ParameterDirection.Input, 0, 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_EL_getBySearch";
this._commandCollection[3].CommandText = "dbo.stp_EL_getByKey";
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("@SearchVal", 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("@Lotto", 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("@TipoLotto", global::System.Data.SqlDbType.NVarChar, 50, 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_EL_getBySearch";
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("@SearchVal", 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()]
@@ -2541,8 +2547,25 @@ namespace MagData.DS_MagTableAdapters {
[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_Mag.ElencoLottiDataTable getByKey(string Lotto, string TipoLotto) {
public virtual DS_Mag.ElencoLottiDataTable getByHashList(string elLotti) {
this.Adapter.SelectCommand = this.CommandCollection[2];
if ((elLotti == null)) {
this.Adapter.SelectCommand.Parameters[1].Value = global::System.DBNull.Value;
}
else {
this.Adapter.SelectCommand.Parameters[1].Value = ((string)(elLotti));
}
DS_Mag.ElencoLottiDataTable dataTable = new DS_Mag.ElencoLottiDataTable();
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_Mag.ElencoLottiDataTable getByKey(string Lotto, string TipoLotto) {
this.Adapter.SelectCommand = this.CommandCollection[3];
if ((Lotto == null)) {
this.Adapter.SelectCommand.Parameters[1].Value = global::System.DBNull.Value;
}
@@ -2565,7 +2588,7 @@ namespace MagData.DS_MagTableAdapters {
[global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")]
[global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Select, false)]
public virtual DS_Mag.ElencoLottiDataTable getBySearch(string SearchVal) {
this.Adapter.SelectCommand = this.CommandCollection[3];
this.Adapter.SelectCommand = this.CommandCollection[4];
if ((SearchVal == null)) {
this.Adapter.SelectCommand.Parameters[1].Value = global::System.DBNull.Value;
}
+11
View File
@@ -49,6 +49,17 @@ FROM V_ElencoLotti
</DbCommand>
</SelectCommand>
</DbSource>
<DbSource ConnectionRef="MoonPro_MAGConnectionString (Settings)" DbObjectName="MoonPro_MAG.dbo.stp_EL_getByHashList" DbObjectType="StoredProcedure" GenerateMethods="Get" GenerateShortCommands="true" GeneratorGetMethodName="getByHashList" GetMethodModifier="Public" GetMethodName="getByHashList" QueryType="Rowset" ScalarCallRetval="System.Object, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="true" UserGetMethodName="getByHashList" UserSourceName="getByHashList">
<SelectCommand>
<DbCommand CommandType="StoredProcedure" ModifiedByUser="false">
<CommandText>dbo.stp_EL_getByHashList</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="@elLotti" Precision="0" ProviderType="NVarChar" Scale="0" Size="500" SourceColumnNullMapping="false" SourceVersion="Current" />
</Parameters>
</DbCommand>
</SelectCommand>
</DbSource>
<DbSource ConnectionRef="MoonPro_MAGConnectionString (Settings)" DbObjectName="MoonPro_MAG.dbo.stp_EL_getByKey" DbObjectType="StoredProcedure" GenerateMethods="Get" GenerateShortCommands="true" GeneratorGetMethodName="getByKey" GetMethodModifier="Public" GetMethodName="getByKey" QueryType="Rowset" ScalarCallRetval="System.Object, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="true" UserGetMethodName="getByKey" UserSourceName="getByKey">
<SelectCommand>
<DbCommand CommandType="StoredProcedure" ModifiedByUser="false">
+25 -6
View File
@@ -5,12 +5,22 @@ using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Text.RegularExpressions;
using System.Web;
namespace MagData
{
public class MagDataLayer
{
#region definizione Regexp
/// <summary>
/// RegExp x Qty odette
/// </summary>
public static string re_QtyOdette = memLayer.ML.cdv("regExp_QtyOdette");
#endregion
#region oggetti public
// reports
@@ -247,12 +257,21 @@ namespace MagData
}
else if (bcValue.StartsWith("Q"))
{
answ.codeType = codeType.Quantity;
answ.code = bcValue.Replace("Q", "");
int codeInt = 0;
int.TryParse(answ.code, NumberStyles.Integer, CultureInfo.InvariantCulture, out codeInt);
answ.codeInt = codeInt;
answ.description = $"Qty Odette: {answ.code}";
// controllo regex
Match testQty = Regex.Match(bcValue, re_QtyOdette);
if (testQty.Success)
{
answ.codeType = codeType.Quantity;
answ.code = bcValue.Replace("Q", "");
int codeInt = 0;
int.TryParse(answ.code, NumberStyles.Integer, CultureInfo.InvariantCulture, out codeInt);
answ.codeInt = codeInt;
answ.description = $"Qty Odette: {answ.code}";
}
else
{
answ.codeType = codeType.UNK;
}
}
else if (bcValue.StartsWith("H"))
{