コード例 #1
0
ファイル: NormalModel.cs プロジェクト: qaz734913414/TLC
        public static decimal GetAward(string PrizeContent, Operation_Record record, List <Globe> Globe_List, ref List <string> AwardList)
        {
            decimal getdecimal = 0;

            try
            {
                List <Globe_S> globes = Globe_S.GetBase(record.Buy_Content, Globe_List, record.BuyPayReturn);

                var contList6 = Split_Hepler.str_to_ints(PrizeContent).ToList();
                contList6.RemoveAt(contList6.Count - 1);
                List <int> contents = Split_Hepler.str_to_ints(record.Buy_Content).ToList();
                foreach (var item in contList6)
                {
                    if (contents.Contains(item))
                    {
                        Globe_S globe_ss = globes.FirstOrDefault(i => i.Code == item);
                        if (globe_ss != null)
                        {
                            getdecimal += (decimal)(globe_ss.PayReturn * record.UnitPrice);
                            AwardList.Add(globe_ss.Name);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                LogHelper.Error(ex);
            }
            return(getdecimal);
        }
コード例 #2
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);
        }
コード例 #3
0
        public static List <Operation_Record_S> Get_Operation_Record_S(List <Operation_Record> Operation_Record_List, List <Award_Public> Award_Public_List, List <Globe_Clue> Globe_Clue_List, List <UserInfo> UserInfo_List, List <Globe> Globe_List)
        {
            List <Operation_Record_S> list = new List <Operation_Record_S>();

            try
            {
                list = (from record in Operation_Record_List
                        join award in Award_Public_List on record.AwardCode equals award.Code
                        join clue in Globe_Clue_List on record.ClueCode equals clue.Code
                        join user in UserInfo_List on record.UserID equals user.LoginName
                        orderby record.CreateTime
                        select 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),
                    IsShowMin = clue.IsEnable == 2 ? true : false,
                    MinPayReturn = (decimal)record.MinPayReturn,
                }).ToList();
            }
            catch (Exception ex)
            {
                LogHelper.Error(ex);
            }
            return(list);
        }
コード例 #4
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);
        }
コード例 #5
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);
            }
        }
コード例 #6
0
        public void BuyGlobe_Group(HttpContext context)
        {
            try
            {
                HttpRequest request   = context.Request;
                string      UserID    = RequestHelper.string_transfer(request, "UserID");
                int         AwardCode = RequestHelper.int_transfer(request, "AwardCode");
                int         ClueCode  = RequestHelper.int_transfer(request, "ClueCode");
                int         Count     = RequestHelper.int_transfer(request, "Count");

                string Buy_Content  = RequestHelper.string_transfer(request, "Buy_Content");
                string Buy_Content2 = string.Empty;

                int     UnitPrice   = RequestHelper.int_transfer(request, "UnitPrice");
                decimal Using_Money = RequestHelper.decimal_transfer(request, "Using_Money");

                string BuyPayReturn  = RequestHelper.string_transfer(request, "BuyPayReturn");
                string BuyPayReturn2 = string.Empty;

                string UID    = RequestHelper.string_transfer(request, "UID");
                string dsp    = RequestHelper.string_transfer(request, "dsp");
                bool   result = Constant.Check_Login_DIP(UID, dsp);//下注
                if (result)
                {
                    string[]      codeArray   = Split_Hepler.str_to_stringss(Buy_Content);
                    List <string> codeList    = codeArray.Count() > 0 ? codeArray.ToList() : new List <string>();
                    List <string> bu_contents = GroupHelper(codeList, Count);
                    //序列化表单详情列表
                    List <string> BuyPayReturnList = JsonConvert.DeserializeObject <List <string> >(BuyPayReturn);

                    int length = 0;
                    foreach (var item in bu_contents)
                    {
                        float          MinPayReturn = 0;
                        float          MaxPayReturn = 0;
                        List <Globe_S> globes       = Globe_S.GetBase(item, Constant.Globe_List, BuyPayReturnList[length]);
                        foreach (var code in globes)
                        {
                            if (MinPayReturn == 0 || MinPayReturn > code.PayReturn)
                            {
                                MinPayReturn = code.PayReturn;
                            }
                            if (MaxPayReturn == 0 || MaxPayReturn < code.PayReturn)
                            {
                                MaxPayReturn = code.PayReturn;
                            }
                        }
                        MinPayReturn = MinPayReturn > 0 ? (float)Math.Round(MinPayReturn, 2) : 0;
                        MaxPayReturn = MaxPayReturn > 0 ? (float)Math.Round(MaxPayReturn, 2) : 0;

                        jsonModel = BuyGlobe_Group_Helper(UserID, AwardCode, ClueCode, item, Buy_Content2, UnitPrice, UnitPrice, BuyPayReturnList[length], BuyPayReturn2, MinPayReturn, MaxPayReturn);
                        length++;
                    }
                }
                else
                {
                    jsonModel = JsonModel.GetJsonModel(300, "未经授权");
                }
            }
            catch (Exception ex)
            {
                jsonModel = new JsonModel()
                {
                    errNum  = 400,
                    errMsg  = ex.Message,
                    retData = ""
                };
                LogHelper.Error(ex);
            }
            finally
            {
                //无论后端出现什么问题,都要给前端有个通知【为防止jsonModel 为空 ,全局字段 jsonModel 特意声明之后进行初始化】
                context.Response.Write("{\"result\":" + Constant.jss.Serialize(jsonModel) + "}");
            }
        }
コード例 #7
0
ファイル: Admin_Award.ashx.cs プロジェクト: qaz734913414/TLC
        public static JsonModelNum GetAward_Helper(int pageIndex, int PageSize, string Key, bool Current, bool IsLast, int Id)
        {
            JsonModelNum jsm = null;

            try
            {
                List <Award_Public> Prize_Public_List = Constant.Award_Public_List;
                List <Globe>        Globe_List        = Constant.Globe_List;

                List <PrizeModel> price_list = (from prize in Prize_Public_List
                                                where Convert.ToString(prize.Name).Contains(Key)
                                                orderby prize.Id
                                                select new PrizeModel()
                {
                    Id = prize.Id,
                    Code = prize.Code,
                    Name = prize.Name,
                    StartTime = prize.StartTime,
                    CloseTime = prize.CloseTime,
                    EndTime = prize.EndTime,
                    Year = prize.Year,
                    IsEnable = prize.IsEnable,
                    GlobeList = Globe_S.GetBase(prize.PrizeContent, Globe_List),
                    PrizeContent = prize.PrizeContent,
                    IsCompleate = prize.IsCompleate,
                }).ToList();
                if (Id > 0)
                {
                    price_list = (from prize in price_list where prize.Id == Id select prize).ToList();
                    if (price_list.Count > 0)
                    {
                        var prize = price_list[0];
                        jsm = JsonModelNum.GetJsonModel(0, "获取成功", prize);
                    }
                    else
                    {
                        jsm = JsonModelNum.GetJsonModel(300, "无数据");
                    }
                }
                else if (Current)
                {
                    price_list = price_list.Where(item => DateTime.Now < item.CloseTime && item.StartTime < DateTime.Now).ToList();
                    if (price_list.Count > 0)
                    {
                        var       prize     = price_list[0];
                        DateTimeS DateTimeS = TimeTransfer((DateTime)prize.CloseTime, DateTime.Now);

                        prize.Leave_Day     = DateTimeS.days;
                        prize.Leave_Hour    = DateTimeS.hours;
                        prize.Leave_Minuite = DateTimeS.minutes;
                        prize.Leave_Second  = DateTimeS.seconds;

                        jsm = JsonModelNum.GetJsonModel(0, "获取成功", prize);
                    }
                    else
                    {
                        jsm = JsonModelNum.GetJsonModel(300, "无数据");
                    }
                }
                else
                {
                    if (IsLast)
                    {
                        var prize_lis = price_list.Where(item => DateTime.Now > item.CloseTime).OrderByDescending(i => i.CloseTime).ToList();

                        if (prize_lis.Count > 0)
                        {
                            jsm = JsonModelNum.GetJsonModel(0, "获取成功", prize_lis[0]);
                        }
                        else
                        {
                            jsm = JsonModelNum.GetJsonModel(300, "无数据");
                        }
                    }
                    else
                    {
                        //where DateTime.Now >= prize.CloseTime || DateTime.Now <= prize.StartTime
                        price_list = (from prize in price_list select prize).OrderByDescending(i => i.CloseTime).ToList();

                        var price_list_get = price_list.Skip((pageIndex - 1) * PageSize).Take(PageSize).ToList();
                        foreach (var item in price_list_get)
                        {
                            if (item.StartTime > DateTime.Now)
                            {
                                item.State = 1;
                            }
                            else if (item.CloseTime < DateTime.Now)
                            {
                                item.State = 3;
                            }
                            else if (item.CloseTime > DateTime.Now && item.StartTime < DateTime.Now)
                            {
                                item.State = 2;
                            }
                        }

                        if (price_list.Count > 0)
                        {
                            jsm           = JsonModelNum.GetJsonModel(0, "获取成功", price_list_get);
                            jsm.PageIndex = pageIndex;
                            jsm.PageSize  = PageSize;

                            jsm.PageCount = (price_list.Count + PageSize - 1) / PageSize;;;

                            jsm.RowCount = price_list.Count;
                        }
                        else
                        {
                            jsm = JsonModelNum.GetJsonModel(300, "无数据");
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                LogHelper.Error(ex);
            }
            return(jsm);
        }