Esempio n. 1
0
        private void registerButton_Click(object sender, EventArgs e)
        {
            string name            = this.nameTextBox.Text;
            string password        = this.passwordTextBox.Text;
            string confirmPassword = this.confirmPassTextBox.Text;
            string deposit         = this.initialDepositTextBox.Text;

            if (name == "" || password == "" || confirmPassword == "" || deposit == "")
            {
                MessageBox.Show("All fields are mandatory");
            }
            else if (!password.Equals(confirmPassword))
            {
                MessageBox.Show("Passwords do not match");
            }
            else
            {
                RegistrationRepo newRegistration = new RegistrationRepo();
                if (newRegistration.RegisterUser(name, password, confirmPassword, deposit) == true)
                {
                    this.registerButton.Enabled = false;
                    LoginForm loginForm = new LoginForm();
                    loginForm.Region = this.Region;
                    this.Hide();
                    loginForm.Show();
                }
                else
                {
                    MessageBox.Show("Registration unsuccessfull");
                }
            }
        }
Esempio n. 2
0
        public void GetAllRegistrationRecordsFromDbContextGreaterThanZeroRecords()
        {
            var dbContext    = new SQLConnType(@"localhost\SqlExpress14", "CSG", "sa", "@1Mops4moa");
            var sysUnderTest = new RegistrationRepo(dbContext);

            var result = sysUnderTest.GetAllAsync();

            Assert.True(result.Count > 0);
        }
Esempio n. 3
0
        public void GetAllRegistrationRecordsFromDbContextNotNull()
        {
            var dbContext    = new SQLConnType(@"localhost\SQLEXPRESS14", "CSG", "sa", "@1Mops4moa");
            var sysUnderTest = new RegistrationRepo(dbContext);

            var result = sysUnderTest.GetAllAsync();

            Assert.NotNull(result);
        }
        public BotUserServices(
            ILogger <BotUserServices> logger,
            RegistrationRepo repo)
        {
            _logger = logger;

            _logger.LogTrace("----- INSTANCE CREATED - {ClassName}", GetType().Name);
            _repo = repo;
        }
Esempio n. 5
0
        public void DeleteClassRecordByID_Succeed()
        {
            var dbContext    = new SQLConnType(@"localhost\SqlExpress14", "CSG", "sa", "@1Mops4moa");
            var sysUnderTest = new RegistrationRepo(dbContext);
            var regEnt       = new Registration("50f14850-1161-4b7f-8093-af335090268f");

            sysUnderTest.DeleteByIdAsync(regEnt.Id);

            var result = sysUnderTest.GetAllAsync();

            Assert.True(result.Count > 0);
        }
Esempio n. 6
0
        public void InsertRegistrationRecord_Succeed()
        {
            var dbContext    = new SQLConnType(@"localhost\SqlExpress14", "CSG", "sa", "@1Mops4moa");
            var sysUnderTest = new RegistrationRepo(dbContext);
            var reg          = new Registration(Guid.NewGuid().ToString());

            reg.AttendanceDate     = DateTime.Now.Date;
            reg.AttendanceStatusId = 1;
            reg.ClassId            = "50f14850-1161-4b7f-8093-af335090268f";
            reg.Grade     = 75;
            reg.StudentId = "50f14850-1161-4b7f-8093-af335090268f";
            reg.TeacherId = "50f14850-1161-4b7f-8093-af335090268f";

            sysUnderTest.InsertEntityAsync(reg);

            var result = sysUnderTest.GetAllAsync();

            Assert.True(result.Count > 0);
        }