Esempio n. 1
0
        ///-------------------------------------------------------------------------------------------------
        /// \fn private async void BtnCreateMonthlySummary_Click(object sender, RoutedEventArgs e)
        ///
        /// \brief  Event handler. Called by BtnCreateMonthlySummary for click events
        ///
        /// \author Arie
        /// \date   2019-04-20
        ///
        /// \param  sender  Source of the event.
        /// \param  e       Routed event information.
        ///-------------------------------------------------------------------------------------------------
        private async void BtnCreateMonthlySummary_Click(object sender, RoutedEventArgs e)
        {
            // Get the month and year
            Nullable <DateTime> selectedDate = SelectDate.SelectedDate();

            if (selectedDate != null)
            {
                DateTime date = (DateTime)selectedDate;

                // Create the file
                if (await Task.Run(() => MainWindow.billing.MonthlyBillSummary(date)))
                {
                    // Display results
                    var firstDayOfMonth = new DateTime(date.Year, date.Month, 1);
                    var lastDayOfMonth  = firstDayOfMonth.AddMonths(1).AddDays(-1);

                    //string query = "SELECT attendee_hcn, code, gender, date, DollarAmount " +
                    //                    "FROM BillReport('" +
                    //                    date.Year + "-" + date.Month + "-" + "01 00:00:00', '" +
                    //                    date.Year + "-" + date.Month + "-" + lastDayOfMonth.Day + " 00:00:00')"
                    //                    ;

                    //LookupTable(query);

                    txbFeedBack.Text = "Successfully created billing summary";
                }
            }
            else
            {
                txbFeedBack.Text = "Failed to generate billing summary";
            }

            SetTimer();
        }
Esempio n. 2
0
        ///-------------------------------------------------------------------------------------------------
        /// \fn private async void BtnShowMonthlySummary_Click(object sender, RoutedEventArgs e)
        ///
        /// \brief  Event handler. Called by BtnShowMonthlySummary for click events
        ///
        /// \author Arie
        /// \date   2019-04-20
        ///
        /// \param  sender  Source of the event.
        /// \param  e       Routed event information.
        ///-------------------------------------------------------------------------------------------------
        private async void BtnShowMonthlySummary_Click(object sender, RoutedEventArgs e)
        {
            // Get the month and year
            Nullable <DateTime> selectedDate = SelectDate.SelectedDate();

            if (selectedDate != null)
            {
                DateTime date = (DateTime)selectedDate;

                DataTable dt = await Task.Run(() => MainWindow.billing.MonthlyBillSummaryTable(date));

                try
                {
                    txtResults.Clear();

                    ToggleTable(true);

                    dgData.DataContext = dt.DefaultView;
                }
                catch (Exception expt)
                {
                    Logging.Write(expt.Message);
                    System.Windows.MessageBox.Show("Exception : " + expt.Message);
                }
            }
            else
            {
                txbFeedBack.Text = "Failed to generate billing summary. Have you reconciled the MOH file?";
                SetTimer();
            }
        }
Esempio n. 3
0
        ///-------------------------------------------------------------------------------------------------
        /// \fn private async void CreateBillingFile_Click(object sender, RoutedEventArgs e)
        ///
        /// \brief  Event handler. Called by CreateBillingFile for click events
        ///
        /// \author Arie
        /// \date   2019-04-20
        ///
        /// \param  sender  Source of the event.
        /// \param  e       Routed event information.
        ///-------------------------------------------------------------------------------------------------
        private async void CreateBillingFile_Click(object sender, RoutedEventArgs e)
        {
            // Get the month and year
            Nullable <DateTime> selectedDate = SelectDate.SelectedDate();

            if (selectedDate != null)
            {
                DateTime date     = (DateTime)selectedDate;
                string   fileName = null;

                // Ask where to save the file.
                Microsoft.Win32.SaveFileDialog saveFileDialog = new Microsoft.Win32.SaveFileDialog();
                saveFileDialog.FileName   = Constants.monthlyBill + date.ToString("yyyyMM"); // The default name of the file
                saveFileDialog.DefaultExt = Constants.fileExt;                               // The default extension
                saveFileDialog.Filter     = "Text documents (.txt)|*.txt";                   // Filter files by extension

                if (saveFileDialog.ShowDialog() == true)
                {
                    fileName = saveFileDialog.FileName;
                }
                else
                {
                    // If user cancels, use default file name.
                    fileName = Constants.dbDirectory + @"\" + Constants.monthlyBill + date.ToString("yyyyMM") + Constants.fileExt;
                }

                // Create the file
                if (await Task.Run(() => MainWindow.billing.GenMonthlyBill(date, fileName)))
                {
                    // Display results
                    var firstDayOfMonth = new DateTime(date.Year, date.Month, 1);
                    var lastDayOfMonth  = firstDayOfMonth.AddMonths(1).AddDays(-1);

                    string query = "SELECT attendee_hcn, code, gender, date, DollarAmount " +
                                   "FROM BillReport('" +
                                   firstDayOfMonth + "', '" +
                                   lastDayOfMonth + "')"
                                   //date.Year + "-" + date.Month + "-" + "01 00:00:00', '" +
                                   //date.Year + "-" + date.Month + "-" + lastDayOfMonth.Day + " 00:00:00')"
                    ;

                    LookupTable(query);

                    txbFeedBack.Text = "Successfully created billing file";
                }
            }
            else
            {
                txbFeedBack.Text = "Failed to generate billing file";
            }

            SetTimer();
        }
Esempio n. 4
0
        ///-------------------------------------------------------------------------------------------------
        /// \fn private void ViewResponse_Click(object sender, RoutedEventArgs e)
        ///
        /// \brief  Event handler. Called by ViewResponse for click events
        ///
        /// \author Arie
        /// \date   2019-04-21
        ///
        /// \param  sender  Source of the event.
        /// \param  e       Routed event information.
        ///-------------------------------------------------------------------------------------------------
        private void ViewResponse_Click(object sender, RoutedEventArgs e)
        {
            // Get the month and year
            Nullable <DateTime> selectedDate = SelectDate.SelectedDate();

            if (selectedDate != null)
            {
                DateTime date = (DateTime)selectedDate;

                var firstDayOfMonth = new DateTime(date.Year, date.Month, 1);
                var lastDayOfMonth  = firstDayOfMonth.AddMonths(1).AddDays(-1);

                string query = "SELECT appointmentDate, HCN, gender, Code, fee, encounterState " +
                               "FROM ResponseRecord " +
                               "WHERE appointmentDate >= '" + firstDayOfMonth + "' " +
                               "AND appointmentDate <= '" + lastDayOfMonth + "'";

                LookupTable(query);
            }
        }