void LoadThongTin() { clsCustomer CUS = new clsCustomer(); Customer cus = CUS.checkIfExist(_idCustomer); lblTen.Text = cus.name; lblCMND.Text = cus.id_Customer; lblSoDT.Text = cus.phone; lblDiaChi.Text = cus.address; clsRoom ROOM = new clsRoom(); var room = ROOM.LayThongTinPhong(_idRoom); lblTenPhong.Text = room.RoomNumber; clsStyleRoom SROOM = new clsStyleRoom(); var SRoom = SROOM.GetRoomStyle(room.id_RoomStyle); lblLoaiPhong.Text = SRoom.NameStyle; double giaPhong = (double)SRoom.Price; lblDonGia.Text = giaPhong.ToString(); // So dem clsBookRoom BROOM = new clsBookRoom(); var BRoom = BROOM.GetThongTinBookRoom(_idRoom); lblNgayDen.Text = BRoom.Checkin_Date.ToString(); var soDem = (BRoom.Checkout_Date - BRoom.Checkin_Date).TotalDays; lblSoDem.Text = soDem.ToString(); double tienPhong = soDem * giaPhong; lblTienPhong.Text = string.Format("{0:0,0 vnđ}", tienPhong); double tienDV = TinhTienDichVu(); lblDichVu.Text = string.Format("{0:0,0 vnđ}", tienDV); double tongTien = tienDV + tienPhong; lblTongTien.Text = string.Format("{0:0,0 vnđ}", tongTien); }
private void btnCapNhat_Click(object sender, EventArgs e) { Room roomUp = ROOM.LayThongTinPhong(_idRoom); roomUp.Note = txtGhiChu.Text; var checkRoom = ROOM.CapNhatTinhTrangPhong(_idRoom, roomUp); BookRoom bRoomUp = BOOKR.GetThongTinBookRoom(_idRoom); bRoomUp.dateBooking = dTimeNgayDat.Value; bRoomUp.Checkin_Date = dTimeNgayNhan.Value; bRoomUp.Checkout_Date = dTimeNgayTra.Value; var checkBRoom = BOOKR.SuaThongTinBookRoomCuaKH(bRoomUp, _idCustomer); var sl = Convert.ToInt32(numUpDown.Value); string idService = listDSDichVu.SelectedValue.ToString(); bool checkBS = false; if (BILLS.checkIfExist(idService, _idBRoom) == null) { Bill_Service bs = new Bill_Service(); bs.id_BookRoom = _idBRoom; bs.id_Service = idService; bs.Service_Count = (int)numUpDown.Value; BILLS.insertBillService(bs); checkBS = true; } else { checkBS = BILLS.CapNhatSoLuong(_idBRoom, idService, sl); checkBS = true; } if (checkBRoom && checkRoom && checkBS) { MessageBox.Show("Cập nhật thành công", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { MessageBox.Show("Cập nhật không thành công", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
private void btnNhanPhong_Click(object sender, EventArgs e) { clsRoom Room = new clsRoom(); Room roomUp = Room.LayThongTinPhong(_idRoom); roomUp.Note = txtGhiChu.Text; Room.CapNhatTinhTrangPhong(_idRoom, roomUp); DuaDataRoomVaoTextBox(Room.LayThongTinPhong(_idRoom)); clsBookRoom BookRoom = new clsBookRoom(); BookRoom bRoomUp = BookRoom.GetThongTinBookRoom(_idRoom); bRoomUp.dateBooking = dTimeNgayDat.Value; bRoomUp.Checkin_Date = dTimeNgayNhan.Value; BookRoom.SuaThongTinBookRoomCuaKH(bRoomUp, _idCustomer); clsHonLoan honLoan = new clsHonLoan(); var dsNP = honLoan.GetDSNhanPhong(); DuaDataVaoLvwDSNhanPhong(lvwDSNhanPhong, dsNP); }