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);
Beispiel #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);
Beispiel #9
0
 public User()
 {
     _profile = new Profile();
 }
Beispiel #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);
 protected override void Add(Profile profile) => _databaseConnection.Insert(profile);
 protected override void Update(Profile profile) => _databaseConnection.Update(profile);
Beispiel #15
0
 public async Task<ActionResult> Create(Profile profile)
 {
     var user = new User(profile);
     await UsersBL.Instance.Create(user);
     return RedirectToAction("Index");
 }