private TechnologyEntryModel GetCreateStateModel() { TechnologyEntryFormData formData = new TechnologyEntryFormData(); List <Control> formControls = CreateFormControls(0); TechnologyDTO technologyDTO = new TechnologyDTO(); return(new TechnologyEntryModel() { FormData = formData, FormControls = formControls, Model = technologyDTO, }); }
private TechnologyEntryModel GetUpdateStateModel(int technologyPK) { TechnologyEntryFormData formData = new TechnologyEntryFormData(); List <Control> formControls = CreateFormControls(technologyPK); TechnologyDTO technologyDTO = technologyQuery.GetByPrimaryKey(technologyPK); if (technologyDTO == null) { throw new KairosException($"Record with primary key '{technologyDTO.Technology_PK}' is not found."); } return(new TechnologyEntryModel() { FormData = formData, FormControls = formControls, Model = technologyDTO, }); }