Exemplo n.º 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);
            }
        }
Exemplo n.º 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();
            }
        }
Exemplo n.º 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");
            }
        }
Exemplo n.º 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");
            }
        }
Exemplo n.º 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;
 }
Exemplo n.º 6
0
 // Deleted billing information from appointment backend
 public void deleteBillingRow(Billing deletedRow)
 {
     billingInfoList.Remove(deletedRow);
 }
Exemplo n.º 7
0
 // Adds billing information to appointment backend
 public void addBillingInfoList(Billing bInfo)
 {
     billingInfoList.Add(bInfo);
 }