private void functionCmbDataChanged(ComboBox cmb) { if (cmb.SelectedIndex != -1) { try { _InCaricamento = true; IDRelazioneVC = htDate[cmb.SelectedIndex].ToString(); MasterFile mf = MasterFile.Create(); Hashtable htRelazioneVC = new Hashtable(); htRelazioneVC = mf.GetRelazioneVC(IDRelazioneVC); dtpDataNomina.IsEnabled = true; txtNota.IsEnabled = true; foreach (DictionaryEntry item in htSelectedDate) { if (item.Value.ToString() == ConvertDataToEsercizio(htRelazioneVC["Data"].ToString(), htRelazioneVC)) { dtpDataNomina.SelectedIndex = Convert.ToInt32(item.Key.ToString()); } } txtNota.Text = htRelazioneVC["Note"].ToString(); _InCaricamento = false; } catch (Exception ex) { cBusinessObjects.logger.Error(ex, "wSchedaRelazioneVC.functionCmbDataChanged exception"); string log = ex.Message; } } }
//----------------------------------------------------------------------------+ // accedi | //----------------------------------------------------------------------------+ public void accedi(string ID, bool ReadOnly) { MasterFile mf = MasterFile.Create(); Hashtable htSelected = mf.GetRelazioneVC(ID); if (htSelected.Count == 0) { return; } WindowWorkAreaTree wWorkArea = new WindowWorkAreaTree(); //Prisc try { wWorkArea.Owner = this; } catch (Exception ex) { cBusinessObjects.logger.Error(ex, "wSchedaRelazioneVC.accedi exception"); string log = ex.Message; } wWorkArea.SelectedTreeSource = App.AppDataDataFolder + "\\" + htSelected["File"].ToString(); wWorkArea.SelectedDataSource = App.AppDataDataFolder + "\\" + htSelected["FileData"].ToString(); if (htSelected["Sigillo"] != null && htSelected["Sigillo"].ToString() != "") { wWorkArea.ReadOnly = true; } else { wWorkArea.ReadOnly = ReadOnly; } wWorkArea.TipoAttivita = App.TipoAttivita.RelazioneVC; wWorkArea.Cliente = (((Hashtable)(mf.GetAnagrafica(Convert.ToInt32(htSelected["Cliente"].ToString()))))["RagioneSociale"].ToString()) + " (C.F. " + (((Hashtable)(mf.GetAnagrafica(Convert.ToInt32(htSelected["Cliente"].ToString()))))["CodiceFiscale"].ToString()) + ")"; wWorkArea.SessioneAlias = ""; wWorkArea.SessioneFile = ""; wWorkArea.SessioneSigillo = null; wWorkArea.SessioneSigilloData = null; wWorkArea.SessioneSigilloPassword = null; wWorkArea.IDTree = (Convert.ToInt32(App.TipoFile.RelazioneVC)).ToString(); wWorkArea.IDCliente = htSelected["Cliente"].ToString(); wWorkArea.IDSessione = ID; foreach (Hashtable item in ((ArrayList)(mf.GetRelazioniVC(htSelected["Cliente"].ToString())))) { wWorkArea.SessioneFile += ((wWorkArea.SessioneFile == "") ? "" : "|") + App.AppDataDataFolder + "\\" + item["FileData"].ToString(); wWorkArea.SessioneAlias += ((wWorkArea.SessioneAlias == "") ? "" : "|") + item["Data"].ToString();// ConvertDataToEsercizio(item["Data"].ToString()); wWorkArea.SessioneID += ((wWorkArea.SessioneID == "") ? "" : "|") + item["ID"].ToString(); wWorkArea.SessioneSigillo += ((wWorkArea.SessioneSigillo == null) ? "" : "|") + ((item["Sigillo"] != null) ? item["Sigillo"].ToString() : ""); wWorkArea.SessioneSigilloData += ((wWorkArea.SessioneSigilloData == null) ? "" : "|") + ((item["Sigillo_Data"] != null) ? item["Sigillo_Data"].ToString() : ""); wWorkArea.SessioneSigilloPassword += ((wWorkArea.SessioneSigilloPassword == null) ? "" : "|") + ((item["Sigillo_Password"] != null) ? item["Sigillo_Password"].ToString() : ""); } //aperto in sola lettura wWorkArea.ApertoInSolaLettura = TipologiaAttivita == App.TipoAttivitaScheda.View; wWorkArea.LoadTreeSource(); Hide(); wWorkArea.ShowDialog(); if (TipologiaAttivita != App.TipoAttivitaScheda.View) { int IDCliente = Convert.ToInt32(htClienti[cmbClienti.SelectedIndex].ToString()); mf.SetAnafraficaStato(Convert.ToInt32(IDCliente), App.TipoAnagraficaStato.Disponibile); } Close(); }