public List <BusinessProgressDto> GetLaterMsg(BusinessSearchDto searchDto) { DateTime Today = DateTime.Parse(DateTime.Now.ToShortDateString().ToString()); IQueryable <BusinessProgressDto> list = this.db.BusinessProgresses.Where(b => (!string.IsNullOrEmpty(searchDto.OrderNo) ? b.PS == searchDto.OrderNo : true) && (!string.IsNullOrEmpty(searchDto.StyleNo) ? b.DT == searchDto.StyleNo : true) && (!string.IsNullOrEmpty(searchDto.ModelNo) ? b.Model == searchDto.ModelNo : true) && (!string.IsNullOrEmpty(searchDto.BrandNo) ? b.Brand.Contains(searchDto.BrandNo) : true) && (!string.IsNullOrEmpty(searchDto.OrderTypeNo) ? b.OrderType == searchDto.OrderTypeNo : true) && b.packShipState == 0 && b.PeopleDelivery < Today && b.PS != null && b.Quantity > 0).OrderBy(b => b.Id) .Select(b => new BusinessProgressDto { PS = b.PS, DT = b.DT, Model = b.Model, Material = b.Material, ProductName = b.ProductName, Lengths = b.Lengths, Quantity = b.Quantity, Delivery = b.Delivery, PersonGuest = b.PersonGuest, OrderType = b.OrderType, Brand = b.Brand, PeopleDelivery = b.PeopleDelivery, PeopleStyle = b.PeopleStyle, ShipType = b.ShipType, ononeIcomeState = b.ononeIcomeState == 1 ? "完成" : "未完成", packIcomeState = b.packIcomeState == 1 ? "完成" : "未完成", packShipState = b.packShipState == 1 ? "完成" : "未完成", }); return(list.ToList()); }
public easyuiFootGridDto <BusinessProgress, ProgressFootDto> GetListBySearch(string rows, string page, string doSearch, string AfterDates, string OrderNo, string StyleNo, string ModelNo, string BrandNo, string OrderTypeNo, string Finished) { var searchDto = new BusinessSearchDto { AfterDates = AfterDates, OrderNo = OrderNo, StyleNo = StyleNo, ModelNo = ModelNo, BrandNo = BrandNo, OrderTypeNo = OrderTypeNo, Finished = Finished }; return(this.repository.GetListBySearch(rows, page, doSearch, searchDto)); }
public easyuiFootGridDto <BusinessProgress, ProgressFootDto> GetTwoMonths(string rows, string page, string OrderNo, string StyleNo, string ModelNo, string BrandNo, string OrderTypeNo) { var searchDto = new BusinessSearchDto { OrderNo = OrderNo, StyleNo = StyleNo, ModelNo = ModelNo, BrandNo = BrandNo, OrderTypeNo = OrderTypeNo }; return(this.repository.GetTwoMonthsMsg(page, rows, searchDto)); }
public easyuiFootGridDto <BusinessProgress, ProgressFootDto> GetListBySearch(string rows, string page, string doSearch, BusinessSearchDto searchDto) { if (doSearch == "do") { int _page = int.Parse(page); int _rows = int.Parse(rows); DateTime beginDate = DateTime.Parse(DateTime.Now.ToShortDateString().ToString()); DateTime?endDate = null; if (!string.IsNullOrEmpty(searchDto.AfterDates)) { endDate = Convert.ToDateTime(DateTime.Now.AddDays(double.Parse(searchDto.AfterDates)).ToShortDateString().ToString()); } IQueryable <BusinessProgress> list = this.db.BusinessProgresses.Where(b => (!string.IsNullOrEmpty(searchDto.OrderNo) ? b.PS == searchDto.OrderNo : true) && (!string.IsNullOrEmpty(searchDto.StyleNo) ? b.DT == searchDto.StyleNo : true) && (!string.IsNullOrEmpty(searchDto.ModelNo) ? b.Model == searchDto.ModelNo : true) && (!string.IsNullOrEmpty(searchDto.BrandNo) ? b.Brand.Contains(searchDto.BrandNo) : true) && (!string.IsNullOrEmpty(searchDto.OrderTypeNo) ? b.OrderType == searchDto.OrderTypeNo : true) && (!string.IsNullOrEmpty(searchDto.AfterDates) ? b.PeopleDelivery >= beginDate : true) && (!string.IsNullOrEmpty(searchDto.AfterDates) ? b.PeopleDelivery <= endDate : true) //加入System.Data.Entity //&& (System.Data.Objects.SqlClient.SqlFunctions.DateDiff()) && (searchDto.Finished == "yes" ? true : b.packShipState == 0) && b.PS != null && b.Quantity > 0 ).OrderBy(g => g.Id); int?_total = list.Count(); var foot = new ProgressFootDto { PS = "数量合计:", DT = list.Sum(b => b.Quantity).ToString() }; var data = list .Skip((_page - 1) * _rows) .Take(_rows) .ToList(); //footer与formater之间的格式会冲突,即js中formater,不但格式化单元格内容,还会把footer中的数据格式化 return(new easyuiFootGridDto <BusinessProgress, ProgressFootDto> { total = _total, rows = data, footer = new List <ProgressFootDto> { foot } }); } else { return(new easyuiFootGridDto <BusinessProgress, ProgressFootDto> { total = 0, rows = this.GetAll().Where(b => b.Id == -1).OrderBy(b => b.PS).ToList(), footer = null }); } }
//public easyuiGridDto<BusinessProgress> GetMsgByDate(string page, string rows,DateTime beginDate,DateTime endDate, BusinessSearchDto searchDto) public easyuiFootGridDto <BusinessProgress, ProgressFootDto> GetMsgByDate(string page, string rows, DateTime beginDate, DateTime endDate, BusinessSearchDto searchDto) { int _page = int.Parse(page); int _rows = int.Parse(rows); IQueryable <BusinessProgress> list = this.db.BusinessProgresses.Where(b => (!string.IsNullOrEmpty(searchDto.OrderNo) ? b.PS == searchDto.OrderNo : true) && (!string.IsNullOrEmpty(searchDto.StyleNo) ? b.DT == searchDto.StyleNo : true) && (!string.IsNullOrEmpty(searchDto.ModelNo) ? b.Model == searchDto.ModelNo : true) && (!string.IsNullOrEmpty(searchDto.BrandNo) ? b.Brand.Contains(searchDto.BrandNo) : true) && (!string.IsNullOrEmpty(searchDto.OrderTypeNo) ? b.OrderType == searchDto.OrderTypeNo : true) && b.packShipState == 0 //&& (new int?[] { 0,-1}).Contains(System.Data.Objects.SqlClient.SqlFunctions.DateDiff("ww", (DateTime)b.PeopleDelivery, Today)) && b.PeopleDelivery >= beginDate && b.PeopleDelivery <= endDate && b.PS != null && b.Quantity > 0 ).OrderBy(b => b.Id); int?_total = list.Count(); var foot = new ProgressFootDto { PS = "数量合计:", DT = list.Sum(b => b.Quantity).ToString() }; var data = list.Skip((_page - 1) * _rows).Take(_rows).ToList(); return(new easyuiFootGridDto <BusinessProgress, ProgressFootDto> { total = _total, rows = data, footer = new List <ProgressFootDto> { foot } }); }
//public easyuiGridDto<BusinessProgress> GetLaterMsg(string page,string rows, BusinessSearchDto searchDto) public easyuiFootGridDto <BusinessProgress, ProgressFootDto> GetLaterMsg(string page, string rows, BusinessSearchDto searchDto) { int _page = int.Parse(page); int _rows = int.Parse(rows); DateTime Today = DateTime.Parse(DateTime.Now.ToShortDateString().ToString()); IQueryable <BusinessProgress> list = this.db.BusinessProgresses.Where(b => (!string.IsNullOrEmpty(searchDto.OrderNo) ? b.PS == searchDto.OrderNo : true) && (!string.IsNullOrEmpty(searchDto.StyleNo) ? b.DT == searchDto.StyleNo : true) && (!string.IsNullOrEmpty(searchDto.ModelNo) ? b.Model == searchDto.ModelNo : true) && (!string.IsNullOrEmpty(searchDto.BrandNo) ? b.Brand.Contains(searchDto.BrandNo) : true) && (!string.IsNullOrEmpty(searchDto.OrderTypeNo) ? b.OrderType == searchDto.OrderTypeNo : true) && b.packShipState == 0 && b.PeopleDelivery < Today && b.PS != null && b.Quantity > 0).OrderBy(b => b.Id); int?_total = list.Count(); var foot = new ProgressFootDto { PS = "数量合计:", DT = list.Sum(b => b.Quantity).ToString() }; var data = list.Skip((_page - 1) * _rows).Take(_rows).ToList(); return(new easyuiFootGridDto <BusinessProgress, ProgressFootDto> { total = _total, rows = data, footer = new List <ProgressFootDto> { foot } }); }
public easyuiFootGridDto <BusinessProgress, ProgressFootDto> GetTwoMonthsMsg(string page, string rows, BusinessSearchDto searchDto) { DateTime Today = DateTime.Parse(DateTime.Now.ToShortDateString().ToString()); DateTime startMonth = Today.AddDays(1 - Today.Day).AddMonths(2); //下二月第一天 DateTime endMonth = startMonth.AddMonths(1).AddDays(-1); //下二月月末 return(GetMsgByDate(page, rows, startMonth, endMonth, searchDto)); }
public easyuiFootGridDto <BusinessProgress, ProgressFootDto> GetTwoWeeksMsg(string page, string rows, BusinessSearchDto searchDto) { DateTime Today = DateTime.Parse(DateTime.Now.ToShortDateString().ToString()); DateTime startWeek = Today.AddDays(1 - Convert.ToInt32(Today.DayOfWeek.ToString("d"))); //本周周一 DateTime endWeek = startWeek.AddDays(13); //下周周日 return(GetMsgByDate(page, rows, startWeek, endWeek, searchDto)); }