private void btnmodificar_Click_1(object sender, EventArgs e) { try { MaquilaCon maq = new MaquilaCon(); int PiezasMaquila = maq.ObtenerCantidadPiezasMaquila(newLavanderia.IdPrenda); int x; cantidadView c = new cantidadView(); c.LoadOrders("Cantidad", PiezasMaquila); c.ShowDialog(); x = c.CantidadACt; c.Close(); if (x > 0) { 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) { int id = dgvLavanderia.CurrentRow.Index; newLavanderia = new LavanderiaDTO(); newLavanderia.Id = Convert.ToInt16(dgvLavanderia[0, id].Value); newLavanderia.FechaEntrega = DateTime.Now; newLavanderia.NumeroPiezas = x; newLavanderia.IdUsuario = logi.User().Id; newLavanderia.Estado = true; if (lav.ProcesoTerminadoLavandria(newLavanderia)) { MessageBox.Show("A finalizado el proceso de lavanderia"); limpiar(); cargarDadots(); btneliminar.Visible = false; btnTerminado.Visible = false; newLavanderia = null; } } } else { MessageBox.Show("El proceso no puede ser terminado con 0 Prendas terminadas"); } } catch (Exception ex) { } }
private void NumeroMAquila() { MaquilaCon con = new MaquilaCon(); txtIdmaquila.Text = "Maquila" + (1 + con.NumeroMaquila()); }
private void btnAgregar_Click_1(object sender, EventArgs e) { if (txtidlavanderia.Text != "") { try { if (newLavanderia == null) { newLavanderia = new LavanderiaDTO(); } if (newLavanderia.Id == 0) { newLavanderia.IdLavanderia = txtidlavanderia.Text; if (lav.ObtenerLavanderiaID(txtidlavanderia.Text)) { newLavanderia.FechaRecepcion = DateTime.Now; newLavanderia.NumeroPiezas = 0; newLavanderia.IdUsuario = logi.User().Id; newLavanderia.IdProceso = Convert.ToInt16(cbbProcesos.SelectedValue); MaquilaCon maq = new MaquilaCon(); newLavanderia.IdMaquila = maq.ObtenerMaquilaProceso(Convert.ToInt16(cbbMaquila.SelectedValue)).IdPrenda; newLavanderia.Estado = false; if (lav.AgregarLavanteria(newLavanderia)) { MessageBox.Show("El proceso lavanderia se agrego correctamente"); limpiar(); cargarDadots(); } } else { MessageBox.Show("EL Id ya existe"); } } else { newLavanderia.IdLavanderia = txtidlavanderia.Text; newLavanderia.FechaRecepcion = DateTime.Now; newLavanderia.NumeroPiezas = 0; newLavanderia.IdUsuario = logi.User().Id; newLavanderia.IdProceso = Convert.ToInt16(cbbProcesos.SelectedValue); newLavanderia.IdMaquila = Convert.ToInt16(cbbMaquila.SelectedValue); newLavanderia.Estado = false; if (lav.ActualizarLavanteria(newLavanderia)) { MessageBox.Show("El proceso se actualizo correctamente"); limpiar(); cargarDadots(); newLavanderia = null; } } } catch (Exception ex) { throw; } } }