public ActionResult Bussiness() { var info = BussinessInfo.Find(UserID, Employee.ID); if (Request.IsAjaxRequest()) { return(Json(new { html = RenderPartialViewToString(Views.BussinessPartial, info) }, JsonRequestBehavior.AllowGet)); } return(View(Views.Bussiness, info)); }
public ActionResult BussinessUpate(BussinessInfo info) { var result = info.Save(ModelState, UserID, Employee.ID); if (Request.IsAjaxRequest()) { return(Json(new { result = result, html = RenderPartialViewToString(Views.BussinessPartial, info), }, JsonRequestBehavior.DenyGet)); } else { return(View(Views.Bussiness, info)); } }
public ActionResult Login(Login login) { if (login.IsValid()) { // clear all sessions first Session.Clear(); Session[SessionKey.Account] = login.ID; Session[SessionKey.AccountInfo] = login; Session[SessionKey.Employee] = login.EmployeeInfo; SiteConfiguration.BussinessInfo = BussinessInfo.Find(UserID, Employee.ID); if (RequestRoute != null) { var route = RequestRoute; Session.Remove(SessionKey.Route); return(RedirectToRoute(route)); } return(RedirectToAction("Index")); } else { return(View(login)); } }