コード例 #1
0
        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);
            }
        }
コード例 #2
0
ファイル: Main.cs プロジェクト: TheVinhLee/DP2_07_06
        private void PictureBox2_Click(object sender, EventArgs e)
        {
            SaleReport salesReport = new SaleReport();

            salesReport.Show();
            this.Hide();
        }
コード例 #3
0
        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");
            }
        }
コード例 #4
0
        private void Button1_Click_2(object sender, EventArgs e)
        {
            SaleReport report = new SaleReport();

            report.Show();
        }