コード例 #1
0
        public HttpResponseMessage ChangePassword(CmnUserAuthentication model)
        {
            int result = 0;

            try
            {
                result = objUserService.ChangePassword(model);
            }
            catch
            {
            }

            return(Request.CreateResponse(HttpStatusCode.OK, result));
        }
コード例 #2
0
        public int ChangePassword(Models.CmnUserAuthentication model)
        {
            int result = 0;

            GenericFactory_EF_AuthenticatedUser = new CmnUserUserAuthentication_EF();
            try
            {
                CmnUserAuthentication _objUserAuthentication = GenericFactory_EF_AuthenticatedUser.FindBy(x => x.UserID == model.UserID).FirstOrDefault();


                _objUserAuthentication.Password        = model.Password;
                _objUserAuthentication.ConfirmPassword = model.Password;
                _objUserAuthentication.UpdateBy        = model.UpdateBy;
                _objUserAuthentication.UpdatePc        = HostService.GetIP();
                _objUserAuthentication.UpdateOn        = DateTime.Now;
                GenericFactory_EF_AuthenticatedUser.Update(_objUserAuthentication);
                GenericFactory_EF_AuthenticatedUser.Save();
                result = 1;
            }
            catch (Exception)
            {
            }
            return(result);
        }