Example #1
0
        public void Bind()
        {
            var             data = teamSvc.GetAll();
            PagedDataSource pds  = new PagedDataSource();

            pds.DataSource = data;
            this.RepTeamList.DataSource = pds;
            this.RepTeamList.DataBind();
        }
        public IActionResult Delete(string formModal)
        {
            var id = formModal;

            var superpower = _teamServices.GetById(id);

            if (superpower != null)
            {
                _teamServices.DeleteById(id);

                var currentTeamList = _teamServices.GetAll();
                return(RedirectToAction("ListTeams", currentTeamList));
            }
            else
            {
                return(Json("Invalid Id.Try again"));
            }
        }
Example #3
0
 private ICollection <TeamViewModel> LoadTeams()
 {
     return(_teamServices.GetAll().ToList());
 }