/// <summary> /// GSM을 통한 eBay 상품리스트 조회 /// </summary> public JsonResult eBayItemList(string gdlc_cd, string gdmc_cd, string gdsc_cd, string stat, string s_type, string s_value) { List<eBayItemsData> list = new eBayItemBiz().List(gdlc_cd, gdmc_cd, gdsc_cd, stat, s_type, s_value); var data = from e in list select new { LCategoryName = e.gep_info.lcategory.name, MCategoryName = e.gep_info.mcategory.name, SCategoryName = e.gep_info.scategory.name, CloneItemNo = e.cln_itemno == null ? "" : e.cln_itemno, GmktItemNo = e.gep_info.src_no, GmktItemName = e.gep_info.src_name, SelectionName = e.gep_info.sel_name == null ? "" : e.gep_info.sel_name, ListingStartDate = e.list_sdate == null ? "" : e.list_sdate.ToShortDateString().Replace("0001-01-01", ""), ListingEndDate = e.list_edate == null ? "" : e.list_edate.ToShortDateString().Replace("0001-01-01", ""), Stat = e.stat.ToString(), ID = e._id.ToString() }; var result = new { rows = data.ToArray() }; return Json(result, JsonRequestBehavior.AllowGet); }
public JsonResult eBayDeadLineItemsData(string categoryId = "", int price1 = 0, int price2 = 0, string periodType = "", string sdate = "", string edate = "", string eBayType = "", string eBayId = "", string eBayVerify = "", string searchType = "", string searchText = "", int page = 1, string sord = "", string sidx = "") { object list = new eBayItemBiz().GetDeadLineItemList(categoryId, price1, price2, periodType, sdate, edate, eBayType, eBayId, eBayVerify, searchType, searchText, page, sord, sidx); return Json(list, JsonRequestBehavior.AllowGet); }
public void GetCategoryData(int id, string serchString) { //정제 & 동작 List<SuggestedCategories> Result = new eBayItemBiz().GetCategoryData(id, serchString); //검증 foreach (var t in Result) { Trace.DumpBusinessEntity(t); } }
/// <summary> /// 카테고리 검색 정보를 가져온다. /// </summary> /// <param name="Site">사이트 번호</param> /// <param name="SrchString">검색자</param> /// <returns></returns> public JsonResult GetCategoryDate(int Site, string SrchString) { List<SuggestedCategories> listsuggestedCategories = new eBayItemBiz().GetCategoryData(Site, SrchString); return Json(listsuggestedCategories, JsonRequestBehavior.AllowGet); }
/// <summary> /// 상품정보 수정 페이지 /// 2차 가공, 대기상품, 리스팅 상품에서 호출 /// </summary> /// <param name="id">ebay_items 컬렉션의 ObjectID(string형태로 받고 추후 ObjectID로 변경)</param> /// <param name="category">Ebay 1차 카테고리(없으면 미리 저장된 데이터 사용)</param> /// <returns></returns> public ActionResult Edit(string id, string category) { if (id == "" || id == null) { //exception을 던지거나 공통 오류 페이지로 보내거나 기타등등의 방법으로 처리하는게 더 나을듯.. //return SetAlertAndRedirect("잘못된 접근 입니다.", Url.Action("List")); throw new Exception("잘못된 접근 입니다."); } eBayItemsData objeBayItemData = new eBayItemBiz().GetEbayItemData(id); if (objeBayItemData == null) { throw new Exception("eBay상품 키값이 유효하지 않습니다."); } GepItemsData gepItemData = new GepItemsBiz().GepItemView(objeBayItemData.gep_id.ToString()); if (gepItemData == null) { throw new Exception("Gep상품 코드가 유효하지 않습니다."); } if (category != "" && category != null && category != "0") { objeBayItemData.dynamicData.PrimaryCategoryID = Util.GetSafeLong(category); } ebayItemDataForSeller forSellerData = new eBayItemBiz().GetForSellerDataParseJSON(objeBayItemData.site, objeBayItemData.dynamicData.PrimaryCategoryID); if (forSellerData == null) { throw new Exception("forSeller와 데이터 연동에 실패했습니다."); } // eBay 대기상품의 경우 계정정보 수정이 가능함 if (objeBayItemData.stat == eBayItemStat.Wait) { var accounts = new CommonBiz().GetTaeBayAccount(MemberContext.LoginID, "ebay"); if (accounts != null) { ViewBag.eBayAccounts = from e in accounts where e.site.ToLower().Equals("ebay") select new SelectListItem { Text = e.site_login_id, Value = e.site_login_id }; } } //ViewBag.siteId = siteId; ViewBag.allowEmsRegion = new TransportCommonBiz().GetEmsNationList(); ViewBag.allowRr = new TransportCommonBiz().GetSpNationList(); ViewBag.eBayItemsData = objeBayItemData; ViewBag.gepItemData = gepItemData; return View(forSellerData); }
/// <summary> /// eBay Item Listing 요청 결과값 리턴 (여러건 처리 결과) /// </summary> /// <param name="Request"></param> /// <returns></returns> public int SetItemListingResult(List<ItemListingResponse> Request) { logger.InfoFormat("Item Count : {0}", Request.Count); //한건도 없으면 실패 if (Request.Count == 0) return 0; foreach(var t in Request) { try { logger.Info(string.Format("[Datas]\nAck : {0}\nEbayTokenID : {1}\nEndTime : {2}\nFees: {3}\nInventoryID : {4}\nItemID : {5}\nMessages : {6}\nStartTime : {7}", t.Ack, t.EbayTokenID, t.EndTime, t.Fees, t.InventoryID, t.ItemID, t.Messages, t.StartTime)); bool result = new eBayItemBiz().SetItemListingResult(new Data.ItemListingResult() { Ack = (eBayAckType)t.Ack ,EbayTokenID = t.EbayTokenID ,EndTime = t.EndTime ,Fees = t.Fees ,InventoryID = t.InventoryID ,ItemID = t.ItemID ,Messages = t.Messages ,StartTime = t.StartTime } ); logger.Info("[Result] : " + result); //TODO 도중에 에러가 날경우 어떻게 할것인지 정해야함. if (!result) { //return 0; } } catch(Exception ex) { //에러가 나면 로그를 남기고 종료. ThriftException tException = new ThriftException(); tException.ExceptionCode = 0; tException.ExceptionMessage = ex.ToString(); logger.Error("[Exception!!] : " + ex.StackTrace.ToString()); throw tException; } } return 1; }
/// <summary> /// eBayItem을 저장한다. (0 : 정상, -1 : eBay아이템 키값 오류) /// </summary> /// <param name="id">eBayItem ObjectID</param> /// <param name="form">forSeller와 연동해서 얻은 Form 값</param> /// <returns></returns> public int SeteBayItems(string id, eBayItemsDataForSeller data) { eBayItemsData objeBayItemData = new eBayItemBiz().GetEbayItemData(id); if (objeBayItemData == null) { return -1; } objeBayItemData.dynamicData = data; new eBayItemDac().Save(objeBayItemData); return 0; }
/// <summary> /// eBay 상품의 Verify /// 대기상품 리스팅에서 호출 /// </summary> public JsonResult Verify(string _id) { eBayItemVerifyResult result = new eBayItemBiz().Verify(_id, MemberContext.LoginID); return Json(result, JsonRequestBehavior.AllowGet); }
/// <summary> /// 판매중지 요청내역 조회 리스트 /// </summary> public JsonResult SearchRequest([ModelBinder(typeof(JqGridPagingModelBinder))] eBayItemSearchModel searchCriteria) { if (!ModelState.IsValid) { } MongoPagingResult<eBayItemsData> mongoResult = new eBayItemBiz().StopRequestList(MemberContext.LoginID, searchCriteria); return Json(new { total = Math.Ceiling(Convert.ToDecimal(Convert.ToDecimal(mongoResult.Count) / 10)), page = searchCriteria.Page.Value, rows = (from e in mongoResult.Result select new { Idx = 1, Image = e.img, GmktItemNo = e.gep_info.src_no, GepCode = e.gep_id, CloneItemNo = e.cln_itemno, ItemId = e.itemno, GmktItemName = e.gep_info.src_name, SelectionName = e.gep_info.sel_name, RequestDate = e.stopreq.reqdate.ToShortDateString().Replace("0001-01-01", ""), Reason = e.stopreq.reason.ToDisplayString(), SellerName = e.gep_info.src_seller, _ID = e._id.ToString() }).ToArray() }); }
public void GetItemListingList() { //동작 List<eBayItemsData> Result = new eBayItemBiz().GetItemListingList(); //검증 foreach (var t in Result) { Trace.DumpBusinessEntity(t); } }
public void GetForSellerDataParseJSON(int siteid, long categoryID) { //정제 & 동작 ebayItemDataForSeller Result = new eBayItemBiz().GetForSellerDataParseJSON(siteid, categoryID); //검증 Trace.DumpBusinessEntity(Result); }
public SellerAgreementChageResult SellerAgreementChange() { SellerAgreementChageResult result = new SellerAgreementChageResult(); try { int rowEffect = 0; List<SellerAgreementT> sellerList = new AdminDac().GetChangedSellerAgreement(); result.sellerCount = sellerList.Count; foreach (var seller in sellerList) { //GEP 대상 상품 List<GepItemsData> gepTargetItem = new GepItemsBiz().GetStopReqItems(seller.SellerNo, seller.TaId); foreach (var gepData in gepTargetItem) { gepData.stat = seller.AgreeYn == "Y" ? "S2" : "S3"; new GepItemsDac().Save(gepData); rowEffect++; } //eBay 대상 상품 List<eBayItemsData> eBayTargetItem = new eBayItemBiz().GetStopReqItems(seller.SellerNo, seller.TaId); foreach (var eBayData in eBayTargetItem) { if (seller.AgreeYn == "N") { StopRequest stopReauest = new StopRequest(); stopReauest.is_req = true; stopReauest.reqdate = DateTime.Now; stopReauest.reason = StopRequestReason.CancelAgreement; eBayData.stopreq = stopReauest; new eBayItemDac().Save(eBayData); rowEffect++; } } } result.rowEffect = rowEffect; result.result = true; } catch (Exception ex) { result.result = false; result.message = string.Format("{0} {1} {2}", ex.Message, ex.Source, ex.StackTrace); } return result; }
/// <summary> /// 필수선택 임시저장 /// </summary> public void SetTempGEPItems(List<GepItemsData> selections, string ta_id) { List<GepItemsData> resultGEPItems = new List<GepItemsData>(); // 최종저장할 GepItemsData foreach (GepItemsData sel in selections) { if (sel.src_info.sel_qty <= 0) continue; // 품절일 때 선택저장불가 string gd_no = sel.src_info.no; string gd_img = sel.img; // 필터링으로부터 상품만들기 SourceItemInfoT info = new GmarketItemBiz().GetSourceItem(ta_id, gd_no); string Desc = new GmarketItemBiz().GetSourceItemDescription(gd_no); // 본 상품이 해외배송 불가, 판매자 미동의 상품인 경우 선택저장불가 if (info.OverseasDeliveryYn.ToUpper() == "N" || info.AgreeYn.ToUpper() == "N") continue; // eBay VeRO 체크 - 한 상품에 대한 임시저장이므로 첫번째 항목에서 걸리면 전체를 중지하고 throw하면 된다. string matchKeyword = null; bool isLimit = new eBayItemBiz().ContainseBayVeroKeyword(info.Name, out matchKeyword); if (isLimit == true) { throw new ValidationException("상품명에 입력된 [" + matchKeyword + "] 단어는 eBay VeRO 정책에 적합하지 않습니다. 작업을 중지합니다."); } if (string.IsNullOrWhiteSpace(info.EngName) == false) { isLimit = new eBayItemBiz().ContainseBayVeroKeyword(info.EngName, out matchKeyword); if (isLimit == true) { throw new ValidationException("영문상품명에 입력된 [" + matchKeyword + "] 단어는 eBay VeRO 정책에 적합하지 않습니다. 작업을 중지합니다."); } } GepItemsData resultGEPItem = new GepItemsData(); resultGEPItem._id = GetNextGEPItemID(); resultGEPItem.stat = "S1"; // resultGEPItemStatusEnum.StanBy; resultGEPItem.img = gd_img; resultGEPItem.src_site = "GMKT"; resultGEPItem.src_info = new src_info(); resultGEPItem.src_info.no = gd_no; resultGEPItem.src_info.name = info.Name; resultGEPItem.src_info.eng_name = info.EngName; resultGEPItem.src_info.seller = new seller(); resultGEPItem.src_info.seller.no = info.SellerNo; resultGEPItem.src_info.seller.sid = info.SellerID; resultGEPItem.src_info.seller.name = info.SellerName; resultGEPItem.src_info.seller.tel = info.SellerTel; resultGEPItem.src_info.seller.cell = info.SellerCell; resultGEPItem.src_info.seller.email = info.SellerEmail; resultGEPItem.src_info.lcategory = new lcategory(); resultGEPItem.src_info.lcategory.cid = info.LCategoryCode; resultGEPItem.src_info.lcategory.name = info.LCategoryName; resultGEPItem.src_info.mcategory = new mcategory(); resultGEPItem.src_info.mcategory.cid = info.MCategoryCode; resultGEPItem.src_info.mcategory.name = info.MCategoryName; resultGEPItem.src_info.scategory = new scategory(); resultGEPItem.src_info.scategory.cid = info.SCategoryCode; resultGEPItem.src_info.scategory.name = info.SCategoryName; resultGEPItem.src_info.desc = Desc; resultGEPItem.src_info.price = Util.GetSafeInt(info.SellPrice); resultGEPItem.src_info.settle_price = Util.GetSafeInt(info.CostPrice); resultGEPItem.src_info.qty = info.StockQty; resultGEPItem.src_info.weight = Util.GetSafeInt(info.Weight); resultGEPItem.src_info.dc = Util.GetSafeInt(info.SellerDiscountPrice); resultGEPItem.src_info.origin = info.Origin; resultGEPItem.src_info.dlv = new dlv(); resultGEPItem.src_info.dlv.dlv_gr_no = info.DeliveryGroupNo; resultGEPItem.src_info.dlv.dlv_gr_nm = info.DeliveryGroupName; resultGEPItem.src_info.dlv.bs_money = Util.GetSafeInt(info.BasisMoney); resultGEPItem.src_info.dlv.dlv_fee = Util.GetSafeInt(info.DeliveryFee); resultGEPItem.src_info.dlv.who_fee = info.WhoFee; resultGEPItem.src_info.dlv.bs_weight = Util.GetSafeInt(info.BasisWeight); resultGEPItem.src_info.dlv.bs_amt = Util.GetSafeInt(info.BasisAmount); resultGEPItem.src_info.dlv.bs_type = info.BasisType; resultGEPItem.src_info.dlv.dlv_fee_yn = info.DeliveryFeeYn; resultGEPItem.src_info.dlv.dlv_fee_cond = info.DeliveryFeeCondition; // 필수선택 정보 들어감 resultGEPItem.src_info.sel_no = sel.src_info.sel_no; resultGEPItem.src_info.sel_name = sel.src_info.sel_name; resultGEPItem.src_info.sel_price = sel.src_info.sel_price; resultGEPItem.src_info.sel_qty = sel.src_info.sel_qty; // 필수선택 정보 들어감 resultGEPItem.src_info.overseas_sold_cnt = info.OverseasSoldCount; resultGEPItem.src_info.total_price = Util.GetSafeInt(info.SellPrice + info.DeliveryFee - info.SellerDiscountPrice); resultGEPItem.ver_code = ""; resultGEPItem.trans = new List<trans>(); resultGEPItem.is_exp = false; resultGEPItem.rdate = DateTime.Now; resultGEPItem.udate = DateTime.Now; resultGEPItem.ta = ta_id; resultGEPItem.total_exp_count = 0; resultGEPItem.latest_exp_date = DateTime.Now; resultGEPItem.exp_ta = ""; resultGEPItems.Add(resultGEPItem); } // Batch Insert (임시저장은 히스토리를 남기지 않음) new GmarketItemDac().InsertGEPItem(resultGEPItems); }
/// <summary> /// GEP로 소스상품 이관 /// </summary> public string SetGEPItems(List<GepItemsData> reqMotherItems, string ta_id) { List<string> sMsg = new List<string>(); // 생성완료 건 안내 string fMsg = ""; // 실패 건 안내 List<GepItemsData> resultGEPItems = new List<GepItemsData>(); // 최종저장할 GepItemsData // 넘어온 reqMotherItems에는 소스상품번호(src_info.no)와 이미지(img)만 값이 들어있다. foreach (GepItemsData motherItem in reqMotherItems) { string gd_no = motherItem.src_info.no; string gd_img = motherItem.img; // 임시저장된 필수선택 리스트(TempGEPItem)를 가져온다. List<GepItemsData> tmpGEPItems = new GmarketItemBiz().GetTempGEPItemList(ta_id, gd_no); if (tmpGEPItems != null && tmpGEPItems.Count > 0) { foreach (GepItemsData t in tmpGEPItems) { t.stat = "S2"; new GmarketItemDac().UpdateGEPItem(t); // 상태만 S1 -> S2 바로 업데이트 // History string sel = GmktUtil.GetOptionNoString(t.src_info.sel_no.RawValues); new GmarketItemDac().SetSourceItemHistory(ta_id, gd_no, t._id, sel, t.src_info.sel_name, t.src_info.sel_price, t.src_info.sel_qty); } sMsg.Add(gd_no); } else { // 필수선택이 없는 소스상품은 Insert를 위해 필터링 DB에서 나머지를 채운다. SourceItemInfoT info = new GmarketItemBiz().GetSourceItem(ta_id, gd_no); string Desc = new GmarketItemBiz().GetSourceItemDescription(gd_no); // 본 상품이 해외배송 불가, 판매자 미동의 상품인 경우 선택저장불가 if (info.OverseasDeliveryYn.ToUpper() == "N" || info.AgreeYn.ToUpper() == "N") { if (fMsg == "") fMsg += gd_no; else fMsg += ", " + gd_no; continue; } // eBay VeRO 체크 string matchKeyword = null; bool isLimit = new eBayItemBiz().ContainseBayVeroKeyword(info.Name, out matchKeyword); if (isLimit == true) { if (fMsg == "") fMsg += gd_no; else fMsg += ", " + gd_no; continue; } if (string.IsNullOrWhiteSpace(info.EngName) == false) { isLimit = new eBayItemBiz().ContainseBayVeroKeyword(info.EngName, out matchKeyword); if (isLimit == true) { if (fMsg == "") fMsg += gd_no; else fMsg += ", " + gd_no; continue; } } GepItemsData resultGEPItem = new GepItemsData(); resultGEPItem._id = GetNextGEPItemID(); resultGEPItem.stat = "S2"; // resultGEPItemStatusEnum.Active; resultGEPItem.img = gd_img; resultGEPItem.src_site = "GMKT"; resultGEPItem.src_info = new src_info(); resultGEPItem.src_info.no = gd_no; resultGEPItem.src_info.name = info.Name; resultGEPItem.src_info.eng_name = info.EngName; resultGEPItem.src_info.seller = new seller(); resultGEPItem.src_info.seller.no = info.SellerNo; resultGEPItem.src_info.seller.sid = info.SellerID; resultGEPItem.src_info.seller.name = info.SellerName; resultGEPItem.src_info.seller.tel = info.SellerTel; resultGEPItem.src_info.seller.cell = info.SellerCell; resultGEPItem.src_info.seller.email = info.SellerEmail; resultGEPItem.src_info.lcategory = new lcategory(); resultGEPItem.src_info.lcategory.cid = info.LCategoryCode; resultGEPItem.src_info.lcategory.name = info.LCategoryName; resultGEPItem.src_info.mcategory = new mcategory(); resultGEPItem.src_info.mcategory.cid = info.MCategoryCode; resultGEPItem.src_info.mcategory.name = info.MCategoryName; resultGEPItem.src_info.scategory = new scategory(); resultGEPItem.src_info.scategory.cid = info.SCategoryCode; resultGEPItem.src_info.scategory.name = info.SCategoryName; resultGEPItem.src_info.desc = Desc; resultGEPItem.src_info.price = Util.GetSafeInt(info.SellPrice); resultGEPItem.src_info.settle_price = Util.GetSafeInt(info.CostPrice); resultGEPItem.src_info.qty = info.StockQty; resultGEPItem.src_info.weight = Util.GetSafeInt(info.Weight); resultGEPItem.src_info.dc = Util.GetSafeInt(info.SellerDiscountPrice); resultGEPItem.src_info.origin = info.Origin; resultGEPItem.src_info.dlv = new dlv(); resultGEPItem.src_info.dlv.dlv_gr_no = info.DeliveryGroupNo; resultGEPItem.src_info.dlv.dlv_gr_nm = info.DeliveryGroupName; resultGEPItem.src_info.dlv.bs_money = Util.GetSafeInt(info.BasisMoney); resultGEPItem.src_info.dlv.dlv_fee = Util.GetSafeInt(info.DeliveryFee); resultGEPItem.src_info.dlv.who_fee = info.WhoFee; resultGEPItem.src_info.dlv.bs_weight = Util.GetSafeInt(info.BasisWeight); resultGEPItem.src_info.dlv.bs_amt = Util.GetSafeInt(info.BasisAmount); resultGEPItem.src_info.dlv.bs_type = info.BasisType; resultGEPItem.src_info.dlv.dlv_fee_yn = info.DeliveryFeeYn; resultGEPItem.src_info.dlv.dlv_fee_cond = info.DeliveryFeeCondition; //resultGEPItem.src_info.sel_no //resultGEPItem.src_info.sel_name //resultGEPItem.src_info.sel_price //resultGEPItem.src_info.sel_qty resultGEPItem.src_info.overseas_sold_cnt = info.OverseasSoldCount; resultGEPItem.src_info.total_price = Util.GetSafeInt(info.SellPrice + info.DeliveryFee - info.SellerDiscountPrice); resultGEPItem.ver_code = ""; resultGEPItem.trans = new List<trans>(); resultGEPItem.is_exp = false; resultGEPItem.rdate = DateTime.Now; resultGEPItem.udate = DateTime.Now; resultGEPItem.ta = ta_id; resultGEPItem.total_exp_count = 0; resultGEPItem.latest_exp_date = DateTime.Now; resultGEPItem.exp_ta = ""; resultGEPItems.Add(resultGEPItem); } } // Batch Insert if (resultGEPItems.Count > 0) { new GmarketItemDac().InsertGEPItem(resultGEPItems); // 이관 History (Batch Insert한 건들은 필수선택이 없으므로 opt_no는 빈 값으로 넘김 foreach (GepItemsData i in resultGEPItems) { new GmarketItemDac().SetSourceItemHistory(ta_id, i.src_info.no, i._id, "", "", 0, 0); } } string resultMsg = "[작업완료]"; if (sMsg.Count > 0) { resultMsg += "\n성공 : " + sMsg[0] + " 외 " + sMsg.Count + "건"; } if (fMsg != "") { resultMsg += "\n실패 : " + fMsg; } return resultMsg; }
public JsonResult Save([ModelBinder(typeof(DynamicDictionaryObjectModelBinder))] eBayItemsDataForSeller data) { if (!ValidateSave(data)) { return Json(new { Success = false, Message = "잘못된 접근입니다." }); } dynamic dynData = data; //Debug.Assert(!String.IsNullOrWhiteSpace(dynData._id.ToString())); int Result = new eBayItemBiz().SeteBayItems(dynData._id, data); if (Result < 0) { return Json(new { Success = false, Message = "저장에 실패했습니다." }); } return Json(new { Success = true, Message = String.Empty }); }
/// <summary> /// eBay 상품 검색 /// 2차가공리스팅, 대기상품 리스팅, 상품관리 리스팅에서 호출 /// </summary> /// <param name="searchCriteria">검색조건</param> /// <returns></returns> public JsonResult Search([ModelBinder(typeof(JqGridPagingModelBinder))] eBayItemSearchModel searchCriteria) { if (!ModelState.IsValid) { //validation failed! //throw exception or something else } MongoPagingResult<eBayItemsData> mongoResult = new eBayItemBiz().List(MemberContext.LoginID, searchCriteria); return Json(ParseSearchResult(searchCriteria, mongoResult), JsonRequestBehavior.AllowGet); }
public void SeteBayItems(string id) { //정제 eBayItemsDataForSeller data = new eBayItemsDataForSeller(); //동작 int Result = new eBayItemBiz().SeteBayItems(id, data); //검증 Trace.WriteLine(Result.ToString()); }
public Boolean ValidateSave(eBayItemsDataForSeller data) { Dictionary<string, object> dic = (Dictionary<string, object>)data.AsDictionary(); if (dic.ContainsKey("_id") == false) { return false; } string ObjectID = dic["_id"].ToString(); if (ObjectID == "") { return false; } eBayItemsData objeBayItemData = new eBayItemBiz().GetEbayItemData(ObjectID); if (objeBayItemData == null) { return false; } ebayItemDataForSeller forSellerData = new eBayItemBiz().GetForSellerDataParseJSON(objeBayItemData.site, objeBayItemData.dynamicData.PrimaryCategoryID); foreach (var t in forSellerData.details) { if (t.isrequire == "true") { if (dic.ContainsKey(t.fieldName) == false || dic[t.fieldName] == null || dic[t.fieldName].ToString() == "") { return false; } } } return true; }
public void SetItemListingResult() { //정제 ItemListingResult Data = new ItemListingResult(); Data.InventoryID = "4f97556542887f4168377c5f"; Data.EndTime = "2011-01-01"; Data.StartTime = "2011-01-02"; Data.InventoryID = ""; //동작 bool Result = new eBayItemBiz().SetItemListingResult(Data); //검증 Trace.WriteLine("Result = " + Result); }
/// <summary> /// Verify 메세지 /// </summary> /// <param name="id">eBay 아이템 ID</param> /// <returns></returns> public JsonResult VerifyMessage(string id) { eBayItemsData data = new eBayItemBiz().VerifyMessage(id); return Json(data.ver_message, JsonRequestBehavior.AllowGet); }
public void TestPerformance() { //worst case //역설적으로 eBayKeyword를 포함하지 않는 대부분의 상품명이 알고리즘상 worst case에 해당함. //성능 테스트 작성함. String matchKeyword = null; var biz = new eBayItemBiz(); biz.ContainseBayVeroKeyword("괜춚한 상품명",out matchKeyword); Assert.IsFalse(biz.ContainseBayVeroKeyword("괜춚한 상품명", out matchKeyword)); }
public JsonResult eBayDeadLineItemsReRegisterRequest(string ebayItemsIds) { object result; if (ebayItemsIds == "") { result = "마감상품 번호가없습니다."; } else { result = new eBayItemBiz().SetDeadLineItemReRequest(ebayItemsIds); } return Json(result, JsonRequestBehavior.AllowGet); }
public void GetEbayItemData(string id) { //정제 & 동작 eBayItemsData Result = new eBayItemBiz().GetEbayItemData(id); //검증 if (Result == null) { Trace.WriteLine("eBayItemData이 없습니다"); } else { Trace.DumpBusinessEntity(Result); } }
internal void Process() { try { //eBayItems select where Listing 요청 건 List<eBayItemsData> list = new eBayItemBiz().GetItemListingList(); logger.InfoFormat("[Target List Count] : " + list.Count); foreach (var t in list) { logger.InfoFormat("[Start Process id] : " + t._id); //초기화 t.listingreq = new ListingRequest(); //데몬에서 읽었다는 표시. t.listingreq.is_comp = true; new eBayItemBiz().SaveItem(t); ClonItemCreateResult result = new ClonItemCreateResult(); //등록과 재등록의 구분 if (string.IsNullOrEmpty(t.cln_itemno)) { logger.InfoFormat("[Create Clon Product id] : " + t._id); //클론 상품 생성 result = CreateGMKTCloneProduct(t); } else { logger.InfoFormat("[ReCreate Clon Product id] : " + t._id); //등록된 상품 마감처리 var closeResult = CloseGMKTCloneProduct(t); if (closeResult.isException) { //마감 처리에 실패했을경우 t.listingreq.success = false; t.listingreq.message = closeResult.exceptionMessage; new eBayItemBiz().SaveItem(t); return; } //클론 상품 재등록 result = EditGMKTCloneProduct(t); } //실패일 경우 메세지및 상태값 처리한다. if (result.isException || result.GepCloneItemRegResultT.GoodsNo == "") { t.listingreq.success = false; t.listingreq.message = result.exceptionMessage; new eBayItemBiz().SaveItem(t); logger.InfoFormat("[GMKT Clon Fail id] : " + t._id); } //성공일 경우 forSeller와 통신 else { //클론상품에 대한 데이터 저장 t.cln_itemno = result.GepCloneItemRegResultT.GoodsNo; t.cln_selno = result.GepCloneItemRegResultT.CloneOptionNo; new eBayItemBiz().SaveItem(t); var forSellerResult = SetListItem(t); //메세지가 성공일 경우 if (forSellerResult.isResult) { t.listingreq.success = true; t.listingreq.message = ""; logger.InfoFormat("[forSeller Success id] : " + t._id); } //메세지가 실패일 경우 else { t.listingreq.success = false; t.listingreq.message = forSellerResult.Message; logger.InfoFormat("[forSeller Fail id] : " + t._id); } new eBayItemBiz().SaveItem(t); } } } catch (Exception ex) { logger.Error(string.Format("Exception!!\n[StackTrance]\n{0}", ex.StackTrace.ToString())); return; } }
public ActionResult GetForSellerDataParseJSONTest() { ebayItemDataForSeller forSellerDataParseJSON = new eBayItemBiz().GetForSellerDataParseJSON(0, 24087); return View(forSellerDataParseJSON); }