// Combo Parte Prenda void CargaPartePrenda() { tb_pp_parteprendaBL BL = new tb_pp_parteprendaBL(); tb_pp_parteprenda BE = new tb_pp_parteprenda(); DataTable dt = new DataTable(); dt = BL.GetAll(EmpresaID, BE).Tables[0]; if (dt.Rows.Count > 0) { cmb_partepda.DataSource = dt; cmb_partepda.ValueMember = "partepdaid"; cmb_partepda.DisplayMember = "partepdaname"; cmb_partepda.SelectedIndex = 0; } }
private void Update() { try { if (txt_partepdaid.Text.Trim().Length == 0) { MessageBox.Show("Falta Codigo de Parte !!!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } else { if (txt_partepdaname.Text.Trim().Length == 0) { MessageBox.Show("Ingrese una Descripcion", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } else { var BL = new tb_pp_parteprendaBL(); var BE = new tb_pp_parteprenda(); BE.partepdaid = Convert.ToInt32(txt_partepdaid.Text); BE.partepdaname = txt_partepdaname.Text.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 Delete() { try { if (txt_partepdaid.Text.Trim().Length == 0) { MessageBox.Show("Falta Codigo Parte !!!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } else { var BL = new tb_pp_parteprendaBL(); var BE = new tb_pp_parteprenda(); BE.partepdaid = Convert.ToInt32(txt_partepdaid.Text); 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_TablaPartePrenda(); btn_nuevo.Enabled = true; } } } catch (Exception ex) { MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void Insert() { try { if (txt_partepdaname.Text.Trim().Length == 0) { MessageBox.Show("Ingrese una Descripción", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } else { var BL = new tb_pp_parteprendaBL(); var BE = new tb_pp_parteprenda(); BE.partepdaname = txt_partepdaname.Text.ToString(); if (BL.Insert(EmpresaID, BE)) { MessageBox.Show("Datos Grabados Correctamente !!!", "Confirmación", MessageBoxButtons.OK, MessageBoxIcon.Information); procesado = true; } } } catch (Exception ex) { MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void data_TablaPartePrenda() { try { if (TablaPartePrenda.Rows.Count > 0) { TablaPartePrenda.Rows.Clear(); } var BL = new tb_pp_parteprendaBL(); var BE = new tb_pp_parteprenda(); BE.partepdaname = txtbusqueda.Text.ToString(); TablaPartePrenda = BL.GetAll(EmpresaID, BE).Tables[0]; if (TablaPartePrenda.Rows.Count > 0) { btn_imprimir.Enabled = true; dgv_parteprenda.DataSource = TablaPartePrenda; dgv_parteprenda.Rows[0].Selected = false; } } catch (Exception ex) { MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }