コード例 #1
0
        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));
        }
コード例 #2
0
        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));
            }
        }
コード例 #3
0
        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));
            }
        }