private void BaoCaoThang_Load(object sender, EventArgs e) { Phong phong = new Phong(); SqlCommand command = new SqlCommand("Select * from BaoCaoLuong "); dataGridView1.ReadOnly = true; dataGridView1.DataSource = phong.getshowkh(command); dataGridView1.AllowUserToAddRows = false; }
private void QuanLyPhong_Load(object sender, EventArgs e) { Phong phong = new Phong(); SqlCommand command = new SqlCommand("Select TenPhong,TrangThai,MKPhong from TTPhong "); dataGridView1.ReadOnly = true; dataGridView1.DataSource = phong.getshowkh(command); dataGridView1.AllowUserToAddRows = false; }
private void BaoCao_Load(object sender, EventArgs e) { Phong phong = new Phong(); SqlCommand command = new SqlCommand("Select Id,HoTen,GioBD,GioKT,ChucVu,CaLamViec from BaoCaoNgay"); dataGridView1.ReadOnly = true; dataGridView1.DataSource = phong.getshowkh(command); dataGridView1.AllowUserToAddRows = false; }
private void button1_Click(object sender, EventArgs e) { Phong phong = new Phong(); LuongNV nv = new LuongNV(); SqlCommand command = new SqlCommand("Select HoTen,ChucVu,sum(Luong) as Luong from BaoCaoLuong where convert(char(7), GioKT,21)='2019-" + textBox1.Text + "' group by HoTen,ChucVu"); nv.dataGridViewLuong.ReadOnly = true; nv.dataGridViewLuong.DataSource = phong.getshowkh(command); nv.dataGridViewLuong.AllowUserToAddRows = false; this.Close(); nv.Show(); }
private void buttonHD_Click(object sender, EventArgs e) { Phong phong = new Phong(); string MAKhach = Global.GlobalUserId2; phong.deleteKH(MAKhach); string Path = "C:\\Users\\DELL\\Downloads\\ToPrinter " + MAKhach + ".txt"; TextWriter w = new StreamWriter(Path); w.WriteLine("\t\t\t\t Hóa Đơn Khách Hàng"); w.WriteLine(""); w.WriteLine("\t\t\t Tên Khách Hàng " + TextBoxNameKHHD.Text); w.WriteLine("\t\t\t Phòng Đã Thuê: " + TextBoxTPHD.Text); if (radioButtonFemaleHD.Checked == true) { w.WriteLine("\t\t\t Giới Tính: Nữ "); } else { w.WriteLine("\t\t\t Giới Tính: Nam "); } w.WriteLine("\t\t\t Địa Chỉ Đã Đăng Kí: " + TextBoxDCHD.Text); w.WriteLine("\t\t\t Ngày Nhận Phòng: " + DatetimeNPHD.Value); w.WriteLine("\t\t\t Ngày Kết Thúc : " + DatetimeTPHD.Value); w.WriteLine("\t\t\t Số Điện Thoại Khách Hàng:" + TextBoxPhoneHD.Text); w.WriteLine(""); w.WriteLine("====================================================================================="); w.WriteLine(""); w.WriteLine("\t\t\t\t Dịch Vụ Đã Sử Dụng"); w.WriteLine("\t\t\t " + labelcoca.Text); w.WriteLine("\t\t\t " + labelTB.Text); w.WriteLine("\t\t\t " + labels.Text); w.WriteLine("\t\t\t " + labelVK.Text); w.WriteLine("\t\t\t " + labelN.Text); w.WriteLine("\t\t\t " + labelngay.Text); w.WriteLine("\t\t\t " + labelgio.Text); w.WriteLine("\t\t\t " + labeltien.Text); w.WriteLine(""); w.WriteLine("\t\t Cảm Ơn Quí Khách Đã Sử Dụng Khách Sạn Chúng Tôi."); w.WriteLine("\t\t Hẹn Gặp Lại Quý Khách Trong Thời Gian Sớm Nhất"); w.Flush(); MessageBox.Show("In Thành Công", "Hóa Đơn", MessageBoxButtons.OK, MessageBoxIcon.Information); this.Close(); TrPhong st = new TrPhong(); st.Show(); }
private void TrPhong_Load(object sender, EventArgs e) { Phong phong = new Phong(); SqlCommand command = new SqlCommand("Select * from TTKH "); dataGridViewKH.ReadOnly = true; dataGridViewKH.DataSource = phong.getshowkh(command); dataGridViewKH.AllowUserToAddRows = false; comboBox1.DataSource = phong.getAllTraPhong();; comboBox1.DisplayMember = "MaKH"; comboBox1.ValueMember = "MaKH"; comboBox1.SelectedItem = null; }
private void NhanVienLeTan_Load(object sender, EventArgs e) { Phong phong = new Phong(); string cv = "LeTan "; SqlCommand command = new SqlCommand("SELECT * FROM TTNV as a,Login as b where b.ChucVu like '" + cv + "%' and a.IdNhanVien = b.Id "); dataGridViewManagerStudent.ReadOnly = true; dataGridViewManagerStudent.DataSource = phong.getshowkh(command); dataGridViewManagerStudent.AllowUserToAddRows = false; ComboBoxCaDK.DataSource = NhanVien.getAllCalam(); ComboBoxCaDK.DisplayMember = "CaLamViec"; ComboBoxCaDK.ValueMember = "CaLamViec"; ComboBoxCaDK.SelectedItem = null; }
private void ThongTinPhong_Load(object sender, EventArgs e) { Phong phong = new Phong(); SqlCommand command = new SqlCommand("Select * from ChiTietPhong "); dataGridView1.ReadOnly = true; dataGridView1.DataSource = phong.getshowkh(command); dataGridView1.AllowUserToAddRows = false; comboBoxRoomName.DataSource = phong.getDatPhong(); comboBoxRoomName.DisplayMember = "TenPhong"; comboBoxRoomName.ValueMember = "MaPhong"; comboBoxRoomName.SelectedItem = null; }