public bool ThemDichVu(DichVu dichVu)
        {
            SimpleQuanLyKhachSanEntities QLKSEntities = new SimpleQuanLyKhachSanEntities();

            QLKSEntities.DichVus.Add(dichVu);
            QLKSEntities.SaveChanges();
            return(true);
        }
Example #2
0
        public bool ThemNhanVien(NhanVien nhanVien)
        {
            SimpleQuanLyKhachSanEntities QLKSEntities = new SimpleQuanLyKhachSanEntities();

            QLKSEntities.NhanViens.Add(nhanVien);
            QLKSEntities.SaveChanges();
            return(true);
        }
        public bool ThemChucDanh(ChucDanh chucDanh)
        {
            SimpleQuanLyKhachSanEntities QLKSEntities = new SimpleQuanLyKhachSanEntities();

            QLKSEntities.ChucDanhs.Add(chucDanh);
            QLKSEntities.SaveChanges();
            return(true);
        }
Example #4
0
        public bool ThemKhachHang(KhachHang khachHang)
        {
            SimpleQuanLyKhachSanEntities QLKSEntities = new SimpleQuanLyKhachSanEntities();

            QLKSEntities.KhachHangs.Add(khachHang);
            QLKSEntities.SaveChanges();
            return(true);
        }
        public bool XoaDichVu(DichVu dichVu)
        {
            SimpleQuanLyKhachSanEntities QLKSEntities = new SimpleQuanLyKhachSanEntities();

            QLKSEntities.DichVus.Attach(dichVu);
            QLKSEntities.DichVus.Remove(dichVu);
            QLKSEntities.SaveChanges();
            return(true);
        }
        public bool XoaChucDanh(ChucDanh chucDanh)
        {
            SimpleQuanLyKhachSanEntities QLKSEntities = new SimpleQuanLyKhachSanEntities();

            QLKSEntities.ChucDanhs.Attach(chucDanh);
            QLKSEntities.ChucDanhs.Remove(chucDanh);
            QLKSEntities.SaveChanges();
            return(true);
        }
Example #7
0
        public int IdChucDanh(string chucDanh)
        {
            SimpleQuanLyKhachSanEntities QLKSEntities = new SimpleQuanLyKhachSanEntities();
            var query = (from p in QLKSEntities.ChucDanhs
                         where p.Ten == chucDanh
                         select p).SingleOrDefault();

            return(query.ID);
        }
Example #8
0
        public bool XoaNhanVien(NhanVien nhanVien)
        {
            SimpleQuanLyKhachSanEntities QLKSEntities = new SimpleQuanLyKhachSanEntities();

            QLKSEntities.NhanViens.Attach(nhanVien);
            QLKSEntities.NhanViens.Remove(nhanVien);
            QLKSEntities.SaveChanges();
            return(true);
        }
Example #9
0
        public bool XoaKhachHang(KhachHang khachHang)
        {
            SimpleQuanLyKhachSanEntities QLKSEntities = new SimpleQuanLyKhachSanEntities();

            QLKSEntities.KhachHangs.Attach(khachHang);
            QLKSEntities.KhachHangs.Remove(khachHang);
            QLKSEntities.SaveChanges();
            return(true);
        }
        public bool SuaChucDanh(ChucDanh chucDanh)
        {
            SimpleQuanLyKhachSanEntities QLKSEntities = new SimpleQuanLyKhachSanEntities();
            var Query = (from p in QLKSEntities.ChucDanhs
                         where p.ID == chucDanh.ID
                         select p).SingleOrDefault();

            if (Query != null)
            {
                Query.Ten = chucDanh.Ten;
                QLKSEntities.SaveChanges();
            }
            return(true);
        }
        public bool SuaDichVu(DichVu dichVu)
        {
            SimpleQuanLyKhachSanEntities QLKSEntities = new SimpleQuanLyKhachSanEntities();
            var Query = (from p in QLKSEntities.DichVus
                         where p.ID == dichVu.ID
                         select p).SingleOrDefault();

            if (Query != null)
            {
                Query.Ten = dichVu.Ten;
                Query.Gia = dichVu.Gia;
                QLKSEntities.SaveChanges();
            }
            return(true);
        }
        public DataTable DSChucDanh()
        {
            SimpleQuanLyKhachSanEntities QLKSEntities = new SimpleQuanLyKhachSanEntities();
            var dstp = from p in QLKSEntities.ChucDanhs
                       select p;
            DataTable dtb = new DataTable();

            dtb.Columns.Add("ID");
            dtb.Columns.Add("Ten");
            foreach (var p in dstp)
            {
                dtb.Rows.Add(p.ID, p.Ten);
            }
            return(dtb);
        }
Example #13
0
        public bool SuaKhachHang(KhachHang khachHang)
        {
            SimpleQuanLyKhachSanEntities QLKSEntities = new SimpleQuanLyKhachSanEntities();
            var Query = (from p in QLKSEntities.KhachHangs
                         where p.ID == khachHang.ID
                         select p).SingleOrDefault();

            if (Query != null)
            {
                Query.Ten      = khachHang.Ten;
                Query.NgaySinh = khachHang.NgaySinh;
                Query.GioiTinh = khachHang.GioiTinh;
                Query.QuocTich = khachHang.QuocTich;
                Query.SDT      = khachHang.SDT;
                Query.CMND     = khachHang.CMND;
                Query.Email    = khachHang.Email;
                QLKSEntities.SaveChanges();
            }
            return(true);
        }
Example #14
0
        public bool SuaNhanVien(NhanVien nhanVien)
        {
            SimpleQuanLyKhachSanEntities QLKSEntities = new SimpleQuanLyKhachSanEntities();
            var Query = (from p in QLKSEntities.NhanViens
                         where p.ID == nhanVien.ID
                         select p).SingleOrDefault();

            if (Query != null)
            {
                Query.Ten        = nhanVien.Ten;
                Query.IDChucDanh = nhanVien.IDChucDanh;
                Query.NgaySinh   = nhanVien.NgaySinh;
                Query.GioiTinh   = nhanVien.GioiTinh;
                Query.DiaChi     = nhanVien.DiaChi;
                Query.SDT        = nhanVien.SDT;
                Query.CMND       = nhanVien.CMND;
                Query.Email      = nhanVien.Email;
                QLKSEntities.SaveChanges();
            }
            return(true);
        }
Example #15
0
        public DataTable DSKhachHang()
        {
            SimpleQuanLyKhachSanEntities QLKSEntities = new SimpleQuanLyKhachSanEntities();
            var dstp = from p in QLKSEntities.KhachHangs
                       select p;
            DataTable dtb = new DataTable();

            dtb.Columns.Add("ID");
            dtb.Columns.Add("Ten");
            dtb.Columns.Add("NgaySinh");
            dtb.Columns.Add("GioiTinh");
            dtb.Columns.Add("QuocTich");
            dtb.Columns.Add("SDT");
            dtb.Columns.Add("CMND");
            dtb.Columns.Add("Email");

            foreach (var p in dstp)
            {
                dtb.Rows.Add(p.ID, p.Ten, p.NgaySinh, p.GioiTinh, p.QuocTich, p.SDT, p.CMND, p.Email);
            }
            return(dtb);
        }
Example #16
0
        public DataTable DSNhanVien()
        {
            SimpleQuanLyKhachSanEntities QLKSEntities = new SimpleQuanLyKhachSanEntities();
            var dstp = from p in QLKSEntities.NhanViens
                       select p;
            DataTable dtb = new DataTable();

            dtb.Columns.Add("ID");
            dtb.Columns.Add("Ten");
            dtb.Columns.Add("ChucDanh");
            dtb.Columns.Add("NgaySinh");
            dtb.Columns.Add("GioiTinh");
            dtb.Columns.Add("DiaChi");
            dtb.Columns.Add("SDT");
            dtb.Columns.Add("CMND");
            dtb.Columns.Add("Email");

            foreach (var p in dstp)
            {
                dtb.Rows.Add(p.ID, p.Ten, p.ChucDanh.Ten, p.NgaySinh, p.GioiTinh, p.DiaChi, p.SDT, p.CMND, p.Email);
            }
            return(dtb);
        }