private void recargarBoleta(DataTable dataTable)
        {
            PopUpForm popUp = new PopUpForm("Recargar boleta", "¿Quieres cargar la boleta " + this.txtSerie.Text + " " + this.txtFolio.Text + "?", 1);

            popUp.ShowDialog();

            if (popUp.DialogResult == DialogResult.OK)
            {
                DataRow dr = dataTable.Rows[0];

                this.txtCodigoCli.Text               = dr["codigoCli"].ToString();
                this.txtRazonSocial.Text             = dr["nombreCli"].ToString();
                this.dataTable.DefaultView.RowFilter = null;
                this.txtSerie.Text           = dr["Serie"].ToString();
                this.txtFolio.Text           = dr["Folio"].ToString();
                this.dtpFecha.Value          = Convert.ToDateTime(dr["Fecha"]);
                this.txtNombreConductor.Text = dr["NombreConductor"].ToString();
                this.txtCantidadCerdos.Text  = dr["CantidadCerdos"].ToString();
                this.txtPesoPromedio.Text    = dr["PesoPromedio"].ToString();
                this.txtGranja.Text          = dr["Granja"].ToString();
                this.idBoleta = Convert.ToInt32(dr["idBoleta"]);
            }
            else
            {
                nuevaBoleta();
            }
        }
示例#2
0
        public void cargarOrdenProduccion(int idOrdenProduccion)
        {
            PopUpForm popUp = new PopUpForm("Recargar orden de producción", "¿Quieres cargar la orden de producción " + this.txtSerie.Text + " " + this.txtFolio.Text + "?", 1);

            popUp.ShowDialog();

            if (popUp.DialogResult == DialogResult.OK)
            {
                try
                {
                    this.command = new SqlCommand("SELECT OrdenesProduccion.idOrdenProduccion, " +
                                                  "OrdenesProduccion.idBoleta, " +
                                                  "OrdenesProduccion.Serie, " +
                                                  "OrdenesProduccion.Folio, " +
                                                  "OrdenesProduccion.idUsuario, " +
                                                  "OrdenesProduccion.Usuario, " +
                                                  "OrdenesProduccion.Fecha, " +
                                                  "OrdenesProduccion.Status, " +
                                                  "Boletas.codigoCli, " +
                                                  "Boletas.nombreCli, " +
                                                  "Boletas.Serie AS SerieBoleta, " +
                                                  "Boletas.Folio AS FolioBoleta, " +
                                                  "Boletas.Status AS StatusBoleta " +
                                                  "FROM OrdenesProduccion " +
                                                  "LEFT JOIN Boletas " +
                                                  "ON OrdenesProduccion.idBoleta = Boletas.idBoleta " +
                                                  "WHERE OrdenesProduccion.idOrdenProduccion = " + idOrdenProduccion, this.conexion);

                    DataTable      dt = new DataTable();
                    SqlDataAdapter da = new SqlDataAdapter(this.command);
                    da.Fill(dt);
                    DataRow dr = dt.Rows[0];

                    this.txtSerieOrden.Text   = dr["Serie"].ToString();
                    this.txtFolioOrden.Text   = dr["Folio"].ToString();
                    this.dtpFecha.Value       = Convert.ToDateTime(dr["Fecha"]);
                    this.txtSerie.Text        = dr["SerieBoleta"].ToString();
                    this.txtFolio.Text        = dr["FolioBoleta"].ToString();
                    this.txtNombreCli.Text    = dr["nombreCli"].ToString();
                    this.chkAutorizar.Checked = Convert.ToInt32(dr["Status"]) == 0 ? true : false;
                    this.idBoleta             = Convert.ToInt32(dr["idBoleta"]);
                }
                catch (SqlException ex)
                {
                    MessageBox.Show(ex.Message);
                }
            }
            else
            {
                nuevaOrdenProduccion();
            }
        }
        private void bttResumenProduccion_Click(object sender, EventArgs e)
        {
            PopUpForm popUp = new PopUpForm("Lote", "Esccriba el lote a consultar", 0);

            popUp.ShowDialog();
            if (popUp.DialogResult == DialogResult.OK)
            {
                string          lote  = popUp.Answer;
                VisorDeReportes visor = new VisorDeReportes(this.conexion);
                visor.LoteDetalle(lote);
            }
            else
            {
                MessageBox.Show("Necesita capturar un lote");
            }
        }
示例#4
0
        private void nuevaOrdenProduccion()
        {
            limpiar();

            PopUpForm dialogSerie = new PopUpForm("Serie nueva orden de produccion", "¿Cual es la serie asumida?", 0);

            dialogSerie.ShowDialog();
            string lSerie = dialogSerie.Answer.ToString();

            this.txtSerieOrden.Text = lSerie;

            SqlCommand comandoNuevaBoleta = new SqlCommand("SELECT ISNULL(MAX(Folio), 0) AS Folio FROM OrdenesProduccion WHERE Serie = '" + lSerie + "'", this.conexion);
            int        ultimaBoleta       = Convert.ToInt32(comandoNuevaBoleta.ExecuteScalar());

            ultimaBoleta = ultimaBoleta + 1;

            this.txtFolioOrden.Text = ultimaBoleta.ToString();
        }
        private void nuevaBoleta()
        {
            limpiar();

            PopUpForm dialogSerie = new PopUpForm("Serie nueva boleta", "¿Cual es la serie asumida?", 0);

            dialogSerie.ShowDialog();
            string lSerie = dialogSerie.Answer.ToString();

            this.txtSerie.Text = lSerie;

            SqlCommand comandoNuevaBoleta = new SqlCommand("SELECT ISNULL(MAX(Folio), 0) AS Folio FROM Boletas WHERE Serie = '" + lSerie + "'", this.conexion);
            int        ultimaBoleta       = Convert.ToInt32(comandoNuevaBoleta.ExecuteScalar());

            ultimaBoleta = ultimaBoleta + 1;

            this.txtFolio.Text = ultimaBoleta.ToString();
            this.txtRazonSocial.Focus();
        }