public JsonResult GetHandSlideJson() { IEnumerable <HandSlideModel> array = from item in ServiceHelper.Create <ISlideAdsService>().GetHandSlidAds().ToArray() select new HandSlideModel() { Id = item.Id, Pic = item.ImageUrl, URL = item.Url, Index = item.DisplaySequence }; DataGridModel <HandSlideModel> dataGridModel = new DataGridModel <HandSlideModel>() { rows = array, total = array.Count() }; return(Json(dataGridModel)); }
public JsonResult List() { var shopG = _iShopService.GetShopGrades(); IEnumerable <ShopGradeModel> shopGs = shopG.ToArray().Select(item => new ShopGradeModel() { Id = item.Id, ChargeStandard = item.ChargeStandard, ImageLimit = item.ImageLimit, ProductLimit = item.ProductLimit, Name = item.Name, }); DataGridModel <ShopGradeModel> dataGrid = new DataGridModel <ShopGradeModel>() { rows = shopGs, total = shopG.Count() }; return(Json(dataGrid)); }
public JsonResult List(CapitalDetailInfo.CapitalDetailType capitalType, long userid, string startTime, string endTime, int page, int rows) { IMemberCapitalService memberCapitalService = ServiceHelper.Create <IMemberCapitalService>(); CapitalDetailQuery capitalDetailQuery = new CapitalDetailQuery() { memberId = userid, capitalType = new CapitalDetailInfo.CapitalDetailType?(capitalType), PageSize = rows, PageNo = page }; CapitalDetailQuery nullable = capitalDetailQuery; if (!string.IsNullOrWhiteSpace(startTime)) { nullable.startTime = new DateTime?(DateTime.Parse(startTime)); } if (!string.IsNullOrWhiteSpace(endTime)) { DateTime dateTime = DateTime.Parse(endTime).AddDays(1); nullable.endTime = new DateTime?(dateTime.AddSeconds(-1)); } PageModel <CapitalDetailInfo> capitalDetails = memberCapitalService.GetCapitalDetails(nullable); List <CapitalDetailModel> list = ( from e in capitalDetails.Models.ToList() select new CapitalDetailModel() { Id = e.Id, Amount = e.Amount, CapitalID = e.CapitalID, CreateTime = e.CreateTime.Value.ToString(), SourceData = e.SourceData, SourceType = e.SourceType, Remark = string.Concat(e.SourceType.ToDescription(), ",单号:", e.Id), PayWay = e.Remark }).ToList(); DataGridModel <CapitalDetailModel> dataGridModel = new DataGridModel <CapitalDetailModel>() { rows = list, total = capitalDetails.Total }; return(Json(dataGridModel)); }
public ActionResult GetData(int index, int size, string cname) { FlashSaleQuery query = new FlashSaleQuery { ItemName = cname, IsPreheat = true, PageNo = index, PageSize = size, AuditStatus = FlashSaleInfo.FlashSaleStatus.Ongoing, CheckProductStatus = true }; ObsoletePageModel <FlashSaleInfo> all = this._iLimitTimeBuyService.GetAll(query); List <FlashSaleModel> list = new List <FlashSaleModel>(); foreach (FlashSaleInfo info in all.Models.ToList <FlashSaleInfo>()) { FlashSaleModel item = new FlashSaleModel { Id = info.Id, Title = info.Title, ShopId = info.ShopId, ProductId = info.ProductId, Status = info.Status, ProductName = info.Himall_Products.ProductName, ProductImg = HimallIO.GetProductSizeImage(info.Himall_Products.RelativePath, 1, 0), MarketPrice = info.Himall_Products.MarketPrice, BeginDate = info.BeginDate.ToString("yyyy-MM-dd HH:mm"), EndDate = info.EndDate.ToString("yyyy-MM-dd HH:mm"), LimitCountOfThePeople = info.LimitCountOfThePeople, SaleCount = info.SaleCount, CategoryName = info.CategoryName, MinPrice = info.MinPrice }; list.Add(item); } DataGridModel <FlashSaleModel> data = new DataGridModel <FlashSaleModel> { total = all.Total, rows = list }; return(base.Json(data)); }
public JsonResult List(int?status, int page, int rows, string shopName, string title) { if (status == null) { status = 0; } ObsoletePageModel <FlashSaleInfo> result = _iLimitTimeBuyService.GetAll((int)status, shopName, title, page, rows); IEnumerable <FlashSaleModel> market = result.Models.ToArray().Select(item => { var m = new FlashSaleModel(); m.Id = item.Id; m.Title = item.Title; m.BeginDate = item.BeginDate.ToString("yyyy-MM-dd"); m.EndDate = item.EndDate.ToString("yyyy-MM-dd"); m.ShopName = item.Himall_Shops.ShopName; m.ProductName = item.Himall_Products.ProductName; m.ProductId = item.ProductId; //StatusStr = item.EndDate < DateTime.Now ?FlashSaleInfo.FlashSaleStatus.Ended.ToDescription() : item.Status.ToDescription() , m.StatusStr = item.Status.ToDescription(); if (item.Status != FlashSaleInfo.FlashSaleStatus.WaitForAuditing && item.Status != FlashSaleInfo.FlashSaleStatus.AuditFailed && item.BeginDate > DateTime.Now && item.EndDate < DateTime.Now) { m.StatusStr = "进行中"; } else if (item.Status != FlashSaleInfo.FlashSaleStatus.WaitForAuditing && item.Status != FlashSaleInfo.FlashSaleStatus.AuditFailed && item.BeginDate > DateTime.Now) { m.StatusStr = "未开始"; } m.SaleCount = item.SaleCount; return(m); }); DataGridModel <FlashSaleModel> dataGrid = new DataGridModel <FlashSaleModel>() { rows = market, total = result.Total }; return(Json(dataGrid)); }
public JsonResult List(Himall.Entities.CapitalDetailInfo.CapitalDetailType capitalType, long userid, string startTime, string endTime, int page, int rows) { var capitalService = _iMemberCapitalService; var query = new CapitalDetailQuery { memberId = userid, capitalType = capitalType, PageSize = rows, PageNo = page }; if (!string.IsNullOrWhiteSpace(startTime)) { query.startTime = DateTime.Parse(startTime); } if (!string.IsNullOrWhiteSpace(endTime)) { query.endTime = DateTime.Parse(endTime).AddDays(1).AddSeconds(-1); } var pageMode = capitalService.GetCapitalDetails(query); var model = pageMode.Models.ToList().Select(e => new CapitalDetailModel { Id = e.Id, Amount = e.Amount + e.PresentAmount, CapitalID = e.CapitalID, CreateTime = e.CreateTime.ToString(), SourceData = e.SourceData, SourceType = e.SourceType, Remark = GetCapitalRemark(e.SourceType, e.SourceData, e.Id.ToString(), e.Remark), PayWay = GetPayWay(e.SourceData, e.SourceType), PresentAmount = e.PresentAmount }).ToList(); var models = new DataGridModel <CapitalDetailModel> { rows = model, total = pageMode.Total }; return(Json(models)); }
private void btnReplace_Click(object sender, RoutedEventArgs e) { int valuesReplaced = 0; string findValue = txtFind.Text; string replaceValue = txtReplace.Text; List <DataGridModel> newValues = new List <DataGridModel>(); try { foreach (DataGridModel dgm in dataGridConfigValues.ItemsSource) { if (dgm.isSelected == true) { if (dgm.value.Contains(findValue)) { dgm.value = dgm.value.Replace(findValue, replaceValue); DataGridModel newDataGridModel = new DataGridModel(); newDataGridModel = dgm; newValues.Add(newDataGridModel); valuesReplaced += 1; } else { newValues.Add(dgm); } } else { newValues.Add(dgm); } } dataGridConfigValues.ItemsSource = newValues; dataGridConfigValues.Items.Refresh(); lblStatusMessage.Foreground = new SolidColorBrush(Colors.LightGreen); lblStatusMessage.Content = valuesReplaced + " values replaced."; } catch (Exception ex) { lblStatusMessage.Foreground = new SolidColorBrush(Colors.Red); lblStatusMessage.Content = ex.Message; } }
public JsonResult ListWithDraw(int page, int rows, string starttime, string endtime, int moneytype, long userid, int usertype) { Finance_WithDrawQuery fpq = new Finance_WithDrawQuery(); fpq.userid = userid; fpq.usertype = usertype; fpq.starttime = starttime; fpq.endtime = endtime; fpq.moneytype = moneytype; fpq.PageSize = rows; fpq.PageNo = page; PageModel <Finance_WithDraw> fp = ServiceHelper.Create <IFinance_WithDrawService>().GetFinance_WithDrawListInfo(fpq); IEnumerable <Finance_WithDraw> models = from item in fp.Models.ToArray() select new Finance_WithDraw() { Id = item.Id, Withdraw_Number = item.Withdraw_Number, Withdraw_UserId = item.Withdraw_UserId, Withdraw_UserName = ServiceHelper.Create <IMemberService>().GetMember(item.Withdraw_UserId) == null ? "" : ServiceHelper.Create <IMemberService>().GetMember(item.Withdraw_UserId).UserName, Withdraw_UserType = item.Withdraw_UserType, Withdraw_Money = item.Withdraw_Money, Withdraw_MoneyType = item.Withdraw_MoneyType, Withdraw_Account = item.Withdraw_Account, Withdraw_BankName = item.Withdraw_BankName, Withdraw_BankUserName = item.Withdraw_BankUserName, Withdraw_Time = item.Withdraw_Time, Withdraw_Status = item.Withdraw_Status, Withdraw_shenhe = item.Withdraw_shenhe, Withdraw_shenheUid = item.Withdraw_shenheUid, Withdraw_shenheUname = item.Withdraw_shenheUname, Withdraw_shenheDesc = item.Withdraw_shenheDesc, Withdraw_shenheTime = item.Withdraw_shenheTime }; DataGridModel <Finance_WithDraw> dataGridModel = new DataGridModel <Finance_WithDraw>() { rows = models, total = fp.Total }; return(Json(dataGridModel)); }
public JsonResult GetlimitTimeProducts(LimitTimeQuery query) { query.ShopId = this.CurrentShop.Id;//只取当前商家的限时购商品 var result = ObjectContainer.Current.Resolve <ILimitTimeBuyService>().GetFlashSaleInfos(query); var products = ProductManagerApplication.GetProducts(result.Models.Select(p => p.ProductId)); var shops = ShopApplication.GetShops(result.Models.Select(p => p.ShopId)); var market = result.Models.Select(item => { var product = products.FirstOrDefault(p => p.Id == item.ProductId); var shop = shops.FirstOrDefault(p => p.Id == item.ShopId); var m = new FlashSaleModel { Id = item.Id, Title = item.Title, BeginDate = item.BeginDate.ToString("yyyy-MM-dd"), EndDate = item.EndDate.ToString("yyyy-MM-dd"), ShopName = shop.ShopName, ProductName = product.ProductName, ProductId = item.ProductId, StatusStr = item.Status.ToDescription() }; if (item.Status != FlashSaleInfo.FlashSaleStatus.WaitForAuditing && item.Status != FlashSaleInfo.FlashSaleStatus.AuditFailed && item.BeginDate > DateTime.Now && item.EndDate < DateTime.Now) { m.StatusStr = "进行中"; } else if (item.Status != FlashSaleInfo.FlashSaleStatus.WaitForAuditing && item.Status != FlashSaleInfo.FlashSaleStatus.AuditFailed && item.BeginDate > DateTime.Now) { m.StatusStr = "未开始"; } m.SaleCount = item.SaleCount; m.MinPrice = item.MinPrice; m.MarketPrice = product.MarketPrice; m.ProductImg = HimallIO.GetProductSizeImage(product.ImagePath, 1, (int)ImageSize.Size_350); return(m); }); var dataGrid = new DataGridModel <FlashSaleModel>() { rows = market, total = result.Total }; return(Json(dataGrid)); }
public JsonResult ApplyWithDrawListByUser(long userid, int page, int rows) { IMemberCapitalService memberCapitalService = ServiceHelper.Create <IMemberCapitalService>(); ApplyWithDrawQuery applyWithDrawQuery = new ApplyWithDrawQuery() { memberId = new long?(userid), PageSize = rows, PageNo = page }; PageModel <ApplyWithDrawInfo> applyWithDraw = memberCapitalService.GetApplyWithDraw(applyWithDrawQuery); IEnumerable <ApplyWithDrawModel> applyWithDrawModels = applyWithDraw.Models.ToList().Select <ApplyWithDrawInfo, ApplyWithDrawModel>((ApplyWithDrawInfo e) => { string empty = string.Empty; if (e.ApplyStatus == ApplyWithDrawInfo.ApplyWithDrawStatus.PayFail || e.ApplyStatus == ApplyWithDrawInfo.ApplyWithDrawStatus.WaitConfirm) { empty = "提现中"; } else if (e.ApplyStatus == ApplyWithDrawInfo.ApplyWithDrawStatus.Refuse) { empty = "提现失败"; } else if (e.ApplyStatus == ApplyWithDrawInfo.ApplyWithDrawStatus.WithDrawSuccess) { empty = "提现成功"; } return(new ApplyWithDrawModel() { Id = e.Id, ApplyAmount = e.ApplyAmount, ApplyStatus = e.ApplyStatus, ApplyStatusDesc = empty, ApplyTime = e.ApplyTime.ToString() }); }); DataGridModel <ApplyWithDrawModel> dataGridModel = new DataGridModel <ApplyWithDrawModel>() { rows = applyWithDrawModels, total = applyWithDraw.Total }; return(Json(dataGridModel)); }
public JsonResult GetMemberCapitals(string user, int page, int rows) { IMemberCapitalService memberCapitalService = ServiceHelper.Create <IMemberCapitalService>(); IMemberService memberService = ServiceHelper.Create <IMemberService>(); long?nullable = null; if (!string.IsNullOrWhiteSpace(user)) { nullable = new long?((memberService.GetMemberByName(user) ?? new UserMemberInfo() { Id = 0 }).Id); } CapitalQuery capitalQuery = new CapitalQuery() { PageNo = page, PageSize = rows, Sort = "Balance", memberId = nullable }; PageModel <CapitalInfo> capitals = memberCapitalService.GetCapitals(capitalQuery); IEnumerable <CapitalModel> capitalModels = capitals.Models.ToList().Select <CapitalInfo, CapitalModel>((CapitalInfo e) => { UserMemberInfo member = memberService.GetMember(e.MemId); return(new CapitalModel() { Balance = e.Balance.Value, ChargeAmount = (e.ChargeAmount.HasValue ? e.ChargeAmount.Value : new decimal(0, 0, 0, false, 2)), FreezeAmount = (e.FreezeAmount.HasValue ? e.FreezeAmount.Value : new decimal(0, 0, 0, false, 2)), Id = e.Id, UserId = e.MemId, UserCode = member.UserName, UserName = (string.IsNullOrWhiteSpace(member.RealName) ? member.UserName : member.RealName) }); }); DataGridModel <CapitalModel> dataGridModel = new DataGridModel <CapitalModel>() { rows = capitalModels, total = capitals.Total }; return(Json(dataGridModel)); }
public JsonResult GetProductSaleStatisticList(int page, int rows, DateTime startDate, DateTime endDate, string Sort = "", bool IsAsc = false) { ProductStatisticQuery query = new ProductStatisticQuery { PageSize = rows, PageNo = page, StartDate = startDate, EndDate = endDate, ShopId = CurrentSellerManager.ShopId, Sort = Sort, IsAsc = IsAsc }; var model = StatisticApplication.GetProductSales(query); DataGridModel <ProductStatisticModel> dataGrid = new DataGridModel <ProductStatisticModel>() { rows = model.Models, total = model.Total }; return(Json(dataGrid)); }
public JsonResult DetailList(long id, int page = 1, int rows = 20) { var result = _iBonusService.GetDetail(id, page, rows); var datas = result.Models.ToList().Select(p => new BonusReceiveModel() { OpenId = p.OpenId, Price = p.Price, ReceiveTime = p.ReceiveTime == null ? "" : ((DateTime)p.ReceiveTime).ToString("yyyy-MM-dd"), UserName = p.Himall_Members == null ? "-" : p.Himall_Members.UserName, IsTransformedDeposit = p.IsTransformedDeposit }).ToList(); DataGridModel <BonusReceiveModel> model = new DataGridModel <BonusReceiveModel> { rows = datas, total = result.Total }; return(Json(model)); }
public JsonResult List(int page, int rows, string keyWords) { keyWords = keyWords.Trim(); PageModel <BrandInfo> brands = this._iBrandService.GetBrands(keyWords, page, rows); IEnumerable <BrandModel> array = from item in (IEnumerable <BrandInfo>)brands.Models.ToArray <BrandInfo>() select new BrandModel() { BrandName = item.Name, BrandLogo = item.Logo, ID = item.Id }; DataGridModel <BrandModel> dataGridModel = new DataGridModel <BrandModel>() { rows = array, total = brands.Total }; return(base.Json(dataGridModel)); }
public JsonResult GetSlideJson() { IQueryable <SlideAdInfo> slidAds = ServiceHelper.Create <ISlideAdsService>().GetSlidAds(0, SlideAdInfo.SlideAdType.PlatformHome); IEnumerable <HandSlideModel> array = from item in slidAds.ToArray() select new HandSlideModel() { Id = item.Id, Pic = item.ImageUrl, URL = item.Url, Index = item.DisplaySequence }; DataGridModel <HandSlideModel> dataGridModel = new DataGridModel <HandSlideModel>() { rows = array, total = array.Count() }; return(Json(dataGridModel)); }
public JsonResult List(int page, int rows, string name, int?position) { var templatePosition = (ProductDescriptionTemplateInfo.TemplatePosition?)position; var pageModel = _iProductDescriptionTemplateService.GetTemplates(CurrentSellerManager.ShopId, page, rows, name, templatePosition); var dataGrid = new DataGridModel <ProductDescriptionTemplateModel>() { rows = pageModel.Models.ToArray().Select(item => new ProductDescriptionTemplateModel() { HtmlContent = item.Content, Id = item.Id, Name = item.Name, Position = (int)item.Position, PositionText = item.Position.ToDescription() }), total = pageModel.Total }; return(Json(dataGrid)); }
public ActionResult GetData(int index, int size, string cname) { #region 初始化查询Model FlashSaleQuery query = new FlashSaleQuery() { ItemName = cname, IsPreheat = true, PageNo = index, PageSize = size, AuditStatus = FlashSaleInfo.FlashSaleStatus.Ongoing, CheckProductStatus = true }; #endregion var obj = _iLimitTimeBuyService.GetAll(query); List <FlashSaleModel> list = new List <FlashSaleModel>(); foreach (var model in obj.Models.ToList()) { FlashSaleModel result = new FlashSaleModel(); result.Id = model.Id; result.Title = model.Title; result.ShopId = model.ShopId; result.ProductId = model.ProductId; result.Status = model.Status; result.ProductName = model.Himall_Products.ProductName; result.ProductImg = Himall.Core.HimallIO.GetProductSizeImage(model.Himall_Products.RelativePath, 1); result.MarketPrice = model.Himall_Products.MarketPrice; result.BeginDate = model.BeginDate.ToString("yyyy-MM-dd HH:mm"); result.EndDate = model.EndDate.ToString("yyyy-MM-dd HH:mm"); result.LimitCountOfThePeople = model.LimitCountOfThePeople; result.SaleCount = model.SaleCount; result.CategoryName = model.CategoryName; result.MinPrice = model.MinPrice; list.Add(result); } DataGridModel <FlashSaleModel> x = new DataGridModel <FlashSaleModel>(); x.total = obj.Total; x.rows = list; return(Json(x)); }
public HeadersForm() { _view = new HeadersFormView(); Func <string, BaseUnboundColumnBuilder <HeaderDto> > build = x => UnboundDataGridColumnBuilder.For <HeaderDto>(x); Headers = DataGridModel <HeaderDto> .CreateAndBindNonReloadable( _view.Items, (el, theaderHeight, _) => //most of the time you would use Toolkit.DefaultTableBodyHeightProvider() el.GetAvailableHeightForFormElement(0, 2) - theaderHeight - _view.Help.Widget.OffsetHeight, new List <IDataGridColumn <HeaderDto> > { build("#") .WithValueLocalized(x => Headers.Items.IndexOf(x) + 1) .Build(), build("Id") .WithValueLocalized(x => x.Id) .TransformableDefault() .Build(), build("Name") .WithValue(x => x.Name) .TransformableDefault() .Build() }).Item1; Headers.Selected.Changed += (_, __, ___) => { if (Headers.Selected.Length != 1) { return; } ChoosenHeader = Headers.Selected.First(); Ended?.Invoke(this, Outcome.ChoosenHeader); }; Headers.Activated.Changed += (sender, oldValue, newValue, errors, isUserChange) => { if (newValue == null) { return; } ChoosenHeader = Headers.Activated.Value; Ended?.Invoke(this, Outcome.ChoosenHeader); }; }
public JsonResult ListMoneyRefundGYS(int page, int rows, string starttime, string endtime, int moneytype, long userid, int usertype) { Finance_RefundQuery fpq = new Finance_RefundQuery(); fpq.userid = userid; fpq.usertype = usertype; fpq.starttime = starttime; fpq.endtime = endtime; fpq.moneytype = moneytype; fpq.PageSize = rows; fpq.PageNo = page; PageModel <Finance_Refund> fp = ServiceHelper.Create <IFinance_RefundService>().GetFinance_RefundListInfo(fpq); IEnumerable <Finance_Refund> models = from item in fp.Models.ToArray() select new Finance_Refund() { Id = item.Id, Refund_Number = item.Refund_Number, Refund_OrderNum = item.Refund_OrderNum, Refund_UserId = item.Refund_UserId, Refund_UserType = item.Refund_UserType, Refund_UserName = item.Refund_UserName, Refund_Money = item.Refund_Money, Refund_MoneyType = item.Refund_MoneyType, Refund_SXMoney = item.Refund_SXMoney, Refund_ISChujing = item.Refund_ISChujing, Refund_Address = item.Refund_Address, Refund_Time = item.Refund_Time, Refund_Status = item.Refund_Status, Refund_ToUserId = item.Refund_ToUserId, Refund_ToUserType = item.Refund_ToUserType, Refund_ToUserName = item.Refund_ToUserName }; DataGridModel <Finance_Refund> dataGridModel = new DataGridModel <Finance_Refund>() { rows = models, total = fp.Total }; return(Json(dataGridModel)); }
public JsonResult ListPay(int page, int rows, string starttime, string endtime, int moneytype, long userid, int usertype) { Finance_PaymentQuery fpq = new Finance_PaymentQuery(); fpq.userid = userid; fpq.usertype = usertype; fpq.starttime = starttime; fpq.endtime = endtime; fpq.moneytype = moneytype; fpq.PageSize = rows; fpq.PageNo = page; PageModel <Finance_Payment> fp = ServiceHelper.Create <IFinance_PaymentService>().GetFinance_PaymentListInfo(fpq); IEnumerable <Finance_Payment> models = from item in fp.Models.ToArray() select new Finance_Payment() { Id = item.Id, PayMent_Number = item.PayMent_Number, PayMent_UserId = item.PayMent_UserId, PayMent_UserType = item.PayMent_UserType, PayMent_OrderNum = item.PayMent_OrderNum, PayMent_PayTime = item.PayMent_PayTime, PayMent_PayMoney = item.PayMent_PayMoney, PayMent_TotalMoney = item.PayMent_TotalMoney, PayMent_BXMoney = item.PayMent_BXMoney, PayMent_YFMoney = item.PayMent_YFMoney, PayMent_JYMoney = item.PayMent_JYMoney, PayMent_SXMoney = item.PayMent_SXMoney, PayMent_PayAddress = item.PayMent_PayAddress, PayMent_MoneyType = item.PayMent_MoneyType, PayMent_Status = item.PayMent_Status, PayMent_Type = item.PayMent_Type }; DataGridModel <Finance_Payment> dataGridModel = new DataGridModel <Finance_Payment>() { rows = models, total = fp.Total }; return(Json(dataGridModel)); }
public JsonResult List() { IQueryable <ShopGradeInfo> shopGrades = ServiceHelper.Create <IShopService>().GetShopGrades(); IEnumerable <ShopGradeModel> array = from item in shopGrades.ToArray() select new ShopGradeModel() { Id = item.Id, ChargeStandard = item.ChargeStandard, ImageLimit = item.ImageLimit, ProductLimit = item.ProductLimit, Name = item.Name }; DataGridModel <ShopGradeModel> dataGridModel = new DataGridModel <ShopGradeModel>() { rows = array, total = shopGrades.Count() }; return(Json(dataGridModel)); }
public JsonResult DetailList(long id, int page = 1, int rows = 20) { PageModel <BonusReceiveInfo> detail = _bonusService.GetDetail(id, page, rows); List <BonusReceiveModel> list = ( from p in detail.Models.ToList() select new BonusReceiveModel() { OpenId = p.OpenId, Price = p.Price, ReceiveTime = (!p.ReceiveTime.HasValue ? "" : p.ReceiveTime.Value.ToString("yyyy-MM-dd")), UserName = (p.Himall_Members == null ? "-" : p.Himall_Members.UserName), IsTransformedDeposit = p.IsTransformedDeposit }).ToList(); DataGridModel <BonusReceiveModel> dataGridModel = new DataGridModel <BonusReceiveModel>() { rows = list, total = detail.Total }; return(Json(dataGridModel)); }
public JsonResult GetWXSmallProducts(int page, int rows, string keyWords, long?categoryId = null) { Himall.Model.ObsoletePageModel <Himall.Model.ProductInfo> datasql = _iWXSmallProgramService.GetWXSmallProducts(page, rows); IEnumerable <ProductModel> products = datasql.Models.ToArray().Select(item => new ProductModel() { name = item.ProductName, brandName = item.BrandName, id = item.Id, imgUrl = item.GetImage(ImageSize.Size_50), price = item.MinSalePrice, state = item.ShowProductState, productCode = item.ProductCode }); DataGridModel <ProductModel> dataGrid = new DataGridModel <ProductModel>() { rows = products, total = datasql.Total }; return(Json(dataGrid)); }
public ActionResult DetailList(long id, int page = 1, int rows = 20) { var result = this._bonusService.GetDetail(id, page, rows); DateTime iniDate = new DateTime(1970, 1, 1); var datas = result.Models.ToList().Select(p => new ShopBonusReceiveModel() { OpenId = p.OpenId, Price = (decimal)p.Price, ReceiveTime = p.ReceiveTime != null && p.ReceiveTime > iniDate ? ((DateTime)p.ReceiveTime).ToString("yyyy-MM-dd"): "", StateStr = p.State.ToDescription(), UsedTime = p.UsedTime == null ? "" : ((DateTime)p.UsedTime).ToString("yyyy-MM-dd"), UsedOrderId = p.UsedOrderId.ToString() }).ToList(); DataGridModel <ShopBonusReceiveModel> model = new DataGridModel <ShopBonusReceiveModel> { rows = datas, total = result.Total }; return(Json(model)); }
public JsonResult GetManagersAccountList(int page, int rows, string starttime, string endtime) { IManagersAccountService IMAS = ServiceHelper.Create <IManagersAccountService>(); ManagersAccountQuery MQ = new ManagersAccountQuery() { startTime = starttime, endTime = endtime, PageNo = page, PageSize = rows, managerId = base.CurrentSellerManager.ShopId }; PageModel <ManagersAccount> PM = IMAS.GetManagersAccountList(MQ); IEnumerable <ManagersAccount> models = from item in PM.Models.ToArray() select new ManagersAccount() { Id = item.Id, Zhuanzhang = item.Zhuanzhang, ZhuanzhangName = item.ZhuanzhangName, Tiqu = item.Tiqu, Tiqufeiyong = item.Tiqufeiyong, Tiquhuobi = item.Tiquhuobi, Huilv = item.Huilv, Tuikuan = item.Tuikuan, OrderNum = item.OrderNum, Balance = item.Balance, BalanceAvailable = item.BalanceAvailable, Datatime = item.Datatime, ManagerId = item.ManagerId, Daikuan = item.Daikuan }; DataGridModel <ManagersAccount> dataGridModel = new DataGridModel <ManagersAccount>() { rows = models, total = PM.Total }; return(Json(dataGridModel)); }
public JsonResult ListTrans(int page, int rows, string starttime, string endtime, int moneytype, long userid, int usertype) { Finance_TransferQuery fpq = new Finance_TransferQuery(); fpq.userid = userid; fpq.usertype = usertype; fpq.starttime = starttime; fpq.endtime = endtime; fpq.moneytype = moneytype; fpq.PageSize = rows; fpq.PageNo = page; PageModel <Finance_Transfer> fp = ServiceHelper.Create <IFinance_TransferService>().GetFinance_TransferListInfo(fpq); IEnumerable <Finance_Transfer> models = from item in fp.Models.ToArray() select new Finance_Transfer() { Id = item.Id, Trans_Number = item.Trans_Number, Trans_UserId = item.Trans_UserId, Trans_UserName = ServiceHelper.Create <IMemberService>().GetMember(item.Trans_UserId) == null ? "" : ServiceHelper.Create <IMemberService>().GetMember(item.Trans_UserId).UserName, Trans_UserType = item.Trans_UserType, Trans_Money = item.Trans_Money, Trans_SXMoney = item.Trans_SXMoney, Trans_MoneyType = item.Trans_MoneyType, Trans_Time = item.Trans_Time, Trans_Address = item.Trans_Address, Trans_ToUserId = item.Trans_ToUserId, Trans_ToUserName = ServiceHelper.Create <IMemberService>().GetMember(item.Trans_ToUserId) == null ? "" : ServiceHelper.Create <IMemberService>().GetMember(item.Trans_ToUserId).UserName, Trans_ToUserType = item.Trans_ToUserType, Trans_Status = item.Trans_Status }; DataGridModel <Finance_Transfer> dataGridModel = new DataGridModel <Finance_Transfer>() { rows = models, total = fp.Total }; return(Json(dataGridModel)); }
public JsonResult PageList_Products(int page, int rows, string productname) { ProductQuery productquery = new ProductQuery() { PageSize = rows, PageNo = page, ProductName = productname }; PageModel <ProductInfo> products = ServiceHelper.Create <IProductService>().GetProducts(productquery); IEnumerable <ProductInfo> array = from item in products.Models.ToArray() select new ProductInfo { Id = item.Id, ProductCode = item.ProductCode, ProductName = item.ProductName, EProductName = item.EProductName, ShopId = item.ShopId, ShopName = (ServiceHelper.Create <IShopService>().GetShopName(item.ShopId) == null ? "" : ServiceHelper.Create <IShopService>().GetShopName(item.ShopId)), ShortDescription = item.ShortDescription, MarketPrice = item.MarketPrice, Purity = item.Purity, CASNo = item.CASNo, HSCODE = item.HSCODE, DangerLevel = item.DangerLevel, MolecularFormula = item.MolecularFormula, ISCASNo = item.ISCASNo, EditStatus = item.EditStatus, MeasureUnit = item.MeasureUnit, Quantity = item.Quantity, Volume = item.Volume, Weight = item.Weight }; DataGridModel <ProductInfo> dataGridModel = new DataGridModel <ProductInfo>() { rows = array, total = products.Total }; return(Json(dataGridModel)); }
public ActionResult DetailList(long id, int page = 1, int rows = 20) { PageModel <ShopBonusReceiveInfo> detail = _bonusService.GetDetail(id, page, rows); List <ShopBonusReceiveModel> list = ( from p in detail.Models.ToList() select new ShopBonusReceiveModel() { OpenId = p.OpenId, Price = p.Price.Value, ReceiveTime = (!p.ReceiveTime.HasValue ? "" : p.ReceiveTime.Value.ToString("yyyy-MM-dd")), StateStr = p.State.ToDescription(), UsedTime = (!p.UsedTime.HasValue ? "" : p.UsedTime.Value.ToString("yyyy-MM-dd")), UsedOrderId = p.UsedOrderId.ToString() }).ToList(); DataGridModel <ShopBonusReceiveModel> dataGridModel = new DataGridModel <ShopBonusReceiveModel>() { rows = list, total = detail.Total }; return(Json(dataGridModel)); }
public JsonResult ProductList(ShopBranchProductQuery query) { query.ShopBranchProductStatus = 0; query.OrderKey = 2; //查询商品 var pageModel = ShopBranchApplication.GetShopBranchProducts(query); //查询门店SKU库存 var allSKU = ProductManagerApplication.GetSKUByProducts(pageModel.Models.Select(p => p.Id)); List <string> skuids = allSKU.Select(p => p.Id).ToList(); var shopBranchSkus = ShopBranchApplication.GetSkusByIds(query.ShopBranchId.Value, skuids); var dataGrid = new DataGridModel <ProductModel>(); dataGrid.total = pageModel.Total; dataGrid.rows = pageModel.Models.Select(item => { var cate = ShopCategoryApplication.GetCategoryByProductId(item.Id); return(new ProductModel() { Name = item.ProductName, Id = item.Id, Image = item.GetImage(ImageSize.Size_50), CategoryName = cate == null ? "" : cate.Name, SaleCount = item.SaleCounts, Stock = shopBranchSkus.Where(e => e.ProductId == item.Id).Sum(s => s.Stock), Price = item.MinSalePrice, MinPrice = allSKU.Where(s => s.ProductId == item.Id).Min(s => s.SalePrice), MaxPrice = allSKU.Where(s => s.ProductId == item.Id).Max(s => s.SalePrice), Url = "", PublishTime = item.AddedDate.ToString("yyyy-MM-dd HH:mm"), SaleState = (int)item.SaleStatus, CategoryId = item.CategoryId, ProductCode = item.ProductCode, ProductType = item.ProductType }); }).ToList(); return(Json(dataGrid)); }
public JsonResult GetCoupons(int page = 1, string title = "") { long shopId = CurrentSellerManager.ShopId; var couponsList = EngineContext.Current.Resolve <ICouponService>().GetCouponList(new Mall.DTO.QueryModel.CouponQuery { CouponName = title, ShopId = shopId, IsOnlyShowNormal = true, IsShowAll = false, ShowPlatform = Mall.Core.PlatformType.PC, PageNo = page, PageSize = 10 }); var resulst = couponsList.Models.ToArray().Select(a => { var m = new CouponsContent { create_time = a.CreateTime.ToString(), game_id = a.Id, link = "/m-wap/vshop/CouponInfo/" + a.Id, type = 1, title = a.CouponName, condition = a.OrderAmount.ToString(), endTime = a.EndTime.ToShortDateString(), price = a.Price.ToString(), shopName = a.ShopName }; return(m); }); var dataGrid = new DataGridModel <CouponsContent>() { rows = resulst, total = couponsList.Total }; return(Json(dataGrid)); }
/// <summary> /// 获取统计列表 /// </summary> /// <returns></returns> public ActionResult ReportsList() { int pageSize = int.Parse(Request.Form["rows"]); //获取请求的页码 int pageIndex = int.Parse(Request.Form["page"]); //从行数 int rowCount = 0; //在session中获取CenterID //center center = SessionHelper.GetSession(SessionHelper.LoginCenter) as center; // 查询分页数据 List<permission> list = new PermissionBLL().getPermissionBy(center.id, pageIndex, pageSize, out rowCount); // 生成规定格式的 json字符串发回 给异步对象 DataGridModel dgModel = new DataGridModel() { total = rowCount, rows = list, footer = null }; return Json(dgModel); }