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