private async void OnSubmitClicked(object obj) { ActivityRunning(); if (Opdnumber != 0 & Firstname != null & Lastname != null & Dateofbirth != null & village != null) { var model = new Patients { OPDNumber = Opdnumber, FirstName = Firstname.ToUpper(), LastName = Lastname.ToUpper(), DateOfBirth = Dateofbirth.Date, HouseNumber = Housenumber, Village = village.ToUpper(), PhoneNumber = Phonenumber, }; var check = await App.Database.CheckClientAsync(Opdnumber); if (check) { DisplayClientAlreadyRegisteredPrompt(); Clear(); return; } else { var responce = await App.Database.CreatePatientAsync(model); if (responce) { ActivityStopped(); DisplayRegistrationSuccessPrompt(); Clear(); //await Shell.Current.GoToAsync("PatientsListPage"); await Shell.Current.GoToAsync($"//{nameof(PatientsListPage)}"); return; } else { ActivityStopped(); DisplayRegistrationFailedPrompt(); Clear(); return; } //await Shell.Current.GoToAsync(".."); } } else { ActivityStopped(); DisplayRequiredFieldPrompt(); return; } }
public AUser(List <string> data, IProcessLogger logger) { AccountNo = int.Parse(data[0]); Firstname = data[1]; Lastname = data[2]; Username = data[3]; PasswordSalt = data[4]; PasswordHash = data[5]; Phone = data[6]; Email = data[7]; Permission = int.Parse(data[8]); DefaultStore = int.Parse(data[9]); _logger = logger; _logger.Log($"USER: {Firstname.ToUpper()} {Lastname.ToUpper()} with username {Username.ToUpper()}", true); }
private async void OnSubmitClicked(object obj) { var model = new Users { Username = Username, Password = Password, Firstname = Firstname.ToUpper(), Lastname = Lastname.ToUpper(), Phonenumber = Phonenumber.ToUpper(), DateCreated = DateTime.Now, DateModified = DateTime.Now, }; if (Username != null && Password != null && Firstname != null && Lastname != null) { var check = await App.Database.CheckUserAsync(Username); if (check) { DisplayUserExistPrompt(); Clear(); await Shell.Current.GoToAsync($"//{nameof(PatientsListPage)}"); } else { var responce = await App.Database.CreateUserAsync(model); if (responce) { //(); Clear(); await Shell.Current.GoToAsync($"//{nameof(PatientsListPage)}"); } else { Clear(); } DisplaySaveFailedPrompt(); } } else { DisplayRequriedFieldPrompt(); } }
public override string ToString() { return($"{Title.Description()}{Lastname.ToUpper()} {Firstname}"); }