Esempio n. 1
0
        private void FX3(int gid, int oid, string[] fromShareUserIds, decimal profit1, decimal profit2, decimal profit3)
        {
            string shareId = string.Empty;
            pbs_basic_MyShareProfitService pbsBasicMyShareProfitService = new pbs_basic_MyShareProfitService();

            ResultInfo <bool> resultIsExistByFromShareOrderId1 = pbsBasicMyShareProfitService.IsExistByFromShareOrderIdAndShareLevel(Utility.Util.ParseHelper.ToInt(Utility.Util.ParseHelper.ToInt(fromShareUserIds[0])), 3);

            if (resultIsExistByFromShareOrderId1.Result && !resultIsExistByFromShareOrderId1.Data)
            {
                //三级级分销
                ResultInfo <bool> resultAddMyShareProfit1 = pbsBasicMyShareProfitService.AddMyShareProfit(
                    Utility.Util.ParseHelper.ToInt(gid), 3, profit3, Utility.Util.ParseHelper.ToInt(fromShareUserIds[0]),
                    0, oid, DateTime.Now, DateTime.Now, 0, string.Empty, ref shareId);
            }

            ResultInfo <bool> resultIsExistByFromShareOrderId2 = pbsBasicMyShareProfitService.IsExistByFromShareOrderIdAndShareLevel(Utility.Util.ParseHelper.ToInt(Utility.Util.ParseHelper.ToInt(fromShareUserIds[0])), 2);

            if (resultIsExistByFromShareOrderId2.Result && !resultIsExistByFromShareOrderId2.Data)
            {
                //二级级分销
                ResultInfo <bool> resultAddMyShareProfit2 = pbsBasicMyShareProfitService.AddMyShareProfit(
                    Utility.Util.ParseHelper.ToInt(gid), 2, profit2, Utility.Util.ParseHelper.ToInt(fromShareUserIds[1]),
                    0, oid, DateTime.Now, DateTime.Now, 0, string.Empty, ref shareId);
            }

            ResultInfo <bool> resultIsExistByFromShareOrderId3 = pbsBasicMyShareProfitService.IsExistByFromShareOrderIdAndShareLevel(Utility.Util.ParseHelper.ToInt(Utility.Util.ParseHelper.ToInt(fromShareUserIds[1])), 1);

            if (resultIsExistByFromShareOrderId3.Result && !resultIsExistByFromShareOrderId3.Data)
            {
                //一级分销
                ResultInfo <bool> resultAddMyShareProfit3 = pbsBasicMyShareProfitService.AddMyShareProfit(
                    Utility.Util.ParseHelper.ToInt(gid), 1, profit1, Utility.Util.ParseHelper.ToInt(fromShareUserIds[2]),
                    0, oid, DateTime.Now, DateTime.Now, 0, string.Empty, ref shareId);
            }
        }
Esempio n. 2
0
 public void TestAddMyShareProfit()
 {
     string shareId = string.Empty;
     pbs_basic_MyShareProfitService pbsBasicMyShareProfitService = new pbs_basic_MyShareProfitService();
     int      goodsId             = 1111;
     int      shareLevel          = 1;
     decimal  profit              = 0;
     int      userId              = 2;
     int      fromShareOrderId    = 2222;
     int      currentShareOrderId = 3333;
     DateTime createTime          = DateTime.Now;
     DateTime updateTime          = DateTime.Now;
     int      creatorId           = 0;
     string   remark              = string.Empty;
     var      result              = pbsBasicMyShareProfitService.AddMyShareProfit(goodsId, shareLevel, profit, userId, fromShareOrderId, currentShareOrderId, createTime, updateTime, creatorId, remark, ref shareId);
 }