public oTabSettingsPage(oTabManager parent, ToolStrip toolStrip, Panel panelMain, ToolStrip mainToolStrip, string tabTitle) : base(parent, toolStrip, panelMain, mainToolStrip, tabTitle) { userSettings about = new userSettings { Dock = DockStyle.Fill }; workingPage.Name = tabTitle; workingPage.Controls.Add(about); }
private void Start() { siteCardAqiBG = siteCardAqi.GetComponent <Image>(); clock.OnBeat += everyBeat; settings = GetComponent <userSettings>(); countyTi = countyToggle.GetComponent <toggleImage>(); site72Ti = site72HrToggle.GetComponent <toggleImage>(); sitesInCounty = new List <int[]> { Keelung, NewTaipei, Taipei, Taoyuan, Yilan, HsinchuCounty, Hsinchu, Miaoli, Taichung, Hualien, Nantou, Changhua, Yunlin, ChiayiCounty, Chiayi, Tainan, Kaohsiung, Taitung, Pingtung, Penghu, Kinmen, Lienchiang }; populateSiteSelectorList(); }
public IActionResult GetUserInfo() { string userID = User.FindFirst(ClaimTypes.NameIdentifier)?.Value; DataAccess accessor = new DataAccess(); userSettings currentUserSettings = accessor.GetAll <userSettings>().FirstOrDefault(); if (currentUserSettings == null) { currentUserSettings = generateDefaultUserSettings(); accessor.Post(currentUserSettings); } return(Json(currentUserSettings)); }
public userSettings generateDefaultUserSettings() { userSettings currentUserSettings = new userSettings { firstName = "", lastName = "", userID = User.FindFirst(ClaimTypes.NameIdentifier)?.Value, userCreatedDate = DateTimeOffset.Now, theme = "dark" }; return(currentUserSettings); }
public bool GetUsertableViewStatusById(int userId) { using (var context = new IgorMarkivMessengerDBEntities()) { userSettings userSetting = context.userSettings.Where(us => us.userId == userId).FirstOrDefault(); if (userSetting != null) { return(userSetting.fileTableView.Value); } else { return(false); } } }
public static userSettings getUserSettings(string apiAuthToken, string apiEndpoint) { string jsonurl = apiEndpoint + "/beernet/userSettings/"; var client = new RestClient("" + jsonurl); var request = new RestRequest(Method.GET); request.AddHeader("Authorization", "bearer " + apiAuthToken); var response = client.Execute(request); userSettings returnable = JsonConvert.DeserializeObject <userSettings>(response.Content); return(returnable); //BeerNet/userSettings }
public void SaveUseSettingTableView(int userId, bool tableViewStatus) { using (var context = new IgorMarkivMessengerDBEntities()) { userSettings userSetting = context.userSettings.Where(us => us.userId == userId).FirstOrDefault(); if (userSetting != null) { userSetting.fileTableView = tableViewStatus; } else { userSettings newUserSetting = new userSettings() { userId = userId, fileTableView = tableViewStatus }; context.userSettings.Add(newUserSetting); } context.SaveChanges(); } }
public IActionResult UpdateUserInfo([FromBody] userSettings currentUserSettings) { string userID = User.FindFirst(ClaimTypes.NameIdentifier)?.Value; DataAccess accessor = new DataAccess(); userSettings existingUserSettings = accessor.GetAll <userSettings>().FirstOrDefault(); if (existingUserSettings == null) { existingUserSettings = generateDefaultUserSettings(); accessor.Post(currentUserSettings); existingUserSettings = accessor.GetAll <userSettings>().FirstOrDefault(); existingUserSettings.firstName = currentUserSettings.firstName; existingUserSettings.lastName = currentUserSettings.lastName; existingUserSettings.theme = currentUserSettings.theme; } else { existingUserSettings.firstName = currentUserSettings.firstName; existingUserSettings.lastName = currentUserSettings.lastName; existingUserSettings.theme = currentUserSettings.theme; } currentUserSettings = GlobalFunctions.AddIdIfNeeded(existingUserSettings, existingUserSettings.idString); return(Json(accessor.Post(currentUserSettings))); }
get => (bool)Convert.ChangeType(userSettings[nameof(AutoApplyRemoteConfigs)], typeof(bool));