Exemplo n.º 1
0
        public BOChiTietQuyen KiemTraQuyen(int MaChucNang)
        {
            BOChiTietQuyen item = new BOChiTietQuyen();

            if (mTransit.DanhSachQuyen != null && mTransit.NhanVien.LoaiNhanVienID > (int)Data.EnumLoaiNhanVien.Admin)
            {
                IQueryable <BOChiTietQuyen> list = mTransit.DanhSachQuyen.Where(s => s.ChiTietQuyen.ChucNangID == MaChucNang);
                if (list.Count() > 0)
                {
                    foreach (BOChiTietQuyen line in list)
                    {
                        item.ChiTietQuyen.ChoPhep  = ((bool)item.ChiTietQuyen.ChoPhep || (bool)line.ChiTietQuyen.ChoPhep) ? true : false;
                        item.ChiTietQuyen.DangNhap = ((bool)item.ChiTietQuyen.DangNhap || (bool)line.ChiTietQuyen.DangNhap) ? true : false;
                        item.ChiTietQuyen.Them     = ((bool)item.ChiTietQuyen.Them || (bool)line.ChiTietQuyen.Them) ? true : false;
                        item.ChiTietQuyen.Sua      = ((bool)item.ChiTietQuyen.Sua || (bool)line.ChiTietQuyen.Sua) ? true : false;
                        item.ChiTietQuyen.Xoa      = ((bool)item.ChiTietQuyen.Xoa || (bool)line.ChiTietQuyen.Xoa) ? true : false;
                    }
                }
            }
            else
            {
                item.ChiTietQuyen.ChoPhep  = true;
                item.ChiTietQuyen.DangNhap = false;
                item.ChiTietQuyen.Them     = true;
                item.ChiTietQuyen.Xoa      = true;
                item.ChiTietQuyen.Sua      = true;
            }
            return(item);
        }
Exemplo n.º 2
0
 private int Sua(BOChiTietQuyen item, Transit mTransit)
 {
     frmChiTietQuyen.Update(item.ChiTietQuyen);
     return item.ChiTietQuyen.ChiTietQuyenID;
 }
Exemplo n.º 3
0
 private int Xoa(BOChiTietQuyen item, Transit mTransit)
 {
     frmChiTietQuyen.DeleteObject(item.ChiTietQuyen);
     return item.ChiTietQuyen.ChiTietQuyenID;
 }
Exemplo n.º 4
0
 private int Them(BOChiTietQuyen item, Transit mTransit)
 {
     frmChiTietQuyen.AddObject(item.ChiTietQuyen);
     return item.ChiTietQuyen.ChiTietQuyenID;
 }
Exemplo n.º 5
0
 public BOChiTietQuyen KiemTraQuyen(int MaChucNang)
 {
     BOChiTietQuyen item = new BOChiTietQuyen();
     if (mTransit.DanhSachQuyen != null && mTransit.NhanVien.LoaiNhanVienID > (int)Data.EnumLoaiNhanVien.Admin)
     {
         IQueryable<BOChiTietQuyen> list = mTransit.DanhSachQuyen.Where(s => s.ChiTietQuyen.ChucNangID == MaChucNang);
         if (list.Count() > 0)
         {
             foreach (BOChiTietQuyen line in list)
             {
                 item.ChiTietQuyen.ChoPhep = ((bool)item.ChiTietQuyen.ChoPhep || (bool)line.ChiTietQuyen.ChoPhep) ? true : false;
                 item.ChiTietQuyen.DangNhap = ((bool)item.ChiTietQuyen.DangNhap || (bool)line.ChiTietQuyen.DangNhap) ? true : false;
                 item.ChiTietQuyen.Them = ((bool)item.ChiTietQuyen.Them || (bool)line.ChiTietQuyen.Them) ? true : false;
                 item.ChiTietQuyen.Sua = ((bool)item.ChiTietQuyen.Sua || (bool)line.ChiTietQuyen.Sua) ? true : false;
                 item.ChiTietQuyen.Xoa = ((bool)item.ChiTietQuyen.Xoa || (bool)line.ChiTietQuyen.Xoa) ? true : false;
             }
         }
     }
     else
     {
         item.ChiTietQuyen.ChoPhep = true;
         item.ChiTietQuyen.DangNhap = false;
         item.ChiTietQuyen.Them = true;
         item.ChiTietQuyen.Xoa = true;
         item.ChiTietQuyen.Sua = true;
     }
     return item;
 }
Exemplo n.º 6
0
 private int Sua(BOChiTietQuyen item, Transit mTransit)
 {
     frmChiTietQuyen.Update(item.ChiTietQuyen);
     return(item.ChiTietQuyen.ChiTietQuyenID);
 }
Exemplo n.º 7
0
 private int Xoa(BOChiTietQuyen item, Transit mTransit)
 {
     frmChiTietQuyen.DeleteObject(item.ChiTietQuyen);
     return(item.ChiTietQuyen.ChiTietQuyenID);
 }
Exemplo n.º 8
0
 private int Them(BOChiTietQuyen item, Transit mTransit)
 {
     frmChiTietQuyen.AddObject(item.ChiTietQuyen);
     return(item.ChiTietQuyen.ChiTietQuyenID);
 }