Beispiel #1
0
        public void Save(SysFavoriteModels model)
        {
            int result = 0;

            try
            {
                if (model.Tag == "Add")
                {
                    result = SysFavoriteDomain.GetInstance().AddModel(model.DataModel);
                }
                else if (model.Tag == "Edit")
                {
                    result = SysFavoriteDomain.GetInstance().UpdateModel(model.DataModel, model.DataModel.FavoriteID);
                }
            }
            catch { }
            Response.ContentType = "text/json";
            if (result > 0)
            {
                Response.Write("{\"statusCode\":\"200\", \"message\":\"操作成功\",\"callbackType\":\"closeCurrentReloadTab\",\"forwardUrl\":\"/WebMain/Main\"}");
            }
            else
            {
                Response.Write("{\"statusCode\":\"300\", \"message\":\"操作失败\"}");
            }
        }
Beispiel #2
0
        public ActionResult Index(SysFavoriteModels evalModel)
        {
            try
            {
                evalModel.currentPage = int.Parse(Request["pageNum"].ToString());
            }
            catch { }
            string order = "";

            try
            {
                order = Request["orderField"].ToString();
            }
            catch { }

            if (order.Trim() == "${param.orderField}")
            {
                order = "";
            }
            int pagesize    = Convert.ToInt32(evalModel.pageSize);
            int pagecount   = Convert.ToInt32(evalModel.pagecount);
            int currentPage = Convert.ToInt32(evalModel.currentPage);

            evalModel.DataModel   = evalModel.DataModel ?? new SysFavorite();
            evalModel.DataList    = SysFavoriteDomain.GetInstance().PageSysFavorite(evalModel.DataModel, evalModel.StartTime, evalModel.EndTime, currentPage, pagesize, out pagecount, out resultCount);
            evalModel.resultCount = resultCount;
            return(View("~/Views/SysFavorite/Index.cshtml", evalModel));
        }
Beispiel #3
0
        public ActionResult Save(System.Int32 id, string tag)
        {
            SysFavoriteModels model = new SysFavoriteModels();

            model.DataModel = new SysFavorite();
            //加载用户列表
            SysUserModels whsQymode = new SysUserModels();

            whsQymode.DataModel = whsQymode.DataModel ?? new SysUser();

            whsQymode.DataList = SysUserDomain.GetInstance().GetAllT_SysUser(whsQymode.DataModel);

            ViewData["SysUser"] = new SelectList(whsQymode.DataList, "UserID", "UserName", "请选择");
            if (id != 0)
            {
                model.DataModel = SysFavoriteDomain.GetInstance().GetModelById(id);
            }
            model.Tag = tag;
            return(View("~/Views/SysFavorite/Save.cshtml", model));
        }