private void ValidaLinea() { if (lineaid.Text.Trim().Length > 0 && ssModo == "NEW") { var BL = new tb_me_lineaBL(); var BE = new tb_me_linea(); var dt = new DataTable(); BE.moduloid = modulo; BE.lineaid = lineaid.Text.Trim().PadLeft(3, '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(); generar_denominacion(); } else { lineaid.Text = string.Empty; lineaname.Text = string.Empty; generar_denominacion(); } } if (lineaid.Text.Trim().Length == 0 && ssModo == "NEW") { lineaid.Text = string.Empty; lineaname.Text = string.Empty; generar_denominacion(); } }
private void data_Tablalinea() { try { if (Tablalinea.Rows.Count > 0) Tablalinea.Rows.Clear(); tb_me_lineaBL BL = new tb_me_lineaBL(); tb_me_linea BE = new tb_me_linea(); BE.moduloid = modulo; BE.lineaname = txt_criterio.Text.Trim().ToUpper(); Tablalinea = BL.GetAll(EmpresaID, BE).Tables[0]; if (Tablalinea.Rows.Count > 0) { btn_imprimir.Enabled = true; gridlinea.DataSource = Tablalinea; gridlinea.Rows[0].Selected = false; gridlinea.Focus(); } } catch (Exception ex) { MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void ValidaLinea() { if (lineaid.Text.Trim().Length > 0) { tb_me_lineaBL BL = new tb_me_lineaBL(); tb_me_linea BE = new tb_me_linea(); DataTable dt = new DataTable(); BE.moduloid = modulo; BE.lineaid = lineaid.Text.Trim().PadLeft(3, '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(); } else { lineaid.Text = ""; lineaname.Text = ""; } } else { lineaid.Text = ""; lineaname.Text = ""; } }