Exemplo n.º 1
0
        public void Save(T_SJZDLXModels model)
        {
            int result = 0;

            try
            {
                if (model.Tag == "Add")
                {
                    result = T_SJZDLXDomain.GetInstance().AddModel(model.DataModel);
                }
                else if (model.Tag == "Edit")
                {
                    result = T_SJZDLXDomain.GetInstance().UpdateModel(model.DataModel, model.DataModel.LXID);
                }
            }
            catch { }
            Response.ContentType = "text/json";
            if (result > 0)
            {
                Response.Write("{\"statusCode\":\"200\", \"message\":\"操作成功\",\"callbackType\":\"closeCurrentReloadTab\",\"forwardUrl\":\"/T_SJZDLX/Index\"}");
            }
            else
            {
                Response.Write("{\"statusCode\":\"300\", \"message\":\"操作失败\"}");
            }
        }
Exemplo n.º 2
0
        public ActionResult Index(T_SJZDLXModels 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 T_SJZDLX();
            evalModel.DataList    = T_SJZDLXDomain.GetInstance().PageT_SJZDLX(evalModel.DataModel, evalModel.StartTime, evalModel.EndTime, currentPage, pagesize, out pagecount, out resultCount);
            evalModel.resultCount = resultCount;
            return(View("~/Views/T_SJZDLX/Index.cshtml", evalModel));
        }
Exemplo n.º 3
0
        public ActionResult Save(System.Int32 id, string tag)
        {
            T_SJZDLXModels model = new T_SJZDLXModels();

            model.DataModel = new T_SJZDLX();
            if (id != 0)
            {
                model.DataModel = T_SJZDLXDomain.GetInstance().GetModelById(id);
            }
            model.Tag = tag;
            return(View("~/Views/T_SJZDLX/Save.cshtml", model));
        }
Exemplo n.º 4
0
        public void Delete(System.Int32 id)
        {
            int result = T_SJZDLXDomain.GetInstance().DeleteModelById(id);

            Response.ContentType = "text/json";
            if (result > 0)
            {
                Response.Write("{\"statusCode\":\"200\", \"message\":\"操作成功\",\"callbackType\":\"forward\",\"forwardUrl\":\"/T_SJZDLX/Index\"}");
            }
            else
            {
                Response.Write("{\"statusCode\":\"300\", \"message\":\"操作失败\"}");
            }
        }
Exemplo n.º 5
0
        public ActionResult Save(System.Int32 id, string tag)
        {
            T_BJDModels model = new T_BJDModels();

            model.DataModel = new T_BJD();
            if (id != 0)
            {
                model.DataModel = T_BJDDomain.GetInstance().GetModelById(id);
            }
            T_SJZDFL pFl = T_SJZDFLDomain.GetInstance().GetModeByName("1");

            //加载类型
            var list = T_SJZDLXDomain.GetInstance().GetAllT_SJZDLX(new T_SJZDLX());

            ViewData["LX"] = new SelectList(list, "LXID", "LXMC");

            model.Tag = tag;
            return(View("~/Views/T_BJD/Save.cshtml", model));
        }