示例#1
0
 public UserTicketList UserisOwnerorAssignedSingle(string id, Ticket ticket)
 {
     var returninput = new UserTicketList();
     returninput.ticketin = ticket.Id;
     if (ticket.OwnerId == id)
     {
         returninput.ownerconfirmed = true;
     }
     else
     {
         returninput.ownerconfirmed = false;
     }
     if (ticket.AssignedId != null)
     {
         if (ticket.AssignedId == id)
         {
             returninput.assignconfirmed = true;
         }
         else
         {
             returninput.assignconfirmed = false;
         }
     }
     else
     {
         returninput.assignconfirmed = false;
     }
     returninput.isinproject = this.UserinProject(id, ticket.Project.Project);
     return returninput;
 }
示例#2
0
 public List<UserTicketList> UserisOwnerorAssigned(string id, IList<Ticket> ticketlist)
 {
     var returnlist = new List<UserTicketList>();
     foreach(var item in ticketlist)
     {
         var returninput = new UserTicketList();
         returninput.ticketin = item.Id;
         if(item.OwnerId == id)
         {
             returninput.ownerconfirmed = true;
         }
         else
         {
             returninput.ownerconfirmed = false;
         }
         if (item.AssignedId != null)
         {
             if (item.AssignedId == id)
             {
                 returninput.assignconfirmed = true;
             }
             else
             {
                 returninput.assignconfirmed = false;
             }
         }
         else
         {
             returninput.assignconfirmed = false;
         }
         returninput.isinproject = this.UserinProject(id, item.Project.Project);
         returnlist.Add(returninput);
     }
     return returnlist;
 }