public DataSet GetAll(string empresaid, tb_CanalVenta BE)
 {
     using (SqlConnection cnx = new SqlConnection(conex.empConexion(empresaid)))
     {
         using (SqlCommand cmd = new SqlCommand("gspTbCanalVenta_SEARCH", cnx))
         {
             DataSet ds = new DataSet();
             {
                 cmd.CommandType = CommandType.StoredProcedure;
                 cmd.Parameters.Add("@canalventaid", SqlDbType.Char, 3).Value = BE.canalventaid;
                 cmd.Parameters.Add("@canalventaname", SqlDbType.VarChar, 20).Value = BE.canalventaname;
             }
             try
             {
                 cnx.Open();
                 using (SqlDataAdapter da = new SqlDataAdapter(cmd))
                 {
                     da.Fill(ds);
                 }
                 return ds;
             }
             catch (Exception ex)
             {
                 throw new Exception(ex.Message);
             }
         }
     }
 }
 public bool Delete(string empresaid, tb_CanalVenta BE)
 {
     using (SqlConnection cnx = new SqlConnection(conex.empConexion(empresaid)))
     {
         using (SqlCommand cmd = new SqlCommand("gspTbCanalVenta_DELETE", cnx))
         {
             {
                 cmd.CommandType = CommandType.StoredProcedure;
                 cmd.Parameters.Add("@canalventaid", SqlDbType.Char, 3).Value = BE.canalventaid;
             }
             try
             {
                 cnx.Open();
                 if (cmd.ExecuteNonQuery() > 0)
                 {
                     return true;
                 }
                 else
                 {
                     return false;
                 }
             }
             catch (Exception ex)
             {
                 throw new Exception(ex.Message);
             }
         }
     }
 }
 public bool Update(string empresaid, tb_CanalVenta BE)
 {
     return tablaDA.Update(empresaid, BE);
 }
 public bool Insert(string empresaid, tb_CanalVenta BE)
 {
     return tablaDA.Insert(empresaid, BE);
 }
 public DataSet GetAll_paginacion(string empresaid, tb_CanalVenta BE)
 {
     return tablaDA.GetAll_paginacion(empresaid, BE);
 }
 public bool Delete(string empresaid, tb_CanalVenta BE)
 {
     return tablaDA.Delete(empresaid, BE);
 }
        private void get_CanalVenta()
        {
            try
            {
                var BL = new tb_CanalVentaBL();
                var BE = new tb_CanalVenta();

                var dt = new DataTable();

                dt = BL.GetAll(EmpresaID, BE).Tables[0];

                if (dt.Rows.Count > 0)
                {
                    cboCanalventa.DataSource = dt;
                    cboCanalventa.ValueMember = "canalventaid";
                    cboCanalventa.DisplayMember = "canalventaname";
                }
                else
                {
                    MessageBox.Show("No Existe Canal de Venta", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }