public ActionResult Cancel(eBayCancelSearchModel model) { // eBay Site, eBay 계정 정보 조회 IEnumerable<SelectListItem> eBaySites = ViewBag.eBaySites = new CommonBiz().GetSecondSites("eBay"); IEnumerable<SelectListItem> eBayAccounts = ViewBag.eBayAccounts = new CommonBiz().GetExportLoginIds(MemberContext.LoginID, "eBay"); if (!ModelState.IsValid) { model.Initialize(); if (eBaySites != null && eBaySites.Count() > 0) { model.eBaySite = eBaySites.ElementAt(0).Value; } if (eBayAccounts != null && eBayAccounts.Count() > 0) { model.sellerId = eBayAccounts.ElementAt(0).Value; } ModelState.Clear(); } return View(model); }
public JsonResult GetCancelList(eBayCancelSearchModel model) { if (!ModelState.IsValid) { return Json(new JQGridResult()); } List<BsonValue> eBayIds = new List<BsonValue>(); if (model.sellerId == "All") { // TODO: (이태희) "eBay" 하드코딩? List<TaAccounts> taAccounts = new CommonBiz().GetTaeBayAccount(MemberContext.LoginID, "eBay"); foreach (TaAccounts t in taAccounts) { eBayIds.Add(BsonValue.Create(t.site_login_id)); } } else { eBayIds.Add(BsonValue.Create(model.sellerId)); } MongoPagingResult<EBayCancelGridT> GridData = new eBayOrderBiz().GeteBayCancelGridData(model.Page.Value , model.Rows.Value , eBayIds , Util.GetSafeInt(model.eBaySite) , (int)model.disputeRecordType.Value , (int)model.searchKind.Value , model.searchKey , model.startDate.Value , model.endDate.Value.AddDays(1)); JQGridResult result = new JQGridResult(); result.total = Math.Ceiling(Convert.ToDecimal(Convert.ToDecimal(GridData.Count) / 10)); result.page = model.Page.Value; result.rows = GridData.Result.ToArray(); result.Count = GridData.Count; return Json(result); }