コード例 #1
0
ファイル: RoomController.cs プロジェクト: truongnhatdat/qlks
        public void DeleteRoom2(int numberroom)
        {
            QLKhachsanEntities entity = new QLKhachsanEntities();

            entity.Phongs.Remove(entity.Phongs.FirstOrDefault(e => e.Sophong == numberroom));
            entity.SaveChanges();
        }
コード例 #2
0
        public void PostEmployee(Nhanvien employee)
        {
            QLKhachsanEntities entity = new QLKhachsanEntities();

            entity.Nhanviens.Add(employee);
            entity.SaveChanges();
        }
コード例 #3
0
ファイル: RoomController.cs プロジェクト: truongnhatdat/qlks
        public void PostRoom2(Phong room)
        {
            QLKhachsanEntities entity = new QLKhachsanEntities();

            entity.Phongs.Add(room);
            entity.SaveChanges();
        }
コード例 #4
0
 public void DeleteBill(long iddat)
 {
     using (QLKhachsanEntities entity = new QLKhachsanEntities())
     {
         entity.Datphongs.Remove(entity.Datphongs.FirstOrDefault(e => e.IDDAT.Equals(iddat)));
         entity.SaveChanges();
     }
 }
コード例 #5
0
 public void DeleteCustomer(string CMT)
 {
     using (QLKhachsanEntities entity = new QLKhachsanEntities())
     {
         entity.Khachhangs.Remove(entity.Khachhangs.FirstOrDefault(e => e.CMT.Equals(CMT)));
         entity.SaveChanges();
     }
 }
コード例 #6
0
 public void Taotk(TaiKhoan dangnhap)
 {
     using (QLKhachsanEntities entity = new QLKhachsanEntities())
     {
         entity.TaiKhoans.Add(dangnhap);
         entity.SaveChanges();
     }
 }
コード例 #7
0
 public void DeleteCTHDP(long sophong, long iddat)
 {
     using (QLKhachsanEntities entity = new QLKhachsanEntities())
     {
         entity.Chitietdatphongs.Remove(entity.Chitietdatphongs.FirstOrDefault(e => e.IDDAT.Equals(iddat) && e.Sophong.Equals(sophong)));
         entity.SaveChanges();
     }
 }
コード例 #8
0
 public void PostTypeRoom(Loaiphong loai)
 {
     using (QLKhachsanEntities entity = new QLKhachsanEntities())
     {
         entity.Loaiphongs.Add(loai);
         entity.SaveChanges();
     }
 }
コード例 #9
0
 public void DeleteService(long iddv)
 {
     using (QLKhachsanEntities entity = new QLKhachsanEntities())
     {
         entity.Dichvus.Remove(entity.Dichvus.FirstOrDefault(e => e.IDDV == iddv));
         entity.SaveChanges();
     }
 }
コード例 #10
0
 public void PostCTHDDV(Chitietdatdichvu cthddv)
 {
     using (QLKhachsanEntities entity = new QLKhachsanEntities())
     {
         entity.Chitietdatdichvus.Add(cthddv);
         entity.SaveChanges();
     }
 }
コード例 #11
0
 public void PostCustomer(Khachhang customer)
 {
     using (QLKhachsanEntities entity = new QLKhachsanEntities())
     {
         entity.Khachhangs.Add(customer);
         entity.SaveChanges();
     }
 }
コード例 #12
0
 public void PostCTHDP(Chitietdatphong ctdp)
 {
     using (QLKhachsanEntities entity = new QLKhachsanEntities())
     {
         entity.Chitietdatphongs.Add(ctdp);
         entity.SaveChanges();
     }
 }
コード例 #13
0
 public void DeleteCTHDDV(long iddv, long idhd)
 {
     using (QLKhachsanEntities entity = new QLKhachsanEntities())
     {
         entity.Chitietdatdichvus.Remove(entity.Chitietdatdichvus.FirstOrDefault(e => e.IDDAT.Equals(idhd) && e.IDDV == iddv));
         entity.SaveChanges();
     }
 }
コード例 #14
0
 public void DeleteEmployees(string manv)
 {
     using (QLKhachsanEntities entity = new QLKhachsanEntities())
     {
         entity.Nhanviens.Remove(entity.Nhanviens.FirstOrDefault(e => e.MaNV == manv));
         entity.SaveChanges();
     }
 }
コード例 #15
0
 public void DeleteTypeRoom(string loai)
 {
     using (QLKhachsanEntities entity = new QLKhachsanEntities())
     {
         entity.Loaiphongs.Remove(entity.Loaiphongs.FirstOrDefault(e => e.Loaiphong1.Equals(loai)));
         entity.SaveChanges();
     }
 }
コード例 #16
0
 public void deletetk(string manv)
 {
     using (QLKhachsanEntities entity = new QLKhachsanEntities())
     {
         var tk = entity.TaiKhoans.FirstOrDefault(e => e.MaNV.Equals(manv));
         entity.TaiKhoans.Remove(tk);
         entity.SaveChanges();
     }
 }
コード例 #17
0
 public void updateroom1(long sophong, Phong room)
 {
     using (QLKhachsanEntities entity = new QLKhachsanEntities())
     {
         var em = entity.Phongs.FirstOrDefault(e => e.Sophong.Equals(sophong));
         em.Tinhtrang = room.Tinhtrang;
         entity.SaveChanges();
     }
 }
コード例 #18
0
 public void Thaydoi(string manv, TaiKhoan login)
 {
     using (QLKhachsanEntities entity = new QLKhachsanEntities())
     {
         var tk = entity.TaiKhoans.FirstOrDefault(e => e.MaNV.Equals(manv));
         tk.Matkhau = login.Matkhau;
         entity.SaveChanges();
     }
 }
コード例 #19
0
 public void PutCTHDDV(long idhd, long iddv, Chitietdatdichvu cthddv)
 {
     using (QLKhachsanEntities entity = new QLKhachsanEntities())
     {
         var em = entity.Chitietdatdichvus.FirstOrDefault(e => e.IDDAT.Equals(idhd) && e.IDDV == iddv);
         em.IDDAT   = cthddv.IDDAT;
         em.IDDV    = cthddv.IDDV;
         em.Soluong = cthddv.Soluong;
         entity.SaveChanges();
     }
 }
コード例 #20
0
        public void PutCTHDP(long sophong, long iddat, Chitietdatphong ctdp)
        {
            using (QLKhachsanEntities entity = new QLKhachsanEntities())
            {
                var cth = entity.Chitietdatphongs.FirstOrDefault(e => e.Sophong.Equals(sophong) && e.IDDAT.Equals(iddat));

                // cth.Sophong = cthdp.Sophong;
                // cth.IDHD = cthdp.IDHD;
                cth.Ngayden = ctdp.Ngayden;
                cth.Ngaydi  = ctdp.Ngaydi;
                entity.SaveChanges();
            }
        }
コード例 #21
0
 public void PutService(long iddv, Dichvu service)
 {
     using (QLKhachsanEntities entity = new QLKhachsanEntities())
     {
         var en = entity.Dichvus.FirstOrDefault(e => e.IDDV == iddv);
         en.TenDV = service.TenDV;
         en.GiaDV = service.GiaDV;
         en.DVT   = service.DVT;
         en.Hinh  = service.Hinh;
         en.Mota  = service.Mota;
         entity.SaveChanges();
     }
 }
コード例 #22
0
ファイル: RoomController.cs プロジェクト: truongnhatdat/qlks
        public void PutRoom2(int numberroom, Phong room)
        {
            QLKhachsanEntities entity = new QLKhachsanEntities();
            var en = entity.Phongs.FirstOrDefault(e => e.Sophong == numberroom);

            en.Sophong   = room.Sophong;
            en.Tinhtrang = room.Tinhtrang;

            en.Loaiphong = room.Loaiphong;
            en.Ghichu    = room.Ghichu;

            entity.SaveChanges();
        }
コード例 #23
0
        public void PutTypeRoom(string loai, Loaiphong loaiphong)
        {
            using (QLKhachsanEntities entity = new QLKhachsanEntities())
            {
                var room = entity.Loaiphongs.FirstOrDefault(e => e.Loaiphong1.Equals(loai));
                //room.Loaiphong1 = loaiphong.Loaiphong1;
                room.Gia     = loaiphong.Gia;
                room.Mota    = loaiphong.Mota;
                room.Hinhanh = loaiphong.Hinhanh;

                entity.SaveChanges();
            }
        }
コード例 #24
0
        public void PutBill(long iddat, Datphong bill)
        {
            using (QLKhachsanEntities entity = new QLKhachsanEntities())
            {
                var bi = entity.Datphongs.FirstOrDefault(e => e.IDDAT.Equals(iddat));
                bi.IDDAT   = bill.IDDAT;
                bi.Ngaydat = bill.Ngaydat;
                bi.MaNV    = bill.MaNV;
                bi.CMT     = bill.CMT;
                bi.Ghichu  = bill.Ghichu;

                entity.SaveChanges();
            }
        }
コード例 #25
0
        public void PutCustomer(string CMT, Khachhang customer)
        {
            using (QLKhachsanEntities entity = new QLKhachsanEntities())
            {
                var cus = entity.Khachhangs.FirstOrDefault(e => e.CMT.Equals(CMT));
                cus.CMT = customer.CMT;

                cus.Hoten    = customer.Hoten;
                cus.Ngaysinh = customer.Ngaysinh;
                cus.Gioitinh = customer.Gioitinh;
                cus.Diachi   = customer.Diachi;
                cus.SDT      = customer.SDT;
                entity.SaveChanges();
            }
        }
コード例 #26
0
        public void PutEmployees(string manv, Nhanvien employee)
        {
            using (QLKhachsanEntities entity = new QLKhachsanEntities())
            {
                var en = entity.Nhanviens.FirstOrDefault(e => e.MaNV == manv);
                en.MaNV = employee.MaNV;

                en.Hoten    = employee.Hoten;
                en.Gioitinh = employee.Gioitinh;
                en.SDT      = employee.SDT;
                en.Hinh     = employee.Hinh;
                en.Ghichu   = employee.Ghichu;

                entity.SaveChanges();
            }
        }