private void BtDelete_Click(object sender, EventArgs e) { try { SaleRecordModel inputData = new SaleRecordModel(); inputData.Id = id.ToString(); inputData.StaffName = ""; inputData.Time = ""; inputData.Date = ""; inputData.TotalPrice = 0; SaleReportController controller = new SaleReportController(); bool delete = controller.DeleteValue(inputData); if (delete == true) { SaleReport report = new SaleReport(); report.Show(); this.Owner.Hide(); MessageBox.Show("Delete successfully"); Close(); } else { MessageBox.Show("Unsuccessfully delete"); } }catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void PictureBox2_Click(object sender, EventArgs e) { SaleReport salesReport = new SaleReport(); salesReport.Show(); this.Hide(); }
private void Btsave_Click(object sender, EventArgs e) { SaleRecordModel inputData = new SaleRecordModel(); inputData.Id = id.ToString(); inputData.StaffName = txtStaffName.Text; inputData.Time = txtTime.Text; inputData.Date = txtDate.Text; inputData.TotalPrice = Convert.ToInt32(txtTotalPrice.Text); SaleReportController controller = new SaleReportController(); bool update = controller.UpdateData(inputData); if (update == true) { SaleReport report = new SaleReport(); report.Show(); this.Owner.Hide(); MessageBox.Show("Update successfully"); //saleReport.Show(); Close(); } else { MessageBox.Show("Unsuccessfully update"); } }
private void Button1_Click_2(object sender, EventArgs e) { SaleReport report = new SaleReport(); report.Show(); }