示例#1
0
        public ActionResult Detail(Guid?id)
        {
            bn_UserProfile bnUser = new bn_UserProfile();
            pb_UserProfile model  = null;

            if (id.HasValue)
            {
                model = bnUser.GetById(id.Value);
            }
            return(View(model));
        }
示例#2
0
        public ActionResult Edit(Guid?userId)
        {
            if (!userId.HasValue)
            {
                userId = ps_Membership.GetUser().UserId;
            }

            bn_UserProfile bnUserProfile = new bn_UserProfile();
            pb_UserProfile model         = new pb_UserProfile();

            model = bnUserProfile.GetById((Guid)userId);

            return(View(model));
        }
示例#3
0
        public ActionResult Edit(pb_UserProfile model)
        {
            if (ModelState.IsValid)
            {
                bn_UserProfile bnUserProfile = new bn_UserProfile();
                var            re            = bnUserProfile.Update(
                    ps_Membership.GetUser().UserId,
                    model.FirstName,
                    model.LastName,
                    model.DateOfBirth);

                if (re >= 0)
                {
                    return(RedirectToAction("Index", "User"));
                }
                else
                {
                    //can't udpate
                }
            }

            return(View(model));
        }