private void data_TablaCanalVta()
        {
            try
            {
                if (TablaCanalVta.Rows.Count > 0)
                {
                    TablaCanalVta.Rows.Clear();
                }
                var BL = new tb_cp_canalventaBL();
                var BE = new tb_cp_canalventa();

                BE.parameters = txtbusqueda.Text.Trim().ToUpper();

                TablaCanalVta = BL.GetAll2(EmpresaID, BE).Tables[0];
                if (TablaCanalVta.Rows.Count > 0)
                {
                    btn_imprimir.Enabled = true;
                    dgb_canalvta.DataSource = TablaCanalVta;
                    dgb_canalvta.Rows[0].Selected = false;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
        void ValidaCanal(String xcod)
        {
            var BL = new tb_cp_canalventaBL();
            var BE = new tb_cp_canalventa();
            DataTable dt = new DataTable();
            BE.parameters = xcod;

            dt = BL.GetAll2(VariablesPublicas.EmpresaID, BE).Tables[0];
            if (dt.Rows.Count > 0)
            {
                txtcanalvtaname.Text = dt.Rows[0]["canalventaname"].ToString();
            }
        }