private void Dgb_ControlStock_MouseClick(object sender, MouseEventArgs e) { var BL = new tb_60movimientosdetBL(); var BE = new tb_60movimientosdet(); if (dgb_mainStock.DataRowCount > 0) { var xproductid = dgb_mainStock.GetFocusedRowCellValue("productid").ToString(); BE.moduloid = modulo; BE.productid = xproductid.ToString(); BE.filtro = "2"; TablaHistorial = BL.GetAll_KardexEstacion(EmpresaID, BE).Tables[0]; if (TablaHistorial.Rows.Count > 0) { Examinar_Historial.DataSource = TablaHistorial; } else { Examinar_Historial.DataSource = TablaHistorial; } } }
private void cmb_estacion_SelectedIndexChanged(object sender, EventArgs e) { if (cmb_estacion.SelectedIndex != -1) { var BL = new tb_60movimientosdetBL(); var BE = new tb_60movimientosdet(); BE.moduloid = modulo; BE.codigo = cencosid.Text.ToString() + cmb_estacion.SelectedValue.ToString(); BE.filtro = "1"; TablaStock = BL.GetAll_KardexEstacion(EmpresaID, BE).Tables[0]; if (TablaStock.Rows.Count > 0) { Dgb_ControlStock.DataSource = TablaStock; } else { Dgb_ControlStock.DataSource = TablaStock; } } if (TablaHistorial.Rows.Count > 0) { TablaHistorial.Clear(); } }
private void btn_print_Click(object sender, EventArgs e) { var BL = new tb_60movimientosdetBL(); var BE = new tb_60movimientosdet(); if (cencosid.Text.ToString() == string.Empty) { MessageBox.Show("Indicar el Centro de Costo ...!!!"); return; } if (cmb_estacion.SelectedIndex == -1) { MessageBox.Show("Seleccione una Estación ...!!!"); return; } else { var xproductid = string.Empty; var xproductname = string.Empty; if (TablaReporte.Rows.Count > 0) { TablaReporte.Rows.Clear(); } foreach (DataRow fila in TablaStock.Rows) { xproductid = fila["productid"].ToString(); xproductname = fila["productname"].ToString(); BE.moduloid = modulo.ToString(); BE.productid = xproductid.ToString(); BE.filtro = "2"; TablaHistorial = BL.GetAll_KardexEstacion(EmpresaID, BE).Tables[0]; if (TablaHistorial.Rows.Count > 0) { foreach (DataRow rows in TablaHistorial.Rows) { row = TablaReporte.NewRow(); row["cencosid"] = cencosid.Text.Trim(); row["cencosname"] = cencosname.Text.Trim(); row["estacion"] = cmb_estacion.SelectedValue.ToString(); row["productid"] = xproductid.ToString(); row["productname"] = xproductname.ToString(); row["fechdoc"] = rows["fechdoc"].ToString(); row["tipodoc"] = rows["tipodoc"].ToString(); row["serdoc"] = rows["serdoc"].ToString(); row["numdoc"] = rows["numdoc"].ToString(); row["cantidad"] = rows["cantidad"].ToString(); row["motivo"] = rows["motivo"].ToString(); row["perdni"] = rows["perdni"].ToString(); row["nombrelargo"] = rows["nombrelargo"].ToString(); TablaReporte.Rows.Add(row); } } } if (TablaReporte.Rows.Count > 0) { var miForma = new REPORTES.Frm_reportes(); miForma.Table = TablaReporte; miForma.Text = "Stock x Estaciones"; miForma.formulario = "Frm_reporte_StockEstacion"; miForma.ShowDialog(); } } }
private void CargarComboEstaciones() { var BL = new tb_60movimientosdetBL(); var BE = new tb_60movimientosdet(); var dt = new DataTable(); BE.moduloid = modulo; BE.codigo = cencosid.Text.ToString(); BE.filtro = "3"; dt = BL.GetAll_KardexEstacion(EmpresaID, BE).Tables[0]; if (dt.Rows.Count > 0) { cmb_estacion.DataSource = dt; cmb_estacion.DisplayMember = "estacion"; cmb_estacion.ValueMember = "estacion"; } }
private void btn_print_Click(object sender, EventArgs e) { tb_60movimientosdetBL BL = new tb_60movimientosdetBL(); tb_60movimientosdet BE = new tb_60movimientosdet(); if (productid.Text.ToString() == "") { MessageBox.Show("Falta el Codigo de Producto ...!!!"); return; } else { String xproductid = "", xproductname = ""; if (TablaReporte.Rows.Count > 0) { TablaReporte.Rows.Clear(); } foreach (DataRow fila in TablaStock.Rows) { xproductid = fila["productid"].ToString(); xproductname = fila["productname"].ToString(); BE.moduloid = modulo.ToString(); BE.productid = xproductid.ToString(); BE.filtro = "2"; TablaHistorial = BL.GetAll_KardexEstacion(EmpresaID, BE).Tables[0]; if (TablaHistorial.Rows.Count > 0) { foreach (DataRow rows in TablaHistorial.Rows) { ////row = TablaReporte.NewRow(); ////row["cencosid"] = cencosid.Text.Trim(); ////row["cencosname"] = cencosname.Text.Trim(); ////row["estacion"] = cmb_estacion.SelectedValue.ToString(); ////row["productid"] = xproductid.ToString(); ////row["productname"] = xproductname.ToString(); ////row["fechdoc"] = rows["fechdoc"].ToString(); ////row["tipodoc"] = rows["tipodoc"].ToString(); ////row["serdoc"] = rows["serdoc"].ToString(); ////row["numdoc"] = rows["numdoc"].ToString(); ////row["cantidad"] = rows["cantidad"].ToString(); ////row["motivo"] = rows["motivo"].ToString(); ////row["perdni"] = rows["perdni"].ToString(); ////row["nombrelargo"] = rows["nombrelargo"].ToString(); ////TablaReporte.Rows.Add(row); } } } if (TablaReporte.Rows.Count > 0) { //REPORTES.Frm_reportes miForma = new REPORTES.Frm_reportes(); //miForma.Table = TablaReporte; //miForma.Text = "Stock x Estaciones"; //miForma.formulario = "Frm_reporte_StockEstacion"; //miForma.ShowDialog(); } } }