private void buttonSbloccaUtenti_Click(object sender, RoutedEventArgs e) { //richiesta conferma Utilities u = new Utilities(); if (MessageBoxResult.Yes == u.ConfermaSbloccoUtenti()) { MasterFile mf = MasterFile.Create(); bool esportatipresenti = false; foreach (Hashtable item in mf.GetAnagrafiche()) { if (mf.GetAnafraficaStato(Convert.ToInt32(item["ID"].ToString())) != App.TipoAnagraficaStato.Esportato) { mf.SetAnafraficaStato(Convert.ToInt32(item["ID"].ToString()), App.TipoAnagraficaStato.Disponibile); } else { esportatipresenti = true; } } ((RevisoftApplication.MainWindow)(this.Owner)).CaricaClienti(); if (esportatipresenti == true) { MessageBox.Show("Sblocco Utenti Esportati disponibile solo da HelpDesk"); } else { MessageBox.Show("Sblocco Utenti Avvenuto con successo"); } } }
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() { 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; } } }