예제 #1
0
        public void DetalleDeCajaPrec(FRM_DET_CAJAS frm, int idpack, int idcaja)
        {
            string sp = "SP_Packing_Insert";

            try
            {
                con = new SqlConnection(cadena());
                SqlCommand com = new SqlCommand(sp, con);
                con.Open();
                com.CommandType = CommandType.StoredProcedure;
                com.Parameters.Add("@ID", SqlDbType.Int).Value         = idpack;
                com.Parameters.Add("@opcion", SqlDbType.VarChar).Value = "CONSUL_PREC";
                com.Parameters.Add("@ORDEN", SqlDbType.Int).Value      = idcaja;
                SqlDataReader dr = com.ExecuteReader();
                while (dr.Read())
                {
                    frm.dgvXPrec.Rows.Add(dr["Id_PreCinto"].ToString());
                }
                con.Close();
            }
            catch (Exception ex)
            {
                MessageBox.Show("error al DetalleDeCaja" + ex.Message);
            }
        }
예제 #2
0
        public void DetalleDeCaja(FRM_DET_CAJAS frm, int idpack, int idcaja)
        {
            string sp = "SP_Detalle_Packing";

            try
            {
                con = new SqlConnection(cadena());
                SqlCommand com = new SqlCommand(sp, con);
                con.Open();
                com.CommandType = CommandType.StoredProcedure;
                com.Parameters.Add("@ID", SqlDbType.Int).Value         = idpack;
                com.Parameters.Add("@opcion", SqlDbType.VarChar).Value = "DET_CAJA";
                com.Parameters.Add("@orden", SqlDbType.Int).Value      = idcaja;
                SqlDataReader dr = com.ExecuteReader();
                while (dr.Read())
                {
                    frm.dgvDetalle.Rows.Add(dr["ORDEN"], dr["ARTICULO"], dr["TALLA"], dr["COLOR"], dr["CANTIDAD"], dr["EN_CAJA"]);
                }
                con.Close();
            }
            catch (Exception ex)
            {
                MessageBox.Show("error al DetalleDeCaja" + ex.Message);
            }
        }
예제 #3
0
        public void Modas(FRM_DET_CAJAS frm)
        {
            string sp = "SP_Detalle_Packing";

            try
            {
                con = new SqlConnection(cadena());
                SqlCommand com = new SqlCommand(sp, con);
                con.Open();
                com.CommandType = CommandType.StoredProcedure;
                com.Parameters.Add("@ID", SqlDbType.Int).Value         = 0;
                com.Parameters.Add("@opcion", SqlDbType.VarChar).Value = "MODAS";
                SqlDataAdapter da = new SqlDataAdapter(com);
                DataSet        ds = new DataSet();
                da.Fill(ds);
                if (ds.Tables.Count > 0)
                {
                    frm.cmbXModa.DataSource    = ds.Tables[0];
                    frm.cmbXModa.ValueMember   = "ID";
                    frm.cmbXModa.DisplayMember = "MODA";
                }
                con.Close();
            }
            catch (Exception e)
            {
                MessageBox.Show("error al generar Modas" + e.Message);
            }
        }
예제 #4
0
        private void btnXbtn_Click(object sender, EventArgs e)
        {
            FRM_DET_CAJAS caja = new FRM_DET_CAJAS(id_pack, id_caja, frm);

            caja.Text = "Caja " + Convert.ToString(id_caja);
            caja.ShowDialog();
            if (caja.Cancelado)
            {
                foreach (Control ctr in frm.pnlBox.Controls)
                {
                    if (ctr.GetType() == typeof(ctrlBtnCaja))
                    {
                        frm.pnlBox.Controls.Remove(ctr);
                    }
                }
                frm.GeneraBrtn();
            }
        }
예제 #5
0
        public void get_datosCaja(FRM_DET_CAJAS frm, int idpack, int idcaja)
        {
            string consulta = "SP_Detalle_Packing";

            try
            {
                con = new SqlConnection(cadena());
                SqlCommand com = new SqlCommand(consulta, con);
                con.Open();
                com.CommandType = CommandType.StoredProcedure;
                com.Parameters.Add("@ID", SqlDbType.Int).Value         = idpack;
                com.Parameters.Add("@opcion", SqlDbType.VarChar).Value = "DAT_CAJA";
                com.Parameters.Add("@orden", SqlDbType.VarChar).Value  = idcaja;
                SqlDataReader dr = com.ExecuteReader();
                while (dr.Read())
                {
                    string mda = dr.GetString(0);
                    try
                    {
                        int index = frm.cmbXModa.FindString(mda.Substring(0, 5));
                        frm.cmbXModa.SelectedIndex = index;
                    }
                    catch (Exception e)
                    {
                    }
                    frm.txtXtara.Text     = "0.9";
                    frm.txtXPesoN.Text    = dr.GetString(2);
                    frm.txtXPesoB.Text    = dr.GetString(3);
                    frm.lblPbruto.Visible = true;
                    frm.lblPneto.Visible  = true;
                    frm.lblXnDim.Visible  = true;
                    frm.lblXnDim.Visible  = true;
                }
                con.Close();
            }
            catch (Exception e)
            {
                MessageBox.Show("error numero de cajas" + e.Message);
            }
        }