public ActionResult Create(User user) { if (ModelState.IsValid) { _db.Users.AddObject(user); _db.SaveChanges(); return RedirectToAction("Index"); } ViewBag.BusinessRoleId = new SelectList(_db.BusinessRoles, "Id", "Name", user.BusinessRoleId); ViewBag.SystemRoleId = new SelectList(_db.SystemRoles, "Id", "Name", user.SystemRoleId); return View(user); }
public COATMemebershipUser(User user) : base("COATMembershipProvider", user.Name, null, user.Email, null, null, user.IsDelete == null || (bool) user.IsDelete, false, DateTime.Now, DateTime.Now, DateTime.Now, DateTime.Now, DateTime.Now) { Id = user.Id; COATUser = user; }
/// <summary> /// Deprecated Method for adding a new object to the Users EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddToUsers(User user) { base.AddObject("Users", user); }
/// <summary> /// Create a new User object. /// </summary> /// <param name="id">Initial value of the Id property.</param> /// <param name="name">Initial value of the Name property.</param> /// <param name="email">Initial value of the Email property.</param> /// <param name="password">Initial value of the Password property.</param> /// <param name="businessRoleId">Initial value of the BusinessRoleId property.</param> /// <param name="systemRoleId">Initial value of the SystemRoleId property.</param> public static User CreateUser(global::System.Int32 id, global::System.String name, global::System.String email, global::System.String password, global::System.Int32 businessRoleId, global::System.Int32 systemRoleId) { User user = new User(); user.Id = id; user.Name = name; user.Email = email; user.Password = password; user.BusinessRoleId = businessRoleId; user.SystemRoleId = systemRoleId; return user; }
public ApproverDealHelper(User user) { _actionName = user.SystemRoleId == SystemRoleIds.ChannelApprover ? "PCA" : "PSA"; _user = user; }
public ActionResult Edit(User user) { if (ModelState.IsValid) { _db.Users.Attach(user); _db.ObjectStateManager.ChangeObjectState(user, EntityState.Modified); _db.SaveChanges(); return RedirectToAction("Index"); } ViewBag.BusinessRoleId = new SelectList(_db.BusinessRoles, "Id", "Name", user.BusinessRoleId); ViewBag.SystemRoleId = new SelectList(_db.SystemRoles, "Id", "Name", user.SystemRoleId); return View(user); }