Esempio n. 1
0
        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)
            {
            }
        }
Esempio n. 2
0
        private void button1_Click_2(object sender, EventArgs e)
        {
            try
            {
                int           x;
                LavanderiaCon lav             = new LavanderiaCon();
                int           PiezasTerminado = lav.ObtenerCantidadPiezasLavanderia(newTerminado.IdPrenda);
                cantidadView  c = new cantidadView();
                c.LoadOrders("Cantidad", PiezasTerminado);
                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)
                    {
                        newTerminado              = new TerminadoDTO();
                        newTerminado.Id           = idTerminado;
                        newTerminado.FechaEntrega = DateTime.Now;

                        newTerminado.NumeroPiezas = x;
                        newTerminado.IdUsuario    = logi.User().Id;
                        newTerminado.Estado       = true;

                        if (con.ActualizarTerminadoPreceso(newTerminado))
                        {
                            limpiar();
                            cargarDatos();
                            MessageBox.Show("A finalizado el Proceso");
                        }
                    }
                }
                else
                {
                    MessageBox.Show("El proceso no puede ser terminado con 0 Prendas terminadas");
                }
            }
            catch (Exception ex)
            {
            }
        }
Esempio n. 3
0
        private void btnTerminado_Click(object sender, EventArgs e)
        {
            BordadoCon   bor           = new BordadoCon();
            int          PiezasBordado = bor.ObtenerCantidadPiezasBordado(newMaquila.IdPrenda);
            int          x;
            cantidadView c = new cantidadView();

            c.LoadOrders("Cantidad", PiezasBordado);
            c.ShowDialog();
            x = c.CantidadACt;
            c.Close();
            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 = dgvMaquila.CurrentRow.Index;


                newMaquila    = new Ob.MaquilaDTO();
                newMaquila.Id = Convert.ToInt16(dgvMaquila[0, id].Value);
                controller.MaquilaCon cor = new controller.MaquilaCon();

                newMaquila.FechaEntrega = DateTime.Now;

                newMaquila.Cantidad  = x;
                newMaquila.IdUsuario = logi.User().Id;
                newMaquila.Estado    = true;

                if (cor.ActualizarMaquilaProcesoTerminado(newMaquila))
                {
                    MessageBox.Show("A finalizado el proceso bordado");
                    limpiar();
                    cargarDadots();
                    btneliminar.Visible  = false;
                    btnTerminado.Visible = false;
                }
            }
        }
Esempio n. 4
0
        private void btnagregar_Click(object sender, EventArgs e)
        {
            if (txtCantidad.Text != "" && txtNumeroCorte.Text != "")
            {
                if (_corte == null)
                {
                    _corte = new Corte();
                }


                _corte.IdCorte = txtNumeroCorte.Text;
                List <Talla> listaTallasSelect = new List <Talla>();
                _detallesPrenda = new List <Detalle>();

                //Me obtiene las tallas seleccionadas
                Int32 selectedCellCount = gtvTallas.GetCellCount(DataGridViewElementStates.Selected);
                for (int i = 0; i < selectedCellCount; i++)
                {
                    int x = gtvTallas.SelectedCells[i].RowIndex;
                    listaTallasSelect.Add(new Talla()
                    {
                        Id     = Convert.ToInt16(gtvTallas[0, x].Value),
                        Talla1 = Convert.ToInt16(gtvTallas[1, x].Value)
                    });
                }


                //paso los valores al corte
                _corte.Piezas       = Convert.ToInt32(txtCantidad.Text);
                _corte.IdPrenda     = (short)cbxDiseño.SelectedValue;
                _corte.FechaEntrada = dtpFechaEntrada.Value.Date;
                _corte.FechaEntrada = dtpFechaEntrada.Value.Date;
                _corte.IdUsuario    = logi.User().Id;
                _corte.Estado       = false;

                //pido la cantidad de cada talla seleccionada al usuario
                for (int z = 0; z < listaTallasSelect.Count(); z++)
                {
                    cantidadView can    = new cantidadView();
                    string       cadena = "Cantidad de talla " + listaTallasSelect[z].Talla1.ToString();
                    can.LoadOrders(cadena, 0);
                    can.ShowDialog();

                    _detallesPrenda.Add(new Detalle()
                    {
                        Cantidad = int.Parse(can.cant().ToString()),
                        IdTalla  = listaTallasSelect[z].Id
                    });
                }


                _prenda          = new Prenda();
                _prenda.IdDiseño = short.Parse(cbxDiseño.SelectedValue.ToString());

                if (AgregarCorteCompleto(_prenda))
                {
                    MessageBox.Show("El corte se agrego correctamente");
                    limpiar();
                    CargarDatosCorte();
                }
            }
        }