private void Insert() { try { if (U_Validacion()) { // CLASES PARA LA INSERCION DE VENDEDORES var BL = new tb_me_vendedorBL(); var BE = new tb_me_vendedor(); // CLASES PARA EL LLAMADO DEL INSERCION DE RRHH rrhh_personalBL BLR = new rrhh_personalBL(); tb_rrhh_personal BER = new tb_rrhh_personal(); BE.vendorname = txt_vendorname.Text.Trim().ToUpper(); BE.appat = txt_apepat.Text.ToUpper(); BE.apmat = txt_apemat.Text.ToUpper(); BE.nombre = txt_nombre.Text.ToUpper(); BE.ddnni = txt_dni.Text.Trim(); BE.direcc = txt_direcc.Text.Trim(); if (txt_fechnac.Text.Length > 0) BE.fechnac = Convert.ToDateTime(txt_fechnac.Text); BE.local = txt_local.Text.Trim(); if (txt_fechini.Text.Length > 0) BE.fechini = Convert.ToDateTime(txt_fechini.Text); if (txt_fechcese.Text.Length > 0) BE.fechcese = Convert.ToDateTime(txt_fechcese.Text); BE.telefono = txt_telefono.Text; BE.remunebas = Convert.ToDecimal(txt_remunebas.Text); BE.cargoid = txt_cargoid.Text.Trim(); if (txt_fechasig.Text.Length > 0) BE.fechasig = Convert.ToDateTime(txt_fechasig.Text); BE.sexo = rb_sexo.EditValue.ToString(); BE.conhijos = chk_conhijos.Checked; BE.comisiona = chk_comisiona.Checked; BE.observac = txt_observ.Text.Trim(); BE.status = "0"; BE.usuar = VariablesPublicas.Usuar.Trim().ToUpper(); String xxMessage = ""; if (BL.Insert(EmpresaID, BE)) { xxMessage = "1"; // Verificamos en el Datapi Si Existe un Personal con el Dni if (SearchWebDNI() > 0) { if (UpdateWeb()) { xxMessage = xxMessage + " / 2"; } } else { if (InsertWeb()) { xxMessage = xxMessage + " / 2"; } } MessageBox.Show("Datos " + xxMessage + " Grabados 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 (U_Validacion()) { var BL = new tb_me_vendedorBL(); var BE = new tb_me_vendedor(); BE.vendorid = txt_vendorid.Text.Trim(); if (BL.Delete(EmpresaID, BE)) { SEGURIDAD_LOG("E"); MessageBox.Show("Datos Eliminado Correctamente !!!", "Confirmación", MessageBoxButtons.OK, MessageBoxIcon.Information); NIVEL_FORMS(); limpiar_documento(); form_bloqueado(false); data_TablaVendedor(); btn_nuevo.Enabled = true; } } } catch (Exception ex) { MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void data_TablaVendedor() { try { if (TablaVendedor.Rows.Count > 0) { TablaVendedor.Rows.Clear(); } var BL = new tb_me_vendedorBL(); var BE = new tb_me_vendedor(); BE.parameters = txt_busqueda.Text.Trim(); BE.activo = Convert.ToBoolean(rb_tipo.EditValue); TablaVendedor = BL.GetAll2(EmpresaID, BE).Tables[0]; if (TablaVendedor.Rows.Count > 0) { btn_imprimir.Enabled = true; Mdi_dgv_vendedor.DataSource = TablaVendedor; lbl_num.Text = Convert.ToInt32(TablaVendedor.Compute("sum(id)", string.Empty)).ToString(); } else { Mdi_dgv_vendedor.DataSource = TablaVendedor; lbl_num.Text = "0"; } } catch (Exception ex) { MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
void CargarCargoVendedor(String xcod) { TablaVendedorDet = new DataTable(); TablaVendedorDet.Columns.Add("fechasig", typeof(DateTime)); TablaVendedorDet.Columns.Add("local", typeof(String)); TablaVendedorDet.Columns.Add("localname", typeof(String)); TablaVendedorDet.Columns.Add("cargoid", typeof(String)); TablaVendedorDet.Columns.Add("cargoname", typeof(String)); TablaVendedorDet.Columns.Add("observac", typeof(String)); tb_me_vendedorBL BL = new tb_me_vendedorBL(); tb_me_vendedor BE = new tb_me_vendedor(); BE.vendorid = xcod.ToString(); TablaVendedorDet = BL.GetAll_History(EmpresaID, BE).Tables[0]; MDI_dgb_vendorcargo.DataSource = TablaVendedorDet; }
private void btn_act_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { tb_me_vendedorBL BL = new tb_me_vendedorBL(); tb_me_vendedor BE = new tb_me_vendedor(); if (BL.Insert_Freeze(EmpresaID, BE)) { MessageBox.Show("Proceso Terminado Correctamente !!!", "Confirmación", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
void ValidaVendedor(String xcodvendor) { tb_me_vendedorBL BL = new tb_me_vendedorBL(); tb_me_vendedor BE = new tb_me_vendedor(); DataTable dt = new DataTable(); BE.vendorid = xcodvendor.ToString(); dt = BL.GetAll(EmpresaID, BE).Tables[0]; if (dt.Rows.Count > 0) { txt_vendorid.Text = dt.Rows[0]["vendorid"].ToString(); txt_vendorname.Text = dt.Rows[0]["vendorname"].ToString(); txt_apepat.Text = dt.Rows[0]["appat"].ToString(); txt_apemat.Text = dt.Rows[0]["apmat"].ToString(); txt_nombre.Text = dt.Rows[0]["nombre"].ToString(); txt_dni.Text = dt.Rows[0]["ddnni"].ToString(); txt_direcc.Text = dt.Rows[0]["direcc"].ToString(); if (dt.Rows[0]["fechnac"].ToString().Length > 0) txt_fechnac.Text = dt.Rows[0]["fechnac"].ToString().Substring(0,10); txt_local.Text = dt.Rows[0]["local"].ToString(); txt_localname.Text = dt.Rows[0]["localname"].ToString(); txt_fechini.Text = dt.Rows[0]["fechini"].ToString().Substring(0,10); if (dt.Rows[0]["fechcese"].ToString().Length > 0) txt_fechcese.Text = dt.Rows[0]["fechcese"].ToString().Substring(0,10); txt_telefono.Text = dt.Rows[0]["telefono"].ToString(); txt_remunebas.Text = dt.Rows[0]["remunebas"].ToString(); //txt_vendorid.Text = dt.Rows[0]["porccomic"].ToString(); txt_cargoid.Text = dt.Rows[0]["cargoid"].ToString(); txt_cargoname.Text = dt.Rows[0]["cargoname"].ToString(); if (dt.Rows[0]["fechasig"].ToString().Length > 0) txt_fechasig.Text = dt.Rows[0]["fechasig"].ToString().Substring(0,10); rb_sexo.EditValue = dt.Rows[0]["sexo"].ToString(); chk_conhijos.Checked = Convert.ToBoolean(dt.Rows[0]["conhijos"].ToString()); chk_comisiona.Checked = Convert.ToBoolean(dt.Rows[0]["comisiona"].ToString()); txt_observ.Text = dt.Rows[0]["observac"].ToString(); } btn_nuevo.Enabled = true; btn_editar.Enabled = true; btn_eliminar.Enabled = true; btn_imprimir.Enabled = true; btn_log.Enabled = true; btn_salir.Enabled = true; }