Exemplo n.º 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\":\"操作失败\"}");
            }
        }
Exemplo n.º 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));
        }
Exemplo n.º 3
0
        public void Delete(System.Int32 id)
        {
            int result = SysFavoriteDomain.GetInstance().DeleteModelById(id);

            Response.ContentType = "text/json";
            if (result > 0)
            {
                Response.Write("{\"statusCode\":\"200\", \"message\":\"操作成功\",\"callbackType\":\"forward\",\"forwardUrl\":\"/WebMain/Main\"}");
            }
            else
            {
                Response.Write("{\"statusCode\":\"300\", \"message\":\"操作失败\"}");
            }
        }
Exemplo n.º 4
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));
        }
Exemplo n.º 5
0
 public ActionResult Main(WebMainModels model)
 {
     model.ListSysFavorite = SysFavoriteDomain.GetInstance().GetFavoriteList(1);
     return(View(model));
 }