示例#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);
        }