private void ValidaDominio()
        {
            if (dominioid.Text.Trim().Length > 0)
            {
                sys_dominioBL BL = new sys_dominioBL();
                tb_sys_dominio BE = new tb_sys_dominio();
                DataTable dt = new DataTable();

                BE.dominioid = dominioid.Text.Trim().PadLeft(2, '0');

                dt = BL.GetAll(EmpresaID, BE).Tables[0];
                if (dt.Rows.Count > 0)
                {
                    dominioid.Text = dt.Rows[0]["dominioid"].ToString().Trim();
                    dominioname.Text = dt.Rows[0]["dominioname"].ToString().Trim();
                }
                else
                {
                    dominioid.Text = "";
                    dominioname.Text = "";
                }
            }
            else
            {
                dominioid.Text = "";
                dominioname.Text = "";
            }
        }
        private void ValidaDominio()
        {
            if (dominioid.Text.Trim().Length > 0)
            {
                var BL = new sys_dominioBL();
                var BE = new tb_sys_dominio();
                var dt = new DataTable();

                BE.dominioid = dominioid.Text.Trim().PadLeft(2, '0');

                dt = BL.GetAll(EmpresaID, BE).Tables[0];
                if (dt.Rows.Count > 0)
                {
                    dominioid.Text = dt.Rows[0]["dominioid"].ToString().Trim();
                    dominioname.Text = dt.Rows[0]["dominioname"].ToString().Trim();
                }
                else
                {
                    dominioid.Text = string.Empty;
                    dominioname.Text = string.Empty;
                    moduloid.Text = string.Empty;
                    moduloname.Text = string.Empty;
                    xlocal.Text = string.Empty;
                    localname.Text = string.Empty;
                    moduloid.Enabled = false;
                    xlocal.Enabled = false;
                }
            }
            else
            {
                dominioid.Text = string.Empty;
                dominioname.Text = string.Empty;
                moduloid.Text = string.Empty;
                moduloname.Text = string.Empty;
                xlocal.Text = string.Empty;
                localname.Text = string.Empty;
                moduloid.Enabled = false;
                xlocal.Enabled = false;
            }
        }
        private void data_Tabladominio()
        {
            try
            {
                if (Tabladominio != null)
                {
                    Tabladominio.Rows.Clear();
                }
                var BL = new sys_dominioBL();
                var BE = new tb_sys_dominio();

                Tabladominio = BL.GetAll(EmpresaID, BE).Tables[0];
                if (Tabladominio.Rows.Count > 0)
                {
                    btn_imprimir.Enabled = true;
                    griddominio.DataSource = Tabladominio;
                    griddominio.Rows[0].Selected = false;
                    griddominio.Focus();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
        private void ValidaDominio_nuevo()
        {
            var BL = new sys_dominioBL();
            var BE = new tb_sys_dominio();
            var dt = new DataTable();

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

            if (dt.Rows.Count == 0)
            {
                mensaje.Text = "VALIDO";
                mensaje.ForeColor = Color.Green;
                form_bloqueado(true);
                dominioname.Focus();

                btn_cancelar.Enabled = true;
                btn_grabar.Enabled = true;
            }
            else
            {
                mensaje.Text = "YA EXISTE";
                mensaje.ForeColor = Color.Red;
                dominioid.Focus();
            }
        }
        private void data_cbo_dominio()
        {
            try
            {
                var BL = new sys_dominioBL();
                var BE = new tb_sys_dominio();

                dominioid.DataSource = BL.GetAll(EmpresaID, BE).Tables[0];
                dominioid.ValueMember = "dominioid";
                dominioid.DisplayMember = "dominioname";
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }