public ActionResult GetTasks(string AreaProduzione) { List <TaskArea> tasks = TaskArea.EstraiListaTaskArea(true); List <string> t = tasks.Where(x => x.AreaProduzione == AreaProduzione).OrderBy(x => x.Task).Select(x => x.Task.Trim()).Distinct().ToList(); List <MPIntranetListItem> ts = t.Select(x => new MPIntranetListItem(x, x)).ToList(); return(Json(ts)); }
private void ddlAreaProduzione_SelectedIndexChanged(object sender, EventArgs e) { ddlTask.Items.Clear(); AreaProduzione a = (AreaProduzione)ddlAreaProduzione.SelectedItem; List <TaskArea> tasks = TaskArea.EstraiListaTaskArea(true); tasks = tasks.Where(x => x.AreaProduzione == a.Codice).ToList(); ddlTask.Items.AddRange(tasks.ToArray()); }
private void popolaGriglia() { _tasksArea = TaskArea.EstraiListaTaskArea(true); dgvTaskArea.AutoGenerateColumns = false; BindingList <TaskArea> bindingList = new BindingList <TaskArea>(_tasksArea); sourceTaskArea = new BindingSource(bindingList, null); dgvTaskArea.DataSource = sourceTaskArea; dgvTaskArea.Update(); }
private void btnSalvaModifiche_Click(object sender, EventArgs e) { if (TaskArea.Salva(_tasksArea, _utenteConnesso)) { MessageBox.Show("Salvataggio riuscito", "INFORMAZIONE", MessageBoxButtons.OK, MessageBoxIcon.Information); popolaGriglia(); } else { MessageBox.Show("SALVATAGGIO NON RIUSCITO. Ci sono campi vuoti o valori minori di zero", "ATTENZIONE", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
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); } }
public ActionResult SPMaster() { List <SPMaster> masters = MPIntranet.Business.SchedeProcesso.SPMaster.EstraiListaSPMaster(true); List <MPIntranetListItem> mItems = masters.Select(x => new MPIntranetListItem(x.Descrizione, x.IdSPMaster.ToString())).ToList(); mItems.Insert(0, new MPIntranetListItem(" -- CREA NUOVO MASTER -- ", ElementiVuoti.SPMaster.ToString())); ViewData.Add("ddlSPMasters", mItems); List <MPIntranetListItem> controlliItems = CreaListaSPControlli(" -- SELEZIONA UN CONTROLLO -- ", true); ViewData.Add("ddlSPControlli", controlliItems); List <TaskArea> tasks = TaskArea.EstraiListaTaskArea(true); List <string> AreaProduzione = tasks.OrderBy(x => x.AreaProduzione).Select(x => x.AreaProduzione.Trim()).Distinct().ToList(); List <MPIntranetListItem> areeProduzione = AreaProduzione.Select(x => new MPIntranetListItem(x, x)).ToList(); areeProduzione.Insert(0, new MPIntranetListItem(string.Empty, string.Empty)); ViewData.Add("ddlAreaProduzione", areeProduzione); return(View()); }
private void DistintaBaseFrm_Load(object sender, EventArgs e) { tmrSalvataggio.Interval = 10 * 60 * 1000; avviaTimerAutoSalvataggio(); impostaColorePulsanteAutosave(); NuovoArticoloFrm nForm = new NuovoArticoloFrm(); nForm.Utente = _utenteConnesso; nForm.ShowDialog(); int _idArticolo = nForm.IDArticolo; if (_idArticolo == ElementiVuoti.Articolo) { MessageBox.Show("Nessun articolo selezionato", "ATTENZIONE", MessageBoxButtons.OK, MessageBoxIcon.Warning); this.BeginInvoke(new MethodInvoker(this.Close)); return; } try { Cursor.Current = Cursors.WaitCursor; caricaAreeProduzione(); caricaTask(); caricaItems(); _articolo = Articolo.EstraiArticolo(_idArticolo); if (_articolo != null) { txtArticolo.Text = _articolo.ToString(); txtCodiceEsteso.Text = _articolo.CodiceClienteEsteso; } _taskAreaProduzione = TaskArea.EstraiListaTaskArea(true); } finally { Cursor.Current = Cursors.Default; } }
private void dgvFasiCiclo_CellEndEdit(object sender, DataGridViewCellEventArgs e) { try { if (e.RowIndex < 0) { return; } convertiContenutoMaiuscolo(dgvFasiCiclo, clmAnagraficaFaseCiclo, e.RowIndex); convertiContenutoMaiuscolo(dgvFasiCiclo, clmCollegamentoDiBAFaseCiclo, e.RowIndex); convertiContenutoMaiuscolo(dgvFasiCiclo, clmCollegamentoCicloFaseCiclo, e.RowIndex); convertiContenutoMaiuscolo(dgvFasiCiclo, clmUMQuantitaFaseCiclo, e.RowIndex); convertiContenutoMaiuscolo(dgvFasiCiclo, clmAreaProduzioneFaseCiclo, e.RowIndex); convertiContenutoMaiuscolo(dgvFasiCiclo, clmTaskFaseCiclo, e.RowIndex); convertiContenutoMaiuscolo(dgvFasiCiclo, clmSchedaProcessoFaseCiclo, e.RowIndex); if (e.ColumnIndex == clmOperazioneFaseCiclo.Index) { riordinaFasiCiclo(); } if (e.ColumnIndex == clmAnagraficaFaseCiclo.Index) { string anagrafica = (dgvFasiCiclo.Rows[e.RowIndex].Cells[clmAnagraficaFaseCiclo.Index].Value as string); if (string.IsNullOrEmpty(anagrafica)) { return; } int posizione = anagrafica.IndexOf(separatoreAutocomplete); if (posizione < 0) { return; } anagrafica = anagrafica.Substring(0, posizione); dgvFasiCiclo.Rows[e.RowIndex].Cells[clmAnagraficaFaseCiclo.Index].Value = anagrafica; Item item = _items.Where(x => x.Anagrafica == anagrafica).FirstOrDefault(); if (item != null) { dgvFasiCiclo.Rows[e.RowIndex].Cells[clmUMQuantitaFaseCiclo.Index].Value = item.UM; } if (!string.IsNullOrEmpty(dgvFasiCiclo.Rows[e.RowIndex].Cells[clmAnagraficaFaseCiclo.Index].Value as string) && string.IsNullOrEmpty(dgvFasiCiclo.Rows[e.RowIndex].Cells[clmCollegamentoDiBAFaseCiclo.Index].Value as string)) { dgvFasiCiclo.Rows[e.RowIndex].Cells[clmCollegamentoDiBAFaseCiclo.Index].Value = ExpCicloBusinessCentral.CodiceCollegamentoStandard; } } if (e.ColumnIndex == clmTaskFaseCiclo.Index) { //if (string.IsNullOrEmpty(dgvFasiCiclo.Rows[e.RowIndex].Cells[clmAreaProduzioneFaseCiclo.Index].Value as string) && // !string.IsNullOrEmpty(dgvFasiCiclo.Rows[e.RowIndex].Cells[clmTaskFaseCiclo.Index].Value as string)) if (!string.IsNullOrEmpty(dgvFasiCiclo.Rows[e.RowIndex].Cells[clmTaskFaseCiclo.Index].Value as string)) { string task = (string)dgvFasiCiclo.Rows[e.RowIndex].Cells[clmTaskFaseCiclo.Index].Value; TaskArea taskArea = _taskAreaProduzione.Where(x => x.Task == task).FirstOrDefault(); if (taskArea != null) { dgvFasiCiclo.Rows[e.RowIndex].Cells[clmAreaProduzioneFaseCiclo.Index].Value = taskArea.AreaProduzione; if (dgvFasiCiclo.Rows[e.RowIndex].Cells[clmPezziOrariFaseCiclo.Index].Value == null) { dgvFasiCiclo.Rows[e.RowIndex].Cells[clmPezziOrariFaseCiclo.Index].Value = taskArea.PezziPeriodo; dgvFasiCiclo.Rows[e.RowIndex].Cells[clmPeriodoFaseCiclo.Index].Value = taskArea.Periodo; } else { double pezzi = (double)dgvFasiCiclo.Rows[e.RowIndex].Cells[clmPezziOrariFaseCiclo.Index].Value; if (pezzi == 0) { dgvFasiCiclo.Rows[e.RowIndex].Cells[clmPezziOrariFaseCiclo.Index].Value = taskArea.PezziPeriodo; dgvFasiCiclo.Rows[e.RowIndex].Cells[clmPeriodoFaseCiclo.Index].Value = taskArea.Periodo; } } } } } } catch (Exception ex) { MostraEccezione(ex, "Errore in popola griglia fasi"); } }