public ActionResult DeleteRecord(int? page, string selectedUsers, string diselectedUsers) { UnitOfWork uof = new UnitOfWork(provider); int[] selected = null; int[] diselected; if (!String.IsNullOrEmpty(selectedUsers) || !String.IsNullOrEmpty(diselectedUsers)) { selected = selectedUsers.Split(new char[] { ';' }, StringSplitOptions.RemoveEmptyEntries).Select(item => Int32.Parse(item)).ToArray(); diselected = diselectedUsers.Split(new char[] { ';' }, StringSplitOptions.RemoveEmptyEntries).Select(item => Int32.Parse(item)).ToArray(); if (Session["selectedUsers"] != null) { int[] saved = (int[])Session["selectedUsers"]; selected = saved.Union(selected).Except(diselected).ToArray(); } foreach (var id in selected) { uof.RegisterDeleted(id); } } uof.Commit(); return RedirectToAction("Index"); }
public void UpdateRecord(User user) { UnitOfWork uof = new UnitOfWork(provider); uof.RegisterDirty(user); uof.Commit(); }
public ActionResult PostStep2(string phone, string address) { UnitOfWork uof = new UnitOfWork(provider); DomainModel.Models.User user = TempData["Model"] as User; user.Phone = phone; user.Address = address; uof.RegisterNew(user); uof.Commit(); return RedirectToAction("Index"); }