Exemple #1
0
        public static List <ClanWarPickViewModel> GetAllByWar(int warId)
        {
            List <ClanWarPickViewModel> clanWarPickList = new List <ClanWarPickViewModel>();
            int  warTypeId = ClanWarManager.SelectByClanWarId(warId).warTypeId;
            byte count     = WarTypeManager.Get(warTypeId).value;

            foreach (Models.ClanWarPick warPick in ClanWarPicksManager.SelectAllByWarId(warId))
            {
                clanWarPickList.Add(new ClanWarPickViewModel()
                {
                    Id                    = warPick.id,
                    ClanWarId             = warPick.clanWarId,
                    ClanMemberWarPosition = warPick.clanMemberWarPosition,
                    ClanUserId            = warPick.clanUserId,
                    PickVS                = warPick.pickVS,
                    Note                  = warPick.note,
                    UpdatedOn             = warPick.updatedOn,
                    AddedOn               = warPick.addedOn,
                    _clanUserName         = warPick.clanUserId > 0 ? ClanUserManager.SelectByClanUserId(warPick.clanUserId).name : string.Empty,
                    _basesCount           = count
                });
            }

            return(clanWarPickList);
        }
        public static ClanWarUpsertViewModel Get(int warId)
        {
            Models.ClanWar         clanWarInfo = ClanWarManager.SelectByClanWarId(warId);
            ClanWarUpsertViewModel updateWar   = new ClanWarUpsertViewModel();

            updateWar.FillModelView(clanWarInfo);

            return(updateWar);
        }
        public ClanWarViewModel(int?id, int clanId) : base(clanId)
        {
            if (id != null)
            {
                _clanWar = ClanWarManager.SelectByClanWarId((int)id);
            }

            ClanWarList = ClanWarManager.SelectClanWarsByClanId(clanId);
        }
Exemple #4
0
        public ActionResult Edit(int id)
        {
            ActionResult result   = View();
            ClanUser     clanUser = HttpContext.GetCurrentLoginInformation();

            //TODO //vv If current user was able to get to this point then it belongs to a Clan, but should it be checked still?

            int clanId = (int)clanUser.clanId;

            ViewBag.WarId          = id;
            ViewBag.IsWarFinalized = ClanWarManager.SelectByClanWarId(id).isFinalized;
            RankingsUpsertViewModel rankings = new RankingsUpsertViewModel(id, clanId);

            result = View(rankings);

            return(result);
        }