From e294cd4eb00f0711290ee9e58b5e3aff9e97a4ce Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Fri, 3 Nov 2023 15:37:43 +0100 Subject: [PATCH] Fix ADM gest nuovi articoli --- MP-ADM/WebUserControls/mod_anagArticoli.ascx.cs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/MP-ADM/WebUserControls/mod_anagArticoli.ascx.cs b/MP-ADM/WebUserControls/mod_anagArticoli.ascx.cs index 905ad4a9..6ea8af3e 100644 --- a/MP-ADM/WebUserControls/mod_anagArticoli.ascx.cs +++ b/MP-ADM/WebUserControls/mod_anagArticoli.ascx.cs @@ -4,6 +4,7 @@ using SteamWare; using System; using System.Collections.Generic; using System.Data; +using System.Linq; using System.Web.UI.WebControls; namespace MP_ADM.WebUserControls @@ -108,9 +109,17 @@ namespace MP_ADM.WebUserControls /// protected void btnNew_Click(object sender, EventArgs e) { + // recupero codAzienda corrente... + string CodAzienda = "*"; + var listConf = DataLayerObj.taConfig.GetData(); + var recAzienda = listConf.Where(x => x.chiave == "Azienda").FirstOrDefault(); + if (recAzienda != null) + { + CodAzienda = recAzienda.valore != "*" ? recAzienda.valore : recAzienda.valoreStd; + } string tempCode = string.Format("_{0:yyyyMMdd-HHmmss}", DateTime.Now); string tempName = string.Format("Nuovo articolo creato {0:dd/MM/yyyy HH:mm:ss}", DateTime.Now); - DataLayerObj.taAnagArt.Insert(tempCode, tempName, "", "", "", "ART"); + DataLayerObj.taAnagArt.insert(tempCode, tempName, "", "", "ART", CodAzienda); // reset! resetSelezione(); }