コード例 #1
0
ファイル: OrderHelper.cs プロジェクト: mccj/FOMS
        public static int GetBuyer(string BuyerCode, PlatformType platformType)
        {
            OMS.Core.DoMain.BuyerType bt = OMS.Core.DoMain.BuyerType.find("BuyerCode='" + BuyerCode + "' and  PlatformCode ='" + platformType.ToString() + "'").first();
            if (bt == null)
            {
                bt = new Core.DoMain.BuyerType();
                //不存在是的操作
                bt.BuyerCode = BuyerCode;
                bt.PlatformCode = platformType.ToString();

                bt.BuyCount++;
                bt.insert();
            }
            else
            {
                bt.BuyCount++;
                bt.update();
            }
            return bt.Id;
        }
コード例 #2
0
ファイル: EbayOrderUtil.cs プロジェクト: mccj/FOMS
        private static void GetBuyer(OMS.Core.DoMain.OrderType order)
        {
            OMS.Core.DoMain.BuyerType bt = OMS.Core.DoMain.BuyerType.find("BuyerCode='" + order.BuyerCode + "' and  PlatformCode ='" + PlatformType.Ebay.ToString() + "'").first();
            if (bt == null)
            {
                bt = new Core.DoMain.BuyerType();
                //不存在是的操作
                bt.BuyerCode = order.BuyerCode;
                bt.PlatformCode = PlatformType.Ebay.ToString();

                bt.BuyCount++;
                bt.insert();
            }
            else
            {
                bt.BuyCount++;
                bt.update();
            }
            order.BuyerId = bt.Id.ToString();
        }