partial void btn_save_TouchUpInside(UIButton sender) { switch (SegmentProTest.SelectedSegment) { case 0: case 1: if (db != null) { foreach (var config in db.DescTableItems) { bool validURL = true; validURL = URLValidation(config, validURL); if (!validURL) { return; } success = ConfigurationDO.UpdateConfiguration(AppDelegate.DatabaseContext, config); } configTableView.ReloadData(); if (success == 1) { UIAlertView alert = new UIAlertView(@" ", @"Url's Saved Successfully", null, NSBundle.MainBundle.LocalizedString("OK", "OK")); alert.Show(); } } break; case 2: foreach (var userSet in db.UserSettingItems) { bool validData = true; if (userSet.ID == 3) { validData = DBVersionValidation(userSet, validData); } else { validData = DataValidation(userSet, validData); } if (!validData) { return; } using (UserSettingService ser = new UserSettingService(AppDelegate.DatabaseContext)) { success = ser.UpdateUserSetting(userSet); } } configTableView.ReloadData(); if (success == 1) { UIAlertView alert = new UIAlertView(@" ", @"User Setting Saved Successfully", null, NSBundle.MainBundle.LocalizedString("OK", "OK")); alert.Show(); } break; } }
public static Configuration GetConfiguration(ConfigurationDO configurationDO) { Configuration configuration = new Configuration() { ID = configurationDO.ID, ConfigDesc = configurationDO.ConfigurationDesc, ConfigUrl = configurationDO.ConfigurationUrl }; return(configuration); }
//ConfigurationConverter public static ConfigurationDO GetConfigurationDO(Configuration configuration) { ConfigurationDO configurationDO = new ConfigurationDO() { ID = configuration.ID, ConfigurationDesc = configuration.ConfigDesc, ConfigurationUrl = configuration.ConfigUrl }; return(configurationDO); }
public DB_ConfigTableSource(ConfigType configType) { var data = ConfigurationDO.getConfiguration(AppDelegate.DatabaseContext); selectedSegment = configType; switch (configType) { case ConfigType.ProductionService: DescTableItems = data.Where(i => i.IsDefault == true); break; case ConfigType.TestService: DescTableItems = data.Where(i => i.IsDefault == false); break; case ConfigType.UserSetting: using (UserSettingService usr = new UserSettingService(AppDelegate.DatabaseContext)) { var userSetting = usr.GetUserSettings(); UserSettingItems = userSetting; } break; } }
void Btn_Use_TouchUpInside(object sender, EventArgs e) { switch (SegmentProTest.SelectedSegment) { case 0: if (db != null) { var items = ConfigurationDO.getConfiguration(AppDelegate.DatabaseContext); foreach (var item in items) { item.use = false; ConfigurationDO.UpdateConfiguration(AppDelegate.DatabaseContext, item); foreach (var config in db.DescTableItems) { bool validURL = true; validURL = URLValidation(config, validURL); if (!validURL) { return; } if (item.ID == config.ID) { config.use = true; SuccessSegment1 = ConfigurationDO.UpdateConfiguration(AppDelegate.DatabaseContext, config); } } } configTableView.ReloadData(); if (SuccessSegment1 == 1) { UIAlertView alert = new UIAlertView(@" ", @"Flag Changed Successfully", null, NSBundle.MainBundle.LocalizedString("OK", "OK")); alert.Show(); } } break; case 1: if (db != null) { var items = ConfigurationDO.getConfiguration(AppDelegate.DatabaseContext); foreach (var item in items) { item.use = false; ConfigurationDO.UpdateConfiguration(AppDelegate.DatabaseContext, item); foreach (var config in db.DescTableItems) { bool validURL = true; validURL = URLValidation(config, validURL); if (!validURL) { return; } config.use = true; SuccessSegment2 = ConfigurationDO.UpdateConfiguration(AppDelegate.DatabaseContext, config); } configTableView.ReloadData(); } if (SuccessSegment2 == 1) { UIAlertView alert = new UIAlertView(@" ", @"Flag Changed Successfully", null, NSBundle.MainBundle.LocalizedString("OK", "OK")); alert.Show(); } } break; } }
/// <summary> /// Updates the service URL, Config page /// </summary> private void UpdateServiceURL() { if (conn != null) { var items = ConfigurationDO.getConfiguration (conn); if (items != null && items.Count > 0) { var configURLs = items.Where (i => i.use == true); foreach (var configURL in configURLs) { switch (configURL.ConfigDesc) { case "UrlAuth": if (configURL.ConfigUrl != null && configURL.ConfigUrl!=string.Empty) { ServiceURL.UrlAuth = configURL.ConfigUrl; } break; case "UrlGetInspection": if (configURL.ConfigUrl != null && configURL.ConfigUrl!=string.Empty) { ServiceURL.UrlGetInspection = configURL.ConfigUrl; } break; case "UrlInspectionResults": if (configURL.ConfigUrl != null && configURL.ConfigUrl!=string.Empty) { ServiceURL.UrlInspectionResults = configURL.ConfigUrl; } break; case "UrlINspectionReport": if (configURL.ConfigUrl != null && configURL.ConfigUrl!=string.Empty) { ServiceURL.UrlINspectionReport = configURL.ConfigUrl; } break; case "UrlGetPunchList": if (configURL.ConfigUrl != null && configURL.ConfigUrl!=string.Empty) { ServiceURL.UrlGetPunchList = configURL.ConfigUrl; } break; case "UrlPunchListResults": if (configURL.ConfigUrl != null && configURL.ConfigUrl!=string.Empty) { ServiceURL.UrlPunchListResults = configURL.ConfigUrl; } break; case "UrlGetInspectionDocuments": if (configURL.ConfigUrl != null && configURL.ConfigUrl!=string.Empty) { ServiceURL.UrlGetInspectionDocuments = configURL.ConfigUrl; } break; case "UrlMasterDataUpdate": if (configURL.ConfigUrl != null && configURL.ConfigUrl!=string.Empty) { ServiceURL.UrlMasterDataUpdate = configURL.ConfigUrl; } break; } } } } }