private void ValidaProducto() { if (productid.Text.Trim().Length == 13) { var BL = new tb_60productosBL(); var BE = new tb_60productos(); var dt = new DataTable(); BE.moduloid = modulo; BE.productid = productid.Text.Trim(); BE.status = "0"; dt = BL.GetAll(EmpresaID, BE).Tables[0]; if (dt.Rows.Count > 0) { lineaid.Text = dt.Rows[0]["lineaid"].ToString().Trim(); lineaname.Text = dt.Rows[0]["lineaname"].ToString().Trim(); grupoid.Text = dt.Rows[0]["grupoid"].ToString().Trim(); gruponame.Text = dt.Rows[0]["gruponame"].ToString().Trim(); subgrupoid.Text = dt.Rows[0]["subgrupoid"].ToString().Trim(); subgruponame.Text = dt.Rows[0]["subgruponame"].ToString().Trim(); productid.Text = dt.Rows[0]["productid"].ToString().Trim(); productname.Text = dt.Rows[0]["productname"].ToString().Trim(); } else { productid.Text = string.Empty; productname.Text = string.Empty; } } else { productid.Text = string.Empty; productname.Text = string.Empty; } }
private void Llenar_Datos() { tb_60productos BE = new tb_60productos(); tb_60productosBL BL = new tb_60productosBL(); BE.moduloid = modulo.ToString(); Tablaproducto = BL.GetAll(EmpresaID, BE).Tables[0]; if (Tablaproducto.Rows.Count > 0) { MDI_dgb_productos.DataSource = Tablaproducto; } else { MDI_dgb_productos.DataSource = Tablaproducto; } }
private void form_cargar_datos() { try { var BL = new tb_60productosBL(); var BE = new tb_60productos(); BE.moduloid = modulo.ToString(); BE.filtro = "1"; Tablaproducto = BL.GetAll(EmpresaID, BE).Tables[0]; if (Tablaproducto.Rows.Count > 0) { dgbproductos.DataSource = Tablaproducto; btn_editar.Enabled = true; btn_eliminar.Enabled = true; btn_imprimir.Enabled = true; btn_salir.Enabled = true; } } catch (Exception ex) { MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void btn_busqueda_Click(object sender, EventArgs e) { var BL = new tb_60productosBL(); var BE = new tb_60productos(); BE.moduloid = modulo.ToString(); BE.codigo = cencosid.Text.Trim() + estacion.Text.Trim(); BE.filtro = "2"; BE.productname = txt_busqueda.Text.ToString(); Tablaproducto = BL.GetAll(EmpresaID, BE).Tables[0]; if (Tablaproducto.Rows.Count > 0) { dgbproductos.DataSource = Tablaproducto; btn_editar.Enabled = true; btn_eliminar.Enabled = true; btn_imprimir.Enabled = true; btn_salir.Enabled = true; } else { dgbproductos.DataSource = Tablaproducto; } }
private void Llenar_Datos() { if (cbo_moduloides.SelectedIndex != -1 && cbo_moduloides.SelectedValue.ToString() != "0000" && cbo_moduloides.SelectedValue.ToString() != "0200") { var BE = new tb_60productos(); var BL = new tb_60productosBL(); BE.moduloid = cbo_moduloides.SelectedValue.ToString(); BE.productname = txtbusqueda.Text.Trim(); Tablaproducto = BL.GetAll(EmpresaID, BE).Tables[0]; if (Tablaproducto.Rows.Count > 0) { MDI_dgb_productos.DataSource = Tablaproducto; } else { MDI_dgb_productos.DataSource = Tablaproducto; } } else { } }
private void ValidaProducto() { if (productid.Text.Trim().Length == 13) { var BL = new tb_60productosBL(); var BE = new tb_60productos(); var dt = new DataTable(); BE.moduloid = cbo_almacenes.SelectedValue.ToString(); BE.productid = productid.Text.Trim(); dt = BL.GetAll(EmpresaID, BE).Tables[0]; if (dt.Rows.Count > 0) { productid.Text = dt.Rows[0]["productid"].ToString().Trim(); productname.Text = dt.Rows[0]["productname"].ToString().Trim(); } else { productid.Text = string.Empty; productname.Text = string.Empty; } } else { productid.Text = string.Empty; productname.Text = string.Empty; } }
private void estacion_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Enter) { var numdo = string.Empty; if (estacion.Text.Trim().Length > 0) { numdo = estacion.Text.Trim().PadLeft(3, '0'); } estacion.Text = numdo; var BL = new tb_60productosBL(); var BE = new tb_60productos(); BE.moduloid = ((D60ALMACEN.MainAlmacen)MdiParent).moduloid; BE.codigo = cencosid.Text.Trim() + estacion.Text.Trim(); BE.filtro = "3"; DataDetalleMov = BL.GetAll(VariablesPublicas.EmpresaID, BE).Tables[0]; if (DataDetalleMov.Rows.Count > 0) { griddetallemov.DataSource = DataDetalleMov; } } }