public static IEnumerable <TousuModel> SelectList(string dicValue, int showLevel, PagerModel pager, string orderType = "") { List <TousuModel> temptousulist; pager.TotalItem = GetTousuItemCount(dicValue, showLevel); IEnumerable <TousuModel> tousulist; if (string.IsNullOrWhiteSpace(dicValue)) { tousulist = tousuList; } else { tousulist = tousuList.Where(q => string.Equals(q.DicType, dicValue, StringComparison.OrdinalIgnoreCase)); } if (string.IsNullOrWhiteSpace(orderType)) { temptousulist = tousulist.Skip((pager.CurrentPage - 1) * pager.PageSize).Take(pager.PageSize).ToList(); } else { var ordertypetousuConfigList = DalTousuConfig.GetOrderTypeTousuConfig(orderType, dicValue); var checkedlasttousuNameList = ordertypetousuConfigList.Where(s => s.IsChecked == true).Select(p => p.LastLevelTousu).ToList(); var uncheckedtousuItemList = tousulist.Where(s => !checkedlasttousuNameList.Contains(s.DicValue)).ToList(); uncheckedtousuItemList.ForEach(p => { p.IsChecked = false; p.IsNeedPhoto = false; p.CautionText = string.Empty; p.GroupName = string.Empty; }); var checkedtousuItemList = tousulist.Where(s => checkedlasttousuNameList.Contains(s.DicValue)).ToList(); foreach (var checkedtousuItem in checkedtousuItemList) { var checkeditem = ordertypetousuConfigList.FirstOrDefault(q => string.Equals(q.LastLevelTousu, checkedtousuItem.DicValue, StringComparison.OrdinalIgnoreCase)); if (checkeditem != null) { checkedtousuItem.IsChecked = true; checkedtousuItem.CautionText = checkeditem.CautionText; checkedtousuItem.IsNeedPhoto = checkeditem.IsNeedPhoto; checkedtousuItem.GroupName = checkeditem.GroupName; } } //uncheckedtousuItemList.AddRange(checkedtousuItemList); checkedtousuItemList.AddRange(uncheckedtousuItemList); temptousulist = checkedtousuItemList.Skip((pager.CurrentPage - 1) * pager.PageSize).Take(pager.PageSize).ToList(); } switch (showLevel) { case 2: temptousulist = temptousulist.Where(p => p.HasThirdLevel == false).ToList(); break; case 3: temptousulist = temptousulist.Where(p => p.HasFourthLevel == false).ToList(); break; case 4: temptousulist = temptousulist.Where(p => p.HasFifthLevel == false).ToList(); break; } return(temptousulist); }
public JsonResult GetTopTousuNameList(string orderType) { var topTousuNameList = DalTousuConfig.GetTopTousuNameList(orderType); return(Json(topTousuNameList, JsonRequestBehavior.AllowGet)); }
public static DataTable GetTousuLog(string objectId, string objectType) { return(DalTousuConfig.GetTousuLog(objectId, objectType)); }
public static bool UpdateOrInsertOrderTypeTousuConfig(OrderTypeTousuConfig model) { return(DalTousuConfig.UpdateOrInsertOrderTypeTousuConfig(model)); }