Ejemplo n.º 1
0
        private void Bot_sincro_Click(object sender, EventArgs e)
        {
            using (PickingList pl = new PickingList())
            {
                pl.ShowDialog();
                int fila = 0;
                if (pl.List_products.Count() == 0)
                {
                    return;
                }
                //llenar el grid de renglones desde la sincronizacion.
                foreach (Producto item in pl.List_products)
                {
                    AgregarRenglon();
                    grid_items.Rows[fila].Cells["product_id"].Value = pl.List_products.ElementAt(fila).Product_id;
                    grid_items.Rows[fila].Cells["cant"].Value       = pl.List_products.ElementAt(fila).Product_quantity;
                    grid_items.Rows[fila].Cells["unidad"].Value     = "rollo cortado.";
                    grid_items.Rows[fila].Cells["ancho"].Value      = pl.List_products.ElementAt(fila).width;
                    grid_items.Rows[fila].Cells["largo"].Value      = pl.List_products.ElementAt(fila).lenght;
                    grid_items.Rows[fila].Cells["msi"].Value        = pl.List_products.ElementAt(fila).msi;
                    grid_items.Rows[fila].Cells["pie_lin"].Value    = Convert.ToDouble(pl.List_products.ElementAt(fila).msi) *
                                                                      Convert.ToDouble(pl.List_products.ElementAt(fila).Product_quantity);
                    grid_items.Rows[fila].Cells["ratio"].Value = despachomanager
                                                                 .GetRatioProduct(pl.List_products.ElementAt(fila).Product_id);
                    grid_items.Rows[fila].Cells["kilo_rollo"].Value =
                        Convert.ToDouble(grid_items.Rows[fila].Cells["msi"].Value) /
                        Convert.ToDouble(grid_items.Rows[fila].Cells["ratio"].Value);

                    grid_items.Rows[fila].Cells["kilo_total"].Value =
                        Convert.ToDouble(grid_items.Rows[fila].Cells["kilo_rollo"].Value) *
                        Convert.ToDouble(grid_items.Rows[fila].Cells["cant"].Value);

                    fila += 1;
                }
                //llenar el grid de unique_code.
                grid_UniqueCode.DataSource = pl.Lista_rollos.ToList();



                listarc = pl.Lista_rollos.ToList();
            }
        }
Ejemplo n.º 2
0
        private void LoadPicking()
        {
            DeleteRowBlank();
            using (PickingList pl = new PickingList())
            {
                pl.ShowDialog();
                switch (pl.Action)
                {
                case 0:
                    //pick de rolls
                    if (pl.List_products == null || pl.List_products.Count() == 0)
                    {
                        return;
                    }
                    FillFormDataCortados(pl);
                    break;

                case 1:
                    //pick de hojas
                    if (pl.Lista_hojas == null || pl.Lista_hojas.Count() == 0)
                    {
                        return;
                    }
                    FillFormDataHojas(pl);
                    break;

                case 2:
                    //pick de graphics
                    if (pl.Lista_graphics == null || pl.Lista_graphics.Count() == 0)
                    {
                        return;
                    }
                    FillFormDatagraphics(pl);
                    break;
                }
            }
        }