예제 #1
0
        public async Task <ActionResult> Delete(string key, bool isTitle = false)
        {
            if (isTitle)
            {
                List <Leader> leaderList = await LeaderWebAPI.GetLeadersByKey(key);

                foreach (var item in leaderList)
                {
                    DeleteLeader(item.Chave);
                }
            }
            return(RedirectToAction("AllLeaders").Success("Dirigente excluido com sucesso."));
        }
예제 #2
0
        public async Task <ActionResult> Edit(string key)
        {
            ViewBag.Url = Url.Action("AllLeaders");
            if (!String.IsNullOrEmpty(key?.Trim()))
            {
                var leaderFound = await LeaderWebAPI.GetLeadersByKey(key);

                if (leaderFound?.Count > 0)
                {
                    var leaderMapped = GetNames(leaderFound).FirstOrDefault();
                    return(View(leaderMapped));
                }
            }
            return(RedirectToAction("AllLeaders"));
        }