Пример #1
0
        private void btnAceptar_Click(object sender, EventArgs e)
        {
            if (DirectorioActivo.Autenticar(Common.Common.Dominio, txtUser.Text.ToString(), txtPwd.Text.ToString(), DBMETAL_SHARP.Common.Common.path))
            {
                List <Entidades.Ent_Usuario> user = ConsultaEntidades.ObtenerUsuarioPorRoles("GetUserForRoles", txtUser.Text.ToString().Trim());

                if (user != null && user.Count() > 0)
                {
                    Common.Common.User        = user;
                    Common.Common.Permissions = ConsultaEntidades.GetPermisosRoles("SPGet_RolesForUser", txtUser.Text.ToString().Trim(), "frmPpal");

                    if (Common.Common.Permissions.Count > 0)
                    {
                        frmSplash oSplash = new frmSplash();
                        oSplash.Show();
                        this.Hide();
                    }
                    else
                    {
                        MessageBox.Show("Usuario no posee permisos para este módulo", "DBMetal", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    }
                }
                else
                {
                    MessageBox.Show("Usuario no activo en directorio activo", "DBMetal", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
            }
            else
            {
                MessageBox.Show("Usuario no registrado en DBMetal", "DBMetal", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
Пример #2
0
 public Frm_Periodo(string User)
 {
     InitializeComponent();
     this.Usuario = User.Trim();
     loadPeriodo(0);
     dataHistoryPeriodo.Columns.Cast <DataGridViewColumn>().ToList().ForEach(f => f.SortMode = DataGridViewColumnSortMode.NotSortable);
     Common.Common.Permissions = ConsultaEntidades.GetPermisosRoles("SPGet_RolesForUser", User.ToString().Trim(), this.Name);
     this.Permission           = Common.Common.Permissions;
     ValidatePermission(this.Controls);
 }
Пример #3
0
        public Frm_CargaAnalisis(string User)
        {
            InitializeComponent();
            this.Usuario = User.Trim();

            Common.Common.Permissions = ConsultaEntidades.GetPermisosRoles("SPGet_RolesForUser", User.ToString().Trim(), this.Name);

            this.Permission = Common.Common.Permissions;

            ValidatePermission(this.Controls);
        }
Пример #4
0
        public frmReportMananger(string User)
        {
            InitializeComponent();
            this.Usuario = User.Trim();
            this.comboBox1.DropDownStyle = ComboBoxStyle.DropDownList;

            comboBox1.Items.Insert(0, "Detalle Mina Día");
            comboBox1.Items.Insert(1, "Resumen Mina Día");
            comboBox1.Items.Insert(2, "Detalle Muestreo");

            dtpEventInitial.Value = DateTime.Now;

            dtpEventEnd.Value = DateTime.Now;

            DBMETAL_SHARP.Common.Common.Permissions = ConsultaEntidades.GetPermisosRoles("SPGet_RolesForUser", User.ToString().Trim(), this.Name);

            this.Permission = DBMETAL_SHARP.Common.Common.Permissions;

            ValidatePermission(this.Controls);


            var read = ConsultaEntidades.MinasReader("SpConsulta_Tablas", "Minas", "", 0, string.Empty);//.OrderBy(f=>f.Nombre);

            comboMina.DisplayMember = "Nombre";
            comboMina.ValueMember   = "Codigo";
            //CmbTypSub.DataSource = LoadShipmentAll();
            //Implementación David Ciro
            //var query1 = LoadShipmentAllTypSubEntity();

            this.comboMina.DropDownStyle = ComboBoxStyle.DropDownList;

            read = read.OrderBy(f => f.Nombre).ToList();

            Ent_Minas pre = new Ent_Minas();

            pre.Codigo = "-1";
            pre.Nombre = "Seleccione opción..";
            read.Insert(read.ToList().Count, pre);

            comboMina.DataSource    = read.Select(c => c.Nombre).ToList();
            comboMina.SelectedIndex = read.ToList().Count - 1;
        }