Exemplo n.º 1
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);
     }
 }
Exemplo n.º 2
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);
     }
 }
Exemplo n.º 3
0
 public Daily_Sales_Report()
 {
     InitializeComponent();
     AllSalesReport.DisplayReport(dataGridDailyReport);
     ItemSales.ItemNames(combItemName);
 }
Exemplo n.º 4
0
 private void btnRefresh_Click(object sender, EventArgs e)
 {
     dateSelected = false;
     AllSalesReport.DisplayReport(dataGridDailyReport);
 }