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

            try
            {
                if (model.Tag == "Add")
                {
                    result = T_FKDDomain.GetInstance().AddModel(model.DataModel);
                }
                else if (model.Tag == "Edit")
                {
                    result = T_FKDDomain.GetInstance().UpdateModel(model.DataModel, model.DataModel.FKID);
                }
            }
            catch { }
            Response.ContentType = "text/json";
            if (result > 0)
            {
                Response.Write("{\"statusCode\":\"200\", \"message\":\"操作成功\",\"callbackType\":\"closeCurrentReloadTab\",\"forwardUrl\":\"/T_FKD/Index\"}");
            }
            else
            {
                Response.Write("{\"statusCode\":\"300\", \"message\":\"操作失败\"}");
            }
        }
Ejemplo n.º 2
0
        public ActionResult Index(T_FKDModels 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_FKD();
            evalModel.DataList    = T_FKDDomain.GetInstance().PageT_FKD(evalModel.DataModel, evalModel.StartTime, evalModel.EndTime, currentPage, pagesize, out pagecount, out resultCount);
            evalModel.resultCount = resultCount;
            return(View("~/Views/T_FKD/Index.cshtml", evalModel));
        }
Ejemplo n.º 3
0
        public void Delete(System.Int32 id)
        {
            int result = T_FKDDomain.GetInstance().DeleteModelById(id);

            Response.ContentType = "text/json";
            if (result > 0)
            {
                Response.Write("{\"statusCode\":\"200\", \"message\":\"操作成功\",\"callbackType\":\"forward\",\"forwardUrl\":\"/T_FKD/Index\"}");
            }
            else
            {
                Response.Write("{\"statusCode\":\"300\", \"message\":\"操作失败\"}");
            }
        }
Ejemplo n.º 4
0
        public ActionResult Save(System.Int32 id, string tag)
        {
            //加载服务列表列表
            T_SHFWModels shfwQymode = new T_SHFWModels();

            shfwQymode.DataModel = shfwQymode.DataModel ?? new T_SHFW();

            shfwQymode.DataList = T_SHFWDomain.GetInstance().GetAllT_SHFW(shfwQymode.DataModel);

            ViewData["SHFW"] = new SelectList(shfwQymode.DataList, "SHID", "FWMC");

            T_FKDModels model = new T_FKDModels();

            model.DataModel = new T_FKD();
            if (id != 0)
            {
                model.DataModel = T_FKDDomain.GetInstance().GetModelById(id);
            }
            model.Tag = tag;
            return(View("~/Views/T_FKD/Save.cshtml", model));
        }