diff --git a/AccountManagement.Application/CameraAccountApplication.cs b/AccountManagement.Application/CameraAccountApplication.cs index b926f06b..27aac649 100644 --- a/AccountManagement.Application/CameraAccountApplication.cs +++ b/AccountManagement.Application/CameraAccountApplication.cs @@ -33,8 +33,8 @@ public class CameraAccountApplication : ICameraAccountApplication return opreation.Failed("نام کاربری تکراری است"); if (command.Password.Length < 8) return opreation.Failed("گذرواژه نباید کمتر از 8 کاراکتر باشد"); - if (command.Username.Length < 8) - return opreation.Failed("نام کاربری نباید کمتر از 8 کاراکتر باشد"); + if (command.Username.Length < 6) + return opreation.Failed("نام کاربری نباید کمتر از 6 کاراکتر باشد"); var password = _passwordHasher.Hash(command.Password); var create = new CameraAccount(command.Username, password, command.Mobile, command.WorkshopName, command.WorkshopId, command.AccountId); diff --git a/CompanyManagment.Application/LeftWorkApplication.cs b/CompanyManagment.Application/LeftWorkApplication.cs index 82a96824..0abe9603 100644 --- a/CompanyManagment.Application/LeftWorkApplication.cs +++ b/CompanyManagment.Application/LeftWorkApplication.cs @@ -604,7 +604,7 @@ public class LeftWorkApplication : ILeftWorkApplication { EmployeeId = employeeId, WorkshopId = x.Key, - LeftWorkDateGr = leftWork.LeftWorkDateGr, + LeftWorkDateGr = leftWork.LeftWorkDateGr.Date.AddDays(-1), StartWorkDateGr = leftWork.StartWorkDateGr }; }).ToList(); @@ -618,7 +618,7 @@ public class LeftWorkApplication : ILeftWorkApplication x.WorkshopId, x.EmployeeId, y.LeftWorkDateGr, - Status = x.Statuses.OrderByDescending(z => z.StartDate).FirstOrDefault(z => z.StartDateGr < y.LeftWorkDateGr && z.EndDateGr > y.LeftWorkDateGr) + Status = x.Statuses.OrderByDescending(z => z.StartDate).FirstOrDefault(z => z.StartDateGr.Date < y.LeftWorkDateGr && z.EndDateGr.Date > y.LeftWorkDateGr) }); //shaping up the list to send as parameter to repository diff --git a/CompanyManagment.EFCore/Repository/RollCallEmployeeStatusRepository.cs b/CompanyManagment.EFCore/Repository/RollCallEmployeeStatusRepository.cs index 4f7ec525..0a84fdd3 100644 --- a/CompanyManagment.EFCore/Repository/RollCallEmployeeStatusRepository.cs +++ b/CompanyManagment.EFCore/Repository/RollCallEmployeeStatusRepository.cs @@ -43,14 +43,14 @@ namespace CompanyManagment.EFCore.Repository //get the statuses which have higher end date than employee's leftwork - finalList.Where(x => command.Any(y => !y.LeaveDate.IsDateUndefined() && y.LeaveDate.AddDays(-1).Date < x.EndDate.Date)).ToList().ForEach( + finalList.Where(x => command.Any(y => !y.LeaveDate.IsDateUndefined() && y.LeaveDate.Date < x.EndDate.Date)).ToList().ForEach( z => { var cmd = command.FirstOrDefault(y => y.RollCallStatusId == z.id); - if (cmd!.LeaveDate.Date.AddDays(-1) > z.StartDate.Date) + if (cmd!.LeaveDate.Date > z.StartDate.Date) { - z.Edit(z.StartDate, cmd!.LeaveDate.Date.AddDays(-1)); + z.Edit(z.StartDate, cmd!.LeaveDate.Date); } } ); diff --git a/ServiceHost/Areas/Client/Pages/Company/RollCall/Index.cshtml.cs b/ServiceHost/Areas/Client/Pages/Company/RollCall/Index.cshtml.cs index 9c5eae1f..6782bb77 100644 --- a/ServiceHost/Areas/Client/Pages/Company/RollCall/Index.cshtml.cs +++ b/ServiceHost/Areas/Client/Pages/Company/RollCall/Index.cshtml.cs @@ -127,9 +127,6 @@ namespace ServiceHost.Areas.Client.Pages.Company.RollCall string finalMessage = ""; using (var transaction = new TransactionScope()) { - //OperationResult resultAccount = new OperationResult(); - //OperationResult resultWorkshopSetting = new OperationResult(); - if (!command.HasCamera) {