public ActionResult Update() { string id = Request["id"] ?? ""; string userid = Request["userid"] ?? ""; string conditioninfo = Request["conditioninfo"] ?? ""; string pagebrief = Request["pagebrief"] ?? ""; string modifydate = Request["modifydate"] ?? ""; string conditiontitle = Request["conditiontitle"] ?? ""; int uid = int.Parse(id); try { searchcondition p = ob_searchconditionservice.GetEntityById(searchcondition => searchcondition.ID == uid); p.UserID = userid == "" ? 0 : int.Parse(userid); p.ConditionInfo = conditioninfo.Trim(); p.PageBrief = pagebrief.Trim(); p.ModifyDate = modifydate == "" ? DateTime.Now : DateTime.Parse(modifydate); p.ConditionTitle = conditiontitle.Trim(); ob_searchconditionservice.UpdateEntity(p); ViewBag.saveok = ViewAddTag.ModifyOk; } catch (Exception ex) { Console.WriteLine(ex.Message); ViewBag.saveok = ViewAddTag.ModifyNo; } return(RedirectToAction("Edit", new { id = uid })); }
public ActionResult Save() { string id = Request["id"] ?? ""; string userid = Request["userid"] ?? ""; string conditioninfo = Request["conditioninfo"] ?? ""; string pagebrief = Request["pagebrief"] ?? ""; string modifydate = Request["modifydate"] ?? ""; string conditiontitle = Request["conditiontitle"] ?? ""; try { searchcondition ob_searchcondition = new searchcondition(); ob_searchcondition.UserID = userid == "" ? 0 : int.Parse(userid); ob_searchcondition.ConditionInfo = conditioninfo.Trim(); ob_searchcondition.PageBrief = pagebrief.Trim(); ob_searchcondition.ModifyDate = modifydate == "" ? DateTime.Now : DateTime.Parse(modifydate); ob_searchcondition.ConditionTitle = conditiontitle.Trim(); ob_searchcondition = ob_searchconditionservice.AddEntity(ob_searchcondition); ViewBag.searchcondition = ob_searchcondition; } catch (Exception ex) { Console.WriteLine(ex.Message); } return(RedirectToAction("Index")); }
public ActionResult Index(string page) { if (string.IsNullOrEmpty(page)) page = "1"; int userid = (int)Session["user_id"]; string pagetag = "quan_zhiliangwh_index"; PageMenu.Set("Index", "quan_zhiliangwh", "质量管理"); Expression<Func<quan_zhiliangwh, bool>> where = PredicateExtensionses.True<quan_zhiliangwh>(); searchcondition sc = searchconditionService.GetInstance().GetEntityById(searchcondition => searchcondition.UserID == userid && searchcondition.PageBrief == pagetag); if (sc != null && sc.ConditionInfo != null) { string[] sclist = sc.ConditionInfo.Split(';'); foreach (string scl in sclist) { string[] scld = scl.Split(','); switch (scld[0]) { case "chid": string chid = scld[1]; string chidequal = scld[2]; string chidand = scld[3]; if (!string.IsNullOrEmpty(chid)) { if (chidequal.Equals("=")) { if (chidand.Equals("and")) where = where.And(quan_zhiliangwh => quan_zhiliangwh.CHID == int.Parse(chid)); else where = where.Or(quan_zhiliangwh => quan_zhiliangwh.CHID == int.Parse(chid)); } if (chidequal.Equals(">")) { if (chidand.Equals("and")) where = where.And(quan_zhiliangwh => quan_zhiliangwh.CHID > int.Parse(chid)); else where = where.Or(quan_zhiliangwh => quan_zhiliangwh.CHID > int.Parse(chid)); } if (chidequal.Equals("<")) { if (chidand.Equals("and")) where = where.And(quan_zhiliangwh => quan_zhiliangwh.CHID < int.Parse(chid)); else where = where.Or(quan_zhiliangwh => quan_zhiliangwh.CHID < int.Parse(chid)); } } break; default: break; } } ViewBag.SearchCondition = sc.ConditionInfo; } where = where.And(quan_zhiliangwh => quan_zhiliangwh.IsDelete == false); var tempData = ob_quan_zhiliangwhservice.LoadSortEntities(where.Compile(), false, quan_zhiliangwh => quan_zhiliangwh.ID).ToPagedList<quan_zhiliangwh>(int.Parse(page), int.Parse(System.Web.Configuration.WebConfigurationManager.AppSettings["ShowPerPage"])); ViewBag.quan_zhiliangwh = tempData; return View(tempData); }
public ActionResult Edit(int id) { searchcondition tempData = ob_searchconditionservice.GetEntityById(searchcondition => searchcondition.ID == id && searchcondition.IsDelete == false); ViewBag.searchcondition = tempData; if (tempData == null) { return(View()); } else { searchconditionViewModel searchconditionviewmodel = new searchconditionViewModel(); searchconditionviewmodel.ID = tempData.ID; searchconditionviewmodel.UserID = tempData.UserID; searchconditionviewmodel.ConditionInfo = tempData.ConditionInfo; searchconditionviewmodel.PageBrief = tempData.PageBrief; searchconditionviewmodel.ModifyDate = tempData.ModifyDate; searchconditionviewmodel.ConditionTitle = tempData.ConditionTitle; return(View(searchconditionviewmodel)); } }
public ActionResult Index(string page) { if (string.IsNullOrEmpty(page)) { page = "1"; } int userid = (int)Session["user_id"]; string pagetag = "cfda_inhistory_index"; Expression <Func <cfda_inhistory, bool> > where = PredicateExtensionses.True <cfda_inhistory>(); searchcondition sc = searchconditionService.GetInstance().GetEntityById(searchcondition => searchcondition.UserID == userid && searchcondition.PageBrief == pagetag); if (sc != null && sc.ConditionInfo != null) { string[] sclist = sc.ConditionInfo.Split(';'); foreach (string scl in sclist) { string[] scld = scl.Split(','); switch (scld[0]) { case "CPMC": string CPMC = scld[1]; string CPMCequal = scld[2]; string CPMCand = scld[3]; if (!string.IsNullOrEmpty(CPMC)) { if (CPMCequal.Equals("=")) { if (CPMCand.Equals("and")) { where = where.And(p => p.CPMC == CPMC.Trim()); } else { where = where.Or(p => p.CPMC == CPMC.Trim()); } } if (CPMCequal.Equals("like")) { if (CPMCand.Equals("and")) { where = where.And(p => p.CPMC.Contains(CPMC.Trim())); } else { where = where.Or(p => p.CPMC.Contains(CPMC.Trim())); } } } break; case "GGXH": string GGXH = scld[1]; string GGXHequal = scld[2]; string GGXHand = scld[3]; if (!string.IsNullOrEmpty(GGXH)) { if (GGXHequal.Equals("=")) { if (GGXHand.Equals("and")) { where = where.And(p => p.GGXH == GGXH.Trim()); } else { where = where.Or(p => p.GGXH == GGXH.Trim()); } } if (GGXHequal.Equals("like")) { if (GGXHand.Equals("and")) { where = where.And(p => p.GGXH.Contains(GGXH.Trim())); } else { where = where.Or(p => p.GGXH.Contains(GGXH.Trim())); } } } break; case "SCPH": string SCPH = scld[1]; string SCPHequal = scld[2]; string SCPHand = scld[3]; if (!string.IsNullOrEmpty(SCPH)) { if (SCPHequal.Equals("=")) { if (SCPHand.Equals("and")) { where = where.And(p => p.SCPH == SCPH.Trim()); } else { where = where.Or(p => p.SCPH == SCPH.Trim()); } } if (SCPHequal.Equals("like")) { if (SCPHand.Equals("and")) { where = where.And(p => p.SCPH.Contains(SCPH.Trim())); } else { where = where.Or(p => p.SCPH.Contains(SCPH.Trim())); } } } break; default: break; } } ViewBag.SearchCondition = sc.ConditionInfo; } where = where.And(cfda_inhistory => cfda_inhistory.IsDelete == false); var tempData = ob_cfda_inhistoryservice.LoadSortEntities(where.Compile(), false, cfda_inhistory => cfda_inhistory.ID).ToPagedList <cfda_inhistory>(int.Parse(page), int.Parse(System.Web.Configuration.WebConfigurationManager.AppSettings["ShowPerPage"])); ViewBag.cfda_inhistory = tempData; return(View(tempData)); }
public ActionResult Index() { int userid = (int)Session["user_id"]; string pagetag = "rmd_myreminder_index"; string page = "1"; string yonghuid = Request["yonghuid"] ?? ""; string yonghuidequal = Request["yonghuidequal"] ?? ""; string yonghuidand = Request["yonghuidand"] ?? ""; PageMenu.Set("Index", "rmd_myreminder", "信息提醒"); Expression <Func <rmd_myreminder, bool> > where = PredicateExtensionses.True <rmd_myreminder>(); searchcondition sc = searchconditionService.GetInstance().GetEntityById(searchcondition => searchcondition.UserID == userid && searchcondition.PageBrief == pagetag); if (sc == null) { sc = new searchcondition(); sc.UserID = userid; sc.PageBrief = pagetag; if (!string.IsNullOrEmpty(yonghuid)) { if (yonghuidequal.Equals("=")) { if (yonghuidand.Equals("and")) { where = where.And(rmd_myreminder => rmd_myreminder.YonghuID == int.Parse(yonghuid)); } else { where = where.Or(rmd_myreminder => rmd_myreminder.YonghuID == int.Parse(yonghuid)); } } if (yonghuidequal.Equals(">")) { if (yonghuidand.Equals("and")) { where = where.And(rmd_myreminder => rmd_myreminder.YonghuID > int.Parse(yonghuid)); } else { where = where.Or(rmd_myreminder => rmd_myreminder.YonghuID > int.Parse(yonghuid)); } } if (yonghuidequal.Equals("<")) { if (yonghuidand.Equals("and")) { where = where.And(rmd_myreminder => rmd_myreminder.YonghuID < int.Parse(yonghuid)); } else { where = where.Or(rmd_myreminder => rmd_myreminder.YonghuID < int.Parse(yonghuid)); } } } if (!string.IsNullOrEmpty(yonghuid)) { sc.ConditionInfo = sc.ConditionInfo + string.Format("{0},{1},{2},{3};", "yonghuid", yonghuid, yonghuidequal, yonghuidand); } else { sc.ConditionInfo = sc.ConditionInfo + string.Format("{0},{1},{2},{3};", "yonghuid", "", yonghuidequal, yonghuidand); } searchconditionService.GetInstance().AddEntity(sc); } else { sc.ConditionInfo = ""; if (!string.IsNullOrEmpty(yonghuid)) { if (yonghuidequal.Equals("=")) { if (yonghuidand.Equals("and")) { where = where.And(rmd_myreminder => rmd_myreminder.YonghuID == int.Parse(yonghuid)); } else { where = where.Or(rmd_myreminder => rmd_myreminder.YonghuID == int.Parse(yonghuid)); } } if (yonghuidequal.Equals(">")) { if (yonghuidand.Equals("and")) { where = where.And(rmd_myreminder => rmd_myreminder.YonghuID > int.Parse(yonghuid)); } else { where = where.Or(rmd_myreminder => rmd_myreminder.YonghuID > int.Parse(yonghuid)); } } if (yonghuidequal.Equals("<")) { if (yonghuidand.Equals("and")) { where = where.And(rmd_myreminder => rmd_myreminder.YonghuID < int.Parse(yonghuid)); } else { where = where.Or(rmd_myreminder => rmd_myreminder.YonghuID < int.Parse(yonghuid)); } } } if (!string.IsNullOrEmpty(yonghuid)) { sc.ConditionInfo = sc.ConditionInfo + string.Format("{0},{1},{2},{3};", "yonghuid", yonghuid, yonghuidequal, yonghuidand); } else { sc.ConditionInfo = sc.ConditionInfo + string.Format("{0},{1},{2},{3};", "yonghuid", "", yonghuidequal, yonghuidand); } searchconditionService.GetInstance().UpdateEntity(sc); } ViewBag.SearchCondition = sc.ConditionInfo; where = where.And(rmd_myreminder => rmd_myreminder.IsDelete == false); var tempData = ob_rmd_myreminderservice.LoadSortEntities(where.Compile(), false, rmd_myreminder => rmd_myreminder.ID).ToPagedList <rmd_myreminder>(int.Parse(page), int.Parse(System.Web.Configuration.WebConfigurationManager.AppSettings["ShowPerPage"])); ViewBag.rmd_myreminder = tempData; return(View(tempData)); }
public ActionResult Index() { int userid = (int)Session["user_id"]; string pagetag = "cust_chukujihua_index"; string page = "1"; //huozhuid string huozhuid = Request["huozhuid"] ?? ""; string huozhuidequal = Request["huozhuidequal"] ?? ""; string huozhuidand = Request["huozhuidand"] ?? ""; //KehuMC string KehuMC = Request["KehuMC"] ?? ""; string KehuMCequal = Request["KehuMCequal"] ?? ""; string KehuMCand = Request["KehuMCand"] ?? ""; //KehuDH string KehuDH = Request["KehuDH"] ?? ""; string KehuDHequal = Request["KehuDHequal"] ?? ""; string KehuDHand = Request["KehuDHand"] ?? ""; //makedate string makedate = Request["makedate"] ?? ""; string makedateequal = Request["makedateequal"] ?? ""; string makedateand = Request["makedateand"] ?? ""; PageMenu.Set("Index", "cust_chukujihua", "客户服务"); Expression <Func <cust_chukujihua, bool> > where = PredicateExtensionses.True <cust_chukujihua>(); searchcondition sc = searchconditionService.GetInstance().GetEntityById(searchcondition => searchcondition.UserID == userid && searchcondition.PageBrief == pagetag); if (sc == null) { sc = new searchcondition(); sc.UserID = userid; sc.PageBrief = pagetag; //huozhuid if (!string.IsNullOrEmpty(huozhuid)) { if (huozhuidequal.Equals("=")) { if (huozhuidand.Equals("and")) { where = where.And(p => p.HuozhuID == int.Parse(huozhuid)); } else { where = where.Or(p => p.HuozhuID == int.Parse(huozhuid)); } } } if (!string.IsNullOrEmpty(huozhuid)) { sc.ConditionInfo = sc.ConditionInfo + string.Format("{0},{1},{2},{3};", "huozhuid", huozhuid, huozhuidequal, huozhuidand); } else { sc.ConditionInfo = sc.ConditionInfo + string.Format("{0},{1},{2},{3};", "huozhuid", "", huozhuidequal, huozhuidand); } //KehuMC if (!string.IsNullOrEmpty(KehuMC)) { if (KehuMCequal.Equals("=")) { if (KehuMCand.Equals("and")) { where = where.And(p => p.KehuMC == KehuMC); } else { where = where.Or(p => p.KehuMC == KehuMC); } } if (KehuMCequal.Equals("like")) { if (KehuMCand.Equals("and")) { where = where.And(p => p.KehuMC.Contains(KehuMC)); } else { where = where.Or(p => p.KehuMC.Contains(KehuMC)); } } } if (!string.IsNullOrEmpty(KehuMC)) { sc.ConditionInfo = sc.ConditionInfo + string.Format("{0},{1},{2},{3};", "KehuMC", KehuMC, KehuMCequal, KehuMCand); } else { sc.ConditionInfo = sc.ConditionInfo + string.Format("{0},{1},{2},{3};", "KehuMC", "", KehuMCequal, KehuMCand); } //KehuDH if (!string.IsNullOrEmpty(KehuDH)) { if (KehuDHequal.Equals("=")) { if (KehuDHand.Equals("and")) { where = where.And(p => p.KehuDH == KehuDH); } else { where = where.Or(p => p.KehuDH == KehuDH); } } if (KehuDHequal.Equals("like")) { if (KehuDHand.Equals("and")) { where = where.And(p => p.KehuDH.Contains(KehuDH)); } else { where = where.Or(p => p.KehuDH.Contains(KehuDH)); } } } if (!string.IsNullOrEmpty(KehuDH)) { sc.ConditionInfo = sc.ConditionInfo + string.Format("{0},{1},{2},{3};", "KehuDH", KehuDH, KehuDHequal, KehuDHand); } else { sc.ConditionInfo = sc.ConditionInfo + string.Format("{0},{1},{2},{3};", "KehuDH", "", KehuDHequal, KehuDHand); } //searchconditionService.GetInstance().AddEntity(sc); //makedate if (!string.IsNullOrEmpty(makedate)) { if (makedateequal.Equals("=")) { if (makedateand.Equals("and")) { where = where.And(p => p.MakeDate.ToString("yyyy-MM-dd") == makedate); } else { where = where.Or(p => p.MakeDate.ToString("yyyy-MM-dd") == makedate); } } if (makedateequal.Equals(">")) { if (makedateand.Equals("and")) { where = where.And(p => p.MakeDate > DateTime.Parse(makedate)); } else { where = where.Or(p => p.MakeDate > DateTime.Parse(makedate)); } } if (makedateequal.Equals("<")) { if (makedateand.Equals("and")) { where = where.And(p => p.MakeDate < DateTime.Parse(makedate)); } else { where = where.Or(p => p.MakeDate < DateTime.Parse(makedate)); } } } if (!string.IsNullOrEmpty(makedate)) { sc.ConditionInfo = sc.ConditionInfo + string.Format("{0},{1},{2},{3};", "makedate", makedate, makedateequal, makedateand); } else { sc.ConditionInfo = sc.ConditionInfo + string.Format("{0},{1},{2},{3};", "makedate", "", makedateequal, makedateand); } searchconditionService.GetInstance().AddEntity(sc); } else { sc.ConditionInfo = ""; //huozhuid if (!string.IsNullOrEmpty(huozhuid)) { if (huozhuidequal.Equals("=")) { if (huozhuidand.Equals("and")) { where = where.And(p => p.HuozhuID == int.Parse(huozhuid)); } else { where = where.Or(p => p.HuozhuID == int.Parse(huozhuid)); } } } if (!string.IsNullOrEmpty(huozhuid)) { sc.ConditionInfo = sc.ConditionInfo + string.Format("{0},{1},{2},{3};", "huozhuid", huozhuid, huozhuidequal, huozhuidand); } else { sc.ConditionInfo = sc.ConditionInfo + string.Format("{0},{1},{2},{3};", "huozhuid", "", huozhuidequal, huozhuidand); } //KehuMC if (!string.IsNullOrEmpty(KehuMC)) { if (KehuMCequal.Equals("=")) { if (KehuMCand.Equals("and")) { where = where.And(p => p.KehuMC == KehuMC); } else { where = where.Or(p => p.KehuMC == KehuMC); } } if (KehuMCequal.Equals("like")) { if (KehuMCand.Equals("and")) { where = where.And(p => p.KehuMC.Contains(KehuMC)); } else { where = where.Or(p => p.KehuMC.Contains(KehuMC)); } } } if (!string.IsNullOrEmpty(KehuMC)) { sc.ConditionInfo = sc.ConditionInfo + string.Format("{0},{1},{2},{3};", "KehuMC", KehuMC, KehuMCequal, KehuMCand); } else { sc.ConditionInfo = sc.ConditionInfo + string.Format("{0},{1},{2},{3};", "KehuMC", "", KehuMCequal, KehuMCand); } //KehuDH if (!string.IsNullOrEmpty(KehuDH)) { if (KehuDHequal.Equals("=")) { if (KehuDHand.Equals("and")) { where = where.And(p => p.KehuDH == KehuDH); } else { where = where.Or(p => p.KehuDH == KehuDH); } } if (KehuDHequal.Equals("like")) { if (KehuDHand.Equals("and")) { where = where.And(p => p.KehuDH.Contains(KehuDH)); } else { where = where.Or(p => p.KehuDH.Contains(KehuDH)); } } } if (!string.IsNullOrEmpty(KehuDH)) { sc.ConditionInfo = sc.ConditionInfo + string.Format("{0},{1},{2},{3};", "KehuDH", KehuDH, KehuDHequal, KehuDHand); } else { sc.ConditionInfo = sc.ConditionInfo + string.Format("{0},{1},{2},{3};", "KehuDH", "", KehuDHequal, KehuDHand); } //makedate if (!string.IsNullOrEmpty(makedate)) { if (makedateequal.Equals("=")) { if (makedateand.Equals("and")) { where = where.And(p => p.MakeDate.ToString("yyyy-MM-dd") == makedate); } else { where = where.Or(p => p.MakeDate.ToString("yyyy-MM-dd") == makedate); } } if (makedateequal.Equals(">")) { if (makedateand.Equals("and")) { where = where.And(p => p.MakeDate > DateTime.Parse(makedate)); } else { where = where.Or(p => p.MakeDate > DateTime.Parse(makedate)); } } if (makedateequal.Equals("<")) { if (makedateand.Equals("and")) { where = where.And(p => p.MakeDate < DateTime.Parse(makedate)); } else { where = where.Or(p => p.MakeDate < DateTime.Parse(makedate)); } } } if (!string.IsNullOrEmpty(makedate)) { sc.ConditionInfo = sc.ConditionInfo + string.Format("{0},{1},{2},{3};", "makedate", makedate, makedateequal, makedateand); } else { sc.ConditionInfo = sc.ConditionInfo + string.Format("{0},{1},{2},{3};", "makedate", "", makedateequal, makedateand); } searchconditionService.GetInstance().UpdateEntity(sc); } ViewBag.SearchCondition = sc.ConditionInfo; userinfo _user = ServiceFactory.userinfoservice.GetEntityById(p => p.ID == userid && p.IsDelete == false); if (_user == null) { where = where.And(p => p.ID < 1); } else { switch (_user.AccountType) { case 100: where = where.And(p => p.HuozhuID == _user.EmployeeID && p.IsDelete == false); break; case 200: where = where.And(p => p.KehuID == _user.EmployeeID && p.IsDelete == false); break; case 300: where = where.And(p => p.KefuID == _user.EmployeeID && p.IsDelete == false); break; case 0: default: where = where.And(cust_chukujihua => cust_chukujihua.IsDelete == false); break; } } //where = where.And(cust_chukujihua => cust_chukujihua.IsDelete == false); var tempData = ob_cust_chukujihuaservice.LoadSortEntities(where.Compile(), true, cust_chukujihua => cust_chukujihua.JihuaZT).ToPagedList <cust_chukujihua>(int.Parse(page), int.Parse(System.Web.Configuration.WebConfigurationManager.AppSettings["ShowPerPage"])); ViewBag.cust_chukujihua = tempData; ViewBag.usertype = _user.AccountType; return(View(tempData)); }
public ActionResult Index(string page) { if (string.IsNullOrEmpty(page)) { page = "1"; } int userid = (int)Session["user_id"]; string pagetag = "base_xiaoshou_index"; PageMenu.Set("Index", "base_xiaoshou", "基础数据"); Expression <Func <base_xiaoshou, bool> > where = PredicateExtensionses.True <base_xiaoshou>(); searchcondition sc = searchconditionService.GetInstance().GetEntityById(searchcondition => searchcondition.UserID == userid && searchcondition.PageBrief == pagetag); if (sc != null) { string[] sclist = sc.ConditionInfo.Split(';'); foreach (string scl in sclist) { string[] scld = scl.Split(','); switch (scld[0]) { case "shouquanid": string shouquanid = scld[1]; string shouquanidequal = scld[2]; string shouquanidand = scld[3]; if (!string.IsNullOrEmpty(shouquanid)) { if (shouquanidequal.Equals("=")) { if (shouquanidand.Equals("and")) { where = where.And(base_xiaoshou => base_xiaoshou.ShouquanID == int.Parse(shouquanid)); } else { where = where.Or(base_xiaoshou => base_xiaoshou.ShouquanID == int.Parse(shouquanid)); } } } break; case "xingming": string xingming = scld[1]; string xingmingequal = scld[2]; string xingmingand = scld[3]; if (!string.IsNullOrEmpty(xingming)) { if (xingmingequal.Equals("=")) { if (xingmingand.Equals("and")) { where = where.And(base_xiaoshou => base_xiaoshou.Xingming == xingming); } else { where = where.Or(base_xiaoshou => base_xiaoshou.Xingming == xingming); } } if (xingmingequal.Equals("like")) { if (xingmingand.Equals("and")) { where = where.And(base_xiaoshou => base_xiaoshou.Xingming.Contains(xingming)); } else { where = where.Or(base_xiaoshou => base_xiaoshou.Xingming.Contains(xingming)); } } } break; default: break; } } ViewBag.SearchCondition = sc.ConditionInfo; } where = where.And(base_xiaoshou => base_xiaoshou.IsDelete == false); var tempData = ob_base_xiaoshouservice.LoadSortEntities(where.Compile(), false, base_xiaoshou => base_xiaoshou.ID).ToPagedList <base_xiaoshou>(int.Parse(page), int.Parse(System.Web.Configuration.WebConfigurationManager.AppSettings["ShowPerPage"])); ViewBag.base_xiaoshou = tempData; return(View(tempData)); }
public ActionResult Index() { int userid = (int)Session["user_id"]; string pagetag = "auth_gongsi_index"; string page = "1"; string daima = Request["daima"] ?? ""; string daimaequal = Request["daimaequal"] ?? ""; string daimaand = Request["daimaand"] ?? ""; string mingcheng = Request["mingcheng"] ?? ""; string mingchengequal = Request["mingchengequal"] ?? ""; string mingchengand = Request["mingchengand"] ?? ""; Expression <Func <auth_gongsi, bool> > where = PredicateExtensionses.True <auth_gongsi>(); searchcondition sc = searchconditionService.GetInstance().GetEntityById(searchcondition => searchcondition.UserID == userid && searchcondition.PageBrief == pagetag); if (sc == null) { sc = new searchcondition(); sc.UserID = userid; sc.PageBrief = pagetag; if (!string.IsNullOrEmpty(daima)) { if (daimaequal.Equals("=")) { if (daimaand.Equals("and")) { where = where.And(auth_gongsi => auth_gongsi.Daima == daima); } else { where = where.Or(auth_gongsi => auth_gongsi.Daima == daima); } } if (daimaequal.Equals("like")) { if (daimaand.Equals("and")) { where = where.And(auth_gongsi => auth_gongsi.Daima.Contains(daima)); } else { where = where.Or(auth_gongsi => auth_gongsi.Daima.Contains(daima)); } } } if (!string.IsNullOrEmpty(daima)) { sc.ConditionInfo = sc.ConditionInfo + string.Format("{0},{1},{2},{3};", "daima", daima, daimaequal, daimaand); } else { sc.ConditionInfo = sc.ConditionInfo + string.Format("{0},{1},{2},{3};", "daima", "", daimaequal, daimaand); } if (!string.IsNullOrEmpty(mingcheng)) { if (mingchengequal.Equals("=")) { if (mingchengand.Equals("and")) { where = where.And(auth_gongsi => auth_gongsi.Mingcheng == mingcheng); } else { where = where.Or(auth_gongsi => auth_gongsi.Mingcheng == mingcheng); } } if (mingchengequal.Equals("like")) { if (mingchengand.Equals("and")) { where = where.And(auth_gongsi => auth_gongsi.Mingcheng.Contains(mingcheng)); } else { where = where.Or(auth_gongsi => auth_gongsi.Mingcheng.Contains(mingcheng)); } } } if (!string.IsNullOrEmpty(mingcheng)) { sc.ConditionInfo = sc.ConditionInfo + string.Format("{0},{1},{2},{3};", "mingcheng", mingcheng, mingchengequal, mingchengand); } else { sc.ConditionInfo = sc.ConditionInfo + string.Format("{0},{1},{2},{3};", "mingcheng", "", mingchengequal, mingchengand); } searchconditionService.GetInstance().AddEntity(sc); } else { sc.ConditionInfo = ""; if (!string.IsNullOrEmpty(daima)) { if (daimaequal.Equals("=")) { if (daimaand.Equals("and")) { where = where.And(auth_gongsi => auth_gongsi.Daima == daima); } else { where = where.Or(auth_gongsi => auth_gongsi.Daima == daima); } } if (daimaequal.Equals("like")) { if (daimaand.Equals("and")) { where = where.And(auth_gongsi => auth_gongsi.Daima.Contains(daima)); } else { where = where.Or(auth_gongsi => auth_gongsi.Daima.Contains(daima)); } } } if (!string.IsNullOrEmpty(daima)) { sc.ConditionInfo = sc.ConditionInfo + string.Format("{0},{1},{2},{3};", "daima", daima, daimaequal, daimaand); } else { sc.ConditionInfo = sc.ConditionInfo + string.Format("{0},{1},{2},{3};", "daima", "", daimaequal, daimaand); } if (!string.IsNullOrEmpty(mingcheng)) { if (mingchengequal.Equals("=")) { if (mingchengand.Equals("and")) { where = where.And(auth_gongsi => auth_gongsi.Mingcheng == mingcheng); } else { where = where.Or(auth_gongsi => auth_gongsi.Mingcheng == mingcheng); } } if (mingchengequal.Equals("like")) { if (mingchengand.Equals("and")) { where = where.And(auth_gongsi => auth_gongsi.Mingcheng.Contains(mingcheng)); } else { where = where.Or(auth_gongsi => auth_gongsi.Mingcheng.Contains(mingcheng)); } } } if (!string.IsNullOrEmpty(mingcheng)) { sc.ConditionInfo = sc.ConditionInfo + string.Format("{0},{1},{2},{3};", "mingcheng", mingcheng, mingchengequal, mingchengand); } else { sc.ConditionInfo = sc.ConditionInfo + string.Format("{0},{1},{2},{3};", "mingcheng", "", mingchengequal, mingchengand); } searchconditionService.GetInstance().UpdateEntity(sc); } ViewBag.SearchCondition = sc.ConditionInfo; where = where.And(auth_gongsi => auth_gongsi.IsDelete == false); var tempData = ob_auth_gongsiservice.LoadSortEntities(where.Compile(), false, auth_gongsi => auth_gongsi.ID).ToPagedList <auth_gongsi>(int.Parse(page), int.Parse(System.Web.Configuration.WebConfigurationManager.AppSettings["ShowPerPage"])); ViewBag.auth_gongsi = tempData; return(View(tempData)); }
public ActionResult Index() { int userid = (int)Session["user_id"]; string pagetag = "u8_lackcargo_index"; string page = "1"; string u8code = Request["u8code"] ?? ""; string u8codeequal = Request["u8codeequal"] ?? ""; string u8codeand = Request["u8codeand"] ?? ""; Expression <Func <u8_lackcargo, bool> > where = PredicateExtensionses.True <u8_lackcargo>(); searchcondition sc = searchconditionService.GetInstance().GetEntityById(searchcondition => searchcondition.UserID == userid && searchcondition.PageBrief == pagetag); if (sc == null) { sc = new searchcondition(); sc.UserID = userid; sc.PageBrief = pagetag; if (!string.IsNullOrEmpty(u8code)) { if (u8codeequal.Equals("=")) { if (u8codeand.Equals("and")) { where = where.And(u8_lackcargo => u8_lackcargo.U8Code == u8code); } else { where = where.Or(u8_lackcargo => u8_lackcargo.U8Code == u8code); } } if (u8codeequal.Equals("like")) { if (u8codeand.Equals("and")) { where = where.And(u8_lackcargo => u8_lackcargo.U8Code.Contains(u8code)); } else { where = where.Or(u8_lackcargo => u8_lackcargo.U8Code.Contains(u8code)); } } } if (!string.IsNullOrEmpty(u8code)) { sc.ConditionInfo = sc.ConditionInfo + string.Format("{0},{1},{2},{3};", "u8code", u8code, u8codeequal, u8codeand); } else { sc.ConditionInfo = sc.ConditionInfo + string.Format("{0},{1},{2},{3};", "u8code", "", u8codeequal, u8codeand); } searchconditionService.GetInstance().AddEntity(sc); } else { sc.ConditionInfo = ""; if (!string.IsNullOrEmpty(u8code)) { if (u8codeequal.Equals("=")) { if (u8codeand.Equals("and")) { where = where.And(u8_lackcargo => u8_lackcargo.U8Code == u8code); } else { where = where.Or(u8_lackcargo => u8_lackcargo.U8Code == u8code); } } if (u8codeequal.Equals("like")) { if (u8codeand.Equals("and")) { where = where.And(u8_lackcargo => u8_lackcargo.U8Code.Contains(u8code)); } else { where = where.Or(u8_lackcargo => u8_lackcargo.U8Code.Contains(u8code)); } } } if (!string.IsNullOrEmpty(u8code)) { sc.ConditionInfo = sc.ConditionInfo + string.Format("{0},{1},{2},{3};", "u8code", u8code, u8codeequal, u8codeand); } else { sc.ConditionInfo = sc.ConditionInfo + string.Format("{0},{1},{2},{3};", "u8code", "", u8codeequal, u8codeand); } searchconditionService.GetInstance().UpdateEntity(sc); } ViewBag.SearchCondition = sc.ConditionInfo; where = where.And(u8_lackcargo => u8_lackcargo.IsDelete == false); var tempData = ob_u8_lackcargoservice.LoadSortEntities(where.Compile(), false, u8_lackcargo => u8_lackcargo.ID).ToPagedList <u8_lackcargo>(int.Parse(page), int.Parse(System.Web.Configuration.WebConfigurationManager.AppSettings["ShowPerPage"])); ViewBag.u8_lackcargo = tempData; return(View(tempData)); }
public ActionResult Index(string page) { if (string.IsNullOrEmpty(page)) { page = "1"; } int userid = (int)Session["user_id"]; string pagetag = "wms_kuwei_index"; PageMenu.Set("Index", "wms_kuwei", "仓库定义"); Expression <Func <wms_kuwei, bool> > where = PredicateExtensionses.True <wms_kuwei>(); searchcondition sc = searchconditionService.GetInstance().GetEntityById(searchcondition => searchcondition.UserID == userid && searchcondition.PageBrief == pagetag); if (sc != null && sc.ConditionInfo != null) { string[] sclist = sc.ConditionInfo.Split(';'); foreach (string scl in sclist) { string[] scld = scl.Split(','); switch (scld[0]) { case "Mingcheng": string Mingcheng = scld[1]; string Mingchengequal = scld[2]; string Mingchengand = scld[3]; if (!string.IsNullOrEmpty(Mingcheng)) { if (Mingchengequal.Equals("=")) { if (Mingchengand.Equals("and")) { where = where.And(p => p.Mingcheng == Mingcheng); } else { where = where.Or(p => p.Mingcheng == Mingcheng); } } if (Mingchengequal.Equals("like")) { if (Mingchengand.Equals("and")) { where = where.And(p => p.Mingcheng.Contains(Mingcheng)); } else { where = where.Or(p => p.Mingcheng.Contains(Mingcheng)); } } } break; default: break; } } ViewBag.SearchCondition = sc.ConditionInfo; } where = where.And(wms_kuwei => wms_kuwei.IsDelete == false); var tempData = ob_wms_kuweiservice.LoadSortEntities(where.Compile(), false, wms_kuwei => wms_kuwei.ID).ToPagedList <wms_kuwei>(int.Parse(page), int.Parse(System.Web.Configuration.WebConfigurationManager.AppSettings["ShowPerPage"])); ViewBag.wms_kuwei = tempData; return(View(tempData)); }
public ActionResult Index() { int userid = (int)Session["user_id"]; string pagetag = "wms_kuwei_index"; string page = "1"; //Mingcheng string Mingcheng = Request["Mingcheng"] ?? ""; string Mingchengequal = Request["Mingchengequal"] ?? ""; string Mingchengand = Request["Mingchengand"] ?? ""; PageMenu.Set("Index", "wms_kuwei", "仓库定义"); Expression <Func <wms_kuwei, bool> > where = PredicateExtensionses.True <wms_kuwei>(); searchcondition sc = searchconditionService.GetInstance().GetEntityById(searchcondition => searchcondition.UserID == userid && searchcondition.PageBrief == pagetag); if (sc == null) { sc = new searchcondition(); sc.UserID = userid; sc.PageBrief = pagetag; //Mingcheng if (!string.IsNullOrEmpty(Mingcheng)) { if (Mingchengequal.Equals("=")) { if (Mingchengand.Equals("and")) { where = where.And(p => p.Mingcheng == Mingcheng); } else { where = where.Or(p => p.Mingcheng == Mingcheng); } } if (Mingchengequal.Equals("like")) { if (Mingchengand.Equals("and")) { where = where.And(p => p.Mingcheng.Contains(Mingcheng)); } else { where = where.Or(p => p.Mingcheng.Contains(Mingcheng)); } } } if (!string.IsNullOrEmpty(Mingcheng)) { sc.ConditionInfo = sc.ConditionInfo + string.Format("{0},{1},{2},{3};", "Mingcheng", Mingcheng, Mingchengequal, Mingchengand); } else { sc.ConditionInfo = sc.ConditionInfo + string.Format("{0},{1},{2},{3};", "Mingcheng", "", Mingchengequal, Mingchengand); } searchconditionService.GetInstance().AddEntity(sc); } else { sc.ConditionInfo = ""; //Mingcheng if (!string.IsNullOrEmpty(Mingcheng)) { if (Mingchengequal.Equals("=")) { if (Mingchengand.Equals("and")) { where = where.And(p => p.Mingcheng == Mingcheng); } else { where = where.Or(p => p.Mingcheng == Mingcheng); } } if (Mingchengequal.Equals("like")) { if (Mingchengand.Equals("and")) { where = where.And(p => p.Mingcheng.Contains(Mingcheng)); } else { where = where.Or(p => p.Mingcheng.Contains(Mingcheng)); } } } if (!string.IsNullOrEmpty(Mingcheng)) { sc.ConditionInfo = sc.ConditionInfo + string.Format("{0},{1},{2},{3};", "Mingcheng", Mingcheng, Mingchengequal, Mingchengand); } else { sc.ConditionInfo = sc.ConditionInfo + string.Format("{0},{1},{2},{3};", "Mingcheng", "", Mingchengequal, Mingchengand); } searchconditionService.GetInstance().UpdateEntity(sc); } ViewBag.SearchCondition = sc.ConditionInfo; where = where.And(wms_kuwei => wms_kuwei.IsDelete == false); var tempData = ob_wms_kuweiservice.LoadSortEntities(where.Compile(), false, wms_kuwei => wms_kuwei.ID).ToPagedList <wms_kuwei>(int.Parse(page), int.Parse(System.Web.Configuration.WebConfigurationManager.AppSettings["ShowPerPage"])); ViewBag.wms_kuwei = tempData; return(View(tempData)); }
public ActionResult Index() { int userid = (int)Session["user_id"]; string pagetag = "quan_zhiliangwh_index"; string page = "1"; string chid = Request["chid"] ?? ""; string chidequal = Request["chidequal"] ?? ""; string chidand = Request["chidand"] ?? ""; Expression<Func<quan_zhiliangwh, bool>> where = PredicateExtensionses.True<quan_zhiliangwh>(); searchcondition sc = searchconditionService.GetInstance().GetEntityById(searchcondition => searchcondition.UserID == userid && searchcondition.PageBrief == pagetag); if (sc == null) { sc = new searchcondition(); sc.UserID = userid; sc.PageBrief = pagetag; if (!string.IsNullOrEmpty(chid)) { if (chidequal.Equals("=")) { if (chidand.Equals("and")) where = where.And(quan_zhiliangwh => quan_zhiliangwh.CHID == int.Parse(chid)); else where = where.Or(quan_zhiliangwh => quan_zhiliangwh.CHID == int.Parse(chid)); } if (chidequal.Equals(">")) { if (chidand.Equals("and")) where = where.And(quan_zhiliangwh => quan_zhiliangwh.CHID > int.Parse(chid)); else where = where.Or(quan_zhiliangwh => quan_zhiliangwh.CHID > int.Parse(chid)); } if (chidequal.Equals("<")) { if (chidand.Equals("and")) where = where.And(quan_zhiliangwh => quan_zhiliangwh.CHID < int.Parse(chid)); else where = where.Or(quan_zhiliangwh => quan_zhiliangwh.CHID < int.Parse(chid)); } } if (!string.IsNullOrEmpty(chid)) sc.ConditionInfo = sc.ConditionInfo + string.Format("{0},{1},{2},{3};", "chid", chid, chidequal, chidand); else sc.ConditionInfo = sc.ConditionInfo + string.Format("{0},{1},{2},{3};", "chid", "", chidequal, chidand); searchconditionService.GetInstance().AddEntity(sc); } else { sc.ConditionInfo = ""; if (!string.IsNullOrEmpty(chid)) { if (chidequal.Equals("=")) { if (chidand.Equals("and")) where = where.And(quan_zhiliangwh => quan_zhiliangwh.CHID == int.Parse(chid)); else where = where.Or(quan_zhiliangwh => quan_zhiliangwh.CHID == int.Parse(chid)); } if (chidequal.Equals(">")) { if (chidand.Equals("and")) where = where.And(quan_zhiliangwh => quan_zhiliangwh.CHID > int.Parse(chid)); else where = where.Or(quan_zhiliangwh => quan_zhiliangwh.CHID > int.Parse(chid)); } if (chidequal.Equals("<")) { if (chidand.Equals("and")) where = where.And(quan_zhiliangwh => quan_zhiliangwh.CHID < int.Parse(chid)); else where = where.Or(quan_zhiliangwh => quan_zhiliangwh.CHID < int.Parse(chid)); } } if (!string.IsNullOrEmpty(chid)) sc.ConditionInfo = sc.ConditionInfo + string.Format("{0},{1},{2},{3};", "chid", chid, chidequal, chidand); else sc.ConditionInfo = sc.ConditionInfo + string.Format("{0},{1},{2},{3};", "chid", "", chidequal, chidand); searchconditionService.GetInstance().UpdateEntity(sc); } ViewBag.SearchCondition = sc.ConditionInfo; where = where.And(quan_zhiliangwh => quan_zhiliangwh.IsDelete == false); var tempData = ob_quan_zhiliangwhservice.LoadSortEntities(where.Compile(), false, quan_zhiliangwh => quan_zhiliangwh.ID).ToPagedList<quan_zhiliangwh>(int.Parse(page), int.Parse(System.Web.Configuration.WebConfigurationManager.AppSettings["ShowPerPage"])); ViewBag.quan_zhiliangwh = tempData; return View(tempData); }
public ActionResult outReportExport() { int userid = (int)Session["user_id"]; string pagetag = "wms_outreport_list"; Expression <Func <wms_outdetaillist_v, bool> > where = PredicateExtensionses.True <wms_outdetaillist_v>(); searchcondition sc = searchconditionService.GetInstance().GetEntityById(searchcondition => searchcondition.UserID == userid && searchcondition.PageBrief == pagetag); if (sc != null && sc.ConditionInfo != null) { string[] sclist = sc.ConditionInfo.Split(';'); foreach (string scl in sclist) { string[] scld = scl.Split(','); switch (scld[0]) { case "chukubh": string chukubh = scld[1]; string chukubhequal = scld[2]; string chukubhand = scld[3]; if (!string.IsNullOrEmpty(chukubh)) { if (chukubhequal.Equals("=")) { if (chukubhand.Equals("and")) { where = where.And(p => p.ChukudanBH == chukubh); } else { where = where.Or(p => p.ChukudanBH == chukubh); } } if (chukubhequal.Equals("like")) { if (chukubhand.Equals("and")) { where = where.And(p => p.ChukudanBH.Contains(chukubh)); } else { where = where.Or(p => p.ChukudanBH.Contains(chukubh)); } } } break; case "ShangpinMC": string ShangpinMC = scld[1]; string ShangpinMCequal = scld[2]; string ShangpinMCand = scld[3]; if (!string.IsNullOrEmpty(ShangpinMC)) { if (ShangpinMCequal.Equals("=")) { if (ShangpinMCand.Equals("and")) { where = where.And(p => p.ShangpinMC == ShangpinMC); } else { where = where.Or(p => p.ShangpinMC == ShangpinMC); } } if (ShangpinMCequal.Equals("like")) { if (ShangpinMCand.Equals("and")) { where = where.And(p => p.ShangpinMC.Contains(ShangpinMC)); } else { where = where.Or(p => p.ShangpinMC.Contains(ShangpinMC)); } } } break; case "Guige": string Guige = scld[1]; string Guigeequal = scld[2]; string Guigeand = scld[3]; if (!string.IsNullOrEmpty(Guige)) { if (Guigeequal.Equals("=")) { if (Guigeand.Equals("and")) { where = where.And(p => p.Guige == Guige); } else { where = where.Or(p => p.Guige == Guige); } } if (Guigeequal.Equals("like")) { if (Guigeand.Equals("and")) { where = where.And(p => p.Guige.Contains(Guige)); } else { where = where.Or(p => p.Guige.Contains(Guige)); } } } break; case "Pihao": string Pihao = scld[1]; string Pihaoequal = scld[2]; string Pihaoand = scld[3]; if (!string.IsNullOrEmpty(Pihao)) { if (Pihaoequal.Equals("=")) { if (Pihaoand.Equals("and")) { where = where.And(p => p.Pihao == Pihao); } else { where = where.Or(p => p.Pihao == Pihao); } } if (Pihaoequal.Equals("like")) { if (Pihaoand.Equals("and")) { where = where.And(p => p.Pihao.Contains(Pihao)); } else { where = where.Or(p => p.Pihao.Contains(Pihao)); } } } break; case "ChukuRQ": string ChukuRQ = scld[1]; string ChukuRQequal = scld[2]; string ChukuRQand = scld[3]; if (!string.IsNullOrEmpty(ChukuRQ)) { if (ChukuRQequal.Equals("=")) { if (ChukuRQand.Equals("and")) { where = where.And(p => p.ChukuRQ == DateTime.Parse(ChukuRQ)); } else { where = where.Or(p => p.ChukuRQ == DateTime.Parse(ChukuRQ)); } } if (ChukuRQequal.Equals(">")) { if (ChukuRQand.Equals("and")) { where = where.And(p => p.ChukuRQ > DateTime.Parse(ChukuRQ)); } else { where = where.Or(p => p.ChukuRQ > DateTime.Parse(ChukuRQ)); } } if (ChukuRQequal.Equals("<")) { if (ChukuRQand.Equals("and")) { where = where.And(p => p.ChukuRQ < DateTime.Parse(ChukuRQ)); } else { where = where.Or(p => p.ChukuRQ < DateTime.Parse(ChukuRQ)); } } } break; default: break; } } ViewBag.SearchCondition = sc.ConditionInfo; } var tempData = ServiceFactory.wms_chukudanservice.GetOutList(where.Compile()); ViewBag.outReport = tempData; ViewData.Model = tempData; string viewHtml = ExportNow.RenderPartialViewToString(this, "outReportExport"); return(File(System.Text.Encoding.UTF8.GetBytes(viewHtml), "application/ms-excel", string.Format("outReportExport_{0}.xls", DateTime.Now.ToShortDateString()))); }
public ActionResult GetOutList(string page) { if (string.IsNullOrEmpty(page)) { page = "1"; } int userid = (int)Session["user_id"]; string pagetag = "wms_outreport_list"; Expression <Func <wms_outdetaillist_v, bool> > where = PredicateExtensionses.True <wms_outdetaillist_v>(); searchcondition sc = searchconditionService.GetInstance().GetEntityById(searchcondition => searchcondition.UserID == userid && searchcondition.PageBrief == pagetag); if (sc != null && sc.ConditionInfo != null) { string[] sclist = sc.ConditionInfo.Split(';'); foreach (string scl in sclist) { string[] scld = scl.Split(','); switch (scld[0]) { case "chukubh": string chukubh = scld[1]; string chukubhequal = scld[2]; string chukubhand = scld[3]; if (!string.IsNullOrEmpty(chukubh)) { if (chukubhequal.Equals("=")) { if (chukubhand.Equals("and")) { where = where.And(p => p.ChukudanBH == chukubh); } else { where = where.Or(p => p.ChukudanBH == chukubh); } } if (chukubhequal.Equals("like")) { if (chukubhand.Equals("and")) { where = where.And(p => p.ChukudanBH.Contains(chukubh)); } else { where = where.Or(p => p.ChukudanBH.Contains(chukubh)); } } } break; case "ShangpinMC": string ShangpinMC = scld[1]; string ShangpinMCequal = scld[2]; string ShangpinMCand = scld[3]; if (!string.IsNullOrEmpty(ShangpinMC)) { if (ShangpinMCequal.Equals("=")) { if (ShangpinMCand.Equals("and")) { where = where.And(p => p.ShangpinMC == ShangpinMC); } else { where = where.Or(p => p.ShangpinMC == ShangpinMC); } } if (ShangpinMCequal.Equals("like")) { if (ShangpinMCand.Equals("and")) { where = where.And(p => p.ShangpinMC.Contains(ShangpinMC)); } else { where = where.Or(p => p.ShangpinMC.Contains(ShangpinMC)); } } } break; case "Guige": string Guige = scld[1]; string Guigeequal = scld[2]; string Guigeand = scld[3]; if (!string.IsNullOrEmpty(Guige)) { if (Guigeequal.Equals("=")) { if (Guigeand.Equals("and")) { where = where.And(p => p.Guige == Guige); } else { where = where.Or(p => p.Guige == Guige); } } if (Guigeequal.Equals("like")) { if (Guigeand.Equals("and")) { where = where.And(p => p.Guige.Contains(Guige)); } else { where = where.Or(p => p.Guige.Contains(Guige)); } } } break; case "Pihao": string Pihao = scld[1]; string Pihaoequal = scld[2]; string Pihaoand = scld[3]; if (!string.IsNullOrEmpty(Pihao)) { if (Pihaoequal.Equals("=")) { if (Pihaoand.Equals("and")) { where = where.And(p => p.Pihao == Pihao); } else { where = where.Or(p => p.Pihao == Pihao); } } if (Pihaoequal.Equals("like")) { if (Pihaoand.Equals("and")) { where = where.And(p => p.Pihao.Contains(Pihao)); } else { where = where.Or(p => p.Pihao.Contains(Pihao)); } } } break; case "ChukuRQ": string ChukuRQ = scld[1]; string ChukuRQequal = scld[2]; string ChukuRQand = scld[3]; if (!string.IsNullOrEmpty(ChukuRQ)) { if (ChukuRQequal.Equals("=")) { if (ChukuRQand.Equals("and")) { where = where.And(p => p.ChukuRQ == DateTime.Parse(ChukuRQ)); } else { where = where.Or(p => p.ChukuRQ == DateTime.Parse(ChukuRQ)); } } if (ChukuRQequal.Equals(">")) { if (ChukuRQand.Equals("and")) { where = where.And(p => p.ChukuRQ > DateTime.Parse(ChukuRQ)); } else { where = where.Or(p => p.ChukuRQ > DateTime.Parse(ChukuRQ)); } } if (ChukuRQequal.Equals("<")) { if (ChukuRQand.Equals("and")) { where = where.And(p => p.ChukuRQ < DateTime.Parse(ChukuRQ)); } else { where = where.Or(p => p.ChukuRQ < DateTime.Parse(ChukuRQ)); } } } break; default: break; } } ViewBag.SearchCondition = sc.ConditionInfo; } var tempData = ServiceFactory.wms_chukudanservice.GetOutList(where.Compile()).ToPagedList <wms_outdetaillist_v>(int.Parse(page), int.Parse(System.Web.Configuration.WebConfigurationManager.AppSettings["ShowPerPage"])); ViewBag.outreport = tempData; return(View(tempData)); }
public ActionResult Index() { int userid = (int)Session["user_id"]; string pagetag = "base_renyuanxx_index"; string page = "1"; //mingcheng string mingcheng = Request["mingcheng"] ?? ""; string mingchengequal = Request["mingchengequal"] ?? ""; string mingchengand = Request["mingchengand"] ?? ""; //bumen string bumen = Request["bumen"] ?? ""; string bumenequal = Request["bumenequal"] ?? ""; string bumenand = Request["bumenand"] ?? ""; PageMenu.Set("Index", "base_renyuanxx", "基础数据"); Expression <Func <base_renyuanxx, bool> > where = PredicateExtensionses.True <base_renyuanxx>(); searchcondition sc = searchconditionService.GetInstance().GetEntityById(searchcondition => searchcondition.UserID == userid && searchcondition.PageBrief == pagetag); if (sc == null) { sc = new searchcondition(); sc.UserID = userid; sc.PageBrief = pagetag; //mingcheng if (!string.IsNullOrEmpty(mingcheng)) { if (mingchengequal.Equals("=")) { if (mingchengand.Equals("and")) { where = where.And(base_renyuanxx => base_renyuanxx.Mingcheng == mingcheng); } else { where = where.Or(base_renyuanxx => base_renyuanxx.Mingcheng == mingcheng); } } if (mingchengequal.Equals("like")) { if (mingchengand.Equals("and")) { where = where.And(base_renyuanxx => base_renyuanxx.Mingcheng.Contains(mingcheng)); } else { where = where.Or(base_renyuanxx => base_renyuanxx.Mingcheng.Contains(mingcheng)); } } } if (!string.IsNullOrEmpty(mingcheng)) { sc.ConditionInfo = sc.ConditionInfo + string.Format("{0},{1},{2},{3};", "mingcheng", mingcheng, mingchengequal, mingchengand); } else { sc.ConditionInfo = sc.ConditionInfo + string.Format("{0},{1},{2},{3};", "mingcheng", "", mingchengequal, mingchengand); } //bumen if (!string.IsNullOrEmpty(bumen)) { if (bumenequal.Equals("=")) { if (bumenand.Equals("and")) { where = where.And(base_renyuanxx => base_renyuanxx.Bumen == bumen); } else { where = where.Or(base_renyuanxx => base_renyuanxx.Bumen == bumen); } } if (bumenequal.Equals("like")) { if (bumenand.Equals("and")) { where = where.And(base_renyuanxx => base_renyuanxx.Bumen.Contains(bumen)); } else { where = where.Or(base_renyuanxx => base_renyuanxx.Bumen.Contains(bumen)); } } } if (!string.IsNullOrEmpty(bumen)) { sc.ConditionInfo = sc.ConditionInfo + string.Format("{0},{1},{2},{3};", "bumen", bumen, bumenequal, bumenand); } else { sc.ConditionInfo = sc.ConditionInfo + string.Format("{0},{1},{2},{3};", "bumen", "", bumenequal, bumenand); } searchconditionService.GetInstance().AddEntity(sc); } else { sc.ConditionInfo = ""; //mingcheng if (!string.IsNullOrEmpty(mingcheng)) { if (mingchengequal.Equals("=")) { if (mingchengand.Equals("and")) { where = where.And(base_renyuanxx => base_renyuanxx.Mingcheng == mingcheng); } else { where = where.Or(base_renyuanxx => base_renyuanxx.Mingcheng == mingcheng); } } if (mingchengequal.Equals("like")) { if (mingchengand.Equals("and")) { where = where.And(base_renyuanxx => base_renyuanxx.Mingcheng.Contains(mingcheng)); } else { where = where.Or(base_renyuanxx => base_renyuanxx.Mingcheng.Contains(mingcheng)); } } } if (!string.IsNullOrEmpty(mingcheng)) { sc.ConditionInfo = sc.ConditionInfo + string.Format("{0},{1},{2},{3};", "mingcheng", mingcheng, mingchengequal, mingchengand); } else { sc.ConditionInfo = sc.ConditionInfo + string.Format("{0},{1},{2},{3};", "mingcheng", "", mingchengequal, mingchengand); } //bumen if (!string.IsNullOrEmpty(bumen)) { if (bumenequal.Equals("=")) { if (bumenand.Equals("and")) { where = where.And(base_renyuanxx => base_renyuanxx.Bumen == bumen); } else { where = where.Or(base_renyuanxx => base_renyuanxx.Bumen == bumen); } } if (bumenequal.Equals("like")) { if (bumenand.Equals("and")) { where = where.And(base_renyuanxx => base_renyuanxx.Bumen.Contains(bumen)); } else { where = where.Or(base_renyuanxx => base_renyuanxx.Bumen.Contains(bumen)); } } } if (!string.IsNullOrEmpty(bumen)) { sc.ConditionInfo = sc.ConditionInfo + string.Format("{0},{1},{2},{3};", "bumen", bumen, bumenequal, bumenand); } else { sc.ConditionInfo = sc.ConditionInfo + string.Format("{0},{1},{2},{3};", "bumen", "", bumenequal, bumenand); } searchconditionService.GetInstance().UpdateEntity(sc); } ViewBag.SearchCondition = sc.ConditionInfo; where = where.And(base_renyuanxx => base_renyuanxx.IsDelete == false); var tempData = ob_base_renyuanxxservice.LoadSortEntities(where.Compile(), false, base_renyuanxx => base_renyuanxx.ID).ToPagedList <base_renyuanxx>(int.Parse(page), int.Parse(System.Web.Configuration.WebConfigurationManager.AppSettings["ShowPerPage"])); ViewBag.base_renyuanxx = tempData; return(View(tempData)); }
public ActionResult Index() { int userid = (int)Session["user_id"]; string pagetag = "json_batch_index"; string page = "1"; string delivery_number = Request["delivery_number"] ?? ""; string delivery_numberequal = Request["delivery_numberequal"] ?? ""; string delivery_numberand = Request["delivery_numberand"] ?? ""; Expression <Func <json_batch, bool> > where = PredicateExtensionses.True <json_batch>(); searchcondition sc = searchconditionService.GetInstance().GetEntityById(searchcondition => searchcondition.UserID == userid && searchcondition.PageBrief == pagetag); if (sc == null) { sc = new searchcondition(); sc.UserID = userid; sc.PageBrief = pagetag; if (!string.IsNullOrEmpty(delivery_number)) { if (delivery_numberequal.Equals("=")) { if (delivery_numberand.Equals("and")) { where = where.And(json_batch => json_batch.DELIVERY_NUMBER == delivery_number); } else { where = where.Or(json_batch => json_batch.DELIVERY_NUMBER == delivery_number); } } if (delivery_numberequal.Equals("like")) { if (delivery_numberand.Equals("and")) { where = where.And(json_batch => json_batch.DELIVERY_NUMBER.Contains(delivery_number)); } else { where = where.Or(json_batch => json_batch.DELIVERY_NUMBER.Contains(delivery_number)); } } } if (!string.IsNullOrEmpty(delivery_number)) { sc.ConditionInfo = sc.ConditionInfo + string.Format("{0},{1},{2},{3};", "delivery_number", delivery_number, delivery_numberequal, delivery_numberand); } else { sc.ConditionInfo = sc.ConditionInfo + string.Format("{0},{1},{2},{3};", "delivery_number", "", delivery_numberequal, delivery_numberand); } searchconditionService.GetInstance().AddEntity(sc); } else { sc.ConditionInfo = ""; if (!string.IsNullOrEmpty(delivery_number)) { if (delivery_numberequal.Equals("=")) { if (delivery_numberand.Equals("and")) { where = where.And(json_batch => json_batch.DELIVERY_NUMBER == delivery_number); } else { where = where.Or(json_batch => json_batch.DELIVERY_NUMBER == delivery_number); } } if (delivery_numberequal.Equals("like")) { if (delivery_numberand.Equals("and")) { where = where.And(json_batch => json_batch.DELIVERY_NUMBER.Contains(delivery_number)); } else { where = where.Or(json_batch => json_batch.DELIVERY_NUMBER.Contains(delivery_number)); } } } if (!string.IsNullOrEmpty(delivery_number)) { sc.ConditionInfo = sc.ConditionInfo + string.Format("{0},{1},{2},{3};", "delivery_number", delivery_number, delivery_numberequal, delivery_numberand); } else { sc.ConditionInfo = sc.ConditionInfo + string.Format("{0},{1},{2},{3};", "delivery_number", "", delivery_numberequal, delivery_numberand); } searchconditionService.GetInstance().UpdateEntity(sc); } ViewBag.SearchCondition = sc.ConditionInfo; where = where.And(json_batch => json_batch.IsDelete == false); var tempData = ob_json_batchservice.LoadSortEntities(where.Compile(), false, json_batch => json_batch.ID).ToPagedList <json_batch>(int.Parse(page), int.Parse(System.Web.Configuration.WebConfigurationManager.AppSettings["ShowPerPage"])); ViewBag.json_batch = tempData; return(View(tempData)); }
public ActionResult Index() { int userid = (int)Session["user_id"]; string pagetag = "quan_gspspxx_index"; string page = "1"; //huozhuid string huozhuid = Request["huozhuid"] ?? ""; string huozhuidequal = Request["huozhuidequal"] ?? ""; string huozhuidand = Request["huozhuidand"] ?? ""; //daima string daima = Request["daima"] ?? ""; string daimaequal = Request["daimaequal"] ?? ""; string daimaand = Request["daimaand"] ?? ""; //mingcheng string mingcheng = Request["mingcheng"] ?? ""; string mingchengequal = Request["mingchengequal"] ?? ""; string mingchengand = Request["mingchengand"] ?? ""; //shouying string shouying = Request["shouying"] ?? ""; string shouyingequal = Request["shouyingequal"] ?? ""; string shouyingand = Request["shouyingand"] ?? ""; if (shouying == "0") { shouying = ""; } Expression <Func <quan_gspspxx, bool> > where = PredicateExtensionses.True <quan_gspspxx>(); searchcondition sc = searchconditionService.GetInstance().GetEntityById(searchcondition => searchcondition.UserID == userid && searchcondition.PageBrief == pagetag); if (sc == null) { sc = new searchcondition(); sc.UserID = userid; sc.PageBrief = pagetag; //huozhuid if (!string.IsNullOrEmpty(huozhuid)) { if (huozhuidequal.Equals("=")) { if (huozhuidand.Equals("and")) { where = where.And(p => p.HuozhuID == int.Parse(huozhuid)); } else { where = where.Or(p => p.HuozhuID == int.Parse(huozhuid)); } } } if (!string.IsNullOrEmpty(huozhuid)) { sc.ConditionInfo = sc.ConditionInfo + string.Format("{0},{1},{2},{3};", "huozhuid", huozhuid, huozhuidequal, huozhuidand); } else { sc.ConditionInfo = sc.ConditionInfo + string.Format("{0},{1},{2},{3};", "huozhuid", "", huozhuidequal, huozhuidand); } //daima if (!string.IsNullOrEmpty(daima)) { if (daimaequal.Equals("=")) { if (daimaand.Equals("and")) { where = where.And(quan_gspspxx => quan_gspspxx.Daima == daima); } else { where = where.Or(quan_gspspxx => quan_gspspxx.Daima == daima); } } if (daimaequal.Equals("like")) { if (daimaand.Equals("and")) { where = where.And(quan_gspspxx => quan_gspspxx.Daima.Contains(daima)); } else { where = where.Or(quan_gspspxx => quan_gspspxx.Daima.Contains(daima)); } } } if (!string.IsNullOrEmpty(daima)) { sc.ConditionInfo = sc.ConditionInfo + string.Format("{0},{1},{2},{3};", "daima", daima, daimaequal, daimaand); } else { sc.ConditionInfo = sc.ConditionInfo + string.Format("{0},{1},{2},{3};", "daima", "", daimaequal, daimaand); } //mingcheng if (!string.IsNullOrEmpty(mingcheng)) { if (mingchengequal.Equals("=")) { if (mingchengand.Equals("and")) { where = where.And(quan_gspspxx => quan_gspspxx.Mingcheng == mingcheng); } else { where = where.Or(quan_gspspxx => quan_gspspxx.Mingcheng == mingcheng); } } if (mingchengequal.Equals("like")) { if (mingchengand.Equals("and")) { where = where.And(quan_gspspxx => quan_gspspxx.Mingcheng.Contains(mingcheng)); } else { where = where.Or(quan_gspspxx => quan_gspspxx.Mingcheng.Contains(mingcheng)); } } } if (!string.IsNullOrEmpty(mingcheng)) { sc.ConditionInfo = sc.ConditionInfo + string.Format("{0},{1},{2},{3};", "mingcheng", mingcheng, mingchengequal, mingchengand); } else { sc.ConditionInfo = sc.ConditionInfo + string.Format("{0},{1},{2},{3};", "mingcheng", "", mingchengequal, mingchengand); } //shouying if (!string.IsNullOrEmpty(shouying)) { if (shouyingequal.Equals("=")) { if (shouyingand.Equals("and")) { where = where.And(p => p.Shouying == int.Parse(shouying)); } else { where = where.Or(p => p.Shouying == int.Parse(shouying)); } } } if (!string.IsNullOrEmpty(shouying)) { sc.ConditionInfo = sc.ConditionInfo + string.Format("{0},{1},{2},{3};", "shouying", shouying, shouyingequal, shouyingand); } else { sc.ConditionInfo = sc.ConditionInfo + string.Format("{0},{1},{2},{3};", "shouying", "", shouyingequal, shouyingand); } searchconditionService.GetInstance().AddEntity(sc); } else { sc.ConditionInfo = ""; //huozhuid if (!string.IsNullOrEmpty(huozhuid)) { if (huozhuidequal.Equals("=")) { if (huozhuidand.Equals("and")) { where = where.And(p => p.HuozhuID == int.Parse(huozhuid)); } else { where = where.Or(p => p.HuozhuID == int.Parse(huozhuid)); } } } if (!string.IsNullOrEmpty(huozhuid)) { sc.ConditionInfo = sc.ConditionInfo + string.Format("{0},{1},{2},{3};", "huozhuid", huozhuid, huozhuidequal, huozhuidand); } else { sc.ConditionInfo = sc.ConditionInfo + string.Format("{0},{1},{2},{3};", "huozhuid", "", huozhuidequal, huozhuidand); } //daima if (!string.IsNullOrEmpty(daima)) { if (daimaequal.Equals("=")) { if (daimaand.Equals("and")) { where = where.And(p => p.Daima == daima); } else { where = where.Or(p => p.Daima == daima); } } if (daimaequal.Equals("like")) { if (daimaand.Equals("and")) { where = where.And(p => p.Daima.Contains(daima)); } else { where = where.Or(p => p.Daima.Contains(daima)); } } } if (!string.IsNullOrEmpty(daima)) { sc.ConditionInfo = sc.ConditionInfo + string.Format("{0},{1},{2},{3};", "daima", daima, daimaequal, daimaand); } else { sc.ConditionInfo = sc.ConditionInfo + string.Format("{0},{1},{2},{3};", "daima", "", daimaequal, daimaand); } //mingcheng if (!string.IsNullOrEmpty(mingcheng)) { if (mingchengequal.Equals("=")) { if (mingchengand.Equals("and")) { where = where.And(p => p.Mingcheng == mingcheng); } else { where = where.Or(p => p.Mingcheng == mingcheng); } } if (mingchengequal.Equals("like")) { if (mingchengand.Equals("and")) { where = where.And(p => p.Mingcheng.Contains(mingcheng)); } else { where = where.Or(p => p.Mingcheng.Contains(mingcheng)); } } } if (!string.IsNullOrEmpty(mingcheng)) { sc.ConditionInfo = sc.ConditionInfo + string.Format("{0},{1},{2},{3};", "mingcheng", mingcheng, mingchengequal, mingchengand); } else { sc.ConditionInfo = sc.ConditionInfo + string.Format("{0},{1},{2},{3};", "mingcheng", "", mingchengequal, mingchengand); } //shouying if (!string.IsNullOrEmpty(shouying)) { if (shouyingequal.Equals("=")) { if (shouyingand.Equals("and")) { where = where.And(p => p.Shouying == int.Parse(shouying)); } else { where = where.Or(p => p.Shouying == int.Parse(shouying)); } } } if (!string.IsNullOrEmpty(shouying)) { sc.ConditionInfo = sc.ConditionInfo + string.Format("{0},{1},{2},{3};", "shouying", shouying, shouyingequal, shouyingand); } else { sc.ConditionInfo = sc.ConditionInfo + string.Format("{0},{1},{2},{3};", "shouying", "", shouyingequal, shouyingand); } searchconditionService.GetInstance().UpdateEntity(sc); } ViewBag.SearchCondition = sc.ConditionInfo; where = where.And(quan_gspspxx => quan_gspspxx.IsDelete == false); var tempData = ob_quan_gspspxxservice.LoadSortEntities(where.Compile(), false, quan_gspspxx => quan_gspspxx.ID).ToPagedList <quan_gspspxx>(int.Parse(page), int.Parse(System.Web.Configuration.WebConfigurationManager.AppSettings["ShowPerPage"])); ViewBag.quan_gspspxx = tempData; return(View(tempData)); }
public ActionResult Index(string page) { if (string.IsNullOrEmpty(page)) { page = "1"; } int userid = (int)Session["user_id"]; string pagetag = "auth_gongsi_index"; Expression <Func <auth_gongsi, bool> > where = PredicateExtensionses.True <auth_gongsi>(); searchcondition sc = searchconditionService.GetInstance().GetEntityById(searchcondition => searchcondition.UserID == userid && searchcondition.PageBrief == pagetag); if (sc != null && sc.ConditionInfo != null) { string[] sclist = sc.ConditionInfo.Split(';'); foreach (string scl in sclist) { string[] scld = scl.Split(','); switch (scld[0]) { case "daima": string daima = scld[1]; string daimaequal = scld[2]; string daimaand = scld[3]; if (!string.IsNullOrEmpty(daima)) { if (daimaequal.Equals("=")) { if (daimaand.Equals("and")) { where = where.And(auth_gongsi => auth_gongsi.Daima == daima); } else { where = where.Or(auth_gongsi => auth_gongsi.Daima == daima); } } if (daimaequal.Equals("like")) { if (daimaand.Equals("and")) { where = where.And(auth_gongsi => auth_gongsi.Daima.Contains(daima)); } else { where = where.Or(auth_gongsi => auth_gongsi.Daima.Contains(daima)); } } } break; default: break; } } ViewBag.SearchCondition = sc.ConditionInfo; } where = where.And(auth_gongsi => auth_gongsi.IsDelete == false); var tempData = ob_auth_gongsiservice.LoadSortEntities(where.Compile(), false, auth_gongsi => auth_gongsi.ID).ToPagedList <auth_gongsi>(int.Parse(page), int.Parse(System.Web.Configuration.WebConfigurationManager.AppSettings["ShowPerPage"])); ViewBag.auth_gongsi = tempData; return(View(tempData)); }
public ActionResult Index(string page) { if (string.IsNullOrEmpty(page)) { page = "1"; } int userid = (int)Session["user_id"]; string pagetag = "quan_gspspxx_index"; Expression <Func <quan_gspspxx, bool> > where = PredicateExtensionses.True <quan_gspspxx>(); searchcondition sc = searchconditionService.GetInstance().GetEntityById(searchcondition => searchcondition.UserID == userid && searchcondition.PageBrief == pagetag); if (sc != null && sc.ConditionInfo != null) { string[] sclist = sc.ConditionInfo.Split(';'); foreach (string scl in sclist) { string[] scld = scl.Split(','); switch (scld[0]) { case "huozhuid": string huozhuid = scld[1]; string huozhuidequal = scld[2]; string huozhuidand = scld[3]; if (!string.IsNullOrEmpty(huozhuid)) { if (huozhuidequal.Equals("=")) { if (huozhuidand.Equals("and")) { where = where.And(p => p.HuozhuID == int.Parse(huozhuid)); } else { where = where.Or(p => p.HuozhuID == int.Parse(huozhuid)); } } } break; case "daima": string daima = scld[1]; string daimaequal = scld[2]; string daimaand = scld[3]; if (!string.IsNullOrEmpty(daima)) { if (daimaequal.Equals("=")) { if (daimaand.Equals("and")) { where = where.And(p => p.Daima == daima); } else { where = where.Or(p => p.Daima == daima); } } if (daimaequal.Equals("like")) { if (daimaand.Equals("and")) { where = where.And(p => p.Daima.Contains(daima)); } else { where = where.Or(p => p.Daima.Contains(daima)); } } } break; case "mingcheng": string mingcheng = scld[1]; string mingchengequal = scld[2]; string mingchengand = scld[3]; if (!string.IsNullOrEmpty(mingcheng)) { if (mingchengequal.Equals("=")) { if (mingchengand.Equals("and")) { where = where.And(p => p.Mingcheng == mingcheng); } else { where = where.Or(p => p.Mingcheng == mingcheng); } } if (mingchengequal.Equals("like")) { if (mingchengand.Equals("and")) { where = where.And(p => p.Mingcheng.Contains(mingcheng)); } else { where = where.Or(p => p.Mingcheng.Contains(mingcheng)); } } } break; case "shouying": string shouying = scld[1]; string shouyingequal = scld[2]; string shouyingand = scld[3]; if (shouying == "0") { shouying = ""; } if (!string.IsNullOrEmpty(shouying)) { if (shouyingequal.Equals("=")) { if (shouyingand.Equals("and")) { where = where.And(p => p.Shouying == int.Parse(shouying)); } else { where = where.Or(p => p.Shouying == int.Parse(shouying)); } } } break; default: break; } } ViewBag.SearchCondition = sc.ConditionInfo; } where = where.And(quan_gspspxx => quan_gspspxx.IsDelete == false); var tempData = ob_quan_gspspxxservice.LoadSortEntities(where.Compile(), false, quan_gspspxx => quan_gspspxx.ID).ToPagedList <quan_gspspxx>(int.Parse(page), int.Parse(System.Web.Configuration.WebConfigurationManager.AppSettings["ShowPerPage"])); ViewBag.quan_gspspxx = tempData; return(View(tempData)); }
public ActionResult Index() { int userid = (int)Session["user_id"]; string pagetag = "base_xiaoshou_index"; string page = "1"; string shouquanid = Request["shouquanid"] ?? ""; string shouquanidequal = Request["shouquanidequal"] ?? ""; string shouquanidand = Request["shouquanidand"] ?? ""; string xingming = Request["xingming"] ?? ""; string xingmingequal = Request["xingmingequal"] ?? ""; string xingmingand = Request["xingmingand"] ?? ""; PageMenu.Set("Index", "base_xiaoshou", "基础数据"); Expression <Func <base_xiaoshou, bool> > where = PredicateExtensionses.True <base_xiaoshou>(); searchcondition sc = searchconditionService.GetInstance().GetEntityById(searchcondition => searchcondition.UserID == userid && searchcondition.PageBrief == pagetag); if (sc == null) { sc = new searchcondition(); sc.UserID = userid; sc.PageBrief = pagetag; //if (!string.IsNullOrEmpty(leibie)) //{ // if (leibieequal.Equals("=")) // { // if (leibieand.Equals("and")) // where = where.And(base_xiaoshou => base_xiaoshou.Leibie == int.Parse(leibie)); // else // where = where.Or(base_xiaoshou => base_xiaoshou.Leibie == int.Parse(leibie)); // } // if (leibieequal.Equals(">")) // { // if (leibieand.Equals("and")) // where = where.And(base_xiaoshou => base_xiaoshou.Leibie > int.Parse(leibie)); // else // where = where.Or(base_xiaoshou => base_xiaoshou.Leibie > int.Parse(leibie)); // } // if (leibieequal.Equals("<")) // { // if (leibieand.Equals("and")) // where = where.And(base_xiaoshou => base_xiaoshou.Leibie < int.Parse(leibie)); // else // where = where.Or(base_xiaoshou => base_xiaoshou.Leibie < int.Parse(leibie)); // } //} //if (!string.IsNullOrEmpty(leibie)) // sc.ConditionInfo = sc.ConditionInfo + string.Format("{0},{1},{2},{3};", "leibie", leibie, leibieequal, leibieand); //else // sc.ConditionInfo = sc.ConditionInfo + string.Format("{0},{1},{2},{3};", "leibie", "", leibieequal, leibieand); if (!string.IsNullOrEmpty(shouquanid)) { if (shouquanidequal.Equals("=")) { if (shouquanidand.Equals("and")) { where = where.And(base_xiaoshou => base_xiaoshou.ShouquanID == int.Parse(shouquanid)); } else { where = where.Or(base_xiaoshou => base_xiaoshou.ShouquanID == int.Parse(shouquanid)); } } } if (!string.IsNullOrEmpty(shouquanid)) { sc.ConditionInfo = sc.ConditionInfo + string.Format("{0},{1},{2},{3};", "shouquanid", shouquanid, shouquanidequal, shouquanidand); } else { sc.ConditionInfo = sc.ConditionInfo + string.Format("{0},{1},{2},{3};", "shouquanid", "", shouquanidequal, shouquanidand); } if (!string.IsNullOrEmpty(xingming)) { if (xingmingequal.Equals("=")) { if (xingmingand.Equals("and")) { where = where.And(base_xiaoshou => base_xiaoshou.Xingming == xingming); } else { where = where.Or(base_xiaoshou => base_xiaoshou.Xingming == xingming); } } if (xingmingequal.Equals("like")) { if (xingmingand.Equals("and")) { where = where.And(base_xiaoshou => base_xiaoshou.Xingming.Contains(xingming)); } else { where = where.Or(base_xiaoshou => base_xiaoshou.Xingming.Contains(xingming)); } } } if (!string.IsNullOrEmpty(xingming)) { sc.ConditionInfo = sc.ConditionInfo + string.Format("{0},{1},{2},{3};", "xingming", xingming, xingmingequal, xingmingand); } else { sc.ConditionInfo = sc.ConditionInfo + string.Format("{0},{1},{2},{3};", "xingming", "", xingmingequal, xingmingand); } searchconditionService.GetInstance().AddEntity(sc); } else { sc.ConditionInfo = ""; if (!string.IsNullOrEmpty(shouquanid)) { if (shouquanidequal.Equals("=")) { if (shouquanidand.Equals("and")) { where = where.And(base_xiaoshou => base_xiaoshou.ShouquanID == int.Parse(shouquanid)); } else { where = where.Or(base_xiaoshou => base_xiaoshou.ShouquanID == int.Parse(shouquanid)); } } } if (!string.IsNullOrEmpty(shouquanid)) { sc.ConditionInfo = sc.ConditionInfo + string.Format("{0},{1},{2},{3};", "shouquanid", shouquanid, shouquanidequal, shouquanidand); } else { sc.ConditionInfo = sc.ConditionInfo + string.Format("{0},{1},{2},{3};", "shouquanid", shouquanid, shouquanidequal, shouquanidand); } if (!string.IsNullOrEmpty(xingming)) { if (xingmingequal.Equals("=")) { if (xingmingand.Equals("and")) { where = where.And(base_xiaoshou => base_xiaoshou.Xingming == xingming); } else { where = where.Or(base_xiaoshou => base_xiaoshou.Xingming == xingming); } } if (xingmingequal.Equals("like")) { if (xingmingand.Equals("and")) { where = where.And(base_xiaoshou => base_xiaoshou.Xingming.Contains(xingming)); } else { where = where.Or(base_xiaoshou => base_xiaoshou.Xingming.Contains(xingming)); } } } if (!string.IsNullOrEmpty(xingming)) { sc.ConditionInfo = sc.ConditionInfo + string.Format("{0},{1},{2},{3};", "xingming", xingming, xingmingequal, xingmingand); } else { sc.ConditionInfo = sc.ConditionInfo + string.Format("{0},{1},{2},{3};", "xingming", "", xingmingequal, xingmingand); } searchconditionService.GetInstance().UpdateEntity(sc); } ViewBag.SearchCondition = sc.ConditionInfo; where = where.And(base_xiaoshou => base_xiaoshou.IsDelete == false); var tempData = ob_base_xiaoshouservice.LoadSortEntities(where.Compile(), false, base_xiaoshou => base_xiaoshou.ID).ToPagedList <base_xiaoshou>(int.Parse(page), int.Parse(System.Web.Configuration.WebConfigurationManager.AppSettings["ShowPerPage"])); ViewBag.base_xiaoshou = tempData; return(View(tempData)); }
public ActionResult Index() { int userid = (int)Session["user_id"]; string pagetag = "base_gongyingshouquan_index"; string page = "1"; string gongyingshangid = Request["gongyingshangid"] ?? ""; string gongyingshangidequal = Request["gongyingshangidequal"] ?? ""; string gongyingshangidand = Request["gongyingshangidand"] ?? ""; Expression <Func <base_gongyingshouquan, bool> > where = PredicateExtensionses.True <base_gongyingshouquan>(); searchcondition sc = searchconditionService.GetInstance().GetEntityById(searchcondition => searchcondition.UserID == userid && searchcondition.PageBrief == pagetag); if (sc == null) { sc = new searchcondition(); sc.UserID = userid; sc.PageBrief = pagetag; //gongyingshangid if (!string.IsNullOrEmpty(gongyingshangid)) { if (gongyingshangidequal.Equals("=")) { if (gongyingshangidand.Equals("and")) { where = where.And(base_gongyingshouquan => base_gongyingshouquan.GongyingshangID == int.Parse(gongyingshangid)); } else { where = where.Or(base_gongyingshouquan => base_gongyingshouquan.GongyingshangID == int.Parse(gongyingshangid)); } } if (gongyingshangidequal.Equals(">")) { if (gongyingshangidand.Equals("and")) { where = where.And(base_gongyingshouquan => base_gongyingshouquan.GongyingshangID > int.Parse(gongyingshangid)); } else { where = where.Or(base_gongyingshouquan => base_gongyingshouquan.GongyingshangID > int.Parse(gongyingshangid)); } } if (gongyingshangidequal.Equals("<")) { if (gongyingshangidand.Equals("and")) { where = where.And(base_gongyingshouquan => base_gongyingshouquan.GongyingshangID < int.Parse(gongyingshangid)); } else { where = where.Or(base_gongyingshouquan => base_gongyingshouquan.GongyingshangID < int.Parse(gongyingshangid)); } } } if (!string.IsNullOrEmpty(gongyingshangid)) { sc.ConditionInfo = sc.ConditionInfo + string.Format("{0},{1},{2},{3};", "gongyingshangid", gongyingshangid, gongyingshangidequal, gongyingshangidand); } else { sc.ConditionInfo = sc.ConditionInfo + string.Format("{0},{1},{2},{3};", "gongyingshangid", "", gongyingshangidequal, gongyingshangidand); } searchconditionService.GetInstance().AddEntity(sc); } else { sc.ConditionInfo = ""; //gongyingshangid if (!string.IsNullOrEmpty(gongyingshangid)) { if (gongyingshangidequal.Equals("=")) { if (gongyingshangidand.Equals("and")) { where = where.And(base_gongyingshouquan => base_gongyingshouquan.GongyingshangID == int.Parse(gongyingshangid)); } else { where = where.Or(base_gongyingshouquan => base_gongyingshouquan.GongyingshangID == int.Parse(gongyingshangid)); } } if (gongyingshangidequal.Equals(">")) { if (gongyingshangidand.Equals("and")) { where = where.And(base_gongyingshouquan => base_gongyingshouquan.GongyingshangID > int.Parse(gongyingshangid)); } else { where = where.Or(base_gongyingshouquan => base_gongyingshouquan.GongyingshangID > int.Parse(gongyingshangid)); } } if (gongyingshangidequal.Equals("<")) { if (gongyingshangidand.Equals("and")) { where = where.And(base_gongyingshouquan => base_gongyingshouquan.GongyingshangID < int.Parse(gongyingshangid)); } else { where = where.Or(base_gongyingshouquan => base_gongyingshouquan.GongyingshangID < int.Parse(gongyingshangid)); } } } if (!string.IsNullOrEmpty(gongyingshangid)) { sc.ConditionInfo = sc.ConditionInfo + string.Format("{0},{1},{2},{3};", "gongyingshangid", gongyingshangid, gongyingshangidequal, gongyingshangidand); } else { sc.ConditionInfo = sc.ConditionInfo + string.Format("{0},{1},{2},{3};", "gongyingshangid", "", gongyingshangidequal, gongyingshangidand); } searchconditionService.GetInstance().UpdateEntity(sc); } ViewBag.SearchCondition = sc.ConditionInfo; where = where.And(base_gongyingshouquan => base_gongyingshouquan.IsDelete == false); var tempData = ob_base_gongyingshouquanservice.LoadSortEntities(where.Compile(), false, base_gongyingshouquan => base_gongyingshouquan.ID).ToPagedList <base_gongyingshouquan>(int.Parse(page), int.Parse(System.Web.Configuration.WebConfigurationManager.AppSettings["ShowPerPage"])); ViewBag.base_gongyingshouquan = tempData; return(View(tempData)); }
public ActionResult Index(string page) { if (string.IsNullOrEmpty(page)) { page = "1"; } int userid = (int)Session["user_id"]; string pagetag = "cust_chukujihua_index"; PageMenu.Set("Index", "cust_chukujihua", "客户服务"); Expression <Func <cust_chukujihua, bool> > where = PredicateExtensionses.True <cust_chukujihua>(); searchcondition sc = searchconditionService.GetInstance().GetEntityById(searchcondition => searchcondition.UserID == userid && searchcondition.PageBrief == pagetag); if (sc != null && sc.ConditionInfo != null) { string[] sclist = sc.ConditionInfo.Split(';'); foreach (string scl in sclist) { string[] scld = scl.Split(','); switch (scld[0]) { case "huozhuid": string huozhuid = scld[1]; string huozhuidequal = scld[2]; string huozhuidand = scld[3]; if (!string.IsNullOrEmpty(huozhuid)) { if (huozhuidequal.Equals("=")) { if (huozhuidand.Equals("and")) { where = where.And(p => p.HuozhuID == int.Parse(huozhuid)); } else { where = where.Or(p => p.HuozhuID == int.Parse(huozhuid)); } } } break; case "KehuMC": string KehuMC = scld[1]; string KehuMCequal = scld[2]; string KehuMCand = scld[3]; if (!string.IsNullOrEmpty(KehuMC)) { if (KehuMCequal.Equals("=")) { if (KehuMCand.Equals("and")) { where = where.And(p => p.KehuMC == KehuMC); } else { where = where.Or(p => p.KehuMC == KehuMC); } } if (KehuMCequal.Equals("like")) { if (KehuMCand.Equals("and")) { where = where.And(p => p.KehuMC.Contains(KehuMC)); } else { where = where.Or(p => p.KehuMC.Contains(KehuMC)); } } } break; case "KehuDH": string KehuDH = scld[1]; string KehuDHequal = scld[2]; string KehuDHand = scld[3]; if (!string.IsNullOrEmpty(KehuDH)) { if (KehuDHequal.Equals("=")) { if (KehuDHand.Equals("and")) { where = where.And(p => p.KehuDH == KehuDH); } else { where = where.Or(p => p.KehuDH == KehuDH); } } if (KehuDHequal.Equals("like")) { if (KehuDHand.Equals("and")) { where = where.And(p => p.KehuDH.Contains(KehuDH)); } else { where = where.Or(p => p.KehuDH.Contains(KehuDH)); } } } break; case "makedate": string makedate = scld[1]; string makedateequal = scld[2]; string makedateand = scld[3]; if (!string.IsNullOrEmpty(makedate)) { if (makedateequal.Equals("=")) { if (makedateand.Equals("and")) { where = where.And(p => p.MakeDate.ToString("yyyy-MM-dd") == makedate); } else { where = where.Or(p => p.MakeDate.ToString("yyyy-MM-dd") == makedate); } } if (makedateequal.Equals(">")) { if (makedateand.Equals("and")) { where = where.And(p => p.MakeDate > DateTime.Parse(makedate)); } else { where = where.Or(p => p.MakeDate > DateTime.Parse(makedate)); } } if (makedateequal.Equals("<")) { if (makedateand.Equals("and")) { where = where.And(p => p.MakeDate < DateTime.Parse(makedate)); } else { where = where.Or(p => p.MakeDate < DateTime.Parse(makedate)); } } } break; default: break; } } ViewBag.SearchCondition = sc.ConditionInfo; } userinfo _user = ServiceFactory.userinfoservice.GetEntityById(p => p.ID == userid && p.IsDelete == false); if (_user == null) { where = where.And(p => p.ID < 1); } else { switch (_user.AccountType) { case 100: where = where.And(p => p.HuozhuID == _user.EmployeeID && p.IsDelete == false); break; case 200: where = where.And(p => p.ID < 1); break; case 300: where = where.And(p => p.KefuID == _user.EmployeeID && p.IsDelete == false); break; case 0: default: where = where.And(cust_chukujihua => cust_chukujihua.IsDelete == false); break; } } //where = where.And(cust_chukujihua => cust_chukujihua.IsDelete == false); var tempData = ob_cust_chukujihuaservice.LoadSortEntities(where.Compile(), true, cust_chukujihua => cust_chukujihua.JihuaZT).ToPagedList <cust_chukujihua>(int.Parse(page), int.Parse(System.Web.Configuration.WebConfigurationManager.AppSettings["ShowPerPage"])); ViewBag.cust_chukujihua = tempData; ViewBag.usertype = _user.AccountType; return(View(tempData)); }
public ActionResult Index(string page) { if (string.IsNullOrEmpty(page)) { page = "1"; } int userid = (int)Session["user_id"]; string pagetag = "quan_rukuys_index"; PageMenu.Set("Index", "quan_rukuys", "质量管理"); Expression <Func <quan_inrec_v, bool> > where = PredicateExtensionses.True <quan_inrec_v>(); searchcondition sc = searchconditionService.GetInstance().GetEntityById(searchcondition => searchcondition.UserID == userid && searchcondition.PageBrief == pagetag); if (sc != null && sc.ConditionInfo != null) { string[] sclist = sc.ConditionInfo.Split(';'); foreach (string scl in sclist) { string[] scld = scl.Split(','); switch (scld[0]) { case "rukudanbh": string rukudanbh = scld[1]; string rukudanbhequal = scld[2]; string rukudanbhand = scld[3]; if (!string.IsNullOrEmpty(rukudanbh)) { if (rukudanbhequal.Equals("=")) { if (rukudanbhand.Equals("and")) { where = where.And(p => p.RukudanBH == rukudanbh); } else { where = where.Or(p => p.RukudanBH == rukudanbh); } } if (rukudanbhequal.Equals("like")) { if (rukudanbhand.Equals("and")) { where = where.And(p => p.RukudanBH.Contains(rukudanbh)); } else { where = where.Or(p => p.RukudanBH.Contains(rukudanbh)); } } } break; default: break; } } ViewBag.SearchCondition = sc.ConditionInfo; } where = where.And(p => p.IsDelete == false); var tempData = ob_quan_rukuysservice.GetInrec(where.Compile()).ToPagedList <quan_inrec_v>(int.Parse(page), int.Parse(System.Web.Configuration.WebConfigurationManager.AppSettings["ShowPerPage"])); ViewBag.quan_inrec = tempData; return(View(tempData)); }
public ActionResult Index(string page) { if (string.IsNullOrEmpty(page)) { page = "1"; } int userid = (int)Session["user_id"]; string pagetag = "rmd_myreminder_index"; PageMenu.Set("Index", "rmd_myreminder", "信息提醒"); Expression <Func <rmd_myreminder, bool> > where = PredicateExtensionses.True <rmd_myreminder>(); searchcondition sc = searchconditionService.GetInstance().GetEntityById(searchcondition => searchcondition.UserID == userid && searchcondition.PageBrief == pagetag); if (sc != null && sc.ConditionInfo != null) { string[] sclist = sc.ConditionInfo.Split(';'); foreach (string scl in sclist) { string[] scld = scl.Split(','); switch (scld[0]) { case "yonghuid": string yonghuid = scld[1]; string yonghuidequal = scld[2]; string yonghuidand = scld[3]; if (!string.IsNullOrEmpty(yonghuid)) { if (yonghuidequal.Equals("=")) { if (yonghuidand.Equals("and")) { where = where.And(rmd_myreminder => rmd_myreminder.YonghuID == int.Parse(yonghuid)); } else { where = where.Or(rmd_myreminder => rmd_myreminder.YonghuID == int.Parse(yonghuid)); } } if (yonghuidequal.Equals(">")) { if (yonghuidand.Equals("and")) { where = where.And(rmd_myreminder => rmd_myreminder.YonghuID > int.Parse(yonghuid)); } else { where = where.Or(rmd_myreminder => rmd_myreminder.YonghuID > int.Parse(yonghuid)); } } if (yonghuidequal.Equals("<")) { if (yonghuidand.Equals("and")) { where = where.And(rmd_myreminder => rmd_myreminder.YonghuID < int.Parse(yonghuid)); } else { where = where.Or(rmd_myreminder => rmd_myreminder.YonghuID < int.Parse(yonghuid)); } } } break; default: break; } } ViewBag.SearchCondition = sc.ConditionInfo; } where = where.And(rmd_myreminder => rmd_myreminder.IsDelete == false); var tempData = ob_rmd_myreminderservice.LoadSortEntities(where.Compile(), false, rmd_myreminder => rmd_myreminder.ID).ToPagedList <rmd_myreminder>(int.Parse(page), int.Parse(System.Web.Configuration.WebConfigurationManager.AppSettings["ShowPerPage"])); ViewBag.rmd_myreminder = tempData; return(View(tempData)); }
public ActionResult Index() { int userid = (int)Session["user_id"]; string pagetag = "quan_rukuys_index"; string page = "1"; //rukudanbh string rukudanbh = Request["rukudanbh"] ?? ""; string rukudanbhequal = Request["rukudanbhequal"] ?? ""; string rukudanbhand = Request["rukudanbhand"] ?? ""; PageMenu.Set("Index", "quan_rukuys", "质量管理"); Expression <Func <quan_inrec_v, bool> > where = PredicateExtensionses.True <quan_inrec_v>(); searchcondition sc = searchconditionService.GetInstance().GetEntityById(searchcondition => searchcondition.UserID == userid && searchcondition.PageBrief == pagetag); if (sc == null) { sc = new searchcondition(); sc.UserID = userid; sc.PageBrief = pagetag; if (!string.IsNullOrEmpty(rukudanbh)) { if (rukudanbhequal.Equals("=")) { if (rukudanbhand.Equals("and")) { where = where.And(p => p.RukudanBH == rukudanbh); } else { where = where.Or(p => p.RukudanBH == rukudanbh); } } if (rukudanbhequal.Equals("like")) { if (rukudanbhand.Equals("and")) { where = where.And(p => p.RukudanBH.Contains(rukudanbh)); } else { where = where.Or(p => p.RukudanBH.Contains(rukudanbh)); } } } if (!string.IsNullOrEmpty(rukudanbh)) { sc.ConditionInfo = sc.ConditionInfo + string.Format("{0},{1},{2},{3};", "rukudanbh", rukudanbh, rukudanbhequal, rukudanbhand); } else { sc.ConditionInfo = sc.ConditionInfo + string.Format("{0},{1},{2},{3};", "rukudanbh", "", rukudanbhequal, rukudanbhand); } searchconditionService.GetInstance().AddEntity(sc); } else { sc.ConditionInfo = ""; if (!string.IsNullOrEmpty(rukudanbh)) { if (rukudanbhequal.Equals("=")) { if (rukudanbhand.Equals("and")) { where = where.And(p => p.RukudanBH == rukudanbh); } else { where = where.Or(p => p.RukudanBH == rukudanbh); } } if (rukudanbhequal.Equals("like")) { if (rukudanbhand.Equals("and")) { where = where.And(p => p.RukudanBH.Contains(rukudanbh)); } else { where = where.Or(p => p.RukudanBH.Contains(rukudanbh)); } } } if (!string.IsNullOrEmpty(rukudanbh)) { sc.ConditionInfo = sc.ConditionInfo + string.Format("{0},{1},{2},{3};", "rukudanbh", rukudanbh, rukudanbhequal, rukudanbhand); } else { sc.ConditionInfo = sc.ConditionInfo + string.Format("{0},{1},{2},{3};", "rukudanbh", "", rukudanbhequal, rukudanbhand); } searchconditionService.GetInstance().UpdateEntity(sc); } where = where.And(p => p.IsDelete == false); ViewBag.SearchCondition = sc.ConditionInfo; var tempData = ob_quan_rukuysservice.GetInrec(where.Compile()).ToPagedList <quan_inrec_v>(int.Parse(page), int.Parse(System.Web.Configuration.WebConfigurationManager.AppSettings["ShowPerPage"])); ViewBag.quan_inrec = tempData; return(View(tempData)); }
public ActionResult Index() { int userid = (int)Session["user_id"]; string pagetag = "cfda_inhistory_index"; string page = "1"; //CPMC string CPMC = Request["CPMC"] ?? ""; string CPMCequal = Request["CPMCequal"] ?? ""; string CPMCand = Request["CPMCand"] ?? ""; //GGXH string GGXH = Request["GGXH"] ?? ""; string GGXHequal = Request["GGXHequal"] ?? ""; string GGXHand = Request["GGXHand"] ?? ""; //SCPH string SCPH = Request["SCPH"] ?? ""; string SCPHequal = Request["SCPHequal"] ?? ""; string SCPHand = Request["SCPHand"] ?? ""; Expression <Func <cfda_inhistory, bool> > where = PredicateExtensionses.True <cfda_inhistory>(); searchcondition sc = searchconditionService.GetInstance().GetEntityById(searchcondition => searchcondition.UserID == userid && searchcondition.PageBrief == pagetag); if (sc == null) { sc = new searchcondition(); sc.UserID = userid; sc.PageBrief = pagetag; //CPMC if (!string.IsNullOrEmpty(CPMC)) { if (CPMCequal.Equals("=")) { if (CPMCand.Equals("and")) { where = where.And(p => p.CPMC == CPMC.Trim()); } else { where = where.Or(p => p.CPMC == CPMC.Trim()); } } if (CPMCequal.Equals("like")) { if (CPMCand.Equals("and")) { where = where.And(p => p.CPMC.Contains(CPMC.Trim())); } else { where = where.Or(p => p.CPMC.Contains(CPMC.Trim())); } } } if (!string.IsNullOrEmpty(CPMC)) { sc.ConditionInfo = sc.ConditionInfo + string.Format("{0},{1},{2},{3};", "CPMC", CPMC, CPMCequal, CPMCand); } else { sc.ConditionInfo = sc.ConditionInfo + string.Format("{0},{1},{2},{3};", "CPMC", "", CPMCequal, CPMCand); } //GGXH if (!string.IsNullOrEmpty(GGXH)) { if (GGXHequal.Equals("=")) { if (GGXHand.Equals("and")) { where = where.And(p => p.GGXH == GGXH.Trim()); } else { where = where.Or(p => p.GGXH == GGXH.Trim()); } } if (GGXHequal.Equals("like")) { if (GGXHand.Equals("and")) { where = where.And(p => p.GGXH.Contains(GGXH.Trim())); } else { where = where.Or(p => p.GGXH.Contains(GGXH.Trim())); } } } if (!string.IsNullOrEmpty(GGXH)) { sc.ConditionInfo = sc.ConditionInfo + string.Format("{0},{1},{2},{3};", "GGXH", GGXH, GGXHequal, GGXHand); } else { sc.ConditionInfo = sc.ConditionInfo + string.Format("{0},{1},{2},{3};", "GGXH", "", GGXHequal, GGXHand); } //SCPH if (!string.IsNullOrEmpty(SCPH)) { if (SCPHequal.Equals("=")) { if (SCPHand.Equals("and")) { where = where.And(p => p.SCPH == SCPH.Trim()); } else { where = where.Or(p => p.SCPH == SCPH.Trim()); } } if (SCPHequal.Equals("like")) { if (SCPHand.Equals("and")) { where = where.And(p => p.SCPH.Contains(SCPH.Trim())); } else { where = where.Or(p => p.SCPH.Contains(SCPH.Trim())); } } } if (!string.IsNullOrEmpty(SCPH)) { sc.ConditionInfo = sc.ConditionInfo + string.Format("{0},{1},{2},{3};", "SCPH", SCPH, SCPHequal, SCPHand); } else { sc.ConditionInfo = sc.ConditionInfo + string.Format("{0},{1},{2},{3};", "SCPH", "", SCPHequal, SCPHand); } searchconditionService.GetInstance().AddEntity(sc); } else { sc.ConditionInfo = ""; if (!string.IsNullOrEmpty(CPMC)) { if (CPMCequal.Equals("=")) { if (CPMCand.Equals("and")) { where = where.And(p => p.CPMC == CPMC.Trim()); } else { where = where.Or(p => p.CPMC == CPMC.Trim()); } } if (CPMCequal.Equals("like")) { if (CPMCand.Equals("and")) { where = where.And(p => p.CPMC.Contains(CPMC.Trim())); } else { where = where.Or(p => p.CPMC.Contains(CPMC.Trim())); } } } if (!string.IsNullOrEmpty(CPMC)) { sc.ConditionInfo = sc.ConditionInfo + string.Format("{0},{1},{2},{3};", "CPMC", CPMC, CPMCequal, CPMCand); } else { sc.ConditionInfo = sc.ConditionInfo + string.Format("{0},{1},{2},{3};", "CPMC", "", CPMCequal, CPMCand); } //GGXH if (!string.IsNullOrEmpty(GGXH)) { if (GGXHequal.Equals("=")) { if (GGXHand.Equals("and")) { where = where.And(p => p.GGXH == GGXH.Trim()); } else { where = where.Or(p => p.GGXH == GGXH.Trim()); } } if (GGXHequal.Equals("like")) { if (GGXHand.Equals("and")) { where = where.And(p => p.GGXH.Contains(GGXH.Trim())); } else { where = where.Or(p => p.GGXH.Contains(GGXH.Trim())); } } } if (!string.IsNullOrEmpty(GGXH)) { sc.ConditionInfo = sc.ConditionInfo + string.Format("{0},{1},{2},{3};", "GGXH", GGXH, GGXHequal, GGXHand); } else { sc.ConditionInfo = sc.ConditionInfo + string.Format("{0},{1},{2},{3};", "GGXH", "", GGXHequal, GGXHand); } //SCPH if (!string.IsNullOrEmpty(SCPH)) { if (SCPHequal.Equals("=")) { if (SCPHand.Equals("and")) { where = where.And(p => p.SCPH == SCPH.Trim()); } else { where = where.Or(p => p.SCPH == SCPH.Trim()); } } if (SCPHequal.Equals("like")) { if (SCPHand.Equals("and")) { where = where.And(p => p.SCPH.Contains(SCPH.Trim())); } else { where = where.Or(p => p.SCPH.Contains(SCPH.Trim())); } } } if (!string.IsNullOrEmpty(SCPH)) { sc.ConditionInfo = sc.ConditionInfo + string.Format("{0},{1},{2},{3};", "SCPH", SCPH, SCPHequal, SCPHand); } else { sc.ConditionInfo = sc.ConditionInfo + string.Format("{0},{1},{2},{3};", "SCPH", "", SCPHequal, SCPHand); } searchconditionService.GetInstance().UpdateEntity(sc); } ViewBag.SearchCondition = sc.ConditionInfo; where = where.And(cfda_inhistory => cfda_inhistory.IsDelete == false); var tempData = ob_cfda_inhistoryservice.LoadSortEntities(where.Compile(), false, cfda_inhistory => cfda_inhistory.ID).ToPagedList <cfda_inhistory>(int.Parse(page), int.Parse(System.Web.Configuration.WebConfigurationManager.AppSettings["ShowPerPage"])); ViewBag.cfda_inhistory = tempData; return(View(tempData)); }
public ActionResult Index(/*string sortOrder,*/ string page, string sortOrder) { if (string.IsNullOrEmpty(page)) { page = "1"; } //Expression<Func<base_gongyingshang, bool>> where = PredicateExtensionses.True<base_gongyingshang>(); int userid = (int)Session["user_id"]; string pagetag = "base_gongyingshang_index"; PageMenu.Set("Index", "base_gongyingshang", "基础数据"); Expression <Func <base_gongyingshang, bool> > where = PredicateExtensionses.True <base_gongyingshang>(); searchcondition sc = searchconditionService.GetInstance().GetEntityById(searchcondition => searchcondition.UserID == userid && searchcondition.PageBrief == pagetag); if (sc != null) { string[] sclist = sc.ConditionInfo.Split(';'); foreach (string scl in sclist) { string[] scld = scl.Split(','); switch (scld[0]) { case "daima": string daima = scld[1]; string daimaequal = scld[2]; string daimaand = scld[3]; if (!string.IsNullOrEmpty(daima)) { if (daimaequal.Equals("=")) { if (daimaand.Equals("and")) { where = where.And(base_gongyingshang => base_gongyingshang.Daima == daima); } else { where = where.Or(base_gongyingshang => base_gongyingshang.Daima == daima); } } if (daimaequal.Equals("like")) { if (daimaand.Equals("and")) { where = where.And(base_gongyingshang => base_gongyingshang.Daima.Contains(daima)); } else { where = where.Or(base_gongyingshang => base_gongyingshang.Daima.Contains(daima)); } } } break; case "mingcheng": string mingcheng = scld[1]; string mingchengequal = scld[2]; string mingchengand = scld[3]; if (!string.IsNullOrEmpty(mingcheng)) { if (mingchengequal.Equals("=")) { if (mingchengand.Equals("and")) { where = where.And(base_gongyingshang => base_gongyingshang.Mingcheng == mingcheng); } else { where = where.Or(base_gongyingshang => base_gongyingshang.Mingcheng == mingcheng); } } if (mingchengequal.Equals("like")) { if (mingchengand.Equals("and")) { where = where.And(base_gongyingshang => base_gongyingshang.Mingcheng.Contains(mingcheng)); } else { where = where.Or(base_gongyingshang => base_gongyingshang.Mingcheng.Contains(mingcheng)); } } } break; default: break; } } ViewBag.SearchCondition = sc.ConditionInfo; } where = where.And(base_gongyingshang => base_gongyingshang.IsDelete == false); //ViewBag.DaimaSortParm = sortOrder == "daima" ? "daima_desc" : "daima"; //ViewBag.NameSortParm = sortOrder == "name" ? "name_desc" : "name"; //ViewBag.YyzzSortParm = sortOrder == "Yyzz" ? "Yyzz_desc" : "Yyzz"; //ViewBag.YyzzyxqSortParm = sortOrder == "Yyzzyxq" ? "Yyzzyxq_desc" : "Yyzzyxq"; //ViewBag.YyzztpSortParm = sortOrder == "Yyzztp" ? "Yyzztp_desc" : "Yyzztp"; //ViewBag.JyxkSortParm = sortOrder == "Jyxk" ? "Jyxk_desc" : "Jyxk"; //ViewBag.JyxkyxqSortParm = sortOrder == "Jyxkyxq" ? "Jyxkyxq_desc" : "Jyxkyxq"; //ViewBag.JyxktpSortParm = sortOrder == "Jyxktp" ? "Jyxktp_desc" : "Jyxktp"; //switch (sortOrder) //{ // case "daima": // var tempData = ob_base_gongyingshangservice.LoadSortEntities(where.Compile(), true, base_gongyingshang => base_gongyingshang.Daima).ToPagedList<base_gongyingshang>(int.Parse(page), int.Parse(System.Web.Configuration.WebConfigurationManager.AppSettings["ShowPerPage"])); // ViewBag.base_gongyingshang = tempData; // return View(tempData); // case "daima_desc": // tempData = ob_base_gongyingshangservice.LoadSortEntities(where.Compile(), false, base_gongyingshang => base_gongyingshang.Daima).ToPagedList<base_gongyingshang>(int.Parse(page), int.Parse(System.Web.Configuration.WebConfigurationManager.AppSettings["ShowPerPage"])); // ViewBag.base_gongyingshang = tempData; // return View(tempData); // case "name": // tempData = ob_base_gongyingshangservice.LoadSortEntities(where.Compile(), true, base_gongyingshang => base_gongyingshang.Mingcheng).ToPagedList<base_gongyingshang>(int.Parse(page), int.Parse(System.Web.Configuration.WebConfigurationManager.AppSettings["ShowPerPage"])); // ViewBag.base_gongyingshang = tempData; // return View(tempData); // case "name_desc": // tempData = ob_base_gongyingshangservice.LoadSortEntities(where.Compile(), false, base_gongyingshang => base_gongyingshang.Mingcheng).ToPagedList<base_gongyingshang>(int.Parse(page), int.Parse(System.Web.Configuration.WebConfigurationManager.AppSettings["ShowPerPage"])); // ViewBag.base_gongyingshang = tempData; // return View(tempData); // case "Yyzz": // tempData = ob_base_gongyingshangservice.LoadSortEntities(where.Compile(), true, base_gongyingshang => base_gongyingshang.YingyezhizhaoBH).ToPagedList<base_gongyingshang>(int.Parse(page), int.Parse(System.Web.Configuration.WebConfigurationManager.AppSettings["ShowPerPage"])); // ViewBag.base_gongyingshang = tempData; // return View(tempData); // case "Yyzz_desc": // tempData = ob_base_gongyingshangservice.LoadSortEntities(where.Compile(), false, base_gongyingshang => base_gongyingshang.YingyezhizhaoBH).ToPagedList<base_gongyingshang>(int.Parse(page), int.Parse(System.Web.Configuration.WebConfigurationManager.AppSettings["ShowPerPage"])); // ViewBag.base_gongyingshang = tempData; // return View(tempData); // case "Yyzzyxq": // tempData = ob_base_gongyingshangservice.LoadSortEntities(where.Compile(), true, base_gongyingshang => base_gongyingshang.YingyezhizhaoYXQ).ToPagedList<base_gongyingshang>(int.Parse(page), int.Parse(System.Web.Configuration.WebConfigurationManager.AppSettings["ShowPerPage"])); // ViewBag.base_gongyingshang = tempData; // return View(tempData); // case "Yyzzyxq_desc": // tempData = ob_base_gongyingshangservice.LoadSortEntities(where.Compile(), false, base_gongyingshang => base_gongyingshang.YingyezhizhaoYXQ).ToPagedList<base_gongyingshang>(int.Parse(page), int.Parse(System.Web.Configuration.WebConfigurationManager.AppSettings["ShowPerPage"])); // ViewBag.base_gongyingshang = tempData; // return View(tempData); // case "Yyzztp": // tempData = ob_base_gongyingshangservice.LoadSortEntities(where.Compile(), true, base_gongyingshang => base_gongyingshang.YingyezhizhaoTP).ToPagedList<base_gongyingshang>(int.Parse(page), int.Parse(System.Web.Configuration.WebConfigurationManager.AppSettings["ShowPerPage"])); // ViewBag.base_gongyingshang = tempData; // return View(tempData); // case "Yyzztp_desc": // tempData = ob_base_gongyingshangservice.LoadSortEntities(where.Compile(), false, base_gongyingshang => base_gongyingshang.YingyezhizhaoTP).ToPagedList<base_gongyingshang>(int.Parse(page), int.Parse(System.Web.Configuration.WebConfigurationManager.AppSettings["ShowPerPage"])); // ViewBag.base_gongyingshang = tempData; // return View(tempData); // case "Jyxk": // tempData = ob_base_gongyingshangservice.LoadSortEntities(where.Compile(), true, base_gongyingshang => base_gongyingshang.JingyingxukeBH).ToPagedList<base_gongyingshang>(int.Parse(page), int.Parse(System.Web.Configuration.WebConfigurationManager.AppSettings["ShowPerPage"])); // ViewBag.base_gongyingshang = tempData; // return View(tempData); // case "Jyxk_desc": // tempData = ob_base_gongyingshangservice.LoadSortEntities(where.Compile(), false, base_gongyingshang => base_gongyingshang.JingyingxukeBH).ToPagedList<base_gongyingshang>(int.Parse(page), int.Parse(System.Web.Configuration.WebConfigurationManager.AppSettings["ShowPerPage"])); // ViewBag.base_gongyingshang = tempData; // return View(tempData); // case "Jyxkyxq": // tempData = ob_base_gongyingshangservice.LoadSortEntities(where.Compile(), true, base_gongyingshang => base_gongyingshang.JingyingxukeYXQ).ToPagedList<base_gongyingshang>(int.Parse(page), int.Parse(System.Web.Configuration.WebConfigurationManager.AppSettings["ShowPerPage"])); // ViewBag.base_gongyingshang = tempData; // return View(tempData); // case "Jyxkyxq_desc": // tempData = ob_base_gongyingshangservice.LoadSortEntities(where.Compile(), false, base_gongyingshang => base_gongyingshang.JingyingxukeYXQ).ToPagedList<base_gongyingshang>(int.Parse(page), int.Parse(System.Web.Configuration.WebConfigurationManager.AppSettings["ShowPerPage"])); // ViewBag.base_gongyingshang = tempData; // return View(tempData); // case "Jyxktp": // tempData = ob_base_gongyingshangservice.LoadSortEntities(where.Compile(), true, base_gongyingshang => base_gongyingshang.JingyingxukeTP).ToPagedList<base_gongyingshang>(int.Parse(page), int.Parse(System.Web.Configuration.WebConfigurationManager.AppSettings["ShowPerPage"])); // ViewBag.base_gongyingshang = tempData; // return View(tempData); // case "Jyxktp_desc": // tempData = ob_base_gongyingshangservice.LoadSortEntities(where.Compile(), false, base_gongyingshang => base_gongyingshang.JingyingxukeTP).ToPagedList<base_gongyingshang>(int.Parse(page), int.Parse(System.Web.Configuration.WebConfigurationManager.AppSettings["ShowPerPage"])); // ViewBag.base_gongyingshang = tempData; // return View(tempData); // default: // tempData = ob_base_gongyingshangservice.LoadSortEntities(where.Compile(), false, base_gongyingshang => base_gongyingshang.ID).ToPagedList<base_gongyingshang>(int.Parse(page), int.Parse(System.Web.Configuration.WebConfigurationManager.AppSettings["ShowPerPage"])); // ViewBag.base_gongyingshang = tempData; // return View(tempData); //} var tempData = ob_base_gongyingshangservice.LoadSortEntities(where.Compile(), false, base_gongyingshang => base_gongyingshang.ID).ToPagedList <base_gongyingshang>(int.Parse(page), int.Parse(System.Web.Configuration.WebConfigurationManager.AppSettings["ShowPerPage"])); ViewBag.base_gongyingshang = tempData; return(View(tempData)); //ViewBag.DaimaSortParm = String.IsNullOrEmpty(sortOrder) ? "daima_desc" : ""; //var gongyingshangs = from s in tempData // select s; //switch (sortOrder) //{ // case "daima_desc": // gongyingshangs = gongyingshangs.OrderByDescending(s => s.Daima); // break; // default: // gongyingshangs = gongyingshangs.OrderBy(s => s.Daima); // break; //} //return View(gongyingshangs.ToList()); }
public ActionResult inHistoryExport() { int userid = (int)Session["user_id"]; string pagetag = "cfda_inhistory_index"; Expression <Func <cfda_inhistory, bool> > where = PredicateExtensionses.True <cfda_inhistory>(); searchcondition sc = searchconditionService.GetInstance().GetEntityById(searchcondition => searchcondition.UserID == userid && searchcondition.PageBrief == pagetag); if (sc != null && sc.ConditionInfo != null) { string[] sclist = sc.ConditionInfo.Split(';'); foreach (string scl in sclist) { string[] scld = scl.Split(','); switch (scld[0]) { case "CPMC": string CPMC = scld[1]; string CPMCequal = scld[2]; string CPMCand = scld[3]; if (!string.IsNullOrEmpty(CPMC)) { if (CPMCequal.Equals("=")) { if (CPMCand.Equals("and")) { where = where.And(p => p.CPMC == CPMC.Trim()); } else { where = where.Or(p => p.CPMC == CPMC.Trim()); } } if (CPMCequal.Equals("like")) { if (CPMCand.Equals("and")) { where = where.And(p => p.CPMC.Contains(CPMC.Trim())); } else { where = where.Or(p => p.CPMC.Contains(CPMC.Trim())); } } } break; case "GGXH": string GGXH = scld[1]; string GGXHequal = scld[2]; string GGXHand = scld[3]; if (!string.IsNullOrEmpty(GGXH)) { if (GGXHequal.Equals("=")) { if (GGXHand.Equals("and")) { where = where.And(p => p.GGXH == GGXH.Trim()); } else { where = where.Or(p => p.GGXH == GGXH.Trim()); } } if (GGXHequal.Equals("like")) { if (GGXHand.Equals("and")) { where = where.And(p => p.GGXH.Contains(GGXH.Trim())); } else { where = where.Or(p => p.GGXH.Contains(GGXH.Trim())); } } } break; case "SCPH": string SCPH = scld[1]; string SCPHequal = scld[2]; string SCPHand = scld[3]; if (!string.IsNullOrEmpty(SCPH)) { if (SCPHequal.Equals("=")) { if (SCPHand.Equals("and")) { where = where.And(p => p.SCPH == SCPH.Trim()); } else { where = where.Or(p => p.SCPH == SCPH.Trim()); } } if (SCPHequal.Equals("like")) { if (SCPHand.Equals("and")) { where = where.And(p => p.SCPH.Contains(SCPH.Trim())); } else { where = where.Or(p => p.SCPH.Contains(SCPH.Trim())); } } } break; default: break; } } ViewBag.SearchCondition = sc.ConditionInfo; } where = where.And(cfda_inhistory => cfda_inhistory.IsDelete == false); var tempData = ob_cfda_inhistoryservice.LoadSortEntities(where.Compile(), false, cfda_inhistory => cfda_inhistory.ID); ViewBag.cfda_inhistory = tempData; ViewData.Model = tempData; string viewHtml = ExportNow.RenderPartialViewToString(this, "inHistoryExport"); return(File(System.Text.Encoding.UTF8.GetBytes(viewHtml), "application/ms-excel", string.Format("inHistoryExport_{0}.xls", DateTime.Now.ToShortDateString()))); }
public ActionResult SupplierExport() { int userid = (int)Session["user_id"]; string pagetag = "base_gongyingshang_index"; Expression <Func <base_gongyingshang, bool> > where = PredicateExtensionses.True <base_gongyingshang>(); searchcondition sc = searchconditionService.GetInstance().GetEntityById(searchcondition => searchcondition.UserID == userid && searchcondition.PageBrief == pagetag); if (sc != null) { string[] sclist = sc.ConditionInfo.Split(';'); foreach (string scl in sclist) { string[] scld = scl.Split(','); switch (scld[0]) { case "daima": string daima = scld[1]; string daimaequal = scld[2]; string daimaand = scld[3]; if (!string.IsNullOrEmpty(daima)) { if (daimaequal.Equals("=")) { if (daimaand.Equals("and")) { where = where.And(base_gongyingshang => base_gongyingshang.Daima == daima); } else { where = where.Or(base_gongyingshang => base_gongyingshang.Daima == daima); } } if (daimaequal.Equals("like")) { if (daimaand.Equals("and")) { where = where.And(base_gongyingshang => base_gongyingshang.Daima.Contains(daima)); } else { where = where.Or(base_gongyingshang => base_gongyingshang.Daima.Contains(daima)); } } } break; case "mingcheng": string mingcheng = scld[1]; string mingchengequal = scld[2]; string mingchengand = scld[3]; if (!string.IsNullOrEmpty(mingcheng)) { if (mingchengequal.Equals("=")) { if (mingchengand.Equals("and")) { where = where.And(base_gongyingshang => base_gongyingshang.Mingcheng == mingcheng); } else { where = where.Or(base_gongyingshang => base_gongyingshang.Mingcheng == mingcheng); } } if (mingchengequal.Equals("like")) { if (mingchengand.Equals("and")) { where = where.And(base_gongyingshang => base_gongyingshang.Mingcheng.Contains(mingcheng)); } else { where = where.Or(base_gongyingshang => base_gongyingshang.Mingcheng.Contains(mingcheng)); } } } break; default: break; } } ViewBag.SearchCondition = sc.ConditionInfo; } where = where.And(base_gongyingshang => base_gongyingshang.IsDelete == false); var tempData = ob_base_gongyingshangservice.LoadSortEntities(where.Compile(), false, base_gongyingshang => base_gongyingshang.ID); ViewBag.supplier = tempData; ViewData.Model = tempData; string viewHtml = ExportNow.RenderPartialViewToString(this, "SupplierExport"); return(File(System.Text.Encoding.UTF8.GetBytes(viewHtml), "application/ms-excel", string.Format("SupplierInformation_{0}.xls", DateTime.Now.ToShortDateString()))); }