private void btnRimuoviComponente_Click(object sender, EventArgs e) { txtMessaggio.Text = string.Empty; try { if (string.IsNullOrEmpty(txtDistintaNo.Text)) { txtMessaggio.Text = "Inserire un codice distinta"; return; } BCServices bc = new BCServices(); bc.CreaConnessione(); bc.CambiaStatoDB(txtDistintaNo.Text, Stato.InSviluppo); bc.RimuoviComponente(txtDistintaNo.Text, txtCodiceVersioneDistinta.Text, (int)nNRRigaComponente.Value, txtNRComponente.Text, true); bc.CambiaStatoDB(txtDistintaNo.Text, Stato.Certificato); txtMessaggio.Text = "Componente rimosso"; } catch (Exception ex) { txtMessaggio.Text = estraiErrore(ex); } }
private void btnCambiaStatoDistinte_Click(object sender, EventArgs e) { try { Cursor.Current = Cursors.WaitCursor; (sender as ToolStripMenuItem).Select(); lblElementi.Focus(); string status = Stato.InSviluppo; if ((sender as ToolStripMenuItem).Name == menuDistinteStatoCertificato.Name) { status = Stato.Certificato; } BCServices bc = new BCServices(); bc.CreaConnessione(); txtEsportazione.Text = string.Empty; foreach (ExpDistintaBusinessCentral d in _distinteExport) { try { if (d.Selezionato) { TestataDIBA testata = bc.EstraiTestataDIBA(d.Codice); if (testata != null) { bc.CambiaDescrizioneDB(d.Codice, testata.Description); testata = bc.EstraiTestataDIBA(d.Codice); bc.CambiaStatoDB(d.Codice, status); string messaggio = string.Format("Distinta {0} in stato: {1}", d.Codice, status); AggiornaMessaggio(messaggio); } else { string messaggio = string.Format("Distinta {0} non trovata", d.Codice, status); AggiornaMessaggio(messaggio); } } } catch (Exception ex) { string messaggio = string.Format("Distinta {0} errore: {1}", d.Codice, ex.Message); AggiornaMessaggio(messaggio); } } PopolaGrigliaDistinte(); } finally { Cursor.Current = Cursors.Default; } }
private void btnModificaComponente_Click(object sender, EventArgs e) { txtMessaggio.Text = string.Empty; try { if (string.IsNullOrEmpty(txtDistintaNo.Text)) { txtMessaggio.Text = "Inserire un codice distinta"; return; } BCServices bc = new BCServices(); bc.CreaConnessione(); bc.CambiaStatoDB(txtDistintaNo.Text, Stato.InSviluppo); bc.ModificaComponente(txtDistintaNo.Text, txtCodiceVersioneDistinta.Text, (int)nNRRigaComponente.Value, txtNRComponente.Text, txtDescrizioneComponente.Text, nQuantitaPerCompoente.Value, txtCodiceCollegamentoCicliDiBa.Text, nScartoComponente.Value, nArrotondamentoComponente.Value); bc.CambiaStatoDB(txtDistintaNo.Text, Stato.Certificato); txtMessaggio.Text = "Componente modificato"; } catch (Exception ex) { txtMessaggio.Text = estraiErrore(ex); } }
private void btnDistintaInSviluppo_Click(object sender, EventArgs e) { txtMessaggio.Text = string.Empty; try { if (string.IsNullOrEmpty(txtDistintaNo.Text)) { txtMessaggio.Text = "Inserire un codice distinta"; return; } BCServices bc = new BCServices(); bc.CreaConnessione(); bc.CambiaStatoDB(txtDistintaNo.Text, MPIntranet.WS.Stato.InSviluppo); txtMessaggio.Text = "Stato cambiato: In sviluppo"; } catch (Exception ex) { txtMessaggio.Text = estraiErrore(ex); } }