private void functionCmbDataChanged(ComboBox cmb) { if (cmb.SelectedIndex != -1) { try { _InCaricamento = true; IDRelazioneV = htDate[cmb.SelectedIndex].ToString(); MasterFile mf = MasterFile.Create(); Hashtable htRelazioneV = new Hashtable(); htRelazioneV = mf.GetRelazioneV(IDRelazioneV); dtpDataNomina.IsEnabled = true; txtNota.IsEnabled = true; foreach (DictionaryEntry item in htSelectedDate) { if (item.Value.ToString() == ConvertDataToEsercizio(htRelazioneV["Data"].ToString(), htRelazioneV)) { dtpDataNomina.SelectedIndex = Convert.ToInt32(item.Key.ToString()); } } txtNota.Text = htRelazioneV["Note"].ToString(); _InCaricamento = false; } catch (Exception ex) { cBusinessObjects.logger.Error(ex, "wSchedaRelazioneV.functionCmbDataChanged exception"); string log = ex.Message; } } }
//----------------------------------------------------------------------------+ // accedi | //----------------------------------------------------------------------------+ public void accedi(string ID, bool ReadOnly) { MasterFile mf = MasterFile.Create(); Hashtable htSelected = mf.GetRelazioneV(ID); if (htSelected.Count == 0) { return; } WindowWorkAreaTree wWorkArea = new WindowWorkAreaTree(); //Prisc try { wWorkArea.Owner = this; } catch (Exception ex) { cBusinessObjects.logger.Error(ex, "wSchedaRelazioneV.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.RelazioneV; 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.RelazioneV)).ToString(); wWorkArea.IDCliente = htSelected["Cliente"].ToString(); wWorkArea.IDSessione = ID; foreach (Hashtable item in ((ArrayList)(mf.GetRelazioniV(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(); }