public int SeteBayOrderCancelReturn(SeteBayOrderCancelReturnRequest Request) { if (Request == null) return 0; eBayResultT result; try { result = new eBayOrderBiz().insertCancel(ConvertToeBayCancelT(Request)); } catch (GEPBizException ex) { ThriftException tEx = new ThriftException(); tEx.ExceptionCode = ex.ErrorCode; tEx.ExceptionMessage = ex.Message; logger.Error(string.Format("[Exception!!]\nTransaction ID : {0}\nItem ID : {1}\n{2}", Request.TransactionID, Request.ItemID, ex.ToString())); throw tEx; } catch (Exception ex) { ThriftException tEx = new ThriftException(); tEx.ExceptionCode = 0; tEx.ExceptionMessage = "알 수 없는 오류가 발생했습니다."; logger.Error(string.Format("[Exception!!]\nTransaction ID : {0}\nItem ID : {1}\n{2}", Request.TransactionID, Request.ItemID, ex.ToString())); throw tEx; } return (result != null && result.RetCode == RetCodeEnum.True) ? 1 : 0; }
public int SetClosedItem(SetClosedItemRequest Request) { if (Request == null) return 0; try { new eBayItemBiz().ItemClose(Request.InventoryID, Request.ItemID); } catch (GEPBizException ex) { ThriftException tEx = new ThriftException(); tEx.ExceptionCode = ex.ErrorCode; tEx.ExceptionMessage = ex.Message; logger.Error(string.Format("[Exception!!]\nInventoryID : {0}\nItem ID : {1}\n{2}", Request.InventoryID, Request.ItemID, ex.ToString())); throw tEx; } catch (Exception ex) { ThriftException tException = new ThriftException(); tException.ExceptionCode = 3; tException.ExceptionMessage = "알 수 없는 오류가 발생했습니다."; logger.Error(string.Format("[Exception!!]\nInventoryID : {0}\nItem ID : {1}\n{2}", Request.InventoryID, Request.ItemID, ex.ToString())); throw tException; } return 1; }
public int SeteBayAccountInfo(SeteBayAccountInfoRequest Request) { int returnValue = 0; logger.InfoFormat("Request UserID : {0}", Request.ToString()); logger.Info(string.Format("eBayToken {0}, eBayUserId {1}, expireDate{2}, userId{3}", Request.EbayTokenID, Request.EbayUserID, Request.ExpireDate, Request.UserID)); if (Request == null) return 0; if (string.IsNullOrEmpty(Request.UserID) == true) return 0; if (Request.EbayTokenID.Equals(0)) return 0; try { CBT.GEP.Data.TaInfo taInfo = new CBT.GEP.BizDac.TaInfoBiz().FindTaUser(Request.UserID); if (taInfo != null) { new CBT.GEP.BizDac.TaInfoBiz().TaAccountUpsert(Request.UserID, "ebay", Request.EbayUserID, Request.EbayTokenID.ToString(), CBT.GEP.Common.Util.Util.GetSafeDateTime(Request.ExpireDate)); returnValue = 1; } else { returnValue = 0; } } catch (Exception ex) { returnValue = 0; ThriftException tException = new ThriftException(); tException.ExceptionCode= 3; tException.ExceptionMessage = ex.ToString(); logger.Error(string.Format("[Exception!!]\nUserID : {0}\neBay ID : {1}\n{2}", Request.UserID, Request.EbayUserID, ex.StackTrace)); //logger.Error(ex.Message); throw tException; } return returnValue; }
/// <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; }