public IActionResult WardBayList() { string token = HttpContext.Session.GetString("access_token"); List <WardModel> wardList = GetWards(); List <WardBayModel> wardBayList = APIservice.GetList <WardBayModel>("synapsenamespace=meta&synapseentityname=wardbay", token); WardBayViewModel wardBayViewModel = new WardBayViewModel(); wardBayViewModel.Wards = wardList; wardBayViewModel.WardBays = wardBayList.OrderBy(w => w.wardcode).ThenBy(w => w.warddisplay).ThenBy(w => w.baycode).ToList(); return(View(wardBayViewModel)); }
public IActionResult GetWardBaysForWard(WardBayViewModel wardBay) { string token = HttpContext.Session.GetString("access_token"); List <WardModel> wardList = GetWards(); List <WardBayModel> wardBayList = new List <WardBayModel>(); if (wardBay.SelectedWardCode is null) { wardBayList = APIservice.GetList <WardBayModel>("synapsenamespace=meta&synapseentityname=wardbay", token); } else { wardBayList = APIservice.GetListById <WardBayModel>(wardBay.SelectedWardCode, "synapsenamespace=meta&synapseentityname=wardbay&synapseattributename=wardcode&attributevalue=", token); } WardBayViewModel wardBayViewModel = new WardBayViewModel(); wardBayViewModel.Wards = wardList; wardBayViewModel.WardBays = wardBayList.OrderBy(w => w.wardcode).ThenBy(w => w.warddisplay).ThenBy(w => w.baycode).ToList(); return(View("WardBayList", wardBayViewModel)); }