Esempio n. 1
0
        public void DescontarEnGrid(int idpack, int idord)
        {
            int    ncolor = 0;
            string art    = "";

            foreach (Control ctr in tabP.Controls)
            {
                if (ctr.GetType() == typeof(TabControlPanel))
                {
                    TabControlPanel tab = (TabControlPanel)ctr;
                    foreach (Control control in tab.Controls)
                    {
                        if (control.GetType() == typeof(ctrlGridDetalleTop))
                        {
                            ctrlGridDetalleTop ctop = control as ctrlGridDetalleTop;
                            for (int x = 0; x <= ctop.dgvXT2.RowCount - 1; x++)
                            {
                                ncolor = Convert.ToInt32(ctop.dgvXT2.Rows[x].Cells["nColor"].Value);
                                art    = ctop.dgvXT2.Rows[x].Cells["ART"].Value.ToString();
                                ctop.dgvXT2.Rows[x].Cells["escan"].Value = conex.Actualiza_grid(idpack, conex.GET_MOVID(Convert.ToInt32(tab.Name)), art, ncolor);
                            }
                        }

                        if (control.GetType() == typeof(ctrlGridDetalle))
                        {
                            ctrlGridDetalle ctop = control as ctrlGridDetalle;
                            for (int x = 0; x <= ctop.dgvXdetalle.RowCount - 1; x++)
                            {
                                ncolor = Convert.ToInt32(ctop.dgvXdetalle.Rows[x].Cells["nColor"].Value);
                                art    = ctop.dgvXdetalle.Rows[x].Cells["ART"].Value.ToString();
                                ctop.dgvXdetalle.Rows[x].Cells["escan"].Value = conex.Actualiza_grid(idpack, conex.GET_MOVID(Convert.ToInt32(tab.Name)), art, ncolor);
                            }
                        }

                        if (control.GetType() == typeof(ctrlGridDetalleBC))
                        {
                            ctrlGridDetalleBC ctop = control as ctrlGridDetalleBC;
                            for (int x = 0; x <= ctop.dataGridViewX1.RowCount - 1; x++)
                            {
                                ncolor = Convert.ToInt32(ctop.dataGridViewX1.Rows[x].Cells["nColor"].Value);
                                art    = ctop.dataGridViewX1.Rows[x].Cells["ART"].Value.ToString();
                                ctop.dataGridViewX1.Rows[x].Cells["escan"].Value = conex.Actualiza_grid(idpack, conex.GET_MOVID(Convert.ToInt32(tab.Name)), art, ncolor);
                            }
                        }

                        if (control.GetType() == typeof(ctrlGridDetalleBD))
                        {
                            ctrlGridDetalleBD ctop = control as ctrlGridDetalleBD;
                            for (int x = 0; x <= ctop.dgvXT1.RowCount - 1; x++)
                            {
                                ncolor = Convert.ToInt32(ctop.dgvXT1.Rows[x].Cells["nColor"].Value);
                                art    = ctop.dgvXT1.Rows[x].Cells["ART"].Value.ToString();
                                ctop.dgvXT1.Rows[x].Cells["escan"].Value = conex.Actualiza_grid(idpack, conex.GET_MOVID(Convert.ToInt32(tab.Name)), art, ncolor);
                            }
                        }
                    }
                }
            }
        }
Esempio n. 2
0
        public Object regresaTipoGrid(string categorias)
        {
            var x = new Object();

            x = new ctrlGridDetalle();

            return(x);
        }
Esempio n. 3
0
        public void dgvUN(ctrlGridDetalle top, int id)
        {
            string sp = "SP_Detalle_Packing";

            con = new SqlConnection(cadena());
            SqlCommand com = new SqlCommand(sp, con);

            con.Open();
            com.CommandType = CommandType.StoredProcedure;
            com.Parameters.Add("@ID", SqlDbType.Int).Value         = id;
            com.Parameters.Add("@opcion", SqlDbType.VarChar).Value = "TODO";
            com.Parameters.Add("@Filtro", SqlDbType.VarChar).Value = "UN";
            SqlDataReader dr = com.ExecuteReader();

            while (dr.Read())
            {
                top.dgvXdetalle.Rows.Add(dr["ID"], dr["Articulo"], dr["descripcion1"], dr["Color"], dr["Cant1"], dr["Cant2"], dr["Cant3"], dr["Cant4"], dr["Cant5"], dr["Cant6"], dr["Cant7"], dr["Cant8"], dr["Cant9"], dr["Cant10"], dr["Cant11"], dr["Cant12"], dr["Cant13"], dr["Cant14"], dr["Cant15"], 0, dr["Cantidad"], dr["nColor"]);
            }

            con.Close();
            dr.Close();

            NotSortable(top.dgvXdetalle);
        }
Esempio n. 4
0
        public void AgregarTap(Dictionary <int, string> ordenes, int id_p)
        {
            Conexion con = new Conexion();

            ID_packing    = id_p;
            lblXnIdp.Text = Convert.ToString(id_p);
            List <string> listCategoria = new List <string>();

            if (tabP.Tabs.Count == 0)
            {
                tabP.Size = new Size(1145, 400);
                //tabP.CloseButtonOnTabsVisible = true;
                tabP.TabItemClose += new DevComponents.DotNetBar.TabStrip.UserActionEventHandler(this.tabControl1_TabItemClose);
            }
            int x = 10, y = 25, increm = 280;

            foreach (int key in ordenes.Keys)     // recorre la lista
            {
                bool found = false;
                foreach (TabItem tab in tabP.Tabs) // recorre el tab para no repetir ordenes
                {
                    if (ordenes[key] == tab.Text)  // busca si ya existe un tab con la orden
                    {
                        found = true;              // si existe no la agrega
                        //MessageBox.Show("existe");
                    }
                }
                if (!found)
                {
                    newTab           = tabP.CreateTab(ordenes[key]);
                    panel            = (TabControlPanel)newTab.AttachedControl;
                    panel.AutoScroll = true;
                    listCategoria    = con.listaCat(key);
                    foreach (string s in listCategoria)
                    {
                        if (s == "TOPS")
                        {
                            ctrlGridDetalleTop ctT = new ctrlGridDetalleTop();
                            ctT.Name           = ordenes[key].ToString() + s;
                            ctT.lblXorden.Text = s;
                            ctT.Location       = new Point(x, y);
                            ctT.AutoScroll     = true;
                            panel.Controls.Add(ctT);
                            con.dgvT(ctT, key);
                            y              = y + increm;
                            Cont_art       = Cont_art + Convert.ToInt32(ctT.txtTot.Text);
                            txtXT_art.Text = Convert.ToString(Cont_art);
                        }
                        else if (s == "BOTTOMS - DAM")
                        {
                            ctrlGridDetalleBD ctBD = new ctrlGridDetalleBD();

                            ctBD.Name           = ordenes[key].ToString() + s;
                            ctBD.lblXorden.Text = s;
                            ctBD.Location       = new Point(x, y);
                            panel.Controls.Add(ctBD);
                            con.dgvBD(ctBD, key);
                            y              = y + increm;
                            Cont_art       = Cont_art + Convert.ToInt32(ctBD.txtTot.Text);
                            txtXT_art.Text = Convert.ToString(Cont_art);
                        }
                        else if (s == "BOTTOMS - CAB")
                        {
                            ctrlGridDetalleBC ctBC = new ctrlGridDetalleBC();
                            ctBC.Name           = ordenes[key].ToString() + s;
                            ctBC.lblXorden.Text = s;
                            ctBC.Location       = new Point(x, y);
                            panel.Controls.Add(ctBC);
                            con.dgvBC(ctBC, key);
                            y              = y + increm;
                            Cont_art       = Cont_art + Convert.ToInt32(ctBC.txtTot.Text);
                            txtXT_art.Text = Convert.ToString(Cont_art);
                        }
                        else if (s == "UNITALLA")
                        {
                            ctrlGridDetalle ctU = new ctrlGridDetalle();
                            ctU.Name           = ordenes[key].ToString() + s;
                            ctU.lblXorden.Text = s;
                            ctU.Location       = new Point(x, y);
                            panel.Controls.Add(ctU);
                            con.dgvUN(ctU, key);
                            y              = y + increm;
                            Cont_art       = Cont_art + Convert.ToInt32(ctU.txtTot.Text);
                            txtXT_art.Text = Convert.ToString(Cont_art);
                        }
                    }
                    //Cont_art = Cont_art + conex.total_orden(key);
                    swBtnPack  = new DevComponents.DotNetBar.Controls.SwitchButton();
                    swBtnPack  = propiedades(ordenes[key]);
                    panel.Name = Convert.ToString(key);
                    panel.Controls.Add(swBtnPack);
                    panel.AutoScroll = true;

                    this.PnlTabs.Controls.Add(tabP);
                    conex.GeneraDetallePack(id_p, Convert.ToInt32(ordenes[key]));
                    found = false;
                    x     = 10; y = 25;
                }
            }

            if (esPendiente)
            {
                GeneraBrtn();
                if (ordenes.Count() > 0)
                {
                    try
                    {
                        DescontarEnGrid(ID_packing, conex.GET_MOVID(Convert.ToInt32(tabP.SelectedPanel.Name)));
                    }
                    catch (Exception ER)
                    {
                        MessageBox.Show("Error: Pendiente-DescontarEnGrid. " + ER.Message);
                    }
                }
            }

            //foreach (string ord in ListaOrd)
            //{
            //    newTab = tabP.CreateTab(ord);
            //    panel = (TabControlPanel)newTab.AttachedControl;
            //    panel.Controls.Add(new ctrlGridDetalle());
            //    this.Controls.Add(tabP);

            //}
        }