예제 #1
0
        /// <summary>
        /// 设置半波
        /// </summary>
        public void Set_Wave(Globe_Clue item, List <Wave> Wave_List, List <Globe> GlobeList)
        {
            try
            {
                string[] globe_clues = item.Clue.Split(new char[] { ',' });
                string[] globe_pays  = item.Pay.Split(new char[] { ',' });
                for (int i = 0; i < globe_clues.Length; i++)
                {
                    int  clue = Convert.ToInt32(globe_clues[i]);
                    Wave wave = Wave_List.FirstOrDefault(g => g.Code == clue);
                    if (wave != null)
                    {
                        float  pay    = float.Parse(globe_pays[i]);
                        Wave_S Wave_S = Wave_S.GetBase(wave, pay);

                        List <Globe_S> templist = new List <Globe_S>();
                        foreach (var code in Wave_S.GlobeCodeList)
                        {
                            Globe globle = GlobeList.FirstOrDefault(c => c.Code == code);
                            if (globle != null)
                            {
                                Globe_S globle_s = Globe_S.GetBase(globle);
                                templist.Add(globle_s);
                            }
                        }
                        Wave_S.GlobeList = templist.ToArray();
                        this.Wave_List.Add(Wave_S);
                    }
                }
            }
            catch (Exception ex)
            {
                LogHelper.Error(ex);
            }
        }
예제 #2
0
        public static Globe_ClueCombineAnimal GetBase(Globe_Clue item)
        {
            Globe_ClueCombineAnimal model = null;

            try
            {
                model = new Globe_ClueCombineAnimal()
                {
                    Id          = item.Id,
                    Code        = item.Code,
                    First_Name  = item.First_Name,
                    First_Type  = item.First_Type,
                    Limit_Max   = item.Limit_Max,
                    Limit_Min   = item.Limit_Min,
                    IsEnable    = item.IsEnable,
                    Second_Name = item.Second_Name,
                    Second_Type = item.Second_Type,
                    Return_Pay  = Convert.ToDecimal(item.Return_Pay),
                    Return_Pay2 = Convert.ToDecimal(item.Return_Pay2),
                };
            }
            catch (Exception ex)
            {
                LogHelper.Error(ex);
            }
            return(model);
        }
예제 #3
0
        /// <summary>
        /// 设置生肖
        /// </summary>
        public void Set_Animal(Globe_Clue item, List <Animal_Info> Animal_Info_List, List <Globe> GlobeList)
        {
            try
            {
                string[] globe_clues = item.Clue.Split(new char[] { ',' });
                string[] globe_pays  = item.Pay.Split(new char[] { ',' });
                for (int i = 0; i < globe_clues.Length; i++)
                {
                    int         clue        = Convert.ToInt32(globe_clues[i]);
                    Animal_Info animal_Info = Animal_Info_List.FirstOrDefault(g => g.Code == clue);
                    if (animal_Info != null)
                    {
                        float         pay          = float.Parse(globe_pays[i]);
                        Animal_Info_S Animal_InfoS = Animal_Info_S.GetBase(animal_Info, pay);

                        List <Globe_S> templist = new List <Globe_S>();
                        foreach (var code in Animal_InfoS.GlobeCodeList)
                        {
                            Globe globle = GlobeList.FirstOrDefault(c => c.Code == code);
                            if (globle != null)
                            {
                                Globe_S globle_s = Globe_S.GetBase(globle);
                                templist.Add(globle_s);
                            }
                        }
                        Animal_InfoS.GlobeList = templist.ToArray();
                        this.Animal_List.Add(Animal_InfoS);
                    }
                }
            }
            catch (Exception ex)
            {
                LogHelper.Error(ex);
            }
        }
예제 #4
0
        /// <summary>
        /// 设置辅助
        /// </summary>
        /// <param name="Type"></param>
        /// <param name="pay1"></param>
        /// <param name="pay2"></param>
        /// <returns></returns>
        public static JsonModel Globe_PaySetting_Helper(string Code, string pay1, string pay2, decimal Return_Pay, decimal Return_Pay2)
        {
            JsonModel jsm = null;

            try
            {
                //GlobeClueType GlobeClueType = (GlobeClueType)Enum.Parse(typeof(GlobeClueType), Type);
                Globe_Clue globe_Clue = Constant.Globe_Clue_List.FirstOrDefault(i => Convert.ToString(i.Code) == Code);
                if (globe_Clue != null)
                {
                    Globe_Clue globe_clue_clone = Constant.Clone <Globe_Clue>(globe_Clue);
                    globe_clue_clone.Pay         = pay1;
                    globe_clue_clone.Pay2        = pay2;
                    globe_clue_clone.Return_Pay  = Return_Pay;
                    globe_clue_clone.Return_Pay2 = Return_Pay2;
                    jsm = Constant.Globe_Clue_S.Update(globe_clue_clone);
                    if (jsm.errNum == 0)
                    {
                        globe_Clue.Pay         = pay1;
                        globe_Clue.Pay2        = pay2;
                        globe_Clue.Return_Pay  = Return_Pay;
                        globe_Clue.Return_Pay2 = Return_Pay2;
                    }
                }
                else
                {
                    jsm = JsonModel.GetJsonModel(300, "successed", "该规则不存在");
                }
            }
            catch (Exception ex)
            {
                LogHelper.Error(ex);
            }
            return(jsm);
        }
예제 #5
0
        public static decimal GetAward(Globe_Clue clue, string PrizeContent, Operation_Record record, List <Globe> Globe_List, List <Size_SpecialNormal> Size_Special_List, ref List <Araw_Return_S> Araw_Return_Ss, ref List <string> NoAwardList, ref List <string> AwardList, ref int paytype)
        {
            decimal getdecimal = 0;

            try
            {
                List <Globe_S>      globes       = Globe_S.GetBase(record.Buy_Content, Globe_List, record.BuyPayReturn);
                List <Size_NormalS> Size_Normals = Size_NormalS.GetBase(record.Buy_Content2, Size_Special_List, record.BuyPayReturn2);
                var cont1_6 = PrizeContent.Length >= 7 ? Split_Hepler.str_to_stringss(PrizeContent)[(int)clue.Second_Type - 1] : "0";
                //特奖
                int conti1_6 = Convert.ToInt32(cont1_6);

                if (!string.IsNullOrEmpty(record.Buy_Content))
                {
                    paytype = 0;
                    List <int> contents = Split_Hepler.str_to_ints(record.Buy_Content).ToList();
                    if (contents.Contains(conti1_6))
                    {
                        Globe_S globe_ss = globes.FirstOrDefault(i => i.Code == conti1_6);
                        if (globe_ss != null)
                        {
                            getdecimal += (decimal)(globe_ss.PayReturn * record.UnitPrice);
                            AwardList.Add(globe_ss.Name);
                        }
                    }
                }
                else if (!string.IsNullOrEmpty(record.Buy_Content2))
                {
                    paytype = 1;
                    List <int> contents2 = Split_Hepler.str_to_ints(record.Buy_Content2).ToList();
                    foreach (var buycontent in contents2)
                    {
                        Size_NormalS size_NormalS = Size_Normals.FirstOrDefault(i => i.Code == buycontent);
                        if (size_NormalS.GlobeCodeList.Contains(conti1_6))
                        {
                            //if (conti1_6 == 49 && size_NormalS.IsEnable == (int)IsEnable.Enable)
                            //{
                            //    //使用和局
                            //    Araw_Return_Ss.Add(new Araw_Return_S() { Name = size_NormalS.Name, Araw_Money = (decimal)record.UnitPrice });
                            //}
                            //else
                            //{
                            getdecimal += (decimal)(size_NormalS.PayReturn * record.UnitPrice);
                            AwardList.Add(size_NormalS.Name);
                            //}
                        }
                        else
                        {
                            NoAwardList.Add(size_NormalS.Name);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                LogHelper.Error(ex);
            }
            return(getdecimal);
        }
예제 #6
0
 public static void SetContent(List <Operation_Record_S> recordList_get, List <Globe_Clue> Globe_Clue_List)
 {
     try
     {
         foreach (var item in recordList_get)
         {
             Globe_Clue clue = Globe_Clue_List.FirstOrDefault(i => i.Code == item.ClueCode);
             if (clue != null)
             {
                 SetContent(clue, item);
             }
         }
     }
     catch (Exception ex)
     {
         LogHelper.Error(ex);
     }
 }
예제 #7
0
 /// <summary>
 /// 设置尾数
 /// </summary>
 public void Set_DetailF(Globe_Clue item, List <Detail> Detail_List)
 {
     try
     {
         string[] globe_clues = item.Clue.Split(new char[] { ',' });
         string[] globe_pays  = item.Pay.Split(new char[] { ',' });
         for (int i = 0; i < globe_clues.Length; i++)
         {
             int    clue   = Convert.ToInt32(globe_clues[i]);
             Detail Detail = Detail_List.FirstOrDefault(g => g.Code == clue);
             if (Detail != null)
             {
                 float    pay      = float.Parse(globe_pays[i]);
                 Detail_S Detail_S = Detail_S.GetBase(Detail, pay);
                 this.Detail_List.Add(Detail_S);
             }
         }
     }
     catch (Exception ex)
     {
         LogHelper.Error(ex);
     }
 }
예제 #8
0
 /// <summary>
 /// 设置6系
 /// </summary>
 public void Set_SizeSix(Globe_Clue item, List <Size_Six> Size_Six_List)
 {
     try
     {
         string[] globe_clues = item.Clue.Split(new char[] { ',' });
         string[] globe_pays  = item.Pay.Split(new char[] { ',' });
         for (int i = 0; i < globe_clues.Length; i++)
         {
             int      clue     = Convert.ToInt32(globe_clues[i]);
             Size_Six Size_Six = Size_Six_List.FirstOrDefault(g => g.Code == clue);
             if (Size_Six != null)
             {
                 float      pay        = float.Parse(globe_pays[i]);
                 Size_Six_S Size_Six_S = Size_Six_S.GetBase(Size_Six, pay);
                 this.Size_Six_S_List.Add(Size_Six_S);
             }
         }
     }
     catch (Exception ex)
     {
         LogHelper.Error(ex);
     }
 }
예제 #9
0
        /// <summary>
        /// 设置正码个例
        /// </summary>
        public void Set_SizeNormal(Globe_Clue item, List <Size_SpecialNormal> Size_SpecialNormal_List)
        {
            try
            {
                string[] globe_clues2 = item.Clue2.Split(new char[] { ',' });
                string[] globe_pays2  = item.Pay2.Split(new char[] { ',' });
                for (int i = 0; i < globe_clues2.Length; i++)
                {
                    int   clue = Convert.ToInt32(globe_clues2[i]);
                    float pay  = float.Parse(globe_pays2[i]);

                    Size_SpecialNormal size_Special = Size_SpecialNormal_List.FirstOrDefault(g => g.Code == clue);
                    if (size_Special != null)
                    {
                        Size_NormalS Size_NormalS = Size_NormalS.GetBase(size_Special, pay);
                        this.Size_NormalS_List.Add(Size_NormalS);
                    }
                }
            }
            catch (Exception ex)
            {
                LogHelper.Error(ex);
            }
        }
예제 #10
0
        public static void SetContent(Globe_Clue clue, Operation_Record_S item)
        {
            try
            {
                GlobeClueType GlobeClueType = (GlobeClueType)clue.First_Type;
                switch (GlobeClueType)
                {
                case GlobeClueType.Special:
                    item.BuyDisplay     = Globe_S.GetBase_Str(item.Buy_Content, Constant.Globe_List);
                    item.FirstGlobeList = Globe_S.GetBase(item.Buy_Content, Constant.Globe_List);
                    item.FirstIsGloble  = true;
                    item.BuyDisplay2    = Size_S.GetBase_Str(item.Buy_Content2, Constant.Size_Special_List);
                    break;

                case GlobeClueType.Normal:
                    item.BuyDisplay     = Globe_S.GetBase_Str(item.Buy_Content, Constant.Globe_List);
                    item.FirstGlobeList = Globe_S.GetBase(item.Buy_Content, Constant.Globe_List);
                    item.FirstIsGloble  = true;
                    break;

                case GlobeClueType.SpecialNormal:
                    item.BuyDisplay     = Globe_S.GetBase_Str(item.Buy_Content, Constant.Globe_List);
                    item.FirstGlobeList = Globe_S.GetBase(item.Buy_Content, Constant.Globe_List);
                    item.FirstIsGloble  = true;
                    item.BuyDisplay2    = Size_NormalS.GetBase_Str(item.Buy_Content2, Constant.Size_SpecialNormal_List);
                    break;

                case GlobeClueType.NormalSix:
                    item.BuyDisplay = Size_Six_S.GetBase_Str(item.Buy_Content, Constant.Size_Six_List);
                    break;

                case GlobeClueType.Line:
                    item.BuyDisplay     = Globe_S.GetBase_Str(item.Buy_Content, Constant.Globe_List);
                    item.FirstGlobeList = Globe_S.GetBase(item.Buy_Content, Constant.Globe_List);
                    item.FirstIsGloble  = true;
                    break;

                case GlobeClueType.Wave:
                    item.BuyDisplay = Wave_S.GetBase_Str(item.Buy_Content, Constant.Wave_List);
                    break;

                case GlobeClueType.Detail:
                    item.BuyDisplay  = Animal_Info_S.GetBase_Str(item.Buy_Content, Constant.Animal_Info_List);
                    item.BuyDisplay2 = Detail_S.GetBase_Str(item.Buy_Content2, Constant.Detail_List);
                    break;

                case GlobeClueType.SpecialAnimal:
                    item.BuyDisplay = Animal_Info_S.GetBase_Str(item.Buy_Content, Constant.Animal_Info_List);
                    break;

                case GlobeClueType.CombineAnimal:
                    item.BuyDisplay = Animal_Info_S.GetBase_Str(item.Buy_Content, Constant.Animal_Info_List);
                    break;

                case GlobeClueType.LineAnimal:
                    item.BuyDisplay = Animal_Info_S.GetBase_Str(item.Buy_Content, Constant.Animal_Info_List);
                    break;

                case GlobeClueType.LineDetail:
                    item.BuyDisplay = Detail_S.GetBase_Str(item.Buy_Content, Constant.Detail_List);
                    break;

                case GlobeClueType.NotAll:
                    item.BuyDisplay     = Globe_S.GetBase_Str(item.Buy_Content, Constant.Globe_List);
                    item.FirstGlobeList = Globe_S.GetBase(item.Buy_Content, Constant.Globe_List);
                    item.FirstIsGloble  = true;
                    break;

                default:
                    break;
                }
            }
            catch (Exception ex)
            {
                LogHelper.Error(ex);
            }
        }
예제 #11
0
        public static Operation_Record_S Get_Operation_Record_S(Operation_Record record, Award_Public award, Globe_Clue clue, UserInfo user, List <Globe> Globe_List)
        {
            Operation_Record_S Operation_Record_S = new Operation_Record_S();

            try
            {
                Operation_Record_S = new Operation_Record_S()
                {
                    Id            = (int)record.Id,
                    AwardCode     = (int)record.AwardCode,
                    ClueCode      = (int)record.ClueCode,
                    Buy_Content   = record.Buy_Content,
                    Buy_Content2  = record.Buy_Content2,
                    BuyPayReturn  = record.BuyPayReturn,
                    BuyPayReturn2 = record.BuyPayReturn2,
                    UnitPrice     = (int)record.UnitPrice,

                    CreateTime         = (DateTime)record.CreateTime,
                    Operation_Time     = (DateTime)record.Operation_Time,
                    IsWin              = (int)record.IsWin,
                    UserID             = record.UserID,
                    Get_Money          = (decimal)record.Get_Money,
                    Araw_ReturnMoney   = (decimal)record.Araw_ReturnMoney,
                    Araw_RetrunContent = record.Araw_RetrunContent,
                    Using_Money        = (decimal)record.Using_Money,
                    Return_Money       = (decimal)record.Return_Money,

                    Win_Money    = (decimal)(record.Get_Money + record.Araw_ReturnMoney + record.Return_Money - record.Using_Money),
                    Year         = award.Year,
                    award_Name   = award.Name,
                    PrizeContent = award.PrizeContent,

                    First_Name  = clue.First_Name,
                    Second_Name = clue.Second_Name,
                    user_Name   = user.Name,

                    GlobeList = Globe_S.GetBase(award.PrizeContent, Globe_List),
                };
            }
            catch (Exception ex)
            {
                LogHelper.Error(ex);
            }
            return(Operation_Record_S);
        }
예제 #12
0
        public static void MoneyAnsys(Operation_Record Operation_Record
                                      , decimal Using_Money, UserInfo userInfo, MoneyType MoneyType, string Araw_RetrunContent)
        {
            try
            {
                List <Award_Public>     Award_Public_List     = Constant.Award_Public_List;
                List <Operation_Record> Operation_Record_List = Constant.Operation_Record_List;
                List <Globe_Clue>       Globe_Clue_List       = Constant.Globe_Clue_List;
                List <UserInfo>         UserInfo_List         = Constant.userInfo_List;
                List <Globe>            Globe_List            = Constant.Globe_List;
                List <MoneyLog>         MoneyLog_List         = Constant.MoneyLog_List;

                MoneyLog MoneyLog = MoneyLog = new MoneyLog()
                {
                    UserID        = userInfo.LoginName,
                    UserName      = userInfo.Name,
                    O_Money       = Using_Money,
                    CreateTime    = DateTime.Now,
                    OperationType = (int)MoneyType,
                    CreateUID     = userInfo.LoginName,
                    IsDelete      = 0,
                    IsEnable      = (int)IsEnable.Enable,
                };
                if (MoneyType == TLC_Model.Enums.MoneyType.充值)
                {
                    MoneyLog.Type      = (int)MoneyLogType.Add;
                    MoneyLog.O_Content = "操作内容:" + "充值" + ";金额:" + Using_Money;
                }
                else if (MoneyType == TLC_Model.Enums.MoneyType.提现)
                {
                    MoneyLog.Type      = (int)MoneyLogType.Reduce;
                    MoneyLog.O_Content = "操作内容:" + "提现" + ";金额:" + Using_Money;
                }
                else
                {
                    //为了做支出支入做统计
                    Globe_Clue         clue         = Globe_Clue_List.FirstOrDefault(i => i.Code == Operation_Record.ClueCode);
                    Award_Public       Award_Public = Award_Public_List.FirstOrDefault(i => i.Code == Operation_Record.AwardCode);
                    Operation_Record_S os           = OperationManage.Get_Operation_Record_S(Operation_Record, Award_Public, clue, userInfo, Globe_List);
                    OperationManage.SetContent(clue, os);
                    switch (MoneyType)
                    {
                    case MoneyType.注:
                        MoneyLog.Type      = (int)MoneyLogType.Reduce;
                        MoneyLog.O_Content = "操作内容:" + "下注->" + "年号->" + Award_Public.Year + "期号->" + Award_Public.Name + clue.First_Name + "->" +
                                             clue.Second_Name + "->下注内容(" + os.BuyDisplay + os.BuyDisplay2 + ")->下注单价(" + Operation_Record.UnitPrice + ")" + ";金额:" + Using_Money;
                        break;

                    case MoneyType.返还奖金:
                        MoneyLog.Type      = (int)MoneyLogType.Add;
                        MoneyLog.O_Content = "操作内容:" + "返水->" + "年号->" + Award_Public.Year + "期号->" + Award_Public.Name + clue.First_Name + "->" +
                                             clue.Second_Name + "->下注内容(" + os.BuyDisplay + os.BuyDisplay2 + ")->下注单价(" + Operation_Record.UnitPrice + ")" + ";金额:" + Using_Money;
                        break;

                    case MoneyType.中奖:
                        MoneyLog.Type      = (int)MoneyLogType.Add;
                        MoneyLog.O_Content = "操作内容:" + "中奖->" + "年号->" + Award_Public.Year + "期号->" + Award_Public.Name + clue.First_Name + "->" +
                                             clue.Second_Name + "->下注内容(" + os.BuyDisplay + os.BuyDisplay2 + ")->下注单价(" + Operation_Record.UnitPrice + ")" + ")->派奖内容【" + Araw_RetrunContent + "】" + ";金额:" + Using_Money;
                        break;

                    case MoneyType.综合:
                        MoneyLog.Type      = (int)MoneyLogType.Add;
                        MoneyLog.O_Content = "操作内容:" + "和局->" + "年号->" + Award_Public.Year + "期号->" + Award_Public.Name + clue.First_Name + "->" +
                                             clue.Second_Name + "->下注内容(" + os.BuyDisplay + os.BuyDisplay2 + ")->下注单价(" + Operation_Record.UnitPrice + ")" + ")->派奖内容【" + Araw_RetrunContent + "】" + ";金额:" + Using_Money;
                        break;

                    case MoneyType.充值:

                    default:
                        break;
                    }
                }
                var jsm = Constant.MoneyLog_S.Add(MoneyLog);
                if (jsm.errNum == 0)
                {
                    MoneyLog.Id = Convert.ToInt32(jsm.retData);
                    MoneyLog_List.Add(MoneyLog);
                }
            }
            catch (Exception ex)
            {
                LogHelper.Error(ex);
            }
        }
예제 #13
0
        /// <summary>
        /// 结果处理
        /// </summary>
        /// <param name="Award_Public"></param>
        /// <param name="record"></param>
        public static void AwardDealWidth(Award_Public Award_Public, Operation_Record record, string PrizeContent)
        {
            try
            {
                List <UserInfo>      UserInfo_List  = Constant.UserInfo_List;
                Globe_Clue           clue           = Constant.Globe_Clue_List.FirstOrDefault(i => i.Code == record.ClueCode);
                decimal              getMoney       = 0;
                List <Araw_Return_S> Araw_Return_Ss = new List <Araw_Return_S>();
                List <string>        NoAwardList    = new List <string>();
                List <string>        AwardList      = new List <string>();

                int paytype = 0;
                if (!string.IsNullOrEmpty(PrizeContent))
                {
                    if (clue != null)
                    {
                        switch ((GlobeClueType)clue.First_Type)
                        {
                        case GlobeClueType.Special:
                            getMoney = SpecialModel.GetAward(PrizeContent, record, Constant.Globe_List, Constant.Size_Special_List, ref Araw_Return_Ss, ref NoAwardList, ref AwardList, ref paytype);
                            break;

                        case GlobeClueType.Normal:
                            getMoney = NormalModel.GetAward(PrizeContent, record, Constant.Globe_List, ref AwardList);
                            break;

                        case GlobeClueType.SpecialNormal:
                            getMoney = SpecialNormalModel.GetAward(clue, PrizeContent, record, Constant.Globe_List, Constant.Size_SpecialNormal_List, ref Araw_Return_Ss, ref NoAwardList, ref AwardList, ref paytype);
                            break;

                        case GlobeClueType.NormalSix:
                            getMoney = NormalSixModel.GetAward(PrizeContent, record, Constant.Size_Six_List, ref Araw_Return_Ss, ref NoAwardList, ref AwardList);
                            break;

                        case GlobeClueType.Line:
                            getMoney = LineModel.GetAward(clue, PrizeContent, record, ref AwardList);
                            break;

                        case GlobeClueType.Wave:
                            getMoney = WaveModel.GetAward(PrizeContent, record, Constant.Wave_List, ref Araw_Return_Ss, ref NoAwardList, ref AwardList);
                            break;

                        case GlobeClueType.Detail:
                            getMoney = Globe_ClueDetail.GetAward(PrizeContent, record, Constant.Animal_Info_List, Constant.Detail_List, ref AwardList);
                            break;

                        case GlobeClueType.SpecialAnimal:
                            getMoney = SpecialAnimalModel.GetAward(PrizeContent, record, Constant.Animal_Info_List, ref AwardList);
                            break;

                        case GlobeClueType.CombineAnimal:
                            getMoney = Globe_ClueCombineAnimal.GetAward(PrizeContent, record, Constant.Animal_Info_List, ref Araw_Return_Ss, ref NoAwardList, ref AwardList);
                            break;

                        case GlobeClueType.LineAnimal:
                            getMoney = LineAnimalModel.GetAward(clue, PrizeContent, record, Constant.Animal_Info_List, ref AwardList);
                            break;

                        case GlobeClueType.LineDetail:
                            getMoney = LineDetaillModel.GetAward(clue, PrizeContent, record, Constant.Detail_List, ref AwardList);
                            break;

                        case GlobeClueType.NotAll:
                            getMoney = NotAllModel.GetAward(PrizeContent, record);
                            break;

                        default:
                            break;
                        }
                    }
                }
                //最终完成【结束】
                Operation_Record record_Clone = Constant.Clone <Operation_Record>(record);

                if (paytype == 1)
                {
                    //返率的钱
                    record_Clone.Return_Money = (decimal)(clue.Return_Pay2 * record_Clone.Using_Money);
                }
                else
                {
                    //返率的钱
                    record_Clone.Return_Money = (decimal)(clue.Return_Pay * record_Clone.Using_Money);
                }

                //获奖的钱
                record_Clone.Get_Money = (decimal)getMoney;

                if (Araw_Return_Ss.Count > 0)
                {
                    #region  和局的情况下

                    //record_Clone.IsWin = (int)IsWinType.综合;
                    //record_Clone.Araw_ReturnMoney = 0;
                    //record_Clone.Araw_RetrunContent = "和局:(";
                    //for (int i = 0; i < Araw_Return_Ss.Count ; i++)
                    //{
                    //    //和局返的钱
                    //    record_Clone.Araw_ReturnMoney += Araw_Return_Ss[i].Araw_Money;
                    //    if (i != Araw_Return_Ss.Count - 1)
                    //    {
                    //        record_Clone.Araw_RetrunContent += Araw_Return_Ss[i].Name += ",";
                    //    }
                    //    else
                    //    {
                    //        record_Clone.Araw_RetrunContent += Araw_Return_Ss[i].Name += ")";
                    //    }

                    //}
                    //if (NoAwardList.Count > 0)
                    //{
                    //    record_Clone.Araw_RetrunContent += "、不中奖:(";
                    //    for (int i = 0; i < NoAwardList.Count; i++)
                    //    {
                    //        if (i != NoAwardList.Count - 1)
                    //        {
                    //            record_Clone.Araw_RetrunContent += NoAwardList[i] += ",";
                    //        }
                    //        else
                    //        {
                    //            record_Clone.Araw_RetrunContent += NoAwardList[i] += ")";
                    //        }

                    //    }
                    //}

                    //if (AwardList.Count > 0)
                    //{
                    //    record_Clone.Araw_RetrunContent += "、中奖:(";
                    //    for (int i = 0; i < AwardList.Count; i++)
                    //    {
                    //        if (i != AwardList.Count - 1)
                    //        {
                    //            record_Clone.Araw_RetrunContent += AwardList[i] += ",";
                    //        }
                    //        else
                    //        {
                    //            record_Clone.Araw_RetrunContent += AwardList[i] += ")";
                    //        }

                    //    }
                    //}

                    #endregion
                }
                else if (record_Clone.Get_Money > 0)
                {
                    record_Clone.IsWin = (int)IsWinType.获奖;

                    if (AwardList.Count > 0)
                    {
                        record_Clone.Araw_RetrunContent += "中奖:(";
                        for (int i = 0; i < AwardList.Count; i++)
                        {
                            if (i != AwardList.Count - 1)
                            {
                                record_Clone.Araw_RetrunContent += AwardList[i] += ",";
                            }
                            else
                            {
                                record_Clone.Araw_RetrunContent += AwardList[i] += ")";
                            }
                        }
                    }
                }
                else
                {
                    record_Clone.IsWin = (int)IsWinType.未获奖;
                }

                var jsm = Constant.Operation_Record_S.Update(record_Clone);
                if (jsm.errNum == 0)
                {
                    record.Get_Money          = record_Clone.Get_Money;
                    record.Return_Money       = record_Clone.Return_Money;
                    record.Araw_ReturnMoney   = record_Clone.Araw_ReturnMoney;
                    record.Araw_RetrunContent = record_Clone.Araw_RetrunContent;
                    record.IsWin = record_Clone.IsWin;

                    UserInfo user = UserInfo_List.FirstOrDefault(u => u.LoginName == record.UserID);
                    if (user != null)
                    {
                        UserInfo userinfo_Clone = Constant.Clone <UserInfo>(user);
                        userinfo_Clone.Money += record_Clone.Get_Money;
                        userinfo_Clone.Money += record.Araw_ReturnMoney;
                        userinfo_Clone.Money += record.Return_Money;
                        var jsm2 = Constant.UserInfo_S.Update(userinfo_Clone);
                        if (jsm2.errNum == 0)
                        {
                            user.Money += record_Clone.Get_Money;
                            user.Money += record.Araw_ReturnMoney;
                            user.Money += record.Return_Money;

                            if (record.Get_Money > 0)
                            {
                                //支出支入
                                Constant.MoneyAnsys(record, (decimal)record.Get_Money, user, MoneyType.中奖, record.Araw_RetrunContent);
                            }
                            if (record.Araw_ReturnMoney > 0)
                            {
                                //支出支入
                                //Constant.MoneyAnsys(record, (decimal)record.Araw_ReturnMoney, user, MoneyType.综合, record.Araw_RetrunContent);
                            }
                            if (record.Return_Money > 0)
                            {
                                //支出支入
                                Constant.MoneyAnsys(record, (decimal)record.Return_Money, user, MoneyType.返还奖金, "");
                            }
                        }
                        else
                        {
                            jsm = JsonModel.GetJsonModel(300, "操作失败");
                        }
                    }
                    else
                    {
                        jsm = JsonModel.GetJsonModel(300, "操作失败");
                    }
                }
                else
                {
                    jsm = JsonModel.GetJsonModel(300, "操作失败");
                }
            }
            catch (Exception ex)
            {
                LogHelper.Error(ex);
            }
        }
예제 #14
0
        public static decimal GetAward(Globe_Clue Globe_Clue, string PrizeContent, Operation_Record record, List <Animal_Info> Animal_Info_List, ref List <string> AwardList)
        {
            decimal getdecimal = 0;
            string  animals    = string.Empty;

            try
            {
                List <Animal_Info_S> Animal_Info_Ss = Animal_Info_S.GetBase(record.Buy_Content, Animal_Info_List, record.BuyPayReturn);

                List <int> contListall = Split_Hepler.str_to_ints(PrizeContent).ToList();

                int            count    = 0;
                LineAnimalType LineType = (LineAnimalType)Globe_Clue.Second_Type;
                if (LineType == LineAnimalType.二肖连中 || LineType == LineAnimalType.肖连中 || LineType == LineAnimalType.四肖连中 ||
                    LineType == LineAnimalType.五肖连中)
                {
                    foreach (var animal in Animal_Info_Ss)
                    {
                        foreach (var awardGlobe in contListall)
                        {
                            if (animal.GlobeCodeList.Contains(awardGlobe))
                            {
                                count++;
                                animals += animal.Name + ",";
                                break;
                            }
                        }
                    }
                    if (count >= Animal_Info_Ss.Count)
                    {
                        getdecimal += (decimal)(record.MinPayReturn * record.UnitPrice);
                        AwardList.Add(animals);
                    }
                }
                else if (LineType == LineAnimalType.二肖连不中 || LineType == LineAnimalType.肖连不中 || LineType == LineAnimalType.四肖连不中)
                {
                    foreach (var animal in Animal_Info_Ss)
                    {
                        bool NoAdd = false;
                        foreach (var awardGlobe in contListall)
                        {
                            if (animal.GlobeCodeList.Contains(awardGlobe))
                            {
                                NoAdd = true;
                                break;
                            }
                        }
                        if (!NoAdd)
                        {
                            count++;
                        }
                    }
                    if (count >= Animal_Info_Ss.Count)
                    {
                        getdecimal += (decimal)(record.MinPayReturn * record.UnitPrice);
                    }
                }
            }
            catch (Exception ex)
            {
                LogHelper.Error(ex);
            }
            return(getdecimal);
        }
예제 #15
0
        public static decimal GetAward(Globe_Clue Globe_Clue, string PrizeContent, Operation_Record record, ref List <string> AwardList)
        {
            decimal getdecimal   = 0;
            string  awardCollect = string.Empty;

            try
            {
                List <int> contList6 = Split_Hepler.str_to_ints(PrizeContent).ToList();
                contList6.RemoveAt(contList6.Count - 1);

                List <int> buyList = Split_Hepler.str_to_ints(record.Buy_Content).ToList();

                var cont7 = PrizeContent.Length >= 7 ? Split_Hepler.str_to_stringss(PrizeContent)[6] : "0";
                //特奖
                int conti7 = Convert.ToInt32(cont7);

                int      count    = 0;
                LineType LineType = (LineType)Globe_Clue.Second_Type;
                if (LineType == LineType.全中)
                {
                    foreach (var wawardClobe in contList6)
                    {
                        if (buyList.Contains(wawardClobe))
                        {
                            count++;
                            awardCollect += Convert.ToString(wawardClobe) + ",";
                        }
                    }
                    if (count >= 3)
                    {
                        getdecimal += (decimal)(record.MinPayReturn * record.UnitPrice);
                        AwardList.Add(Convert.ToString(awardCollect));
                    }
                }
                else if (LineType == LineType.二全中 || LineType == LineType.中二之中二)
                {
                    foreach (var wawardClobe in contList6)
                    {
                        if (buyList.Contains(wawardClobe))
                        {
                            count++;
                            awardCollect += Convert.ToString(wawardClobe) + ",";
                        }
                    }
                    if (count >= 2)
                    {
                        getdecimal += (decimal)(record.MinPayReturn * record.UnitPrice);
                        AwardList.Add(Convert.ToString(awardCollect));
                    }
                }
                else if (LineType == LineType.二中特之中二)
                {
                    foreach (var wawardClobe in contList6)
                    {
                        if (buyList.Contains(wawardClobe))
                        {
                            count++;
                            awardCollect += Convert.ToString(wawardClobe) + ",";
                        }
                    }
                    if (count >= 2)
                    {
                        getdecimal += (decimal)(record.MaxPayReturn * record.UnitPrice);
                        AwardList.Add(Convert.ToString(awardCollect));
                    }
                }
                else if (LineType == TLC_Model.Enums.LineType.二中特之中特 || LineType == TLC_Model.Enums.LineType.特串)
                {
                    foreach (var wawardClobe in contList6)
                    {
                        if (buyList.Contains(wawardClobe))
                        {
                            count++;
                            awardCollect += Convert.ToString(wawardClobe) + ",";
                            break;
                        }
                    }
                    if (buyList.Contains(conti7))
                    {
                        count++;
                        awardCollect += Convert.ToString(conti7) + ",";
                    }
                    if (count >= 2)
                    {
                        getdecimal += (decimal)(record.MinPayReturn * record.UnitPrice);
                        AwardList.Add(Convert.ToString(awardCollect));
                    }
                }
                else if (LineType == TLC_Model.Enums.LineType.四中一)
                {
                    foreach (var wawardClobe in contList6)
                    {
                        if (buyList.Contains(wawardClobe))
                        {
                            count++;
                            awardCollect += Convert.ToString(wawardClobe) + ",";
                            break;
                        }
                    }
                    if (count >= 1)
                    {
                        getdecimal += (decimal)(record.MinPayReturn * record.UnitPrice);
                        AwardList.Add(Convert.ToString(awardCollect));
                    }
                }
            }
            catch (Exception ex)
            {
                LogHelper.Error(ex);
            }
            return(getdecimal);
        }