private VendorEntryModel GetCreateStateModel()
        {
            VendorEntryFormData formData     = new VendorEntryFormData();
            List <Control>      formControls = CreateFormControls(0);
            VendorDTO           vendorDTO    = new VendorDTO();

            return(new VendorEntryModel()
            {
                FormData = formData,
                FormControls = formControls,
                Model = vendorDTO,
            });
        }
        private VendorEntryModel GetUpdateStateModel(int vendorPK)
        {
            VendorEntryFormData formData     = new VendorEntryFormData();
            List <Control>      formControls = CreateFormControls(vendorPK);
            VendorDTO           vendorDTO    = vendorQuery.GetByPrimaryKey(vendorPK);

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

            return(new VendorEntryModel()
            {
                FormData = formData,
                FormControls = formControls,
                Model = vendorDTO,
            });
        }