Esempio n. 1
0
        public void AddFinancialRequestTest()
        {
            // Arrange
            int oldCount = financialRequestController.GetFinancialRequests().Count;

            // Act
            financialRequestController.AddFinancialRequest(RequestingDepartment.Administration, new Event(), "122", "test", new User("test", "test", User.Roles.AdministrationDepartmentManager));
            List <FinancialRequest> financialRequests = financialRequestController.GetFinancialRequests();

            // Assert
            Assert.AreEqual(oldCount + 1, financialRequests.Count);
        }
Esempio n. 2
0
        private void SaveButton_Click(object sender, EventArgs e)
        {
            var requestingDepartment = administrationRadioButton.Checked ? RequestingDepartment.Administration :
                                       serviceRadioButton.Checked ? RequestingDepartment.Service :
                                       productionRadioButton.Checked ? RequestingDepartment.Production : RequestingDepartment.Financial;

            FinancialRequestController financialRequestController = new FinancialRequestController();

            financialRequestController.AddFinancialRequest(requestingDepartment, requestEvent, ammountTextBox.Text, reasonTextBox.Text, Session.UserSession.LoggedInUser);
            this.Close();
        }