Пример #1
0
 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");
 }
Пример #2
0
 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);
Пример #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);
Пример #9
0
 public User()
 {
     _profile = new Profile();
 }
Пример #10
0
 public User(Profile p)
 {
     _profile = p;
     _profile.UserName = p.UserName;
 }
Пример #11
0
 protected override void Update(Profile profile)
 {
     var existingProfile = _profiles.FirstOrDefault(p => p.Id == profile.Id);
     profile.Update(existingProfile);
 }
Пример #12
0
 protected override void Add(Profile profile) => _profiles.Add(profile);
Пример #13
0
 protected override void Add(Profile profile) => _databaseConnection.Insert(profile);
Пример #14
0
 protected override void Update(Profile profile) => _databaseConnection.Update(profile);
Пример #15
0
 public async Task<ActionResult> Create(Profile profile)
 {
     var user = new User(profile);
     await UsersBL.Instance.Create(user);
     return RedirectToAction("Index");
 }