Beispiel #1
0
        private void addBudgetButton_Click(object sender, EventArgs e)
        {
            AddBudgetItemPage addPage = new AddBudgetItemPage();
            addPage.ShowDialog();

            if (addPage.isConfirm == true) {
                string budgetName = addPage.name;
                decimal amount = addPage.amount;

                if (tabControl2.SelectedTab == tabPage7) {
                    int budgetId = eventOrganizerManager.AddExpenditure(budgetName, amount, this.eventId);
                    ListViewItem newBudget = new ListViewItem(new[] { budgetName, amount.ToString("F2"), budgetId.ToString() });
                    expenditureListView.Items.Add(newBudget);
                } else {
                    int budgetId = eventOrganizerManager.AddIncome(budgetName, amount, this.eventId);
                    ListViewItem newBudget = new ListViewItem(new[] { budgetName, amount.ToString("F2"), budgetId.ToString() });
                    incomeListView.Items.Add(newBudget);
                }
                toolStripStatusLabel1.Text = "Budget item <" + budgetName + "> has been added to the list.";
            }
            addPage.Close();
            this.totalIncomeLabel.Text = eventOrganizerManager.GetTotalIncome(eventId);
            this.totalExpenditureLabel.Text = eventOrganizerManager.GetTotalExpenditure(eventId);
            this.netCashflowLabel.Text = eventOrganizerManager.GetNetBudget(eventId);
            budgetButtonDisable();
        }
Beispiel #2
0
        private void addBudgetButton_Click(object sender, EventArgs e)
        {
            AddBudgetItemPage addPage = new AddBudgetItemPage();

            addPage.ShowDialog();

            if (addPage.isConfirm == true)
            {
                string  budgetName = addPage.name;
                decimal amount     = addPage.amount;

                if (tabControl2.SelectedTab == tabPage7)
                {
                    int          budgetId  = eventOrganizerManager.AddExpenditure(budgetName, amount, this.eventId);
                    ListViewItem newBudget = new ListViewItem(new[] { budgetName, amount.ToString("F2"), budgetId.ToString() });
                    expenditureListView.Items.Add(newBudget);
                }
                else
                {
                    int          budgetId  = eventOrganizerManager.AddIncome(budgetName, amount, this.eventId);
                    ListViewItem newBudget = new ListViewItem(new[] { budgetName, amount.ToString("F2"), budgetId.ToString() });
                    incomeListView.Items.Add(newBudget);
                }
                toolStripStatusLabel1.Text = "Budget item <" + budgetName + "> has been added to the list.";
            }
            addPage.Close();
            this.totalIncomeLabel.Text      = eventOrganizerManager.GetTotalIncome(eventId);
            this.totalExpenditureLabel.Text = eventOrganizerManager.GetTotalExpenditure(eventId);
            this.netCashflowLabel.Text      = eventOrganizerManager.GetNetBudget(eventId);
            budgetButtonDisable();
        }
Beispiel #3
0
 private void editBudgetButton_Click(object sender, EventArgs e)
 {
     if (tabControl2.SelectedTab == tabPage7)
     {
         ListViewItem lvi = expenditureListView.SelectedItems[0];
         if (lvi.SubItems[2].Text == "0")
         {
             MessageBox.Show("Logistic List cannot be editted", "Entry Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
         }
         else
         {
             AddBudgetItemPage editPage = new AddBudgetItemPage(lvi.SubItems[0].Text, Convert.ToDecimal(lvi.SubItems[1].Text));
             editPage.ShowDialog();
             if (editPage.isConfirm == true)
             {
                 string  budgetName = editPage.name;
                 decimal amount     = editPage.amount;
                 eventOrganizerManager.EditExpenditure(budgetName, amount, Convert.ToInt32(lvi.SubItems[2].Text), this.eventId);
                 lvi.SubItems[0].Text       = budgetName;
                 lvi.SubItems[1].Text       = amount.ToString("F2");
                 toolStripStatusLabel1.Text = "Budget item <" + budgetName + "> has been editted";
             }
         }
     }
     else
     {
         ListViewItem lvi = incomeListView.SelectedItems[0];
         if (lvi.SubItems[2].Text == "0")
         {
             MessageBox.Show("CampFees cannot be editted", "Entry Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
         }
         else
         {
             AddBudgetItemPage editPage = new AddBudgetItemPage(lvi.SubItems[0].Text, Convert.ToDecimal(lvi.SubItems[1].Text));
             editPage.ShowDialog();
             if (editPage.isConfirm == true)
             {
                 string  budgetName = editPage.name;
                 decimal amount     = editPage.amount;
                 eventOrganizerManager.EditIncome(budgetName, amount, Convert.ToInt32(lvi.SubItems[2].Text), this.eventId);
                 lvi.SubItems[0].Text       = budgetName;
                 lvi.SubItems[1].Text       = amount.ToString("F2");
                 toolStripStatusLabel1.Text = "Budget item <" + budgetName + "> has been editted";
             }
         }
     }
     this.totalIncomeLabel.Text      = eventOrganizerManager.GetTotalIncome(eventId);
     this.totalExpenditureLabel.Text = eventOrganizerManager.GetTotalExpenditure(eventId);
     this.netCashflowLabel.Text      = eventOrganizerManager.GetNetBudget(eventId);
     budgetButtonDisable();
 }
Beispiel #4
0
 private void editBudgetButton_Click(object sender, EventArgs e)
 {
     if (tabControl2.SelectedTab == tabPage7) {
         ListViewItem lvi = expenditureListView.SelectedItems[0];
         if (lvi.SubItems[2].Text == "0") {
             MessageBox.Show("Logistic List cannot be editted", "Entry Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
         } else {
             AddBudgetItemPage editPage = new AddBudgetItemPage(lvi.SubItems[0].Text, Convert.ToDecimal(lvi.SubItems[1].Text));
             editPage.ShowDialog();
             if (editPage.isConfirm == true) {
                 string budgetName = editPage.name;
                 decimal amount = editPage.amount;
                 eventOrganizerManager.EditExpenditure(budgetName, amount, Convert.ToInt32(lvi.SubItems[2].Text), this.eventId);
                 lvi.SubItems[0].Text = budgetName;
                 lvi.SubItems[1].Text = amount.ToString("F2");
                 toolStripStatusLabel1.Text = "Budget item <" + budgetName + "> has been editted";
             }
         }
     } else {
         ListViewItem lvi = incomeListView.SelectedItems[0];
         if (lvi.SubItems[2].Text == "0") {
             MessageBox.Show("CampFees cannot be editted", "Entry Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
         } else {
             AddBudgetItemPage editPage = new AddBudgetItemPage(lvi.SubItems[0].Text, Convert.ToDecimal(lvi.SubItems[1].Text));
             editPage.ShowDialog();
             if (editPage.isConfirm == true) {
                 string budgetName = editPage.name;
                 decimal amount = editPage.amount;
                 eventOrganizerManager.EditIncome(budgetName, amount, Convert.ToInt32(lvi.SubItems[2].Text), this.eventId);
                 lvi.SubItems[0].Text = budgetName;
                 lvi.SubItems[1].Text = amount.ToString("F2");
                 toolStripStatusLabel1.Text = "Budget item <" + budgetName + "> has been editted";
             }
         }
     }
     this.totalIncomeLabel.Text = eventOrganizerManager.GetTotalIncome(eventId);
     this.totalExpenditureLabel.Text = eventOrganizerManager.GetTotalExpenditure(eventId);
     this.netCashflowLabel.Text = eventOrganizerManager.GetNetBudget(eventId);
     budgetButtonDisable();
 }