示例#1
0
        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);
        }
示例#2
0
 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();
 }
示例#3
0
        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));
        }
示例#4
0
        public userSettings generateDefaultUserSettings()
        {
            userSettings currentUserSettings = new userSettings
            {
                firstName       = "",
                lastName        = "",
                userID          = User.FindFirst(ClaimTypes.NameIdentifier)?.Value,
                userCreatedDate = DateTimeOffset.Now,
                theme           = "dark"
            };

            return(currentUserSettings);
        }
示例#5
0
 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);
         }
     }
 }
示例#6
0
        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
        }
示例#7
0
 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();
     }
 }
示例#8
0
        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));