public void Setup() { userStore = Substitute.For <IUserStore <IdentityUser> >(); userManager = Substitute.For <UserManager <IdentityUser> >(userStore); registrationLogic = new RegistrationLogic(userManager); accountController = new AccountController(registrationLogic, userManager); }
public void TestGetBalance() { var cacheLogic = new CacheLogic(); cacheLogic.ClearCache(); var registerLogic = new RegistrationLogic(); registerLogic.RegisterNewUser("alex", "pass"); WithdrawlLogic withdrawlLogic = new WithdrawlLogic(); withdrawlLogic.CreateWithdrawl("Customer1", "Check", 22, "alex"); withdrawlLogic.CreateWithdrawl("Customer1", "Check", 2, "alex"); DepositLogic depositLogic = new DepositLogic(); depositLogic.CreateDeposit("Customer1", "Check", 55, "alex"); TransactionLogic transactionLogic = new TransactionLogic(); var currentBalance = transactionLogic.GetBalance("alex"); Assert.AreEqual((55 - 22 - 2), currentBalance); }
//##########################################CLASS PatientRegistrationList EVENTS################################################# //event is raised when the class is loaded private void ClassLoad(object sender, EventArgs e) { try { _regManager = new RegistrationLogic(_userInfo); _regManager.DeleteImageDirectory(Application.StartupPath); _patientInfo = _regManager.SelectByPatientSystemIdPatientInformation(_userInfo, _patientId, Application.StartupPath); this.lblSysId.Text = _patientInfo.PatientSystemId; this.lblName.Text = _patientInfo.LastName.ToUpper() + ", " + _patientInfo.FirstName + " " + _patientInfo.MiddleName; if (!String.IsNullOrEmpty(_patientInfo.ImagePath)) { this.pbxPatient.Image = Image.FromFile(_patientInfo.ImagePath); } this.optRegistration.Checked = true; } catch (Exception ex) { DentalLib.ProcStatic.ShowErrorDialog(ex.Message, "Error Loading Patient Registration List"); this.Close(); } } //-------------------------------
public void TestTransactionList() { var cacheLogic = new CacheLogic(); cacheLogic.ClearCache(); var registerLogic = new RegistrationLogic(); registerLogic.RegisterNewUser("alex", "pass"); WithdrawlLogic withdrawlLogic = new WithdrawlLogic(); var firstWithdrawl = withdrawlLogic.CreateWithdrawl("Customer1", "Check", 22, "alex"); withdrawlLogic.CreateWithdrawl("Customer1", "Check", 2, "alex"); DepositLogic depositLogic = new DepositLogic(); var firstDeposit = depositLogic.CreateDeposit("Customer1", "Check", 55, "alex"); TransactionLogic transactionLogic = new TransactionLogic(); var transactionList = transactionLogic.GetTransactionList("alex"); Assert.AreEqual(transactionList.Count, 3); Assert.AreEqual((-transactionList[1].Amount), firstWithdrawl.Amount); Assert.AreEqual((transactionList[0].Amount), firstDeposit.Amount); }
public async Task <RegistrationRequest> Post([FromBody] RegistrationRequest registrationRequest) { CheckNullBody(registrationRequest); var registrationLogic = new RegistrationLogic(Cache, BudgeterLock, AuthContext, UserContext, SettingRequester, IsAdmin); return(await registrationLogic.RegisterUser(registrationRequest)); }
//#######################################CLASS MedicalPrescription EVENTS########################################### //event is raised when the class is loaded private void ClassLoad(object sender, EventArgs e) { _strPrescriptionTemp = _regInfo.MedicalPrescription; this.txtPrescription.Text = _regInfo.MedicalPrescription; this.txtPrescription.Select(0, 0); _regManager = new RegistrationLogic(_userInfo); } //-----------------------------------
public PatientRegistrationCreate(CommonExchange.SysAccess userInfo, RegistrationLogic regManager, CommonExchange.Patient patientInfo) : base(userInfo, regManager, patientInfo) { this.InitializeComponent(); this.FormClosing += new FormClosingEventHandler(ClassClosing); this.btnRegister.Click += new EventHandler(btnRegisterClick); this.btnCancel.Click += new EventHandler(btnCancelClick); }
public PatientRegistration(CommonExchange.SysAccess userInfo, RegistrationLogic regManager, CommonExchange.Patient patientInfo) { this.InitializeComponent(); _userInfo = userInfo; _patientInfo = patientInfo; _regManager = regManager; this.Load += new EventHandler(ClassLoad); this.lnkChange.LinkClicked += new LinkLabelLinkClickedEventHandler(lnkChangeLinkClicked); }
public ReportOptionsSalesReport(CommonExchange.SysAccess userInfo, DateTime iDateFrom, DateTime iDateTo, RegistrationLogic regManager) : base(iDateFrom, iDateTo) { this.InitializeComponent(); _userInfo = userInfo; _regManager = regManager; this.lnkAll.LinkClicked += new LinkLabelLinkClickedEventHandler(lnkAllLinkClicked); this.lnkNone.LinkClicked += new LinkLabelLinkClickedEventHandler(lnkNoneLinkClicked); this.cbxProcedures.SelectedIndexChanged += new EventHandler(cbxProceduresSelectedIndexChanged); }
//#########################################CLASS Reports EVENTS##################################################################### //event is raised when the class is loaded protected virtual void ClassLoad(object sender, EventArgs e) { if (!DatabaseLib.ProcStatic.IsSystemAccessAdmin(_userInfo) && !DatabaseLib.ProcStatic.IsSystemAccessDentalUser(_userInfo)) { DentalLib.ProcStatic.ShowErrorDialog("You are not allowed to access this module.", "Reports"); this.Close(); } _regManager = new RegistrationLogic(_userInfo); } //------------------------------
public PatientRegistrationUpdate(CommonExchange.SysAccess userInfo, RegistrationLogic regManager, CommonExchange.Patient patientInfo, String registrationSysId) : base(userInfo, regManager, patientInfo) { this.InitializeComponent(); _registrationSysId = registrationSysId; this.FormClosing += new FormClosingEventHandler(ClassClosing); this.btnUpdate.Click += new EventHandler(btnUpdateClick); this.btnClose.Click += new EventHandler(btnCloseClick); }
public ReportsSalesReport(CommonExchange.SysAccess userInfo, DateTime dateFrom, DateTime dateTo, RegistrationLogic regManager) : base(userInfo) { this.InitializeComponent(); _userInfo = userInfo; _dateFrom = dateFrom; _dateTo = dateTo; _regManager = regManager; this.FormClosed += new FormClosedEventHandler(ClassClosed); this.btnPrint.Click += new EventHandler(btnPrintClick); }
private bool CheckExistingEmail() { if (RegistrationLogic.CheckExistingEmail(txtEmail.Text)) { lblPostoji.Visible = true; txtEmail.Clear(); return(false); } else { lblPostoji.Visible = false; return(true); } }
private bool ValidateEmail() { if (RegistrationLogic.CheckEmail(txtEmail.Text)) { lblEmail.Visible = false; return(true); } else { lblEmail.Visible = true; } txtEmail.Clear(); return(false); }
public void RegistrationTest() { var cacheLogic = new CacheLogic(); cacheLogic.ClearCache(); var registerLogic = new RegistrationLogic(); registerLogic.RegisterNewUser("alex", "pass"); var authLogic = new AuthenticationLogic(); var findUser = authLogic.CheckSystemForUsername("alex"); var findUser2 = authLogic.CheckSystemForUsername("jon"); Assert.AreEqual(findUser, true); Assert.AreEqual(findUser2, false); }
private void btnRegistriraj_Click(object sender, EventArgs e) { if (CheckPassword() & ValidateEmail() & CheckExistingEmail() & CheckPasswordLength()) { User u = new User(); u.Name = txtName.Text; u.Surname = txtSurname.Text; u.Email = txtEmail.Text; u.Password = txtPassword.Text; u.PhoneNumber = txtPhoneNumber.Text; u.BirthDate = DateTime.Parse(cbxYear.Text + "/" + cbxMonth.Text + "/" + cbxDay.Text); u.CommitteeId = int.Parse(cbxCommittee.SelectedValue.ToString()); RegistrationLogic r = new RegistrationLogic(); if (r.Register(u)) { MessageBox.Show("Registracija je uspješna!", "Registracija", MessageBoxButtons.OK); this.Close(); } } }
private async void RegisterButton_Clicked(object sender, EventArgs e) { string name = nameEntry.Text; string email = emailEntry.Text; string password = passwordEntry.Text; string passwordConfirm = passwordEntryConfirm.Text; if (String.IsNullOrEmpty(name) || String.IsNullOrEmpty(email) || String.IsNullOrEmpty(password) || String.IsNullOrEmpty(passwordConfirm)) { await DisplayAlert("Greška!", "Morate popuniti sva polja", "OK"); return; } if (password == passwordConfirm) { registerButton.IsEnabled = false; cancelButton.IsEnabled = false; registerActivityIndicator.IsVisible = true; bool succcess = await RegistrationLogic.Register(name, email, password); if (succcess) { Application.Current.MainPage = new MainPage(); } else { await DisplayAlert("Greška!", "Registracija nije uspjela", "OK"); } registerButton.IsEnabled = true; cancelButton.IsEnabled = true; registerActivityIndicator.IsVisible = false; } else { await DisplayAlert("Greška!", "Lozinke se ne podudaraju", "OK"); } }
public async Task <int> RegisterGoogleUser(GoogleUserProfile googleUser, bool isAdmin) { // Register the new user RegistrationRequest registrationRequest = new RegistrationRequest { Username = googleUser.Email, RegistrationChannel = "Google-SSO-Provider", UserProfileProperties = new List <UserProfileProperty> { new UserProfileProperty { ProfilePropertyName = "GoogleId", Value = googleUser.Id }, new UserProfileProperty { ProfilePropertyName = "FirstName", Value = googleUser.GivenName }, new UserProfileProperty { ProfilePropertyName = "LastName", Value = googleUser.FamilyName }, new UserProfileProperty { ProfilePropertyName = "Email", Value = googleUser.Email } } }; RegistrationLogic registrationLogic = new RegistrationLogic(Cache, BudgeterLock, AuthContext, UserContext, SettingRequester, isAdmin); RegistrationRequest registrationResponse = await registrationLogic.RegisterUser(registrationRequest); return(registrationResponse.UserId); }
static void Main(string[] args) { RegistrationLogic.CreateAdminUser(); ConsoleOptionsLogic.LoggedOutScreen(); }
public AccountController(RegistrationLogic registrationLogic, UserManager <IdentityUser> userManager) { _registrationLogic = registrationLogic; _userManager = userManager; }
public void Setup() { userStore = Substitute.For <IUserStore <IdentityUser> >(); userManager = Substitute.For <UserManager <IdentityUser> >(userStore); registrationLogic = new RegistrationLogic(userManager); }