Exemplo n.º 1
0
        private void button2_Click(object sender, EventArgs e)
        {
            this.Close();
            TrangChu op = new TrangChu();

            if (dsDv == "")
            {
                op.Show();
            }
            else
            {
                op.onSubmit(dsDv, tongChiPhi, idPhong);
                op.Show();
            }
        }
Exemplo n.º 2
0
        private void button1_Click(object sender, EventArgs e)
        {
            foreach (DataGridViewRow row in dataGridView1.Rows)
            {
                if ((bool)row.Cells["Chọn"].Value)
                {
                    dsDv += "," + row.Cells["ID Dịch Vụ"].Value.ToString();
                }
                //More code here
            }

            PhongBUS           phongBus = new PhongBUS();
            PhongDangSuDungDTO p        = phongBus.LayThongTinPhongDangSuDung(idPhong);

            int s;

            if (p.GiaDichVu == "")
            {
                s = 0;
            }
            else
            {
                s = Int32.Parse(p.GiaDichVu);
            }
            p.GiaDichVu = (s + tongChiPhi).ToString();

            p.DsDichVu += dsDv;
            // string str = p.ThoiGianBatDau.ToString("mm/dd/yyyy");
            phongBus.CapNhatThongTinPhongDangSuDung(p);
            // Observer Pattern
            TrangChu op = new TrangChu();

            op.onSubmit(dsDv, tongChiPhi, idPhong);
            this.Close();
            op.Show();
            //
        }