private void deleteBillingButton_Click(object sender, RoutedEventArgs e) { if (descriptCostDataGrid.SelectedItem != null) { Billing deletedObj = (Billing)descriptCostDataGrid.SelectedItem; aptBilling.deleteBillingRow(deletedObj); descriptCostDataGrid.Items.Remove(deletedObj); } }
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(); } }
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"); } }
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"); } }
// 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; }
// Deleted billing information from appointment backend public void deleteBillingRow(Billing deletedRow) { billingInfoList.Remove(deletedRow); }
// Adds billing information to appointment backend public void addBillingInfoList(Billing bInfo) { billingInfoList.Add(bInfo); }