private void btneliminar_Click(object sender, EventArgs e) { string message = "Desea eliminar al usuario " + _corte.IdCorte + "?"; const string caption = "Form Closing"; var result = MessageBox.Show(message, caption, MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation); // If the no button was pressed ... if (result == DialogResult.Yes) { corteBL bl = new corteBL(); if (bl.EliminarCorte(_corte.Id)) { MessageBox.Show("Se elimino correctamente"); limpiar(); CargarDatosCorte(); btnTerminado.Visible = false; btnTerminado.Visible = false; _corte = null; } } }
private void CargarDatosCorte() { corteBL bl = new corteBL(); dgvCorte.DataSource = bl.ListaCortesEnproceso(); dgvCorte.Columns[0].Visible = false; for (int i = 8; i < dgvCorte.ColumnCount; i++) { dgvCorte.Columns[i].Visible = false; } DiseñoBL bld = new DiseñoBL(); cbxDiseño.DisplayMember = "Corte"; cbxDiseño.ValueMember = "id"; cbxDiseño.DataSource = bld.ListaDiseñosActivos(); TallaBL blt = new TallaBL(); gtvTallas.DataSource = blt.ListaTallasActivas(); gtvTallas.Columns[0].Visible = false; gtvTallas.Columns[2].Visible = false; }
private void btnTerminado_Click(object sender, EventArgs e) { controller.CorteCon con = new controller.CorteCon(); try { string message = "Desea marcar el proceso como terminado?"; const string caption = "Form Closing"; var result = MessageBox.Show(message, caption, MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation); // If the no button was pressed ... if (result == DialogResult.Yes) { _corte.Estado = true; corteBL bl = new corteBL(); if (bl.AgregarActualizarCorte(_corte)) { MessageBox.Show("Laoperacion fue exitosa"); limpiar(); CargarDatosCorte(); btnTerminado.Visible = false; btneliminar.Visible = false; _corte = null; } } } catch (Exception) { throw; } }
private bool AgregarCorteCompleto(Prenda prenda) { bool resul = false; try { string message = "Desea agregar el corte?"; const string caption = "Form Closing"; var result = MessageBox.Show(message, caption, MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation); // If the no button was pressed ... if (result == DialogResult.Yes) { int total = 0; foreach (Detalle item in _detallesPrenda) { total += item.Cantidad; } //agregar prenda PrendaBL blp = new PrendaBL(); short IdPrenda = blp.AgregarActualizarPreda(prenda); for (int i = 0; i < _detallesPrenda.Count; i++) { _detallesPrenda[i].IdPrenda = IdPrenda; detallesPrendaBL bld = new detallesPrendaBL(); if (bld.AgregarActualizarDetallePrenda(_detallesPrenda[i])) { } } corteBL blc = new corteBL(); _corte.IdPrenda = IdPrenda; return(blc.AgregarActualizarCorte(_corte)); } else { _corte = null; _detallesPrenda = null; _prenda = null; return(false); } } catch (Exception ex) { resul = false; } return(resul); }
private void dgvCorte_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { if (logi.User().Permiso.Corte) { try { int id = dgvCorte.CurrentRow.Index; _corte.Id = Convert.ToInt16(dgvCorte[0, id].Value); corteBL bl = new corteBL(); _corte = bl.ObtenerCorte(_corte.Id); txtNumeroCorte.Text = _corte.IdCorte; cbxDiseño.SelectedValue = _corte.Prenda.IdDiseño; btneliminar.Visible = true; btnTerminado.Visible = true; } catch (Exception ex) { throw; } } }