public ActionResult EditParliament(Models.Parliament.ParliamentEditModel model) { var service = new ParliamentService(); service.UpdateParliament(model.ParliamentID.Value, model); return(RedirectToAction("ParliamentDetails", new { id = model.ParliamentID })); }
public ActionResult CreateParliamentHouse(int id) { var service = new ParliamentService(); var model = service.InitializeEditParliamentHouseModel(id); return(View("Parliament/CreateParliamentHouse", model)); }
public ActionResult EditParliamentHouse(int ParliamentId, int HouseId) { var service = new ParliamentService(); var model = service.InitializeEditParliamentHouseModel(ParliamentId, HouseId); return(View("Parliament/EditParliamentHouse", model)); }
public ActionResult CreateParliament(Models.Parliament.ParliamentEditModel model) { var service = new ParliamentService(); service.CreateParliament(model); return(RedirectToAction("ManageParliament")); }
public ActionResult EditParliamentHouses(int id) { var service = new ParliamentService(); var model = service.GetParliamentEditModel(id); return(View("Parliament/EditParliamentHouses", model)); }
public ActionResult CreateParliament() { var service = new ParliamentService(); var model = service.InitializeParliamentEditModel(SessionManager.Current.CurrentParliamentId); return(View("Parliament/Create", model)); }
public ActionResult DeleteParliament(int id, string test) { var service = new ParliamentService(); service.DeleteParliament(id); return(RedirectToAction("ManageParliament")); }
public ActionResult DeleteParliament(int id) { var service = new ParliamentService(); var model = service.GetParliamentEditModel(id); return(View("Parliament/Delete", model)); }
public ActionResult DeleteParliamentHouse(int id) { var service = new ParliamentService(); var ParliamentId = service.DeleteParliamentHouse(id); return(RedirectToAction("EditParliamentHouses", new { id = ParliamentId })); }
public ActionResult EditParliamentHouse(Models.Parliament.ParliamentHouseEditModel model) { var service = new ParliamentService(); service.UpdateParliamentHouse(model.ParliamentHouseID, model); return(RedirectToAction("EditParliamentHouses", new { id = model.ParliamentID })); }
public ActionResult ManageParliament() { var service = new ParliamentService(); var model = service.GetAllParliamentEditModels(); return(View("Parliament/Index", model)); }
// GET: Parliament public ActionResult Index() { ParliamentService service = new ParliamentService(); ParliamentListModel model = service.GetParliaments(); return(View(model)); }
public ActionResult Index(string pCode) { var parliamentId = new ParliamentService().GetParliamentId(pCode); var service = new QuizService(); var model = service.InitializeSearchModel(parliamentId); return(View(model)); }
public ActionResult Index(string pCode) { var parliamentId = new ParliamentService().GetParliamentId(pCode); RepresentativeService service = new RepresentativeService(); RepresentativeListModel model = service.GetAllRepresentativesForParliament(parliamentId); return(View(model)); }
// GET: Petitions public ActionResult Index() { var service = new PetitionService(); var parliamentService = new ParliamentService(); PetitionHomeModel model = new PetitionHomeModel { LastSuccessfulPetitions = service.GatLatestPetitions(AppConfig.GetInt("Petitions.Index.LastSuccessfulPetitions", 5)), TopActivePetitions = service.GetTopActivePetitions(AppConfig.GetInt("Petitions.Index.TopActivePetitions", 5)), Parliaments = parliamentService.GetParliaments() }; return(View(model)); }
private ActionResult GetPartialView(string pCode, string returnUrl, string partialViewName, bool returnAll = false) { var parliament = GetCurrentParliament(pCode); var parliaments = new ParliamentService().GetAllParliamentsCached().Where(x => x.Tenant == parliament.Tenant).ToList(); if (!returnAll && parliaments.Count() == 1) { return(new EmptyResult()); } string baseTenantAddress = AppConfig.GetStringValue("BaseTenantAddress"); ViewBag.BaseTenantAddress = baseTenantAddress; ViewBag.ReturnUrl = returnUrl; var parliamentsToPass = returnAll ? new ParliamentService().GetAllParliamentsCached() : parliaments; if (parliamentsToPass.Count() == 1) { return(new EmptyResult()); } int colNumber = 1; switch (parliamentsToPass.Count) { case 2: case 3: case 4: case 6: colNumber = (12 / parliamentsToPass.Count); break; case 5: colNumber = 2; break; } ViewBag.DivClass = $"col-sm-{colNumber}"; return(PartialView(partialViewName, parliamentsToPass)); }
public ActionResult Index(string pCode) { var parliamentId = new ParliamentService().GetParliamentId(pCode); var service = new LawService(); var searchModel = service.InitializeSearchModel(); searchModel.Order = "desc"; searchModel.SortBy = "createTime"; searchModel.ParliamentId = parliamentId; searchModel.PageItemCount = 16; var results = service.SearchLaw(searchModel); var model = new AllLawsModel { SearchModel = searchModel, Results = results }; return(View(model)); }
public ActionResult Index(string pcode) { var parliamentService = new ParliamentService(); var parliamentId = parliamentService.GetParliamentId(pcode); var service = new LawService(); var repService = new RepresentativeService(); var model = new LawHomeModel(); model.LatestLaws = service.GetLatestLaws(AppConfig.GetIntValue("JavnaRasprava.Index.LatestLaws", 5), parliamentId); model.LatestLaws.Title = GlobalLocalization.LatestLawsTitle; model.MostActive = service.GetMostActive(AppConfig.GetIntValue("JavnaRasprava.Index.MostActive", 5), parliamentId); model.MostActive.Title = GlobalLocalization.MostActiveLawsTitle; model.NextLawsInVote = service.GetNextLawsInVote(AppConfig.GetIntValue("JavnaRasprava.Index.NextLawsInVote", 5), parliamentId); model.NextLawsInVote.Title = GlobalLocalization.NextLawsInVoteTitle; model.TopRepresentatives = repService.GetTopRepresentatives(Infrastructure.AppConfig.GetIntValue("JavnaRasprava.Index.TopRepresentatives", 5), parliamentId); model.Search = service.InitializeSearchModel(); return(View(model)); }
public void GetParliaments_All_Returned() { var response = new ParliamentService().GetParliaments(); Assert.AreEqual(3, response.Parliaments.Count); }