コード例 #1
0
        public void Save(T_XSHTModels model)
        {
            int result = 0;

            try
            {
                if (model.Tag == "Add")
                {
                    model.DataModel.SHJG = 0;
                    result = T_XSHTDomain.GetInstance().AddModel(model.DataModel);
                }
                else if (model.Tag == "Edit")
                {
                    result = T_XSHTDomain.GetInstance().UpdateModel(model.DataModel, model.DataModel.HTID);
                }
            }
            catch { }
            Response.ContentType = "text/json";
            if (result > 0)
            {
                Response.Write("{\"statusCode\":\"200\", \"message\":\"操作成功\",\"callbackType\":\"closeCurrentReloadTab\",\"forwardUrl\":\"/T_XSHT/Index\"}");
            }
            else
            {
                Response.Write("{\"statusCode\":\"300\", \"message\":\"操作失败\"}");
            }
        }
コード例 #2
0
        public void through(T_XSHTModels model, string id)
        {
            int result = 0;

            try
            {
                Int32  xsid = model.DataModel.HTID;
                T_XSHT temp = T_XSHTDomain.GetInstance().GetModelById(xsid);
                model.DataModel.HTQDDWID = temp.HTQDDWID;
                if (id == "1")
                {
                    model.DataModel.SHJG = 1;
                }
                else
                {
                    model.DataModel.SHJG = 2;
                }
                result = T_XSHTDomain.GetInstance().UpdateModel(model.DataModel, model.DataModel.HTID);
            }
            catch { }
            Response.ContentType = "text/json";
            if (result > 0)
            {
                Response.Write("{\"statusCode\":\"200\", \"message\":\"操作成功\",\"callbackType\":\"closeCurrentReloadTab\",\"forwardUrl\":\"/T_XSHT/Index\"}");
            }
            else
            {
                Response.Write("{\"statusCode\":\"300\", \"message\":\"操作失败\"}");
            }
        }
コード例 #3
0
        public ActionResult XSHTSPIndex(System.Int32 id, string tag)
        {
            //加载购买商商企业列表
            T_CusQYModels cusQymode = new T_CusQYModels();

            cusQymode.DataModel = cusQymode.DataModel ?? new T_CusQY();

            cusQymode.DataList = T_CusQYDomain.GetInstance().GetAllT_CusQY(cusQymode.DataModel).Where(p => p.CusStatus == Convert.ToInt32("1")).ToList();

            ViewData["CusQY"] = new SelectList(cusQymode.DataList, "CusID", "CusMC");

            T_XSHTModels model = new T_XSHTModels();

            model.DataModel = new T_XSHT();
            if (id != 0)
            {
                model.DataModel = T_XSHTDomain.GetInstance().GetModelById(id);

                if (model.DataModel.HTFJ != "" && model.DataModel.ZLXY != "")
                {
                    ViewData["HTFJ"] = model.DataModel.HTFJ;
                    ViewData["ZLXY"] = model.DataModel.ZLXY;
                }
            }
            model.Tag = tag;
            return(View("~/Views/T_XSHT/XSHTSPIndex.cshtml", model));
        }
コード例 #4
0
        public void Delete(System.Int32 id)
        {
            int result = T_XSHTDomain.GetInstance().DeleteModelById(id);

            Response.ContentType = "text/json";
            if (result > 0)
            {
                Response.Write("{\"statusCode\":\"200\", \"message\":\"操作成功\",\"callbackType\":\"forward\",\"forwardUrl\":\"/T_XSHT/Index\"}");
            }
            else
            {
                Response.Write("{\"statusCode\":\"300\", \"message\":\"操作失败\"}");
            }
        }
コード例 #5
0
        public ActionResult Index(T_XSHTModels evalModel)
        {
            try
            {
                SysUser UserModel = Session["UserModel"] as SysUser;
                ViewData["shUserId"]  = UserModel.UserId;
                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_XSHT();

            if (Request["strHTCode"] != null)
            {
                string str = Request["strHTCode"].ToString();
                if (!String.IsNullOrEmpty(str))
                {
                    evalModel.DataModel.HTBH = str.Trim();
                }
            }

            if (Request["strHTMC"] != null)
            {
                string str = Request["strHTMC"].ToString();
                if (!String.IsNullOrEmpty(str))
                {
                    evalModel.DataModel.HTMC = str.Trim();
                }
            }

            evalModel.DataList    = T_XSHTDomain.GetInstance().PageT_XSHT(evalModel.DataModel, evalModel.StartTime, evalModel.EndTime, currentPage, pagesize, out pagecount, out resultCount);
            evalModel.resultCount = resultCount;
            return(View("~/Views/T_XSHT/Index.cshtml", evalModel));
        }