add version 0.2.1.0

complete activity and shifting
master
Amir Hossein Khademi 2023-12-12 14:54:19 +03:30
parent 504744da7d
commit 48523274e2
21 changed files with 406 additions and 511 deletions

View File

@ -1 +1 @@
0.1.4.0 0.2.1.0

View File

@ -6,8 +6,8 @@
<ImplicitUsings>enable</ImplicitUsings> <ImplicitUsings>enable</ImplicitUsings>
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS> <DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
<DockerComposeProjectPath>..\docker-compose.dcproj</DockerComposeProjectPath> <DockerComposeProjectPath>..\docker-compose.dcproj</DockerComposeProjectPath>
<AssemblyVersion>0.1.4.0</AssemblyVersion> <AssemblyVersion>0.2.1.0</AssemblyVersion>
<FileVersion>0.1.4.0</FileVersion> <FileVersion>0.2.1.0</FileVersion>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>

View File

@ -1,26 +1,12 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <!--<PropertyGroup>
<TargetFramework>net8.0</TargetFramework> <TargetFramework>net8.0</TargetFramework>
<LangVersion>10</LangVersion> <LangVersion>10</LangVersion>
<ImplicitUsings>enable</ImplicitUsings> <ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable> <Nullable>enable</Nullable>
</PropertyGroup> </PropertyGroup>
<ItemGroup>
<PackageReference Include="MD.PersianDateTime.Standard" Version="2.5.0" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="System.ComponentModel.Annotations" Version="5.0.0" />
<PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="7.0.3" />
</ItemGroup>
<!--<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
<LangVersion>10</LangVersion>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="MD.PersianDateTime.Standard" Version="2.5.0" /> <PackageReference Include="MD.PersianDateTime.Standard" Version="2.5.0" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" /> <PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
@ -28,6 +14,20 @@
<PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="7.0.3" /> <PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="7.0.3" />
</ItemGroup>--> </ItemGroup>-->
<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
<LangVersion>10</LangVersion>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="MD.PersianDateTime.Standard" Version="2.5.0" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="System.ComponentModel.Annotations" Version="5.0.0" />
<PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="7.0.3" />
</ItemGroup>
<ItemGroup> <ItemGroup>
<Using Include="MD.PersianDateTime.Standard" /> <Using Include="MD.PersianDateTime.Standard" />
<Using Include="System.ComponentModel.DataAnnotations" /> <Using Include="System.ComponentModel.DataAnnotations" />

View File

@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <!--<PropertyGroup>
<TargetFramework>net8.0</TargetFramework> <TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings> <ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable> <Nullable>enable</Nullable>
@ -13,10 +13,10 @@
<PackageReference Include="MediatR" Version="12.2.0" /> <PackageReference Include="MediatR" Version="12.2.0" />
<PackageReference Include="Microsoft.Extensions.Identity.Stores" Version="8.0.0" /> <PackageReference Include="Microsoft.Extensions.Identity.Stores" Version="8.0.0" />
<PackageReference Include="PropertyChanged.Fody" Version="4.1.0" /> <PackageReference Include="PropertyChanged.Fody" Version="4.1.0" />
</ItemGroup> </ItemGroup>-->
<!--<PropertyGroup> <PropertyGroup>
<TargetFramework>net5.0</TargetFramework> <TargetFramework>net5.0</TargetFramework>
<LangVersion>10</LangVersion> <LangVersion>10</LangVersion>
<ImplicitUsings>enable</ImplicitUsings> <ImplicitUsings>enable</ImplicitUsings>
@ -32,15 +32,15 @@
<PackageReference Include="Microsoft.Extensions.Identity.Stores" Version="5.0.0" /> <PackageReference Include="Microsoft.Extensions.Identity.Stores" Version="5.0.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="5.0.0" /> <PackageReference Include="Microsoft.EntityFrameworkCore" Version="5.0.0" />
<PackageReference Include="PropertyChanged.Fody" Version="4.1.0" /> <PackageReference Include="PropertyChanged.Fody" Version="4.1.0" />
</ItemGroup>--> </ItemGroup>
<Target Name="Mapster"> <Target Name="Mapster">
<Exec WorkingDirectory="$(ProjectDir)" Command="dotnet build -p:CopyLocalLockFileAssemblies=true" /> <Exec WorkingDirectory="$(ProjectDir)" Command="dotnet build -p:CopyLocalLockFileAssemblies=true" />
<Exec WorkingDirectory="$(ProjectDir)" Command="dotnet tool restore" /> <Exec WorkingDirectory="$(ProjectDir)" Command="dotnet tool restore" />
<Exec WorkingDirectory="$(ProjectDir)" Command="dotnet mapster extension -a &quot;$(TargetDir)$(ProjectName).dll&quot; -n Brizco.Domain.Mappers -o Mappers" /> <Exec WorkingDirectory="$(ProjectDir)" Command="dotnet mapster extension -a &quot;$(TargetDir)$(ProjectName).dll&quot; -n Brizco.Domain.Mappers -o Mappers" />
<Exec WorkingDirectory="$(ProjectDir)" Command="dotnet mapster mapper -a &quot;$(TargetDir)$(ProjectName).dll&quot; -n Brizco.Domain.Mappers -o Mappers" /> <Exec WorkingDirectory="$(ProjectDir)" Command="dotnet mapster mapper -a &quot;$(TargetDir)$(ProjectName).dll&quot; -n Brizco.Domain.Mappers -o Mappers" />
</Target> </Target>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\Brizco.Common\Brizco.Common.csproj" /> <ProjectReference Include="..\Brizco.Common\Brizco.Common.csproj" />
@ -73,7 +73,6 @@
<ItemGroup> <ItemGroup>
<Folder Include="Dtos\PageDto\" /> <Folder Include="Dtos\PageDto\" />
<Folder Include="Models\Settings\" />
</ItemGroup> </ItemGroup>
</Project> </Project>

View File

@ -15,6 +15,7 @@ public class ActivitySDto : BaseDto<ActivitySDto , Activity>
public ActivityStatus Status { get; internal set; } public ActivityStatus Status { get; internal set; }
public DateTime DoneAt { get; internal set; } public DateTime DoneAt { get; internal set; }
public bool IsDone { get; set; } public bool IsDone { get; set; }
public string ShiftTitle { get; set; } = string.Empty;
public string PerformanceDescription { get; internal set; } = string.Empty; public string PerformanceDescription { get; internal set; } = string.Empty;
public string UserFirstName { get; set; } = string.Empty; public string UserFirstName { get; set; } = string.Empty;
public string UserLastName { get; set; } = string.Empty; public string UserLastName { get; set; } = string.Empty;

View File

@ -8,6 +8,8 @@ public class ShiftSDto : BaseDto<ShiftSDto,Shift>
public int UndoneActivitiesCount { get; set; } public int UndoneActivitiesCount { get; set; }
public int DoneActivitiesCount { get; set; } public int DoneActivitiesCount { get; set; }
public int TotalActivitiesCount { get; set; } public int TotalActivitiesCount { get; set; }
public Guid CurrentShiftPlanId { get; set; }
public bool HasCurrentShiftPlan { get; set; }
public bool IsCompleted { get; set; } public bool IsCompleted { get; set; }
public TimeSpan StartAt { get; set; } public TimeSpan StartAt { get; set; }
public TimeSpan EndAt { get; set; } public TimeSpan EndAt { get; set; }

View File

@ -3,7 +3,8 @@
namespace Brizco.Domain.Entities.Complex; namespace Brizco.Domain.Entities.Complex;
[AdaptTwoWays("[name]SDto", IgnoreAttributes = new[] { typeof(AdaptIgnoreAttribute) }, MapType = MapType.Map | MapType.MapToTarget | MapType.Projection)] [AdaptTwoWays("[name]SDto", IgnoreAttributes = new[] { typeof(AdaptIgnoreAttribute) }, MapType = MapType.Map | MapType.MapToTarget | MapType.Projection)]
[AdaptTwoWays("[name]LDto", IgnoreAttributes = new[] { typeof(AdaptIgnoreAttribute) }, MapType = MapType.Map | MapType.MapToTarget | MapType.Projection)] [AdaptTwoWays("[name]LDto", IgnoreAttributes = new[] { typeof(AdaptIgnoreAttribute) }, MapType = MapType.Map | MapType.MapToTarget)]
[AdaptTo("[name]LDto", IgnoreAttributes = new[] { typeof(AdaptIgnoreAttribute) }, MapType = MapType.Projection)]
[GenerateMapper] [GenerateMapper]
public partial class Complex : ApiEntity public partial class Complex : ApiEntity
{ {

View File

@ -1,7 +1,8 @@
namespace Brizco.Domain.Entities.Complex; namespace Brizco.Domain.Entities.Complex;
[AdaptTwoWays("[name]SDto", IgnoreAttributes = new[] { typeof(AdaptIgnoreAttribute) }, MapType = MapType.Map | MapType.MapToTarget | MapType.Projection)] [AdaptTwoWays("[name]SDto", IgnoreAttributes = new[] { typeof(AdaptIgnoreAttribute) }, MapType = MapType.Map | MapType.MapToTarget | MapType.Projection)]
[AdaptTwoWays("[name]LDto", IgnoreAttributes = new[] { typeof(AdaptIgnoreAttribute) }, MapType = MapType.Map | MapType.MapToTarget | MapType.Projection)] [AdaptTwoWays("[name]LDto", IgnoreAttributes = new[] { typeof(AdaptIgnoreAttribute) }, MapType = MapType.Map | MapType.MapToTarget)]
[AdaptTo("[name]LDto", IgnoreAttributes = new[] { typeof(AdaptIgnoreAttribute) }, MapType = MapType.Projection)]
[GenerateMapper] [GenerateMapper]
public partial class Position : ApiEntity public partial class Position : ApiEntity
{ {

View File

@ -1,7 +1,8 @@
namespace Brizco.Domain.Entities.Complex; namespace Brizco.Domain.Entities.Complex;
[AdaptTwoWays("[name]SDto", IgnoreAttributes = new[] { typeof(AdaptIgnoreAttribute) }, MapType = MapType.Map | MapType.MapToTarget | MapType.Projection)] [AdaptTwoWays("[name]SDto", IgnoreAttributes = new[] { typeof(AdaptIgnoreAttribute) }, MapType = MapType.Map | MapType.MapToTarget | MapType.Projection)]
[AdaptTwoWays("[name]LDto", IgnoreAttributes = new[] { typeof(AdaptIgnoreAttribute) }, MapType = MapType.Map | MapType.MapToTarget | MapType.Projection)] [AdaptTwoWays("[name]LDto", IgnoreAttributes = new[] { typeof(AdaptIgnoreAttribute) }, MapType = MapType.Map | MapType.MapToTarget)]
[AdaptTo("[name]LDto", IgnoreAttributes = new[] { typeof(AdaptIgnoreAttribute) }, MapType = MapType.Projection)]
[GenerateMapper] [GenerateMapper]
public partial class Section : ApiEntity public partial class Section : ApiEntity
{ {

View File

@ -1,7 +1,8 @@
namespace Brizco.Domain.Entities.Shift; namespace Brizco.Domain.Entities.Shift;
[AdaptTwoWays("[name]SDto", IgnoreAttributes = new[] { typeof(AdaptIgnoreAttribute) }, MapType = MapType.Map | MapType.MapToTarget | MapType.Projection)] [AdaptTwoWays("[name]SDto", IgnoreAttributes = new[] { typeof(AdaptIgnoreAttribute) }, MapType = MapType.Map | MapType.MapToTarget | MapType.Projection)]
[AdaptTwoWays("[name]LDto", IgnoreAttributes = new[] { typeof(AdaptIgnoreAttribute) }, MapType = MapType.Map | MapType.MapToTarget | MapType.Projection)] [AdaptTwoWays("[name]LDto", IgnoreAttributes = new[] { typeof(AdaptIgnoreAttribute) }, MapType = MapType.Map | MapType.MapToTarget)]
[AdaptTo("[name]LDto", IgnoreAttributes = new[] { typeof(AdaptIgnoreAttribute) }, MapType = MapType.Projection)]
[GenerateMapper] [GenerateMapper]
public partial class Shift : ApiEntity public partial class Shift : ApiEntity
{ {

View File

@ -1,7 +1,8 @@
namespace Brizco.Domain.Entities.Shift; namespace Brizco.Domain.Entities.Shift;
[AdaptTwoWays("[name]SDto", IgnoreAttributes = new[] { typeof(AdaptIgnoreAttribute) }, MapType = MapType.Map | MapType.MapToTarget | MapType.Projection)] [AdaptTwoWays("[name]SDto", IgnoreAttributes = new[] { typeof(AdaptIgnoreAttribute) }, MapType = MapType.Map | MapType.MapToTarget | MapType.Projection)]
[AdaptTwoWays("[name]LDto", IgnoreAttributes = new[] { typeof(AdaptIgnoreAttribute) }, MapType = MapType.Map | MapType.MapToTarget | MapType.Projection)] [AdaptTwoWays("[name]LDto", IgnoreAttributes = new[] { typeof(AdaptIgnoreAttribute) }, MapType = MapType.Map | MapType.MapToTarget)]
[AdaptTo("[name]LDto", IgnoreAttributes = new[] { typeof(AdaptIgnoreAttribute) }, MapType = MapType.Projection)]
[GenerateMapper] [GenerateMapper]
public partial class ShiftPlan : ApiEntity public partial class ShiftPlan : ApiEntity
{ {

View File

@ -2,7 +2,8 @@
namespace Brizco.Domain.Entities.Task; namespace Brizco.Domain.Entities.Task;
[AdaptTwoWays("[name]SDto", IgnoreAttributes = new[] { typeof(AdaptIgnoreAttribute) }, MapType = MapType.Map | MapType.MapToTarget | MapType.Projection)] [AdaptTwoWays("[name]SDto", IgnoreAttributes = new[] { typeof(AdaptIgnoreAttribute) }, MapType = MapType.Map | MapType.MapToTarget | MapType.Projection)]
[AdaptTwoWays("[name]LDto", IgnoreAttributes = new[] { typeof(AdaptIgnoreAttribute) }, MapType = MapType.Map | MapType.MapToTarget | MapType.Projection)] [AdaptTwoWays("[name]LDto", IgnoreAttributes = new[] { typeof(AdaptIgnoreAttribute) }, MapType = MapType.Map | MapType.MapToTarget )]
[AdaptTo("[name]LDto", IgnoreAttributes = new[] { typeof(AdaptIgnoreAttribute) }, MapType = MapType.Projection)]
[GenerateMapper] [GenerateMapper]
public partial class Task : ApiEntity public partial class Task : ApiEntity
{ {

View File

@ -26,7 +26,11 @@ namespace Brizco.Domain.Mappers
LastName = p1.UserLastName LastName = p1.UserLastName
}, },
ShiftId = p1.ShiftId, ShiftId = p1.ShiftId,
Shift = new Shift() {Id = p1.ShiftId}, Shift = new Shift()
{
Title = p1.ShiftTitle,
Id = p1.ShiftId
},
Type = p1.Type, Type = p1.Type,
Title = p1.Title, Title = p1.Title,
Description = p1.Description, Description = p1.Description,
@ -81,7 +85,11 @@ namespace Brizco.Domain.Mappers
LastName = p8.UserLastName LastName = p8.UserLastName
}, },
ShiftId = p8.ShiftId, ShiftId = p8.ShiftId,
Shift = new Shift() {Id = p8.ShiftId}, Shift = new Shift()
{
Title = p8.ShiftTitle,
Id = p8.ShiftId
},
Type = p8.Type, Type = p8.Type,
Title = p8.Title, Title = p8.Title,
Description = p8.Description, Description = p8.Description,
@ -108,6 +116,7 @@ namespace Brizco.Domain.Mappers
Status = p9.Status, Status = p9.Status,
DoneAt = p9.DoneAt, DoneAt = p9.DoneAt,
IsDone = p9.IsDone, IsDone = p9.IsDone,
ShiftTitle = p9.Shift != null ? p9.Shift.Title : string.Empty,
PerformanceDescription = p9.PerformanceDescription, PerformanceDescription = p9.PerformanceDescription,
UserFirstName = p9.User != null ? p9.User.FirstName : string.Empty, UserFirstName = p9.User != null ? p9.User.FirstName : string.Empty,
UserLastName = p9.User != null ? p9.User.LastName : string.Empty, UserLastName = p9.User != null ? p9.User.LastName : string.Empty,
@ -136,6 +145,7 @@ namespace Brizco.Domain.Mappers
result.Status = p10.Status; result.Status = p10.Status;
result.DoneAt = p10.DoneAt; result.DoneAt = p10.DoneAt;
result.IsDone = p10.IsDone; result.IsDone = p10.IsDone;
result.ShiftTitle = p10.Shift != null ? p10.Shift.Title : string.Empty;
result.PerformanceDescription = p10.PerformanceDescription; result.PerformanceDescription = p10.PerformanceDescription;
result.UserFirstName = p10.User != null ? p10.User.FirstName : string.Empty; result.UserFirstName = p10.User != null ? p10.User.FirstName : string.Empty;
result.UserLastName = p10.User != null ? p10.User.LastName : string.Empty; result.UserLastName = p10.User != null ? p10.User.LastName : string.Empty;
@ -159,6 +169,7 @@ namespace Brizco.Domain.Mappers
Status = p12.Status, Status = p12.Status,
DoneAt = p12.DoneAt, DoneAt = p12.DoneAt,
IsDone = p12.IsDone, IsDone = p12.IsDone,
ShiftTitle = p12.Shift != null ? p12.Shift.Title : string.Empty,
PerformanceDescription = p12.PerformanceDescription, PerformanceDescription = p12.PerformanceDescription,
UserFirstName = p12.User != null ? p12.User.FirstName : string.Empty, UserFirstName = p12.User != null ? p12.User.FirstName : string.Empty,
UserLastName = p12.User != null ? p12.User.LastName : string.Empty, UserLastName = p12.User != null ? p12.User.LastName : string.Empty,
@ -210,80 +221,64 @@ namespace Brizco.Domain.Mappers
return result; return result;
} }
public static Expression<Func<ActivityLDto, Activity>> ProjectLDtoToActivity => p16 => new Activity() public static ActivityLDto AdaptToLDto(this Activity p16)
{ {
Status = p16.Status, return p16 == null ? null : new ActivityLDto()
DoneAt = p16.DoneAt,
IsDone = p16.IsDone,
PerformanceDescription = p16.PerformanceDescription,
Type = p16.Type,
Title = p16.Title,
Description = p16.Description,
IsDisposable = p16.IsDisposable,
SetFor = p16.SetFor,
HasDisposed = p16.HasDisposed,
Amount = p16.Amount,
AmountType = p16.AmountType,
Id = p16.Id
};
public static ActivityLDto AdaptToLDto(this Activity p17)
{
return p17 == null ? null : new ActivityLDto()
{ {
Type = p17.Type, Type = p16.Type,
Title = p17.Title, Title = p16.Title,
Description = p17.Description, Description = p16.Description,
IsDisposable = p17.IsDisposable, IsDisposable = p16.IsDisposable,
SetFor = p17.SetFor, SetFor = p16.SetFor,
HasDisposed = p17.HasDisposed, HasDisposed = p16.HasDisposed,
Status = p17.Status, Status = p16.Status,
DoneAt = p17.DoneAt, DoneAt = p16.DoneAt,
IsDone = p17.IsDone, IsDone = p16.IsDone,
PerformanceDescription = p17.PerformanceDescription, PerformanceDescription = p16.PerformanceDescription,
Amount = p17.Amount, Amount = p16.Amount,
AmountType = p17.AmountType, AmountType = p16.AmountType,
Id = p17.Id Id = p16.Id
}; };
} }
public static ActivityLDto AdaptTo(this Activity p18, ActivityLDto p19) public static ActivityLDto AdaptTo(this Activity p17, ActivityLDto p18)
{ {
if (p18 == null) if (p17 == null)
{ {
return null; return null;
} }
ActivityLDto result = p19 ?? new ActivityLDto(); ActivityLDto result = p18 ?? new ActivityLDto();
result.Type = p18.Type; result.Type = p17.Type;
result.Title = p18.Title; result.Title = p17.Title;
result.Description = p18.Description; result.Description = p17.Description;
result.IsDisposable = p18.IsDisposable; result.IsDisposable = p17.IsDisposable;
result.SetFor = p18.SetFor; result.SetFor = p17.SetFor;
result.HasDisposed = p18.HasDisposed; result.HasDisposed = p17.HasDisposed;
result.Status = p18.Status; result.Status = p17.Status;
result.DoneAt = p18.DoneAt; result.DoneAt = p17.DoneAt;
result.IsDone = p18.IsDone; result.IsDone = p17.IsDone;
result.PerformanceDescription = p18.PerformanceDescription; result.PerformanceDescription = p17.PerformanceDescription;
result.Amount = p18.Amount; result.Amount = p17.Amount;
result.AmountType = p18.AmountType; result.AmountType = p17.AmountType;
result.Id = p18.Id; result.Id = p17.Id;
return result; return result;
} }
public static Expression<Func<Activity, ActivityLDto>> ProjectToLDto => p20 => new ActivityLDto() public static Expression<Func<Activity, ActivityLDto>> ProjectToLDto => p19 => new ActivityLDto()
{ {
Type = p20.Type, Type = p19.Type,
Title = p20.Title, Title = p19.Title,
Description = p20.Description, Description = p19.Description,
IsDisposable = p20.IsDisposable, IsDisposable = p19.IsDisposable,
SetFor = p20.SetFor, SetFor = p19.SetFor,
HasDisposed = p20.HasDisposed, HasDisposed = p19.HasDisposed,
Status = p20.Status, Status = p19.Status,
DoneAt = p20.DoneAt, DoneAt = p19.DoneAt,
IsDone = p20.IsDone, IsDone = p19.IsDone,
PerformanceDescription = p20.PerformanceDescription, PerformanceDescription = p19.PerformanceDescription,
Amount = p20.Amount, Amount = p19.Amount,
AmountType = p20.AmountType, AmountType = p19.AmountType,
Id = p20.Id Id = p19.Id
}; };
private static ApplicationUser funcMain1(Never p4, ApplicationUser p5, ActivitySDto p2) private static ApplicationUser funcMain1(Never p4, ApplicationUser p5, ActivitySDto p2)
@ -300,6 +295,7 @@ namespace Brizco.Domain.Mappers
{ {
Shift result = p7 ?? new Shift(); Shift result = p7 ?? new Shift();
result.Title = p2.ShiftTitle;
result.Id = p2.ShiftId; result.Id = p2.ShiftId;
return result; return result;

View File

@ -102,68 +102,49 @@ namespace Brizco.Domain.Mappers
return result; return result;
} }
public static Expression<Func<ComplexLDto, Complex>> ProjectLDtoToComplex => p15 => new Complex() public static ComplexLDto AdaptToLDto(this Complex p15)
{ {
Name = p15.Name, return p15 == null ? null : new ComplexLDto()
Address = p15.Address,
SupportPhone = p15.SupportPhone,
Users = p15.Users.Select<ComplexUserSDto, ComplexUser>(p16 => new ComplexUser()
{ {
UserId = p16.UserId, Name = p15.Name,
ComplexId = p16.ComplexId, Address = p15.Address,
User = new ApplicationUser() {Id = p16.UserId}, SupportPhone = p15.SupportPhone,
Complex = new Complex() Users = funcMain3(p15.Users),
{ Id = p15.Id
Name = p16.ComplexName,
Id = p16.ComplexId
},
Id = p16.Id
}).ToList<ComplexUser>(),
Id = p15.Id
};
public static ComplexLDto AdaptToLDto(this Complex p17)
{
return p17 == null ? null : new ComplexLDto()
{
Name = p17.Name,
Address = p17.Address,
SupportPhone = p17.SupportPhone,
Users = funcMain3(p17.Users),
Id = p17.Id
}; };
} }
public static ComplexLDto AdaptTo(this Complex p19, ComplexLDto p20) public static ComplexLDto AdaptTo(this Complex p17, ComplexLDto p18)
{ {
if (p19 == null) if (p17 == null)
{ {
return null; return null;
} }
ComplexLDto result = p20 ?? new ComplexLDto(); ComplexLDto result = p18 ?? new ComplexLDto();
result.Name = p19.Name; result.Name = p17.Name;
result.Address = p19.Address; result.Address = p17.Address;
result.SupportPhone = p19.SupportPhone; result.SupportPhone = p17.SupportPhone;
result.Users = funcMain4(p19.Users, result.Users); result.Users = funcMain4(p17.Users, result.Users);
result.Id = p19.Id; result.Id = p17.Id;
return result; return result;
} }
public static Expression<Func<Complex, ComplexLDto>> ProjectToLDto => p23 => new ComplexLDto() public static Expression<Func<Complex, ComplexLDto>> ProjectToLDto => p21 => new ComplexLDto()
{ {
Name = p23.Name, Name = p21.Name,
Address = p23.Address, Address = p21.Address,
SupportPhone = p23.SupportPhone, SupportPhone = p21.SupportPhone,
Users = p23.Users.Select<ComplexUser, ComplexUserSDto>(p24 => new ComplexUserSDto() Users = p21.Users.Select<ComplexUser, ComplexUserSDto>(p22 => new ComplexUserSDto()
{ {
FirstName = p24.User != null ? p24.User.FirstName : string.Empty, FirstName = p22.User != null ? p22.User.FirstName : string.Empty,
LastName = p24.User != null ? p24.User.LastName : string.Empty, LastName = p22.User != null ? p22.User.LastName : string.Empty,
NationalId = p24.User != null ? p24.User.NationalId : string.Empty, NationalId = p22.User != null ? p22.User.NationalId : string.Empty,
ComplexName = p24.Complex != null ? p24.Complex.Name : string.Empty, ComplexName = p22.Complex != null ? p22.Complex.Name : string.Empty,
UserId = p24.UserId, UserId = p22.UserId,
ComplexId = p24.ComplexId, ComplexId = p22.ComplexId,
Id = p24.Id Id = p22.Id
}).ToList<ComplexUserSDto>(), }).ToList<ComplexUserSDto>(),
Id = p23.Id Id = p21.Id
}; };
private static List<ComplexUser> funcMain1(List<ComplexUserSDto> p10) private static List<ComplexUser> funcMain1(List<ComplexUserSDto> p10)
@ -230,20 +211,20 @@ namespace Brizco.Domain.Mappers
} }
private static List<ComplexUserSDto> funcMain3(List<ComplexUser> p18) private static List<ComplexUserSDto> funcMain3(List<ComplexUser> p16)
{ {
if (p18 == null) if (p16 == null)
{ {
return null; return null;
} }
List<ComplexUserSDto> result = new List<ComplexUserSDto>(p18.Count); List<ComplexUserSDto> result = new List<ComplexUserSDto>(p16.Count);
int i = 0; int i = 0;
int len = p18.Count; int len = p16.Count;
while (i < len) while (i < len)
{ {
ComplexUser item = p18[i]; ComplexUser item = p16[i];
result.Add(item == null ? null : new ComplexUserSDto() result.Add(item == null ? null : new ComplexUserSDto()
{ {
FirstName = item.User != null ? item.User.FirstName : string.Empty, FirstName = item.User != null ? item.User.FirstName : string.Empty,
@ -260,20 +241,20 @@ namespace Brizco.Domain.Mappers
} }
private static List<ComplexUserSDto> funcMain4(List<ComplexUser> p21, List<ComplexUserSDto> p22) private static List<ComplexUserSDto> funcMain4(List<ComplexUser> p19, List<ComplexUserSDto> p20)
{ {
if (p21 == null) if (p19 == null)
{ {
return null; return null;
} }
List<ComplexUserSDto> result = new List<ComplexUserSDto>(p21.Count); List<ComplexUserSDto> result = new List<ComplexUserSDto>(p19.Count);
int i = 0; int i = 0;
int len = p21.Count; int len = p19.Count;
while (i < len) while (i < len)
{ {
ComplexUser item = p21[i]; ComplexUser item = p19[i];
result.Add(item == null ? null : new ComplexUserSDto() result.Add(item == null ? null : new ComplexUserSDto()
{ {
FirstName = item.User != null ? item.User.FirstName : string.Empty, FirstName = item.User != null ? item.User.FirstName : string.Empty,

View File

@ -114,57 +114,43 @@ namespace Brizco.Domain.Mappers
return result; return result;
} }
public static Expression<Func<PositionLDto, Position>> ProjectLDtoToPosition => p16 => new Position() public static PositionLDto AdaptToLDto(this Position p16)
{ {
Name = p16.Name, return p16 == null ? null : new PositionLDto()
Description = p16.Description,
ComplexId = p16.ComplexId,
Complex = new Complex() {Id = p16.ComplexId},
SectionId = p16.SectionId,
Section = new Section()
{ {
Name = p16.SectionName, Name = p16.Name,
Id = p16.SectionId Description = p16.Description,
}, ComplexId = p16.ComplexId,
Id = p16.Id SectionId = p16.SectionId,
}; SectionName = p16.Section != null ? p16.Section.Name : string.Empty,
public static PositionLDto AdaptToLDto(this Position p17) Id = p16.Id
{
return p17 == null ? null : new PositionLDto()
{
Name = p17.Name,
Description = p17.Description,
ComplexId = p17.ComplexId,
SectionId = p17.SectionId,
SectionName = p17.Section != null ? p17.Section.Name : string.Empty,
Id = p17.Id
}; };
} }
public static PositionLDto AdaptTo(this Position p18, PositionLDto p19) public static PositionLDto AdaptTo(this Position p17, PositionLDto p18)
{ {
if (p18 == null) if (p17 == null)
{ {
return null; return null;
} }
PositionLDto result = p19 ?? new PositionLDto(); PositionLDto result = p18 ?? new PositionLDto();
result.Name = p18.Name; result.Name = p17.Name;
result.Description = p18.Description; result.Description = p17.Description;
result.ComplexId = p18.ComplexId; result.ComplexId = p17.ComplexId;
result.SectionId = p18.SectionId; result.SectionId = p17.SectionId;
result.SectionName = p18.Section != null ? p18.Section.Name : string.Empty; result.SectionName = p17.Section != null ? p17.Section.Name : string.Empty;
result.Id = p18.Id; result.Id = p17.Id;
return result; return result;
} }
public static Expression<Func<Position, PositionLDto>> ProjectToLDto => p20 => new PositionLDto() public static Expression<Func<Position, PositionLDto>> ProjectToLDto => p19 => new PositionLDto()
{ {
Name = p20.Name, Name = p19.Name,
Description = p20.Description, Description = p19.Description,
ComplexId = p20.ComplexId, ComplexId = p19.ComplexId,
SectionId = p20.SectionId, SectionId = p19.SectionId,
SectionName = p20.Section != null ? p20.Section.Name : string.Empty, SectionName = p19.Section != null ? p19.Section.Name : string.Empty,
Id = p20.Id Id = p19.Id
}; };
private static Complex funcMain1(Never p12, Complex p13, PositionLDto p10) private static Complex funcMain1(Never p12, Complex p13, PositionLDto p10)

View File

@ -101,62 +101,47 @@ namespace Brizco.Domain.Mappers
return result; return result;
} }
public static Expression<Func<SectionLDto, Section>> ProjectLDtoToSection => p15 => new Section() public static SectionLDto AdaptToLDto(this Section p15)
{ {
Name = p15.Name, return p15 == null ? null : new SectionLDto()
Description = p15.Description,
ComplexId = p15.ComplexId,
Positions = p15.Positions.Select<PositionSDto, Position>(p16 => new Position()
{ {
Name = p16.Name, Name = p15.Name,
Description = p16.Description, Description = p15.Description,
ComplexId = p16.ComplexId, ComplexId = p15.ComplexId,
SectionId = p16.SectionId, Positions = funcMain3(p15.Positions),
Id = p16.Id Id = p15.Id
}).ToList<Position>(),
Id = p15.Id
};
public static SectionLDto AdaptToLDto(this Section p17)
{
return p17 == null ? null : new SectionLDto()
{
Name = p17.Name,
Description = p17.Description,
ComplexId = p17.ComplexId,
Positions = funcMain3(p17.Positions),
Id = p17.Id
}; };
} }
public static SectionLDto AdaptTo(this Section p19, SectionLDto p20) public static SectionLDto AdaptTo(this Section p17, SectionLDto p18)
{ {
if (p19 == null) if (p17 == null)
{ {
return null; return null;
} }
SectionLDto result = p20 ?? new SectionLDto(); SectionLDto result = p18 ?? new SectionLDto();
result.Name = p19.Name; result.Name = p17.Name;
result.Description = p19.Description; result.Description = p17.Description;
result.ComplexId = p19.ComplexId; result.ComplexId = p17.ComplexId;
result.Positions = funcMain4(p19.Positions, result.Positions); result.Positions = funcMain4(p17.Positions, result.Positions);
result.Id = p19.Id; result.Id = p17.Id;
return result; return result;
} }
public static Expression<Func<Section, SectionLDto>> ProjectToLDto => p23 => new SectionLDto() public static Expression<Func<Section, SectionLDto>> ProjectToLDto => p21 => new SectionLDto()
{ {
Name = p23.Name, Name = p21.Name,
Description = p23.Description, Description = p21.Description,
ComplexId = p23.ComplexId, ComplexId = p21.ComplexId,
Positions = p23.Positions.Select<Position, PositionSDto>(p24 => new PositionSDto() Positions = p21.Positions.Select<Position, PositionSDto>(p22 => new PositionSDto()
{ {
Name = p24.Name, Name = p22.Name,
Description = p24.Description, Description = p22.Description,
ComplexId = p24.ComplexId, ComplexId = p22.ComplexId,
SectionId = p24.SectionId, SectionId = p22.SectionId,
Id = p24.Id Id = p22.Id
}).ToList<PositionSDto>(), }).ToList<PositionSDto>(),
Id = p23.Id Id = p21.Id
}; };
private static List<Position> funcMain1(List<PositionSDto> p10) private static List<Position> funcMain1(List<PositionSDto> p10)
@ -215,20 +200,20 @@ namespace Brizco.Domain.Mappers
} }
private static List<PositionSDto> funcMain3(List<Position> p18) private static List<PositionSDto> funcMain3(List<Position> p16)
{ {
if (p18 == null) if (p16 == null)
{ {
return null; return null;
} }
List<PositionSDto> result = new List<PositionSDto>(p18.Count); List<PositionSDto> result = new List<PositionSDto>(p16.Count);
int i = 0; int i = 0;
int len = p18.Count; int len = p16.Count;
while (i < len) while (i < len)
{ {
Position item = p18[i]; Position item = p16[i];
result.Add(item == null ? null : new PositionSDto() result.Add(item == null ? null : new PositionSDto()
{ {
Name = item.Name, Name = item.Name,
@ -243,20 +228,20 @@ namespace Brizco.Domain.Mappers
} }
private static List<PositionSDto> funcMain4(List<Position> p21, List<PositionSDto> p22) private static List<PositionSDto> funcMain4(List<Position> p19, List<PositionSDto> p20)
{ {
if (p21 == null) if (p19 == null)
{ {
return null; return null;
} }
List<PositionSDto> result = new List<PositionSDto>(p21.Count); List<PositionSDto> result = new List<PositionSDto>(p19.Count);
int i = 0; int i = 0;
int len = p21.Count; int len = p19.Count;
while (i < len) while (i < len)
{ {
Position item = p21[i]; Position item = p19[i];
result.Add(item == null ? null : new PositionSDto() result.Add(item == null ? null : new PositionSDto()
{ {
Name = item.Name, Name = item.Name,

View File

@ -132,71 +132,54 @@ namespace Brizco.Domain.Mappers
return result; return result;
} }
public static Expression<Func<ShiftLDto, Shift>> ProjectLDtoToShift => p29 => new Shift() public static ShiftLDto AdaptToLDto(this Shift p29)
{ {
Title = p29.Title, return p29 == null ? null : new ShiftLDto()
StartAt = p29.StartAt,
EndAt = p29.EndAt,
Description = p29.Description,
ComplexId = p29.ComplexId,
Complex = new Complex() {Id = p29.ComplexId},
Days = p29.Days.Select<DayOfWeek, ShiftDay>(p30 => new ShiftDay() {}).ToList<ShiftDay>(),
Routines = p29.Routines.Select<ShiftRoutineSDto, ShiftRoutine>(p31 => new ShiftRoutine()
{ {
RoutineId = p31.RoutineId, Title = p29.Title,
ShiftId = p31.ShiftId, Description = p29.Description,
Id = p31.Id StartAt = p29.StartAt,
}).ToList<ShiftRoutine>(), EndAt = p29.EndAt,
Id = p29.Id ComplexId = p29.ComplexId,
}; Days = funcMain12(p29.Days.Select<ShiftDay, DayOfWeek>(funcMain13).ToList<DayOfWeek>()),
public static ShiftLDto AdaptToLDto(this Shift p32) Routines = funcMain14(p29.Routines),
{ Id = p29.Id
return p32 == null ? null : new ShiftLDto()
{
Title = p32.Title,
Description = p32.Description,
StartAt = p32.StartAt,
EndAt = p32.EndAt,
ComplexId = p32.ComplexId,
Days = funcMain12(p32.Days.Select<ShiftDay, DayOfWeek>(funcMain13).ToList<DayOfWeek>()),
Routines = funcMain14(p32.Routines),
Id = p32.Id
}; };
} }
public static ShiftLDto AdaptTo(this Shift p35, ShiftLDto p36) public static ShiftLDto AdaptTo(this Shift p32, ShiftLDto p33)
{ {
if (p35 == null) if (p32 == null)
{ {
return null; return null;
} }
ShiftLDto result = p36 ?? new ShiftLDto(); ShiftLDto result = p33 ?? new ShiftLDto();
result.Title = p35.Title; result.Title = p32.Title;
result.Description = p35.Description; result.Description = p32.Description;
result.StartAt = p35.StartAt; result.StartAt = p32.StartAt;
result.EndAt = p35.EndAt; result.EndAt = p32.EndAt;
result.ComplexId = p35.ComplexId; result.ComplexId = p32.ComplexId;
result.Days = funcMain15(p35.Days.Select<ShiftDay, DayOfWeek>(funcMain13).ToList<DayOfWeek>(), result.Days); result.Days = funcMain15(p32.Days.Select<ShiftDay, DayOfWeek>(funcMain13).ToList<DayOfWeek>(), result.Days);
result.Routines = funcMain16(p35.Routines, result.Routines); result.Routines = funcMain16(p32.Routines, result.Routines);
result.Id = p35.Id; result.Id = p32.Id;
return result; return result;
} }
public static Expression<Func<Shift, ShiftLDto>> ProjectToLDto => p41 => new ShiftLDto() public static Expression<Func<Shift, ShiftLDto>> ProjectToLDto => p38 => new ShiftLDto()
{ {
Title = p41.Title, Title = p38.Title,
Description = p41.Description, Description = p38.Description,
StartAt = p41.StartAt, StartAt = p38.StartAt,
EndAt = p41.EndAt, EndAt = p38.EndAt,
ComplexId = p41.ComplexId, ComplexId = p38.ComplexId,
Days = p41.Days.Select<ShiftDay, DayOfWeek>(d => d.DayOfWeek).ToList<DayOfWeek>(), Days = p38.Days.Select<ShiftDay, DayOfWeek>(d => d.DayOfWeek).ToList<DayOfWeek>(),
Routines = p41.Routines.Select<ShiftRoutine, ShiftRoutineSDto>(p42 => new ShiftRoutineSDto() Routines = p38.Routines.Select<ShiftRoutine, ShiftRoutineSDto>(p39 => new ShiftRoutineSDto()
{ {
RoutineId = p42.RoutineId, RoutineId = p39.RoutineId,
ShiftId = p42.ShiftId, ShiftId = p39.ShiftId,
Id = p42.Id Id = p39.Id
}).ToList<ShiftRoutineSDto>(), }).ToList<ShiftRoutineSDto>(),
Id = p41.Id Id = p38.Id
}; };
private static List<ShiftDay> funcMain1(List<DayOfWeek> p2) private static List<ShiftDay> funcMain1(List<DayOfWeek> p2)
@ -400,20 +383,20 @@ namespace Brizco.Domain.Mappers
} }
private static List<DayOfWeek> funcMain12(List<DayOfWeek> p33) private static List<DayOfWeek> funcMain12(List<DayOfWeek> p30)
{ {
if (p33 == null) if (p30 == null)
{ {
return null; return null;
} }
List<DayOfWeek> result = new List<DayOfWeek>(p33.Count); List<DayOfWeek> result = new List<DayOfWeek>(p30.Count);
int i = 0; int i = 0;
int len = p33.Count; int len = p30.Count;
while (i < len) while (i < len)
{ {
DayOfWeek item = p33[i]; DayOfWeek item = p30[i];
result.Add(item); result.Add(item);
i++; i++;
} }
@ -426,20 +409,20 @@ namespace Brizco.Domain.Mappers
return d.DayOfWeek; return d.DayOfWeek;
} }
private static List<ShiftRoutineSDto> funcMain14(List<ShiftRoutine> p34) private static List<ShiftRoutineSDto> funcMain14(List<ShiftRoutine> p31)
{ {
if (p34 == null) if (p31 == null)
{ {
return null; return null;
} }
List<ShiftRoutineSDto> result = new List<ShiftRoutineSDto>(p34.Count); List<ShiftRoutineSDto> result = new List<ShiftRoutineSDto>(p31.Count);
int i = 0; int i = 0;
int len = p34.Count; int len = p31.Count;
while (i < len) while (i < len)
{ {
ShiftRoutine item = p34[i]; ShiftRoutine item = p31[i];
result.Add(item == null ? null : new ShiftRoutineSDto() result.Add(item == null ? null : new ShiftRoutineSDto()
{ {
RoutineId = item.RoutineId, RoutineId = item.RoutineId,
@ -452,20 +435,20 @@ namespace Brizco.Domain.Mappers
} }
private static List<DayOfWeek> funcMain15(List<DayOfWeek> p37, List<DayOfWeek> p38) private static List<DayOfWeek> funcMain15(List<DayOfWeek> p34, List<DayOfWeek> p35)
{ {
if (p37 == null) if (p34 == null)
{ {
return null; return null;
} }
List<DayOfWeek> result = new List<DayOfWeek>(p37.Count); List<DayOfWeek> result = new List<DayOfWeek>(p34.Count);
int i = 0; int i = 0;
int len = p37.Count; int len = p34.Count;
while (i < len) while (i < len)
{ {
DayOfWeek item = p37[i]; DayOfWeek item = p34[i];
result.Add(item); result.Add(item);
i++; i++;
} }
@ -473,20 +456,20 @@ namespace Brizco.Domain.Mappers
} }
private static List<ShiftRoutineSDto> funcMain16(List<ShiftRoutine> p39, List<ShiftRoutineSDto> p40) private static List<ShiftRoutineSDto> funcMain16(List<ShiftRoutine> p36, List<ShiftRoutineSDto> p37)
{ {
if (p39 == null) if (p36 == null)
{ {
return null; return null;
} }
List<ShiftRoutineSDto> result = new List<ShiftRoutineSDto>(p39.Count); List<ShiftRoutineSDto> result = new List<ShiftRoutineSDto>(p36.Count);
int i = 0; int i = 0;
int len = p39.Count; int len = p36.Count;
while (i < len) while (i < len)
{ {
ShiftRoutine item = p39[i]; ShiftRoutine item = p36[i];
result.Add(item == null ? null : new ShiftRoutineSDto() result.Add(item == null ? null : new ShiftRoutineSDto()
{ {
RoutineId = item.RoutineId, RoutineId = item.RoutineId,

View File

@ -14,6 +14,7 @@ namespace Brizco.Domain.Mappers
{ {
return p1 == null ? null : new ShiftPlan() return p1 == null ? null : new ShiftPlan()
{ {
PlanFor = p1.PlanFor,
IsCompleted = p1.IsCompleted, IsCompleted = p1.IsCompleted,
CompletePercent = p1.CompletePercent, CompletePercent = p1.CompletePercent,
CompleteDescription = p1.CompleteDescription, CompleteDescription = p1.CompleteDescription,
@ -29,6 +30,7 @@ namespace Brizco.Domain.Mappers
} }
ShiftPlan result = p3 ?? new ShiftPlan(); ShiftPlan result = p3 ?? new ShiftPlan();
result.PlanFor = p2.PlanFor;
result.IsCompleted = p2.IsCompleted; result.IsCompleted = p2.IsCompleted;
result.CompletePercent = p2.CompletePercent; result.CompletePercent = p2.CompletePercent;
result.CompleteDescription = p2.CompleteDescription; result.CompleteDescription = p2.CompleteDescription;
@ -39,6 +41,7 @@ namespace Brizco.Domain.Mappers
} }
public static Expression<Func<ShiftPlanSDto, ShiftPlan>> ProjectToShiftPlan => p4 => new ShiftPlan() public static Expression<Func<ShiftPlanSDto, ShiftPlan>> ProjectToShiftPlan => p4 => new ShiftPlan()
{ {
PlanFor = p4.PlanFor,
IsCompleted = p4.IsCompleted, IsCompleted = p4.IsCompleted,
CompletePercent = p4.CompletePercent, CompletePercent = p4.CompletePercent,
CompleteDescription = p4.CompleteDescription, CompleteDescription = p4.CompleteDescription,
@ -49,6 +52,7 @@ namespace Brizco.Domain.Mappers
{ {
return p5 == null ? null : new ShiftPlanSDto() return p5 == null ? null : new ShiftPlanSDto()
{ {
PlanFor = p5.PlanFor,
IsCompleted = p5.IsCompleted, IsCompleted = p5.IsCompleted,
CompletePercent = p5.CompletePercent, CompletePercent = p5.CompletePercent,
CompleteDescription = p5.CompleteDescription, CompleteDescription = p5.CompleteDescription,
@ -65,6 +69,7 @@ namespace Brizco.Domain.Mappers
} }
ShiftPlanSDto result = p7 ?? new ShiftPlanSDto(); ShiftPlanSDto result = p7 ?? new ShiftPlanSDto();
result.PlanFor = p6.PlanFor;
result.IsCompleted = p6.IsCompleted; result.IsCompleted = p6.IsCompleted;
result.CompletePercent = p6.CompletePercent; result.CompletePercent = p6.CompletePercent;
result.CompleteDescription = p6.CompleteDescription; result.CompleteDescription = p6.CompleteDescription;
@ -76,6 +81,7 @@ namespace Brizco.Domain.Mappers
} }
public static Expression<Func<ShiftPlan, ShiftPlanSDto>> ProjectToSDto => p8 => new ShiftPlanSDto() public static Expression<Func<ShiftPlan, ShiftPlanSDto>> ProjectToSDto => p8 => new ShiftPlanSDto()
{ {
PlanFor = p8.PlanFor,
IsCompleted = p8.IsCompleted, IsCompleted = p8.IsCompleted,
CompletePercent = p8.CompletePercent, CompletePercent = p8.CompletePercent,
CompleteDescription = p8.CompleteDescription, CompleteDescription = p8.CompleteDescription,
@ -116,72 +122,55 @@ namespace Brizco.Domain.Mappers
return result; return result;
} }
public static Expression<Func<ShiftPlanLDto, ShiftPlan>> ProjectLDtoToShiftPlan => p15 => new ShiftPlan() public static ShiftPlanLDto AdaptToLDto(this ShiftPlan p15)
{ {
PlanFor = p15.PlanFor, return p15 == null ? null : new ShiftPlanLDto()
IsCompleted = p15.IsCompleted,
CompletePercent = p15.CompletePercent,
CompleteDescription = p15.CompleteDescription,
ShiftId = p15.ShiftId,
RoutineId = p15.RoutineId,
Users = p15.Users.Select<ShiftPlanUserSDto, ShiftPlanUser>(p16 => new ShiftPlanUser()
{ {
ShiftPlanId = p16.ShiftPlanId, PlanFor = p15.PlanFor,
PositionId = p16.PositionId, RoutineId = p15.RoutineId,
UserId = p16.UserId, IsCompleted = p15.IsCompleted,
Id = p16.Id CompletePercent = p15.CompletePercent,
}).ToList<ShiftPlanUser>(), CompleteDescription = p15.CompleteDescription,
Id = p15.Id ShiftId = p15.ShiftId,
}; Users = funcMain3(p15.Users),
public static ShiftPlanLDto AdaptToLDto(this ShiftPlan p17) Id = p15.Id
{
return p17 == null ? null : new ShiftPlanLDto()
{
PlanFor = p17.PlanFor,
RoutineId = p17.RoutineId,
IsCompleted = p17.IsCompleted,
CompletePercent = p17.CompletePercent,
CompleteDescription = p17.CompleteDescription,
ShiftId = p17.ShiftId,
Users = funcMain3(p17.Users),
Id = p17.Id
}; };
} }
public static ShiftPlanLDto AdaptTo(this ShiftPlan p19, ShiftPlanLDto p20) public static ShiftPlanLDto AdaptTo(this ShiftPlan p17, ShiftPlanLDto p18)
{ {
if (p19 == null) if (p17 == null)
{ {
return null; return null;
} }
ShiftPlanLDto result = p20 ?? new ShiftPlanLDto(); ShiftPlanLDto result = p18 ?? new ShiftPlanLDto();
result.PlanFor = p19.PlanFor; result.PlanFor = p17.PlanFor;
result.RoutineId = p19.RoutineId; result.RoutineId = p17.RoutineId;
result.IsCompleted = p19.IsCompleted; result.IsCompleted = p17.IsCompleted;
result.CompletePercent = p19.CompletePercent; result.CompletePercent = p17.CompletePercent;
result.CompleteDescription = p19.CompleteDescription; result.CompleteDescription = p17.CompleteDescription;
result.ShiftId = p19.ShiftId; result.ShiftId = p17.ShiftId;
result.Users = funcMain4(p19.Users, result.Users); result.Users = funcMain4(p17.Users, result.Users);
result.Id = p19.Id; result.Id = p17.Id;
return result; return result;
} }
public static Expression<Func<ShiftPlan, ShiftPlanLDto>> ProjectToLDto => p23 => new ShiftPlanLDto() public static Expression<Func<ShiftPlan, ShiftPlanLDto>> ProjectToLDto => p21 => new ShiftPlanLDto()
{ {
PlanFor = p23.PlanFor, PlanFor = p21.PlanFor,
RoutineId = p23.RoutineId, RoutineId = p21.RoutineId,
IsCompleted = p23.IsCompleted, IsCompleted = p21.IsCompleted,
CompletePercent = p23.CompletePercent, CompletePercent = p21.CompletePercent,
CompleteDescription = p23.CompleteDescription, CompleteDescription = p21.CompleteDescription,
ShiftId = p23.ShiftId, ShiftId = p21.ShiftId,
Users = p23.Users.Select<ShiftPlanUser, ShiftPlanUserSDto>(p24 => new ShiftPlanUserSDto() Users = p21.Users.Select<ShiftPlanUser, ShiftPlanUserSDto>(p22 => new ShiftPlanUserSDto()
{ {
ShiftPlanId = p24.ShiftPlanId, ShiftPlanId = p22.ShiftPlanId,
UserId = p24.UserId, UserId = p22.UserId,
PositionId = p24.PositionId, PositionId = p22.PositionId,
Id = p24.Id Id = p22.Id
}).ToList<ShiftPlanUserSDto>(), }).ToList<ShiftPlanUserSDto>(),
Id = p23.Id Id = p21.Id
}; };
private static List<ShiftPlanUser> funcMain1(List<ShiftPlanUserSDto> p10) private static List<ShiftPlanUser> funcMain1(List<ShiftPlanUserSDto> p10)
@ -238,20 +227,20 @@ namespace Brizco.Domain.Mappers
} }
private static List<ShiftPlanUserSDto> funcMain3(List<ShiftPlanUser> p18) private static List<ShiftPlanUserSDto> funcMain3(List<ShiftPlanUser> p16)
{ {
if (p18 == null) if (p16 == null)
{ {
return null; return null;
} }
List<ShiftPlanUserSDto> result = new List<ShiftPlanUserSDto>(p18.Count); List<ShiftPlanUserSDto> result = new List<ShiftPlanUserSDto>(p16.Count);
int i = 0; int i = 0;
int len = p18.Count; int len = p16.Count;
while (i < len) while (i < len)
{ {
ShiftPlanUser item = p18[i]; ShiftPlanUser item = p16[i];
result.Add(item == null ? null : new ShiftPlanUserSDto() result.Add(item == null ? null : new ShiftPlanUserSDto()
{ {
ShiftPlanId = item.ShiftPlanId, ShiftPlanId = item.ShiftPlanId,
@ -265,20 +254,20 @@ namespace Brizco.Domain.Mappers
} }
private static List<ShiftPlanUserSDto> funcMain4(List<ShiftPlanUser> p21, List<ShiftPlanUserSDto> p22) private static List<ShiftPlanUserSDto> funcMain4(List<ShiftPlanUser> p19, List<ShiftPlanUserSDto> p20)
{ {
if (p21 == null) if (p19 == null)
{ {
return null; return null;
} }
List<ShiftPlanUserSDto> result = new List<ShiftPlanUserSDto>(p21.Count); List<ShiftPlanUserSDto> result = new List<ShiftPlanUserSDto>(p19.Count);
int i = 0; int i = 0;
int len = p21.Count; int len = p19.Count;
while (i < len) while (i < len)
{ {
ShiftPlanUser item = p21[i]; ShiftPlanUser item = p19[i];
result.Add(item == null ? null : new ShiftPlanUserSDto() result.Add(item == null ? null : new ShiftPlanUserSDto()
{ {
ShiftPlanId = item.ShiftPlanId, ShiftPlanId = item.ShiftPlanId,

View File

@ -186,122 +186,86 @@ namespace Brizco.Domain.Mappers
return result; return result;
} }
public static Expression<Func<TaskLDto, Task>> ProjectLDtoToTask => p47 => new Task() public static TaskLDto AdaptToLDto(this Task p47)
{ {
Type = p47.Type, return p47 == null ? null : new TaskLDto()
Title = p47.Title,
Description = p47.Description,
IsDisposable = p47.IsDisposable,
SetFor = Convert.ToDateTime(p47.SetFor),
HasDisposed = p47.HasDisposed,
ScheduleType = p47.ScheduleType,
Amount = p47.Amount,
AmountType = p47.AmountType,
Shifts = p47.Shifts.Select<TaskShiftSDto, TaskShift>(p48 => new TaskShift()
{ {
TaskId = p48.TaskId, Type = p47.Type,
ShiftId = p48.ShiftId Title = p47.Title,
}).ToList<TaskShift>(), Description = p47.Description,
Days = p47.Days.Select<TaskDaySDto, TaskDay>(p49 => new TaskDay() IsDisposable = p47.IsDisposable,
{ SetFor = DateTimeExtensions.DateTimeToUnixTimeStamp(p47.SetFor),
DayOfWeek = p49.DayOfWeek, HasDisposed = p47.HasDisposed,
TaskId = p49.TaskId, ScheduleType = p47.ScheduleType,
Id = p49.Id Amount = p47.Amount,
}).ToList<TaskDay>(), AmountType = p47.AmountType,
Routines = p47.Routines.Select<TaskRoutineSDto, TaskRoutine>(p50 => new TaskRoutine() Shifts = funcMain25(p47.Shifts),
{ Positions = funcMain26(p47.Positions),
TaskId = p50.TaskId, Days = funcMain27(p47.Days),
RoutineId = p50.RoutineId, Routines = funcMain28(p47.Routines),
Id = p50.Id Id = p47.Id
}).ToList<TaskRoutine>(),
Positions = p47.Positions.Select<TaskPositionSDto, TaskPosition>(p51 => new TaskPosition()
{
PositionId = p51.PositionId,
TaskId = p51.TaskId,
Id = p51.Id
}).ToList<TaskPosition>(),
Id = p47.Id
};
public static TaskLDto AdaptToLDto(this Task p52)
{
return p52 == null ? null : new TaskLDto()
{
Type = p52.Type,
Title = p52.Title,
Description = p52.Description,
IsDisposable = p52.IsDisposable,
SetFor = DateTimeExtensions.DateTimeToUnixTimeStamp(p52.SetFor),
HasDisposed = p52.HasDisposed,
ScheduleType = p52.ScheduleType,
Amount = p52.Amount,
AmountType = p52.AmountType,
Shifts = funcMain25(p52.Shifts),
Positions = funcMain26(p52.Positions),
Days = funcMain27(p52.Days),
Routines = funcMain28(p52.Routines),
Id = p52.Id
}; };
} }
public static TaskLDto AdaptTo(this Task p57, TaskLDto p58) public static TaskLDto AdaptTo(this Task p52, TaskLDto p53)
{ {
if (p57 == null) if (p52 == null)
{ {
return null; return null;
} }
TaskLDto result = p58 ?? new TaskLDto(); TaskLDto result = p53 ?? new TaskLDto();
result.Type = p57.Type; result.Type = p52.Type;
result.Title = p57.Title; result.Title = p52.Title;
result.Description = p57.Description; result.Description = p52.Description;
result.IsDisposable = p57.IsDisposable; result.IsDisposable = p52.IsDisposable;
result.SetFor = DateTimeExtensions.DateTimeToUnixTimeStamp(p57.SetFor); result.SetFor = DateTimeExtensions.DateTimeToUnixTimeStamp(p52.SetFor);
result.HasDisposed = p57.HasDisposed; result.HasDisposed = p52.HasDisposed;
result.ScheduleType = p57.ScheduleType; result.ScheduleType = p52.ScheduleType;
result.Amount = p57.Amount; result.Amount = p52.Amount;
result.AmountType = p57.AmountType; result.AmountType = p52.AmountType;
result.Shifts = funcMain29(p57.Shifts, result.Shifts); result.Shifts = funcMain29(p52.Shifts, result.Shifts);
result.Positions = funcMain30(p57.Positions, result.Positions); result.Positions = funcMain30(p52.Positions, result.Positions);
result.Days = funcMain31(p57.Days, result.Days); result.Days = funcMain31(p52.Days, result.Days);
result.Routines = funcMain32(p57.Routines, result.Routines); result.Routines = funcMain32(p52.Routines, result.Routines);
result.Id = p57.Id; result.Id = p52.Id;
return result; return result;
} }
public static Expression<Func<Task, TaskLDto>> ProjectToLDto => p67 => new TaskLDto() public static Expression<Func<Task, TaskLDto>> ProjectToLDto => p62 => new TaskLDto()
{ {
Type = p67.Type, Type = p62.Type,
Title = p67.Title, Title = p62.Title,
Description = p67.Description, Description = p62.Description,
IsDisposable = p67.IsDisposable, IsDisposable = p62.IsDisposable,
SetFor = DateTimeExtensions.DateTimeToUnixTimeStamp(p67.SetFor), SetFor = DateTimeExtensions.DateTimeToUnixTimeStamp(p62.SetFor),
HasDisposed = p67.HasDisposed, HasDisposed = p62.HasDisposed,
ScheduleType = p67.ScheduleType, ScheduleType = p62.ScheduleType,
Amount = p67.Amount, Amount = p62.Amount,
AmountType = p67.AmountType, AmountType = p62.AmountType,
Shifts = p67.Shifts.Select<TaskShift, TaskShiftSDto>(p68 => new TaskShiftSDto() Shifts = p62.Shifts.Select<TaskShift, TaskShiftSDto>(p63 => new TaskShiftSDto()
{ {
ShiftId = p68.ShiftId, ShiftId = p63.ShiftId,
TaskId = p68.TaskId TaskId = p63.TaskId
}).ToList<TaskShiftSDto>(), }).ToList<TaskShiftSDto>(),
Positions = p67.Positions.Select<TaskPosition, TaskPositionSDto>(p69 => new TaskPositionSDto() Positions = p62.Positions.Select<TaskPosition, TaskPositionSDto>(p64 => new TaskPositionSDto()
{ {
PositionId = p69.PositionId, PositionId = p64.PositionId,
TaskId = p69.TaskId, TaskId = p64.TaskId,
Id = p69.Id Id = p64.Id
}).ToList<TaskPositionSDto>(), }).ToList<TaskPositionSDto>(),
Days = p67.Days.Select<TaskDay, TaskDaySDto>(p70 => new TaskDaySDto() Days = p62.Days.Select<TaskDay, TaskDaySDto>(p65 => new TaskDaySDto()
{ {
DayOfWeek = p70.DayOfWeek, DayOfWeek = p65.DayOfWeek,
TaskId = p70.TaskId, TaskId = p65.TaskId,
Id = p70.Id Id = p65.Id
}).ToList<TaskDaySDto>(), }).ToList<TaskDaySDto>(),
Routines = p67.Routines.Select<TaskRoutine, TaskRoutineSDto>(p71 => new TaskRoutineSDto() Routines = p62.Routines.Select<TaskRoutine, TaskRoutineSDto>(p66 => new TaskRoutineSDto()
{ {
TaskId = p71.TaskId, TaskId = p66.TaskId,
RoutineId = p71.RoutineId, RoutineId = p66.RoutineId,
Id = p71.Id Id = p66.Id
}).ToList<TaskRoutineSDto>(), }).ToList<TaskRoutineSDto>(),
Id = p67.Id Id = p62.Id
}; };
private static List<TaskShift> funcMain1(List<string> p2) private static List<TaskShift> funcMain1(List<string> p2)
@ -774,20 +738,20 @@ namespace Brizco.Domain.Mappers
} }
private static List<TaskShiftSDto> funcMain25(List<TaskShift> p53) private static List<TaskShiftSDto> funcMain25(List<TaskShift> p48)
{ {
if (p53 == null) if (p48 == null)
{ {
return null; return null;
} }
List<TaskShiftSDto> result = new List<TaskShiftSDto>(p53.Count); List<TaskShiftSDto> result = new List<TaskShiftSDto>(p48.Count);
int i = 0; int i = 0;
int len = p53.Count; int len = p48.Count;
while (i < len) while (i < len)
{ {
TaskShift item = p53[i]; TaskShift item = p48[i];
result.Add(item == null ? null : new TaskShiftSDto() result.Add(item == null ? null : new TaskShiftSDto()
{ {
ShiftId = item.ShiftId, ShiftId = item.ShiftId,
@ -799,20 +763,20 @@ namespace Brizco.Domain.Mappers
} }
private static List<TaskPositionSDto> funcMain26(List<TaskPosition> p54) private static List<TaskPositionSDto> funcMain26(List<TaskPosition> p49)
{ {
if (p54 == null) if (p49 == null)
{ {
return null; return null;
} }
List<TaskPositionSDto> result = new List<TaskPositionSDto>(p54.Count); List<TaskPositionSDto> result = new List<TaskPositionSDto>(p49.Count);
int i = 0; int i = 0;
int len = p54.Count; int len = p49.Count;
while (i < len) while (i < len)
{ {
TaskPosition item = p54[i]; TaskPosition item = p49[i];
result.Add(item == null ? null : new TaskPositionSDto() result.Add(item == null ? null : new TaskPositionSDto()
{ {
PositionId = item.PositionId, PositionId = item.PositionId,
@ -825,20 +789,20 @@ namespace Brizco.Domain.Mappers
} }
private static List<TaskDaySDto> funcMain27(List<TaskDay> p55) private static List<TaskDaySDto> funcMain27(List<TaskDay> p50)
{ {
if (p55 == null) if (p50 == null)
{ {
return null; return null;
} }
List<TaskDaySDto> result = new List<TaskDaySDto>(p55.Count); List<TaskDaySDto> result = new List<TaskDaySDto>(p50.Count);
int i = 0; int i = 0;
int len = p55.Count; int len = p50.Count;
while (i < len) while (i < len)
{ {
TaskDay item = p55[i]; TaskDay item = p50[i];
result.Add(item == null ? null : new TaskDaySDto() result.Add(item == null ? null : new TaskDaySDto()
{ {
DayOfWeek = item.DayOfWeek, DayOfWeek = item.DayOfWeek,
@ -851,20 +815,20 @@ namespace Brizco.Domain.Mappers
} }
private static List<TaskRoutineSDto> funcMain28(List<TaskRoutine> p56) private static List<TaskRoutineSDto> funcMain28(List<TaskRoutine> p51)
{ {
if (p56 == null) if (p51 == null)
{ {
return null; return null;
} }
List<TaskRoutineSDto> result = new List<TaskRoutineSDto>(p56.Count); List<TaskRoutineSDto> result = new List<TaskRoutineSDto>(p51.Count);
int i = 0; int i = 0;
int len = p56.Count; int len = p51.Count;
while (i < len) while (i < len)
{ {
TaskRoutine item = p56[i]; TaskRoutine item = p51[i];
result.Add(item == null ? null : new TaskRoutineSDto() result.Add(item == null ? null : new TaskRoutineSDto()
{ {
TaskId = item.TaskId, TaskId = item.TaskId,
@ -877,20 +841,20 @@ namespace Brizco.Domain.Mappers
} }
private static List<TaskShiftSDto> funcMain29(List<TaskShift> p59, List<TaskShiftSDto> p60) private static List<TaskShiftSDto> funcMain29(List<TaskShift> p54, List<TaskShiftSDto> p55)
{ {
if (p59 == null) if (p54 == null)
{ {
return null; return null;
} }
List<TaskShiftSDto> result = new List<TaskShiftSDto>(p59.Count); List<TaskShiftSDto> result = new List<TaskShiftSDto>(p54.Count);
int i = 0; int i = 0;
int len = p59.Count; int len = p54.Count;
while (i < len) while (i < len)
{ {
TaskShift item = p59[i]; TaskShift item = p54[i];
result.Add(item == null ? null : new TaskShiftSDto() result.Add(item == null ? null : new TaskShiftSDto()
{ {
ShiftId = item.ShiftId, ShiftId = item.ShiftId,
@ -902,20 +866,20 @@ namespace Brizco.Domain.Mappers
} }
private static List<TaskPositionSDto> funcMain30(List<TaskPosition> p61, List<TaskPositionSDto> p62) private static List<TaskPositionSDto> funcMain30(List<TaskPosition> p56, List<TaskPositionSDto> p57)
{ {
if (p61 == null) if (p56 == null)
{ {
return null; return null;
} }
List<TaskPositionSDto> result = new List<TaskPositionSDto>(p61.Count); List<TaskPositionSDto> result = new List<TaskPositionSDto>(p56.Count);
int i = 0; int i = 0;
int len = p61.Count; int len = p56.Count;
while (i < len) while (i < len)
{ {
TaskPosition item = p61[i]; TaskPosition item = p56[i];
result.Add(item == null ? null : new TaskPositionSDto() result.Add(item == null ? null : new TaskPositionSDto()
{ {
PositionId = item.PositionId, PositionId = item.PositionId,
@ -928,20 +892,20 @@ namespace Brizco.Domain.Mappers
} }
private static List<TaskDaySDto> funcMain31(List<TaskDay> p63, List<TaskDaySDto> p64) private static List<TaskDaySDto> funcMain31(List<TaskDay> p58, List<TaskDaySDto> p59)
{ {
if (p63 == null) if (p58 == null)
{ {
return null; return null;
} }
List<TaskDaySDto> result = new List<TaskDaySDto>(p63.Count); List<TaskDaySDto> result = new List<TaskDaySDto>(p58.Count);
int i = 0; int i = 0;
int len = p63.Count; int len = p58.Count;
while (i < len) while (i < len)
{ {
TaskDay item = p63[i]; TaskDay item = p58[i];
result.Add(item == null ? null : new TaskDaySDto() result.Add(item == null ? null : new TaskDaySDto()
{ {
DayOfWeek = item.DayOfWeek, DayOfWeek = item.DayOfWeek,
@ -954,20 +918,20 @@ namespace Brizco.Domain.Mappers
} }
private static List<TaskRoutineSDto> funcMain32(List<TaskRoutine> p65, List<TaskRoutineSDto> p66) private static List<TaskRoutineSDto> funcMain32(List<TaskRoutine> p60, List<TaskRoutineSDto> p61)
{ {
if (p65 == null) if (p60 == null)
{ {
return null; return null;
} }
List<TaskRoutineSDto> result = new List<TaskRoutineSDto>(p65.Count); List<TaskRoutineSDto> result = new List<TaskRoutineSDto>(p60.Count);
int i = 0; int i = 0;
int len = p65.Count; int len = p60.Count;
while (i < len) while (i < len)
{ {
TaskRoutine item = p65[i]; TaskRoutine item = p60[i];
result.Add(item == null ? null : new TaskRoutineSDto() result.Add(item == null ? null : new TaskRoutineSDto()
{ {
TaskId = item.TaskId, TaskId = item.TaskId,

View File

@ -16,6 +16,7 @@ public class MapsterRegister : IRegister
config.NewConfig<Activity, ActivitySDto>() config.NewConfig<Activity, ActivitySDto>()
.Map("UserFirstName", o => o.User !=null ? o.User.FirstName : string.Empty) .Map("UserFirstName", o => o.User !=null ? o.User.FirstName : string.Empty)
.Map("UserLastName", o => o.User != null ? o.User.LastName : string.Empty) .Map("UserLastName", o => o.User != null ? o.User.LastName : string.Empty)
.Map("ShiftTitle",o=>o.Shift != null ? o.Shift.Title : string.Empty)
.TwoWays(); .TwoWays();
config.NewConfig<Task, TaskLDto>() config.NewConfig<Task, TaskLDto>()

View File

@ -47,7 +47,9 @@ public class GetShiftPlansQueryHandler : IRequestHandler<GetShiftsQuery, List<Sh
var existedShiftPlan = await _repositoryWrapper.SetRepository<Domain.Entities.Shift.ShiftPlan>() var existedShiftPlan = await _repositoryWrapper.SetRepository<Domain.Entities.Shift.ShiftPlan>()
.TableNoTracking .TableNoTracking
.FirstOrDefaultAsync(s => s.ShiftId == shift.Id && s.PlanFor.Date == selectedDate.Date, cancellationToken); .FirstOrDefaultAsync(s => s.ShiftId == shift.Id && s.PlanFor.Date == selectedDate.Date, cancellationToken);
shift.IsCompleted = existedShiftPlan is { IsCompleted : true }; shift.IsCompleted = existedShiftPlan?.IsCompleted ?? false;
shift.CurrentShiftPlanId = existedShiftPlan?.Id ?? default;
shift.HasCurrentShiftPlan = existedShiftPlan != null;
} }
} }
else else