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

            try
            {
                if (model.Tag == "Add")
                {
                    result = T_WhsQYDomain.GetInstance().AddModel(model.DataModel);
                }
                else if (model.Tag == "Edit")
                {
                    result = T_WhsQYDomain.GetInstance().UpdateModel(model.DataModel, model.DataModel.WhsID);
                }
                //企业资质操作
                T_WhsQYDomain.GetInstance().OperQyzz(model.DataModel.WhsID, model.QYZZFiles);
            }
            catch { }
            Response.ContentType = "text/json";
            if (result > 0)
            {
                Response.Write("{\"statusCode\":\"200\", \"message\":\"操作成功\",\"callbackType\":\"closeCurrentReloadTab\",\"forwardUrl\":\"/T_WhsQY/Index\"}");
            }
            else
            {
                Response.Write("{\"statusCode\":\"300\", \"message\":\"操作失败\"}");
            }
        }
Beispiel #2
0
        public ActionResult Save(System.Int32 id, string tag)
        {
            T_PersonModels model = new T_PersonModels();

            //加载批发商企业列表
            T_WhsQYModels whsQymode = new T_WhsQYModels();

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

            whsQymode.DataList = T_WhsQYDomain.GetInstance().GetAllT_WhsQY(whsQymode.DataModel);

            ViewData["WHSQY"] = new SelectList(whsQymode.DataList, "WhsID", "WhsMC", "请选择");

            model.DataModel = new T_Person();
            if (id != 0)
            {
                model.DataModel = T_PersonDomain.GetInstance().GetModelById(id);
            }
            model.Tag = tag;

            //加载性别类型
            List <SelectListItem> list = new List <SelectListItem>();

            list.Add(new SelectListItem {
                Text = "男", Value = "男"
            });
            list.Add(new SelectListItem {
                Text = "女", Value = "女"
            });

            ViewData["XB"] = new SelectList(list, "Value", "Text", "请选择");

            //加载学历类型
            List <SelectListItem> xlList = new List <SelectListItem>();

            xlList.Add(new SelectListItem {
                Text = "大专", Value = "大专"
            });
            xlList.Add(new SelectListItem {
                Text = "本科", Value = "本科"
            });
            xlList.Add(new SelectListItem {
                Text = "硕士", Value = "硕士"
            });
            xlList.Add(new SelectListItem {
                Text = "博士", Value = "博士"
            });

            ViewData["XL"] = new SelectList(xlList, "Value", "Text", "请选择");

            return(View("~/Views/T_Person/Save.cshtml", model));
        }
Beispiel #3
0
        public ActionResult Save(System.Int32 id, string tag)
        {
            T_WhsQYModels model = new T_WhsQYModels();

            model.DataModel = new T_WhsQY();
            if (id != 0)
            {
                model.DataModel   = T_WhsQYDomain.GetInstance().GetModelById(id);
                model.WhsQYZZList = T_WhsQYZZDomain.GetInstance().GetQYZZByQyid(id);
            }
            //经营范围(下)
            T_JYFWModels jyfwmodels = new T_JYFWModels();

            jyfwmodels.DataModel = jyfwmodels.DataModel ?? new T_JYFW();
            model.JYFWList       = T_JYFWDomain.GetInstance().GetAllT_JYFW(jyfwmodels.DataModel).ToList();
            model.Tag            = tag;
            GetRoleCode(model);
            return(View("~/Views/T_WhsQY/Save.cshtml", model));
        }
Beispiel #4
0
        public ActionResult Index(T_WhsQYModels 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_WhsQY();

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

            evalModel.DataList    = T_WhsQYDomain.GetInstance().PageT_WhsQY(evalModel.DataModel, evalModel.StartTime, evalModel.EndTime, currentPage, pagesize, out pagecount, out resultCount);
            evalModel.resultCount = resultCount;
            //GetRoleCode(evalModel);
            return(View("~/Views/T_WhsQY/Index.cshtml", evalModel));
        }
Beispiel #5
0
 private void GetRoleCode(T_WhsQYModels evalModel)
 {
     evalModel.RoleCode = Session["RoleCode"] == null ? "" : Session["RoleCode"].ToString();
 }