private void _CargarCargos() { tb_me_cargoBL BL = new tb_me_cargoBL(); tb_me_cargo BE = new tb_me_cargo(); DataTable tbCargos = new DataTable(); tbCargos = BL.GetAll(EmpresaID, BE).Tables[0]; if (tbCargos.Rows.Count > 0) { cmb_cargo.DataSource = tbCargos; cmb_cargo.ValueMember = "cargoid"; cmb_cargo.DisplayMember = "cargoname"; } }
void ValidaCargo(String xcod) { tb_me_cargoBL BL = new tb_me_cargoBL(); tb_me_cargo BE = new tb_me_cargo(); DataTable dt = new DataTable(); BE.cargoid = xcod.ToString(); dt = BL.GetAll(EmpresaID,BE).Tables[0]; if (dt.Rows.Count > 0) { txt_cargoid.Text = dt.Rows[0]["cargoid"].ToString(); txt_cargoname.Text = dt.Rows[0]["cargoname"].ToString(); } else { txt_cargoid.Text = ""; txt_cargoname.Text = ""; } }
private void Delete() { try { if (txtcargoid.Text.Trim().Length == 0) { MessageBox.Show("Falta Codigo Cargo !!!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } else { var BL = new tb_me_cargoBL(); var BE = new tb_me_cargo(); BE.cargoid = txtcargoid.Text.ToString(); if (BL.Delete(EmpresaID, BE)) { SEGURIDAD_LOG("E"); MessageBox.Show("Datos Eliminados Correctamente !!!", "Confirmación", MessageBoxButtons.OK, MessageBoxIcon.Information); NIVEL_FORMS(); form_bloqueado(false); limpiar_documento(); data_Tablacargos(); btn_nuevo.Enabled = true; } } } catch (Exception ex) { MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void Update() { try { if (txtcargoid.Text.Trim().Length == 0) { MessageBox.Show("Falta Codigo de Cargo !!!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } else { if (txtcargoname.Text.Trim().Length == 0) { MessageBox.Show("Ingrese Nombre de Cargo", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } else { var BL = new tb_me_cargoBL(); var BE = new tb_me_cargo(); BE.cargoid = txtcargoid.Text.ToString(); BE.cargoname = txtcargoname.Text.ToString(); if (cmb_cateplan.SelectedIndex != -1) BE.cateplanid = Convert.ToInt32(cmb_cateplan.SelectedValue.ToString()); if (BL.Update(EmpresaID, BE)) { SEGURIDAD_LOG("M"); MessageBox.Show("Datos Modificado Correctamente !!!", "Confirmación", MessageBoxButtons.OK, MessageBoxIcon.Information); procesado = true; } } } } catch (Exception ex) { MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void data_Tablacargos() { try { if (Tablacargos.Rows.Count > 0) { Tablacargos.Rows.Clear(); } var BL = new tb_me_cargoBL(); var BE = new tb_me_cargo(); BE.cargoname = txtbusqueda.Text.Trim().ToUpper(); Tablacargos = BL.GetAll(EmpresaID, BE).Tables[0]; if (Tablacargos.Rows.Count > 0) { btn_imprimir.Enabled = true; dgb_cargos.DataSource = Tablacargos; dgb_cargos.Rows[0].Selected = false; } } catch (Exception ex) { MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }