private void btnRimuoviFase_Click(object sender, EventArgs e) { txtMessaggio.Text = string.Empty; try { if (string.IsNullOrEmpty(txtNoCiclo.Text)) { txtMessaggio.Text = "Inserire un codice ciclo"; return; } int operazione = (int)nOperazioneFase.Value; BCServices bc = new BCServices(); bc.CreaConnessione(); bc.CambiaStatoCiclo(txtNoCiclo.Text, Stato.InSviluppo); bc.RimuoviFase(txtNoCiclo.Text, txtVersioneCiclo.Text, operazione.ToString(), true); bc.CambiaStatoCiclo(txtNoCiclo.Text, Stato.InSviluppo); txtMessaggio.Text = "Fase rimossa"; } catch (Exception ex) { txtMessaggio.Text = estraiErrore(ex); } }
private void btnAggiuntiFase_Click(object sender, EventArgs e) { txtMessaggio.Text = string.Empty; try { if (string.IsNullOrEmpty(txtNoCiclo.Text)) { txtMessaggio.Text = "Inserire un codice ciclo"; return; } if (ddlAreaProduzione.SelectedIndex == -1) { txtMessaggio.Text = "Selezionare un area produzione"; return; } if (ddlTask.SelectedIndex == -1) { txtMessaggio.Text = "Selezionare un task"; return; } BCServices bc = new BCServices(); bc.CreaConnessione(); bc.CambiaStatoCiclo(txtNoCiclo.Text, Stato.InSviluppo); int operazione = (int)nOperazioneFase.Value; AreaProduzione area = (AreaProduzione)ddlAreaProduzione.SelectedItem; TaskArea task = (TaskArea)ddlTask.SelectedItem; bc.AggiungiFase(txtNoCiclo.Text, txtVersioneCiclo.Text, operazione.ToString(), txtTipoFase.Text, area.Codice, task.Task, nSetupFase.Value, txtUMSetupFase.Text, txtCodiceScheda.Text, nLavorazioneFase.Value, txtUMLavorazioneFase.Text, nAttesaFase.Value, txtUMAttesaFase.Text, nSpostamentoFase.Value, txtUMSpostamentoFase.Text, nDimensioneLottoFase.Value, txtCollegmentoFase.Text, txtCodiceCondizioneFase.Text, txtCodiceLogicheFase.Text, txtCodiceCaratteristicaFase.Text, string.Empty); bc.CambiaStatoCiclo(txtNoCiclo.Text, Stato.Certificato); txtMessaggio.Text = "Fase aggiunta"; } catch (Exception ex) { txtMessaggio.Text = estraiErrore(ex); } }
private void btnCicloCerficato_Click(object sender, EventArgs e) { txtMessaggio.Text = string.Empty; try { if (string.IsNullOrEmpty(txtNoCiclo.Text)) { txtMessaggio.Text = "Inserire un codice ciclo"; return; } BCServices bc = new BCServices(); bc.CreaConnessione(); bc.CambiaStatoCiclo(txtNoCiclo.Text, MPIntranet.WS.Stato.Certificato); txtMessaggio.Text = "Stato cambiato: Certificato"; } catch (Exception ex) { txtMessaggio.Text = estraiErrore(ex); } }
private void btnCambiaStatoCicli_Click(object sender, EventArgs e) { try { Cursor.Current = Cursors.WaitCursor; lblElementi.Focus(); string status = Stato.InSviluppo; if ((sender as ToolStripMenuItem).Name == menucicliStatoCertificato.Name) { status = Stato.Certificato; } BCServices bc = new BCServices(); bc.CreaConnessione(); txtEsportazione.Text = string.Empty; foreach (ExpCicloBusinessCentral c in _cicliExport) { try { if (c.Selezionato) { bc.CambiaStatoCiclo(c.Codice, status); string messaggio = string.Format("Ciclo {0} in stato: {1}", c.Codice, status); AggiornaMessaggio(messaggio); } } catch (Exception ex) { string messaggio = string.Format("Ciclo {0} errore: {1}", c.Codice, ex.Message); AggiornaMessaggio(messaggio); } } PopolaGrigliaCicli(); } finally { Cursor.Current = Cursors.Default; } }