示例#1
0
 public ActionResult EditUser(int id)
 {
     UserDAL.user dal = repo.View(id);
     Models.user  mvc = new Models.user();
     mvc.userId   = dal.userId;
     mvc.userName = dal.userName;
     mvc.Phone    = dal.Phone;
     mvc.Email    = dal.Email;
     mvc.Password = dal.Password;
     return(View(mvc));
 }
示例#2
0
        public ActionResult EditConfirm(Models.user mvc)
        {
            UserDAL.user dal = repo.View(mvc.userId);
            dal.userId   = mvc.userId;
            dal.userName = mvc.userName;
            dal.Phone    = mvc.Phone;
            dal.Email    = mvc.Email;
            dal.Password = mvc.Password;
            bool result = repo.Update(dal);

            if (result)
            {
                ViewBag.Msg = "Updated Successfully!";
            }
            else
            {
                ViewBag.ErrorMsg = "Update Failed";
            }
            return(View("EditUser"));
        }