public void LoadDataSource(ref XmlDataProviderManager x, string ID) { _x = x; Binding b = new Binding(); b.Source = _x.xdp; b.XPath = "/Dati/Dato[@ID]/Valore[@tipo='ErroriRilevati']"; dtgErroriRilevati.SetBinding(ItemsControl.ItemsSourceProperty, b); }
public void Load(XmlDataProviderManager x, string xpath) { _x = x; Binding b = new Binding(); b.Source = x.Document; b.XPath = xpath; XPath = b.XPath; dtgMain.SetBinding(ItemsControl.ItemsSourceProperty, b); }
private void RetrieveData(XmlDataProviderManager x_AP, string ID) { DataTable datiBil = cBusinessObjects.GetData(int.Parse(ID), typeof(Excel_Bilancio)); foreach (DataRow dtrow in datiBil.Rows) { //Calcolo valori attuali if (dtrow["EA"].ToString() != "" && !valoreEA.Contains(dtrow["ID"].ToString())) { valoreEA.Add(dtrow["ID"].ToString(), dtrow["EA"].ToString()); } else { if (!valoreEA.Contains(dtrow["ID"].ToString())) { valoreEA.Add(dtrow["ID"].ToString(), "0"); } } if (true) { if (dtrow["EP"].ToString() != "" && !valoreEP.Contains(dtrow["ID"].ToString())) { valoreEP.Add(dtrow["ID"].ToString(), dtrow["EP"].ToString()); } else { if (!valoreEP.Contains(dtrow["ID"].ToString())) { valoreEP.Add(dtrow["ID"].ToString(), "0"); } } } //Calcolo valori anno precedente if (dtrow["EP"].ToString() != "" && !valoreEA.Contains(dtrow["ID"].ToString())) { valoreEP.Add(dtrow["ID"].ToString(), dtrow["EP"].ToString()); } else { if (!valoreEP.Contains(dtrow["ID"].ToString())) { valoreEP.Add(dtrow["ID"].ToString(), "0"); } } } }
private void RetrieveData(XmlDataProviderManager _x, string ID) { if (_x != null) { foreach (XmlNode node in _x.Document.SelectNodes("/Dati//Dato[@ID='" + ID + "']/Valore")) { //Calcolo valori attuali if (node.Attributes["EA"] != null) { valoreEA.Add(node.Attributes["ID"].Value, node.Attributes["EA"].Value); } else { valoreEA.Add(node.Attributes["ID"].Value, "0"); } } } }
void txt_MouseDownCicli(object sender, MouseButtonEventArgs e, string Codice) { MasterFile mf = MasterFile.Create(); Hashtable revisioneNow = mf.GetRevisioneFromFileData(Sessioni[SessioneNow].ToString()); string revisioneAssociata = App.AppDataDataFolder + "\\" + revisioneNow["FileData"].ToString(); string revisioneTreeAssociata = App.AppDataDataFolder + "\\" + revisioneNow["File"].ToString(); string revisioneIDAssociata = revisioneNow["ID"].ToString(); string IDCliente = revisioneNow["Cliente"].ToString(); if (revisioneAssociata == "") { e.Handled = true; return; } XmlDataProviderManager _xNew = new XmlDataProviderManager(revisioneAssociata); WindowWorkArea wa = new WindowWorkArea(ref _xNew); //Nodi wa.NodeHome = 0; RevisoftApplication.XmlManager xt = new XmlManager(); xt.TipoCodifica = RevisoftApplication.XmlManager.TipologiaCodifica.Normale; XmlDataProvider TreeXmlProvider = new XmlDataProvider(); TreeXmlProvider.Document = xt.LoadEncodedFile(revisioneTreeAssociata); if (TreeXmlProvider.Document != null && TreeXmlProvider.Document.SelectSingleNode("/Tree") != null) { foreach (XmlNode item in TreeXmlProvider.Document.SelectNodes("/Tree//Node")) { if (item.Attributes["Codice"].Value == Codice) { wa.Nodes.Add(0, item); } } } if (wa.Nodes.Count == 0) { e.Handled = true; return; } wa.NodeNow = wa.NodeHome; wa.Owner = Window.GetWindow(this); //posizione e dimensioni finestra wa.WindowStartupLocation = System.Windows.WindowStartupLocation.CenterScreen; wa.Height = System.Windows.SystemParameters.PrimaryScreenHeight * 90.0 / 100.0; wa.Width = System.Windows.SystemParameters.PrimaryScreenWidth * 90.0 / 100.0; wa.MaxHeight = System.Windows.SystemParameters.PrimaryScreenHeight * 90.0 / 100.0; wa.MaxWidth = System.Windows.SystemParameters.PrimaryScreenWidth * 90.0 / 100.0; wa.MinHeight = System.Windows.SystemParameters.PrimaryScreenHeight * 90.0 / 100.0; wa.MinWidth = System.Windows.SystemParameters.PrimaryScreenWidth * 90.0 / 100.0; //Sessioni wa.Sessioni.Clear(); wa.Sessioni.Add(0, revisioneAssociata); wa.SessioniTitoli.Clear(); wa.SessioniTitoli.Add(0, ""); wa.SessioniID.Clear(); wa.SessioniID.Add(0, revisioneIDAssociata); wa.SessioneHome = 0; wa.SessioneNow = 0; //Variabili wa.ReadOnly = true; wa.ReadOnlyOLD = true; wa.ApertoInSolaLettura = true; //passaggio dati wa.IDTree = IDTree; wa.IDSessione = revisioneIDAssociata; wa.IDCliente = IDCliente; wa.Stato = App.TipoTreeNodeStato.Sconosciuto; wa.OldStatoNodo = wa.Stato; //apertura wa.Load(); App.MessaggioSolaScrittura = "Carta in sola lettura, premere tasto ESCI"; App.MessaggioSolaScritturaStato = "Carta in sola lettura, premere tasto ESCI"; wa.ShowDialog(); App.MessaggioSolaScrittura = "Occorre selezionare Sblocca Stato per modificare il contenuto."; App.MessaggioSolaScritturaStato = "Sessione in sola lettura, impossibile modificare lo stato."; }
public void Load(ref XmlDataProviderManager _x, XmlDataProviderManager x_AP, string _ID) { #region Dati da bilancio RetrieveData(_x, x_AP, IDB_Padre); #endregion SommeDaExcel.Add("B10", "89|54|59|98|99|3|4|32|80"); ValoriDaExcelEA.Add("B10", GetValoreEA("B10")); ValoriDaExcelEP.Add("B10", GetValoreEP("B10")); SommeDaExcel.Add("B13", "50"); ValoriDaExcelEA.Add("B13", GetValoreEA("B13")); ValoriDaExcelEP.Add("B13", GetValoreEP("B13")); SommeDaExcel.Add("B21", "16|7|23|33|60|53"); ValoriDaExcelEA.Add("B21", GetValoreEA("B21")); ValoriDaExcelEP.Add("B21", GetValoreEP("B21")); SommeDaExcel.Add("B31", "133|176|177"); ValoriDaExcelEA.Add("B31", GetValoreEA("B31")); ValoriDaExcelEP.Add("B31", GetValoreEP("B31")); SommeDaExcel.Add("B37", "123|129|134"); ValoriDaExcelEA.Add("B37", GetValoreEA("B37")); ValoriDaExcelEP.Add("B37", GetValoreEP("B37")); SommeDaExcel.Add("B45", "108|108|109|110|111|112|113|115|116|117|118|119|120|121|-120|-108|189|190|192|194|195|-198|-212|-199|-208|-202|-203|-204|-200|-209|-213|-214|-215|222|223|224|227|228|229|230|231|232|234|235|236|237|-239|-240|-241|-242|243|239|240|241|242|-239|-240|-241|-242|246|-250|256|-259|-266"); ValoriDaExcelEA.Add("B45", GetValoreEA("B45")); ValoriDaExcelEP.Add("B45", GetValoreEP("B45")); SommeDaExcel.Add("B53", "189|190|192|194|195"); ValoriDaExcelEA.Add("B53", GetValoreEA("B53")); ValoriDaExcelEP.Add("B53", GetValoreEP("B53")); SommeDaExcel.Add("B63", "189|190|192|194|195|-198|-212|-199|-208|-202|-203|-204|-200|-209|-213|-214|-215"); ValoriDaExcelEA.Add("B63", GetValoreEA("B63")); ValoriDaExcelEP.Add("B63", GetValoreEP("B63")); SommeDaExcel.Add("B68", "222|223|224|227|228|229|230|231|232|234|235|236|237|-239|-240|-241|-242|243|239|240|241|242|-239|-240|-241|-242"); ValoriDaExcelEA.Add("B68", GetValoreEA("B68")); ValoriDaExcelEP.Add("B68", GetValoreEP("B68")); SommeDaExcel.Add("B77", "189|190|192|194|195|-198|-212|-199|-208|-202|-203|-204|-200|-209|-213|-214|-215|222|223|224|227|228|229|230|231|232|234|235|236|237|-239|-240|-241|-242|243|239|240|241|242|-239|-240|-241|-242|246|-250|256|-259|-266"); ValoriDaExcelEA.Add("B77", GetValoreEA("B77")); ValoriDaExcelEP.Add("B77", GetValoreEP("B77")); txtEA_1.Text = cBusinessObjects.ConvertNumber(((double)(ValoriDaExcelEA["B31"]) == 0.0) ? "" : ((double)(ValoriDaExcelEA["B10"]) / (double)(ValoriDaExcelEA["B31"])).ToString()); txtEP_1.Text = cBusinessObjects.ConvertNumber(((double)(ValoriDaExcelEP["B31"]) == 0.0) ? "" : ((double)(ValoriDaExcelEP["B10"]) / (double)(ValoriDaExcelEP["B31"])).ToString()); txtEA_2.Text = cBusinessObjects.ConvertNumber(((double)(ValoriDaExcelEA["B31"]) == 0.0) ? "" : (((double)(ValoriDaExcelEA["B10"]) + (double)(ValoriDaExcelEA["B13"])) / (double)(ValoriDaExcelEA["B31"])).ToString()); txtEP_2.Text = cBusinessObjects.ConvertNumber(((double)(ValoriDaExcelEP["B31"]) == 0.0) ? "" : (((double)(ValoriDaExcelEP["B10"]) + (double)(ValoriDaExcelEP["B13"])) / (double)(ValoriDaExcelEP["B31"])).ToString()); txtEA_3.Text = cBusinessObjects.ConvertNumber(((double)(ValoriDaExcelEA["B45"]) == 0.0) ? "" : (((double)(ValoriDaExcelEA["B31"]) + (double)(ValoriDaExcelEA["B37"])) / (double)(ValoriDaExcelEA["B45"])).ToString()); txtEP_3.Text = cBusinessObjects.ConvertNumber(((double)(ValoriDaExcelEP["B45"]) == 0.0) ? "" : (((double)(ValoriDaExcelEP["B31"]) + (double)(ValoriDaExcelEP["B37"])) / (double)(ValoriDaExcelEP["B45"])).ToString()); txtEA_4.Text = cBusinessObjects.ConvertNumber((((double)(ValoriDaExcelEA["B31"]) + (double)(ValoriDaExcelEA["B37"])) == 0.0) ? "" : ((double)(ValoriDaExcelEA["B45"]) / ((double)(ValoriDaExcelEA["B31"]) + (double)(ValoriDaExcelEA["B37"]))).ToString()); txtEP_4.Text = cBusinessObjects.ConvertNumber((((double)(ValoriDaExcelEP["B31"]) + (double)(ValoriDaExcelEP["B37"])) == 0.0) ? "" : ((double)(ValoriDaExcelEP["B45"]) / ((double)(ValoriDaExcelEP["B31"]) + (double)(ValoriDaExcelEP["B37"]))).ToString()); txtEA_5.Text = cBusinessObjects.ConvertNumber(((double)(ValoriDaExcelEA["B21"]) == 0.0) ? "" : (((double)(ValoriDaExcelEA["B45"])) / (double)(ValoriDaExcelEA["B21"])).ToString()); txtEP_5.Text = cBusinessObjects.ConvertNumber(((double)(ValoriDaExcelEP["B21"]) == 0.0) ? "" : (((double)(ValoriDaExcelEP["B45"])) / (double)(ValoriDaExcelEP["B21"])).ToString()); txtEA_6.Text = cBusinessObjects.ConvertNumber(((double)(ValoriDaExcelEA["B21"]) == 0.0) ? "" : (((double)(ValoriDaExcelEA["B37"]) + (double)(ValoriDaExcelEA["B45"])) / (double)(ValoriDaExcelEA["B21"])).ToString()); txtEP_6.Text = cBusinessObjects.ConvertNumber(((double)(ValoriDaExcelEP["B21"]) == 0.0) ? "" : (((double)(ValoriDaExcelEP["B37"]) + (double)(ValoriDaExcelEP["B45"])) / (double)(ValoriDaExcelEP["B21"])).ToString()); txtEA_7.Text = cBusinessObjects.ConvertNumber((((double)(ValoriDaExcelEA["B13"]) + (double)(ValoriDaExcelEA["B10"]) - (double)(ValoriDaExcelEA["B31"])) == 0.0) ? "" : ((double)(ValoriDaExcelEA["B63"]) * 100.0 / ((double)(ValoriDaExcelEA["B13"]) + (double)(ValoriDaExcelEA["B10"]) - (double)(ValoriDaExcelEA["B31"]))).ToString()) + "%"; txtEP_7.Text = cBusinessObjects.ConvertNumber((((double)(ValoriDaExcelEP["B13"]) + (double)(ValoriDaExcelEP["B10"]) - (double)(ValoriDaExcelEP["B31"])) == 0.0) ? "" : ((double)(ValoriDaExcelEP["B63"]) * 100.0 / ((double)(ValoriDaExcelEP["B13"]) + (double)(ValoriDaExcelEP["B10"]) - (double)(ValoriDaExcelEP["B31"]))).ToString()) + "%"; txtEA_8.Text = cBusinessObjects.ConvertNumber(((double)(ValoriDaExcelEA["B45"]) == 0.0) ? "" : (((double)(ValoriDaExcelEA["B77"])) * 100.0 / (double)(ValoriDaExcelEA["B45"])).ToString()) + "%"; txtEP_8.Text = cBusinessObjects.ConvertNumber(((double)(ValoriDaExcelEP["B45"]) == 0.0) ? "" : (((double)(ValoriDaExcelEP["B77"])) * 100.0 / (double)(ValoriDaExcelEP["B45"])).ToString()) + "%"; txtEA_9.Text = cBusinessObjects.ConvertNumber(((double)(ValoriDaExcelEA["B53"]) == 0.0) ? "" : (((double)(ValoriDaExcelEA["B63"])) * 100.0 / (double)(ValoriDaExcelEA["B53"])).ToString()) + "%"; txtEP_9.Text = cBusinessObjects.ConvertNumber(((double)(ValoriDaExcelEP["B53"]) == 0.0) ? "" : (((double)(ValoriDaExcelEP["B63"])) * 100.0 / (double)(ValoriDaExcelEP["B53"])).ToString()) + "%"; if (((double)(ValoriDaExcelEA["B63"])) <= 0.0) { txtEA_10.Text = "n.c."; } else //if (((double)(ValoriDaExcelEA["B72"])) / -((double)(ValoriDaExcelEA["B77"])) > 1.0) { txtEA_10.Text = cBusinessObjects.ConvertNumber((((double)(ValoriDaExcelEA["B63"])) / -((double)(ValoriDaExcelEA["B68"]))).ToString()); } if (((double)(ValoriDaExcelEP["B63"])) <= 0.0) { txtEP_10.Text = "n.c."; } else { txtEP_10.Text = cBusinessObjects.ConvertNumber((((double)(ValoriDaExcelEP["B63"])) / -((double)(ValoriDaExcelEP["B68"]))).ToString()); } XmlNode xnode = _x.Document.SelectSingleNode("/Dati/Dato[@ID=" + _ID + "]"); if (xnode.Attributes["txtEA_1"] == null) { XmlAttribute attr = _x.Document.CreateAttribute("txtEA_1"); xnode.Attributes.Append(attr); } xnode.Attributes["txtEA_1"].Value = txtEA_1.Text; if (xnode.Attributes["txtEP_1"] == null) { XmlAttribute attr = _x.Document.CreateAttribute("txtEP_1"); xnode.Attributes.Append(attr); } xnode.Attributes["txtEP_1"].Value = txtEP_1.Text; if (xnode.Attributes["txtEA_2"] == null) { XmlAttribute attr = _x.Document.CreateAttribute("txtEA_2"); xnode.Attributes.Append(attr); } xnode.Attributes["txtEA_2"].Value = txtEA_2.Text; if (xnode.Attributes["txtEP_2"] == null) { XmlAttribute attr = _x.Document.CreateAttribute("txtEP_2"); xnode.Attributes.Append(attr); } xnode.Attributes["txtEP_2"].Value = txtEP_2.Text; if (xnode.Attributes["txtEA_3"] == null) { XmlAttribute attr = _x.Document.CreateAttribute("txtEA_3"); xnode.Attributes.Append(attr); } xnode.Attributes["txtEA_3"].Value = txtEA_3.Text; if (xnode.Attributes["txtEP_3"] == null) { XmlAttribute attr = _x.Document.CreateAttribute("txtEP_3"); xnode.Attributes.Append(attr); } xnode.Attributes["txtEP_3"].Value = txtEP_3.Text; if (xnode.Attributes["txtEA_4"] == null) { XmlAttribute attr = _x.Document.CreateAttribute("txtEA_4"); xnode.Attributes.Append(attr); } xnode.Attributes["txtEA_4"].Value = txtEA_4.Text; if (xnode.Attributes["txtEP_4"] == null) { XmlAttribute attr = _x.Document.CreateAttribute("txtEP_4"); xnode.Attributes.Append(attr); } xnode.Attributes["txtEP_4"].Value = txtEP_4.Text; if (xnode.Attributes["txtEA_5"] == null) { XmlAttribute attr = _x.Document.CreateAttribute("txtEA_5"); xnode.Attributes.Append(attr); } xnode.Attributes["txtEA_5"].Value = txtEA_5.Text; if (xnode.Attributes["txtEP_5"] == null) { XmlAttribute attr = _x.Document.CreateAttribute("txtEP_5"); xnode.Attributes.Append(attr); } xnode.Attributes["txtEP_5"].Value = txtEP_5.Text; if (xnode.Attributes["txtEA_6"] == null) { XmlAttribute attr = _x.Document.CreateAttribute("txtEA_6"); xnode.Attributes.Append(attr); } xnode.Attributes["txtEA_6"].Value = txtEA_6.Text; if (xnode.Attributes["txtEP_6"] == null) { XmlAttribute attr = _x.Document.CreateAttribute("txtEP_6"); xnode.Attributes.Append(attr); } xnode.Attributes["txtEP_6"].Value = txtEP_6.Text; if (xnode.Attributes["txtEA_7"] == null) { XmlAttribute attr = _x.Document.CreateAttribute("txtEA_7"); xnode.Attributes.Append(attr); } xnode.Attributes["txtEA_7"].Value = txtEA_7.Text; if (xnode.Attributes["txtEP_7"] == null) { XmlAttribute attr = _x.Document.CreateAttribute("txtEP_7"); xnode.Attributes.Append(attr); } xnode.Attributes["txtEP_7"].Value = txtEP_7.Text; if (xnode.Attributes["txtEA_8"] == null) { XmlAttribute attr = _x.Document.CreateAttribute("txtEA_8"); xnode.Attributes.Append(attr); } xnode.Attributes["txtEA_8"].Value = txtEA_8.Text; if (xnode.Attributes["txtEP_8"] == null) { XmlAttribute attr = _x.Document.CreateAttribute("txtEP_8"); xnode.Attributes.Append(attr); } xnode.Attributes["txtEP_8"].Value = txtEP_8.Text; if (xnode.Attributes["txtEA_9"] == null) { XmlAttribute attr = _x.Document.CreateAttribute("txtEA_9"); xnode.Attributes.Append(attr); } xnode.Attributes["txtEA_9"].Value = txtEA_9.Text; if (xnode.Attributes["txtEP_9"] == null) { XmlAttribute attr = _x.Document.CreateAttribute("txtEP_9"); xnode.Attributes.Append(attr); } xnode.Attributes["txtEP_9"].Value = txtEP_9.Text; if (xnode.Attributes["txtEA_10"] == null) { XmlAttribute attr = _x.Document.CreateAttribute("txtEA_10"); xnode.Attributes.Append(attr); } xnode.Attributes["txtEA_10"].Value = txtEA_10.Text; if (xnode.Attributes["txtEP_10"] == null) { XmlAttribute attr = _x.Document.CreateAttribute("txtEP_10"); xnode.Attributes.Append(attr); } xnode.Attributes["txtEP_10"].Value = txtEP_10.Text; _x.Save(); }
private void RetrieveData(XmlDataProviderManager _x, XmlDataProviderManager x_AP, string ID) { foreach (XmlNode node in _x.Document.SelectNodes("/Dati//Dato[@ID='" + ID + "']/Valore")) { //Calcolo valori attuali if (node.Attributes["EA"] != null) { if (!valoreEA.Contains(node.Attributes["ID"].Value)) { valoreEA.Add(node.Attributes["ID"].Value, node.Attributes["EA"].Value); } } else { if (!valoreEA.Contains(node.Attributes["ID"].Value)) { valoreEA.Add(node.Attributes["ID"].Value, "0"); } } if (x_AP == null || (x_AP != null && x_AP.Document.SelectSingleNode("/Dati//Dato[@ID='" + ID + "']/Valore[@ID='" + node.Attributes["ID"].Value + "']") == null)) { if (node.Attributes["EP"] != null) { if (!valoreEP.Contains(node.Attributes["ID"].Value)) { valoreEP.Add(node.Attributes["ID"].Value, node.Attributes["EP"].Value); } } else { if (!valoreEP.Contains(node.Attributes["ID"].Value)) { valoreEP.Add(node.Attributes["ID"].Value, "0"); } } } //Calcolo valori anno precedente if (x_AP != null) { XmlNode tmpNode = x_AP.Document.SelectSingleNode("/Dati//Dato[@ID='" + ID + "']/Valore[@ID='" + node.Attributes["ID"].Value + "']"); if (tmpNode != null) { if (tmpNode.Attributes["EA"] != null) { if (!valoreEP.Contains(node.Attributes["ID"].Value)) { valoreEP.Add(node.Attributes["ID"].Value, tmpNode.Attributes["EA"].Value); } } else { if (!valoreEP.Contains(node.Attributes["ID"].Value)) { valoreEP.Add(node.Attributes["ID"].Value, "0"); } } } else { if (!valoreEP.Contains(node.Attributes["ID"].Value)) { valoreEP.Add(node.Attributes["ID"].Value, "0"); } } } } }
public void Load(XmlDataProviderManager x_AP, string _ID, string IDCliente, string IDSessione) { id = int.Parse(_ID.ToString()); cBusinessObjects.idcliente = int.Parse(IDCliente.ToString()); cBusinessObjects.idsessione = int.Parse(IDSessione.ToString()); if (_ID == "325") { IDB_Padre = "321"; FileXML = App.AppTemplateBilancio_Riclassificato2016_Consolidato; } else { if (_ID == "139") { IDB_Padre = "134"; } if (_ID == "170") { IDB_Padre = "166"; } if (_ID == "173") { IDB_Padre = "172"; } if (_ID == "2016178") { IDB_Padre = "2016174"; IDBA_Padre = "2016174"; } if (_ID == "2016139") { IDB_Padre = "2016134"; IDBA_Padre = "2016134"; } if (_ID == "2016190") { IDB_Padre = "2016186"; IDBA_Padre = "2016186"; } datiTestata = cBusinessObjects.GetData(int.Parse(IDB_Padre), typeof(Excel_Bilancio_Testata)); string tipoBilancio = ""; foreach (DataRow dtrow in datiTestata.Rows) { if (dtrow["tipoBilancio"].ToString() != "") { tipoBilancio = dtrow["tipoBilancio"].ToString(); } } if (_Abbreviato) { switch (tipoBilancio) { case "Micro": FileXML = App.AppTemplateBilancioMicro_Riclassificato2016; break; case "2016": FileXML = App.AppTemplateBilancioAbbreviato_Riclassificato2016; break; default: FileXML = App.AppTemplateBilancioAbbreviato_Riclassificato; break; } } else { switch (tipoBilancio) { case "2016": FileXML = App.AppTemplateBilancio_Riclassificato2016; break; default: FileXML = App.AppTemplateBilancio_Riclassificato; break; } } } ID = _ID; dati = cBusinessObjects.GetData(id, typeof(Excel_BilancioRiclassificato)); dati.Clear(); #region Dati da bilancio RetrieveData(x_AP, IDB_Padre); #endregion XmlDataProviderManager _y = new XmlDataProviderManager(FileXML, true); AddTable(_y, "ATTIVO", ref grdATTIVITA, "TOTALE ATTIVITA'"); AddTable(_y, "PASSIVO", ref grdPASSIVITA, "TOTALE PASSIVITA'"); AddTable(_y, "CONTO ECONOMICO", ref grdCONTOECONOMICO, "RISULTATO OPERATIVO"); if (!_Abbreviato) { AddTable(_y, "SINTESI", ref grdSINTESI, "CAPITALE INVESTITO"); } else { TabSintesi.Visibility = System.Windows.Visibility.Collapsed; } cBusinessObjects.SaveData(id, dati, typeof(Excel_BilancioRiclassificato)); }
void txt_MouseDownCicli(object sender, MouseButtonEventArgs e) { if (e.ClickCount == 2) { MasterFile mf = MasterFile.Create(); Hashtable revisioneNow = mf.GetRevisioneFromFileData(Sessioni[SessioneNow].ToString()); string revisioneAssociata = App.AppDataDataFolder + "\\" + revisioneNow["FileData"].ToString(); string revisioneTreeAssociata = App.AppDataDataFolder + "\\" + revisioneNow["File"].ToString(); string revisioneIDAssociata = revisioneNow["ID"].ToString(); string IDCliente = revisioneNow["Cliente"].ToString(); if (revisioneAssociata == "") { e.Handled = true; return; } XmlDataProviderManager _xNew = new XmlDataProviderManager(revisioneAssociata); WindowWorkArea wa = new WindowWorkArea(ref _xNew); //Nodi wa.NodeHome = 0; RevisoftApplication.XmlManager xt = new XmlManager(); xt.TipoCodifica = RevisoftApplication.XmlManager.TipologiaCodifica.Normale; XmlDataProvider TreeXmlProvider = new XmlDataProvider(); TreeXmlProvider.Document = cBusinessObjects.NewLoadEncodedFile("", (Convert.ToInt32(App.TipoFile.Revisione)).ToString()); if (TreeXmlProvider.Document != null && TreeXmlProvider.Document.SelectSingleNode("/Tree") != null) { foreach (XmlNode item in TreeXmlProvider.Document.SelectNodes("/Tree//Node")) { if (item.Attributes["Codice"].Value == ((TextBlock)(sender)).ToolTip.ToString().Replace("Fare Doppio CLick per aprire la Carta di lavoro ", "")) { wa.Nodes.Add(0, item); } } } if (wa.Nodes.Count == 0) { e.Handled = true; return; } wa.NodeNow = wa.NodeHome; wa.Owner = Window.GetWindow(this); //posizione e dimensioni finestra wa.WindowStartupLocation = System.Windows.WindowStartupLocation.CenterScreen; wa.Height = System.Windows.SystemParameters.PrimaryScreenHeight * 90.0 / 100.0; wa.Width = System.Windows.SystemParameters.PrimaryScreenWidth * 90.0 / 100.0; wa.MaxHeight = System.Windows.SystemParameters.PrimaryScreenHeight * 90.0 / 100.0; wa.MaxWidth = System.Windows.SystemParameters.PrimaryScreenWidth * 90.0 / 100.0; wa.MinHeight = System.Windows.SystemParameters.PrimaryScreenHeight * 90.0 / 100.0; wa.MinWidth = System.Windows.SystemParameters.PrimaryScreenWidth * 90.0 / 100.0; //Sessioni wa.Sessioni.Clear(); wa.Sessioni.Add(0, revisioneAssociata); wa.SessioniTitoli.Clear(); wa.SessioniTitoli.Add(0, ""); wa.SessioniID.Clear(); wa.SessioniID.Add(0, revisioneIDAssociata); wa.SessioneHome = 0; wa.SessioneNow = 0; //Variabili wa.ReadOnly = true; wa.ReadOnlyOLD = true; wa.ApertoInSolaLettura = true; //passaggio dati wa.IDTree = IDTree; wa.IDSessione = revisioneIDAssociata; wa.IDCliente = IDCliente; wa.Stato = App.TipoTreeNodeStato.Sconosciuto; wa.OldStatoNodo = wa.Stato; //apertura wa.Load(); wa.ShowDialog(); } }
private void RetrieveData(XmlDataProviderManager _x, XmlDataProviderManager x_AP, string ID) { DataTable datiBil = cBusinessObjects.GetData(int.Parse(ID), typeof(Excel_Bilancio)); foreach (DataRow dtrow in datiBil.Rows) { //Calcolo valori attuali if (!valoreEA.Contains(dtrow["ID"].ToString())) { if (dtrow["EA"] != null) { valoreEA.Add(dtrow["ID"].ToString(), dtrow["EA"].ToString()); } else { valoreEA.Add(dtrow["ID"].ToString(), "0"); } } if (!valoreEP.Contains(dtrow["ID"].ToString())) { // if ( x_AP == null || ( x_AP != null && x_AP.Document.SelectSingleNode( "/Dati//Dato[@ID='" + ID + "']/Valore[@ID='" + node.Attributes["ID"].Value + "']" ) == null ) ) if (true) { if (dtrow["EP"] != null) { valoreEP.Add(dtrow["ID"].ToString(), dtrow["EP"].ToString()); } else { valoreEP.Add(dtrow["ID"].ToString(), "0"); } } } //Calcolo valori anno precedente if (x_AP != null) { if (!valoreEP.Contains(dtrow["ID"].ToString())) { XmlNode tmpNode = null; // XmlNode tmpNode = x_AP.Document.SelectSingleNode( "/Dati//Dato[@ID='" + ID + "']/Valore[@ID='" + node.Attributes["ID"].Value + "']" ); if (tmpNode != null) { if (tmpNode.Attributes["EA"] != null) { valoreEP.Add(dtrow["ID"].ToString(), tmpNode.Attributes["EA"].Value); } else { valoreEP.Add(dtrow["ID"].ToString(), "0"); } } else { valoreEP.Add(dtrow["ID"].ToString(), "0"); } } } } }
public void Load(ref XmlDataProviderManager _x, XmlDataProviderManager x_AP, string _ID, string IDCliente, string IDSessione) { id = int.Parse(_ID.ToString()); cBusinessObjects.idcliente = int.Parse(IDCliente.ToString()); cBusinessObjects.idsessione = int.Parse(IDSessione.ToString()); if (_ID == "326") { IDB_Padre = "321"; } if (_ID == "207") { IDB_Padre = "227"; } if (_ID == "171") { IDB_Padre = "166"; } if (_ID == "174") { IDB_Padre = "172"; } if (_ID == "220") { IDB_Padre = "229"; } if (_ID == "140") { IDB_Padre = "134"; } if (_ID == "2016140") { IDB_Padre = "2016134"; } if (_ID == "2016179") { IDB_Padre = "2016174"; } if (_ID == "2016191") { IDB_Padre = "2016186"; } datiTestata = cBusinessObjects.GetData(int.Parse(IDB_Padre), typeof(Excel_Bilancio_Testata)); #region Dati da bilancio RetrieveData(_x, x_AP, IDB_Padre); string tipoBilancio = ""; bool abbreviato = false; if (_ID == "326") { SommeDaExcel.Clear(); //crediti verso clienti SommeDaExcel.Add("B7", "59|62|65|68|201677|201678"); //liquidità immediate differite SommeDaExcel.Add("B12", "3|4|81|82|83|84|85|86|32|35|38|41|76|201683|201651|98|77|71|73|59|62|65|68|201677|201678|90|91|92"); //Disponibilità SommeDaExcel.Add("B15", "51|52|53|54|201655|55|-148|-149"); //attivo fisso SommeDaExcel.Add("B25", "17|18|19|20|21|8|9|10|11|12|13|14|25|26|27|28|201627|43|44|33|36|39|42|60|63|66|69|72|78|201638|201639|40"); //Debiti Commerciali SommeDaExcel.Add("B34", "151|157|160|163|2016163"); //passività correnti SommeDaExcel.Add("B39", "142|151|157|160|163|2016163|133|136|139|145|154|169|172|175|176|177|166"); //passività consolidate SommeDaExcel.Add("B46", "124|125|2018125|126|129|2016164|2016126|134|137|140|143|146|152|155|158|161|164|167|170|173"); //mezzi propri SommeDaExcel.Add("B54", "108|109|110|111|112|114|2016114|2016998|20161131|20161132|20161133|20161134|20161135|20161136|20161137|20161138|20161139|20161140|20161141|20171142|20181142|20161142|20161143|117|11600|11601|11602|11603|11604|11605|115|11606|11607|116|11608|11609|11610|118|119|1160|11700|11701|11611"); //valore della produzione SommeDaExcel.Add("B62", "189|190|191|192|194|195"); //consumi SommeDaExcel.Add("B65", "198|212"); //utile operativo SommeDaExcel.Add("B72", "189|190|191|192|194|195|198|212|199|208|209|210|202|203|204|205|206|200|211|213|214|215"); //risultato netto della gestione finanziaria SommeDaExcel.Add("B77", "222|223|224|2016224|20162241|235|236|237|234|232|231|228|229|230|227|2016237|2016229|240|241|242|239|2016242|243"); //utile esercizio SommeDaExcel.Add("B87", "11611"); //capitale investito SommeDaExcel.Add("I22", "33|36|39|42|60|63|66|69|72|78|201638|201639|40|25|26|27|28|201627|43|44|8|9|10|11|12|13|14|17|18|19|20|21|55|51|52|53|54|201655|3|4|81|82|83|84|85|86|32|35|38|41|76|201683|201651|98|99|77|71|73|59|62|65|68|201677|201678|-151|-157|-160|-163|-2016163|-133|-136|-139|-145|-154|-169|-172|-166|-175|-176|-177|-148|-149"); } else { foreach (DataRow dtrow in datiTestata.Rows) { if (dtrow["tipoBilancio"].ToString() != "") { tipoBilancio = dtrow["tipoBilancio"].ToString(); } } if (IDB_Padre == "227" || IDB_Padre == "134" || IDB_Padre == "2016134" || IDB_Padre == "166") { switch (tipoBilancio) { case "2016": SommeDaExcel.Clear(); //crediti verso clienti SommeDaExcel.Add("B7", "59|62|65|68|201677|201678"); //liquidità immediate differite SommeDaExcel.Add("B12", "3|4|81|82|83|84|85|86|32|35|38|41|76|201683|201651|98|77|71|73|59|62|65|68|201677|201678|90|91|92"); //Disponibilità SommeDaExcel.Add("B15", "51|52|53|54|201655|55|-148|-149"); //attivo fisso SommeDaExcel.Add("B25", "17|18|19|20|21|8|9|10|11|12|13|14|25|26|27|28|201627|43|44|33|36|39|42|60|63|66|69|72|78|201638|201639|40"); //Debiti Commerciali SommeDaExcel.Add("B34", "151|157|160|163|2016163"); //passività correnti SommeDaExcel.Add("B39", "142|151|157|160|163|2016163|133|136|139|145|154|169|172|175|176|177|166"); //passività consolidate SommeDaExcel.Add("B46", "124|125|126|129|2016164|2016126|134|137|140|143|146|152|155|158|161|164|167|170|173"); //mezzi propri SommeDaExcel.Add("B54", "108|109|110|111|112|114|2016114|2016998|20161131|20161132|20161133|20161134|20161135|20161136|20161137|20161138|20161139|20161140|20161141|20171142|20161142|20161143|117|11600|11601|11602|11603|11604|11605|115|11606|11607|116|11608|11609|11610|118|119|1160|11700|11701|11611"); //valore della produzione SommeDaExcel.Add("B62", "189|190|191|192|194|195"); //consumi SommeDaExcel.Add("B65", "198|212"); //utile operativo SommeDaExcel.Add("B72", "189|190|191|192|194|195|198|212|199|208|209|210|202|203|204|205|206|200|211|213|214|215"); //risultato netto della gestione finanziaria SommeDaExcel.Add("B77", "222|223|224|2016224|20162241|235|236|237|234|232|231|228|229|230|227|2016237|2016229|240|241|242|239|2016242|243"); //utile esercizio SommeDaExcel.Add("B87", "11611"); //capitale investito SommeDaExcel.Add("I22", "33|36|39|42|60|63|66|69|72|78|201638|201639|40|25|26|27|28|201627|43|44|8|9|10|11|12|13|14|17|18|19|20|21|55|51|52|53|54|201655|3|4|81|82|83|84|85|86|32|35|38|41|76|201683|201651|98|99|77|71|73|59|62|65|68|201677|201678|-151|-157|-160|-163|-2016163|-133|-136|-139|-145|-154|-169|-172|-166|-175|-176|-177|-148|-149"); break; default: SommeDaExcel.Clear(); //crediti verso clienti SommeDaExcel.Add("B7", "59|62|65|68"); //liquidità immediate differite SommeDaExcel.Add("B12", "3|4|81|82|83|84|85|86|32|35|38|41|98|99|77|71|74|59|62|65|68|90|91|92"); //Disponibilità SommeDaExcel.Add("B15", "-148|55|51|52|53|54"); //attivo fisso SommeDaExcel.Add("B25", "17|18|19|20|21|8|9|10|11|12|13|14|25|26|27|28|43|44|33|36|39|42|60|63|66|69|72|75|78"); //Debiti Commerciali SommeDaExcel.Add("B34", "151|157|160|163"); //passività correnti SommeDaExcel.Add("B39", "142|151|157|160|163|133|136|139|145|154|169|172|176|177|166"); //passività consolidate SommeDaExcel.Add("B46", "124|125|126|129|134|137|140|143|146|152|155|158|161|164|167|170|173"); //mezzi propri SommeDaExcel.Add("B54", "108|109|110|111|112|113|117|11600|11601|11602|11603|11604|11605|115|11606|11607|116|11608|11609|11610|118|119|1160|11700|11701|120"); //valore della produzione SommeDaExcel.Add("B62", "189|190|191|192|194|195"); //consumi SommeDaExcel.Add("B65", "198|212"); //utile operativo SommeDaExcel.Add("B72", "189|190|191|192|194|195|198|212|199|208|209|210|202|203|204|205|206|200|211|213|214|215"); //risultato netto della gestione finanziaria SommeDaExcel.Add("B77", "222|223|224|227|228|229|230|231|232|234|235|236|237|239|240|241|242|243"); //utile esercizio SommeDaExcel.Add("B87", "120"); //capitale investito SommeDaExcel.Add("I22", "17|18|19|20|21|8|9|10|11|12|13|14|25|26|27|28|43|44|33|36|39|42|60|63|66|69|72|75|78|59|62|65|68|71|74|77|98|99|3|4|81|82|83|84|85|86|32|35|38|41|51|52|53|54|55|-151|-157|-160|-163|-133|-136|-139|-145|-154|-169|-172|-166|-176|-177|-148|-149"); break; } } else { abbreviato = true; switch (tipoBilancio) { case "Micro": SommeDaExcel.Clear(); //crediti verso clienti SommeDaExcel.Add("B7", ""); //liquidità immediate differite SommeDaExcel.Add("B12", "89|1059|1060|97|98|2|80"); //Disponibilità SommeDaExcel.Add("B15", "50|201655"); //attivo fisso SommeDaExcel.Add("B25", "7|16|1009"); //Debiti Commerciali SommeDaExcel.Add("B34", ""); //passività correnti SommeDaExcel.Add("B39", "133|175"); //passività consolidate SommeDaExcel.Add("B46", "123|129|134"); //mezzi propri SommeDaExcel.Add("B54", "108|109|110|111|112|114|100114|119|2016114|2016998|11611"); //valore della produzione SommeDaExcel.Add("B62", "189|2016190|190|191|192|194|195"); //consumi SommeDaExcel.Add("B65", "198|212"); //utile operativo SommeDaExcel.Add("B72", "189|2016190|190|191|192|194|195|198|212|199|2016208|208|209|210|211|202|203|204|205|206|2016204|200|209|213|214|215"); //risultato netto della gestione finanziaria SommeDaExcel.Add("B77", "222|223|224|2016224|20162241|235|236|237|234|232|231|228|229|230|227|2016237|2016231|2016229|240|241|242|239|2016242|243"); //utile esercizio SommeDaExcel.Add("B87", "11611"); //capitale investito SommeDaExcel.Add("I22", "7|16|1009|50|201655|89|1059|1060|97|98|2|80"); break; case "2016": SommeDaExcel.Clear(); //crediti verso clienti SommeDaExcel.Add("B7", ""); //liquidità immediate differite SommeDaExcel.Add("B12", "89|1059|1060|97|98|2|80"); //Disponibilità SommeDaExcel.Add("B15", "50|201655"); //attivo fisso SommeDaExcel.Add("B25", "7|16|1009"); //Debiti Commerciali SommeDaExcel.Add("B34", ""); //passività correnti SommeDaExcel.Add("B39", "133|175"); //passività consolidate SommeDaExcel.Add("B46", "123|129|134"); //mezzi propri SommeDaExcel.Add("B54", "108|109|110|111|112|114|100114|119|2016114|2016998|11611"); //valore della produzione SommeDaExcel.Add("B62", "189|2016190|190|191|192|194|195"); //consumi SommeDaExcel.Add("B65", "198|212"); //utile operativo SommeDaExcel.Add("B72", "189|2016190|190|191|192|194|195|198|212|199|2016208|208|209|210|211|202|203|204|205|206|2016204|200|209|213|214|215"); //risultato netto della gestione finanziaria SommeDaExcel.Add("B77", "222|223|224|2016224|20162241|235|236|237|234|232|231|228|229|230|227|2016237|2016231|2016229|240|241|242|239|2016242|243"); //utile esercizio SommeDaExcel.Add("B87", "11611"); //capitale investito SommeDaExcel.Add("I22", "7|16|1009|50|201655|89|1059|1060|97|98|2|80"); break; default: SommeDaExcel.Clear(); //crediti verso clienti SommeDaExcel.Add("B7", ""); //liquidità immediate differite SommeDaExcel.Add("B12", "89|1059|1060|97|3|4|80"); //Disponibilità SommeDaExcel.Add("B15", "50|201655"); //attivo fisso SommeDaExcel.Add("B25", "7|16|1009"); //Debiti Commerciali SommeDaExcel.Add("B34", ""); //passività correnti SommeDaExcel.Add("B39", "133|175"); //passività consolidate SommeDaExcel.Add("B46", "123|129|134"); //mezzi propri SommeDaExcel.Add("B54", "108|109|110|111|112|114|100114|119|2016114|2016998|11611"); //valore della produzione SommeDaExcel.Add("B62", "189|2016190|190|191|192|194|195"); //consumi SommeDaExcel.Add("B65", "198|212"); //utile operativo SommeDaExcel.Add("B72", "189|2016190|190|191|192|194|195|198|212|199|2016208|208|209|210|211|202|203|204|205|206|2016204|200|209|213|214|215"); //risultato netto della gestione finanziaria SommeDaExcel.Add("B77", "222|223|224|2016224|20162241|235|236|237|234|232|231|228|229|230|227|2016237|2016231|2016229|240|241|242|239|2016242|243"); //utile esercizio SommeDaExcel.Add("B87", "11611"); //capitale investito SommeDaExcel.Add("I22", "7|16|1009|50|201655|89|1059|1060|97|98|2|80"); break; } } } #endregion ValoriDaExcelEA.Add("B7", GetValoreEA("B7")); ValoriDaExcelEP.Add("B7", GetValoreEP("B7")); ValoriDaExcelEA.Add("B12", GetValoreEA("B12")); ValoriDaExcelEP.Add("B12", GetValoreEP("B12")); ValoriDaExcelEA.Add("B15", GetValoreEA("B15")); ValoriDaExcelEP.Add("B15", GetValoreEP("B15")); ValoriDaExcelEA.Add("B25", GetValoreEA("B25")); ValoriDaExcelEP.Add("B25", GetValoreEP("B25")); ValoriDaExcelEA.Add("B34", GetValoreEA("B34")); ValoriDaExcelEP.Add("B34", GetValoreEP("B34")); ValoriDaExcelEA.Add("B39", GetValoreEA("B39")); ValoriDaExcelEP.Add("B39", GetValoreEP("B39")); ValoriDaExcelEA.Add("B46", GetValoreEA("B46")); ValoriDaExcelEP.Add("B46", GetValoreEP("B46")); ValoriDaExcelEA.Add("B54", GetValoreEA("B54")); ValoriDaExcelEP.Add("B54", GetValoreEP("B54")); ValoriDaExcelEA.Add("B62", GetValoreEA("B62")); ValoriDaExcelEP.Add("B62", GetValoreEP("B62")); ValoriDaExcelEA.Add("B65", GetValoreEA("B65")); ValoriDaExcelEP.Add("B65", GetValoreEP("B65")); ValoriDaExcelEA.Add("B72", GetValoreEA("B72")); ValoriDaExcelEP.Add("B72", GetValoreEP("B72")); ValoriDaExcelEA.Add("B77", GetValoreEA("B77")); ValoriDaExcelEP.Add("B77", GetValoreEP("B77")); ValoriDaExcelEA.Add("B87", GetValoreEA("B87")); ValoriDaExcelEP.Add("B87", GetValoreEP("B87")); ValoriDaExcelEA.Add("I22", GetValoreEA("I22")); ValoriDaExcelEP.Add("I22", GetValoreEP("I22")); txtEA_1.Text = cBusinessObjects.ConvertNumber(((double)(ValoriDaExcelEA["B39"]) == 0.0) ? "" : ((double)(ValoriDaExcelEA["B12"]) / (double)(ValoriDaExcelEA["B39"])).ToString()); txtEP_1.Text = cBusinessObjects.ConvertNumber(((double)(ValoriDaExcelEP["B39"]) == 0.0) ? "" : ((double)(ValoriDaExcelEP["B12"]) / (double)(ValoriDaExcelEP["B39"])).ToString()); txtEA_2.Text = cBusinessObjects.ConvertNumber(((double)(ValoriDaExcelEA["B39"]) == 0.0) ? "" : (((double)(ValoriDaExcelEA["B12"]) + (double)(ValoriDaExcelEA["B15"])) / (double)(ValoriDaExcelEA["B39"])).ToString()); txtEP_2.Text = cBusinessObjects.ConvertNumber(((double)(ValoriDaExcelEP["B39"]) == 0.0) ? "" : (((double)(ValoriDaExcelEP["B12"]) + (double)(ValoriDaExcelEP["B15"])) / (double)(ValoriDaExcelEP["B39"])).ToString()); txtEA_3.Text = cBusinessObjects.ConvertNumber(((double)(ValoriDaExcelEA["B54"]) == 0.0) ? "" : (((double)(ValoriDaExcelEA["B39"]) + (double)(ValoriDaExcelEA["B46"])) / (double)(ValoriDaExcelEA["B54"])).ToString()); txtEP_3.Text = cBusinessObjects.ConvertNumber(((double)(ValoriDaExcelEP["B54"]) == 0.0) ? "" : (((double)(ValoriDaExcelEP["B39"]) + (double)(ValoriDaExcelEP["B46"])) / (double)(ValoriDaExcelEP["B54"])).ToString()); txtEA_4.Text = cBusinessObjects.ConvertNumber((((double)(ValoriDaExcelEA["B39"]) + (double)(ValoriDaExcelEA["B46"])) == 0.0) ? "" : ((double)(ValoriDaExcelEA["B54"]) / ((double)(ValoriDaExcelEA["B39"]) + (double)(ValoriDaExcelEA["B46"]))).ToString()); txtEP_4.Text = cBusinessObjects.ConvertNumber((((double)(ValoriDaExcelEP["B39"]) + (double)(ValoriDaExcelEP["B46"])) == 0.0) ? "" : ((double)(ValoriDaExcelEP["B54"]) / ((double)(ValoriDaExcelEP["B39"]) + (double)(ValoriDaExcelEP["B46"]))).ToString()); txtEA_5.Text = cBusinessObjects.ConvertNumber(((double)(ValoriDaExcelEA["B25"]) == 0.0) ? "" : (((double)(ValoriDaExcelEA["B54"])) / (double)(ValoriDaExcelEA["B25"])).ToString()); txtEP_5.Text = cBusinessObjects.ConvertNumber(((double)(ValoriDaExcelEP["B25"]) == 0.0) ? "" : (((double)(ValoriDaExcelEP["B54"])) / (double)(ValoriDaExcelEP["B25"])).ToString()); txtEA_6.Text = cBusinessObjects.ConvertNumber(((double)(ValoriDaExcelEA["B25"]) == 0.0) ? "" : (((double)(ValoriDaExcelEA["B46"]) + (double)(ValoriDaExcelEA["B54"])) / (double)(ValoriDaExcelEA["B25"])).ToString()); txtEP_6.Text = cBusinessObjects.ConvertNumber(((double)(ValoriDaExcelEP["B25"]) == 0.0) ? "" : (((double)(ValoriDaExcelEP["B46"]) + (double)(ValoriDaExcelEP["B54"])) / (double)(ValoriDaExcelEP["B25"])).ToString()); txtEA_7.Text = cBusinessObjects.ConvertNumber(((double)(ValoriDaExcelEA["I22"]) == 0.0) ? "" : (((double)(ValoriDaExcelEA["B72"])) / (double)(ValoriDaExcelEA["I22"]) * 100.0).ToString()) + "%"; txtEP_7.Text = cBusinessObjects.ConvertNumber(((double)(ValoriDaExcelEP["I22"]) == 0.0) ? "" : (((double)(ValoriDaExcelEP["B72"])) / (double)(ValoriDaExcelEP["I22"]) * 100.0).ToString()) + "%"; txtEA_8.Text = cBusinessObjects.ConvertNumber(((double)(ValoriDaExcelEA["B54"]) == 0.0) ? "" : (((double)(ValoriDaExcelEA["B87"])) / (double)(ValoriDaExcelEA["B54"]) * 100.0).ToString()) + "%"; txtEP_8.Text = cBusinessObjects.ConvertNumber(((double)(ValoriDaExcelEP["B54"]) == 0.0) ? "" : (((double)(ValoriDaExcelEP["B87"])) / (double)(ValoriDaExcelEP["B54"]) * 100.0).ToString()) + "%"; txtEA_9.Text = cBusinessObjects.ConvertNumber(((double)(ValoriDaExcelEA["B62"]) == 0.0) ? "" : (((double)(ValoriDaExcelEA["B72"])) / (double)(ValoriDaExcelEA["B62"]) * 100.0).ToString()) + "%"; txtEP_9.Text = cBusinessObjects.ConvertNumber(((double)(ValoriDaExcelEP["B62"]) == 0.0) ? "" : (((double)(ValoriDaExcelEP["B72"])) / (double)(ValoriDaExcelEP["B62"]) * 100.0).ToString()) + "%"; if (((double)(ValoriDaExcelEA["B77"])) >= 0.0) { txtEA_10.Text = "n.c."; } else //if (((double)(ValoriDaExcelEA["B72"])) / -((double)(ValoriDaExcelEA["B77"])) > 1.0) { txtEA_10.Text = cBusinessObjects.ConvertNumber((((double)(ValoriDaExcelEA["B72"])) / -((double)(ValoriDaExcelEA["B77"]))).ToString()); } if (((double)(ValoriDaExcelEP["B77"])) >= 0.0) { txtEP_10.Text = "n.c."; } else { txtEP_10.Text = cBusinessObjects.ConvertNumber((((double)(ValoriDaExcelEP["B72"])) / -((double)(ValoriDaExcelEP["B77"]))).ToString()); } if (abbreviato == true) { labelROI.Text = "R.O.I. (*)"; NotaROI.Visibility = Visibility.Visible; txtEA_11.Text = "n.c."; txtEP_11.Text = "n.c."; txtEA_12.Text = "n.c."; txtEP_12.Text = "n.c."; } else { labelROI.Text = "R.O.I."; NotaROI.Visibility = Visibility.Collapsed; txtEA_11.Text = ConvertInteger(((double)(ValoriDaExcelEA["B62"]) == 0.0) ? "" : Math.Abs((((double)(ValoriDaExcelEA["B7"])) * 365.0 / (double)(ValoriDaExcelEA["B62"]))).ToString()); txtEP_11.Text = ConvertInteger(((double)(ValoriDaExcelEP["B62"]) == 0.0) ? "" : Math.Abs((((double)(ValoriDaExcelEP["B7"])) * 365.0 / (double)(ValoriDaExcelEP["B62"]))).ToString()); txtEA_12.Text = ConvertInteger(((double)(ValoriDaExcelEA["B65"]) == 0.0) ? "" : Math.Abs((((double)(ValoriDaExcelEA["B34"])) * 365.0 / (double)(ValoriDaExcelEA["B65"]))).ToString()); txtEP_12.Text = ConvertInteger(((double)(ValoriDaExcelEP["B65"]) == 0.0) ? "" : Math.Abs((((double)(ValoriDaExcelEP["B34"])) * 365.0 / (double)(ValoriDaExcelEP["B65"]))).ToString()); } txtEA_13.Text = ConvertInteger(((double)(ValoriDaExcelEA["B62"]) == 0.0) ? "" : Math.Abs((((double)(ValoriDaExcelEA["B15"])) * 365.0 / (double)(ValoriDaExcelEA["B62"]))).ToString()); txtEP_13.Text = ConvertInteger(((double)(ValoriDaExcelEP["B62"]) == 0.0) ? "" : Math.Abs((((double)(ValoriDaExcelEP["B15"])) * 365.0 / (double)(ValoriDaExcelEP["B62"]))).ToString()); dati = cBusinessObjects.GetData(id, typeof(Excel_BilancioIndici)); if (dati.Rows.Count == 0) { dati.Rows.Add(id, cBusinessObjects.idcliente, cBusinessObjects.idsessione); } foreach (DataRow dtrow in dati.Rows) { dtrow["txtEA_1"] = txtEA_1.Text; dtrow["txtEP_1"] = txtEP_1.Text; dtrow["txtEA_2"] = txtEA_2.Text; dtrow["txtEP_2"] = txtEP_2.Text; dtrow["txtEA_3"] = txtEA_3.Text; dtrow["txtEP_3"] = txtEP_3.Text; dtrow["txtEA_4"] = txtEA_4.Text; dtrow["txtEP_4"] = txtEP_4.Text; dtrow["txtEA_5"] = txtEA_5.Text; dtrow["txtEP_5"] = txtEP_5.Text; dtrow["txtEA_6"] = txtEA_6.Text; dtrow["txtEP_6"] = txtEP_6.Text; dtrow["txtEA_7"] = txtEA_7.Text; dtrow["txtEP_7"] = txtEP_7.Text; dtrow["txtEA_8"] = txtEA_8.Text; dtrow["txtEP_8"] = txtEP_8.Text; dtrow["txtEA_9"] = txtEA_9.Text; dtrow["txtEP_9"] = txtEP_9.Text; dtrow["txtEA_10"] = txtEA_10.Text; dtrow["txtEP_10"] = txtEP_10.Text; dtrow["txtEA_11"] = txtEA_11.Text; dtrow["txtEP_11"] = txtEP_11.Text; dtrow["txtEA_12"] = txtEA_12.Text; dtrow["txtEP_12"] = txtEP_12.Text; dtrow["txtEA_13"] = txtEA_13.Text; dtrow["txtEP_13"] = txtEP_13.Text; } cBusinessObjects.SaveData(id, dati, typeof(Excel_BilancioIndici)); }
//----------------------------------------------------------------------------+ // Load | //----------------------------------------------------------------------------+ public void Load(ref XmlDataProviderManager x, string ID, string FileRevisione, Hashtable _Sessioni, Hashtable _SessioniTitoli, Hashtable _SessioniID, int _SessioneNow, string _IDTree, string _IDCliente, string _IDSessione) { AltoMedioBasso valore; DataTable dt; Image img; int i, id_scheda, j, k, row; string qry, val, xml; TextBlock txt; Uri uriSource; //----------------------------------------------- recupero dati da 2.9.1 .. 5 id = int.Parse(ID.ToString()); id_scheda = cBusinessObjects.GetIDTree(id); cBusinessObjects.idcliente = int.Parse(_IDCliente.ToString()); cBusinessObjects.idsessione = int.Parse(_IDSessione.ToString()); qry = string.Format( "select ID_SCHEDA,value from clsAltoMedioBasso " + "where (ID_SCHEDA in (10000205,10000217,10000218,10000219,10000220)) " + "and (ID_CLIENTE={0}) and (ID_SESSIONE={1}) " + "order by ID_SCHEDA ", cBusinessObjects.idcliente, cBusinessObjects.idsessione); dt = cBusinessObjects.ExecutesqlDataTable(qry); Sessioni = _Sessioni; SessioniTitoli = _SessioniTitoli; SessioniID = _SessioniID; SessioneNow = _SessioneNow; IDTree = _IDTree; IDCliente = _IDCliente; IDSessione = _IDSessione; _x = x.Clone(); _ID = ID; ArrayList Nodi = new ArrayList(); Nodi.Add("205"); Nodi.Add("217"); Nodi.Add("218"); Nodi.Add("219"); Nodi.Add("220"); Hashtable NodiAlias = new Hashtable(); NodiAlias.Add("205", "204"); NodiAlias.Add("217", "213"); NodiAlias.Add("218", "214"); NodiAlias.Add("219", "215"); NodiAlias.Add("220", "216"); #region xaml_objects1 row = 1; Grid grd = new Grid(); ColumnDefinition cd = new ColumnDefinition(); cd.Width = GridLength.Auto; grd.ColumnDefinitions.Add(cd); cd = new ColumnDefinition(); cd.Width = new GridLength(1, GridUnitType.Star); grd.ColumnDefinitions.Add(cd); cd = new ColumnDefinition(); cd.Width = new GridLength(1, GridUnitType.Star); grd.ColumnDefinitions.Add(cd); cd = new ColumnDefinition(); cd.Width = new GridLength(1, GridUnitType.Star); grd.ColumnDefinitions.Add(cd); RowDefinition rd = new RowDefinition(); grd.RowDefinitions.Add(rd); txt = new TextBlock(); grd.Children.Add(txt); Grid.SetRow(txt, 0); Grid.SetColumn(txt, 0); Border brd = new Border(); brd.BorderThickness = new Thickness(1.0); brd.BorderBrush = Brushes.LightGray; brd.Background = Brushes.LightGray; brd.Padding = new Thickness(2.0); txt = new TextBlock(); txt.Text = "Alto"; txt.FontSize = 14; txt.TextAlignment = TextAlignment.Center; txt.FontWeight = FontWeights.Bold; txt.Margin = new Thickness(0, 0, 0, 10); brd.Child = txt; grd.Children.Add(brd); Grid.SetRow(brd, 0); Grid.SetColumn(brd, 1); brd = new Border(); brd.BorderThickness = new Thickness(1.0); brd.BorderBrush = Brushes.LightGray; brd.Background = Brushes.LightGray; brd.Padding = new Thickness(2.0); txt = new TextBlock(); txt.Text = "Medio"; txt.FontSize = 14; txt.TextAlignment = TextAlignment.Center; txt.FontWeight = FontWeights.Bold; txt.Margin = new Thickness(0, 0, 0, 10); brd.Child = txt; grd.Children.Add(brd); Grid.SetRow(brd, 0); Grid.SetColumn(brd, 2); brd = new Border(); brd.BorderThickness = new Thickness(1.0); brd.BorderBrush = Brushes.LightGray; brd.Background = Brushes.LightGray; brd.Padding = new Thickness(2.0); txt = new TextBlock(); txt.Text = "Basso"; txt.FontSize = 14; txt.TextAlignment = TextAlignment.Center; txt.FontWeight = FontWeights.Bold; txt.Margin = new Thickness(0, 0, 0, 10); brd.Child = txt; grd.Children.Add(brd); Grid.SetRow(brd, 0); Grid.SetColumn(brd, 3); #endregion //---------------------------------------------------------- scansione valori for (i = 0; i < 5; i++) { //---------------------------------------------------------- lettura valore k = -1; valore = AltoMedioBasso.Sconosciuto; for (j = 0; j < dt.Rows.Count && k < 0; j++) { if (dt.Rows[j].ItemArray[0].ToString().EndsWith(Nodi[i].ToString())) { k = j; } } if (k > -1) { val = dt.Rows[k].ItemArray[1].ToString(); if (!string.IsNullOrEmpty(val)) { valore = (AltoMedioBasso)Convert.ToInt32(val); } } //---------------------------------------------- impostazione prima colonna rd = new RowDefinition(); grd.RowDefinitions.Add(rd); RevisoftApplication.XmlManager xt = new XmlManager(); xt.TipoCodifica = RevisoftApplication.XmlManager.TipologiaCodifica.Normale; XmlDataProvider TreeXmlProvider = new XmlDataProvider(); TreeXmlProvider.Document = xt.LoadEncodedFile(App.AppTemplateTreeRevisione); XmlNode tnode = TreeXmlProvider.Document.SelectSingleNode( "/Tree//Node[@ID=" + NodiAlias[Nodi[i]].ToString() + "]"); brd = new Border(); brd.BorderThickness = new Thickness(1.0); brd.BorderBrush = Brushes.LightGray; brd.Background = (row % 2 == 0) ? new SolidColorBrush(Color.FromArgb(126, 241, 241, 241)) : Brushes.White; brd.Padding = new Thickness(2.0); txt = new TextBlock(); txt.Text = tnode.Attributes["Codice"].Value + "\t" + tnode.Attributes["Titolo"].Value; txt.ToolTip = "Fare Doppio CLick per aprire la Carta di lavoro " + tnode.Attributes["Codice"].Value; txt.MouseDown += new MouseButtonEventHandler(txt_MouseDownCicli); txt.FontSize = 13; //---------------------------------------------- impostazione nodo "Valore" XmlNode nodeNodo = null; // XmlNode nodeNodo = _x.Document.SelectSingleNode( // "/Dati//Dato[@ID='" + _ID + "']/Valore[@ID='" + Nodi[i] + "']"); if (nodeNodo == null) { xml = "<Valore ID='" + Nodi[i].ToString() + "'/>"; XmlDocument doctmp = new XmlDocument(); doctmp.LoadXml(xml); XmlNode tmpNode_int = doctmp.SelectSingleNode("Valore"); XmlNode node_imp = _x.Document.ImportNode(tmpNode_int, true); _x.Document.SelectSingleNode( "/Dati//Dato[@ID='" + _ID + "']").AppendChild(node_imp); nodeNodo = _x.Document.SelectSingleNode( "/Dati//Dato[@ID='" + _ID + "']/Valore[@ID='" + Nodi[i].ToString() + "']"); } if (nodeNodo.Attributes["name"] == null) { XmlAttribute attr = _x.Document.CreateAttribute("name"); nodeNodo.Attributes.Append(attr); } nodeNodo.Attributes["name"].Value = tnode.Attributes["Codice"].Value + " " + tnode.Attributes["Titolo"].Value; if (nodeNodo.Attributes["value"] == null) { XmlAttribute attr = _x.Document.CreateAttribute("value"); nodeNodo.Attributes.Append(attr); } nodeNodo.Attributes["value"].Value = (Convert.ToInt32(valore)).ToString(); #region xaml_objects2 brd.Child = txt; grd.Children.Add(brd); Grid.SetRow(brd, row); Grid.SetColumn(brd, 0); brd = new Border(); brd.BorderThickness = new Thickness(1.0); brd.BorderBrush = Brushes.LightGray; brd.Background = (row % 2 == 0) ? new SolidColorBrush(Color.FromArgb(126, 241, 241, 241)) : Brushes.White; brd.Padding = new Thickness(2.0); img = new Image(); uriSource = (valore == AltoMedioBasso.Alto) ? new Uri(check, UriKind.Relative) : new Uri(uncheck, UriKind.Relative); img.Source = new BitmapImage(uriSource); img.Width = 16.0; brd.Child = img; grd.Children.Add(brd); Grid.SetRow(brd, row); Grid.SetColumn(brd, 1); brd = new Border(); brd.BorderThickness = new Thickness(1.0); brd.BorderBrush = Brushes.LightGray; brd.Background = (row % 2 == 0) ? new SolidColorBrush(Color.FromArgb(126, 241, 241, 241)) : Brushes.White; brd.Padding = new Thickness(2.0); img = new Image(); uriSource = (valore == AltoMedioBasso.Medio) ? new Uri(check, UriKind.Relative) : new Uri(uncheck, UriKind.Relative); img.Source = new BitmapImage(uriSource); img.Width = 16.0; brd.Child = img; grd.Children.Add(brd); Grid.SetRow(brd, row); Grid.SetColumn(brd, 2); brd = new Border(); brd.BorderThickness = new Thickness(1.0); brd.BorderBrush = Brushes.LightGray; brd.Background = (row % 2 == 0) ? new SolidColorBrush(Color.FromArgb(126, 241, 241, 241)) : Brushes.White; brd.Padding = new Thickness(2.0); img = new Image(); uriSource = (valore == AltoMedioBasso.Basso) ? new Uri(check, UriKind.Relative) : new Uri(uncheck, UriKind.Relative); img.Source = new BitmapImage(uriSource); img.Width = 16.0; brd.Child = img; grd.Children.Add(brd); Grid.SetRow(brd, row); Grid.SetColumn(brd, 3); #endregion row++; } brdMain.Child = grd; }
public void Load(ref XmlDataProviderManager x, string ID, string tab, Hashtable Sessioni, int SessioneNow, string Tab, string IDTree, string IDCliente) { _x = x; _ID = ID; id = int.Parse(ID.ToString()); cBusinessObjects.idcliente = int.Parse(IDCliente.ToString()); cBusinessObjects.idsessione = int.Parse(Sessioni[SessioneNow].ToString()); TabItem ti; dati = cBusinessObjects.GetData(id, typeof(NodoMultiplo)); foreach (DataRow dtrow in dati.Rows) { ti = new TabItem(); ti.Header = dtrow["Tab"].ToString(); switch (dtrow["Tipologia"].ToString()) { case "Testo": ucTesto Testo = new ucTesto(); Testo.ReadOnly = _ReadOnly; Testo.Load(dtrow["ID"].ToString(), IDCliente, Sessioni[SessioneNow].ToString()); ti.Content = Testo; break; case "Tabella": ucTabella Tabella = new ucTabella(); Tabella.ReadOnly = _ReadOnly; Tabella.Load(dtrow["ID"].ToString(), "", IDTree, "", IDCliente, Sessioni[SessioneNow].ToString()); ti.Content = Tabella; break; case "Tabella Replicabile": ucTabellaReplicata TabellaReplicata = new ucTabellaReplicata(); TabellaReplicata.ReadOnly = _ReadOnly; TabellaReplicata.Load(dtrow["ID"].ToString(), dtrow["Tab"].ToString(), IDTree, IDCliente, Sessioni[SessioneNow].ToString()); ti.Content = TabellaReplicata; break; case "Check List": ucCheckList CheckList = new ucCheckList(); CheckList.ReadOnly = _ReadOnly; CheckList.Load(dtrow["ID"].ToString(), IDCliente, Sessioni[SessioneNow].ToString()); ti.Content = CheckList; break; case "Check List +": ucCheckListPlus CheckListPlus = new ucCheckListPlus(); CheckListPlus.ReadOnly = _ReadOnly; CheckListPlus.Load(dtrow["ID"].ToString(), IDCliente, Sessioni[SessioneNow].ToString()); ti.Content = CheckListPlus; break; case "Nodo Multiplo": ucNodoMultiplo NodoMultiplo = new ucNodoMultiplo(); NodoMultiplo.ReadOnly = _ReadOnly; NodoMultiplo.Load(ref _x, dtrow["ID"].ToString(), dtrow["Tab"].ToString(), Sessioni, SessioneNow, Tab, IDTree, IDCliente); ti.Content = NodoMultiplo; break; case "Excel: Errori Rilevati": uc_Excel_ErroriRilevati uce_er = new uc_Excel_ErroriRilevati(); try { uce_er.LoadDataSource(dtrow["ID"].ToString(), IDCliente, Sessioni[SessioneNow].ToString()); } catch (Exception ex) { string log = ex.Message; } ti.Content = uce_er; break; case "Excel: Bilancio": uc_Excel_Bilancio uce_b = new uc_Excel_Bilancio(1); try { XmlDataProviderManager _x_AP = null; //if (Sessioni.Contains((SessioneNow + 1))) //{ // _x_AP = new XmlDataProviderManager(Sessioni[(SessioneNow + 1)].ToString()); //} uce_b.LoadDataSource(ref _x, ID, _x_AP, App.AppDataFolder + "\\" + Tab, IDCliente, cBusinessObjects.idsessione.ToString()); } catch (Exception ex) { string log = ex.Message; break; // uce_b.LoadDataSource(ref _x, "-1", null); } ti.Content = uce_b; break; default: break; } tabControl.Items.Add(ti); } }
public bool Load(string ID, string FileConclusione, Hashtable _Sessioni, Hashtable _SessioniTitoli, Hashtable _SessioniID, int _SessioneNow, string _IDTree, string _IDCliente, string _IDSessione) { id = int.Parse(ID.ToString()); cBusinessObjects.idcliente = int.Parse(_IDCliente.ToString()); cBusinessObjects.idsessione = int.Parse(_IDSessione.ToString()); Sessioni = _Sessioni; SessioniTitoli = _SessioniTitoli; SessioniID = _SessioniID; SessioneNow = _SessioneNow; IDTree = _IDTree; IDCliente = _IDCliente; IDSessione = _IDSessione; _ID = ID; #region DA MATERIALITA' MasterFile mf = MasterFile.Create(); string FileDataRevisione = mf.GetRevisioneAssociataFromConclusioneFile(FileConclusione); if (FileDataRevisione != "") { _lm = new XmlDataProviderManager(FileDataRevisione); } else { _lm = null; } DataTable tmpNode_true = null; string idsessionedatimaterialita = cBusinessObjects.CercaSessione("Conclusione", "Revisione", IDSessione, cBusinessObjects.idcliente); DataTable datimaterialita = cBusinessObjects.GetData(int.Parse(ID_Materialità_1), typeof(Excel_LimiteMaterialitaSPCE), cBusinessObjects.idcliente, int.Parse(idsessionedatimaterialita), 1); if (datimaterialita.Rows.Count > 0) { string statomat = ""; DataTable statom = cBusinessObjects.GetData(int.Parse(ID_Materialità_1), typeof(StatoNodi), cBusinessObjects.idcliente, int.Parse(idsessionedatimaterialita), 1); foreach (DataRow dd in statom.Rows) { statomat = dd["Stato"].ToString().Trim(); } if (datimaterialita.Rows.Count > 0 && statomat != "" && ((App.TipoTreeNodeStato)(Convert.ToInt32(statomat))) == App.TipoTreeNodeStato.Completato) { Materialità_1 = true; ucExcel_LimiteMaterialitaSPCE uce_lm = new ucExcel_LimiteMaterialitaSPCE(IDTree); uce_lm.Load(ID_Materialità_1, FileDataRevisione, IpotesiMaterialita.Prima, IDCliente, IDSessione); uce_lm.Save(); brdPrima.Visibility = System.Windows.Visibility.Visible; brdSeconda.Visibility = System.Windows.Visibility.Collapsed; brdTerza.Visibility = System.Windows.Visibility.Collapsed; tmpNode_true = datimaterialita; } //if (tmpNode_true == null) { datimaterialita = cBusinessObjects.GetData(int.Parse(ID_Materialità_2), typeof(Excel_LimiteMaterialitaSPCE), cBusinessObjects.idcliente, int.Parse(idsessionedatimaterialita), 1); statom = cBusinessObjects.GetData(int.Parse(ID_Materialità_2), typeof(StatoNodi), cBusinessObjects.idcliente, int.Parse(idsessionedatimaterialita), 1); foreach (DataRow dd in statom.Rows) { statomat = dd["Stato"].ToString().Trim(); } if (datimaterialita.Rows.Count > 0 && statomat != "" && ((App.TipoTreeNodeStato)(Convert.ToInt32(statomat))) == App.TipoTreeNodeStato.Completato) { Materialità_2 = true; ucExcel_LimiteMaterialitaSPCE uce_lm = new ucExcel_LimiteMaterialitaSPCE(IDTree); uce_lm.Load(ID_Materialità_2, FileDataRevisione, IpotesiMaterialita.Seconda, IDCliente, IDSessione); uce_lm.Save(); brdPrima.Visibility = System.Windows.Visibility.Collapsed; brdSeconda.Visibility = System.Windows.Visibility.Visible; brdTerza.Visibility = System.Windows.Visibility.Collapsed; tmpNode_true = datimaterialita; } //if (tmpNode_true == null) { datimaterialita = cBusinessObjects.GetData(int.Parse(ID_Materialità_3), typeof(Excel_LimiteMaterialitaSPCE), cBusinessObjects.idcliente, int.Parse(idsessionedatimaterialita), 1); statom = cBusinessObjects.GetData(int.Parse(ID_Materialità_3), typeof(StatoNodi), cBusinessObjects.idcliente, int.Parse(idsessionedatimaterialita), 1); foreach (DataRow dd in statom.Rows) { statomat = dd["Stato"].ToString().Trim(); } if (datimaterialita.Rows.Count > 0 && statomat != "" && ((App.TipoTreeNodeStato)(Convert.ToInt32(statomat))) == App.TipoTreeNodeStato.Completato) { Materialità_3 = true; ucExcel_LimiteMaterialitaSPCE uce_lm = new ucExcel_LimiteMaterialitaSPCE(IDTree); uce_lm.Load(ID_Materialità_3, FileDataRevisione, IpotesiMaterialita.Terza, IDCliente, IDSessione); uce_lm.Save(); brdPrima.Visibility = System.Windows.Visibility.Collapsed; brdSeconda.Visibility = System.Windows.Visibility.Collapsed; brdTerza.Visibility = System.Windows.Visibility.Visible; tmpNode_true = datimaterialita; } } } } if (tmpNode_true != null) { foreach (DataRow dtrow in tmpNode_true.Rows) { if (dtrow["ID"].ToString() == "txt7") { txt7.Text = dtrow["value"].ToString(); } if (dtrow["ID"].ToString() == "txt7_2sp") { txt7_2sp.Text = dtrow["value"].ToString(); } if (dtrow["ID"].ToString() == "txt7_2ce") { txt7_2ce.Text = dtrow["value"].ToString(); } if (dtrow["ID"].ToString() == "txt7_3sp") { txt7_3sp.Text = dtrow["value"].ToString(); } if (dtrow["ID"].ToString() == "txt7_3ec") { txt7_3ec.Text = dtrow["value"].ToString(); } if (dtrow["ID"].ToString() == "txt9") { txt9.Text = dtrow["value"].ToString(); } if (dtrow["ID"].ToString() == "txt9_2sp") { txt9_2sp.Text = dtrow["value"].ToString(); } if (dtrow["ID"].ToString() == "txt9_2ce") { txt9_2ce.Text = dtrow["value"].ToString(); } if (dtrow["ID"].ToString() == "txt9_3ec") { txt9_3ec.Text = dtrow["value"].ToString(); } if (dtrow["ID"].ToString() == "txt7BILANCIO") { txt7BILANCIO.Text = dtrow["value"].ToString(); } if (dtrow["ID"].ToString() == "txt7_2spBILANCIO") { txt7_2spBILANCIO.Text = dtrow["value"].ToString(); } if (dtrow["ID"].ToString() == "txt7_2ceBILANCIO") { txt7_2ceBILANCIO.Text = dtrow["value"].ToString(); } if (dtrow["ID"].ToString() == "txt7_3spBILANCIO") { txt7_3spBILANCIO.Text = dtrow["value"].ToString(); } if (dtrow["ID"].ToString() == "txt7_3ecBILANCIO") { txt7_3ecBILANCIO.Text = dtrow["value"].ToString(); } if (dtrow["ID"].ToString() == "txt9BILANCIO") { txt9BILANCIO.Text = dtrow["value"].ToString(); } if (dtrow["ID"].ToString() == "txt9_2spBILANCIO") { txt9_2spBILANCIO.Text = dtrow["value"].ToString(); } if (dtrow["ID"].ToString() == "txt9_2ceBILANCIO") { txt9_2ceBILANCIO.Text = dtrow["value"].ToString(); } if (dtrow["ID"].ToString() == "txt9_3spBILANCIO") { txt9_3spBILANCIO.Text = dtrow["value"].ToString(); } if (dtrow["ID"].ToString() == "txt9_3ecBILANCIO") { txt9_3ecBILANCIO.Text = dtrow["value"].ToString(); } if (dtrow["ID"].ToString() == "txt12") { txt12.Text = dtrow["value"].ToString(); } if (dtrow["ID"].ToString() == "txt12_2sp") { txt12_2sp.Text = dtrow["value"].ToString(); } if (dtrow["ID"].ToString() == "txt12_2sp") { txt12_2sp.Text = dtrow["value"].ToString(); } if (dtrow["ID"].ToString() == "txt12_2ce") { txt12_2ce.Text = dtrow["value"].ToString(); } if (dtrow["ID"].ToString() == "txt12_3sp") { txt12_3sp.Text = dtrow["value"].ToString(); } if (dtrow["ID"].ToString() == "txt12_3ec") { txt12_3ec.Text = dtrow["value"].ToString(); } if (dtrow["ID"].ToString() == "txt12BILANCIO") { txt12BILANCIO.Text = dtrow["value"].ToString(); } if (dtrow["ID"].ToString() == "txt12_2spBILANCIO") { txt12_2spBILANCIO.Text = dtrow["value"].ToString(); } if (dtrow["ID"].ToString() == "txt12_2ceBILANCIO") { txt12_2ceBILANCIO.Text = dtrow["value"].ToString(); } if (dtrow["ID"].ToString() == "txt12_3spBILANCIO") { txt12_3spBILANCIO.Text = dtrow["value"].ToString(); } if (dtrow["ID"].ToString() == "txt12_3ecBILANCIO") { txt12_3ecBILANCIO.Text = dtrow["value"].ToString(); } } } if (Materialità_1 == false && Materialità_2 == false && Materialità_3 == false) { MessageBox.Show("E' necessario completare prima la materialità", "Attenzione"); return(false); } if (((Materialità_1) ? 1 : 0) + ((Materialità_2) ? 1 : 0) + ((Materialità_3) ? 1 : 0) >= 2) { MessageBox.Show("Il confronto materialità può essere considerato valido solo nel caso sia stato utilizzato un solo calcolo della materialità.", "Attenzione"); return(false); } #endregion #region CONFRONTO MATERIALITA' CALCOLO txt7VALORE.Text = ConvertNumber((Convert.ToDouble((txt7BILANCIO.Text == "") ? "0" : txt7BILANCIO.Text) - Convert.ToDouble((txt7.Text == "") ? "0" : txt7.Text)).ToString()); txt9VALORE.Text = ConvertNumber((Convert.ToDouble((txt9BILANCIO.Text == "") ? "0" : txt9BILANCIO.Text) - Convert.ToDouble((txt9.Text == "") ? "0" : txt9.Text)).ToString()); txt12VALORE.Text = ConvertNumber((Convert.ToDouble((txt12BILANCIO.Text == "") ? "0" : txt12BILANCIO.Text) - Convert.ToDouble((txt12.Text == "") ? "0" : txt12.Text)).ToString()); txt7_2spVALORE.Text = ConvertNumber((Convert.ToDouble((txt7_2spBILANCIO.Text == "") ? "0" : txt7_2spBILANCIO.Text) - Convert.ToDouble((txt7_2sp.Text == "") ? "0" : txt7_2sp.Text)).ToString()); txt7_2ceVALORE.Text = ConvertNumber((Convert.ToDouble((txt7_2ceBILANCIO.Text == "") ? "0" : txt7_2ceBILANCIO.Text) - Convert.ToDouble((txt7_2ce.Text == "") ? "0" : txt7_2ce.Text)).ToString()); txt7_3spVALORE.Text = ConvertNumber((Convert.ToDouble((txt7_3spBILANCIO.Text == "") ? "0" : txt7_3spBILANCIO.Text) - Convert.ToDouble((txt7_3sp.Text == "") ? "0" : txt7_3sp.Text)).ToString()); txt7_3ecVALORE.Text = ConvertNumber((Convert.ToDouble((txt7_3ecBILANCIO.Text == "") ? "0" : txt7_3ecBILANCIO.Text) - Convert.ToDouble((txt7_3ec.Text == "") ? "0" : txt7_3ec.Text)).ToString()); txt9_2spVALORE.Text = ConvertNumber((Convert.ToDouble((txt9_2spBILANCIO.Text == "") ? "0" : txt9_2spBILANCIO.Text) - Convert.ToDouble((txt9_2sp.Text == "") ? "0" : txt9_2sp.Text)).ToString()); txt9_2ceVALORE.Text = ConvertNumber((Convert.ToDouble((txt9_2ceBILANCIO.Text == "") ? "0" : txt9_2ceBILANCIO.Text) - Convert.ToDouble((txt9_2ce.Text == "") ? "0" : txt9_2ce.Text)).ToString()); txt9_3spVALORE.Text = ConvertNumber((Convert.ToDouble((txt9_3spBILANCIO.Text == "") ? "0" : txt9_3spBILANCIO.Text) - Convert.ToDouble((txt9_3sp.Text == "") ? "0" : txt9_3sp.Text)).ToString()); txt9_3ecVALORE.Text = ConvertNumber((Convert.ToDouble((txt9_3ecBILANCIO.Text == "") ? "0" : txt9_3ecBILANCIO.Text) - Convert.ToDouble((txt9_3ec.Text == "") ? "0" : txt9_3ec.Text)).ToString()); txt12_2spVALORE.Text = ConvertNumber((Convert.ToDouble((txt12_2spBILANCIO.Text == "") ? "0" : txt12_2spBILANCIO.Text) - Convert.ToDouble((txt12_2sp.Text == "") ? "0" : txt12_2sp.Text)).ToString()); txt12_2ceVALORE.Text = ConvertNumber((Convert.ToDouble((txt12_2ceBILANCIO.Text == "") ? "0" : txt12_2ceBILANCIO.Text) - Convert.ToDouble((txt12_2ce.Text == "") ? "0" : txt12_2ce.Text)).ToString()); txt12_3spVALORE.Text = ConvertNumber((Convert.ToDouble((txt12_3spBILANCIO.Text == "") ? "0" : txt12_3spBILANCIO.Text) - Convert.ToDouble((txt12_3sp.Text == "") ? "0" : txt12_3sp.Text)).ToString()); txt12_3ecVALORE.Text = ConvertNumber((Convert.ToDouble((txt12_3ecBILANCIO.Text == "") ? "0" : txt12_3ecBILANCIO.Text) - Convert.ToDouble((txt12_3ec.Text == "") ? "0" : txt12_3ec.Text)).ToString()); txt7PERCENTUALE.Text = ConvertPercent(((Convert.ToDouble((txt7BILANCIO.Text == "") ? "0" : txt7BILANCIO.Text) - Convert.ToDouble((txt7.Text == "") ? "0" : txt7.Text)) / Convert.ToDouble((txt7.Text == "") ? "0" : txt7.Text)).ToString()); txt9PERCENTUALE.Text = ConvertPercent(((Convert.ToDouble((txt9BILANCIO.Text == "") ? "0" : txt9BILANCIO.Text) - Convert.ToDouble((txt9.Text == "") ? "0" : txt9.Text)) / Convert.ToDouble((txt9.Text == "") ? "0" : txt9.Text)).ToString()); txt12PERCENTUALE.Text = ConvertPercent(((Convert.ToDouble((txt12BILANCIO.Text == "") ? "0" : txt12BILANCIO.Text) - Convert.ToDouble((txt12.Text == "") ? "0" : txt12.Text)) / Convert.ToDouble((txt12.Text == "") ? "0" : txt12.Text)).ToString()); txt7_2spPERCENTUALE.Text = ConvertPercent(((Convert.ToDouble((txt7_2spBILANCIO.Text == "") ? "0" : txt7_2spBILANCIO.Text) - Convert.ToDouble((txt7_2sp.Text == "") ? "0" : txt7_2sp.Text)) / Convert.ToDouble((txt7_2sp.Text == "") ? "0" : txt7_2sp.Text)).ToString()); txt7_2cePERCENTUALE.Text = ConvertPercent(((Convert.ToDouble((txt7_2ceBILANCIO.Text == "") ? "0" : txt7_2ceBILANCIO.Text) - Convert.ToDouble((txt7_2ce.Text == "") ? "0" : txt7_2ce.Text)) / Convert.ToDouble((txt7_2ce.Text == "") ? "0" : txt7_2ce.Text)).ToString()); txt7_3spPERCENTUALE.Text = ConvertPercent(((Convert.ToDouble((txt7_3spBILANCIO.Text == "") ? "0" : txt7_3spBILANCIO.Text) - Convert.ToDouble((txt7_3sp.Text == "") ? "0" : txt7_3sp.Text)) / Convert.ToDouble((txt7_3sp.Text == "") ? "0" : txt7_3sp.Text)).ToString()); txt7_3ecPERCENTUALE.Text = ConvertPercent(((Convert.ToDouble((txt7_3ecBILANCIO.Text == "") ? "0" : txt7_3ecBILANCIO.Text) - Convert.ToDouble((txt7_3ec.Text == "") ? "0" : txt7_3ec.Text)) / Convert.ToDouble((txt7_3ec.Text == "") ? "0" : txt7_3ec.Text)).ToString()); txt9_2spPERCENTUALE.Text = ConvertPercent(((Convert.ToDouble((txt9_2spBILANCIO.Text == "") ? "0" : txt9_2spBILANCIO.Text) - Convert.ToDouble((txt9_2sp.Text == "") ? "0" : txt9_2sp.Text)) / Convert.ToDouble((txt9_2sp.Text == "") ? "0" : txt9_2sp.Text)).ToString()); txt9_2cePERCENTUALE.Text = ConvertPercent(((Convert.ToDouble((txt9_2ceBILANCIO.Text == "") ? "0" : txt9_2ceBILANCIO.Text) - Convert.ToDouble((txt9_2ce.Text == "") ? "0" : txt9_2ce.Text)) / Convert.ToDouble((txt9_2ce.Text == "") ? "0" : txt9_2ce.Text)).ToString()); txt9_3spPERCENTUALE.Text = ConvertPercent(((Convert.ToDouble((txt9_3spBILANCIO.Text == "") ? "0" : txt9_3spBILANCIO.Text) - Convert.ToDouble((txt9_3sp.Text == "") ? "0" : txt9_3sp.Text)) / Convert.ToDouble((txt9_3sp.Text == "") ? "0" : txt9_3sp.Text)).ToString()); txt9_3ecPERCENTUALE.Text = ConvertPercent(((Convert.ToDouble((txt9_3ecBILANCIO.Text == "") ? "0" : txt9_3ecBILANCIO.Text) - Convert.ToDouble((txt9_3ec.Text == "") ? "0" : txt9_3ec.Text)) / Convert.ToDouble((txt9_3ec.Text == "") ? "0" : txt9_3ec.Text)).ToString()); txt12_2spPERCENTUALE.Text = ConvertPercent(((Convert.ToDouble((txt12_2spBILANCIO.Text == "") ? "0" : txt12_2spBILANCIO.Text) - Convert.ToDouble((txt12_2sp.Text == "") ? "0" : txt12_2sp.Text)) / Convert.ToDouble((txt12_2sp.Text == "") ? "0" : txt12_2sp.Text)).ToString()); txt12_2cePERCENTUALE.Text = ConvertPercent(((Convert.ToDouble((txt12_2ceBILANCIO.Text == "") ? "0" : txt12_2ceBILANCIO.Text) - Convert.ToDouble((txt12_2ce.Text == "") ? "0" : txt12_2ce.Text)) / Convert.ToDouble((txt12_2ce.Text == "") ? "0" : txt12_2ce.Text)).ToString()); txt12_3spPERCENTUALE.Text = ConvertPercent(((Convert.ToDouble((txt12_3spBILANCIO.Text == "") ? "0" : txt12_3spBILANCIO.Text) - Convert.ToDouble((txt12_3sp.Text == "") ? "0" : txt12_3sp.Text)) / Convert.ToDouble((txt12_3sp.Text == "") ? "0" : txt12_3sp.Text)).ToString()); txt12_3ecPERCENTUALE.Text = ConvertPercent(((Convert.ToDouble((txt12_3ecBILANCIO.Text == "") ? "0" : txt12_3ecBILANCIO.Text) - Convert.ToDouble((txt12_3ec.Text == "") ? "0" : txt12_3ec.Text)) / Convert.ToDouble((txt12_3ec.Text == "") ? "0" : txt12_3ec.Text)).ToString()); #endregion return(true); }
void txt_MouseDown(object sender, MouseButtonEventArgs e) { if (e.ClickCount == 2) { //Se vecchio nodo presente nello stesso bilancio if (IDTree == "4") { WindowWorkArea wa = new WindowWorkArea(ref _x); //Nodi int index = -1; wa.NodeHome = -1; RevisoftApplication.XmlManager xt = new XmlManager(); xt.TipoCodifica = RevisoftApplication.XmlManager.TipologiaCodifica.Normale; XmlDataProvider TreeXmlProvider = new XmlDataProvider(); TreeXmlProvider.Document = xt.LoadEncodedFile(App.AppTemplateTreeBilancio); if (TreeXmlProvider.Document != null && TreeXmlProvider.Document.SelectSingleNode("/Tree") != null) { foreach (XmlNode item in TreeXmlProvider.Document.SelectNodes("/Tree//Node")) { if (item.Attributes["Tipologia"].Value == "Nodo Multiplo" || item.ChildNodes.Count == 1) { index++; if (item.Attributes["ID"].Value == ((TextBlock)(sender)).MaxHeight.ToString()) { wa.NodeHome = index; } wa.Nodes.Add(index, item); } } } if (wa.NodeHome == -1) { e.Handled = true; return; } wa.NodeNow = wa.NodeHome; wa.Owner = Window.GetWindow(this); //posizione e dimensioni finestra wa.WindowStartupLocation = System.Windows.WindowStartupLocation.CenterScreen; wa.Height = System.Windows.SystemParameters.PrimaryScreenHeight * 90.0 / 100.0; wa.Width = System.Windows.SystemParameters.PrimaryScreenWidth * 90.0 / 100.0; wa.MaxHeight = System.Windows.SystemParameters.PrimaryScreenHeight * 90.0 / 100.0; wa.MaxWidth = System.Windows.SystemParameters.PrimaryScreenWidth * 90.0 / 100.0; wa.MinHeight = System.Windows.SystemParameters.PrimaryScreenHeight * 90.0 / 100.0; wa.MinWidth = System.Windows.SystemParameters.PrimaryScreenWidth * 90.0 / 100.0; //Sessioni wa.Sessioni = Sessioni; wa.SessioniTitoli = SessioniTitoli; wa.SessioniID = SessioniID; foreach (DictionaryEntry item in Sessioni) { if (item.Value.ToString() == _x.File) { wa.SessioneHome = Convert.ToInt32(item.Key.ToString()); wa.SessioneNow = wa.SessioneHome; break; } } //Variabili wa.ReadOnly = true; wa.ReadOnlyOLD = true; wa.ApertoInSolaLettura = true; //XmlNode nodeSessione = node.SelectSingleNode( "Sessioni/Sessione[@Alias=\"" + selectedAliasCodificato + "\"]" ); //if ( nodeSessione != null ) //{ // wa.Stato = ((App.TipoTreeNodeStato)(Convert.ToInt32( nodeSessione.Attributes["Stato"].Value ))); // wa.OldStatoNodo = wa.Stato; //} //passaggio dati wa.IDTree = IDTree; wa.IDSessione = IDSessione; wa.IDCliente = IDCliente; //apertura wa.Load(); App.MessaggioSolaScrittura = "Carta in sola lettura, premere tasto ESCI"; App.MessaggioSolaScritturaStato = "Carta in sola lettura, premere tasto ESCI"; wa.ShowDialog(); App.MessaggioSolaScrittura = "Occorre selezionare Sblocca Stato per modificare il contenuto."; App.MessaggioSolaScritturaStato = "Sessione in sola lettura, impossibile modificare lo stato."; } else { MasterFile mf = MasterFile.Create(); string bilancioAssociato = mf.GetBilancioAssociatoFromConclusioneFile(Sessioni[SessioneNow].ToString()); string bilancioTreeAssociato = mf.GetBilancioTreeAssociatoFromConclusioneFile(Sessioni[SessioneNow].ToString()); string bilancioIDAssociato = mf.GetBilancioIDAssociatoFromConclusioneFile(Sessioni[SessioneNow].ToString()); if (bilancioAssociato == "") { e.Handled = true; return; } XmlDataProviderManager _xNew = new XmlDataProviderManager(bilancioAssociato); WindowWorkArea wa = new WindowWorkArea(ref _xNew); //Nodi wa.NodeHome = 0; RevisoftApplication.XmlManager xt = new XmlManager(); xt.TipoCodifica = RevisoftApplication.XmlManager.TipologiaCodifica.Normale; XmlDataProvider TreeXmlProvider = new XmlDataProvider(); TreeXmlProvider.Document = xt.LoadEncodedFile(bilancioTreeAssociato); if (TreeXmlProvider.Document != null && TreeXmlProvider.Document.SelectSingleNode("/Tree") != null) { foreach (XmlNode item in TreeXmlProvider.Document.SelectNodes("/Tree//Node")) { if (item.Attributes["Codice"].Value == ((TextBlock)(sender)).Text) { wa.Nodes.Add(0, item); } } } if (wa.Nodes.Count == 0) { e.Handled = true; return; } wa.NodeNow = wa.NodeHome; wa.Owner = Window.GetWindow(this); //posizione e dimensioni finestra wa.WindowStartupLocation = System.Windows.WindowStartupLocation.CenterScreen; wa.Height = System.Windows.SystemParameters.PrimaryScreenHeight * 90.0 / 100.0; wa.Width = System.Windows.SystemParameters.PrimaryScreenWidth * 90.0 / 100.0; wa.MaxHeight = System.Windows.SystemParameters.PrimaryScreenHeight * 90.0 / 100.0; wa.MaxWidth = System.Windows.SystemParameters.PrimaryScreenWidth * 90.0 / 100.0; wa.MinHeight = System.Windows.SystemParameters.PrimaryScreenHeight * 90.0 / 100.0; wa.MinWidth = System.Windows.SystemParameters.PrimaryScreenWidth * 90.0 / 100.0; //Sessioni wa.Sessioni.Clear(); wa.Sessioni.Add(0, bilancioAssociato); wa.SessioniTitoli.Clear(); wa.SessioniTitoli.Add(0, SessioniTitoli[SessioneNow].ToString()); wa.SessioniID.Clear(); wa.SessioniID.Add(0, bilancioIDAssociato); wa.SessioneHome = 0; wa.SessioneNow = 0; //Variabili wa.ReadOnly = true; wa.ReadOnlyOLD = true; wa.ApertoInSolaLettura = true; //passaggio dati wa.IDTree = "4"; wa.IDSessione = bilancioIDAssociato; wa.IDCliente = IDCliente; wa.Stato = App.TipoTreeNodeStato.Sconosciuto; wa.OldStatoNodo = wa.Stato; //apertura wa.Load(); App.MessaggioSolaScrittura = "Carta in sola lettura, premere tasto ESCI"; App.MessaggioSolaScritturaStato = "Carta in sola lettura, premere tasto ESCI"; wa.ShowDialog(); App.MessaggioSolaScrittura = "Occorre selezionare Sblocca Stato per modificare il contenuto."; App.MessaggioSolaScritturaStato = "Sessione in sola lettura, impossibile modificare lo stato."; } } }
private void AddTable(XmlDataProviderManager _y, string xpath, ref Grid grd, string titoloTotale) { int row = 0; Border brd; TextBlock txt; RowDefinition rd; double totEA_final = 0.0; double totEP_final = 0.0; //double tot_totEA = 0.0; //double tot_totEP = 0.0; //double parziale_totEA = 0.0; //double parziale_totEP = 0.0; Hashtable ht_totEA = new Hashtable(); Hashtable ht_totEP = new Hashtable(); //Hashtable ht_rowtotEA = new Hashtable(); //Hashtable ht_rowtotEP = new Hashtable(); Hashtable ht_tipo = new Hashtable(); foreach (XmlNode item in _y.Document.SelectNodes("/Dato/MacroGruppo[@name='" + xpath + "']/Bilancio")) { if (item.Attributes["name"] == null || item.Attributes["tipo"] == null) { continue; } DataRow crow = null; foreach (DataRow dtrow in dati.Rows) { if (dtrow["row"].ToString() == row.ToString() && dtrow["Titolo"].ToString() == xpath) { crow = dtrow; } } if (crow == null) { crow = dati.Rows.Add(id, cBusinessObjects.idcliente, cBusinessObjects.idsessione); } crow["row"] = row; crow["Titolo"] = xpath; crow["tipo"] = item.Attributes["tipo"].Value; if (item.Attributes["tipo"].Value == "spazio") { rd = new RowDefinition(); rd.Height = new GridLength(10.0); grd.RowDefinitions.Add(rd); row++; ht_tipo.Add(row, item.Attributes["tipo"].Value); continue; } else if (item.Attributes["tipo"].Value == "rigarossa") { rd = new RowDefinition(); grd.RowDefinitions.Add(rd); rd.Height = new GridLength(2.0); row++; ht_tipo.Add(row, item.Attributes["tipo"].Value); brd = new Border(); brd.BorderThickness = new Thickness(1.0); brd.BorderBrush = Brushes.DarkRed; grd.Children.Add(brd); Grid.SetRow(brd, row); Grid.SetColumn(brd, 0); Grid.SetColumnSpan(brd, 6); continue; } else { rd = new RowDefinition(); grd.RowDefinitions.Add(rd); row++; ht_tipo.Add(row, item.Attributes["tipo"].Value); } crow["name"] = item.Attributes["name"].Value; txt = new TextBlock(); txt.Text = item.Attributes["name"].Value; if (item.Attributes["tipo"].Value == "semitotale") { txt.FontWeight = FontWeights.Bold; } if (item.Attributes["tipo"].Value == "totale") { txt.FontWeight = FontWeights.Bold; txt.Background = Brushes.LavenderBlush; } if (item.Attributes["tipo"].Value == "grantotale") { txt.FontWeight = FontWeights.Bold; txt.Background = Brushes.DarkRed; txt.Foreground = Brushes.White; } txt.TextAlignment = TextAlignment.Left; txt.TextWrapping = TextWrapping.Wrap; txt.FontSize = 13; grd.Children.Add(txt); Grid.SetRow(txt, row); Grid.SetColumn(txt, 0); if (item.Attributes["tipo"].Value == "titolo") { continue; } double totEA = 0.0; double totEP = 0.0; foreach (string ID in item.Attributes["somma"].Value.Split('|')) { string realID = ID; double dblValore = 0.0; bool negativo = false; if (ID.Contains('-')) { realID = ID.Replace("-", ""); negativo = true; } if (valoreEA.Contains(realID)) { double.TryParse(valoreEA[realID].ToString(), out dblValore); } //parziale_totEA += dblValore; //tot_totEA += dblValore; if (negativo) { totEA -= dblValore; } else { totEA += dblValore; } dblValore = 0.0; if (valoreEP.Contains(realID)) { double.TryParse(valoreEP[realID].ToString(), out dblValore); } //parziale_totEP += dblValore; //tot_totEP += dblValore; if (negativo) { totEP -= dblValore; } else { totEP += dblValore; } } ht_totEA.Add(row, totEA); txt = new TextBlock(); txt.Text = ConvertNumber(totEA.ToString()); txt.TextAlignment = TextAlignment.Right; txt.FontSize = 13; crow["EA"] = txt.Text; if (item.Attributes["tipo"].Value == "semitotale") { txt.FontWeight = FontWeights.Bold; } if (item.Attributes["tipo"].Value == "totale") { txt.FontWeight = FontWeights.Bold; txt.Background = Brushes.LavenderBlush; } if (item.Attributes["tipo"].Value == "grantotale") { txt.FontWeight = FontWeights.Bold; txt.Background = Brushes.DarkRed; txt.Foreground = Brushes.White; } grd.Children.Add(txt); Grid.SetRow(txt, row); Grid.SetColumn(txt, 1); ht_totEP.Add(row, totEP); txt = new TextBlock(); txt.Text = ConvertNumber(totEP.ToString()); txt.TextAlignment = TextAlignment.Right; txt.FontSize = 13; crow["EP"] = txt.Text; if (item.Attributes["tipo"].Value == "semitotale") { txt.FontWeight = FontWeights.Bold; } if (item.Attributes["tipo"].Value == "totale") { txt.FontWeight = FontWeights.Bold; txt.Background = Brushes.LavenderBlush; } if (item.Attributes["tipo"].Value == "grantotale") { txt.FontWeight = FontWeights.Bold; txt.Background = Brushes.DarkRed; txt.Foreground = Brushes.White; } grd.Children.Add(txt); Grid.SetRow(txt, row); Grid.SetColumn(txt, 3); txt = new TextBlock(); txt.Text = ConvertNumber((totEA - totEP + 0.001).ToString()); txt.TextAlignment = TextAlignment.Right; txt.FontSize = 13; crow["DIFF"] = txt.Text; if (item.Attributes["tipo"].Value == "semitotale") { txt.FontWeight = FontWeights.Bold; } if (item.Attributes["tipo"].Value == "totale") { txt.FontWeight = FontWeights.Bold; txt.Background = Brushes.LavenderBlush; } if (item.Attributes["tipo"].Value == "grantotale") { txt.FontWeight = FontWeights.Bold; txt.Background = Brushes.DarkRed; txt.Foreground = Brushes.White; } grd.Children.Add(txt); Grid.SetRow(txt, row); Grid.SetColumn(txt, 5); if ((item.Attributes["tipo"].Value == "totale" || item.Attributes["tipo"].Value == "grantotale") && item.Attributes["final"] != null) { totEA_final = totEA; totEP_final = totEP; } } dati.AcceptChanges(); for (int i = 1; i <= row; i++) { //if (!ht_totEA.Contains(i)) //{ // if (ht_rowtotEA.Contains(i)) // { // AddRowWithTot(ref i, ref grd, Convert.ToDouble(ht_rowtotEA[i].ToString()), Convert.ToDouble(ht_rowtotEP[i].ToString()), tot_totEA, tot_totEP, ""); // continue; // } // continue; //} if (!ht_totEA.Contains(i)) { continue; } DataRow dd = null; foreach (DataRow dtrow in dati.Rows) { if ((dtrow["row"].ToString() == (i - 1).ToString()) && (dtrow["Titolo"].ToString() == xpath)) { dd = dtrow; } } txt = new TextBlock(); txt.Text = ConvertPercent(((totEA_final == 0.0) ? 0.0 : (Convert.ToDouble(ht_totEA[i].ToString()) / totEA_final)).ToString()); txt.TextAlignment = TextAlignment.Right; txt.FontSize = 13; if (dd != null) { dd["PERCENT_EA"] = txt.Text; } if (ht_tipo[i].ToString() == "semitotale") { txt.FontWeight = FontWeights.Bold; } if (ht_tipo[i].ToString() == "totale") { txt.FontWeight = FontWeights.Bold; txt.Background = Brushes.LavenderBlush; } if (ht_tipo[i].ToString() == "grantotale") { txt.FontWeight = FontWeights.Bold; txt.Background = Brushes.DarkRed; txt.Foreground = Brushes.White; } grd.Children.Add(txt); Grid.SetRow(txt, i); Grid.SetColumn(txt, 2); txt = new TextBlock(); txt.Text = ConvertPercent(((totEP_final == 0.0) ? 0.0 : (Convert.ToDouble(ht_totEP[i].ToString()) / totEP_final)).ToString()); txt.TextAlignment = TextAlignment.Right; txt.FontSize = 13; if (dd != null) { dd["PERCENT_EP"] = txt.Text; } if (ht_tipo[i].ToString() == "semitotale") { txt.FontWeight = FontWeights.Bold; } if (ht_tipo[i].ToString() == "totale") { txt.FontWeight = FontWeights.Bold; txt.Background = Brushes.LavenderBlush; } if (ht_tipo[i].ToString() == "grantotale") { txt.FontWeight = FontWeights.Bold; txt.Background = Brushes.DarkRed; txt.Foreground = Brushes.White; } grd.Children.Add(txt); Grid.SetRow(txt, i); Grid.SetColumn(txt, 4); dati.AcceptChanges(); } //AddRowWithTot(ref row, ref grd, tot_totEA, tot_totEP, tot_totEA, tot_totEP, titoloTotale); }
public bool Load(ref XmlDataProviderManager x, string ID, string FileConclusione, Hashtable _Sessioni, Hashtable _SessioniTitoli, Hashtable _SessioniID, int _SessioneNow, string _IDTree, string _IDCliente, string _IDSessione) { Sessioni = _Sessioni; SessioniTitoli = _SessioniTitoli; SessioniID = _SessioniID; SessioneNow = _SessioneNow; IDTree = _IDTree; IDCliente = _IDCliente; IDSessione = _IDSessione; _x = x.Clone(); _ID = ID; RowDefinition rd; Border brd; TextBlock txt; int row = 3; RevisoftApplication.XmlManager xt = new XmlManager(); xt.TipoCodifica = RevisoftApplication.XmlManager.TipologiaCodifica.Normale; XmlDataProvider TreeXmlProvider = new XmlDataProvider(); TreeXmlProvider.Document = xt.LoadEncodedFile(App.AppTemplateTreeBilancio); //Controllo degli indici pro salvataggio AP int indice = 0; MasterFile mf = MasterFile.Create(); if (IDTree == "4") { string FileDataRevisione = mf.GetRevisioneAssociataFromBilancioFile(FileConclusione); if (FileDataRevisione != "") { _lm = new XmlDataProviderManager(FileDataRevisione); } else { _lm = null; } _lb = x; } else { string FileDataRevisione = mf.GetRevisioneAssociataFromConclusioneFile(FileConclusione); string FileDataBilancio = mf.GetBilancioAssociatoFromConclusioneFile(FileConclusione); if (FileDataRevisione != "") { _lm = new XmlDataProviderManager(FileDataRevisione); } else { _lm = null; } if (FileDataBilancio != "") { _lb = new XmlDataProviderManager(FileDataBilancio); } else { _lb = null; } } double totaleimporto = 0.0; if (_lb != null) { foreach (XmlNode item in _lb.Document.SelectNodes("/Dati/Dato[@ID]/Valore[@tipo='ErroriRilevatiMR']")) { int indiceinterno = 0; if (item.Attributes["ID"] != null) { int.TryParse(item.Attributes["ID"].Value, out indiceinterno); } if (indiceinterno > indice) { indice = indiceinterno; } } Dictionary <int, XmlNode> lista = new Dictionary <int, XmlNode>(); foreach (XmlNode item in _lb.Document.SelectNodes("/Dati/Dato[@ID]/Valore[@tipo='ErroriRilevatiMR']")) { if (item.Attributes["name"].Value == "Totale") { continue; } XmlNode tnode = TreeXmlProvider.Document.SelectSingleNode("/Tree//Node[@ID=" + item.ParentNode.Attributes["ID"].Value + "]"); if (tnode == null) { continue; } int chiave = Convert.ToInt32(tnode.Attributes["Codice"].Value.Replace(".", "").Replace("A", "").Replace("B", "").Replace("C", "").Replace("D", "")); while (lista.Keys.Contains(chiave)) { chiave = chiave + 1; } lista.Add(chiave, item); } bool first = true; int indiceinternoRow = 0; foreach (KeyValuePair <int, XmlNode> itemD in lista.OrderBy(key => key.Key)) { XmlNode item = itemD.Value; XmlNode tnode = TreeXmlProvider.Document.SelectSingleNode("/Tree//Node[@ID=" + item.ParentNode.Attributes["ID"].Value + "]"); if (item.Attributes["ID"] == null) { XmlAttribute attr = _lb.Document.CreateAttribute("ID"); attr.Value = (++indice).ToString(); item.Attributes.Append(attr); } rd = new RowDefinition(); if (first) { first = false; rd.Height = new GridLength(0.0); } else { rd.Height = new GridLength(20.0); } grdMainMR.RowDefinitions.Add(rd); row++; brd = new Border(); brd.BorderThickness = new Thickness(1.0, 0, 0, 1.0); brd.BorderBrush = Brushes.Black; indiceinternoRow++; indicerow.Add(indiceinternoRow, row.ToString()); txt = new TextBlock(); txt.Name = "txtCodice" + row.ToString(); this.RegisterName(txt.Name, txt); txt.Text = tnode.ParentNode.Attributes["Codice"].Value; txt.ToolTip = tnode.ParentNode.Attributes["Titolo"].Value; txt.TextAlignment = TextAlignment.Left; txt.TextWrapping = TextWrapping.Wrap; txt.HorizontalAlignment = System.Windows.HorizontalAlignment.Center; txt.MaxHeight = Convert.ToInt32(tnode.ParentNode.Attributes["ID"].Value); txt.MouseDown += new MouseButtonEventHandler(txt_MouseDown); brd.Child = txt; grdMainMR.Children.Add(brd); Grid.SetRow(brd, row); Grid.SetColumn(brd, 0); brd = new Border(); brd.BorderThickness = new Thickness(1.0, 0, 0, 1.0); brd.BorderBrush = Brushes.Black; txt = new TextBlock(); txt.Text = (item.Attributes["name"].Value.Length > 30) ? item.Attributes["name"].Value.Substring(0, 30) + "[...]" : item.Attributes["name"].Value; txt.ToolTip = item.Attributes["name"].Value; txt.Name = "txtName" + row.ToString(); txt.Margin = new Thickness(0, 0, 0, 0); txt.Padding = new Thickness(0, 0, 0, 0); txt.TextAlignment = TextAlignment.Left; txt.HorizontalAlignment = System.Windows.HorizontalAlignment.Left; this.RegisterName(txt.Name, txt); brd.Child = txt; grdMainMR.Children.Add(brd); Grid.SetRow(brd, row); Grid.SetColumn(brd, 1); brd = new Border(); brd.BorderThickness = new Thickness(1.0, 0, 0, 1.0); brd.Background = Brushes.LightYellow; brd.BorderBrush = Brushes.Black; txt = new TextBlock(); txt.Text = item.Attributes["contoimputato"].Value; txt.Name = "txtcontoimputato" + row.ToString(); this.RegisterName(txt.Name, txt); txt.TextAlignment = TextAlignment.Right; brd.Child = txt; grdMainMR.Children.Add(brd); Grid.SetRow(brd, row); Grid.SetColumn(brd, 2); brd = new Border(); brd.BorderThickness = new Thickness(1.0, 0, 0, 1.0); brd.BorderBrush = Brushes.Black; txt = new TextBlock(); txt.Text = item.Attributes["contoproposto"].Value; txt.Name = "txtcontoproposto" + row.ToString(); this.RegisterName(txt.Name, txt); txt.TextAlignment = TextAlignment.Right; brd.Child = txt; grdMainMR.Children.Add(brd); Grid.SetRow(brd, row); Grid.SetColumn(brd, 3); brd = new Border(); brd.BorderThickness = new Thickness(1.0, 0, 0, 1.0); brd.BorderBrush = Brushes.Black; txt = new TextBlock(); txt.Text = ConvertNumber(item.Attributes["importo"].Value); double valueimporto = 0; double.TryParse(txt.Text, out valueimporto); totaleimporto += valueimporto; txt.Name = "txtEA" + row.ToString(); this.RegisterName(txt.Name, txt); txt.TextAlignment = TextAlignment.Right; brd.Child = txt; grdMainMR.Children.Add(brd); Grid.SetRow(brd, row); Grid.SetColumn(brd, 4); brd = new Border(); brd.BorderThickness = new Thickness(1.0, 0, 1.0, 1.0); brd.BorderBrush = Brushes.Black; brd.Background = Brushes.White; CheckBox chk = new CheckBox(); chk.Name = "chkCorretto" + row.ToString(); this.RegisterName(chk.Name, chk); chk.IsChecked = Convert.ToBoolean(item.Attributes["corretto"].Value); chk.IsHitTestVisible = false; chk.HorizontalAlignment = System.Windows.HorizontalAlignment.Center; chk.VerticalAlignment = System.Windows.VerticalAlignment.Center; chk.VerticalContentAlignment = System.Windows.VerticalAlignment.Center; brd.Child = chk; grdMainMR.Children.Add(brd); Grid.SetRow(brd, row); Grid.SetColumn(brd, 5); } rowTOT = row; rd = new RowDefinition(); rd.Height = new GridLength(20.0); grdMainMR.RowDefinitions.Add(rd); rd = new RowDefinition(); rd.Height = new GridLength(30.0); grdMainMR.RowDefinitions.Add(rd); row++; brd = new Border(); brd.BorderThickness = new Thickness(0.0); brd.BorderBrush = Brushes.Black; brd.Background = Brushes.White; txt = new TextBlock(); txt.Text = "TOTALE DELLE RETTIFICHE"; txt.HorizontalAlignment = System.Windows.HorizontalAlignment.Right; txt.Height = 30; txt.Margin = new Thickness(0, 0, 20, 0); txt.FontWeight = FontWeights.Bold; txt.Padding = new Thickness(0, 7, 3, 0); brd.Child = txt; grdMainMR.Children.Add(brd); Grid.SetRow(brd, row); Grid.SetColumn(brd, 1); brd = new Border(); brd.BorderThickness = new Thickness(1.0, 0, 1.0, 1.0); brd.BorderBrush = Brushes.Black; brd.Background = Brushes.LightYellow; txt = new TextBlock(); txt.Name = "txtTotEA"; this.RegisterName(txt.Name, txt); txt.Text = ConvertNumber(totaleimporto.ToString()); txt.TextAlignment = TextAlignment.Right; txt.FontWeight = FontWeights.Bold; txt.Padding = new Thickness(0, 7, 3, 0); txt.Height = 30; brd.Child = txt; grdMainMR.Children.Add(brd); Grid.SetRow(brd, row); Grid.SetColumn(brd, 4); } CalculateValues(null); indice = 0; row = 3; if (_lb != null) { foreach (XmlNode item in _lb.Document.SelectNodes("/Dati/Dato[@ID]/Valore[@tipo='ErroriRilevatiNN']")) { int indiceinterno = 0; if (item.Attributes["ID"] != null) { int.TryParse(item.Attributes["ID"].Value, out indiceinterno); } if (indiceinterno > indice) { indice = indiceinterno; } } Dictionary <int, XmlNode> lista = new Dictionary <int, XmlNode>(); foreach (XmlNode item in _lb.Document.SelectNodes("/Dati/Dato[@ID]/Valore[@tipo='ErroriRilevatiNN']")) { if (item.Attributes["name"].Value == "Totale") { continue; } XmlNode tnode = TreeXmlProvider.Document.SelectSingleNode("/Tree//Node[@ID=" + item.ParentNode.Attributes["ID"].Value + "]"); if (tnode == null) { continue; } int chiave = Convert.ToInt32(tnode.Attributes["Codice"].Value.Replace(".", "").Replace("A", "").Replace("B", "").Replace("C", "").Replace("D", "")); while (lista.Keys.Contains(chiave)) { chiave = chiave + 1; } lista.Add(chiave, item); } bool first = true; foreach (KeyValuePair <int, XmlNode> itemD in lista.OrderBy(key => key.Key)) { XmlNode item = itemD.Value; XmlNode tnode = TreeXmlProvider.Document.SelectSingleNode("/Tree//Node[@ID=" + item.ParentNode.Attributes["ID"].Value + "]"); if (item.Attributes["ID"] == null) { XmlAttribute attr = _lb.Document.CreateAttribute("ID"); attr.Value = (++indice).ToString(); item.Attributes.Append(attr); } rd = new RowDefinition(); if (first) { first = false; rd.Height = new GridLength(0.0); } else { rd.Height = new GridLength(20.0); } grdMainNN.RowDefinitions.Add(rd); row++; brd = new Border(); brd.BorderThickness = new Thickness(1.0, 0, 0, 1.0); brd.BorderBrush = Brushes.Black; txt = new TextBlock(); txt.Text = tnode.ParentNode.Attributes["Codice"].Value; txt.ToolTip = tnode.ParentNode.Attributes["Titolo"].Value; txt.TextAlignment = TextAlignment.Left; txt.TextWrapping = TextWrapping.Wrap; txt.HorizontalAlignment = System.Windows.HorizontalAlignment.Center; txt.MaxHeight = Convert.ToInt32(tnode.ParentNode.Attributes["ID"].Value); txt.MouseDown += new MouseButtonEventHandler(txt_MouseDown); brd.Child = txt; grdMainNN.Children.Add(brd); Grid.SetRow(brd, row); Grid.SetColumn(brd, 0); brd = new Border(); brd.BorderThickness = new Thickness(1.0, 0, 0, 1.0); brd.BorderBrush = Brushes.Black; txt = new TextBlock(); txt.Text = (item.Attributes["name"].Value.Length > 30) ? item.Attributes["name"].Value.Substring(0, 30) + "[...]" : item.Attributes["name"].Value; txt.ToolTip = item.Attributes["name"].Value; txt.Margin = new Thickness(0, 0, 0, 0); txt.Padding = new Thickness(0, 0, 0, 0); txt.TextAlignment = TextAlignment.Left; txt.HorizontalAlignment = System.Windows.HorizontalAlignment.Left; brd.Child = txt; grdMainNN.Children.Add(brd); Grid.SetRow(brd, row); Grid.SetColumn(brd, 1); brd = new Border(); brd.BorderThickness = new Thickness(1.0, 0, 0, 1.0); brd.Background = Brushes.LightYellow; brd.BorderBrush = Brushes.Black; txt = new TextBlock(); txt.Text = item.Attributes["numero"].Value; txt.TextAlignment = TextAlignment.Right; brd.Child = txt; grdMainNN.Children.Add(brd); Grid.SetRow(brd, row); Grid.SetColumn(brd, 2); brd = new Border(); brd.BorderThickness = new Thickness(1.0, 0, 1.0, 1.0); brd.BorderBrush = Brushes.Black; brd.Background = Brushes.White; CheckBox chk = new CheckBox(); chk.IsChecked = Convert.ToBoolean(item.Attributes["corretto"].Value); chk.IsHitTestVisible = false; chk.HorizontalAlignment = System.Windows.HorizontalAlignment.Center; chk.VerticalAlignment = System.Windows.VerticalAlignment.Center; chk.VerticalContentAlignment = System.Windows.VerticalAlignment.Center; brd.Child = chk; grdMainNN.Children.Add(brd); Grid.SetRow(brd, row); Grid.SetColumn(brd, 3); } rd = new RowDefinition(); rd.Height = new GridLength(20.0); grdMainNN.RowDefinitions.Add(rd); } return(true); }
public void Load(string __ID, string FileData, string IDCliente, string IDTree, string IDSessione) { id = int.Parse(__ID); cBusinessObjects.idcliente = int.Parse(IDCliente.ToString()); cBusinessObjects.idsessione = int.Parse(IDSessione.ToString()); dati = cBusinessObjects.GetData(id, typeof(DestinatariEBilancio)); _ID = __ID; _IDTree = IDTree; if (_ReadOnly == true) { if (IDTree != "19" || __ID == "281") { cmbDestinatari.PreviewKeyDown += obj_PreviewKeyDown; cmbDestinatari.PreviewMouseLeftButtonDown += obj_PreviewMouseLeftButtonDown; } if (__ID != "281") { cmbBilancio.PreviewKeyDown += obj_PreviewKeyDown; cmbBilancio.PreviewMouseLeftButtonDown += obj_PreviewMouseLeftButtonDown; } } if (IDTree == "19") { if (__ID != "281") { brdDestinatari.Visibility = System.Windows.Visibility.Collapsed; } if (__ID == "281") { brdBilancio2.Visibility = System.Windows.Visibility.Collapsed; cmbitem1.Content = "Al Consiglio di Amministrazione"; cmbitem2.Content = "All'Amministratore Unico"; cmbitem3.Content = "Alla Direzione generale"; } brdBilancio.Visibility = System.Windows.Visibility.Collapsed; } DataRow xnode = null; if (dati.Rows.Count == 0) { dati.Rows.Add(id, cBusinessObjects.idcliente, cBusinessObjects.idsessione); } foreach (DataRow dtrow in dati.Rows) { xnode = dtrow; } if (IDTree != "19") { MasterFile mf = MasterFile.Create(); string FileBilancio = ""; string FileRevisione = ""; if (IDTree == "22") { FileBilancio = mf.GetBilancioAssociatoFromRelazioneVFile(FileData); FileRevisione = mf.GetRevisioneAssociataFromRelazioneVFile(FileData); } if (IDTree == "32") { FileBilancio = mf.GetBilancioAssociatoFromRelazioneVCFile(FileData); FileRevisione = mf.GetRevisioneAssociataFromRelazioneVCFile(FileData); } if (IDTree == "21") { FileBilancio = mf.GetBilancioAssociatoFromRelazioneBFile(FileData); FileRevisione = mf.GetRevisioneAssociataFromRelazioneBFile(FileData); } if (IDTree == "31") { FileBilancio = mf.GetBilancioAssociatoFromRelazioneBCFile(FileData); FileRevisione = mf.GetRevisioneAssociataFromRelazioneBCFile(FileData); } if (IDTree == "23") { FileBilancio = mf.GetBilancioAssociatoFromRelazioneBVFile(FileData); FileRevisione = mf.GetRevisioneAssociataFromRelazioneBVFile(FileData); } XmlDataProviderManager _b = null; //if (FileBilancio != "" && (new FileInfo(FileBilancio)).Exists) if (!string.IsNullOrEmpty(FileBilancio)) { _b = new XmlDataProviderManager(FileBilancio); } else { _b = null; } //XmlDataProviderManager _y = null; #region Dati da revisione xnode["RagioneSociale"] = "Dato Mancante: Compilare Carta di Lavoro 2.1.1"; xnode["RagioneSociale"] = cBusinessObjects.GetRagioneSociale(); xnode["Indirizzo"] = cBusinessObjects.GetIndirizzo(); xnode["REA"] = cBusinessObjects.GetREA(); xnode["CapitaleSociale"] = cBusinessObjects.GetCapitaleSociale(); #endregion #region Dati da bilancio if (_b != null) { RetrieveData("-1"); if (isabbreviato == true) { SommeDaExcel.Add("ValoreProduzione", "189|190|191|192|194|195"); SommeDaExcel.Add("CostiProduzione", "198|199|200|202|203|204|205|206|208|209|210|211|212|213|214|215"); SommeDaExcel.Add("RisultatoGestione", "222|223|224|227|228|229|230|231|232|234|235|236|237|239|240|241|242|243"); SommeDaExcel.Add("Rettifiche", "246|250"); SommeDaExcel.Add("RisultatoExtragestione", "256|259"); SommeDaExcel.Add("Imposte", "266"); SommeDaExcel.Add("UtilePerditaEconomico", "189|190|192|194|195|198|199|200|202|203|204|208|209|212|213|214|215|210|211|222|223|224|227|228|229|230|231|232|234|235|236|237|239|240|241|242|243|246|250|256|259|266"); SommeDaExcel.Add("Attivita", "3|4|10071|10072|10073|10081|10082|10083|10092|10093|23|50|1059|1060|80|89|97"); SommeDaExcel.Add("UtilePerditaPatrimoniale", "120"); SommeDaExcel.Add("Patrimonio", "108|109|110|111|112|113|100114|119"); SommeDaExcel.Add("Passivita", "123|129|133|134|175"); } if (isabbreviato2016 == true) { SommeDaExcel.Add("ValoreProduzione", "189|2016190|190|191|192|194|195"); SommeDaExcel.Add("CostiProduzione", "212|213|214|215|2016208|208|209|210|211|202|203|204|205|206|2016204|200|199|198"); SommeDaExcel.Add("RisultatoGestione", "222|223|224|2016224|20162241|235|236|237|234|232|231|228|229|230|227|2016237|2016231|2016229|240|241|242|239|2016242|243"); SommeDaExcel.Add("Rettifiche", "247|248|249|251|252|253|2016249|20162491|20162492|20162493"); SommeDaExcel.Add("RisultatoExtragestione", ""); SommeDaExcel.Add("Imposte", "267|268|217005|217006|2016267"); SommeDaExcel.Add("UtilePerditaEconomico", "189|2016190|190|191|192|194|195|212|213|214|215|2016208|208|209|210|211|202|203|204|205|206|2016204|200|199|198|222|223|224|2016224|20162241|235|236|237|234|232|231|228|229|230|227|2016237|2016231|2016229|240|241|242|239|2016242|243|247|248|249|251|252|253|2016249|20162491|20162492|20162493|267|268|217005|217006|2016267"); SommeDaExcel.Add("Attivita", "2|7|16|1009|50|1059|1060|80|89|201655|98"); SommeDaExcel.Add("UtilePerditaPatrimoniale", "11611"); SommeDaExcel.Add("Patrimonio", "108|109|110|111|114|112|100114|119|11611|2016114|2016998"); SommeDaExcel.Add("Passivita", "108|109|110|111|112|100114|119|11611|123|129|133|134|175|2016114|2016998|114"); } if (isordinario2016 == true) { SommeDaExcel.Add("ValoreProduzione", "189|190|191|192|194|195"); SommeDaExcel.Add("CostiProduzione", "198|199|200|202|203|204|205|206|208|209|210|211|212|213|214|215"); SommeDaExcel.Add("RisultatoGestione", "222|223|224|2016224|20162241|235|236|237|234|232|231|228|229|230|227|2016237|2016229|240|241|242|239|2016242|243"); SommeDaExcel.Add("Rettifiche", "247|248|249|251|252|253|2016249|20162491|20162492|20162493"); SommeDaExcel.Add("RisultatoExtragestione", ""); SommeDaExcel.Add("Imposte", "267|268|217005|217006|2016267"); SommeDaExcel.Add("UtilePerditaEconomico", "247|248|249|251|252|253|2016249|20162491|20162492|20162493|198|199|200|202|203|204|205|206|208|209|210|211|212|213|214|215|189|190|191|192|194|195|222|223|224|2016224|20162241|235|236|237|234|232|231|228|229|230|227|2016237|2016229|240|241|242|239|2016242|243|267|268|217005|217006|2016267"); SommeDaExcel.Add("Attivita", "3|4|8|9|10|11|12|13|14|17|18|19|20|21|25|26|27|28|32|33|35|36|38|39|41|42|43|44|51|52|53|54|55|59|60|62|63|65|66|68|69|71|72|73|77|78|81|82|83|84|85|86|90|91|92|98|201655|201627|201638|201639|201677|201678|201651|201683"); SommeDaExcel.Add("UtilePerditaPatrimoniale", "11611"); SommeDaExcel.Add("Patrimonio", "108|109|110|111|112|113|117|11600|11601|11602|11603|11604|11605|115|11606|11607|116|11608|11609|11610|118|119|120|1160|11700|11701|114|20161131|20161132|20161133|20161134|20161135|20161136|20161137|20161138|20161139|20161140|20161141|20161142|20171142|20161143|2016114|2016998|11611"); SommeDaExcel.Add("Passivita", "108|109|110|111|112|113|117|11600|11601|11602|11603|11604|11605|115|11606|11607|116|11608|11609|11610|118|119|120|1160|11700|11701|114|20161131|20161132|20161133|20161134|20161135|20161136|20161137|20161138|20161139|20161140|20161141|20161142|20171142|20161143|2016114|2016998|11611|124|125|126|2016126|129|133|134|136|137|139|140|142|143|145|146|148|149|151|152|154|155|157|158|160|161|163|164|166|167|169|170|172|173|2016163|2016164|175"); } if (_IDTree == "31" || _IDTree == "32") { SommeDaExcel.Add("ValoreProduzione", "189|190|191|192|194|195"); SommeDaExcel.Add("CostiProduzione", "198|199|200|202|203|204|205|206|208|209|210|211|212|213|214|215"); SommeDaExcel.Add("RisultatoGestione", "222|223|224|2016224|20162241|235|236|237|234|232|231|228|229|230|227|2016237|2016229|240|241|242|239|2016242|243"); SommeDaExcel.Add("Rettifiche", "247|248|249|251|252|253|2016249|20162491|20162492|20162493"); SommeDaExcel.Add("RisultatoExtragestione", ""); SommeDaExcel.Add("Imposte", "267|268|217005|217006|2016267"); SommeDaExcel.Add("UtilePerditaEconomico", "247|248|249|251|252|253|2016249|20162491|20162492|20162493|198|199|200|202|203|204|205|206|208|209|210|211|212|213|214|215|189|190|191|192|194|195|222|223|224|2016224|20162241|235|236|237|234|232|231|228|229|230|227|2016237|2016229|240|241|242|239|2016242|243|267|268|217005|217006|2016267"); SommeDaExcel.Add("Attivita", "3|4|8|9|10|11|12|13|14|17|18|19|20|21|25|26|27|28|32|33|35|36|38|39|41|42|43|44|51|52|53|54|55|59|60|62|63|65|66|68|69|71|72|73|77|78|81|82|83|84|85|86|90|91|92|98|201655|201627|201638|201639|201677|201678|201651|201683"); SommeDaExcel.Add("UtilePerditaPatrimoniale", "11611"); SommeDaExcel.Add("Patrimonio", "108|109|110|111|112|113|117|11600|11601|11602|11603|11604|11605|115|11606|11607|116|11608|11609|11610|118|119|120|1160|11700|11701|114|20161131|20161132|20161133|20161134|20161135|20161136|20161137|20161138|20161139|20161140|20161141|20161142|20171142|20181142|20161143|2016114|2016998|11611"); SommeDaExcel.Add("Passivita", "108|109|110|111|112|113|117|11600|11601|11602|11603|11604|11605|115|11606|11607|116|11608|11609|11610|118|119|120|1160|11700|11701|114|20161131|20161132|20161133|20161134|20161135|20161136|20161137|20161138|20161139|20161140|20161141|20161142|20171142|20181142|20161143|2016114|2016998|11611|124|125|2018125|126|2016126|129|133|134|136|137|139|140|142|143|145|146|148|149|151|152|154|155|157|158|160|161|163|164|166|167|169|170|172|173|2016163|2016164|175"); } if (isordinario == true) { SommeDaExcel.Add("ValoreProduzione", "189|190|191|192|194|195"); SommeDaExcel.Add("CostiProduzione", "198|199|200|202|203|204|205|206|208|209|210|211|212|213|214|215"); SommeDaExcel.Add("RisultatoGestione", "222|223|224|227|228|229|230|231|232|234|235|236|237|239|240|241|242|243"); SommeDaExcel.Add("Rettifiche", "247|248|249|251|252|253"); SommeDaExcel.Add("RisultatoExtragestione", "257|258|260|261|262|21700412|21700414"); SommeDaExcel.Add("Imposte", "267|268|217005|217006"); SommeDaExcel.Add("UtilePerditaEconomico", "189|190|191|192|194|195|198|199|200|202|203|204|205|206|208|209|210|211|212|213|214|215|222|223|224|227|228|229|230|231|232|234|235|236|237|239|240|241|242|243|247|248|249|251|252|253|257|258|260|261|262|21700412|21700414|267|268|217005|217006"); SommeDaExcel.Add("Attivita", "3|4|8|9|10|11|12|13|14|17|18|19|20|21|25|26|27|28|32|33|35|36|38|39|41|42|43|44|51|52|53|54|55|59|60|62|63|65|66|68|69|71|72|74|75|77|78|81|82|83|84|85|86|90|91|92|98|99"); SommeDaExcel.Add("UtilePerditaPatrimoniale", "120"); SommeDaExcel.Add("Patrimonio", "108|109|110|111|112|113|117|11600|11601|11602|11603|11604|11605|115|11606|11607|116|11608|11609|11610|118|119|1160|11700|11701"); SommeDaExcel.Add("Passivita", "124|125|126|129|133|134|136|137|139|140|142|143|145|146|148|149|151|152|154|155|157|158|160|161|163|164|166|167|169|170|172|173|176|177"); } txtValoreProduzione.Text = ConvertInteger(GetValoreEA("ValoreProduzione").ToString()); txtCostiProduzione.Text = ConvertInteger(GetValoreEA("CostiProduzione").ToString()); txtRisultatoGestione.Text = ConvertInteger(GetValoreEA("RisultatoGestione").ToString()); txtRettifiche.Text = ConvertInteger(GetValoreEA("Rettifiche").ToString()); txtRisultatoExtragestione.Text = ConvertInteger(GetValoreEA("RisultatoExtragestione").ToString()); txtImposte.Text = ConvertInteger(GetValoreEA("Imposte").ToString()); txtUtilePerditaEconomico.Text = ConvertInteger(GetValoreEA("UtilePerditaEconomico").ToString()); txtAttivita.Text = ConvertInteger(GetValoreEA("Attivita").ToString()); txtUtilePerditaPatrimoniale.Text = ConvertInteger(GetValoreEA("UtilePerditaPatrimoniale").ToString()); txtPatrimonioNetto.Text = ConvertInteger(GetValoreEA("Patrimonio").ToString()); //Patrimonio - Utile txtPassivita.Text = ConvertInteger(GetValoreEA("Passivita").ToString()); //Passività - Partimonio netto xnode["txtValoreProduzione"] = txtValoreProduzione.Text; xnode["txtCostiProduzione"] = txtCostiProduzione.Text; xnode["txtRisultatoGestione"] = txtRisultatoGestione.Text; xnode["txtRettifiche"] = txtRettifiche.Text; xnode["txtRisultatoExtragestione"] = txtRisultatoExtragestione.Text; xnode["txtImposte"] = txtImposte.Text; xnode["txtUtilePerditaEconomico"] = txtUtilePerditaEconomico.Text; xnode["txtAttivita"] = txtAttivita.Text; xnode["txtPassivita"] = txtPassivita.Text; xnode["txtPatrimonioNetto"] = txtPatrimonioNetto.Text; xnode["txtUtilePerditaPatrimoniale"] = txtUtilePerditaPatrimoniale.Text; } else { if (xnode["txtValoreProduzione"].ToString() == "") { txtValoreProduzione.Text = "0"; xnode["txtValoreProduzione"] = "0"; } else { txtValoreProduzione.Text = xnode["txtValoreProduzione"].ToString(); } if (xnode["txtCostiProduzione"].ToString() == "") { txtCostiProduzione.Text = "0"; xnode["txtCostiProduzione"] = "0"; } else { txtCostiProduzione.Text = xnode["txtCostiProduzione"].ToString(); } if (xnode["txtRisultatoGestione"].ToString() == "") { txtRisultatoGestione.Text = "0"; xnode["txtRisultatoGestione"] = "0"; } else { txtRisultatoGestione.Text = xnode["txtRisultatoGestione"].ToString(); } if (xnode["txtRettifiche"].ToString() == "") { txtRettifiche.Text = "0"; xnode["txtRettifiche"] = "0"; } else { txtRettifiche.Text = xnode["txtRettifiche"].ToString(); } if (xnode["txtRisultatoExtragestione"].ToString() == "") { txtRisultatoExtragestione.Text = "0"; xnode["txtRisultatoExtragestione"] = "0"; } else { txtRisultatoExtragestione.Text = xnode["txtRisultatoExtragestione"].ToString(); } if (xnode["txtImposte"].ToString() == "") { txtImposte.Text = "0"; xnode["txtImposte"] = "0"; } else { txtImposte.Text = xnode["txtImposte"].ToString(); } if (xnode["txtUtilePerditaEconomico"].ToString() == "") { txtUtilePerditaEconomico.Text = "0"; xnode["txtUtilePerditaEconomico"] = "0"; } else { txtUtilePerditaEconomico.Text = xnode["txtUtilePerditaEconomico"].ToString(); } if (xnode["txtAttivita"].ToString() == "") { txtAttivita.Text = "0"; xnode["txtAttivita"] = "0"; } else { txtAttivita.Text = xnode["txtAttivita"].ToString(); } if (xnode["txtPassivita"].ToString() == "") { txtPassivita.Text = "0"; xnode["txtPassivita"] = "0"; } else { txtPassivita.Text = xnode["txtPassivita"].ToString(); } if (xnode["txtPatrimonioNetto"].ToString() == "") { txtPatrimonioNetto.Text = "0"; xnode["txtPatrimonioNetto"] = "0"; } else { txtPatrimonioNetto.Text = xnode["txtPatrimonioNetto"].ToString(); } if (xnode["txtUtilePerditaPatrimoniale"].ToString() == "") { txtUtilePerditaPatrimoniale.Text = "0"; xnode["txtUtilePerditaPatrimoniale"] = "0"; } else { txtUtilePerditaPatrimoniale.Text = xnode["txtUtilePerditaPatrimoniale"].ToString(); } } #endregion } if (xnode["cmbDestinatari"].ToString() == "") { xnode["cmbDestinatari"] = "(Selezionare una voce)"; } cmbDestinatari.Text = xnode["cmbDestinatari"].ToString(); if (IDTree == "31" || IDTree == "32") { if (xnode["cmbBilancio"].ToString() == "") { xnode["cmbBilancio"] = "al consolidato"; } cmbBilancio.Text = "al consolidato"; } else { if (xnode["cmbBilancio"].ToString() == "") { xnode["cmbBilancio"] = "all'esercizio"; } cmbBilancio.Text = "all'esercizio"; } }