public void PhanQuyen(string Nhom, HT_Quyen Quyen) { Context.DB.HT_PhanQuyens.InsertOnSubmit(new HT_PhanQuyen() { Nhom = Nhom, IDQuyen = Quyen.IDQuyen }); Context.DB.SubmitChanges(); }
public bool DuocPhep(HT_Quyen Quyen) { return(Self.IDTaiKhoan == SA.IDTaiKhoan || Context.DB.HT_PhanQuyens .Where( p => p.HT_TaiKhoan.IDTaiKhoan == Self.IDTaiKhoan && p.HT_Quyen.IDQuyen == Quyen.IDQuyen ) .Select(p => p.HT_Quyen) .Contains(Quyen)); }
public HT_PhanQuyen ThemQuyenCho(HT_TaiKhoan TaiKhoanKhac, HT_Quyen Quyen) { CoTheSua(TaiKhoanKhac, true); var pq = new HT_PhanQuyen(); pq.HT_TaiKhoan = TaiKhoanKhac; pq.HT_Quyen = Quyen; Context.DB.HT_PhanQuyens.InsertOnSubmit(pq); Context.DB.SubmitChanges(); return(pq); }
public HT_PhanQuyen XoaQuyenCho(HT_TaiKhoan TaiKhoanKhac, HT_Quyen Quyen) { CoTheSua(TaiKhoanKhac, true); var pq = Context.DB.HT_PhanQuyens.First(_pq => _pq.HT_TaiKhoan.IDTaiKhoan == TaiKhoanKhac.IDTaiKhoan && _pq.HT_Quyen.IDQuyen == Quyen.IDQuyen); if (pq != null) { Context.DB.HT_PhanQuyens.DeleteOnSubmit(pq); Context.DB.SubmitChanges(); } return(pq); }
partial void DeleteHT_Quyen(HT_Quyen instance);
partial void UpdateHT_Quyen(HT_Quyen instance);
partial void InsertHT_Quyen(HT_Quyen instance);