public void ConfiguraMaschera() { MasterFile mf = MasterFile.Create(); int index = 0; int selectedIndex = -1; if (cmbClienti.Items.Count != 0) { selectedIndex = cmbClienti.SelectedIndex; cmbClienti.Items.Clear(); htClienti.Clear(); } List <KeyValuePair <string, string> > myList = new List <KeyValuePair <string, string> >(); foreach (Hashtable item in mf.GetAnagrafiche()) { if (mf.GetBilanci(item["ID"].ToString()).Count == 0 && mf.GetRevisioni(item["ID"].ToString()).Count == 0 && mf.GetISQCs(item["ID"].ToString()).Count == 0 && mf.GetIncarichi(item["ID"].ToString()).Count == 0 && mf.GetConclusioni(item["ID"].ToString()).Count == 0 && mf.GetVerifiche(item["ID"].ToString()).Count == 0) { continue; } string cliente = item["RagioneSociale"].ToString(); myList.Add(new KeyValuePair <string, string>(item["ID"].ToString(), cliente)); } myList.Sort ( delegate(KeyValuePair <string, string> firstPair, KeyValuePair <string, string> nextPair) { return(firstPair.Value.CompareTo(nextPair.Value)); } ); foreach (KeyValuePair <string, string> item in myList) { cmbClienti.Items.Add(item.Value); htClienti.Add(index, item.Key); index++; } cmbClienti.SelectedIndex = selectedIndex; string IDCliente = mf.GetClienteFissato(); foreach (DictionaryEntry item in htClienti) { if (item.Value.ToString() == IDCliente) { cmbClienti.SelectedIndex = Convert.ToInt32(item.Key.ToString()); return; } } }
public void ConfiguraMaschera() { //inibisco tutto i controlli dtpDataNomina.IsEnabled = false; txtNota.IsReadOnly = true; //nascondo testo help - non + usato textBlockDescrizione.Text = ""; textBlockDescrizione.Visibility = System.Windows.Visibility.Collapsed; switch (TipologiaAttivita) { case App.TipoAttivitaScheda.New: labelTitolo.Content = "Nuova Sessione"; buttonComando.Content = "Crea"; GridComboData.Visibility = System.Windows.Visibility.Collapsed; buttonComando.Visibility = System.Windows.Visibility.Visible; buttonApri.Visibility = System.Windows.Visibility.Hidden; //abilito controlli dtpDataNomina.IsEnabled = true; txtNota.IsReadOnly = false; break; case App.TipoAttivitaScheda.Edit: labelTitolo.Content = "Modifica Sessione"; buttonComando.Content = "Salva"; buttonComando.Visibility = System.Windows.Visibility.Collapsed; //abilito controlli dtpDataNomina.IsEnabled = true; txtNota.IsReadOnly = false; break; case App.TipoAttivitaScheda.Delete: labelTitolo.Content = "Elimina Sessione"; buttonComando.Content = "Elimina"; buttonComando.Visibility = System.Windows.Visibility.Visible; buttonApri.Visibility = System.Windows.Visibility.Collapsed; break; case App.TipoAttivitaScheda.Export: labelTitolo.Content = "Esporta Sessione"; buttonComando.Content = "Esporta"; buttonComando.Visibility = System.Windows.Visibility.Visible; break; case App.TipoAttivitaScheda.View: default: labelTitolo.Content = "Apri Sessione in sola lettura"; cmbData.Visibility = System.Windows.Visibility.Visible; buttonApri.Visibility = System.Windows.Visibility.Visible; buttonApri.Margin = buttonComando.Margin; break; } MasterFile mf = MasterFile.Create(); string IDCliente = mf.GetClienteFissato(); foreach (DictionaryEntry item in htClienti) { if (item.Value.ToString() == IDCliente) { cmbClienti.SelectedIndex = Convert.ToInt32(item.Key.ToString()); return; } } }
public void ConfiguraMaschera() { //inibisco tutto i controlli dtpDataInizio.IsHitTestVisible = false; dtpDataFine.IsHitTestVisible = false; switch (TipologiaAttivita) { case App.TipoAttivitaScheda.New: //labelTitolo.Content = "Nuova Sessione"; buttonComando.Content = "Crea"; buttonComando.Visibility = System.Windows.Visibility.Visible; dtpDataInizio.IsHitTestVisible = true; dtpDataFine.IsHitTestVisible = true; GridComboData.Visibility = System.Windows.Visibility.Collapsed; GridComboDataDaVigilanza.Visibility = System.Windows.Visibility.Visible; buttonComando.Visibility = System.Windows.Visibility.Visible; buttonApri.Visibility = System.Windows.Visibility.Hidden; break; case App.TipoAttivitaScheda.Edit: //labelTitolo.Content = "Modifica Sessione"; buttonComando.Content = "Salva"; buttonComando.Visibility = System.Windows.Visibility.Collapsed; GridComboDataDaVigilanza.Visibility = System.Windows.Visibility.Collapsed; dtpDataInizio.IsHitTestVisible = true; dtpDataFine.IsHitTestVisible = true; buttonComando.Visibility = System.Windows.Visibility.Collapsed; buttonApri.Visibility = System.Windows.Visibility.Visible; break; case App.TipoAttivitaScheda.Delete: //labelTitolo.Content = "Elimina Sessione"; buttonComando.Content = "Elimina"; buttonComando.Visibility = System.Windows.Visibility.Visible; GridComboDataDaVigilanza.Visibility = System.Windows.Visibility.Collapsed; buttonApri.Visibility = System.Windows.Visibility.Collapsed; break; case App.TipoAttivitaScheda.Export: //labelTitolo.Content = "Esporta Sessione"; buttonComando.Content = "Esporta"; buttonComando.Visibility = System.Windows.Visibility.Visible; GridComboDataDaVigilanza.Visibility = System.Windows.Visibility.Collapsed; buttonApri.Visibility = System.Windows.Visibility.Visible; break; case App.TipoAttivitaScheda.View: default: //labelTitolo.Content = "Apri Sessione in sola lettura"; cmbData.Visibility = System.Windows.Visibility.Visible; GridComboDataDaVigilanza.Visibility = System.Windows.Visibility.Collapsed; buttonApri.Visibility = System.Windows.Visibility.Visible; //buttonApri.Margin = buttonComando.Margin; break; } MasterFile mf = MasterFile.Create(); string IDCliente = mf.GetClienteFissato(); foreach (DictionaryEntry item in htClienti) { if (item.Value.ToString() == IDCliente) { cmbClienti.SelectedIndex = Convert.ToInt32(item.Key.ToString()); return; } } }
public void ConfiguraMaschera() { MasterFile mf = MasterFile.Create(); int index = 0; int selectedIndex = -1; if (cmbClienti.Items.Count != 0) { selectedIndex = cmbClienti.SelectedIndex; cmbClienti.Items.Clear(); htClienti.Clear(); } List <KeyValuePair <string, string> > myList = new List <KeyValuePair <string, string> >(); foreach (Hashtable item in mf.GetAnagrafiche()) { bool tbe = false; if (selectedCliente != "") { if (item["ID"].ToString() == selectedCliente) { myList.Add(new KeyValuePair <string, string>(item["ID"].ToString(), item["RagioneSociale"].ToString())); foreach (Hashtable item2 in mf.GetVerifiche(selectedCliente)) { if (item2["ID"].ToString() == selectedSession) { cmbData.Items.Add(item2["Data"].ToString()); cmbData.SelectedIndex = 0; htDate.Add(0, item2["ID"].ToString()); tbe = true; break; } } if (tbe) { break; } foreach (Hashtable item2 in mf.GetVigilanze(selectedCliente)) { if (item2["ID"].ToString() == selectedSession) { cmbData.Items.Add(item2["Data"].ToString()); cmbData.SelectedIndex = 0; htDate.Add(0, item2["ID"].ToString()); break; } } if (tbe) { break; } } } else { if (mf.GetVerifiche(item["ID"].ToString()).Count == 0 && mf.GetVigilanze(item["ID"].ToString()).Count == 0) { continue; } string cliente = item["RagioneSociale"].ToString(); myList.Add(new KeyValuePair <string, string>(item["ID"].ToString(), cliente)); } } myList.Sort ( delegate(KeyValuePair <string, string> firstPair, KeyValuePair <string, string> nextPair) { return(firstPair.Value.CompareTo(nextPair.Value)); } ); foreach (KeyValuePair <string, string> item in myList) { cmbClienti.Items.Add(item.Value); htClienti.Add(index, item.Key); index++; } cmbClienti.SelectedIndex = selectedIndex; string IDCliente = ((selectedCliente != "") ? selectedCliente : mf.GetClienteFissato()); foreach (DictionaryEntry item in htClienti) { if (item.Value.ToString() == IDCliente) { cmbClienti.SelectedIndex = Convert.ToInt32(item.Key.ToString()); } } }
public void ConfiguraMaschera() { MasterFile mf = MasterFile.Create(); GestioneLicenza gl = new GestioneLicenza(); txtRevisore.Text = gl.Utente; int index = 0; int selectedIndex = -1; if (cmbClienti.Items.Count != 0) { selectedIndex = cmbClienti.SelectedIndex; cmbClienti.Items.Clear(); htClienti.Clear(); } List <KeyValuePair <string, string> > myList = new List <KeyValuePair <string, string> >(); foreach (Hashtable item in mf.GetAnagrafiche()) { if (mf.GetBilanci(item["ID"].ToString()).Count == 0 && mf.GetRevisioni(item["ID"].ToString()).Count == 0) { continue; } string cliente = item["RagioneSociale"].ToString(); //switch (((App.TipoAnagraficaStato)(Convert.ToInt32(item["Stato"].ToString())))) //{ // case App.TipoAnagraficaStato.InUso: // cliente += " (In Uso)"; // break; // case App.TipoAnagraficaStato.Bloccato: // cliente += " (Bloccato)"; // break; // case App.TipoAnagraficaStato.Esportato: // cliente += " (Esportato)"; // break; // case App.TipoAnagraficaStato.Disponibile: // case App.TipoAnagraficaStato.Sconosciuto: // default: // break; //} myList.Add(new KeyValuePair <string, string>(item["ID"].ToString(), cliente)); } myList.Sort ( delegate(KeyValuePair <string, string> firstPair, KeyValuePair <string, string> nextPair) { return(firstPair.Value.CompareTo(nextPair.Value)); } ); foreach (KeyValuePair <string, string> item in myList) { cmbClienti.Items.Add(item.Value); htClienti.Add(index, item.Key); index++; } cmbClienti.SelectedIndex = selectedIndex; string IDCliente = mf.GetClienteFissato(); foreach (DictionaryEntry item in htClienti) { if (item.Value.ToString() == IDCliente) { cmbClienti.SelectedIndex = Convert.ToInt32(item.Key.ToString()); return; } } }