private RoleGroupEntryModel GetCreateStateModel()
        {
            RoleGroupEntryFormData formData     = new RoleGroupEntryFormData();
            List <Control>         formControls = CreateFormControls(0);
            RoleGroupDTO           roleGroupDTO = new RoleGroupDTO();

            return(new RoleGroupEntryModel()
            {
                FormData = formData,
                FormControls = formControls,
                Model = new RoleGroupDTO(),
            });
        }
        private RoleGroupEntryModel GetUpdateStateModel(int roleGroupPK)
        {
            RoleGroupEntryFormData formData     = new RoleGroupEntryFormData();
            List <Control>         formControls = CreateFormControls(roleGroupPK);
            RoleGroupDTO           roleGroupDTO = roleGroupQuery.GetByPrimaryKey(roleGroupPK);

            if (roleGroupDTO == null)
            {
                throw new KairosException($"Record with primary key '{roleGroupDTO.RoleGroup_PK}' is not found.");
            }

            return(new RoleGroupEntryModel()
            {
                FormData = formData,
                FormControls = formControls,
                Model = roleGroupDTO,
            });
        }