Beispiel #1
0
        public void Cancela(FRM_agregarArticulos frm, int id_packing, int id_caja, int id_orden)
        {
            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         = id_packing;
                com.Parameters.Add("@ORDEN", SqlDbType.Int).Value      = id_orden;
                com.Parameters.Add("@CAJA", SqlDbType.Int).Value       = id_caja;
                com.Parameters.Add("@opcion", SqlDbType.VarChar).Value = "G_CANCELA";
                SqlDataReader dr = com.ExecuteReader();
                while (dr.Read())
                {
                    foreach (DataGridViewRow row in frm.dgvArticulos.Rows)
                    {
                        if (row.Cells["Articulo"].Value.ToString() == dr.GetString(0) && row.Cells["SUBCUENTA"].Value.ToString() == dr.GetString(1))
                        {
                            frm.lblNUmero.Text        = Convert.ToString(Convert.ToInt32(frm.lblNUmero.Text) - Convert.ToInt32(row.Cells["EnCaja"].Value));
                            row.Cells["EnCaja"].Value = 0;
                        }
                    }
                }
                dr.Close();
                con.Close();
            }
            catch (Exception e)
            {
                MessageBox.Show("error al generar nueva caja" + e.Message);
            }
        }
Beispiel #2
0
        public void InfoArticulosLineal(FRM_agregarArticulos f, int id_v, int orden, int id_pack)
        {
            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         = id_v;
                com.Parameters.Add("@opcion", SqlDbType.VarChar).Value = "DET_LINEAL";
                com.Parameters.Add("@IdPacking", SqlDbType.Int).Value  = id_pack;
                com.Parameters.Add("@orden", SqlDbType.Int).Value      = orden;

                SqlDataReader dr = com.ExecuteReader();
                while (dr.Read())
                {
                    f.dgvArticulos.Rows.Add(dr["ID"], dr["Subcuenta"], dr["Articulo"], dr["Familia"], dr["nombre"], dr["Cantidad"], dr["Nombre"], dr["EnCaja"], dr["CODIGO"], dr["MovID"]);
                }
                dr.Close();
                con.Close();
                NotSortable(f.dgvArticulos);
            }
            catch (Exception e)
            {
                MessageBox.Show("error al desplegar informacion de artriculos" + e.Message);
            }
        }
Beispiel #3
0
        public void Modas(FRM_agregarArticulos 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);
            }
        }
Beispiel #4
0
        private void swBtnPack_ValueChanged(object sender, EventArgs e)
        {
            swBtnPack = (DevComponents.DotNetBar.Controls.SwitchButton)sender;
            string n = "";

            if (swBtnPack.Value == true)
            {
                n = tabP.SelectedPanel.Name;
                //tabP.SelectedTab.AttachedControl.Name = n;

                foreach (Control c in tabP.Controls)
                {
                    if (c.Name != n)
                    {
                        c.Enabled = false;
                    }
                }

                FRM_agregarArticulos AgrArt = new FRM_agregarArticulos(ID_packing, this);
                AgrArt.lblXorden.Text = "ORDEN " + tabP.SelectedPanel.Name;
                AgrArt.vaciarInfoOrden(Convert.ToInt32(tabP.SelectedPanel.Name));
                AgrArt.ShowDialog();
                GeneraBrtn();
                //if (conex.Orden_Completa(ID_packing, Convert.ToInt32(tabP.SelectedPanel.Name)))
                //    swBtnPack.Enabled = false;
                //else
                swBtnPack.Value = false;
                DescontarEnGrid(ID_packing, conex.GET_MOVID(Convert.ToInt32(tabP.SelectedPanel.Name)));
            }
            else
            {
                n = tabP.SelectedPanel.Name;
                //tabP.SelectedTab.AttachedControl.Name = n;

                foreach (Control c in tabP.Controls)
                {
                    if (c.Name != n)
                    {
                        c.Enabled = true;
                    }
                }
            }
        }