// // GET: /Gang/ public ActionResult Index() { var identity = HardIdentify(); if (identity != null) { var model = new GangModel { Id = identity.Id, Identified = true, Gang = identity.Gang }; return View("Index", model); } return ErrorView("this page is only available if you are logged in."); }
private ActionResult StandardGangPage(string viewName) { var identity = HardIdentify(); if (identity != null) { var model = new GangModel { Id = identity.Id, Identified = true, Gang = identity.Gang }; return View(viewName, model); } return ErrorView("this page is only available if you are logged in."); }
// // GET: /Mail/ public ActionResult Index() { var identity = GetIdentity(); if (identity != null && identity.Registered) { var model = new GangModel(identity); return View("MailIndex", model); } return RedirectToAction("Index", "Home"); }
public ActionResult CreateGangPost(GangModel model) { model.Valid = ModelState.IsValid; if (model.Valid) { using (var transaction = NhSession.BeginTransaction()) { var identity = NhSession.Get<Identity>(model.Id); var gang = model.Gang; gang.Funds = 1000; identity.Gang = gang; NhSession.Save(identity); transaction.Commit(); } } return PartialView("GangPartial", model); }
public ActionResult CreateGangPost(GangModel model) { model.Valid = ModelState.IsValid; if (model.Valid) { var hideout = CreateHideout(); var factory = MvcApplication.SessionFactory; NhSession = factory.OpenSession(); using (var transaction = NhSession.BeginTransaction()) { var identity = NhSession.Get<Identity>(model.Id); var gang = model.Gang; identity.Gang = gang; identity.Gang.Funds = 1000; identity.Gang.Hideout = hideout; NhSession.Save(identity); transaction.Commit(); } } return PartialView("GangPartial", model); }