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)); }
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)); }
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)); }