Ejemplo n.º 1
0
 private List <HelpDeskEntities.Ticket.Ticket> AllTicket()
 {
     if (role == "EndUser")
     {
         return(tktRepo.AllTicket(Convert.ToInt32(CurrentUser[2])));
     }
     else
     {
         var TktData = tktRepo.AllTicket(null);
         if (role == "admin")
         {
             return(TktData);
         }
         else if (role == "HelpdeskUser" || role == "SuperUser")
         {
             ModuleBAL mb = new ModuleBAL();
             UserModuleList = mb.ModuleListForUser(Convert.ToInt32(CurrentUser[2]));
             return(TktData.Where(t => UserModuleList.Any(m => m.ModuleID == t.TicketModule.ModuleID)).ToList());
         }
         else if (role == "SupportStaff")
         {
             return(TktData.Where(t => t.AssignedTo.UID == Convert.ToInt32(CurrentUser[2])).ToList());
         }
         else
         {
             List <HelpDeskEntities.Ticket.Ticket> tkts = new List <HelpDeskEntities.Ticket.Ticket>();
             return(tkts);
         }
     }
 }