public async Task SetUpProperties() { IsReviewNeededForCurrentSpec = false; var tempAllCustomers = await CustomerDataAccess.GetAllCurrentAndProspectCustomers(); AllCustomers = (tempAllCustomers != null) ? tempAllCustomers.ToList() : new List <CustomerModel>(); var tempAllProcesses = await ProcessDataAccess.GetHydratedProcessesWithCurrentLockedRev(); AllProcessesWithCurrentRev = (tempAllProcesses != null) ? tempAllProcesses.ToList() : new List <ProcessModel>(); var tempAllSpecifications = await SpecificationDataAccess.GetAllHydratedSpecs(); AllSpecifications = (tempAllSpecifications != null) ? tempAllSpecifications.ToList() : new List <SpecModel>(); if (CurrentSpec != null) { var spaForSpecResult = await SpecProcessAssignDataAccess.GetAllActiveHydratedSpecProcessAssignForSpec(CurrentSpec.Id); if (spaForSpecResult != null && spaForSpecResult.Any()) { SpecProcessAssignsForCurrentSpec = spaForSpecResult.ToList(); } IsReviewNeededForCurrentSpec = await SpecProcessAssignDataAccess.CheckIfReviewIsNeededForSpecId(CurrentSpec.Id); } }
public async Task <ActionResult> OnGet(int?aSpecId, string aMessage, bool?isMessageGood) { Message = new PopUpMessageModel() { Text = aMessage, IsMessageGood = isMessageGood }; if (aSpecId != null) { int tempSpecId = aSpecId ?? default(int); //Converts the int? to an int. The part after ?? means that if aSpecId == null, then assign a 0 to tempSpecId, but the if() handles null. CurrentSpec = await SpecificationDataAccess.GetHydratedCurrentRevOfSpec(tempSpecId); CurrentSpecCurrentRev = CurrentSpec.SpecRevModels.OrderByDescending(i => i.InternalRev).FirstOrDefault(); SpecId = CurrentSpec.Id; SpecInternalRevId = CurrentSpecCurrentRev.InternalRev; //ToDo: Get history SPAs for the spec selected. Populate a history modal or collapsable or something like that } await SetUpProperties(); return(Page()); }