private void Insert_DBF() { try { if (txtcanalvtaid.Text.Length == 0) { MessageBox.Show("Ingrese el Canal de Venta !!!"); return; } var BL = new clienteBL(); var BE = new tb_cliente(); BE.ctacte = txtcodigo.Text.Trim().ToUpper(); BE.ctactename = txtrazonsocial.Text.Trim().ToUpper(); BE.docuidentid = cboTipdoc.SelectedValue.ToString(); BE.nmruc = txtmnruc.Text.Trim().ToUpper(); if (rbnatural.Checked == true) { BE.tpperson = "01"; } if (rbjuridica.Checked == true) { BE.tpperson = "02"; } if (rbnodom.Checked == true) { BE.tpperson = "03"; } BE.agerent = chkretencion.Checked; BE.appat = txtapepat.Text.Trim().ToUpper(); BE.apmat = txtapemat.Text.Trim().ToUpper(); BE.nombr = txtnombres.Text.Trim().ToUpper(); BE.direc = txtdireccion.Text.Trim().ToUpper(); BE.paisid = txtpaisid.Text.Trim().ToUpper(); if (txtpaisid.Text.Trim() != "9589") { BE.ubige = "000000"; } else { BE.ubige = cboDistr.SelectedValue.ToString(); } BE.telef1 = txttelefono1.Text.Trim().ToUpper(); BE.email = txtemail.Text.Trim().ToUpper(); BE.urweb = txtweb.Text.Trim().ToUpper(); BE.telef2 = txttelefono2.Text.Trim().ToUpper(); BE.telef3 = txttelefono3.Text.Trim().ToUpper(); BE.contacto = txtContacto.Text.Trim().ToUpper(); BE.nctactedetraccion = txtctadetrac.Text.Trim().ToUpper(); BE.canalventaid = txtcanalvtaid.Text; BE.replegaldni = txtreplegaldni.Text; BE.replegalname = txtreplegalname.Text; if (rbactivo.Checked == true) { BE.status = "0"; } if (rbbaja.Checked == true) { BE.status = "1"; } if (rbanulado.Checked == true) { BE.status = "9"; } BE.usuar = VariablesPublicas.Usuar.Trim(); if (BE.status == "0") BE.status = "1"; // 1 PARA DBF ES ACTIVO BE.ctacte = Equivalencias.Right(txtcodigo.Text.Trim().ToUpper(), 4); BE.usuar = Equivalencias.Left(VariablesPublicas.Usuar.Trim(), 3); BE.ctactename = Equivalencias.Left(txtrazonsocial.Text.Trim(), 60); BE.direc = Equivalencias.Left(txtdireccion.Text.Trim(), 100); if (BL.Insert_dbf(VariablesPublicas.EmpresaID.ToString(), BE)) { } else { MessageBox.Show("Contacte con sistemas", "Mensaje del Sistema", MessageBoxButtons.OK, MessageBoxIcon.Warning); } } catch (Exception ex) { MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }