示例#1
0
        private void SolveFinancialRequestItem_Click(object sender, EventArgs e)
        {
            var selectedRequest = (FinancialRequest)financialRequestDataGridView.CurrentRow.DataBoundItem;
            FinancialRequestController financialRequestController = new FinancialRequestController();

            financialRequestController.SolveFinancialRequest(selectedRequest, (sender as MenuItem).Text);

            SetFinancialRequests();
        }
示例#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();
        }
示例#3
0
        private void SetFinancialRequests()
        {
            var financialRequest = new FinancialRequestController().GetFinancialRequests();

            if (Session.UserSession.LoggedInUser.Role == User.Roles.FinancialManager)
            {
                financialRequest = financialRequest.Where(x => x.Reviewed == false).ToList();
            }
            else
            {
                financialRequest = financialRequest.Where(x => x.Reviewed == true &&
                                                          x.User == Session.UserSession.LoggedInUser).ToList();
            }
            financialRequestDataGridView.DataSource = null;
            financialRequestDataGridView.DataSource = financialRequest;
        }