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

            result = context.LICH_KHOI_HANH.FirstOrDefault(m => m.MA_LICH == pMaLKH);
            return(result);
        }
Пример #2
0
        public int Add(LICH_KHOI_HANH pLKH)
        {
            int result = 0;

            context.LICH_KHOI_HANH.Add(pLKH);
            result = context.SaveChanges();
            return(result);
        }
Пример #3
0
        public int Delete(int pMaLKH)
        {
            int            result = 0;
            LICH_KHOI_HANH k      = context.LICH_KHOI_HANH.FirstOrDefault(m => m.MA_LICH == pMaLKH);

            context.LICH_KHOI_HANH.Remove(k);
            result = context.SaveChanges();
            return(result);
        }
Пример #4
0
        public int Update(LICH_KHOI_HANH pLKH)
        {
            int            result = 0;
            LICH_KHOI_HANH k      = context.LICH_KHOI_HANH.FirstOrDefault(m => m.MA_LICH == pLKH.MA_LICH);

            if (k != null)
            {
                k.TEN_LICH       = pLKH.TEN_LICH;
                k.MA_TOUR        = pLKH.MA_TOUR;
                k.NGAY_KHOI_HANH = pLKH.NGAY_KHOI_HANH;
            }
            result = context.SaveChanges();
            return(result);
        }