Beispiel #1
0
        protected override bool Grabar_Registro()
        {
            CUser_systemFactory faUser_name = new CUser_systemFactory();

            if (tbPwd.Text.Trim().Length > 0 && tbRepPwd.Text.Trim().Length > 0)
            {
                oUser_system.Pwd = Comun.EncriptarMD5(tbPwd.Text);
            }

            oUser_system.Cod_user = tbUserName.Text;
            oUser_system.Idperson = Convert.ToInt16(cbPerson.EditValue);

            bool result = false;

            if (!(result = faUser_name.Update(oUser_system)))
            {
                result = faUser_name.Insert(oUser_system);
            }

            if (result)
            {
                InitCombos();
            }

            return(result);
        }
Beispiel #2
0
 bool AreUserAndPwdRight()
 {
     foreach (CUser_system oUsuario in LstUser)
     {
         if (tbUser.Text.Trim().ToUpper() == oUsuario.Cod_user.Trim().ToUpper())
         {
             if (oUsuario.Pwd == Comun.EncriptarMD5(tbPwd.Text))
             {
                 Comun.User_system = oUsuario;
                 return(true);
             }
         }
     }
     return(false);
 }
Beispiel #3
0
        public static bool AreUserAndPwdRight(string user, string pwd)
        {
            List <CUser_system> lstUser = new CUser_systemFactory().GetAll();

            foreach (CUser_system oUsuario in lstUser)
            {
                if (user.Trim().ToUpper() == oUsuario.Cod_user.Trim().ToUpper())
                {
                    if (oUsuario.Pwd == Comun.EncriptarMD5(pwd))
                    {
                        Comun.User_system = oUsuario;
                        return(true);
                    }
                }
            }
            return(false);
        }