예제 #1
0
        public int Save(BO.j03User rec)
        {
            var p = new DL.Params4Dapper();

            p.AddInt("pid", rec.j03ID);
            p.AddInt("j02ID", rec.j02ID, true);
            p.AddInt("j04ID", rec.j04ID, true);
            p.AddBool("j03IsMustChangePassword", rec.j03IsMustChangePassword);
            p.AddString("j03Login", rec.j03Login);
            p.AddInt("j03AccessFailedCount", rec.j03AccessFailedCount);
            p.AddInt("j03ModalDialogFlag", rec.j03ModalDialogFlag);
            p.AddInt("j03FontStyleFlag", rec.j03FontStyleFlag);
            p.AddInt("j03SideBarFlag", rec.j03SideBarFlag);
            p.AddInt("j03EnvironmentFlag", rec.j03EnvironmentFlag);
            p.AddInt("j03GridSelectionModeFlag", rec.j03GridSelectionModeFlag);
            p.AddDateTime("j03LiveChatTimestamp", rec.j03LiveChatTimestamp);
            if (!String.IsNullOrEmpty(rec.j03PasswordHash))
            {
                p.Add("j03PasswordHash", rec.j03PasswordHash);
            }


            return(_db.SaveRecord("j03User", p.getDynamicDapperPars(), rec));
        }
예제 #2
0
        public Result ValidateChangePassword(string strNewPwd, string strCurPwd, string strVerify, j03User cSavedJ03)
        {
            var ret = ValidatePassword(strNewPwd);

            if (ret.Flag == BO.ResultEnum.Failed)
            {
                ret.PreMessage = "Nové heslo"; return(ret);
            }

            ret = ValidatePassword(strCurPwd);
            if (ret.Flag == BO.ResultEnum.Failed)
            {
                ret.PreMessage = "Současné heslo"; return(ret);
            }

            if (strNewPwd != strVerify)
            {
                return(new Result(true, "Nové heslo nesouhlasí s ověřením."));
            }

            ret = VerifyHash(strCurPwd, cSavedJ03.j03Login, cSavedJ03);
            if (ret.Flag == BO.ResultEnum.Failed)
            {
                return(new Result(true, "Stávající heslo se nepodařilo ověřit."));
            }

            if (strNewPwd == strCurPwd)
            {
                return(new Result(true, "Nové heslo se musí lišit od současného!"));
            }

            return(new Result(false));
        }