private void bntDatPhong_Click(object sender, EventArgs e) { if (gridKhachHang.Rows.Count != 0) { DatPhong datPhong = new DatPhong(); DatPhong.maKH = Convert.ToInt32(gridKhachHang.CurrentRow.Cells[0].Value.ToString()); datPhong.ShowDialog(); Load(); } }
private void CustomePhong_EventDatPhong(object sender, ProcessEventArgs e) { // call dăt phòng DatPhong datPhong = new DatPhong(); DatPhong.maP = e.PHONG.Ma; DatPhong.isSodoKScall = true; datPhong.ShowDialog(); if (DatPhong.result) { LoadPhong(); } }
private void gridviewPhong_CellClick(object sender, DataGridViewCellEventArgs e) { if (KTTG()) { string str = gridviewPhong.CurrentCell.Value.ToString(); string str2 = ""; foreach (DataRow r in dt1.Rows) { int maP = Convert.ToInt32(r["Ma"]); if (maP % 5 == 0) { str2 = maP / 5 + "0" + 5; } else { str2 = maP / 5 + 1 + "0" + maP % 5; } if (str.CompareTo(str2) == 0) { //KhachHangDangO kh = new KhachHangDangO(); DateTime s = dtpkNgayBD.Value.Date; TimeSpan ts = dtpkGioDB.Value.TimeOfDay; s = s.Date + ts; DateTime f = dtpkNgayKT.Value.Date; TimeSpan tf = dtpkGioKT.Value.TimeOfDay; f = f.Date + tf; if (isSoDoKSCall == true) { isSoDoKSCall = false; DatPhong datPhong = new DatPhong(); DatPhong.maP = maP; DatPhong._thoiGianNhan = s; DatPhong._thoiGianTra = f; datPhong.ShowDialog(); } else { MyParent.HienthithongTinDatPhong(maP, s, f); } this.Close(); } } gridviewPhong.CurrentCell = null; } }