Beispiel #1
0
        public int SetItemConvertStopRequest(List<string> expireEbayId, StopRequestReason reason)
        {
            int result = 0;

            List<QueryComplete> param = new List<QueryComplete>();
            foreach (var arrIdx in expireEbayId)
            {
                param.Add(Query.EQ("ebay_acnt", arrIdx));
            }
            QueryComplete query = Query.Or(param.ToArray());

            // eBay item 읽어온후
            List<eBayItemsData> eBayItemList = new eBayItemDac().List(query).ToList();
            foreach (var listItem in eBayItemList)
            {
                if (listItem.stopreq != null)
                {
                    if (!listItem.stopreq.is_req)
                    {
                        StopRequest stopReauest = new StopRequest();
                        stopReauest.is_req = true;
                        stopReauest.reqdate = DateTime.Now;
                        stopReauest.reason = reason;

                        listItem.stopreq = stopReauest;
                        new eBayItemDac().Save(listItem);
                        result++;
                    }
                }
                else
                {
                    StopRequest stopReauest = new StopRequest();
                    stopReauest.is_req = true;
                    stopReauest.reqdate = DateTime.Now;
                    stopReauest.reason = reason;

                    listItem.stopreq = stopReauest;
                    new eBayItemDac().Save(listItem);
                    result++;
                }
            }
            return result;
        }
Beispiel #2
0
        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;
        }