Пример #1
0
 public ActionResult Edit(int id)
 {
     my_aspnet_membership membership = db.my_aspnet_membership.FirstOrDefault();
     foreach (my_aspnet_membership item in db.my_aspnet_membership)
     {
         if (item.userId == id)
         {
             membership = item;
         }
     }
     string userName = Membership.GetUserNameByEmail(membership.Email);
     UserModel model = new UserModel();
     model.UserName = userName;
     model.membership = membership;
     return View(model);
 }
Пример #2
0
        public ActionResult Edit(UserModel model)
        {
            if (MembershipService.EditUser(model.membership))
            {
                return RedirectToAction("Index");
            }

            //Cas raté, on réaffiche le formulaire

            return View(model);
        }
Пример #3
0
        public ActionResult Details(int id)
        {
            var temp = from m in db.my_aspnet_membership
                        join u in db.my_aspnet_users on m.userId equals u.id
                        where (u.id == id)
                        select new UserModel { UserName = u.name, membership = m };

            UserModel model = new UserModel();
            model = temp.FirstOrDefault();
            return View(model);
        }