public JsonResult Save(UserSetofBookModel model) { UserSetofBookModel defaultSOB = UserSetofBookHelper.GetDefaultSOB(); if (defaultSOB != null) { model.Id = defaultSOB.Id; } //Remove all transaction's session that depends on SOB.. SessionHelper.JV = null; SessionHelper.Invoice = null; SessionHelper.PayableInvoice = null; SessionHelper.Payment = null; SessionHelper.Order = null; SessionHelper.MiscellaneousTransaction = null; SessionHelper.Locator = null; SessionHelper.Receipts = null; SessionHelper.Bank = null; SessionHelper.BankAccount = null; SessionHelper.Calendar = null; SessionHelper.Item = null; SessionHelper.Remittance = null; SessionHelper.Tax = null; SessionHelper.Shipment = null; model.UserId = AuthenticationHelper.UserId; model.CompanyId = AuthenticationHelper.CompanyId.Value; SessionHelper.SOBId = model.SOBId; SessionHelper.SOBName = SetOfBookHelper.GetSetOfBook(SessionHelper.SOBId.ToString()).Name; return(Json(UserSetofBookHelper.Save(model))); }
public ActionResult Index() { if (TempData["LastURL"] == null) { TempData["LastURL"] = Request.UrlReferrer.AbsolutePath; } UserSetofBookModel model = new UserSetofBookModel(); //if(SessionHelper.SOBId != null && SessionHelper.SOBId != 0) if (SessionHelper.SOBId != 0) { model = UserSetofBookHelper.GetDefaultSOB(); if (model != null) { model.SetofBooks = SetOfBookHelper.GetSetOfBookList(); return(PartialView("_Create", model)); } } model = new UserSetofBookModel { SetofBooks = SetOfBookHelper.GetSetOfBookList(), CompanyId = AuthenticationHelper.CompanyId.Value, SOBId = SessionHelper.SOBId, UserId = AuthenticationHelper.UserId }; return(PartialView("_Create", model)); }
public ActionResult Index() { if (AuthenticationHelper.UserRole == UserRoles.SuperAdmin.ToString()) { return(RedirectToAction("Index", "Company")); } SessionHelper.SOBId = UserSetofBookHelper.GetDefaultSOB() == null ? 0 : UserSetofBookHelper.GetDefaultSOB().SOBId; SessionHelper.SOBName = SessionHelper.SOBId == 0? "Click here to select Set of Book": SetOfBookHelper.GetSetOfBook(SessionHelper.SOBId.ToString()).Name; return(View()); }