public async Task<ActionResult> UserProfilePage(string id, Profile profile)
 {
     var user = await UsersBL.Instance.FindById(id);
     user.Profile = profile;
     await UsersBL.Instance.Save(user);
     return RedirectToAction("Index", "Home");
 }
 public bool Validate(Profile profile) => !string.IsNullOrWhiteSpace(profile.FirstName) &&
         !string.IsNullOrWhiteSpace(profile.LastName) &&
         Connection.IsValidEmailAddress(profile.Email) &&
         !string.IsNullOrWhiteSpace(profile.Phone) &&
         !string.IsNullOrWhiteSpace(profile.BusinessName) &&
         !string.IsNullOrWhiteSpace(profile.State) &&
         !string.IsNullOrWhiteSpace(profile.City) &&
         !string.IsNullOrWhiteSpace(profile.Postal) &&
         !string.IsNullOrWhiteSpace(profile.Address1);
Example #3
0
        public App()
        {
            InitializeComponent();

            // _databaseFactory.PromiseDBs();
            _ioFactory.PromiseFileReader();

            _profile = new ProfileServer().GetProfile();

            _autonomy.Activate();

            // The root page of your application
            var homePage = new ViewMenu.View(); // SearchCustomers.View();
            MainPage = new NavigationPage(homePage) { BarBackgroundColor = Color.Transparent };
            MainPage.Padding = new Thickness(5);

            _viewFactory.Promise(MainPage);
        }
 protected abstract void Add(Profile profile);
 protected abstract void Update(Profile profile);
 protected override void SaveData(Profile profile) => _database.OnSave(profile);
 protected bool Validate(Profile profile) => new ProfileValidator().Validate(profile);
 protected abstract void SaveData(Profile profile);
Example #9
0
 public User()
 {
     _profile = new Profile();
 }
Example #10
0
 public User(Profile p)
 {
     _profile = p;
     _profile.UserName = p.UserName;
 }
 protected override void Update(Profile profile)
 {
     var existingProfile = _profiles.FirstOrDefault(p => p.Id == profile.Id);
     profile.Update(existingProfile);
 }
 protected override void Add(Profile profile) => _profiles.Add(profile);
Example #13
0
 protected override void Add(Profile profile) => _databaseConnection.Insert(profile);
Example #14
0
 protected override void Update(Profile profile) => _databaseConnection.Update(profile);
Example #15
0
 public async Task<ActionResult> Create(Profile profile)
 {
     var user = new User(profile);
     await UsersBL.Instance.Create(user);
     return RedirectToAction("Index");
 }