Exemplo n.º 1
0
 public ActionResult Index()
 {
     var model = new StaticPageBaseModel(this);
     return new ActionResultCached(
         true,
         model.GetLastModifiedFunc(() => model.StaticPageTransport.LastModifyDateUtc),
         () => View(model));
 }
Exemplo n.º 2
0
 public ActionResult Game(FilterModel<int> filter)
 {
     LogAction(ProjectBActions.PageLiveCompetitionItemIDConcrete, filter.id);
     var itemData = FrontCompetitionProvider.GetCompetitionItemLiveBetForCompetition(CurrentLanguage, null, null, filter.id);
     var model = new StaticPageBaseModel<CompetitionAdvancedTransport>(this) {
         ControllerModel = itemData
     };
     return new ActionResultCached(
         itemData?.CompetitionTransport != null,
         model.GetLastModifiedFunc(() => TryGetNotModifiedResultForGame(itemData, model.StaticPageTransport.LastModifyDateUtc)),
         () => {
             FixToUserTime(itemData.CompetitionTransport);
             return View(model);
         });
 }
Exemplo n.º 3
0
 public ActionResult Files(short startID = 0, int limit = 12)
 {
     var totalFilesCount = ProjectProvider.Instance.WebFileProvider.GetTotalFilesCount();
     startID = startID == default(short) ? totalFilesCount : startID;
     var fileInfos = ProjectProvider.Instance.WebFileProvider.GetFileInfos(startID, limit);
     var pages = (totalFilesCount / limit) + (totalFilesCount % limit > 0 ? 1 : 0);
     var m = (dynamic)new ExpandoObject();
     var model = new StaticPageBaseModel<dynamic>(this) {
         ControllerModel = m
     };
     m.currentPage = pages - (startID / limit);
     m.pages = pages;
     m.currentLimit = limit;
     m.files = fileInfos;
     return View(model);
 }
Exemplo n.º 4
0
 public ActionResult Item(FilterModel<int> filter)
 {
     LogAction(ProjectBActions.PageLiveCompetitionUniqueIDConcrete, filter.id);
     var itemData = FrontCompetitionProvider.GetCompetitionItemsLive(CurrentLanguage, true, null, null, null, new[] { filter.id });
     var staticPageBaseModel = new StaticPageBaseModel<CompetitionRegularModel<CompetitionItemBetTransport>>(this) {
         ControllerModel = new CompetitionRegularModel<CompetitionItemBetTransport>(new PageDisplaySettings {
                 DisplayColumn = DisplayColumnType.TraditionalOdds | DisplayColumnType.Result
             }) {
             Competitions = itemData
         }
     };
     return new ActionResultCached(
         itemData != null && itemData.Count > 0,
         staticPageBaseModel.GetLastModifiedFunc(() => TryGetNotModifiedResultForItems(itemData, staticPageBaseModel.StaticPageTransport.LastModifyDateUtc)),
         () => {
             itemData.Each(FixToUserTime);
             return View(staticPageBaseModel);
         });
 }
Exemplo n.º 5
0
 public ActionResult File(short id = default(short))
 {
     switch (Request.RequestType.ToUpper()) {
         case "POST":
             id = id == default(short)
                 ? FileController.UploadFileFromRequest(Request, 1).First()
                 : FileController.UpdateFileFromRequest(id, Request);
             break;
         case "GET":
         default:
             break;
     }
     var fileInfo = ProjectProvider.Instance.WebFileProvider.GetFileInfos(id, 1).First();
     var m = (dynamic)new ExpandoObject();
     var model = new StaticPageBaseModel<dynamic>(this) {
         ControllerModel = m
     };
     m.file = fileInfo;
     return View(model);
 }
Exemplo n.º 6
0
 public ActionResult Index(FilterModel<SportType> filter)
 {
     LogAction(ProjectBActions.PageLiveIndexConcrete, (short)filter.id);
     var itemData = FrontCompetitionProvider.GetCompetitionItemsLive(CurrentLanguage, filter.all, null, null, filter.id);
     var staticPageBaseModel = new StaticPageBaseModel<CompetitionRegularModel<CompetitionItemBetTransport>>(this) {
             ControllerModel = new CompetitionRegularModel<CompetitionItemBetTransport>(new PageDisplaySettings {
                 DisplayColumn = DisplayColumnType.TraditionalOdds | DisplayColumnType.Result
             }) {
             Competitions = itemData,
             Filter = new FilterModel<SportType>("Index", "CompetitionLive", CurrentLanguage, FilterSettings.BtnAll | FilterSettings.BtnWithOdds, filter)
         }
     };
     return new ActionResultCached(
         true,
         staticPageBaseModel.GetLastModifiedFunc(() => TryGetNotModifiedResultForItems(itemData, staticPageBaseModel.StaticPageTransport.LastModifyDateUtc)),
         () => {
             itemData.Each(FixToUserTime);
             return View(staticPageBaseModel);
         });
 }
Exemplo n.º 7
0
 public ActionResult Index(FilterModel<SportType> filter)
 {
     LogAction(ProjectBActions.PageHistoryIndexConcrete, (short)filter.id);
     filter.FixDates(_minDateTime, MaxDateTime);
     var fromDate = FixUserTimeToSystem(filter.date);
     var itemData = FrontCompetitionProvider.GetCompetitionItemsHistory(CurrentLanguage, null, new[] {BrokerType.Default}, fromDate, fromDate.AddDays(1), filter.id);
     var model = new StaticPageBaseModel<CompetitionRegularModel<CompetitionItemBetTransport>>(this) {
         ControllerModel = new CompetitionRegularModel<CompetitionItemBetTransport>(new PageDisplaySettings {
                 DisplayColumn = DisplayColumnType.TraditionalOdds | DisplayColumnType.Result
             }) {
             Competitions = itemData,
             Filter = new FilterModel<SportType>("Index", "History" , CurrentLanguage, FilterSettings.ToDate, filter)
         }
     };
     return new ActionResultCached(
         true,
         model.GetLastModifiedFunc(() => TryGetNotModifiedResultForItems(itemData, model.StaticPageTransport.LastModifyDateUtc)),
         () => {
             itemData.Each(FixToUserTime);
             return View(model);
         });
 }
Exemplo n.º 8
0
 public ActionResult Competitor(FilterModel<int> filter)
 {
     LogAction(ProjectBActions.PageHistoryCompetitorIDConcrete, filter.id);
     filter.FixDates(_minDateTime, MaxDateTime);
     var itemData = FrontCompetitionProvider
         .GetCompetitionItemsRegularBetForCompetitor(CurrentLanguage, null, new[] { BrokerType.Default }, filter.from, filter.date, filter.id);
     var staticPageBaseModel = new StaticPageBaseModel<CompetitionRegularModel<CompetitionItemBetTransport>>(this) {
             ControllerModel = new CompetitionRegularModel<CompetitionItemBetTransport>(new PageDisplaySettings {
                 DisplayColumn = DisplayColumnType.TraditionalOdds | DisplayColumnType.Result
             }) {
             Competitions = itemData,
             Filter = new FilterModel<int>("Competitor", "History", CurrentLanguage, FilterSettings.FromDate | FilterSettings.ToDate, filter)
         }
     };
     return new ActionResultCached(
         itemData.Any(),
         staticPageBaseModel.GetLastModifiedFunc(() => TryGetNotModifiedResultForItems(itemData, staticPageBaseModel.StaticPageTransport.LastModifyDateUtc)),
         () => {
             itemData.Each(FixToUserTime);
             return View(staticPageBaseModel);
         });
 }
Exemplo n.º 9
0
 public ActionResult Index(FilterModel<SportType> filter)
 {
     LogAction(ProjectBActions.PageCompetitionIndexConcrete, (short)filter.id);
     var dateDef = DateTime.UtcNow.Date;
     var maxDateDef = dateDef.AddDays(14);
     filter.FixDates(dateDef, maxDateDef);
     var itemData = FrontCompetitionProvider.GetCompetitionItemsFuturedNew(CurrentLanguage, filter.all ? null : (DateTime?)FixUserTimeToSystem(filter.from), null, null, filter.id);
     var model = new StaticPageBaseModel<CompetitionRegularModel<CompetitionItemBetTransport>>(this) {
         ControllerModel = new CompetitionRegularModel<CompetitionItemBetTransport>(new PageDisplaySettings {
             LimitToDisplayInGroup = 4,
             DisplayColumn = DisplayColumnType.TraditionalOdds
         }) {
             Competitions = itemData,
             Filter = new FilterModel<SportType>("Index", "Competition", CurrentLanguage, FilterSettings.BtnAll | FilterSettings.FromDate, filter)
         }
     };
     return new ActionResultCached(
         true,
         model.GetLastModifiedFunc(() => TryGetNotModifiedResultForItems(itemData, model.StaticPageTransport.LastModifyDateUtc)),
         () => {
             itemData.Each(FixToUserTime);
             return View(model);
         });
 }
Exemplo n.º 10
0
 public ActionResult PagesForType(ProjectBActions id)
 {
     var staticPageBaseModel = new StaticPageBaseModel(this) { PageKey = id };
     return PartialView("PageEditor/PagesForType", staticPageBaseModel);
 }
Exemplo n.º 11
0
 public ActionResult Profitable(FilterModel<SportType> filter)
 {
     var itemData = FrontCompetitionProvider.GetCompetitionItemsFuturedProfitable(CurrentLanguage, null, null, filter.id);
     var model = new StaticPageBaseModel<CompetitionRegularModel<CompetitionItemRoiTransport>>(this) {
         ControllerModel = new CompetitionRegularModel<CompetitionItemRoiTransport>(new PageDisplaySettings {
                 LimitToDisplayInGroup = 4,
                 DisplayColumn = DisplayColumnType.Roi
             }) {
             Competitions = itemData,
             Filter = new FilterModel<SportType>(null, null, CurrentLanguage, FilterSettings.Default, filter)
         }
     };
     return new ActionResultCached(
         true,
         model.GetLastModifiedFunc(() => itemData.MaxOrDefault(i => i.CompetitionItems.Max(c => c.Roi.Max(r => r.Odds.Max(o => o.Value.DateTimeUtc))), DateTime.MinValue)),
         () => {
             itemData.Each(d => d.CompetitionItems.Each(ci => {
                 ci.DateUtc = FixSystemTimeToUser(ci.DateUtc);
                 ci.Roi.Each(r => {
                     r.Odds.Each(o => {
                         o.Value.DateTimeUtc = FixSystemTimeToUser(o.Value.DateTimeUtc);
                     });
                 });
             }));
             return View(model);
         });
 }