private void Bot_leer_Click(object sender, EventArgs e) { ExtraerDataAppMovil(); //getdata de los unique code. foreach (Roll_Details item in Lista_rollos) { Roll_Details rollo = produccionManager.GetDataUniqueCode(item.Unique_code); item.Product_id = rollo.Product_id; item.Product_name = rollo.Product_name; item.Roll_number = rollo.Roll_number; item.Width = rollo.Width; item.Large = rollo.Large; item.Msi = rollo.Msi; item.Splice = rollo.Splice; item.Roll_id = rollo.Roll_id; item.Code_Person = rollo.Code_Person; item.Status = rollo.Status; } grid_itemRC.DataSource = Lista_rollos; //linq que consolida los renglones del conduce. CALCULATE_DATA(); grid_productos.DataSource = List_products.ToList(); REGISTROS_TOTALES.Text = "Numero de Registros : " + Lista_rollos.Count.ToString(); }
private void FillFormDataHojas(PickingList pl) { int row = grid_items.Rows.Count; int index = 0; //llenar el grid de renglones desde la sincronizacion. foreach (ClassRecepcion item in pl.Lista_hojas) { AgregarRenglon(); grid_items.Rows[row].Cells["product_id"].Value = pl.Lista_hojas.ElementAt(index).Part_Number; grid_items.Rows[row].Cells["cant"].Value = pl.Lista_hojas.ElementAt(index).cant_despacho; grid_items.Rows[row].Cells["unidad"].Value = "hojas"; grid_items.Rows[row].Cells["ancho"].Value = pl.Lista_hojas.ElementAt(index).Width; grid_items.Rows[row].Cells["largo"].Value = pl.Lista_hojas.ElementAt(index).Lenght; grid_items.Rows[row].Cells["msi"].Value = 0; grid_items.Rows[row].Cells["pie_lin"].Value = 0; grid_items.Rows[row].Cells["ratio"].Value = 0; grid_items.Rows[row].Cells["kilo_rollo"].Value = 0; grid_items.Rows[row].Cells["kilo_total"].Value = 0; grid_items.Rows[row].Cells["action"].Value = 1; row += 1; index += 1; } //llenar el grid de ID con los datos de las hojas. foreach (ClassRecepcion item in pl.Lista_hojas) { Roll_Details hoja = new Roll_Details { Product_id = item.Part_Number, Product_name = item.ProductName, Roll_id = item.Palet_number, Roll_number = "0", Code_Person = "0", Unique_code = "0", Tipo_pro = 1, Cant_despacho = Convert.ToInt32(item.cant_despacho), Cantidad = item.Palet_paginas, Tipo_mov = item.Tipo }; listarc.Add(hoja); } grid_UniqueCode.DataSource = listarc.ToList(); }
private void FillFormDatagraphics(PickingList pl) { int row = grid_items.Rows.Count; int index = 0; foreach (ClassRecepcion item in pl.Lista_graphics) { AgregarRenglon(); grid_items.Rows[row].Cells["product_id"].Value = pl.Lista_graphics.ElementAt(index).Part_Number; grid_items.Rows[row].Cells["cant"].Value = 1; grid_items.Rows[row].Cells["unidad"].Value = "graphics"; grid_items.Rows[row].Cells["ancho"].Value = pl.Lista_graphics.ElementAt(index).Width; grid_items.Rows[row].Cells["largo"].Value = pl.Lista_graphics.ElementAt(index).Lenght; grid_items.Rows[row].Cells["msi"].Value = 0; grid_items.Rows[row].Cells["pie_lin"].Value = 0; grid_items.Rows[row].Cells["ratio"].Value = 0; grid_items.Rows[row].Cells["kilo_rollo"].Value = 0; grid_items.Rows[row].Cells["kilo_total"].Value = 0; grid_items.Rows[row].Cells["action"].Value = 2; row += 1; index += 1; } //llenar el grid de ID con los datos de las hojas. foreach (ClassRecepcion item in pl.Lista_graphics) { Roll_Details graphic = new Roll_Details { Product_id = item.Part_Number, Product_name = item.ProductName, Roll_id = item.Roll_ID, Roll_number = "0", Code_Person = "0", Unique_code = "0", Tipo_pro = 2, Cant_despacho = 1, Cantidad = 1, Tipo_mov = item.Tipo }; listarc.Add(graphic); } grid_UniqueCode.DataSource = listarc.ToList(); }
private void ExtraerDataAppMovil() { //extraigo los unique code Lista_rollos = new List <Roll_Details>(); if (File.Exists(R.PATH_FILES.FILE_TXT_DATA_PICKING_DESPACHO)) { try { using (StreamReader sr = new StreamReader(R.PATH_FILES.FILE_TXT_DATA_PICKING_DESPACHO)) { while (sr.Peek() >= 0) { try { string str; string[] strArray; str = sr.ReadLine(); strArray = str.Split(','); string unique = strArray[0]; Roll_Details rollo = new Roll_Details { Unique_code = strArray[0], }; Lista_rollos.Add(rollo); } catch (Exception ex) { MessageBox.Show("error al leer la data y convertir el archivo txt de despacho: " + ex); } } } } catch (Exception ex) { MessageBox.Show("error al tratar de crear el txt de despacho" + ex); } } }
private void LoadRC() { string prefix; if (txt_uniqueCode.Text.Length == 7) { prefix = ""; } else { prefix = "RC"; } Roll_Details rollo = produccionManager.GetDataUniqueCode(prefix + txt_uniqueCode.Text.Trim()); //verificar valores vacios. if (rollo.Unique_code == "" || rollo.Unique_code == null) { return; } //verificar valores repetidos foreach (Roll_Details item in Lista_rollos) { if (item.Unique_code.Equals(prefix + txt_uniqueCode.Text.Trim())) { MessageBox.Show("esta repetido"); txt_uniqueCode.Text = ""; return; } } Lista_rollos.Add(rollo); grid_itemRC.DataSource = Lista_rollos.ToList(); txt_uniqueCode.Text = ""; REGISTROS_TOTALES.Text = "Numero de Registros : " + Lista_rollos.Count.ToString(); }
private void SAVEDATA_CORTADOS() { int OrdenCorte = 1; Orden ocorte = new Orden { Numero = OrdenCorte.ToString(), Fecha = DateTime.Today, Fecha_produccion = DateTime.Today, Product_id = Convert.ToString(GRID_IMPORT.Rows[0].Cells["F1"].Value), Rollid_1 = "1", Rollid_2 = "2", Width_1 = 0, Width_2 = 0, Lenght_1 = 0, Rest1_width = 0, Rest2_width = 0, Rest1_lenght = 0, Rest2_lenght = 0, Cantidad_Rollos = 0, Cantidad_Rollos2 = 0, Util1_real_Lenght = 0, Util2_real_Lenght = 0, Util1_Real_Width = 0, Util2_Real_Width = 0, Anulada = false, Procesado = false, Status = 0 }; ocorte.rollos = new List <Roll_Details>(); ocorte.Cortes = new List <Corte>(); Corte c = new Corte { Num = 0, Msi = 0, Width = 0, Lenght = 0, Orden = Convert.ToString(OrdenCorte) }; ocorte.Cortes.Add(c); int fil = 1; foreach (DataGridViewRow row in GRID_IMPORT.Rows) { Roll_Details data = new Roll_Details { Fecha = DateTime.Today, Numero_Orden = Convert.ToString(OrdenCorte), Product_id = Convert.ToString(row.Cells["F1"].Value) + "0", Product_name = Convert.ToString(GRID_IMPORT.Rows[fil - 1].Cells["F2"].Value), Roll_number = Convert.ToString(fil), Code_Person = Convert.ToString(row.Cells["F9"].Value), Unique_code = Convert.ToString(row.Cells["F7"].Value), Width = Convert.ToDecimal(row.Cells["F4"].Value), Large = Convert.ToDecimal(row.Cells["F5"].Value), Msi = Convert.ToDecimal(row.Cells["F6"].Value), Roll_id = Convert.ToString(row.Cells["F3"].Value), Splice = Convert.ToInt16(row.Cells["F8"].Value), Status = "Ok", Disponible = true }; fil += 1; OrdenCorte++; ocorte.rollos.Add(data); } managerorden.AddRolls(ocorte, false); MessageBox.Show("se guardaron los datos correctamente en el servidor..."); }