Exemple #1
0
        public IViewBattl GetActiveBattl(IViewBattlQueryParams queryParams)
        {
            IDataQuery query = new DataQuery();

            query.Where = string.Format("ViewBattl.active =1");
            IViewBattl         _battl = new ViewBattl();
            IList <IViewBattl> col    = _viewBattlRepository.Find(query);

            if (col.Count > 0)
            {
                _battl = col[0];

                if (BattlHasExperied(_battl))
                {
                    EndActiveBattl();

                    _battl = CreateBattl();
                }
            }
            else
            {
                _battl = CreateBattl();
            }

            return(_battl);
        }
Exemple #2
0
        public IViewBattl GetActiveBattl(IViewBattlQueryParams queryParams)
        {
            IDataQuery query = new DataQuery();
            query.Where = string.Format("ViewBattl.active =1");
            IViewBattl _battl = new ViewBattl();
            IList<IViewBattl> col = _viewBattlRepository.Find(query);

            if (col.Count > 0)
            {
                _battl = col[0];

                if (BattlHasExperied(_battl))
                {
                    EndActiveBattl();

                    _battl = CreateBattl();
                }
            }
            else
            {
                _battl = CreateBattl();
            }

            return _battl;
        }