Exemple #1
0
        public PHAN_QUYEN GetDVByMa(int pMaNhom, int pMaMH)
        {
            PHAN_QUYEN result = new PHAN_QUYEN();

            result = context.PHAN_QUYEN.FirstOrDefault(m => m.MA_NHOM == pMaNhom && m.MA_MH == pMaMH);
            return(result);
        }
Exemple #2
0
        public int Add(PHAN_QUYEN pT)
        {
            int result = 0;

            context.PHAN_QUYEN.Add(pT);
            result = context.SaveChanges();
            return(result);
        }
Exemple #3
0
        public int Delete(int pMaNhom, int pMaMH)
        {
            int        result = 0;
            PHAN_QUYEN k      = context.PHAN_QUYEN.FirstOrDefault(m => m.MA_NHOM == pMaNhom && m.MA_MH == pMaMH);

            context.PHAN_QUYEN.Remove(k);
            result = context.SaveChanges();
            return(result);
        }
Exemple #4
0
        public int Update(PHAN_QUYEN pT)
        {
            int        result = 0;
            PHAN_QUYEN k      = context.PHAN_QUYEN.FirstOrDefault(m => m.MA_MH == pT.MA_MH && m.MA_NHOM == pT.MA_NHOM);

            if (k != null)
            {
                k.CO_QUYEN = pT.CO_QUYEN;
            }
            result = context.SaveChanges();
            return(result);
        }