示例#1
0
        private EmployeeSettingsModel RetrieveSettings(DynamicDataStore store)
        {
            EmployeeSettingsModel model = null;

            if (store != null)
            {
                model = store.LoadAll <EmployeeSettingsModel>().First();
            }

            return(model);
        }
        private void BindSettings()
        {
            EmployeeSettingsModel model = _handler.RetrieveSettings();

            if (model != null)
            {
                EmployeeFileName.Text  = model.ImportFileName;
                LocationsFileName.Text = model.LocationsFileName;
                ExpertiseFileName.Text = model.ExpertiseFileName;
            }
        }
        protected void FullRegion_MainRegion_Save_Click(object sender, EventArgs e)
        {
            EmployeeSettingsModel model = new EmployeeSettingsModel()
            {
                ImportFileName    = EmployeeFileName.Text,
                LocationsFileName = LocationsFileName.Text,
                ExpertiseFileName = ExpertiseFileName.Text
            };

            _handler.SaveSettings(model);

            OutputMessage.Text = "Changes have been saved.";
        }
示例#4
0
        public bool SaveSettings(EmployeeSettingsModel data)
        {
            DynamicDataStore store = DynamicDataStoreFactory.Instance.GetStore(StoreName);

            if (store == null)
            {
                store = DynamicDataStoreFactory.Instance.CreateStore(StoreName, typeof(EmployeeSettingsModel));
            }
            else
            {
                store.DeleteAll();
            }
            Identity id = store.Save(data);

            return(id.ExternalId != Guid.Empty);
        }