From 754a8da8a7abe495c322f9c7807e4883320db05e Mon Sep 17 00:00:00 2001 From: "Samuele E. Locatelli" Date: Mon, 2 Jul 2018 15:07:52 +0200 Subject: [PATCH] avanzamento gestione KIT anime --- GMW/GMW.csproj | 8 + GMW/TK_KA_crea.aspx | 5 +- GMW/TK_KA_crea.aspx.cs | 10 +- GMW/TK_KA_crea.aspx.designer.cs | 4 +- GMW/WebUserControls/mod_anagKit.ascx | 8 +- GMW/WebUserControls/mod_kitAnime.ascx | 58 ++ GMW/WebUserControls/mod_kitAnime.ascx.cs | 561 ++++++++++++++++++ .../mod_kitAnime.ascx.designer.cs | 141 +++++ GMW_data/DS_magazzino.xsd | 15 +- GMW_data/DS_magazzino.xss | 8 +- GMW_data/DS_magazzino1.Designer.cs | 39 +- GMW_data/MagClass.cs | 65 ++ GMW_data/TermClass.cs | 18 +- 13 files changed, 913 insertions(+), 27 deletions(-) create mode 100644 GMW/WebUserControls/mod_kitAnime.ascx create mode 100644 GMW/WebUserControls/mod_kitAnime.ascx.cs create mode 100644 GMW/WebUserControls/mod_kitAnime.ascx.designer.cs diff --git a/GMW/GMW.csproj b/GMW/GMW.csproj index bfc44e35..a56a5647 100644 --- a/GMW/GMW.csproj +++ b/GMW/GMW.csproj @@ -595,6 +595,7 @@ + @@ -1732,6 +1733,13 @@ mod_gestPrinterPost.ascx + + mod_kitAnime.ascx + ASPXCodeBehind + + + mod_kitAnime.ascx + mod_labAssStampaUdc.ascx ASPXCodeBehind diff --git a/GMW/TK_KA_crea.aspx b/GMW/TK_KA_crea.aspx index d6c823fb..1e4812a6 100644 --- a/GMW/TK_KA_crea.aspx +++ b/GMW/TK_KA_crea.aspx @@ -2,7 +2,8 @@ <%@ Register Src="WebUserControls/mod_selLineaNtDt.ascx" TagName="mod_selLineaNtDt" TagPrefix="uc1" %> <%@ Register Src="WebUserControls/mod_storicoAzioniOperatore.ascx" TagName="mod_storicoAzioniOperatore" TagPrefix="uc2" %> -<%@ Register Src="WebUserControls/mod_anime.ascx" TagName="mod_anime" TagPrefix="uc3" %> +<%@ Register Src="~/WebUserControls/mod_kitAnime.ascx" TagPrefix="uc1" TagName="mod_kitAnime" %> + @@ -31,7 +32,7 @@
- +
diff --git a/GMW/TK_KA_crea.aspx.cs b/GMW/TK_KA_crea.aspx.cs index bcd19f98..ed1638d5 100644 --- a/GMW/TK_KA_crea.aspx.cs +++ b/GMW/TK_KA_crea.aspx.cs @@ -25,8 +25,8 @@ namespace GMW // update vari... doUpdate(); mod_storicoAzioniOperatore1.eh_stampa += new EventHandler(mod_storicoAzioniOperatore1_eh_stampa); - mod_anime1.doUpdate(); - mod_anime1.eh_reqUpdate += mod_PostRX_NT1_eh_reqUpdate; + mod_kitAnime.doUpdate(); + mod_kitAnime.eh_reqUpdate += mod_PostRX_NT1_eh_reqUpdate; mod_selLineaNtDt1.eh_lineSelected += mod_selLineaNtDt1_eh_doRefresh; mod_selLineaNtDt1.eh_showHideStorico += mod_selLineaNtDt1_eh_showHideStorico; } @@ -47,7 +47,7 @@ namespace GMW private void mod_selLineaNtDt1_eh_doRefresh(object sender, EventArgs e) { doUpdate(); - mod_anime1.doUpdate(); + mod_kitAnime.doUpdate(); } /// /// richiesta update del controllo SAO @@ -74,7 +74,7 @@ namespace GMW /// void mod_storicoAzioniOperatore1_eh_stampa(object sender, EventArgs e) { - mod_anime1.ristampa(); + mod_kitAnime.ristampa(); } /// /// sistemo visualizzazione pannelli @@ -83,7 +83,7 @@ namespace GMW { // default: moduli visibili (non serve linea).. bool enableBtn = true; - mod_anime1.Visible = enableBtn; + mod_kitAnime.Visible = enableBtn; fixStorico(); } /// diff --git a/GMW/TK_KA_crea.aspx.designer.cs b/GMW/TK_KA_crea.aspx.designer.cs index 40fe2d9f..6c887159 100644 --- a/GMW/TK_KA_crea.aspx.designer.cs +++ b/GMW/TK_KA_crea.aspx.designer.cs @@ -67,12 +67,12 @@ namespace GMW { protected global::System.Web.UI.WebControls.Label lblWarning; /// - /// Controllo mod_anime1. + /// Controllo mod_kitAnime. /// /// /// Campo generato automaticamente. /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. /// - protected global::GMW.WebUserControls.mod_anime mod_anime1; + protected global::GMW.WebUserControls.mod_kitAnime mod_kitAnime; } } diff --git a/GMW/WebUserControls/mod_anagKit.ascx b/GMW/WebUserControls/mod_anagKit.ascx index 2623aedd..13dfcc10 100644 --- a/GMW/WebUserControls/mod_anagKit.ascx +++ b/GMW/WebUserControls/mod_anagKit.ascx @@ -62,7 +62,13 @@
- + + +
+ + +
+
diff --git a/GMW/WebUserControls/mod_kitAnime.ascx b/GMW/WebUserControls/mod_kitAnime.ascx new file mode 100644 index 00000000..6068754d --- /dev/null +++ b/GMW/WebUserControls/mod_kitAnime.ascx @@ -0,0 +1,58 @@ +<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="mod_kitAnime.ascx.cs" Inherits="GMW.WebUserControls.mod_kitAnime" %> + +<% if (false) + { %> + + +<% } %> + + +
+
+ Elenco UDC nel KIT +
+ esterno: <%: animeExt.ToString() %> +
+
+
+ +
+
+ +
+ +
+
+
+
+
+ +
+ +
+
+
+
+ <%: traduci("Note") %> +
+
+ + +
+
+ <%: traduci("lbtGeneraUDC") %> +
+
+
+
+
+
+
+ <%: traduci("lblQtaPart") %> +
+
+ +
+
+
+
diff --git a/GMW/WebUserControls/mod_kitAnime.ascx.cs b/GMW/WebUserControls/mod_kitAnime.ascx.cs new file mode 100644 index 00000000..57fff880 --- /dev/null +++ b/GMW/WebUserControls/mod_kitAnime.ascx.cs @@ -0,0 +1,561 @@ +using GMW_data; +using SteamWare; +using System; +using System.Web.UI; + +namespace GMW.WebUserControls +{ + public partial class mod_kitAnime : System.Web.UI.UserControl + { + /// + /// flusso associato (hard coded) a ANIME + /// + protected string flusso = "AN"; + /// + /// stato associato (hard coded) a ANIME + /// + protected string statoUDC = "Anim"; + /// + /// dati x verifica CodSoggetto / matricola + /// + protected string preCodSogg = memLayer.ML.AppConf["prefCodSogg"]; + /// + /// Imposta se le anime del KIT siano di origine INT o EXT + /// + public bool animeExt + { + set + { + hfAnimeExt.Value = value.ToString(); + } + get + { + bool answ = false; + bool.TryParse(hfAnimeExt.Value, out answ); + return answ; + } + } + /// + /// gestione eh update + /// + public event EventHandler eh_reqUpdate; + /// + /// stringa UID univoca + /// + public string uid + { + get + { + return this.UniqueID.Replace("$", "_").Replace("-", "_"); + } + } + /// + /// caricamento pagina + /// + /// + /// + protected void Page_Load(object sender, EventArgs e) + { + if (!Page.IsPostBack) + { + Postazione.messaggiText = ""; + Postazione.warningText = ""; + traduciObj(); + checkNumKeyIn(); + } + doChecks(); + if (currKitAnime!= "") + { + lblParticolareAttivo.Text = string.Format("KIT Anime selezionato {0}", currKitAnime); + // aggiungo descrizione del particolare + string descr = ""; + string disegno = ""; + try + { + var riga = MagClass.magazzino.taAK.getByKey(currKitAnime)[0]; + descr = riga.Descrizione; + disegno = string.Format("KIT ANIME {0}", currKitAnime); + } + catch + { } + lblDescrAttivo.Text = descr; + lblDisegno.Text = disegno; + } + else + { + lblParticolareAttivo.Text = "..."; + lblDescrAttivo.Text = ""; + lblDisegno.Text = ""; + } + } + /// + /// verifico se ci sia in sessione un input da NumKeyb e nel caso lometto in barcodeIn e processo... + /// + private void checkNumKeyIn() + { + if (memLayer.ML.isInSessionObject("numKeyIn")) + { + barcodeIn = memLayer.ML.StringSessionObj("numKeyIn"); + // svuoto valore in sessione... + memLayer.ML.emptySessionVal("numKeyIn"); + // controllo barcode... + checkBarcode(); + } + } + + /// + /// richiesta (ri)stampa UDC + /// + /// + /// + public void ristampa() + { + bool fatto = false; + // registro ri-stampa UDC + DateTime adesso = DateTime.Now; + // calcolo particolare... + DS_magazzino.ElencoCartelliniRow rigaUDC; + string particolare = ""; + try + { + rigaUDC = MagClass.magazzino.taCartellini.getByUdc(udcReq)[0]; + particolare = rigaUDC.Particolare; + fatto = MagClass.magazzino.ristampaUdc(udcReq, Postazione.printer, Request.UserHostName); + } + catch + { + logger.lg.scriviLog(string.Format("Errore recupero particolare UDC Anime {0}", udcReq), tipoLog.EXCEPTION); + } + if (fatto) MagClass.magazzino.taSAO.insertQuery(adesso, MagClass.magazzino.CodSoggCurrUser, Postazione.name, Postazione.IP, udcReq, particolare, "stampaUDC", "Ri-Stampato UDC Anime"); + // raise dell'evento + if (eh_reqUpdate != null) + { + eh_reqUpdate(this, new EventArgs()); + } + } + /// + /// udc da stampare + /// + protected string udcReq + { + get + { + return memLayer.ML.StringSessionObj("udcSelSAO"); + } + } + /// + /// effettua controlli visibilità + /// + private void doChecks() + { + checkBarcode(); + checkStampa(); + } + /// + /// sistemo labels oggetti + /// + private void traduciObj() + { + //txtBox + qta = pezziKitAnime; + // buttons + btnEmptyNote.Text = traduci("btnEmptyNote"); + } + /// + /// restituisce il nome della pagina corrente + /// + protected string PagCorrente + { + get + { + string answ = ""; + Uri MyUrl = Request.Url; + string delimStr = "/"; + char[] delimiter = delimStr.ToCharArray(); + string[] finalUrl = MyUrl.LocalPath.ToString().Split(delimiter); + int n = finalUrl.Length; + answ = finalUrl[n - 1].ToString(); + DataLayer_AnagGen.PermessiRow riga = (DataLayer_AnagGen.PermessiRow)user_std.UtSn.permessi.Select(string.Format("URL = '{0}'", answ))[0]; + answ = riga.NOME; + return answ; + } + } + /// + /// wrapper traduzione + /// + /// + /// + public string traduci(object lemma) + { + return user_std.UtSn.Traduci(lemma.ToString()); + } + /// + /// indica il codice currKitAnime correntemente selezionato + /// + protected string currKitAnime + { + get + { + return memLayer.ML.StringSessionObj(string.Format("currKitAnime_{0}", uid)); + } + set + { + memLayer.ML.setSessionVal(string.Format("currKitAnime_{0}", uid), value, memLayer.ML.confReadBool("keepParticolareSel")); + } + } + /// + /// indica se i caratteri vadano forzati a maiuscoli + /// + public bool forceUppercase + { + get + { + return memLayer.ML.confReadBool("forceUppercase"); + } + } + /// + /// num pezzi kit anime + /// + public int pezziKitAnime + { + get + { + int answ = 0; + try + { + answ = MagClass.magazzino.taAK.getByKey(currKitAnime)[0].QtaKIT; + + } + catch + { + answ = 0; + } + return answ; + } + } + /// + /// valore barcode + /// + public string barcodeIn + { + get + { + return txtBarcode.Text.Trim(); + } + set + { + txtBarcode.Text = value; + } + } + /// + /// qta pezzi x UDC + /// + public int qta + { + get + { + int _qta = 0; + try + { + _qta = Convert.ToInt32(txtQta.Text.Trim()); + } + catch + { + _qta = memLayer.ML.cdvi("QtaImballoAnime"); + } + return _qta; + } + set + { + txtQta.Text = value.ToString(); + } + } + /// + /// controlla se ci sia un barcode + /// + private void checkBarcode() + { + if (barcodeIn != "") + { + Postazione.messaggiText = string.Format("Barcode digitato: {0}", barcodeIn); + switch (MagClass.tipoBCode_L2K(barcodeIn)) + { + case tipoCodiceBarcode.KitAnime: + // imposto il KitAnime corrente + currKitAnime = barcodeIn; + // controllo esista il KitAnime scansionato + var tabRes = MagClass.magazzino.taAK.getByKey(currKitAnime); + if (tabRes.Rows.Count == 0) + { + currKitAnime = ""; + Postazione.messaggiText += traduci("ERR-ANM-002"); + Postazione.CssClass = "stileComandoKo"; + } + else + { + Postazione.messaggiText += traduci("kitSelected"); + Postazione.CssClass = "stileComandoOk"; + } + // imposto QTA da KIT anime + qta = pezziKitAnime; + // mostro dettaglio composizione KIT ANIME con qta già correttamente moltiplicata + break; + case tipoCodiceBarcode.Operatore: + // calcolo matricola utente + int MatrUtente = -1; + if (barcodeIn.StartsWith(preCodSogg)) + { + MatrUtente = DataProxy.obj.taTrascSogg.getByKey(barcodeIn, 0)[0].CodMatricola; + } + else + { + MatrUtente = Convert.ToInt32(barcodeIn); + } + if (MatrUtente >= 0) + { + // salvo in sessione operatore con AUTH + OpAuth.startOpAuth(MatrUtente); + // mostro che ho autorizzato... + Postazione.messaggiText += traduci("userAuthRec"); + Postazione.CssClass = "stileComandoOk"; + // svuoto particolare e qta... + currKitAnime = ""; + qta = 0; + Response.Redirect(user_std.pagCorrente); + } + else + { + Postazione.messaggiText += traduci("ERR-BCD-001"); + Postazione.CssClass = "stileComandoND"; + } + break; + default: + // cerco se sia "0" = reset utente... + if (barcodeIn == memLayer.ML.CRS("resetCodSogg")) + { + // salvo in sessione operatore con AUTH + OpAuth.stopAuth(); + // mostro che ho autorizzato... + Postazione.messaggiText += traduci("userAuthRem"); + Postazione.CssClass = "stileComandoOk"; + Response.Redirect(user_std.pagCorrente); + } + Postazione.messaggiText += traduci("ERR-BCD-001"); + Postazione.CssClass = "stileComandoND"; + break; + } + barcodeIn = ""; + } + doUpdate(); + } + /// + /// aggiorna tabella + focus a barcode + /// + public void doUpdate() + { + updateKit(); + // raise dell'evento + if (eh_reqUpdate != null) + { + eh_reqUpdate(this, new EventArgs()); + } + checkStampa(); + txtBarcode.Focus(); + } + /// + /// aggiorna visualizzazioen dati particolare + /// + private void updateKit() + { + if (currKitAnime != "") + { + lblParticolareAttivo.Text = string.Format("{0} {1}", traduci("particSel"), currKitAnime); + // aggiungo descrizione del particolare + string descr = ""; + string disegno = ""; + try + { + var riga = MagClass.magazzino.taAK.getByKey(currKitAnime)[0]; + descr = riga.Descrizione; + disegno = string.Format("KIT ANIME {0}", currKitAnime); + } + catch + { } + lblDescrAttivo.Text = descr; + lblDisegno.Text = disegno; + } + else + { + lblParticolareAttivo.Text = "..."; + lblDescrAttivo.Text = ""; + lblDisegno.Text = ""; + } + } + /// + /// controllo l'abilitazione alla stampa UDC: + /// - particolare ok + /// - qta > 0 + /// altrimenti disabilito btn stampa + /// + private void checkStampa() + { + bool stampaOk = false; + if (currKitAnime != "" && qta > 0) + { + stampaOk = true; + } + divNote.Visible = stampaOk; + } + /// + /// genera i barcode di + /// - anime + /// e lancia la relativa stampa + /// + /// + /// + protected void lbtStampaUDC_Click(object sender, EventArgs e) + { + bool needsRedirect = false; + // verifico postazione x procedere... + if (Postazione.printer != "n.d.") + { + // verifico auth utente OPPURE se NON sia richiesta... + if (OpAuth.isAuth || !OpAuth.opAuthReq) + { + string newUdcChild = ""; + string noteTrim = txtNote.Text.Trim(); + // effettuo controlli che cod_soggetto e cod particolare siano disponibili... + string codSogg = ""; + string KitAnime = ""; + try + { + codSogg = MagClass.magazzino.CodSoggCurrUser; + KitAnime = currKitAnime; + } + catch + { + } + if (codSogg != "" && KitAnime != "") + { + // genero cartellino liquidi + DateTime adesso = DateTime.Now; + try + { +#if false + // creo nuovo UDC del trattamento liquidi + newUdcChild = MagClass.magazzino.creaUdc(flusso, "", KitAnime, "", "", "", "", "", 0, memLayer.ML.cdv("CodImballoAnime"), "U", codSogg, qta, 0, 0, adesso, 0, statoUDC, memLayer.ML.cdvi("IdxPosizioneAnime"), "IdxPosizioneAnime", "UDC_ANIMA", noteTrim, "", adesso.Year, Request.UserHostName); + + if (OpAuth.isAuth) + { + // salvo attributo dell'OpAuth... + MagClass.magazzino.taAtt2UDC.Insert(newUdcChild, memLayer.ML.CRS("attrOpAuth"), OpAuth.currAuth.CodSoggetto, DateTime.Now, codSogg); + // consumo una auth... + OpAuth.currAuth.remAuth--; + if (OpAuth.currAuth.remAuth == 0) + { + OpAuth.stopAuth(); + needsRedirect = true; + } + } +#endif + // registro creazione nuovo UDC + MagClass.magazzino.taSAO.insertQuery(adesso, codSogg, Postazione.name, Postazione.IP, newUdcChild, KitAnime, "creaUDC", string.Format("Creato nuovo UDC Anime - qta:{0} {1}", qta, noteTrim)); + } + catch (Exception exc) + { + httpLog(string.Format("Errore creazione UDC anime: {0}", exc), tipoLog.EXCEPTION); + } + // se ho cart stampo! + if (newUdcChild != "") + { + // ora stampo il nuovo cartellino!!! + MagClass.magazzino.stampaUdc(newUdcChild, Postazione.printer, tipoCartellino.cartAnime, Request.UserHostName); + // incremento timing... + adesso = DateTime.Now; + adesso = adesso.AddSeconds(1); + // registro stampa nuovo UDC + MagClass.magazzino.taSAO.insertQuery(adesso, codSogg, Postazione.name, Postazione.IP, newUdcChild, KitAnime, "stampaUDC", "Stampato UDC Anime"); + } + } + else + { + httpLog(string.Format("Errore persi utente/particolare, ricarico!"), tipoLog.ERROR); + Response.Redirect("~/login.aspx"); + } + // + } + else + { + Postazione.messaggiText = traduci("noOpAuth"); + Postazione.CssClass = "stileComandoKo"; + httpLog(string.Format("Errore manca OpAuth x UDC anime"), tipoLog.ERROR); + } + } + else + { + Response.Redirect("~/menu.aspx"); + } + // raise dell'evento + if (eh_reqUpdate != null) + { + eh_reqUpdate(this, new EventArgs()); + } + if (needsRedirect) + { + Response.Redirect(user_std.pagCorrente); + } + } + /// + /// wrapper per log con salvataggio dell'IP del chiamante + /// + /// + /// + public bool httpLog(string _testoPre) + { + bool answ = false; + string postazione_IP = ""; + try + { + postazione_IP = string.Format(" | {0} | ", Request.UserHostName); + } + catch + { } + logger.lg.scriviLog(postazione_IP + _testoPre); + return answ; + } + /// + /// wrapper per log con salvataggio dell'IP del chiamante + /// + /// + /// + public bool httpLog(string testoLog, tipoLog tipo) + { + bool answ = false; + string postazione_IP = ""; + try + { + postazione_IP = string.Format(" | {0} | ", Request.UserHostName); + } + catch + { } + logger.lg.scriviLog(postazione_IP + testoLog, tipo); + return answ; + } + /// + /// svuoto le note + /// + /// + /// + protected void btnEmptyNote_Click(object sender, EventArgs e) + { + txtNote.Text = ""; + Postazione.messaggiText = traduci("AttesaBCode"); + Postazione.CssClass = "stileAttesa"; + // raise dell'evento + if (eh_reqUpdate != null) + { + eh_reqUpdate(this, new EventArgs()); + } + } + } +} \ No newline at end of file diff --git a/GMW/WebUserControls/mod_kitAnime.ascx.designer.cs b/GMW/WebUserControls/mod_kitAnime.ascx.designer.cs new file mode 100644 index 00000000..7f10057c --- /dev/null +++ b/GMW/WebUserControls/mod_kitAnime.ascx.designer.cs @@ -0,0 +1,141 @@ +//------------------------------------------------------------------------------ +// +// Codice generato da uno strumento. +// +// Le modifiche a questo file possono causare un comportamento non corretto e verranno perse se +// il codice viene rigenerato. +// +//------------------------------------------------------------------------------ + +namespace GMW.WebUserControls { + + + public partial class mod_kitAnime { + + /// + /// Controllo BundleReference1. + /// + /// + /// Campo generato automaticamente. + /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. + /// + protected global::Microsoft.AspNet.Web.Optimization.WebForms.BundleReference BundleReference1; + + /// + /// Controllo BundleReference2. + /// + /// + /// Campo generato automaticamente. + /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. + /// + protected global::Microsoft.AspNet.Web.Optimization.WebForms.BundleReference BundleReference2; + + /// + /// Controllo hfAnimeExt. + /// + /// + /// 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.HiddenField hfAnimeExt; + + /// + /// Controllo lblParticolareAttivo. + /// + /// + /// 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.Label lblParticolareAttivo; + + /// + /// Controllo lblDescrAttivo. + /// + /// + /// 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.Label lblDescrAttivo; + + /// + /// Controllo lblDisegno. + /// + /// + /// 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.Label lblDisegno; + + /// + /// Controllo divBarcode. + /// + /// + /// Campo generato automaticamente. + /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. + /// + protected global::System.Web.UI.HtmlControls.HtmlGenericControl divBarcode; + + /// + /// Controllo lblBarcode. + /// + /// + /// 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.Label lblBarcode; + + /// + /// Controllo txtBarcode. + /// + /// + /// 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.TextBox txtBarcode; + + /// + /// Controllo divNote. + /// + /// + /// Campo generato automaticamente. + /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. + /// + protected global::System.Web.UI.HtmlControls.HtmlGenericControl divNote; + + /// + /// Controllo txtNote. + /// + /// + /// 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.TextBox txtNote; + + /// + /// Controllo btnEmptyNote. + /// + /// + /// 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.Button btnEmptyNote; + + /// + /// Controllo lbtStampaUDC. + /// + /// + /// 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 lbtStampaUDC; + + /// + /// Controllo txtQta. + /// + /// + /// 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.TextBox txtQta; + } +} diff --git a/GMW_data/DS_magazzino.xsd b/GMW_data/DS_magazzino.xsd index 2d3a6026..a3066a05 100644 --- a/GMW_data/DS_magazzino.xsd +++ b/GMW_data/DS_magazzino.xsd @@ -4734,7 +4734,7 @@ SELECT CodKIT, Descrizione, QtaKIT FROM AnagKit WHERE (CodKIT = @CodKIT) - + dbo.stp_AK_deleteQuery @@ -4745,7 +4745,18 @@ SELECT CodKIT, Descrizione, QtaKIT FROM AnagKit WHERE (CodKIT = @CodKIT) - + + + + dbo.stp_AK_getByKey + + + + + + + + dbo.stp_AK_insertQuery diff --git a/GMW_data/DS_magazzino.xss b/GMW_data/DS_magazzino.xss index 537e7e08..43eff04d 100644 --- a/GMW_data/DS_magazzino.xss +++ b/GMW_data/DS_magazzino.xss @@ -4,7 +4,7 @@ Changes to this file may cause incorrect behavior and will be lost if the code is regenerated. --> - + @@ -36,15 +36,15 @@ - + - + - + diff --git a/GMW_data/DS_magazzino1.Designer.cs b/GMW_data/DS_magazzino1.Designer.cs index 02b37787..2d2fb0bc 100644 --- a/GMW_data/DS_magazzino1.Designer.cs +++ b/GMW_data/DS_magazzino1.Designer.cs @@ -46379,7 +46379,7 @@ SELECT CodKIT, Descrizione, QtaKIT FROM AnagKit WHERE (CodKIT = @CodKIT)"; [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.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 CodKIT, Descrizione, QtaKIT FROM dbo.AnagKit"; @@ -46392,21 +46392,27 @@ SELECT CodKIT, Descrizione, QtaKIT FROM AnagKit WHERE (CodKIT = @CodKIT)"; this._commandCollection[1].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@Original_CodKIT", global::System.Data.SqlDbType.NVarChar, 15, 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_AK_insertQuery"; + this._commandCollection[2].CommandText = "dbo.stp_AK_getByKey"; 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("@CodKIT", global::System.Data.SqlDbType.NVarChar, 15, 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("@Descrizione", global::System.Data.SqlDbType.VarChar, 250, 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("@QtaKIT", 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_AK_updateQuery"; + this._commandCollection[3].CommandText = "dbo.stp_AK_insertQuery"; 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("@Original_CodKIT", global::System.Data.SqlDbType.NVarChar, 15, 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("@CodKIT", global::System.Data.SqlDbType.NVarChar, 15, 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.VarChar, 250, 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("@QtaKIT", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.Input, 10, 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_AK_updateQuery"; + 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("@Original_CodKIT", global::System.Data.SqlDbType.NVarChar, 15, 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("@CodKIT", global::System.Data.SqlDbType.NVarChar, 15, 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("@Descrizione", global::System.Data.SqlDbType.VarChar, 250, 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("@QtaKIT", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.Input, 10, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] @@ -46433,6 +46439,23 @@ SELECT CodKIT, Descrizione, QtaKIT FROM AnagKit WHERE (CodKIT = @CodKIT)"; return dataTable; } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")] + [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] + [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Select, false)] + public virtual DS_magazzino.AnagKitDataTable getByKey(string CodKIT) { + this.Adapter.SelectCommand = this.CommandCollection[2]; + if ((CodKIT == null)) { + this.Adapter.SelectCommand.Parameters[1].Value = global::System.DBNull.Value; + } + else { + this.Adapter.SelectCommand.Parameters[1].Value = ((string)(CodKIT)); + } + DS_magazzino.AnagKitDataTable dataTable = new DS_magazzino.AnagKitDataTable(); + this.Adapter.Fill(dataTable); + return dataTable; + } + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")] [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] @@ -46617,7 +46640,7 @@ SELECT CodKIT, Descrizione, QtaKIT FROM AnagKit WHERE (CodKIT = @CodKIT)"; [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")] [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] public virtual int insertQuery(string CodKIT, string Descrizione, global::System.Nullable QtaKIT) { - global::System.Data.SqlClient.SqlCommand command = this.CommandCollection[2]; + global::System.Data.SqlClient.SqlCommand command = this.CommandCollection[3]; if ((CodKIT == null)) { command.Parameters[1].Value = global::System.DBNull.Value; } @@ -46657,7 +46680,7 @@ SELECT CodKIT, Descrizione, QtaKIT FROM AnagKit WHERE (CodKIT = @CodKIT)"; [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "15.0.0.0")] [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] public virtual int updateQuery(string Original_CodKIT, string CodKIT, string Descrizione, global::System.Nullable QtaKIT) { - global::System.Data.SqlClient.SqlCommand command = this.CommandCollection[3]; + global::System.Data.SqlClient.SqlCommand command = this.CommandCollection[4]; if ((Original_CodKIT == null)) { command.Parameters[1].Value = global::System.DBNull.Value; } diff --git a/GMW_data/MagClass.cs b/GMW_data/MagClass.cs index 37ae4a84..59ec0a6a 100644 --- a/GMW_data/MagClass.cs +++ b/GMW_data/MagClass.cs @@ -3364,6 +3364,71 @@ namespace GMW_data return answ; } + + /// + /// Decodifica il tipo barcode acquisito + /// checkL3 = verifica i livelli sino L3 + /// L1: comandi/matricole/DT e BCD + /// L2: KIT (Anime) + /// + public static tipoCodiceBarcode tipoBCode_L2K(string valore) + { + tipoCodiceBarcode answ = tipoCodiceBarcode.ND; + int matricola = -1; + // provo a convertire in intero barcode x verifica eventuale matricola... + try + { + matricola = Convert.ToInt32(valore); + } + catch + { } + // controllo non si tratti di un comando... + string preCmd = memLayer.ML.AppConf["prefComandi"]; + string preDT = memLayer.ML.AppConf["prefDateTime"]; + string preBCD = memLayer.ML.AppConf["prefBCode"]; + string preCodSogg = memLayer.ML.AppConf["prefCodSogg"]; + if (valore.StartsWith(preCmd)) + { + answ = tipoCodiceBarcode.Comando; + } + else if ((TermClass.Ter.riconosciBarcode(valore) == tipoCodiceBarcode.KitAnime)) + { + answ = tipoCodiceBarcode.KitAnime; + } + else if (valore.StartsWith(preBCD)) + { + answ = tipoCodiceBarcode.BarCodeCMD; + } + else if (valore.StartsWith(preDT)) + { + // se lungh = 2+10 (DT+yyMMddHHmm) è SOLO datetime, altrimenti è DateTimeLine + if (valore.Length > 12) + { + answ = tipoCodiceBarcode.DateTimeLine; + } + else + { + answ = tipoCodiceBarcode.DateTime; + } + } + else if (valore.StartsWith(preCodSogg)) + { + // cerco cod soggetto... + if (DataProxy.obj.taTrascSogg.getByKey(valore, 0).Rows.Count == 1) + { + answ = tipoCodiceBarcode.Operatore; + } + } + else if (matricola >= 0) + { + if (DataProxy.obj.taTrascSogg.getByKey("", matricola).Rows.Count == 1) + { + answ = tipoCodiceBarcode.Operatore; + } + } + return answ; + } + #endregion #region area utenti diff --git a/GMW_data/TermClass.cs b/GMW_data/TermClass.cs index 7ebff107..f0fda20f 100644 --- a/GMW_data/TermClass.cs +++ b/GMW_data/TermClass.cs @@ -9,7 +9,7 @@ namespace GMW_data public class TermClass { #region area table adapters - + /// /// init dei table adapters /// @@ -238,7 +238,15 @@ namespace GMW_data answ = tipoCodiceBarcode.Operatore; break; case "K": - answ = tipoCodiceBarcode.ListaPrelievo; + // se è "KITAN" allora è tipo KIT... + if (barcodeIN.Substring(0, 5) == "KITAN") + { + answ = tipoCodiceBarcode.KitAnime; + } + else + { + answ = tipoCodiceBarcode.ListaPrelievo; + } break; //case "P": //case "A": @@ -359,7 +367,11 @@ public enum tipoCodiceBarcode /// /// Marcatore DataOra e Linea /// - DateTimeLine + DateTimeLine, + /// + /// Tipologia di KIT ANIME + /// + KitAnime } /// /// elenco degli esiti per una sessione di login da terminalino