Пример #1
0
 public ActionResult AddTodayDrop(int? Id)
 {
     BetUpperLimit limit = null;
     TodayDropWaterModel model = new TodayDropWaterModel();
     if (Id.HasValue)
         limit = UpperLimitManager.GetManager().GetLimit(Id.Value);
     if (limit != null)
     {
         model.Num = limit.Num;
         model.GamePlayWay = limit.GamePlayWayId;
         model.Amount = limit.TotalBetAmount + LotterySystem.Current.QuickAddDropAmount;
         model.Companys = new[] { limit.CompanyId };
     }
     var companys = TodayLotteryCompany.Instance.GetTodayCompany().Select(it => new SelectListItem
     {
         Text = it.Name,
         Value = it.CompanyId.ToString()
     });
     ViewBag.Companys = new MultiSelectList(companys, "Value", "Text", new[] { limit.CompanyId.ToString() });
     return View(model);
 }
Пример #2
0
 public ActionResult AddTodayDrop(TodayDropWaterModel model)
 {
     if (!ModelState.IsValid)
         return ErrorAction(ModelState.ToErrorString());
     if (model.GamePlayWay == 0)
         ModelState.AddModelError("GamePlayWay", string.Format(ModelResource.PleaseSelected, Resource.GameType));
     else if (!Extended.NumIsCorrectGameTypeFormat(model.Num, model.GamePlayWay))
         ModelState.AddModelError("GamePlayWay", string.Format(Resource.PleaseSelectedCorrectGameType));
     if (ModelState.Sum(it => it.Value.Errors.Count) > 0)
         return ErrorAction(ModelState.ToErrorString());
     DropManager.AddTodayDrop(model.Num, model.GamePlayWay, model.DropWater, model.Amount, model.Companys);
     if (Request.IsAjaxRequest())
         return Json(new JsonResultModel
         {
             IsSuccess = true,
             Message = Resource.Success,
             Model = model
         });
     else
         return RedirectToAction("Today");
 }