Ejemplo n.º 1
0
        public bool UpdateUser(SysUserProfileModels user)
        {
            Dictionary<string, object> param = new Dictionary<string, object>();
            param.Add("emailAddress", user.emailAddress);

            user.birthday = DateTime.ParseExact(user.birthDate + "/" + user.birthMonth + "/" + user.birthYear, Constants.DateTimeFormat, System.Globalization.CultureInfo.InvariantCulture);

            param.Add("userCode", user.userCode);
            param.Add("fullName", user.fullName);
            param.Add("updatedBy", user.userCode);
            param.Add("updatedDate", DateTime.Now);
            param.Add("sex", user.sex);
            param.Add("birthday", user.birthday);
            param.Add("phoneNo", user.phoneNo);

            mapper.Update("Sys.updateUser", param);
            user.infoMessage = PsMModel.Resource.MsgSuccess;
            return true;
        }
Ejemplo n.º 2
0
        public SysUserProfileModels GetUserProfile(SysUserModels user)
        {
            SysUserProfileModels result = new SysUserProfileModels();
            result.birthDateList = DateUtils.genDateList();
            result.birthMonthList = DateUtils.genMonthList();
            result.birthYearList = DateUtils.genYearList();

            if (user.birthday.Day < 10)
            {
                result.birthDate = "0" + user.birthday.Date.Day.ToString();
            }
            else
            {
                result.birthDate = user.birthday.Date.Day.ToString();
            }

            if (user.birthday.Month < 10)
            {
                result.birthMonth = "0" + user.birthday.Date.Month.ToString();
            }
            else
            {
                result.birthMonth = user.birthday.Date.Month.ToString();
            }

            result.birthYear = user.birthday.Year.ToString();

            result.emailAddress = user.emailAddress;
            result.fullName = user.fullName;
            result.phoneNo = user.phoneNo;
            result.sex = user.sex;
            result.userCode = user.userCode;

            return result;
        }
Ejemplo n.º 3
0
 public ActionResult Profile(SysUserProfileModels model)
 {
     SysUserDAO userDAO = new SysUserDAO(this.mapper);
     userDAO.UpdateUser(model);
     model.birthDateList = DateUtils.genDateList();
     model.birthMonthList = DateUtils.genMonthList();
     model.birthYearList = DateUtils.genYearList();
     return View(model);
 }