Revize 23b9ad46
Přidáno uživatelem Milan Hotovec před téměř 4 roky(ů)
src/Modules/Goal/Application/Leuze.Modules.Goal.Application/CQRS/GoalDefinitionAreas/Commands/CreateNewArea.cs | ||
---|---|---|
47 | 47 |
return RequestResponse<Response>.CreateErrorResponse($"V zadaném rozsahu již existuje oblast!"); |
48 | 48 |
} |
49 | 49 |
|
50 |
GlobalDefinitionArea item = new GlobalDefinitionArea(user, request.from, request.to); |
|
50 |
GlobalDefinitionArea item = new GlobalDefinitionArea(user, request.from, request.to, request.variCompany);
|
|
51 | 51 |
|
52 | 52 |
await _gdAreaRepo.AddAsync(item); |
53 | 53 |
|
src/Modules/Goal/Domain/Leuze.Modules.Goal.Domain/Repositories/IGlobalDefinitionAreaRepository.cs | ||
---|---|---|
21 | 21 |
|
22 | 22 |
Task<bool> SetTo(Guid id, DateTime to); |
23 | 23 |
|
24 |
Task<bool> SetCompanyVariSetVariCompanySuccess(Guid id, double vari);
|
|
24 |
Task<bool> SetVariCompanySuccess(Guid id, double vari); |
|
25 | 25 |
|
26 | 26 |
|
27 | 27 |
Task<List<GlobalDefinitionArea>> GetAllWithinTimeRange(DateTime from, DateTime to); |
src/Modules/Goal/Infrastructure/Leuze.Modules.Goal.Infrastructure.Persistence/Repositories/GlobalDefinitionAreaRepository.cs | ||
---|---|---|
47 | 47 |
return true; |
48 | 48 |
} |
49 | 49 |
|
50 |
public async Task<bool> SetCompanyVariSetVariCompanySuccess(Guid id, double vari)
|
|
50 |
public async Task<bool> SetVariCompanySuccess(Guid id, double vari) |
|
51 | 51 |
{ |
52 | 52 |
GlobalDefinitionArea item = await dbSet.FindAsync(id); |
53 | 53 |
if (item == null) return false; |
... | ... | |
76 | 76 |
|
77 | 77 |
public async Task<List<GlobalDefinitionArea>> GetAllWithinTimeRange(DateTime from, DateTime to) |
78 | 78 |
{ |
79 |
GlobalDefinitionArea gdArea = dbSet.FirstOrDefault(); |
|
80 |
if(gdArea != null) |
|
81 |
{ |
|
82 |
Console.WriteLine(gdArea.From >= from); |
|
83 |
Console.WriteLine(gdArea.From <= to); |
|
84 |
Console.WriteLine(gdArea.To >= from); |
|
85 |
Console.WriteLine(gdArea.To <= to); |
|
86 |
} |
|
79 | 87 |
//return await dbSet.Where(item => ((item.From >= from && item.From <= to) || (item.To <= to && item.To >= from))).ToListAsync(); |
80 | 88 |
return await dbSet.Where(item => ((item.From >= from && item.From <= to) || (item.To <= to && item.To >= from))).ToListAsync(); |
81 | 89 |
} |
Také k dispozici: Unified diff
Are bugfix