private void SetupBioScreenView(IUserEntitie loggedInUser, Window window) { this.appViews.BioScreen.Add(new Label(10, 3, "Welcome " + loggedInUser.Username) { TextAlignment = TextAlignment.Centered }); window.Add(this.appViews.BioScreen); this.appViews.BioScreen.ConfirmButton.Clicked += () => { BioDataEntitie newBioData = new BioDataEntitie { Age = int.Parse(this.appViews.BioScreen.AgeTextField.Text.ToString()), Weight = double.Parse(this.appViews.BioScreen.WeightTextField.Text.ToString()), Height = double.Parse(this.appViews.BioScreen.HeightTextField.Text.ToString()), NeckSize = double.Parse(this.appViews.BioScreen.NeckSizeeTextField.Text.ToString()), WaistSize = double.Parse(this.appViews.BioScreen.WaistSizeTextField.Text.ToString()), HipsSize = double.Parse(this.appViews.BioScreen.HipsSizeTextField.Text.ToString()), Gender = int.Parse(this.appViews.BioScreen.GenderRadioGroup.Selected.ToString()) }; loggedInUser.BioData = newBioData; userService.UpdateUser(loggedInUser); window.Remove(this.appViews.BioScreen); window.Add(this.appViews.ChooseGoalScreen); this.appViews.ChooseGoalScreen.SetFocus(this.appViews.ChooseGoalScreen.RadioGroup); Application.Run(window); }; }
public void Add(IUserEntitie entity) { if (entity == null) { throw new ArgumentNullException("User cannot be null!"); } this.FakeLiteDb.Add(entity); }
public void UpdateUser(IUserEntitie loggedInUser) { if (loggedInUser == null) { throw new ArgumentNullException("User cannot be null!"); } db.UserRepository.Update(loggedInUser); }
public void Register(IUserEntitie userToCreate) { if (userToCreate == null) { throw new ArgumentNullException("User cannot be null!"); } db.UserRepository.Add(userToCreate); }
public void Update(IUserEntitie entity) { using (var db = new LiteDatabase(connectionString)) { var collection = db.GetCollection <IUserEntitie>(typeof(IUserEntitie).Name); collection.Update(entity); } }
public void Add(IUserEntitie entity) { using (var db = new LiteDatabase(connectionString)) { var collection = db.GetCollection <IUserEntitie>(typeof(IUserEntitie).Name); collection.Insert(collection.Max("_id").AsInt32 + 1, entity); } }
public void Update(IUserEntitie entity) { if (entity == null) { throw new ArgumentNullException("User cannot be null!"); } var user = this.FakeLiteDb.Find(u => u.Username == entity.Username); this.FakeLiteDb.Remove(user); this.FakeLiteDb.Add(entity); }
private void SetupLoginScreenLoginButtonAction(Window window) { this.appViews.LoginScreen.LoginButton.Clicked += () => { // Try to get existing user loggedInUser = userService.Login(this.appViews.LoginScreen.UsernameField.Text.ToString(), this.appViews.LoginScreen.PasswordField.Text.ToString()); // Successfull login if (loggedInUser != null) { this.HandleSuccessfulLogin(window); } // Login failed else { this.SetupFailedLoginDialogPopUp(); } }; }
public void Delete(IUserEntitie entity) { throw new NotImplementedException(); }