Пример #1
0
        public KHACH_SAN GetDVByMa(int pMaKS)
        {
            KHACH_SAN result = new KHACH_SAN();

            result = context.KHACH_SAN.FirstOrDefault(m => m.MA_KHACH_SAN == pMaKS);
            return(result);
        }
Пример #2
0
        public int AddNewKhachSan(KHACH_SAN pKS)
        {
            int result = 0;

            context.KHACH_SAN.Add(pKS);
            result = context.SaveChanges();
            return(result);
        }
Пример #3
0
        public int DeleteKS(int pMaKS)
        {
            int       result = 0;
            KHACH_SAN k      = context.KHACH_SAN.FirstOrDefault(m => m.MA_KHACH_SAN == pMaKS);

            context.KHACH_SAN.Remove(k);
            result = context.SaveChanges();
            return(result);
        }
Пример #4
0
        public int UpdateKS(KHACH_SAN pKS)
        {
            int       result = 0;
            KHACH_SAN k      = context.KHACH_SAN.FirstOrDefault(m => m.MA_KHACH_SAN == pKS.MA_KHACH_SAN);

            if (k != null)
            {
                k.TEN_KHACH_SAN = pKS.TEN_KHACH_SAN;
                k.MA_TINH       = pKS.MA_TINH;
                result          = context.SaveChanges();
                return(result);
            }
            return(result);
        }