Beispiel #1
0
 private void combItemName_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (dateSelected == true)
     {
         AllSalesReport.AllReportBetweenDate(dataGridDailyReport, dateTimeFrom, combItemName.Text);
     }
     else
     {
         AllSalesReport.DisplaySelectedReport(dataGridDailyReport, combItemName.Text);
     }
     lblTotal.Text = string.Format("{0:00.#0}", AllSalesReport.Total);
 }
Beispiel #2
0
 private void btnReportSales_Click(object sender, EventArgs e)
 {
     try
     {
         AllSalesReport.CheckItemReport(combItemName.Text, dateTimeFrom.Value);
         AllSalesReport.InsertReport(combItemName.Text, dateTimeFrom.Value);
         MessageBox.Show("Report completed Successfully", "Sales Report", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, "Report Error", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
Beispiel #3
0
 private void txtItemSearch_TextChanged(object sender, EventArgs e)
 {
     try
     {
         if (!string.IsNullOrEmpty(txtItemSearch.Text))
         {
             AllSalesReport.DisplayReport(dataGridDailyReport, txtItemSearch.Text);
         }
         else
         {
             AllSalesReport.DisplayReport(dataGridDailyReport, "");
         }
         lblTotal.Text = string.Format("{0:00.#0}", AllSalesReport.Total);
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, "Search Error", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
Beispiel #4
0
 private void btnReportSales_Click(object sender, EventArgs e)
 {
     try
     {
         if (!string.IsNullOrEmpty(combItemName.Text))
         {
             AllSalesReport.CheckItemReport(combItemName.Text, DateTime.Today);
             AllSalesReport.InsertReport(combItemName.Text, DateTime.Today);
             MessageBox.Show("Report completed Successfully", "Sales Report", MessageBoxButtons.OK, MessageBoxIcon.Information);
         }
         else
         {
             throw new Exception("No Item is selected for report");
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, "Report Error", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
Beispiel #5
0
 private void btnDelete_Click(object sender, EventArgs e)
 {
     try
     {
         if (dateSelected == true)
         {
             if (MessageBox.Show("Do you want to delete record(s) for the selected Date ?", "Multiple Delete", MessageBoxButtons.YesNo, MessageBoxIcon.Information) == DialogResult.Yes)
             {
                 AllSalesReport.DeleteReport(dateTimeFrom);
                 dataAccess.Description = "Deleted Report record(s) for " + dateTimeFrom.Value.ToString("MM/dd/yyyy");
                 dataAccess.Activities();
                 MessageBox.Show("Delete Successful", "Delete Completed", MessageBoxButtons.OK, MessageBoxIcon.Information);
                 AllSalesReport.DisplayReport(dataGridDailyReport);
             }
         }
         else if (ReportID == 0)
         {
             throw new Exception("No record is selected, Selete a record to Delete");
         }
         else
         {
             if (MessageBox.Show("Do you want to delete Selected record ?", "Confirm Delete", MessageBoxButtons.YesNo, MessageBoxIcon.Information) == DialogResult.Yes)
             {
                 AllSalesReport.DeleteReport(ReportID);
                 dataAccess.Description = "Deleted a Report record ";
                 dataAccess.Activities();
                 MessageBox.Show("Delete Successful", "Delete Completed", MessageBoxButtons.OK, MessageBoxIcon.Information);
                 AllSalesReport.DisplayReport(dataGridDailyReport);
             }
         }
     }
     catch (Exception ex)
     {
         throw new  ExceptionHandling("Delete Error", ex);
     }
 }
Beispiel #6
0
 private void dateTimeTo_ValueChanged(object sender, EventArgs e)
 {
     dateSelected = false;
     AllSalesReport.AllReportBetweenDate(dataGridDailyReport, dateTimeFrom, dateTimeTo);
 }
Beispiel #7
0
 public Daily_Sales_Report()
 {
     InitializeComponent();
     AllSalesReport.DisplayReport(dataGridDailyReport);
     ItemSales.ItemNames(combItemName);
 }
Beispiel #8
0
 private void btnRefresh_Click(object sender, EventArgs e)
 {
     dateSelected = false;
     AllSalesReport.DisplayReport(dataGridDailyReport);
 }