Exemple #1
0
        ///-------------------------------------------------------------------------------------------------
        /// \fn private void BtnAdd_Click(object sender, RoutedEventArgs e)
        ///
        /// \brief  Try to add a billcode when the add button is clicked. It is validated before adding
        ///
        /// \author Bailey
        /// \date   2019-04-18
        ///-------------------------------------------------------------------------------------------------
        private void BtnAdd_Click(object sender, RoutedEventArgs e)
        {
            // Try to add
            EMSBilling billing = new EMSBilling();
            string     newCode = txtAdd.Text;

            if (billing.validateBillCode(newCode, appointment.Date))
            {
                // Add new billcode to the list
                List <string> codes = appointment.GetBillcodesByHCN(selectedPerson.HCN);
                codes.Add(newCode);

                // Update database
                Database.UpdateBillcodes(appointment.AppointmentID, selectedPerson.HCN, codes);

                // Reset user input
                txtAdd.Clear();
            }
            else
            {
                MessageBox.Show("Invalid Billcode");
            }

            // Reload Bill Codes
            LoadBillCodes();
        }
Exemple #2
0
 ///-------------------------------------------------------------------------------------------------
 /// \fn public Reconcile(Object obj)
 ///
 /// \brief  Constructor
 ///
 /// \author Arie
 /// \date   2019-04-20
 ///
 /// \param  obj The object.
 ///-------------------------------------------------------------------------------------------------
 public Reconcile(Object obj)
 {
     InitializeComponent();
     billing = (EMSBilling)obj;
     cmdMonth.ItemsSource = cultureInfo.DateTimeFormat.MonthNames.Take(12);                 //fill month selector
     cmdYear.ItemsSource  = Enumerable.Range(startYear, DateTime.Now.Year - startYear + 1); //Fill year selector
 }
Exemple #3
0
        ///-------------------------------------------------------------------------------------------------
        /// \fn private void BtnUpdate_Click(object sender, RoutedEventArgs e)
        ///
        /// \brief  Try to update an existing billcode when the update button is clicked. It is validated
        ///			before editing, and an existing billcode must be selecetd for this to be possible
        ///
        /// \author Bailey
        /// \date   2019-04-18
        ///-------------------------------------------------------------------------------------------------
        private void BtnUpdate_Click(object sender, RoutedEventArgs e)
        {
            // Try to update
            EMSBilling billing         = new EMSBilling();
            string     replacementCode = txtUpdate.Text;

            if (billing.validateBillCode(replacementCode, appointment.Date))
            {
                // Remove old, add new billcode to list
                List <string> codes = appointment.GetBillcodesByHCN(selectedPerson.HCN);
                codes.Add(replacementCode);
                codes.Remove(lstBillCodes.SelectedItem.ToString());

                // Update database
                Database.UpdateBillcodes(appointment.AppointmentID, selectedPerson.HCN, codes);

                // Reset user input
                txtUpdate.Clear();
            }

            // Reload Bill Codes
            LoadBillCodes();
        }