|  |  | @ -1,4 +1,5 @@ | 
			
		
	
		
			
				
					|  |  |  | using CoviDok.Api.Request; | 
			
		
	
		
			
				
					|  |  |  | using CoviDok.Api; | 
			
		
	
		
			
				
					|  |  |  | using CoviDok.Api.Request; | 
			
		
	
		
			
				
					|  |  |  | using CoviDok.BLL.Sessions; | 
			
		
	
		
			
				
					|  |  |  | using CoviDok.BLL.Storage; | 
			
		
	
		
			
				
					|  |  |  | using CoviDok.BLL.User.Handlers; | 
			
		
	
	
		
			
				
					|  |  | @ -113,6 +114,20 @@ namespace CoviDok.BLL.User.Managers | 
			
		
	
		
			
				
					|  |  |  |             } | 
			
		
	
		
			
				
					|  |  |  |         } | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |         public async Task SetPriority(Session s, int id, Priority priority) | 
			
		
	
		
			
				
					|  |  |  |         { | 
			
		
	
		
			
				
					|  |  |  |             Case c = await handler.GetCase(id); | 
			
		
	
		
			
				
					|  |  |  |             if (c == null) throw new KeyNotFoundException(); | 
			
		
	
		
			
				
					|  |  |  |             if (handler.IsAuthorized(s.Id, c)) | 
			
		
	
		
			
				
					|  |  |  |             { | 
			
		
	
		
			
				
					|  |  |  |                 await handler.SetPriority(id, priority); | 
			
		
	
		
			
				
					|  |  |  |             } | 
			
		
	
		
			
				
					|  |  |  |             else | 
			
		
	
		
			
				
					|  |  |  |             { | 
			
		
	
		
			
				
					|  |  |  |                 throw new UnauthorizedAccessException(); | 
			
		
	
		
			
				
					|  |  |  |             } | 
			
		
	
		
			
				
					|  |  |  |         } | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |         public async Task<Case> CreateCase(Session s, int DoctorId, int ChildId, string Title, DateTime startDate, Api.Priority priority) | 
			
		
	
		
			
				
					|  |  |  |         { | 
			
		
	
		
			
				
					|  |  |  |             // TODO szülő csak saját gyereket jelenthet
 | 
			
		
	
	
		
			
				
					|  |  | @ -131,7 +146,7 @@ namespace CoviDok.BLL.User.Managers | 
			
		
	
		
			
				
					|  |  |  |             return await handler.AddCase(c); | 
			
		
	
		
			
				
					|  |  |  |         } | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |         public async Task UpdateCase(Session s, int id, string updateMsg, List<string> Images, Api.Priority priority) | 
			
		
	
		
			
				
					|  |  |  |         public async Task UpdateCase(Session s, int id, string updateMsg, List<string> Images) | 
			
		
	
		
			
				
					|  |  |  |         { | 
			
		
	
		
			
				
					|  |  |  |             Case c = await handler.GetCase(id); | 
			
		
	
		
			
				
					|  |  |  |             if (c == null) throw new KeyNotFoundException("Case Id not found: " + id); | 
			
		
	
	
		
			
				
					|  |  | @ -146,7 +161,7 @@ namespace CoviDok.BLL.User.Managers | 
			
		
	
		
			
				
					|  |  |  |                 if (s.Id == c.ParentId) c.Assignee = c.DoctorId; // Ha szülő updatel, az assignee az orvos lesz
 | 
			
		
	
		
			
				
					|  |  |  |                 // TODO Ha a doki VAGY asszisztense frissít
 | 
			
		
	
		
			
				
					|  |  |  |                 if (s.Id == c.DoctorId) c.Assignee = c.ParentId; // Ha doki frissít, a szülőhöz kerül
 | 
			
		
	
		
			
				
					|  |  |  |                 c.Priority = priority; | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |                 c.LastModificationDate = DateTime.Now; | 
			
		
	
		
			
				
					|  |  |  |                 Update update = new Update { | 
			
		
	
		
			
				
					|  |  |  |                     CaseId = c.Id, | 
			
		
	
	
		
			
				
					|  |  | 
 |