private void bbiAccept_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            try
            {
                var oBeV = new BESVMC_USUA();
                var oBrV = new BRSVMC_USUA();

                oBeV.ALF_PASS = BRCryptography.Encrypt(txtALF_PASS_ACTU.Text);
                oBeV.COD_USUA = SESSION_USER;
                oBeV.COD_COMP = SESSION_COMP;
                oBeV.NUM_ACCI = 6;

                var oList = oBrV.Get_SVPR_USUA_LIST(oBeV);

                if (oList.Count == 0)
                    throw new ArgumentException("La contraseña actual ingresada no es correcta");

                if (string.IsNullOrEmpty(txtALF_PASS.Text))
                    throw new ArgumentException("Ingrese correctamente la contraseña");
                if (string.IsNullOrEmpty(txtALF_PASS_REPE.Text))
                    throw new ArgumentException("Ingrese correctamente la contraseña");
                if (!txtALF_PASS.Text.Equals(txtALF_PASS_REPE.Text))
                    throw new ArgumentException("Las contraseñas ingresadas no coinciden");
                if (XtraMessageBox.Show("Esta seguro que desea cambiar la contraseña?", "Sistema", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                {
                    oBe.ALF_PASS = BRCryptography.Encrypt(txtALF_PASS.Text);
                    DialogResult = DialogResult.OK;
                }
            }
            catch(Exception ex)
            {
                XtraMessageBox.Show(ex.Message,"Sistema",MessageBoxButtons.OK,MessageBoxIcon.Error);
            }
        }
Exemple #2
0
 /// <summary>
 /// REALIZAR OPERACIONES DE MANTENIMIENTO
 /// </summary>
 /// <param name="oBe"></param>
 public void Set_SVPR_USUA(BESVMC_USUA oBe)
 {
     try
     {
         oDa.Set_SVPR_USUA(oBe);
         Dispose(false);
     }
     catch (Exception ex)
     {
         throw new ArgumentException(ex.Message);
     }
 }
Exemple #3
0
 /// <summary>
 /// OBTENER EL RESULTADO DE CUALQUIER CONSULTA
 /// </summary>
 /// <param name="oBe"></param>
 /// <returns></returns>
 public List<BESVMC_USUA> Get_SVPR_USUA_LIST(BESVMC_USUA oBe)
 {
     try
     {
         using (IDataReader oDr = oDa.Get_SVPR_USUA_LIST(oBe))
         {
             List<BESVMC_USUA> oList = new List<BESVMC_USUA>();
             IList iList = oList;
             ((IList)iList).LoadFromReader<BESVMC_USUA>(oDr);
             Dispose(false);
             return (oList);
         }
     }
     catch (Exception ex)
     {
         throw new ArgumentException(ex.Message);
     }
 }
        public BESVMC_USUA get_SVPR_USUA(BESVMC_USUA oBe)
        {
            var oBr = new BRSVMC_USUA();
            try
            {
                oBe.COD_COMP = 1;
                oBe.ALF_PASS = BRCryptography.Encrypt(oBe.ALF_PASS);
                oBe.NUM_ACCI = 5;

                var oList = oBr.Get_SVPR_USUA_LIST(oBe);

                if (oList.Count > 0)
                {
                    HttpContext.Current.Session["ALF_NOMB"] = oList[0].ALF_NOMB;
                    HttpContext.Current.Session["COD_PERF"] = oList[0].COD_PERF;
                    HttpContext.Current.Session["ALF_IMPU"] = oList[0].ALF_IMPU;
                    HttpContext.Current.Session["COD_COMP"] = oList[0].COD_COMP;
                    oBe.ALF_NOMB = oList[0].ALF_NOMB;
                    oBe.COD_PERF = oList[0].COD_PERF;
                    oBe.ALF_IMPU = oList[0].ALF_IMPU;
                    oBe.IND_ACTI = true;
                }
                else
                {
                    oBe.IND_ACTI = false;
                }
                oBe.IND_ERRO = false;
            }
            catch (Exception ex)
            {
                oBe.IND_ERRO = true;
                oBe.ALF_ERRO = ex.Message;
            }
            oBe.ALF_PASS = null;
            return oBe;
        }
Exemple #5
0
 public void Set_SVPR_USUA(BESVMC_USUA oBe)
 {
     if (ocn.State == ConnectionState.Closed) ocn.Open();
     using (var obts = ocn.BeginTransaction())
     {
         try
         {
             using (var ocmd = odb.GetStoredProcCommand("SVPR_USUA", oBe.COD_USUA,
                                                                     oBe.COD_SOCI_NEGO,
                                                                     oBe.COD_PERF,
                                                                     oBe.ALF_PASS,
                                                                     oBe.IND_ACTI,
                                                                     oBe.COD_COMP,
                                                                     oBe.COD_USUA_CREA,
                                                                     oBe.COD_USUA_MODI,
                                                                     oBe.NUM_ACCI))
             {
                 ocmd.CommandTimeout = 2000;
                 odb.ExecuteNonQuery(ocmd, obts);
                 obts.Commit();
             }
         }
         catch (Exception ex)
         {
             obts.Rollback();
             throw new ArgumentException(ex.Message);
         }
         finally
         {
             ocn.Close();
         }
     }
 }
Exemple #6
0
 public IDataReader Get_SVPR_USUA_LIST(BESVMC_USUA oBe)
 {
     try
     {
         if (ocn.State == ConnectionState.Closed) ocn.Open();
         var ocmd = odb.GetStoredProcCommand("SVPR_USUA_LIST",
                                             oBe.COD_USUA,
                                             oBe.COD_SOCI_NEGO,
                                             oBe.COD_PERF,
                                             oBe.ALF_PASS,
                                             oBe.IND_ACTI,
                                             oBe.COD_COMP,
                                             oBe.COD_USUA_CREA,
                                             oBe.COD_USUA_MODI,
                                             oBe.NUM_ACCI
                                         );
         ocmd.CommandTimeout = 2000;
         var odr = odb.ExecuteReader(ocmd);
         Dispose(false);
         return (odr);
     }
     finally
     {
         ocn.Close();
     }
 }
 public xfPasswordChange()
 {
     InitializeComponent();
     oBe = new BESVMC_USUA();
 }
Exemple #8
0
 public xfLogin()
 {
     oBe = new BESVMC_USUA();
     InitializeComponent();
 }
Exemple #9
0
        private void bbiSecurityPasswordChange_ItemClick(object sender, ItemClickEventArgs e)
        {
            try
            {
                using (var oForm = new xfPasswordChange())
                {
                    oForm.SESSION_COMP = SESSION_COMP;
                    oForm.SESSION_USER = SESSION_USER;
                    if (oForm.ShowDialog() == DialogResult.OK)
                    {
                        var oBer = new BESVMC_USUA();
                        var oBr = new BRSVMC_USUA();

                        oBer.NUM_ACCI = 5;
                        oBer.COD_USUA = SESSION_USER;
                        oBer.COD_USUA_CREA = SESSION_USER;
                        oBer.COD_USUA_MODI = SESSION_USER;
                        oBer.ALF_PASS = oForm.oBe.ALF_PASS;
                        oBr.Set_SVPR_USUA(oBer);
                        XtraMessageBox.Show("Operación realizada con exito!!!!","Sistema",MessageBoxButtons.OK,MessageBoxIcon.Information);
                    }
                }
            }
            catch (Exception ex)
            {
                XtraMessageBox.Show(ex.Message,"Sistema",MessageBoxButtons.OK,MessageBoxIcon.Error);
            }
        }
Exemple #10
0
        public void Save()
        {
            try
            {
                if (string.IsNullOrEmpty(txtCOD_SOCI_NEGO.Text))
                    throw new ArgumentException("Seleccione un empleado para asignarle el usuario");
                if (string.IsNullOrEmpty(txtALF_PASS.Text))
                    throw new ArgumentException("Escriba la contraseña");
                if (string.IsNullOrEmpty(txtALF_PASS_REPE.Text))
                    throw new ArgumentException("Escriba nuevamente la contraseña");
                if (lueCOD_PERF.EditValue == null)
                    throw new ArgumentException("Seleccione el perfil");
                if (!txtALF_PASS.Text.Equals(txtALF_PASS_REPE.Text))
                    throw new ArgumentException("Las contraseñas no coinciden ");

                var oBe = new BESVMC_USUA();
                var oBr = new BRSVMC_USUA();

                if (txtCOD_USUA.Properties.ReadOnly)
                {
                    oBe.NUM_ACCI = 2;
                }
                else
                {
                    oBe.NUM_ACCI = 1;
                }

                oBe.COD_SOCI_NEGO=Convert.ToInt32(txtCOD_SOCI_NEGO.Text);
                oBe.COD_USUA = txtCOD_USUA.Text;
                oBe.ALF_PASS = BRCryptography.Encrypt(txtALF_PASS.Text);
                oBe.COD_PERF = Convert.ToInt32(lueCOD_PERF.EditValue);
                oBe.COD_COMP = SESSION_COMP;
                oBe.COD_USUA_CREA = SESSION_USER;
                oBe.COD_USUA_MODI = SESSION_USER;

                oBr.Set_SVPR_USUA(oBe);

                var oBeU = new BESVMC_USUA();
                var oBrU = new BRSVMC_USUA();

                oBeU.COD_COMP = SESSION_COMP;
                oBeU.NUM_ACCI = 4;

                var oListUser = oBrU.Get_SVPR_USUA_LIST(oBeU);

                gdcUsuarios.DataSource = oListUser;

                StateControl(true);

                XtraMessageBox.Show("Operacion realizada con exito!!!!","Sistema",MessageBoxButtons.OK,MessageBoxIcon.Information);
            }
            catch (Exception ex)
            {
                XtraMessageBox.Show(ex.Message,"Sistema",MessageBoxButtons.OK,MessageBoxIcon.Error);
            }
        }
Exemple #11
0
        private void xfUsuario_Load(object sender, EventArgs e)
        {
            SESSION_USER = ((xfMain)MdiParent).SESSION_USER;
            SESSION_PERF = ((xfMain)MdiParent).SESSION_PERF;
            SESSION_COMP = ((xfMain)MdiParent).SESSION_COMP;

            var oBe = new BESVMC_PERF();
            var oBr = new BRSVMC_PERF();

            oBe.NUM_ACCI = 4;
            oBe.COD_COMP = SESSION_COMP;
            var oList = oBr.Get_SVPR_PERF_LIST(oBe);

            lueCOD_PERF.Properties.DataSource = oList;
            lueCOD_PERF.Properties.Columns.Clear();
            lueCOD_PERF.Properties.Columns.Add(new LookUpColumnInfo("ALF_PERF", 100, "Perfiles"));
            lueCOD_PERF.Properties.DisplayMember = "ALF_PERF";
            lueCOD_PERF.Properties.ValueMember = "COD_PERF";

            var oBeU = new BESVMC_USUA();
            var oBrU = new BRSVMC_USUA();

            oBeU.COD_COMP = SESSION_COMP;
            oBeU.NUM_ACCI = 4;

            var oListUser = oBrU.Get_SVPR_USUA_LIST(oBeU);

            gdcUsuarios.DataSource = oListUser;

            StateControl(true);
        }