private void data_Tablactactelistitem()
 {
     TablactactelistItem = new DataTable();
     if (TablactactelistItem.Rows.Count > 0)
     {
         TablactactelistItem.Rows.Clear();
     }
     var BL = new tb_me_ctactelistitemBL();
     var BE = new tb_me_ctactelistitem();
     BE.ctactelistid = Convert.ToInt32(ctactelistid.Text.Trim());
     TablactactelistItem = BL.GetAll(EmpresaID, BE).Tables[0];
     if (TablactactelistItem.Rows.Count > 0)
     {
         MDI_dgv_ctactelistitem.DataSource = TablactactelistItem;
     }
     else
     {
         MDI_dgv_ctactelistitem.DataSource = TablactactelistItem;
     }
 }
        private void RecibeCliente(String xctacte, String xctactename, String resultado4, String resultado5, String otro)
        {
            if (xctacte.Trim().Length > 0)
            {
                ctacteid.Text = xctacte.Trim();
                ctactename.Text = xctactename.Trim();
                var BL = new tb_me_ctactelistitemBL();
                var BE = new tb_me_ctactelistitem();

                BE.ctactelistid = Convert.ToInt32(ctactelistid.Text.Trim());
                BE.ctacte = ctacteid.Text.Trim();
                BE.usuar = VariablesPublicas.Usuar.Trim();
                BE.status = "0";
                BE.feact = DateTime.Today;

                if (BL.Insert(EmpresaID, BE))
                {
                    data_Tablactactelistitem();
                }
            }
        }
        private void btn_del_Click(object sender, EventArgs e)
        {
            var xcoditem = string.Empty;
            if ((dgv_ctactelistitem.RowCount != null))
            {
                xcoditem = dgv_ctactelistitem.GetRowCellValue(dgv_ctactelistitem.FocusedRowHandle, "ctacte").ToString();
                var BL = new tb_me_ctactelistitemBL();
                var BE = new tb_me_ctactelistitem();
                BE.ctactelistid = Convert.ToInt32(ctactelistid.Text.Trim());
                BE.ctacte = ctacteid.Text.Trim();

                if (BL.Delete(EmpresaID, BE))
                {
                    data_Tablactactelistitem();
                }
            }
        }