Пример #1
0
        public ActionResult Add()
        {
            SpecialModel model = new SpecialModel();

            ViewData["referer"] = MallUtils.GetMallAdminRefererCookie();
            return(View(model));
        }
Пример #2
0
        public IActionResult Edit(SpecialModel model)
        {
            model.Begins = StringToTimeSpan(Request, "Begins");
            model.Ends   = StringToTimeSpan(Request, "Ends");

            return(Json(_handler.Upsert(model)));
        }
Пример #3
0
        public ActionResult Edit(SpecialModel model, int specialId = -1)
        {
            SpecialPerformanceInfo specialInfo = AdminSpecial.GetSpecialById(specialId);

            if (specialInfo == null)
            {
                return(PromptView("专场不存在"));
            }

            int specialId2 = AdminSpecial.GetSpecialIdByName(model.SpecialName);

            if (specialId2 > 0 && specialId2 != specialId)
            {
                ModelState.AddModelError("SpecialName", "名称已经存在");
            }

            if (ModelState.IsValid)
            {
                specialInfo.DisplayOrder = model.DisplayOrder;
                specialInfo.Name         = model.SpecialName;
                specialInfo.State        = model.State;

                AdminSpecial.UpdateSpecial(specialInfo);
                AddMallAdminLog("修改专场", "修改专场,专场ID为:" + specialId);
                return(PromptView("专场修改成功"));
            }

            ViewData["referer"] = MallUtils.GetMallAdminRefererCookie();
            return(View(model));
        }
Пример #4
0
        public ActionResult Edit(SpecialModel model, int id = -1)
        {
            SpecialInfo specialInfo = Special.AdminGetModelById(id);

            if (specialInfo == null)
            {
                return(PromptView("专题不存在"));
            }
            if (ModelState.IsValid)
            {
                specialInfo.Name         = model.Name;
                specialInfo.Title        = model.Title;
                specialInfo.ImgUrl       = model.ImgUrl;
                specialInfo.LogoUrl      = model.LogoUrl;
                specialInfo.IsOut        = model.IsOut;
                specialInfo.OutUrl       = model.OutUrl;
                specialInfo.Body         = model.Body;
                specialInfo.DisplayOrder = model.DisplayOrder;

                Special.Update(specialInfo);

                return(PromptView("专题编辑成功"));
            }
            Load();
            return(View(model));
        }
Пример #5
0
        public ActionResult Edit(int id = -1)
        {
            SpecialInfo specialInfo = Special.AdminGetModelById(id);

            if (specialInfo == null)
            {
                return(PromptView("专题信息不存在"));
            }

            SpecialModel model = new SpecialModel
            {
                SpecialID    = specialInfo.SpecialID,
                Name         = specialInfo.Name,
                Title        = specialInfo.Title,
                ImgUrl       = specialInfo.ImgUrl,
                LogoUrl      = specialInfo.LogoUrl,
                IsOut        = specialInfo.IsOut,
                OutUrl       = specialInfo.OutUrl,
                Body         = specialInfo.Body,
                DisplayOrder = specialInfo.DisplayOrder
            };

            Load();
            return(View(model));
        }
Пример #6
0
        public ActionResult Add()
        {
            SpecialModel model = new SpecialModel();

            Load();
            return(View(model));
        }
Пример #7
0
        internal TypeModel GetTypeModel(Type type, bool directReference)
        {
            TypeModel model;

            if (_models.TryGetValue(type, out model))
            {
                return(model);
            }
            TypeDesc typeDesc = _typeScope.GetTypeDesc(type, null, directReference);

            switch (typeDesc.Kind)
            {
            case TypeKind.Enum:
                model = new EnumModel(type, typeDesc, this);
                break;

            case TypeKind.Primitive:
                model = new PrimitiveModel(type, typeDesc, this);
                break;

            case TypeKind.Array:
            case TypeKind.Collection:
            case TypeKind.Enumerable:
                model = new ArrayModel(type, typeDesc, this);
                break;

            case TypeKind.Root:
            case TypeKind.Class:
            case TypeKind.Struct:
                model = new StructModel(type, typeDesc, this);
                break;

            default:
                if (!typeDesc.IsSpecial)
                {
                    throw new NotSupportedException(SR.Format(SR.XmlUnsupportedTypeKind, type.FullName));
                }
                model = new SpecialModel(type, typeDesc, this);
                break;
            }

            _models.Add(type, model);
            return(model);
        }
Пример #8
0
        public ActionResult Edit(int specialId = -1)
        {
            SpecialPerformanceInfo specialInfo = AdminSpecial.GetSpecialById(specialId);

            if (specialInfo == null)
            {
                return(PromptView("专场不存在"));
            }

            SpecialModel model = new SpecialModel();

            model.DisplayOrder = specialInfo.DisplayOrder;
            model.SpecialName  = specialInfo.Name;
            model.State        = specialInfo.State;

            ViewData["referer"] = MallUtils.GetMallAdminRefererCookie();

            return(View(model));
        }
Пример #9
0
        public ActionResult Add(SpecialModel model)
        {
            if (AdminSpecial.GetSpecialIdByName(model.SpecialName) > 0)
            {
                ModelState.AddModelError("SpecialName", "名称已经存在");
            }

            if (ModelState.IsValid)
            {
                SpecialPerformanceInfo specialInfo = new SpecialPerformanceInfo()
                {
                    DisplayOrder = model.DisplayOrder,
                    Name         = model.SpecialName,
                    State        = model.State
                };

                AdminSpecial.CreateSpecial(specialInfo);
                AddMallAdminLog("添加专场", "添加专场,专场为:" + model.SpecialName);
                return(PromptView("专场添加成功"));
            }

            ViewData["referer"] = MallUtils.GetMallAdminRefererCookie();
            return(View(model));
        }
Пример #10
0
        public ActionResult Add(SpecialModel model)
        {
            if (model != null)
            {
                SpecialInfo specialInfo = new SpecialInfo
                {
                    Name         = model.Name,
                    Title        = model.Title,
                    ImgUrl       = model.ImgUrl,
                    LogoUrl      = model.LogoUrl,
                    IsOut        = model.IsOut,
                    OutUrl       = model.OutUrl,
                    Body         = model.Body,
                    DisplayOrder = model.DisplayOrder
                };

                Special.Create(specialInfo);
                //AddAdminOperateLog("添加友情链接", "添加友情链接,友情链接为:" + model.FriendLinkName);
                return(PromptView("专题添加成功"));
            }

            Load();
            return(View(model));
        }
Пример #11
0
 public SpecialModelController(MainForm topform, SpecialModel item, FileController targetFile) : base(topform, item, targetFile)
 {
     Data = item;
     AddMenu("Open model viewer", Menu_OpenViewer);
 }
Пример #12
0
 public void OverrideMethod(SpecialModel model)
 {
 }
Пример #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 JsonModel Get_Globe_Helper(string Type)
        {
            JsonModel jsm = null;

            try
            {
                GlobeClueType GlobeClueType  = (GlobeClueType)Enum.Parse(typeof(GlobeClueType), Type);
                object        Globe_ClueBase = null;//获取
                switch (GlobeClueType)
                {
                case GlobeClueType.Special:
                    Globe_ClueBase = SpecialModel.Get_Globe(Constant.Globe_Clue_List, Constant.Globe_List, Constant.Size_Special_List);
                    break;

                case GlobeClueType.Normal:
                    Globe_ClueBase = NormalModel.Get_Globe(Constant.Globe_Clue_List, Constant.Globe_List);    //获取
                    break;

                case GlobeClueType.SpecialNormal:
                    Globe_ClueBase = SpecialNormalModel.Get_Globe(Constant.Globe_Clue_List, Constant.Globe_List, Constant.Size_SpecialNormal_List);    //获取
                    break;

                case GlobeClueType.NormalSix:
                    Globe_ClueBase = NormalSixModel.Get_Globe(Constant.Globe_Clue_List, Constant.Size_Six_List);    //获取
                    break;

                case GlobeClueType.Line:
                    Globe_ClueBase = LineModel.Get_Globe(Constant.Globe_Clue_List, Constant.Globe_List);    //获取
                    break;

                case GlobeClueType.Wave:
                    Globe_ClueBase = WaveModel.Get_Globe(Constant.Globe_Clue_List, Constant.Wave_List, Constant.Globe_List);    //获取
                    break;

                case GlobeClueType.Detail:
                    Globe_ClueBase = DetailModel.Get_Globe(Constant.Globe_Clue_List, Constant.Animal_Info_List, Constant.Globe_List, Constant.Detail_List);    //获取
                    break;

                case GlobeClueType.SpecialAnimal:
                    Globe_ClueBase = SpecialAnimalModel.Get_Globe(Constant.Globe_Clue_List, Constant.Animal_Info_List, Constant.Globe_List);    //获取
                    break;

                case GlobeClueType.CombineAnimal:
                    Globe_ClueBase = CombineAnimalModel.Get_Globe(Constant.Globe_Clue_List, Constant.Animal_Info_List, Constant.Globe_List);    //获取
                    break;

                case GlobeClueType.LineAnimal:
                    Globe_ClueBase = LineAnimalModel.Get_Globe(Constant.Globe_Clue_List, Constant.Animal_Info_List, Constant.Globe_List);    //获取
                    break;

                case GlobeClueType.LineDetail:
                    Globe_ClueBase = LineDetaillModel.Get_Globe(Constant.Globe_Clue_List, Constant.Globe_List, Constant.Detail_List);    //获取
                    break;

                case GlobeClueType.NotAll:
                    Globe_ClueBase = NotAllModel.Get_Globe(Constant.Globe_Clue_List, Constant.Globe_List);    //获取
                    break;

                default:
                    break;
                }
                jsm = JsonModel.GetJsonModel(0, "successed", Globe_ClueBase);
            }
            catch (Exception ex)
            {
                LogHelper.Error(ex);
            }
            return(jsm);
        }