Beispiel #1
0
        private void deleteBillingButton_Click(object sender, RoutedEventArgs e)
        {
            if (descriptCostDataGrid.SelectedItem != null)
            {
                Billing deletedObj = (Billing)descriptCostDataGrid.SelectedItem;

                aptBilling.deleteBillingRow(deletedObj);

                descriptCostDataGrid.Items.Remove(deletedObj);
            }
        }
Beispiel #2
0
        private void editBillingButton_Click(object sender, RoutedEventArgs e)
        {
            if (descriptCostDataGrid.SelectedItem != null)
            {
                Billing editBilling = (Billing)descriptCostDataGrid.SelectedItem;

                EditRowBilling editBillingWindow = new EditRowBilling(editBilling.Description, editBilling.Cost);
                editBillingWindow.Owner = this;
                editBillingWindow.Show();
            }
        }
Beispiel #3
0
        private void EditButton_Click(object sender, RoutedEventArgs e)
        {
            BillingWindow parentWindow = (BillingWindow)this.Owner;
            decimal       d;
            Billing       rowToBeUpdated = (Billing)parentWindow.descriptCostDataGrid.SelectedItem;

            if (decimal.TryParse(editCostTextbox.Text, out d))
            {
                rowToBeUpdated.Description = editDescriptionTextbox.Text;
                rowToBeUpdated.Cost        = editCostTextbox.Text;
                parentWindow.descriptCostDataGrid.Items.Refresh();

                this.Close();
            }
            else
            {
                MessageBox.Show("Inavlid Numbers entered for cost, please try again");
            }
        }
Beispiel #4
0
        private void AddToTableButton_Click(object sender, RoutedEventArgs e)
        {
            decimal d;

            if (decimal.TryParse(itemCostTextBox.Text, out d))
            {
                Billing billingObj = new Billing()
                {
                    Description = itemDescriptionTextBox.Text, Cost = itemCostTextBox.Text
                };
                descriptCostDataGrid.Items.Add(billingObj);

                aptBilling.addBillingInfoList(billingObj);
            }
            else
            {
                MessageBox.Show("Inavlid Numbers entered for cost, please try again");
            }
        }
Beispiel #5
0
 // Updates billing information from appointment backend
 public void updateBillingRow(Billing rowToBeUpdated)
 {
     billingInfoList[billingInfoList.IndexOf(rowToBeUpdated)].Description = rowToBeUpdated.Description;
     billingInfoList[billingInfoList.IndexOf(rowToBeUpdated)].Cost        = rowToBeUpdated.Cost;
 }
Beispiel #6
0
 // Deleted billing information from appointment backend
 public void deleteBillingRow(Billing deletedRow)
 {
     billingInfoList.Remove(deletedRow);
 }
Beispiel #7
0
 // Adds billing information to appointment backend
 public void addBillingInfoList(Billing bInfo)
 {
     billingInfoList.Add(bInfo);
 }