private async Task UpdateSelectedUserAsync() { ucUsers1.txtFullName.Text = Users.GetInstance().fullName; ucUsers1.txtGrossSalary.Text = Users.GetInstance().grossSalary.ToString(); ucUsers1.txtNetSalary.Text = Users.GetInstance().netSalary.ToString(); ucUsers1.txtDob.Text = Users.GetInstance().dob.ToString(); ucUsers1.txtHomeAddress.Text = Users.GetInstance().homeAddress; ucUsers1.txtNote.Text = Users.GetInstance().note; ucUsers1.txtPIN.Text = Users.GetInstance().pin; Departments tempDepartment = new Departments(); tempDepartment = await _departmentRepository.GetByIdAsync(Users.GetInstance().departmentId); ucUsers1.cbbDepartment.Items.Add(tempDepartment.id + "." + tempDepartment.departmentName); Roles tempRole = new Roles(); tempRole = await _rolesRepository.GetByIdAsync(Users.GetInstance().roleId); ucUsers1.cbbRole.Items.Add(tempRole.id + "." + tempRole.roleName); Shifts tempShift = new Shifts(); tempShift = await _shiftsRepository.GetByIdAsync(Users.GetInstance().shiftId); ucUsers1.cbbShift.Items.Add(tempShift.id + "." + tempShift.shiftName); }
public void Given_UserType_When_NewUsertTypeIsAdded_Then_ShouldHaveOneUserTypeInDatabase() { RunOnDatabase(context => { // ARRANGE var userTypesRepository = new RolesRepository(context); var userType = Role.Create("student"); var userTypeInserted = userTypesRepository.InsertAsync(userType).Result; // ACT var result = userTypesRepository.GetByIdAsync(userTypeInserted.Id); // ASSERT result.Should().NotBe(null); }); }