diff --git a/0_Framework/Application/OperationResult.cs b/0_Framework/Application/OperationResult.cs index 88c9b659..f37172bb 100644 --- a/0_Framework/Application/OperationResult.cs +++ b/0_Framework/Application/OperationResult.cs @@ -30,4 +30,25 @@ public class OperationResult } +} + +public class OperationResult +{ + public T Data { get; set; } + public bool IsSuccedded { get; set; } + public string Message { get; set; } + + public OperationResult Succcedded(T data, string message = "عملیات با موفقیت انجام شد") + { + IsSuccedded = true; + Message = message; + Data = data; + return this; + } + public OperationResult Failed(string message) + { + IsSuccedded = false; + Message = message; + return this; + } } \ No newline at end of file diff --git a/Company.Domain/LeaveAgg/ILeaveRepository.cs b/Company.Domain/LeaveAgg/ILeaveRepository.cs index 403de39f..da1d27ef 100644 --- a/Company.Domain/LeaveAgg/ILeaveRepository.cs +++ b/Company.Domain/LeaveAgg/ILeaveRepository.cs @@ -11,6 +11,14 @@ public interface ILeaveRepository : IRepository EditLeave GetDetails(long id); List search(LeaveSearchModel searchModel); OperationResult RemoveLeave(long id); + + #region Pooya + /// + /// چک می کند که آیا پرسنل مرخصی روزانه استحقاقی دارد یا خیر + /// + bool HasLeave(long employeeId, long workshopId, DateTime date); + #endregion + bool CheckContractExist(DateTime myDate,long employeeId, long workshopId); LeavErrorViewModel CheckErrors(DateTime startLeav, DateTime endLeav, long employeeId, long workshopId); diff --git a/Company.Domain/RollCallAgg/IRollCallRepository.cs b/Company.Domain/RollCallAgg/IRollCallRepository.cs index 6392b8e8..05f93d17 100644 --- a/Company.Domain/RollCallAgg/IRollCallRepository.cs +++ b/Company.Domain/RollCallAgg/IRollCallRepository.cs @@ -13,13 +13,27 @@ namespace Company.Domain.RollCallAgg { EditRollCall GetByEmployeeIdAndWorkshopId(long employeeId, long workshopId); EditRollCall GetById(long id); - RollCallsByDateViewModel GetWorkshopRollCallHistory(RollCallSearchModel searchModel); + List Search(RollCallSearchModel searchModel); + + + + + #region Pooya + void RemoveEmployeeRollCallsInDate(long workshopId, long employeeId, DateTime date); + RollCallsByDateViewModel GetWorkshopRollCallHistory(RollCallSearchModel searchModel); CurrentDayRollCall GetWorkshopCurrentDayRollCalls(long workshopId); List GetEmployeeRollCallsForMonth(long employeeId, long workshopId, DateTime startDate, DateTime endDate); + EmployeeRollCallsByMonthViewModel GetEmployeeRollCallsHistory(long employeeId, long workshopId, - DateTime? startDateTime, DateTime? endDateTime, DateTime? exactDateTime, DateTime? monthIndex); - long Flag(long employeeId, long workshopId); + DateTime? startDateTime, DateTime? endDateTime, DateTime? exactDateTime, DateTime? monthIndex); + + void AddRange(List rollCalls); + + + List GetWorkshopEmployeeRollCallsForDate(long workshopId, long employeeId, DateTime date); + #endregion + long Flag(long employeeId, long workshopId); } diff --git a/Company.Domain/RollCallEmployeeAgg/IRollCallEmployeeRepository.cs b/Company.Domain/RollCallEmployeeAgg/IRollCallEmployeeRepository.cs index 3d6550be..a3956bba 100644 --- a/Company.Domain/RollCallEmployeeAgg/IRollCallEmployeeRepository.cs +++ b/Company.Domain/RollCallEmployeeAgg/IRollCallEmployeeRepository.cs @@ -15,12 +15,20 @@ public interface IRollCallEmployeeRepository : IRepository GetRollCallEmployeesByWorkshopId(long workshopId); List GetByEmployeeIdWithStatuses(long employeeId); - bool HasEmployees(long workshopId); + List GetActivePersonnelByWorkshopId(long workshopId); List GetEmployeeRollCalls(long workshopId); List GetPersonnelRollCallListAll(long workshopId); #endregion + + #region Farokhi&Mahan + + bool HasEmployees(long workshopId); + (int activeEmployees, int deActiveEmployees) GetActiveAndDeActiveRollCallEmployees(long workshopId); + + #endregion + } \ No newline at end of file diff --git a/Company.Domain/RollCallEmployeeStatusAgg/IRollCallEmployeeStatusRepository.cs b/Company.Domain/RollCallEmployeeStatusAgg/IRollCallEmployeeStatusRepository.cs index d525da41..158b30b0 100644 --- a/Company.Domain/RollCallEmployeeStatusAgg/IRollCallEmployeeStatusRepository.cs +++ b/Company.Domain/RollCallEmployeeStatusAgg/IRollCallEmployeeStatusRepository.cs @@ -1,6 +1,7 @@ using _0_Framework.Domain; using CompanyManagment.App.Contracts.RollCallEmployee; using CompanyManagment.App.Contracts.RollCallEmployeeStatus; +using System; using System.Collections.Generic; namespace Company.Domain.RollCallEmployeeStatusAgg @@ -8,6 +9,18 @@ namespace Company.Domain.RollCallEmployeeStatusAgg public interface IRollCallEmployeeStatusRepository : IRepository { List GetAll(); - void AdjustRollCallStatusEndDates(List command); - } + /// + /// تغییر بازه فعالیت هنگام ترک کار پرسنل + /// + /// + /// + void AdjustRollCallStatusEndDates(List command); + /// + /// دریافت وضعیت حضور غیاب پرسنل در تاریخ مشخص + /// + /// + /// + /// + RollCallEmployeeStatus GetByRollCallEmployeeIdAndDate(long rollCallEmployeeId, DateTime date); + } } diff --git a/CompanyManagment.App.Contracts/Leave/ILeaveApplication.cs b/CompanyManagment.App.Contracts/Leave/ILeaveApplication.cs index 209953ff..84779071 100644 --- a/CompanyManagment.App.Contracts/Leave/ILeaveApplication.cs +++ b/CompanyManagment.App.Contracts/Leave/ILeaveApplication.cs @@ -26,4 +26,5 @@ public interface ILeaveApplication #endregion bool CheckIfValidToEdit(long id); + OperationResult HasLeave(long workshopId, long employeeId, string dateFa); } \ No newline at end of file diff --git a/CompanyManagment.App.Contracts/RollCall/CreateOrEditEmployeeRollCall.cs b/CompanyManagment.App.Contracts/RollCall/CreateOrEditEmployeeRollCall.cs new file mode 100644 index 00000000..8f30fd1b --- /dev/null +++ b/CompanyManagment.App.Contracts/RollCall/CreateOrEditEmployeeRollCall.cs @@ -0,0 +1,14 @@ +using System.Collections.Generic; + +namespace CompanyManagment.App.Contracts.RollCall +{ + public class CreateOrEditEmployeeRollCall + { + public long EmployeeId { get; set; } + public long WorkshopId { get; set; } + public string DateFa { get; set; } + public List RollCallRecords { get; set; } + } +} + + diff --git a/CompanyManagment.App.Contracts/RollCall/EmployeeRollCallRecord.cs b/CompanyManagment.App.Contracts/RollCall/EmployeeRollCallRecord.cs new file mode 100644 index 00000000..e1bb27c4 --- /dev/null +++ b/CompanyManagment.App.Contracts/RollCall/EmployeeRollCallRecord.cs @@ -0,0 +1,12 @@ +using System; + +namespace CompanyManagment.App.Contracts.RollCall +{ + public class EmployeeRollCallRecord + { + public long RollCallId { get; set; } + public DateTime Date { get; set; } + public string StartTime { get; set; } + public string EndTime { get; set; } + } +} \ No newline at end of file diff --git a/CompanyManagment.App.Contracts/RollCall/EmployeeRollCallsViewModel.cs b/CompanyManagment.App.Contracts/RollCall/EmployeeRollCallsViewModel.cs new file mode 100644 index 00000000..71ac7bef --- /dev/null +++ b/CompanyManagment.App.Contracts/RollCall/EmployeeRollCallsViewModel.cs @@ -0,0 +1,14 @@ + + +using System.Collections.Generic; + +namespace CompanyManagment.App.Contracts.RollCall +{ + public class EmployeeRollCallsViewModel + { + public long EmployeeId { get; set; } + public string EmployeeFullName { get; set; } + public string DateFa { get; set; } + public List RollCalls { get; set; } + } +} diff --git a/CompanyManagment.App.Contracts/RollCall/IRollCallApplication.cs b/CompanyManagment.App.Contracts/RollCall/IRollCallApplication.cs index 07463742..a372a7ae 100644 --- a/CompanyManagment.App.Contracts/RollCall/IRollCallApplication.cs +++ b/CompanyManagment.App.Contracts/RollCall/IRollCallApplication.cs @@ -13,16 +13,59 @@ namespace CompanyManagment.App.Contracts.RollCall OperationResult Edit(long id); EditRollCall GetByEmployeeIdAndWorkshopId(long employeeId, long workshopId); - List GetActiveEmployeeRollCallsForDuration(long employeeId, long workshopId, - string startDate, string endDate); - EmployeeRollCallsByMonthViewModel GetEmployeeRollCallsHistory(long employeeId, long workshopId, - string startDateTime, string endDateTime, string exactDateTime, string dateIndex); + + EditRollCall GetById(long id); List Search(RollCallSearchModel searchModel); - CurrentDayRollCall GetWorkshopCurrentDayRollCalls(long workshopId); - RollCallsByDateViewModel GetWorkshopRollCallHistory(RollCallSearchModel searchModel); + + long Flag(long employeeId, long workshopId); + + #region Pooya + + OperationResult RemoveEmployeeRollCallsInDate(long workshopId, long employeeId, string dateFa); + /// + /// برای صدور فیش حقوقی + /// + List GetActiveEmployeeRollCallsForDuration(long employeeId, long workshopId, + string startDate, string endDate); + + + /// + /// برای دریافت سوابق حضور غیاب پرسنل انتخاب شده بر اساس ماه + /// + /// پرسنل مورد نظر + /// کارگاه مورد نظر + /// شروع بازه جستجو، می تواند خالی باشد + /// پایان بازه جستجو، می تواند خالی باشد + /// جستجو بر اساس مقطع زمانی، میتواند خالی باشد + /// با اسکرول کاربر این مقدار افزایش پیدا می کند + EmployeeRollCallsByMonthViewModel GetEmployeeRollCallsHistory(long employeeId, long workshopId, + string startDateTime, string endDateTime, string exactDateTime, string dateIndex); + + + /// + /// گزارش آنلاین حضور غیاب + /// + CurrentDayRollCall GetWorkshopCurrentDayRollCalls(long workshopId); + + /// + /// گزارش آفلاین حضور غیاب کارگاه + /// + RollCallsByDateViewModel GetWorkshopRollCallHistory(RollCallSearchModel searchModel); + + /// + /// دریافت لیست حضور غیاب کارمند در تاریخ مشخص + /// + List GetWorkshopEmployeeRollCallsForDate(long workshopId, long employeeId, string date); + + /// + /// اضافه کردن یا ویرایش دستی حضور غیاب + /// + OperationResult ManualEdit(CreateOrEditEmployeeRollCall command); + + #endregion } } diff --git a/CompanyManagment.App.Contracts/RollCall/RollCallViewModel.cs b/CompanyManagment.App.Contracts/RollCall/RollCallViewModel.cs index b331ea80..89562c65 100644 --- a/CompanyManagment.App.Contracts/RollCall/RollCallViewModel.cs +++ b/CompanyManagment.App.Contracts/RollCall/RollCallViewModel.cs @@ -30,4 +30,6 @@ public class RollCallViewModel public bool HasLeave { get; set; } public string DayOfWeekFa { get; set; } public bool IsHoliday { get; set; } + public string EndTimeString { get; set; } + public string StartTimeString { get; set; } } \ No newline at end of file diff --git a/CompanyManagment.App.Contracts/RollCallEmployee/IRollCallEmployeeApplication.cs b/CompanyManagment.App.Contracts/RollCallEmployee/IRollCallEmployeeApplication.cs index 1c77df2f..f0eb2718 100644 --- a/CompanyManagment.App.Contracts/RollCallEmployee/IRollCallEmployeeApplication.cs +++ b/CompanyManagment.App.Contracts/RollCallEmployee/IRollCallEmployeeApplication.cs @@ -1,5 +1,6 @@ using _0_Framework.Application; using System.Collections.Generic; +using System.Linq; namespace CompanyManagment.App.Contracts.RollCallEmployee; @@ -8,7 +9,7 @@ public interface IRollCallEmployeeApplication OperationResult Create(CreateRollCallEmployee command); OperationResult Active(long id); OperationResult DeActive(long id); - OperationResult UploadedImage(long Employeeid,long WorkshopId); + OperationResult UploadedImage(long Employeeid, long WorkshopId); List GetByWorkshopId(long workshopId); EditRollCallEmployee GetDetails(long id); RollCallEmployeeViewModel GetByEmployeeIdAndWorkshopId(long employeeId, long workshopId); @@ -16,12 +17,25 @@ public interface IRollCallEmployeeApplication List GetActivePersonnelByWorkshopId(long workshopId); bool IsEmployeeRollCallActive(long employeeId, long workshopId); int activedPerson(long workshopId); + #region pooya + /// + /// دریافت لیست پرسنل کارگاه برای حضور غیاب دستی + /// + List GetRollCallEmployeesByWorkshopId(long workshopId); + List GetEmployeeRollCalls(long workshopId); - List GetPersonnelRollCallListAll(long workshopId); + //List GetPersonnelRollCallListAll(long workshopId); + + OperationResult ChangeEmployeeRollCallName(long rollCallEmployeeId, string fName, string lName); + + #endregion + + #region Farpkhi&Mahan + (int activeEmployees, int deActiveEmployees) GetActiveAndDeActiveRollCallEmployees(long workshopId); bool HasEmployees(long workshopId); #endregion } \ No newline at end of file diff --git a/CompanyManagment.Application/InsuranceListApplication.cs b/CompanyManagment.Application/InsuranceListApplication.cs index 45c6c881..a1e0c34d 100644 --- a/CompanyManagment.Application/InsuranceListApplication.cs +++ b/CompanyManagment.Application/InsuranceListApplication.cs @@ -544,9 +544,9 @@ public class InsuranceListApplication: IInsuranceListApplication switch (item.EmployeeId) { - case 3812://ثابت - countWorkingDays = 15; - break; + //case 3812://ثابت- کسری حاجی پور + // countWorkingDays = 15; + // break; case 40463://ثابت countWorkingDays = 10; break; @@ -1488,9 +1488,9 @@ public class InsuranceListApplication: IInsuranceListApplication switch (item.EmployeeId) { - case 3812://ثابت - countWorkingDays = 15; - break; + //case 3812://ثابت + // countWorkingDays = 15; + // break; case 40463://ثابت countWorkingDays = 10; break; @@ -1622,8 +1622,6 @@ public class InsuranceListApplication: IInsuranceListApplication return result; } - - #endregion //farokhiChanges public (double basic, int totalYear) BasicYear(long employeeId, long worshopId, DateTime startDate) diff --git a/CompanyManagment.Application/LeaveApplication.cs b/CompanyManagment.Application/LeaveApplication.cs index 21b21a90..490822cd 100644 --- a/CompanyManagment.Application/LeaveApplication.cs +++ b/CompanyManagment.Application/LeaveApplication.cs @@ -326,6 +326,16 @@ public class LeaveApplication : ILeaveApplication return _leaveRepository.CheckIfValidToEdit(id); } + public OperationResult HasLeave(long workshopId, long employeeId, string dateFa) + { + OperationResult op = new(); + DateTime date = dateFa.ToGeorgianDateTime(); + if (date == Tools.GetUndefinedDateTime()) + return op.Failed("تاریخ وارد شده صحیح نمی باشد"); + var result = _leaveRepository.HasLeave(employeeId, workshopId, date); + return op.Succcedded(result); + } + public LeavePrintViewModel PrintOne(long id) { return _leaveRepository.PrintOne(id); diff --git a/CompanyManagment.Application/RollCallApplication.cs b/CompanyManagment.Application/RollCallApplication.cs index e93592e0..884f9ed5 100644 --- a/CompanyManagment.Application/RollCallApplication.cs +++ b/CompanyManagment.Application/RollCallApplication.cs @@ -5,6 +5,8 @@ using System.Linq; using System.Text; using System.Threading.Tasks; using _0_Framework.Application; +using Company.Domain.EmployeeAgg; +using Company.Domain.LeaveAgg; using Company.Domain.RollCallAgg; using Company.Domain.RollCallEmployeeAgg; using CompanyManagment.App.Contracts.Employee; @@ -17,11 +19,16 @@ public class RollCallApplication : IRollCallApplication private readonly IRollCallRepository _rollCallRepository; private readonly IEmployeeApplication _employeeApplication; private readonly IRollCallEmployeeRepository _rollCallEmployeeRepository; - public RollCallApplication(IRollCallRepository rollCallRepository, IEmployeeApplication employeeApplication, IRollCallEmployeeRepository rollCallEmployeeRepository) + private readonly IEmployeeRepository _employeeRepository; + private readonly ILeaveRepository _leaveRepository; + + public RollCallApplication(IRollCallRepository rollCallRepository, IEmployeeApplication employeeApplication, IRollCallEmployeeRepository rollCallEmployeeRepository, IEmployeeRepository employeeRepository, ILeaveRepository leaveRepository) { _rollCallRepository = rollCallRepository; _employeeApplication = employeeApplication; _rollCallEmployeeRepository = rollCallEmployeeRepository; + _employeeRepository = employeeRepository; + _leaveRepository = leaveRepository; } public OperationResult Create(CreateRollCall command) @@ -69,70 +76,210 @@ public class RollCallApplication : IRollCallApplication } + #region Pooya + public OperationResult RemoveEmployeeRollCallsInDate(long workshopId, long employeeId, string dateFa) + { + OperationResult op = new(); + var date = dateFa.ToGeorgianDateTime(); + if (date == Tools.GetUndefinedDateTime()) + return op.Failed("خطای سیستمی"); + _rollCallRepository.RemoveEmployeeRollCallsInDate(workshopId, employeeId, date); + _rollCallRepository.SaveChanges(); + return op.Succcedded(); + } + public RollCallsByDateViewModel GetWorkshopRollCallHistory(RollCallSearchModel searchModel) + { + return _rollCallRepository.GetWorkshopRollCallHistory(searchModel); + } + + public CurrentDayRollCall GetWorkshopCurrentDayRollCalls(long workshopId) + { + return _rollCallRepository.GetWorkshopCurrentDayRollCalls(workshopId); + } + + public List GetActiveEmployeeRollCallsForDuration(long employeeId, long workshopId, string startDate, + string endDate) + { + if (!string.IsNullOrWhiteSpace(startDate) || !string.IsNullOrWhiteSpace(endDate)) + return new(); + + var startDateGr = startDate.ToGeorgianDateTime(); + var endDateGr = endDate.ToGeorgianDateTime(); + + if (startDateGr >= endDateGr) + return new(); + + //if (!_rollCallEmployeeRepository.Exists(x => x.EmployeeId == employeeId && + // x.WorkshopId == workshopId && x.IsActiveString == "true")) + // return new(); + return _rollCallRepository.GetEmployeeRollCallsForMonth(employeeId, workshopId, startDateGr, endDateGr); + } - #region Pooya + public EmployeeRollCallsByMonthViewModel GetEmployeeRollCallsHistory(long employeeId, long workshopId, string startDateTime, string endDateTime, string exactDateTime, + string dateIndex) + { + DateTime? startDateTimeGr = null; + DateTime? endDateTimeGr = null; + if (!string.IsNullOrWhiteSpace(startDateTime) && !string.IsNullOrWhiteSpace(endDateTime)) + { + startDateTimeGr = startDateTime.ToGeorgianDateTime(); + endDateTimeGr = endDateTime.ToGeorgianDateTime(); + if (endDateTimeGr <= startDateTimeGr) + { + return new(); + } - public RollCallsByDateViewModel GetWorkshopRollCallHistory(RollCallSearchModel searchModel) - { - return _rollCallRepository.GetWorkshopRollCallHistory(searchModel); - } + } - public CurrentDayRollCall GetWorkshopCurrentDayRollCalls(long workshopId) - { - return _rollCallRepository.GetWorkshopCurrentDayRollCalls(workshopId); - } - public List GetActiveEmployeeRollCallsForDuration(long employeeId, long workshopId, string startDate, - string endDate) - { - if (!string.IsNullOrWhiteSpace(startDate) || !string.IsNullOrWhiteSpace(endDate)) - return new(); - - var startDateGr = startDate.ToGeorgianDateTime(); - var endDateGr = endDate.ToGeorgianDateTime(); - - if (startDateGr >= endDateGr) - return new(); - - //if (!_rollCallEmployeeRepository.Exists(x => x.EmployeeId == employeeId && - // x.WorkshopId == workshopId && x.IsActiveString == "true")) - // return new(); - return _rollCallRepository.GetEmployeeRollCallsForMonth(employeeId, workshopId, startDateGr, endDateGr); - } + DateTime? exactDateTimeGr = + !string.IsNullOrWhiteSpace(exactDateTime) ? exactDateTime.ToGeorgianDateTime() : null; - public EmployeeRollCallsByMonthViewModel GetEmployeeRollCallsHistory(long employeeId, long workshopId, string startDateTime, string endDateTime, string exactDateTime, - string dateIndex) - { - DateTime? startDateTimeGr = null; - DateTime? endDateTimeGr = null; - if (!string.IsNullOrWhiteSpace(startDateTime) && !string.IsNullOrWhiteSpace(endDateTime)) - { - startDateTimeGr = startDateTime.ToGeorgianDateTime(); - endDateTimeGr = endDateTime.ToGeorgianDateTime(); - if (endDateTimeGr <= startDateTimeGr) - { - return new(); - } + DateTime? index = null; + if (!string.IsNullOrWhiteSpace(dateIndex)) + { + index = dateIndex.ToGeorgianDateTime(); + index = (index.Value.Date >= DateTime.Now) || (index.Value == new DateTime(3000, 12, 20, new PersianCalendar())) ? null : index; - } + } - DateTime? exactDateTimeGr = - !string.IsNullOrWhiteSpace(exactDateTime) ? exactDateTime.ToGeorgianDateTime() : null; + return _rollCallRepository.GetEmployeeRollCallsHistory(employeeId, workshopId, startDateTimeGr, endDateTimeGr, exactDateTimeGr, index); + } - DateTime? index = null; - if (!string.IsNullOrWhiteSpace(dateIndex)) - { - index = dateIndex.ToGeorgianDateTime(); - index = (index.Value.Date >= DateTime.Now) || (index.Value == new DateTime(3000, 12, 20, new PersianCalendar())) ? null : index; + /// + /// افزودن حضور غیاب به صورت دستی. اگر آیدی رکورد صفر باشد رکورد جدید، در غیر این صورت ویرایش می کند + /// + public OperationResult ManualEdit(CreateOrEditEmployeeRollCall command) + { + var operation = new OperationResult(); - } - return _rollCallRepository.GetEmployeeRollCallsHistory(employeeId, workshopId, startDateTimeGr, endDateTimeGr, exactDateTimeGr, index); - } - #endregion - public long Flag(long employeeId, long workshopId) + DateTime date = command.DateFa.ToGeorgianDateTime(); + if (date == Tools.GetUndefinedDateTime()) + return operation.Failed("فرمت تاریخ وارد شده صحیح نمی باشد"); + + if (date >= DateTime.Now.Date) + { + return operation.Failed("امکان اضافه کردن حضور غیاب برای روز جاری و روز های آینده وجود ندارد"); + } + + if (command.WorkshopId < 1) + { + return operation.Failed("خطای سیستمی"); + } + + if (command.RollCallRecords == null || command.RollCallRecords.Count == 0) + return operation.Failed("خطای سیستمی"); + + if (_leaveRepository.HasLeave(command.EmployeeId, command.WorkshopId, date)) + return operation.Failed("در روز مرخصی کارمند نمی توانید حضور غیاب ثبت کنید"); + + var employeeStatuses = _rollCallEmployeeRepository.GetByEmployeeIdWithStatuses(command.EmployeeId) + .FirstOrDefault(x => x.WorkshopId == command.WorkshopId)?.Statuses; + + var employeeRollCalls = _rollCallRepository.GetWorkshopEmployeeRollCallsForDate(command.WorkshopId, command.EmployeeId, date); + + if (employeeRollCalls.Any(x => x.EndDate == null)) + return operation.Failed("به دلیل عدم ثبت خروج پرسنل در این تاریخ، شما قادر به افزودن رکورد جدید نمی باشید"); + + if (command.RollCallRecords.Any(x => string.IsNullOrWhiteSpace(x.StartTime) || string.IsNullOrWhiteSpace(x.EndTime))) + return operation.Failed("ساعات شروع و پایان نمیتوانند خالی باشد"); + + #region RollCallTimes validation and parse to DateTime + + List<(TimeOnly start, TimeOnly end, long rollCallId)> preprocessedRollCalls = new(); + try + { + preprocessedRollCalls = command.RollCallRecords.Select(x => + { + + if (!TimeOnly.TryParseExact(x.StartTime, "HH:mm", out TimeOnly start)) + throw new Exception(); + if (!TimeOnly.TryParseExact(x.EndTime, "HH:mm", out TimeOnly end)) + throw new Exception(); + return (start, end, x.RollCallId); + + }).ToList(); + } + catch (Exception e) + { + + return operation.Failed("فرمت ساعات ورودی نادرست می باشد"); + } + + DateTime day = command.DateFa.ToGeorgianDateTime(); + if (day == Tools.GetUndefinedDateTime()) + return operation.Failed("خطای سیستمی"); + DateTime previousEnd = new DateTime(); + preprocessedRollCalls = preprocessedRollCalls.OrderBy(x => x.start).ToList(); + List<(DateTime Start, DateTime End, long RollCallId)> result = new(); + + + foreach (var item in preprocessedRollCalls) + { + (DateTime Start, DateTime End, long RollCallId) rollCallWithDateTime = + new() + { + Start = new DateTime(DateOnly.FromDateTime(day), item.start), + End = new DateTime(DateOnly.FromDateTime(day), item.end), + RollCallId = item.rollCallId + + }; + + if (previousEnd != new DateTime()) + { + if (rollCallWithDateTime.Start < previousEnd) + { + rollCallWithDateTime.Start = rollCallWithDateTime.Start.AddDays(1); + } + } + while (rollCallWithDateTime.Start >= rollCallWithDateTime.End) + { + rollCallWithDateTime.End = rollCallWithDateTime.End.AddDays(1); + } + result.Add(rollCallWithDateTime); + previousEnd = rollCallWithDateTime.End; + } + var firstShiftStart = result.OrderBy(x => x.Start).FirstOrDefault().Start; + var lastShiftEnd = result.OrderByDescending(x => x.Start).FirstOrDefault().End; + var lastShiftStart = result.OrderByDescending(x => x.Start).FirstOrDefault().Start; + + if (firstShiftStart.AddDays(1) < lastShiftEnd) + return operation.Failed("بازه زمانی وارد شده نا معتبر است"); + if (result.Sum(x => (x.End - x.Start).TotalHours) > 24) + { + return operation.Failed("بازه زمانی نمیتواند بیشتر از 24 ساعت باشد"); + } + if (firstShiftStart.Date != lastShiftStart.Date) + return operation.Failed("شروع رکورد حضور غیاب نمی تواند در روز های بعد از تاریخ تعیین شده باشد"); + + #endregion + + if (result == null || !result.All(x => employeeStatuses.Any(y => x.Start >= y.StartDateGr || x.End <= y.EndDateGr))) + return operation.Failed("کارمند در بازه وارد شده غیر فعال است"); + + + var name = _rollCallEmployeeRepository.GetByEmployeeIdAndWorkshopId(command.EmployeeId, command.WorkshopId).EmployeeFullName; + var rollCallsAsEntityModels = result.Select(x => new RollCall(command.WorkshopId, command.EmployeeId, name, x.Start, x.End, + Convert.ToInt32(x.Start.ToFarsi().Substring(0, 4)), Convert.ToInt32(x.Start.ToFarsi().Substring(5, 2)))).ToList(); + _rollCallRepository.RemoveEmployeeRollCallsInDate(command.WorkshopId, command.EmployeeId, date); + + + _rollCallRepository.AddRange(rollCallsAsEntityModels); + _rollCallRepository.SaveChanges(); + return operation.Succcedded(); + } + public List GetWorkshopEmployeeRollCallsForDate(long workshopId, long employeeId, string dateFa) + { + DateTime date = Tools.ToGeorgianDateTime(dateFa); + if (date == Tools.GetUndefinedDateTime()) + return new(); + return _rollCallRepository.GetWorkshopEmployeeRollCallsForDate(workshopId, employeeId, date); + } + #endregion + public long Flag(long employeeId, long workshopId) { return _rollCallRepository.Flag(employeeId, workshopId); } diff --git a/CompanyManagment.Application/RollCallEmployeeApplication.cs b/CompanyManagment.Application/RollCallEmployeeApplication.cs index ae59aeb5..6d5b9b4e 100644 --- a/CompanyManagment.Application/RollCallEmployeeApplication.cs +++ b/CompanyManagment.Application/RollCallEmployeeApplication.cs @@ -5,8 +5,10 @@ using Company.Domain.RollCallEmployeeAgg; using Company.Domain.RollCallEmployeeStatusAgg; using CompanyManagment.App.Contracts.RollCallEmployee; using CompanyManagment.App.Contracts.RollCallEmployeeStatus; +using Microsoft.AspNetCore.Hosting; using System; using System.Collections.Generic; +using System.IO; using System.Linq; using static Microsoft.EntityFrameworkCore.DbLoggerCategory.Database; @@ -19,14 +21,15 @@ public class RollCallEmployeeApplication : IRollCallEmployeeApplication private readonly IEmployeeRepository _employeeRepository; private readonly ILeftWorkRepository _leftWorkRepository; private readonly IRollCallEmployeeStatusRepository _rollCallEmployeeStatusRepository; - - public RollCallEmployeeApplication(IRollCallEmployeeRepository rollCallEmployeeRepository, IEmployeeRepository employeeRepository, IRollCallEmployeeStatusApplication rollCallEmployeeStatusApplication, ILeftWorkRepository leftWorkRepository, IRollCallEmployeeStatusRepository rollCallEmployeeStatusRepository) + private readonly IWebHostEnvironment _webHostEnvironment; + public RollCallEmployeeApplication(IRollCallEmployeeRepository rollCallEmployeeRepository, IEmployeeRepository employeeRepository, IRollCallEmployeeStatusApplication rollCallEmployeeStatusApplication, ILeftWorkRepository leftWorkRepository, IRollCallEmployeeStatusRepository rollCallEmployeeStatusRepository, IWebHostEnvironment webHostEnvironment) { _rollCallEmployeeRepository = rollCallEmployeeRepository; _employeeRepository = employeeRepository; _rollCallEmployeeStatusApplication = rollCallEmployeeStatusApplication; _leftWorkRepository = leftWorkRepository; _rollCallEmployeeStatusRepository = rollCallEmployeeStatusRepository; + _webHostEnvironment = webHostEnvironment; } public OperationResult Create(CreateRollCallEmployee command) @@ -89,16 +92,28 @@ public class RollCallEmployeeApplication : IRollCallEmployeeApplication public OperationResult UploadedImage(long Employeeid, long WorkshopId) { - var opreation = new OperationResult(); - var emp = _rollCallEmployeeRepository.GetByEmployeeIdAndWorkshopId(Employeeid, WorkshopId); - if (emp == null) - return opreation.Failed("پرسنل یافت نشد"); + var opreation = new OperationResult(); + var emp = _rollCallEmployeeRepository.GetByEmployeeIdAndWorkshopId(Employeeid, WorkshopId); + if (emp == null) + return opreation.Failed("پرسنل یافت نشد"); - var rollCall = _rollCallEmployeeRepository.Get(emp.Id); - rollCall.HasImage(); - _rollCallEmployeeRepository.SaveChanges(); - return opreation.Succcedded(); - } + var rollCall = _rollCallEmployeeRepository.Get(emp.Id); + rollCall.HasImage(); + _rollCallEmployeeRepository.SaveChanges(); + var path = Path.Combine(_webHostEnvironment.ContentRootPath, "Faces", WorkshopId.ToString(), Employeeid.ToString()); + var thumbnailPath = Path.Combine(path, "Thumbnail.jpg"); + try + { + var thumbnail = Tools.ResizeImage(Path.Combine(path, "1.jpg"), 150, 150); + System.IO.File.WriteAllBytes(thumbnailPath, Convert.FromBase64String(thumbnail)); + } + catch + { + // ignored + } + + return opreation.Succcedded(); + } public List GetByWorkshopId(long workshopId) @@ -127,7 +142,10 @@ public class RollCallEmployeeApplication : IRollCallEmployeeApplication } #region Pooya - + public List GetRollCallEmployeesByWorkshopId(long workshopId) + { + return _rollCallEmployeeRepository.GetRollCallEmployeesByWorkshopId(workshopId); + } public List GetActivePersonnelByWorkshopId(long workshopId) { return _rollCallEmployeeRepository.GetActivePersonnelByWorkshopId(workshopId); @@ -151,6 +169,11 @@ public class RollCallEmployeeApplication : IRollCallEmployeeApplication return _rollCallEmployeeRepository.GetEmployeeRollCalls(workshopId); } + public (int activeEmployees, int deActiveEmployees) GetActiveAndDeActiveRollCallEmployees(long workshopId) + { + return _rollCallEmployeeRepository.GetActiveAndDeActiveRollCallEmployees(workshopId); + } + public List GetPersonnelRollCallListAll(long workshopId) { return _rollCallEmployeeRepository.GetPersonnelRollCallListAll(workshopId); @@ -163,14 +186,28 @@ public class RollCallEmployeeApplication : IRollCallEmployeeApplication public OperationResult ChangeEmployeeRollCallName(long rollCallEmployeeId, string fName, string lName) { - OperationResult result = new(); - if (string.IsNullOrWhiteSpace(lName)) - return result.Failed("نام خاوادگی نمی تواند خالی باشد"); - fName = fName ?? ""; - var entity = _rollCallEmployeeRepository.Get(rollCallEmployeeId); - entity.ChangeName(fName, lName); - _rollCallEmployeeRepository.SaveChanges(); - return result.Succcedded(); + OperationResult result = new(); + if (string.IsNullOrWhiteSpace(lName) || string.IsNullOrWhiteSpace(fName)) + return result.Failed("نام و نام خانوادگی نمی توانند خالی باشند"); + fName = fName.Trim(); + lName = lName.Trim(); + var fullName = $"{fName} {lName}"; + var entity = _rollCallEmployeeRepository.Get(rollCallEmployeeId); + + + if (entity == null) + return result.Failed(ApplicationMessages.RecordNotFound); + + if (_rollCallEmployeeRepository.Exists(x => x.WorkshopId == entity.WorkshopId && x.EmployeeFullName == fullName && x.id != rollCallEmployeeId)) + return result.Failed("نام و نام خانوادگی کارمند نمی تواند با نام و نام خانوادگی کارمند دیگری در آن کارگاه یکسان باشد"); + + if (entity.IsActiveString != "true") + return result.Failed("امکان تغییر نام برای کارمند غیر فعال وجود ندارد"); + + + entity.ChangeName(fName, lName); + _rollCallEmployeeRepository.SaveChanges(); + return result.Succcedded(); } #endregion } \ No newline at end of file diff --git a/CompanyManagment.Application/RollCallEmployeeStatusApplication.cs b/CompanyManagment.Application/RollCallEmployeeStatusApplication.cs index 21a04802..8b675648 100644 --- a/CompanyManagment.Application/RollCallEmployeeStatusApplication.cs +++ b/CompanyManagment.Application/RollCallEmployeeStatusApplication.cs @@ -24,20 +24,33 @@ namespace CompanyManagment.Application _leftWorkRepository = leftWorkRepository; } - public OperationResult Create(CreateRollCallEmployeeStatus cmd) - { + public OperationResult Create(CreateRollCallEmployeeStatus cmd) + { OperationResult op = new(); - RollCallEmployee employee = _rollCallEmployeeRepository.Get(cmd.RollCallEmployeeId); - if (employee == null) + RollCallEmployee rollCallEmployee = _rollCallEmployeeRepository.Get(cmd.RollCallEmployeeId); + if (rollCallEmployee == null) return op.Failed("کارمند مجاز نیست"); - if (!_leftWorkRepository.Exists(x => x.EmployeeId == employee.EmployeeId && x.WorkshopId == employee.WorkshopId && - x.LeftWorkDate.Date > DateTime.Now.Date && x.StartWorkDate.Date <= DateTime.Now.Date)) + if (!_leftWorkRepository.Exists(x => x.EmployeeId == rollCallEmployee.EmployeeId && x.WorkshopId == rollCallEmployee.WorkshopId && + x.LeftWorkDate.Date > DateTime.Now.Date && x.StartWorkDate.Date < DateTime.Now.Date)) return op.Failed("کارمند در کارگاه شروع به کار نکرده است"); - if (_employeeRollCallStatusRepository.Exists(x => x.EndDate >= DateTime.Now && employee.id == x.RollCallEmployeeId)) - return op.Failed("تکراری است"); - RollCallEmployeeStatus newRecord = new(employee.id, DateTime.Now); - _employeeRollCallStatusRepository.Create(newRecord); + + if (_employeeRollCallStatusRepository.Exists(y => + rollCallEmployee.id == y.RollCallEmployeeId && y.EndDate.Date > DateTime.Now.Date)) + return op.Failed("کارمند فعال می باشد"); + + if (_employeeRollCallStatusRepository.Exists(y => + rollCallEmployee.id == y.RollCallEmployeeId && y.EndDate.Date == DateTime.Now.Date)) + { + RollCallEmployeeStatus previousStatusInDate = _employeeRollCallStatusRepository.GetByRollCallEmployeeIdAndDate(cmd.RollCallEmployeeId, DateTime.Now.Date); + previousStatusInDate.Edit(previousStatusInDate.StartDate, Tools.GetUndefinedDateTime()); + } + else + { + RollCallEmployeeStatus newRecord = new(rollCallEmployee.id, DateTime.Now.Date); + _employeeRollCallStatusRepository.Create(newRecord); + } + _employeeRollCallStatusRepository.SaveChanges(); return op.Succcedded(); diff --git a/CompanyManagment.EFCore/Repository/LeaveRepository.cs b/CompanyManagment.EFCore/Repository/LeaveRepository.cs index 0826fed0..454fdc0b 100644 --- a/CompanyManagment.EFCore/Repository/LeaveRepository.cs +++ b/CompanyManagment.EFCore/Repository/LeaveRepository.cs @@ -363,6 +363,13 @@ public class LeaveRepository : RepositoryBase, ILeaveRepository return op.Failed("موردی یافت نشد"); } + public bool HasLeave(long employeeId, long workshopId, DateTime date) + { + return _context.LeaveList.Where(x => (x.LeaveType == "استحقاقی" && x.PaidLeaveType == "روزانه") || + x.LeaveType == "استعلاجی") + .FirstOrDefault(x => x.EmployeeId == employeeId && x.WorkshopId == workshopId && x.StartLeave.Date <= date.Date && x.EndLeave.Date >= date.Date) != null; + } + public bool CheckContractExist(DateTime myDate, long employeeId, long workshopId) { var result = _context.Contracts.Any(x => x.ContarctStart <= myDate diff --git a/CompanyManagment.EFCore/Repository/RollCallEmployeeRepository.cs b/CompanyManagment.EFCore/Repository/RollCallEmployeeRepository.cs index 8a0883c6..f2c50587 100644 --- a/CompanyManagment.EFCore/Repository/RollCallEmployeeRepository.cs +++ b/CompanyManagment.EFCore/Repository/RollCallEmployeeRepository.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.Diagnostics; using System.IO; using System.Linq; using _0_Framework.Application; @@ -15,93 +16,126 @@ namespace CompanyManagment.EFCore.Repository; public class RollCallEmployeeRepository : RepositoryBase, IRollCallEmployeeRepository { - private readonly CompanyContext _context; - private readonly IPasswordHasher _passwordHasher; - private readonly IWebHostEnvironment _webHostEnvironment; - private IRollCallEmployeeRepository _rollCallEmployeeRepositoryImplementation; + private readonly CompanyContext _context; + private readonly IPasswordHasher _passwordHasher; + private readonly IWebHostEnvironment _webHostEnvironment; + // private IRollCallEmployeeRepository _rollCallEmployeeRepositoryImplementation; - public RollCallEmployeeRepository(CompanyContext context, IPasswordHasher passwordHasher, IWebHostEnvironment webHostEnvironment) : base(context) - { - _context = context; - _passwordHasher = passwordHasher; - _webHostEnvironment = webHostEnvironment; - } + public RollCallEmployeeRepository(CompanyContext context, IPasswordHasher passwordHasher, + IWebHostEnvironment webHostEnvironment) : base(context) + { + _context = context; + _passwordHasher = passwordHasher; + _webHostEnvironment = webHostEnvironment; + } - public List GetByWorkshopId(long workshopId) - { - var query = _context.RollCallEmployees.Select(x => new RollCallEmployeeViewModel() - { - Id = x.id, - EmployeeId = x.EmployeeId, - WorkshopId = x.WorkshopId, - EmployeeFullName = x.EmployeeFullName, - IsActiveString = x.IsActiveString, - HasUploadedImage = x.HasUploadedImage - }).Where(x => x.WorkshopId == workshopId); + public List GetByWorkshopId(long workshopId) + { + var query = _context.RollCallEmployees.Select(x => new RollCallEmployeeViewModel() + { + Id = x.id, + EmployeeId = x.EmployeeId, + WorkshopId = x.WorkshopId, + EmployeeFullName = x.EmployeeFullName, + IsActiveString = x.IsActiveString, + HasUploadedImage = x.HasUploadedImage + }).Where(x => x.WorkshopId == workshopId); - return query.ToList(); - } + return query.ToList(); + } - public EditRollCallEmployee GetDetails(long id) - { - return _context.RollCallEmployees.Select(x => new RollCallEmployeeViewModel() - { - Id = x.id, - WorkshopId = x.WorkshopId, - EmployeeFullName = x.EmployeeFullName, - IsActiveString = x.IsActiveString, - HasUploadedImage = x.HasUploadedImage - }).FirstOrDefault(x => x.Id == id); - } + public EditRollCallEmployee GetDetails(long id) + { + return _context.RollCallEmployees.Select(x => new RollCallEmployeeViewModel() + { + Id = x.id, + WorkshopId = x.WorkshopId, + EmployeeFName = x.FName, + EmployeeLName = x.LName, + EmployeeFullName = x.EmployeeFullName, + IsActiveString = x.IsActiveString, + HasUploadedImage = x.HasUploadedImage + }).FirstOrDefault(x => x.Id == id); + } + + public RollCallEmployeeViewModel GetByEmployeeIdAndWorkshopId(long employeeId, long workshopId) + { + return _context.RollCallEmployees.Where(x => x.EmployeeId == employeeId && x.WorkshopId == workshopId).Select( + x => new RollCallEmployeeViewModel() + { + Id = x.id, + EmployeeId = x.EmployeeId, + WorkshopId = x.WorkshopId, + EmployeeFName = x.FName, + EmployeeLName = x.LName, + EmployeeFullName = x.EmployeeFullName, + IsActiveString = x.IsActiveString, + HasUploadedImage = x.HasUploadedImage + }).FirstOrDefault(); + } - public RollCallEmployeeViewModel GetByEmployeeIdAndWorkshopId(long employeeId, long workshopId) - { - return _context.RollCallEmployees.Where(x => x.EmployeeId == employeeId && x.WorkshopId == workshopId).Select(x => new RollCallEmployeeViewModel() - { - Id = x.id, - WorkshopId = x.WorkshopId, - EmployeeFullName = x.EmployeeFullName, - IsActiveString = x.IsActiveString, - HasUploadedImage = x.HasUploadedImage - }).FirstOrDefault(); - } - public List GetPersonnelRollCallListPaginate(RollCallEmployeeSearchModel command) { var dateNow = DateTime.Now; - var rawQuery = _context.Employees.Include(x => x.LeftWorks).Include(x => x.LeftWorkInsurances) + var employeeQuery = _context.Employees.AsQueryable(); + + if (!string.IsNullOrWhiteSpace(command.Name)) + { + var rollCallNames = _context.RollCallEmployees.Where(x => command.WorkshopId == x.WorkshopId && + x.EmployeeFullName.Contains(command.Name)).Select( + x => new + { + x.EmployeeId, + x.EmployeeFullName + }); + + employeeQuery = employeeQuery.Where(x => rollCallNames.Any(y => y.EmployeeId == x.id)); + } + + var rawQuery = employeeQuery.Include(x => x.LeftWorks).Include(x => x.LeftWorkInsurances) .Where(x => x.LeftWorks.Any(y => y.WorkshopId == command.WorkshopId && y.StartWorkDate <= dateNow && y.LeftWorkDate > dateNow) || x.LeftWorkInsurances.Any(y => y.WorkshopId == command.WorkshopId && y.StartWorkDate <= dateNow && - (y.LeftWorkDate > dateNow || y.LeftWorkDate == null))).OrderByDescending(x => x.id).AsQueryable().AsSplitQuery(); - if (!string.IsNullOrWhiteSpace(command.Name)) - rawQuery = rawQuery.Where(x => (x.FName + " " + x.LName).Contains(command.Name)); + (y.LeftWorkDate > dateNow || y.LeftWorkDate == null))).OrderByDescending(x => x.id) + .Select(x => new + { + Id = x.id, + x.FullName, + x.NationalCode, + + }).AsSplitQuery(); + + var rollCallEmployees = _context.RollCallEmployees.Where(x => x.WorkshopId == command.WorkshopId); var joinedQuery = from employee in rawQuery - join rollCallEmployee in rollCallEmployees - on employee.id equals rollCallEmployee.EmployeeId into grp - from joinedRollCall in grp.DefaultIfEmpty() - select new RollCallEmployeeViewModel() - { - WorkshopId = command.WorkshopId, - EmployeeId = employee.id, - Id = joinedRollCall == null ? 0 : joinedRollCall.id, - EmployeeFullName = employee.FullName, - NationalCode = employee.NationalCode, - IsActiveString = joinedRollCall == null ? "false" : joinedRollCall.IsActiveString, - HasUploadedImage = joinedRollCall == null ? "false" : joinedRollCall.HasUploadedImage - }; + join rollCallEmployee in rollCallEmployees + on employee.Id equals rollCallEmployee.EmployeeId into grp + from joinedRollCall in grp.DefaultIfEmpty() + select new RollCallEmployeeViewModel() + { + WorkshopId = command.WorkshopId, + EmployeeId = employee.Id, + Id = joinedRollCall == null ? 0 : joinedRollCall.id, + EmployeeFullName = joinedRollCall == null ? employee.FullName : joinedRollCall.EmployeeFullName, + NationalCode = employee.NationalCode, + IsActiveString = joinedRollCall == null ? "false" : joinedRollCall.IsActiveString, + HasUploadedImage = joinedRollCall == null ? "false" : joinedRollCall.HasUploadedImage + }; + + var firstlist = joinedQuery.AsSplitQuery(); var list = firstlist.OrderByDescending(x => x.IsActiveString == "true" ? 1 : 0) .ThenByDescending(x => x.HasUploadedImage == "true" ? 1 : 0) .Skip(command.PageIndex).Take(30).ToList(); + var watch = new Stopwatch(); + watch.Start(); list.ForEach(x => { @@ -110,17 +144,19 @@ public class RollCallEmployeeRepository : RepositoryBase { try { - var path = Path.Combine(_webHostEnvironment.ContentRootPath, "Faces", command.WorkshopId.ToString(), x.EmployeeId.ToString()); + var path = Path.Combine(_webHostEnvironment.ContentRootPath, "Faces", command.WorkshopId.ToString(), + x.EmployeeId.ToString()); var thumbnailPath = Path.Combine(path, "Thumbnail.jpg"); - if (System.IO.File.Exists(path)) + if (System.IO.File.Exists(thumbnailPath)) { var bytes = System.IO.File.ReadAllBytes(thumbnailPath); var image = Convert.ToBase64String(bytes); x.ImagePath = image; } - else + else if (System.IO.File.Exists(Path.Combine(path, "1.jpg"))) { + var thumbnail = Tools.ResizeImage(Path.Combine(path, "1.jpg"), 150, 150); System.IO.File.WriteAllBytes(thumbnailPath, Convert.FromBase64String(thumbnail)); x.ImagePath = thumbnail; @@ -128,150 +164,229 @@ public class RollCallEmployeeRepository : RepositoryBase } catch { - + // ignored } - - } }); - - //list = list.Select(x => new RollCallEmployeeViewModel() - //{ - // WorkshopId = x.WorkshopId, - // EmployeeId = x.EmployeeId, - // Id = x.Id, - // EmployeeFullName = x.EmployeeFullName, - // NationalCode = x.NationalCode, - // IsActiveString = x.IsActiveString, - // HasUploadedImage = x.HasUploadedImage, - // EmployeeSlug = _passwordHasher.SlugHasher(x.EmployeeId), - // ImagePath = (System.IO.File.Exists(Path.Combine(_webHostEnvironment.ContentRootPath, "Faces", command.WorkshopId.ToString(), x.EmployeeId.ToString(), "1.jpg"))) - // ? Tools.ResizeImage(Path.Combine(_webHostEnvironment.ContentRootPath, "Faces", command.WorkshopId.ToString(), x.EmployeeId.ToString(), "1.jpg"), 150, 150) : "" - //}).ToList(); - - - + Console.WriteLine(watch.Elapsed); return list; } public RollCallEmployee GetWithRollCallStatus(long id) - { - return _context.RollCallEmployees.Include(x => x.EmployeesStatus) - .FirstOrDefault(x => x.id == id); - } + { + return _context.RollCallEmployees.Include(x => x.EmployeesStatus) + .FirstOrDefault(x => x.id == id); + } - public int activedPerson(long workshopId) - { - return _context.RollCallEmployees.Count(x => x.WorkshopId == workshopId && x.IsActiveString == "true" && x.HasUploadedImage == "true"); - } + public int activedPerson(long workshopId) + { + return _context.RollCallEmployees.Count(x => + x.WorkshopId == workshopId && x.IsActiveString == "true" && x.HasUploadedImage == "true"); + } - #region Pooya - public List GetByEmployeeIdWithStatuses(long employeeId) - { - return _context.RollCallEmployees.Include(x => x.EmployeesStatus) - .Where(x => x.EmployeeId == employeeId).Select(x => - new RollCallEmployeeViewModel() - { - EmployeeId = x.EmployeeId, - EmployeeFullName = x.EmployeeFullName, - Id = x.id, - WorkshopId = x.WorkshopId, - IsActiveString = x.IsActiveString, - HasUploadedImage = x.HasUploadedImage, - Statuses = x.EmployeesStatus.Select(y => new RollCallEmployeeStatusViewModel() - { - StartDateGr = y.StartDate, - EndDateGr = y.EndDate, - Id = y.id - }) + #region Pooya - }).ToList(); ; - } + public List GetRollCallEmployeesByWorkshopId(long workshopId) + { + return _context.RollCallEmployees.Where(x => x.WorkshopId == workshopId) + .Select(x => + new RollCallEmployeeViewModel() + { + EmployeeId = x.EmployeeId, + EmployeeFullName = x.EmployeeFullName, + Id = x.id, + WorkshopId = x.WorkshopId, + IsActiveString = x.IsActiveString, + HasUploadedImage = x.HasUploadedImage, + Statuses = x.EmployeesStatus.Select(y => new RollCallEmployeeStatusViewModel() + { + StartDateGr = y.StartDate, + EndDateGr = y.EndDate, + Id = y.id + }) + + }).ToList(); + + } + + public List GetByEmployeeIdWithStatuses(long employeeId) + { + return _context.RollCallEmployees.Include(x => x.EmployeesStatus) + .Where(x => x.EmployeeId == employeeId).Select(x => + new RollCallEmployeeViewModel() + { + EmployeeId = x.EmployeeId, + EmployeeFullName = x.EmployeeFullName, + Id = x.id, + WorkshopId = x.WorkshopId, + IsActiveString = x.IsActiveString, + HasUploadedImage = x.HasUploadedImage, + Statuses = x.EmployeesStatus.Select(y => new RollCallEmployeeStatusViewModel() + { + StartDateGr = y.StartDate, + EndDateGr = y.EndDate, + Id = y.id + }) + + }).ToList(); + ; + } public bool HasEmployees(long workshopId) { var dateNow = DateTime.Now; - return _context.Employees.Include(x => x.LeftWorks).Include(x => x.LeftWorkInsurances) - .Any(x => x.LeftWorks.Any(y => - y.WorkshopId == workshopId && y.StartWorkDate <= dateNow && - y.LeftWorkDate > dateNow) || - x.LeftWorkInsurances.Any(y => - y.WorkshopId == workshopId && y.StartWorkDate <= dateNow && - (y.LeftWorkDate > dateNow || y.LeftWorkDate == null))); - + return _context.Employees.Include(x => x.LeftWorks).Include(x => x.LeftWorkInsurances) + .Any(x => x.LeftWorks.Any(y => + y.WorkshopId == workshopId && y.StartWorkDate <= dateNow && + y.LeftWorkDate > dateNow) || + x.LeftWorkInsurances.Any(y => + y.WorkshopId == workshopId && y.StartWorkDate <= dateNow && + (y.LeftWorkDate > dateNow || y.LeftWorkDate == null))); + } public List GetActivePersonnelByWorkshopId(long workshopId) - { - var rollCallEmployees = _context.RollCallEmployees.Where(x => x.WorkshopId == workshopId - && x.IsActiveString == "true" && x.HasUploadedImage == "true"); + { + var rollCallEmployees = _context.RollCallEmployees.Where(x => x.WorkshopId == workshopId + && x.IsActiveString == "true" && + x.HasUploadedImage == "true"); - var personnel = - _context.PersonnelCodeSet.Where(x => rollCallEmployees.Any(y => y.EmployeeId == x.EmployeeId && y.WorkshopId == x.WorkshopId)) - .Select(x => new { x.EmployeeId, x.PersonnelCode }).ToList(); - var rollCallEmployeesList = rollCallEmployees.ToList(); - return personnel.Select(x => - { - var name = rollCallEmployeesList.FirstOrDefault(y => x.EmployeeId == y.EmployeeId); - return new RollCallEmployeeViewModel() - { - PersonelCode = x.PersonnelCode, - EmployeeFName = name.FName, - EmployeeLName = name.LName, - EmployeeId = x.EmployeeId, - EmployeeFullName = name.EmployeeFullName - }; - }).OrderBy(x => x.EmployeeLName).ToList(); + var personnel = + _context.PersonnelCodeSet.Where(x => + rollCallEmployees.Any(y => y.EmployeeId == x.EmployeeId && y.WorkshopId == x.WorkshopId)) + .Select(x => new { x.EmployeeId, x.PersonnelCode }).ToList(); + var rollCallEmployeesList = rollCallEmployees.ToList(); + return personnel.Select(x => + { + var name = rollCallEmployeesList.FirstOrDefault(y => x.EmployeeId == y.EmployeeId); + return new RollCallEmployeeViewModel() + { + PersonelCode = x.PersonnelCode, + EmployeeFName = name.FName, + EmployeeLName = name.LName, + EmployeeId = x.EmployeeId, + EmployeeFullName = name.EmployeeFullName + }; + }).OrderBy(x => x.EmployeeLName).ToList(); - } + } - public List GetEmployeeRollCalls(long workshopId) - { - var dateNow = DateTime.Now; - var f = _context.RollCallEmployees.Where(x => x.WorkshopId == workshopId); + public List GetEmployeeRollCalls(long workshopId) + { + var dateNow = DateTime.Now; + var f = _context.RollCallEmployees.Where(x => x.WorkshopId == workshopId); - var res = f.Select(x => new RollCallEmployeeViewModel - { - RollCallEmployeeId = x.id, - EmployeeId = x.EmployeeId, - EmployeeFullName = x.EmployeeFullName - }) - .ToList(); + var res = f.Select(x => new RollCallEmployeeViewModel + { + RollCallEmployeeId = x.id, + EmployeeId = x.EmployeeId, + EmployeeFullName = x.EmployeeFullName + }) + .ToList(); - return res; - } + return res; + } - public List GetPersonnelRollCallListAll(long workshopId) - { - var dateNow = DateTime.Now; - var f = _context.Employees.Include(x => x.LeftWorks).Include(x => x.LeftWorkInsurances) - .Where(x => x.LeftWorks.Any(y => y.WorkshopId == workshopId && y.StartWorkDate <= dateNow && y.LeftWorkDate > dateNow) || - x.LeftWorkInsurances.Any(y => y.WorkshopId == workshopId && y.StartWorkDate <= dateNow && - (y.LeftWorkDate > dateNow || y.LeftWorkDate == null))).ToList(); + public List GetPersonnelRollCallListAll(long workshopId) + { + //var dateNow = DateTime.Now; + //var f = _context.Employees.Include(x => x.LeftWorks).Include(x => x.LeftWorkInsurances) + // .Where(x => x.LeftWorks.Any(y => y.WorkshopId == workshopId && y.StartWorkDate <= dateNow && y.LeftWorkDate > dateNow) || + // x.LeftWorkInsurances.Any(y => y.WorkshopId == workshopId && y.StartWorkDate <= dateNow && + // (y.LeftWorkDate > dateNow || y.LeftWorkDate == null))).ToList(); - var res = f.Select(x => new RollCallEmployeeViewModel - { - WorkshopId = workshopId, - EmployeeId = x.id, - Id = _context.RollCallEmployees.Any(r => r.EmployeeId == x.id && r.WorkshopId == workshopId) ? - _context.RollCallEmployees.FirstOrDefault(r => r.EmployeeId == x.id && r.WorkshopId == workshopId)!.id : 0, - EmployeeFullName = $"{x.FName} {x.LName}", - EmployeeSlug = _passwordHasher.SlugHasher(x.id), - NationalCode = _context.Employees.FirstOrDefault(e => e.id == x.id).NationalCode, - IsActiveString = _context.RollCallEmployees.Any(r => r.EmployeeId == x.id && r.WorkshopId == workshopId && r.IsActiveString == "true") ? "true" : "false", - HasUploadedImage = _context.RollCallEmployees.Any(r => r.EmployeeId == x.id && r.WorkshopId == workshopId && r.HasUploadedImage == "true") ? "true" : "false", - ImagePath = (System.IO.File.Exists(Path.Combine(_webHostEnvironment.ContentRootPath, "Faces", workshopId.ToString(), x.id.ToString(), "1.jpg"))) - ? Tools.ResizeImage(Path.Combine(_webHostEnvironment.ContentRootPath, "Faces", workshopId.ToString(), x.id.ToString(), "1.jpg"), 150, 150) - : "", - }).OrderBy(x => x.PersonelCode) - .ToList(); + //var res = f.Select(x => new RollCallEmployeeViewModel + //{ + // WorkshopId = workshopId, + // EmployeeId = x.id, + // Id = _context.RollCallEmployees.Any(r => r.EmployeeId == x.id && r.WorkshopId == workshopId) ? + // _context.RollCallEmployees.FirstOrDefault(r => r.EmployeeId == x.id && r.WorkshopId == workshopId)!.id : 0, + // EmployeeFullName = $"{x.FName} {x.LName}", + // EmployeeSlug = _passwordHasher.SlugHasher(x.id), + // NationalCode = _context.Employees.FirstOrDefault(e => e.id == x.id).NationalCode, + // IsActiveString = _context.RollCallEmployees.Any(r => r.EmployeeId == x.id && r.WorkshopId == workshopId && r.IsActiveString == "true") ? "true" : "false", + // HasUploadedImage = _context.RollCallEmployees.Any(r => r.EmployeeId == x.id && r.WorkshopId == workshopId && r.HasUploadedImage == "true") ? "true" : "false", + // ImagePath = (System.IO.File.Exists(Path.Combine(_webHostEnvironment.ContentRootPath, "Faces", workshopId.ToString(), x.id.ToString(), "1.jpg"))) + // ? Tools.ResizeImage(Path.Combine(_webHostEnvironment.ContentRootPath, "Faces", workshopId.ToString(), x.id.ToString(), "1.jpg"), 150, 150) + // : "", + //}).OrderBy(x => x.PersonelCode) + // .ToList(); - return res; - } + //return res; - #endregion + return new(); + } + + public (int activeEmployees, int deActiveEmployees) GetActiveAndDeActiveRollCallEmployees(long workshopId) + { + var dateNow = DateTime.Now; + //var employeeQuery = _context.Employees.AsQueryable(); + + + //var rawQuery = employeeQuery.Include(x => x.LeftWorks).Include(x => x.LeftWorkInsurances) + // .Where(x => x.LeftWorks.Any(y => + // y.WorkshopId == command.WorkshopId && y.StartWorkDate <= dateNow && + // y.LeftWorkDate > dateNow) || + // x.LeftWorkInsurances.Any(y => + // y.WorkshopId == command.WorkshopId && y.StartWorkDate <= dateNow && + // (y.LeftWorkDate > dateNow || y.LeftWorkDate == null))).OrderByDescending(x => x.id) + // .Select(x => new + // { + // Id = x.id, + // x.FullName, + // x.NationalCode, + + // }).AsSplitQuery(); + + + + //var rollCallEmployees = _context.RollCallEmployees.Where(x => x.WorkshopId == command.WorkshopId); + + + //var joinedQuery = from employee in rawQuery + // join rollCallEmployee in rollCallEmployees + // on employee.Id equals rollCallEmployee.EmployeeId into grp + // from joinedRollCall in grp.DefaultIfEmpty() + // select new RollCallEmployeeViewModel() + // { + // WorkshopId = command.WorkshopId, + // EmployeeId = employee.Id, + // Id = joinedRollCall == null ? 0 : joinedRollCall.id, + // EmployeeFullName = joinedRollCall == null ? employee.FullName : joinedRollCall.EmployeeFullName, + // NationalCode = employee.NationalCode, + // IsActiveString = joinedRollCall == null ? "false" : joinedRollCall.IsActiveString, + // HasUploadedImage = joinedRollCall == null ? "false" : joinedRollCall.HasUploadedImage + // }; + var rawQuery = _context.Employees.Include(x => x.LeftWorks).Include(x => x.LeftWorkInsurances) + .Where(x => x.LeftWorks.Any(y => + y.WorkshopId == workshopId && y.StartWorkDate <= dateNow && + y.LeftWorkDate > dateNow) || + x.LeftWorkInsurances.Any(y => + y.WorkshopId == workshopId && y.StartWorkDate <= dateNow && + (y.LeftWorkDate > dateNow || y.LeftWorkDate == null))).OrderByDescending(x => x.id) + .Select(x => new + { + Id = x.id, + }).Distinct(); + + var rollCallEmployees = _context.RollCallEmployees.Where(x => x.WorkshopId == workshopId); + + var joinedQuery = from employee in rawQuery + join rollCallEmployee in rollCallEmployees + on employee.Id equals rollCallEmployee.EmployeeId into grp + from joinedRollCall in grp.DefaultIfEmpty() + select new RollCallEmployeeViewModel() + { + IsActiveString = joinedRollCall == null ? "false" : joinedRollCall.IsActiveString, + }; + var deActiveCount = joinedQuery.Count(x => x.IsActiveString == "false"); + var ActiveCount = joinedQuery.Count(x => x.IsActiveString == "true"); + return (ActiveCount, deActiveCount); + + #endregion + } } \ No newline at end of file diff --git a/CompanyManagment.EFCore/Repository/RollCallEmployeeStatusRepository.cs b/CompanyManagment.EFCore/Repository/RollCallEmployeeStatusRepository.cs index d0289abf..433aebd4 100644 --- a/CompanyManagment.EFCore/Repository/RollCallEmployeeStatusRepository.cs +++ b/CompanyManagment.EFCore/Repository/RollCallEmployeeStatusRepository.cs @@ -47,6 +47,13 @@ namespace CompanyManagment.EFCore.Repository _context.SaveChanges(); } - #endregion - } + + public RollCallEmployeeStatus GetByRollCallEmployeeIdAndDate(long rollCallEmployeeId, DateTime date) + { + return _context.RollCallEmployeesStatus.FirstOrDefault(x => x.RollCallEmployeeId == rollCallEmployeeId && x.StartDate.Date <= date.Date && x.EndDate.Date >= date.Date); + + } + + #endregion + } } diff --git a/CompanyManagment.EFCore/Repository/RollCallRepository.cs b/CompanyManagment.EFCore/Repository/RollCallRepository.cs index 4d9d6702..7a1b6125 100644 --- a/CompanyManagment.EFCore/Repository/RollCallRepository.cs +++ b/CompanyManagment.EFCore/Repository/RollCallRepository.cs @@ -36,9 +36,14 @@ public class RollCallRepository : RepositoryBase, IRollCallRepos { throw new NotImplementedException(); } - #region Pooya - //حضور غیاب فیش حقوقی - public List GetEmployeeRollCallsForMonth(long employeeId, long workshopId, DateTime startMonthDay, DateTime endMonthDay) + + + + #region Pooya + + + //حضور غیاب فیش حقوقی + public List GetEmployeeRollCallsForMonth(long employeeId, long workshopId, DateTime startMonthDay, DateTime endMonthDay) { @@ -107,375 +112,428 @@ public class RollCallRepository : RepositoryBase, IRollCallRepos } - //جستجوی سوابق حضور غیاب بر اساس کارمند - public EmployeeRollCallsByMonthViewModel GetEmployeeRollCallsHistory(long employeeId, long workshopId, - DateTime? startDateTime, DateTime? endDateTime, DateTime? exactDateTime, DateTime? dateIndex) - { - - //get RollCallEmployee and RollCallEmployeeStatus for that employee in that workshop - var employeeRollCallStatuses = _context.RollCallEmployees.Include(x => x.EmployeesStatus) - .FirstOrDefault(x => x.EmployeeId == employeeId && x.WorkshopId == workshopId); - - //if none was found return empty - if (employeeRollCallStatuses == null) - return new(); - - //this list will have all the months which employee was active in - var activeMonths = new List(); - - //filling the list - foreach (var status in employeeRollCallStatuses.EmployeesStatus) - { - var persianEndDate = new PersianDateTime(status.EndDate.Date); - var persianStartDate = new PersianDateTime(status.StartDate.Date); - - var persianStartFirstDayOfMonth = new PersianDateTime(persianStartDate.Year, persianStartDate.Month, 1); - - for (PersianDateTime start = persianStartFirstDayOfMonth; start <= persianEndDate && start < PersianDateTime.Today.Date; start = start.AddMonths(1)) - { - activeMonths.Add(start); - } - } - //might have duplicated records, this is the reason for distinct - var activeMonthsList = activeMonths.OrderByDescending(x => x.Date).Distinct().ToList(); - - PersianDateTime startSearch = new(); - PersianDateTime endSearch = new(); - - //if search has these parameters below - if (startDateTime.HasValue && endDateTime.HasValue) - { - //change them to persian date time and save them - startSearch = new PersianDateTime(startDateTime.Value); - endSearch = new PersianDateTime(endDateTime.Value); - - //get the months that include these dates - activeMonthsList = activeMonthsList.Where(x => x.Year >= startSearch.Year && x.Month >= startSearch.Month && x.Year <= endSearch.Year && x.Month <= endSearch.Month).ToList(); - } - //if exact datetime is given - if (exactDateTime.HasValue) - { - //start and end will be the same date - startSearch = new PersianDateTime(exactDateTime.Value); - endSearch = startSearch; - //get the - activeMonthsList = activeMonthsList.Where(x => x.Year >= startSearch.Year && x.Month >= startSearch.Month && x.Year <= endSearch.Year && x.Month <= endSearch.Month).ToList(); - } - - if (dateIndex != null) - { - var persianDateIndex = new PersianDateTime(dateIndex.Value); - var dateIndexFirstOfMonth = persianDateIndex.AddDays(-(persianDateIndex.Day - 1)); - activeMonthsList = activeMonthsList.Where(x => dateIndexFirstOfMonth >= x).ToList(); - } - - if (!activeMonthsList.Any()) return new(); - - //get the last month which user was active in - PersianDateTime selectedMonthPersian = activeMonthsList.First(); - - DateTime selectedMonthFirstDay = selectedMonthPersian; - DateTime nextMonthFirstDay = selectedMonthPersian.AddMonths(1); - - var statusesOfMonth = employeeRollCallStatuses.EmployeesStatus.Where(x => x.EndDate >= selectedMonthFirstDay && - x.StartDate < nextMonthFirstDay); - - - - var leavesQuery = - _context.LeaveList.Where(x => (x.LeaveType == "استعلاجی" || (x.LeaveType == "استحقاقی" && x.PaidLeaveType == "روزانه")) && - x.IsAccepted && - x.EndLeave >= selectedMonthFirstDay && x.StartLeave < nextMonthFirstDay && x.WorkshopId == workshopId); - - var rollCalls = _context.RollCalls.Where(x => - !leavesQuery.Any(y => - y.StartLeave.Date <= x.StartDate.Value.Date && y.EndLeave.Date >= x.StartDate.Value.Date) && - x.EmployeeId == employeeId && x.WorkshopId == workshopId && x.StartDate != null && x.EndDate != null && - x.StartDate >= selectedMonthFirstDay && x.StartDate < nextMonthFirstDay); - - var personnelCode = - _context.PersonnelCodeSet.FirstOrDefault(x => x.EmployeeId == employeeId && x.WorkshopId == workshopId)?.PersonnelCode; - - var employeeName = _context.RollCallEmployees.Where(x => x.WorkshopId == workshopId).Select(x => new { x.EmployeeId, x.EmployeeFullName }) - .FirstOrDefault(x => x.EmployeeId == employeeId); - - var rollCallsList = rollCalls.ToList(); - var leavesList = leavesQuery.ToList(); - - int dateRange = (int)(nextMonthFirstDay - selectedMonthFirstDay).TotalDays; - - var todayDate = DateTime.Now.Date; - //all the dates from start to end, to be compared with present days to get absent dates - var completeDaysList = Enumerable.Range(0, dateRange).Select(offset => selectedMonthFirstDay.AddDays(offset).Date).Where(x => x.Date < todayDate); - - //if user search range is within a month for example, we dont want 30/31/29 days for month, we want it to be the size of the search range - //user input = 2024/04/15~2024/04/21, output days count is 21-15+1=6 days from 15th to 21st - if (exactDateTime.HasValue || (startDateTime.HasValue && endDateTime.HasValue)) - completeDaysList = completeDaysList.Where(x => x.Date >= startSearch.Date && x.Date <= endSearch.Date); - var result = completeDaysList.Where(x => statusesOfMonth.Any(y => x >= y.StartDate.Date && x <= y.EndDate.Date)) - .Select(x => new RollCallViewModel() - { - - DateGr = x.Date.Date, - DateFa = x.Date.Date.ToFarsi(), - RollCallTimesList = rollCallsList.Where(y => x.Date.Date == y.StartDate!.Value.Date).Select(y => - new RollCallTimeViewModel() - { - StartDate = y.StartDate.Value.ToString("HH:mm"), - EndDate = y.EndDate!.Value.ToString("HH:mm") - }), - TotalWorkingHoursSpan = new TimeSpan(rollCallsList.Where(y => x.Date.Date == y.StartDate!.Value.Date) - .Sum(y => (y.EndDate!.Value - y.StartDate.Value).Ticks)), - Reason = leavesList.FirstOrDefault(y => y.EndLeave >= x.Date.Date && y.StartLeave <= x.Date.Date)?.LeaveType ?? "" - }); - result = result.Select(x => new RollCallViewModel() - { - EmployeeFullName = employeeName.EmployeeFullName, - PersonnelCode = personnelCode.ToString(), - DateGr = x.DateGr, - DateFa = x.DateFa, - DayOfWeekFa = x.DateGr.DayOfWeek.DayOfWeeKToPersian(), - IsHoliday = _holidayItemApplication.IsHoliday(x.DateGr), - IsAbsent = !x.RollCallTimesList.Any(), - RollCallTimesList = x.RollCallTimesList, - TotalWorkingHours = $"{x.TotalWorkingHoursSpan.TotalHours.ToString("0")}:{x.TotalWorkingHoursSpan.Minutes.ToString("00")}", - }).ToList(); - return new EmployeeRollCallsByMonthViewModel() - { - PersianMonthName = selectedMonthPersian.ToString("MMMM"), - PersianYear = selectedMonthPersian.ToString("yyyy"), - DateGr = selectedMonthFirstDay, - RollCalls = result, - DateIndex = activeMonthsList.Count > 1 ? activeMonthsList.Skip(1).First().ToString("yyyy/MM/dd") : null - - }; - } - - //سوابق حضور غیاب کارگاه - public RollCallsByDateViewModel GetWorkshopRollCallHistory(RollCallSearchModel searchModel) - { - - //initialize - - DateTime searchDurationEnd = DateTime.Now.AddDays(-1).Date; - DateTime searchDurationStart = searchDurationEnd.AddDays(-16); - - - - //override if user has entered inputs (dates must be validated in the application layer) - if (!string.IsNullOrWhiteSpace(searchModel.StarDateFa) && !string.IsNullOrWhiteSpace(searchModel.StarDateFa)) - { - searchDurationEnd = searchModel.EndDateFa.ToGeorgianDateTime().Date; - searchDurationStart = searchModel.StarDateFa.ToGeorgianDateTime().AddDays(-1).Date; - } - - - - else - if (!string.IsNullOrWhiteSpace(searchModel.ExactDateFa)) - { - searchDurationEnd = searchModel.ExactDateFa.ToGeorgianDateTime().Date; - searchDurationStart = searchModel.ExactDateFa.ToGeorgianDateTime().AddDays(-1).Date; - } - - - if (searchDurationEnd < searchDurationStart) - return new(); - - - - DateTime dateIndex = searchDurationEnd.AddDays(-1 * (searchModel.DateIndex)).Date; - - if (dateIndex <= searchDurationStart) - return new(); - - - //get leaves for workshop that have been activated in dateIndex date - var leavesQuery = _context.LeaveList.Where(x => x.WorkshopId == searchModel.WorkshopId && - x.IsAccepted && (x.LeaveType == "استعلاجی" || (x.LeaveType == "استحقاقی" && x.PaidLeaveType == "روزانه")) && - x.EndLeave.Date >= dateIndex && x.StartLeave.Date <= dateIndex); - - //roll calls for current workshop where shift start is in dateIndex date (filters today's shifts) - var rollCallsQuery = _context.RollCalls - .Where(x => x.WorkshopId == searchModel.WorkshopId && x.StartDate.HasValue && x.EndDate.HasValue && x.StartDate < DateTime.Now.Date && - x.StartDate.Value.Date == dateIndex.Date); - - - //get active employees of workshop in dateIndex date - var activeEmployeesQuery = - _context.RollCallEmployees.Include(x => x.EmployeesStatus) - .Where(x => x.WorkshopId == searchModel.WorkshopId && x.EmployeesStatus.Any(y => y.EndDate.Date >= dateIndex && y.StartDate.Date <= dateIndex)); - + //جستجوی سوابق حضور غیاب بر اساس کارمند + public EmployeeRollCallsByMonthViewModel GetEmployeeRollCallsHistory(long employeeId, long workshopId, + DateTime? startDateTime, DateTime? endDateTime, DateTime? exactDateTime, DateTime? dateIndex) + { + + //get RollCallEmployee and RollCallEmployeeStatus for that employee in that workshop + var employeeRollCallStatuses = _context.RollCallEmployees.Include(x => x.EmployeesStatus) + .FirstOrDefault(x => x.EmployeeId == employeeId && x.WorkshopId == workshopId); + + //if none was found return empty + if (employeeRollCallStatuses == null) + return new(); + + //this list will have all the months which employee was active in + var activeMonths = new List(); + + //filling the list + foreach (var status in employeeRollCallStatuses.EmployeesStatus) + { + var persianEndDate = new PersianDateTime(status.EndDate.Date); + var persianStartDate = new PersianDateTime(status.StartDate.Date); + + var persianStartFirstDayOfMonth = new PersianDateTime(persianStartDate.Year, persianStartDate.Month, 1); + + for (PersianDateTime start = persianStartFirstDayOfMonth; start <= persianEndDate && start < PersianDateTime.Today.Date; start = start.AddMonths(1)) + { + activeMonths.Add(start); + } + } + //might have duplicated records, this is the reason for distinct + var activeMonthsList = activeMonths.OrderByDescending(x => x.Date).Distinct().ToList(); + + PersianDateTime startSearch = new(); + PersianDateTime endSearch = new(); + + //if search has these parameters below + if (startDateTime.HasValue && endDateTime.HasValue) + { + //change them to persian date time and save them + startSearch = new PersianDateTime(startDateTime.Value); + endSearch = new PersianDateTime(endDateTime.Value); + + //get the months that include these dates + activeMonthsList = activeMonthsList.Where(x => x.Year >= startSearch.Year && x.Month >= startSearch.Month && x.Year <= endSearch.Year && x.Month <= endSearch.Month).ToList(); + } + //if exact datetime is given + if (exactDateTime.HasValue) + { + //start and end will be the same date + startSearch = new PersianDateTime(exactDateTime.Value); + endSearch = startSearch; + //get the + activeMonthsList = activeMonthsList.Where(x => x.Year >= startSearch.Year && x.Month >= startSearch.Month && x.Year <= endSearch.Year && x.Month <= endSearch.Month).ToList(); + } + + if (dateIndex != null) + { + var persianDateIndex = new PersianDateTime(dateIndex.Value); + var dateIndexFirstOfMonth = persianDateIndex.AddDays(-(persianDateIndex.Day - 1)); + activeMonthsList = activeMonthsList.Where(x => dateIndexFirstOfMonth >= x).ToList(); + } + + if (!activeMonthsList.Any()) return new(); + + //get the last month which user was active in + PersianDateTime selectedMonthPersian = activeMonthsList.First(); + + DateTime selectedMonthFirstDay = selectedMonthPersian; + DateTime nextMonthFirstDay = selectedMonthPersian.AddMonths(1); + + var statusesOfMonth = employeeRollCallStatuses.EmployeesStatus.Where(x => x.EndDate >= selectedMonthFirstDay && + x.StartDate < nextMonthFirstDay); + + + + var leavesQuery = + _context.LeaveList.Where(x => (x.LeaveType == "استعلاجی" || (x.LeaveType == "استحقاقی" && x.PaidLeaveType == "روزانه")) && + x.IsAccepted && + x.EndLeave >= selectedMonthFirstDay && x.StartLeave < nextMonthFirstDay && x.WorkshopId == workshopId); + + var rollCalls = _context.RollCalls.Where(x => + !leavesQuery.Any(y => + y.StartLeave.Date <= x.StartDate.Value.Date && y.EndLeave.Date >= x.StartDate.Value.Date) && + x.EmployeeId == employeeId && x.WorkshopId == workshopId && x.StartDate != null && + x.StartDate >= selectedMonthFirstDay && x.StartDate < nextMonthFirstDay); + + var personnelCode = + _context.PersonnelCodeSet.FirstOrDefault(x => x.EmployeeId == employeeId && x.WorkshopId == workshopId)?.PersonnelCode; + + var employeeName = _context.RollCallEmployees.Where(x => x.WorkshopId == workshopId).Select(x => new { x.EmployeeId, x.EmployeeFullName }) + .FirstOrDefault(x => x.EmployeeId == employeeId); + + var rollCallsList = rollCalls.ToList(); + var leavesList = leavesQuery.ToList(); + + int dateRange = (int)(nextMonthFirstDay - selectedMonthFirstDay).TotalDays; + + var todayDate = DateTime.Now.Date; + //all the dates from start to end, to be compared with present days to get absent dates + var completeDaysList = Enumerable.Range(0, dateRange).Select(offset => selectedMonthFirstDay.AddDays(offset).Date).Where(x => x.Date < todayDate); + + //if user search range is within a month for example, we dont want 30/31/29 days for month, we want it to be the size of the search range + //user input = 2024/04/15~2024/04/21, output days count is 21-15+1=6 days from 15th to 21st + if (exactDateTime.HasValue || (startDateTime.HasValue && endDateTime.HasValue)) + completeDaysList = completeDaysList.Where(x => x.Date >= startSearch.Date && x.Date <= endSearch.Date); + + var result = completeDaysList.Where(x => !rollCallsList.Any(y => y.StartDate.Value.Date == x.Date && y.EndDate == null) && + statusesOfMonth.Any(y => x >= y.StartDate.Date && x <= y.EndDate.Date)) + .Select(x => + { + var leave = leavesList.FirstOrDefault(y => y.EndLeave >= x.Date.Date && y.StartLeave <= x.Date.Date); + return new RollCallViewModel() + { + DateGr = x.Date.Date, + DateFa = x.Date.Date.ToFarsi(), + RollCallTimesList = rollCallsList.Where(y => x.Date.Date == y.StartDate!.Value.Date).Select(y => + new RollCallTimeViewModel() + { + StartDate = y.StartDate.Value.ToString("HH:mm"), + EndDate = y.EndDate!.Value.ToString("HH:mm") + }), + TotalWorkingHoursSpan = new TimeSpan(rollCallsList.Where(y => x.Date.Date == y.StartDate!.Value.Date) + .Sum(y => (y.EndDate!.Value - y.StartDate.Value).Ticks)), + Reason = leave?.LeaveType ?? "", + HasLeave = (leave?.PaidLeaveType == "روزانه" || leave?.LeaveType == "استعلاجی") ? true : false + }; + }); + result = result.Select(x => new RollCallViewModel() + { + EmployeeFullName = employeeName.EmployeeFullName, + EmployeeId = employeeId, + PersonnelCode = personnelCode.ToString(), + DateGr = x.DateGr, + DateFa = x.DateFa, + DayOfWeekFa = x.DateGr.DayOfWeek.DayOfWeeKToPersian(), + IsHoliday = _holidayItemApplication.IsHoliday(x.DateGr), + IsAbsent = !x.RollCallTimesList.Any(), + RollCallTimesList = x.RollCallTimesList, + TotalWorkingHours = $"{(int)x.TotalWorkingHoursSpan.TotalHours}:{x.TotalWorkingHoursSpan.Minutes:00}", + }).ToList(); + return new EmployeeRollCallsByMonthViewModel() + { + PersianMonthName = selectedMonthPersian.ToString("MMMM"), + PersianYear = selectedMonthPersian.ToString("yyyy"), + DateGr = selectedMonthFirstDay, + RollCalls = result, + DateIndex = activeMonthsList.Count > 1 ? activeMonthsList.Skip(1).First().ToString("yyyy/MM/dd") : null + + }; + } + public void AddRange(List rollCalls) + { + _context.RollCalls.AddRange(rollCalls); + } + + + + //سوابق حضور غیاب کارگاه + public RollCallsByDateViewModel GetWorkshopRollCallHistory(RollCallSearchModel searchModel) + { + + //initialize + + DateTime searchDurationEnd = DateTime.Now.AddDays(-1).Date; + DateTime searchDurationStart = searchDurationEnd.AddDays(-16); + + + + //override if user has entered inputs (dates must be validated in the application layer) + if (!string.IsNullOrWhiteSpace(searchModel.StarDateFa) && !string.IsNullOrWhiteSpace(searchModel.StarDateFa)) + { + searchDurationEnd = searchModel.EndDateFa.ToGeorgianDateTime().Date; + searchDurationStart = searchModel.StarDateFa.ToGeorgianDateTime().AddDays(-1).Date; + } + + + + else + if (!string.IsNullOrWhiteSpace(searchModel.ExactDateFa)) + { + searchDurationEnd = searchModel.ExactDateFa.ToGeorgianDateTime().Date; + searchDurationStart = searchModel.ExactDateFa.ToGeorgianDateTime().AddDays(-1).Date; + } + + + if (searchDurationEnd < searchDurationStart) + return new(); + + + + DateTime dateIndex = searchDurationEnd.AddDays(-1 * (searchModel.DateIndex)).Date; + + if (dateIndex <= searchDurationStart) + return new(); + + + //get leaves for workshop that have been activated in dateIndex date + var leavesQuery = _context.LeaveList.Where(x => x.WorkshopId == searchModel.WorkshopId && + x.IsAccepted && (x.LeaveType == "استعلاجی" || (x.LeaveType == "استحقاقی" && x.PaidLeaveType == "روزانه")) && + x.EndLeave.Date >= dateIndex && x.StartLeave.Date <= dateIndex); + + //roll calls for current workshop where shift start is in dateIndex date (filters today's shifts) + var rollCallsQuery = _context.RollCalls + .Where(x => x.WorkshopId == searchModel.WorkshopId && x.StartDate.HasValue && x.StartDate < DateTime.Now.Date && + x.StartDate.Value.Date == dateIndex.Date); + + + //get active employees of workshop in dateIndex date + var activeEmployeesQuery = + _context.RollCallEmployees.Include(x => x.EmployeesStatus) + .Where(x => x.WorkshopId == searchModel.WorkshopId && x.EmployeesStatus.Any(y => y.EndDate.Date >= dateIndex && y.StartDate.Date <= dateIndex) + && !rollCallsQuery.Any(rc => rc.EmployeeId == x.EmployeeId && !rc.EndDate.HasValue)); + + + + + + if (searchModel.EmployeeId > 0) + { + rollCallsQuery = rollCallsQuery.Where(x => x.EmployeeId == searchModel.EmployeeId); + activeEmployeesQuery = activeEmployeesQuery.Where(x => x.EmployeeId == searchModel.EmployeeId); + leavesQuery = leavesQuery.Where(x => x.EmployeeId == searchModel.EmployeeId); + } + var personnelCodeList = + _context.PersonnelCodeSet.Where(x => activeEmployeesQuery.Any(y => y.EmployeeId == x.EmployeeId && y.WorkshopId == x.WorkshopId)); + var activatedEmployeesList = activeEmployeesQuery.ToList(); + rollCallsQuery = rollCallsQuery.Where(x => x.EndDate.HasValue); + var rollCallsList = rollCallsQuery.ToList(); + var leavesList = leavesQuery.ToList(); + rollCallsList = rollCallsList.Where(x => leavesList.All(y => y.EmployeeId != x.EmployeeId)).ToList(); + var result = new RollCallsByDateViewModel() + { + DateGr = dateIndex, + DayOfWeekFa = dateIndex.DayOfWeek.DayOfWeeKToPersian(), + IsHoliday = _holidayItemApplication.IsHoliday(dateIndex), + DateFa = dateIndex.ToFarsi(), + ActiveEmployees = activatedEmployeesList.Select(x => + { + var leave = leavesList.FirstOrDefault(y => y.EmployeeId == x.EmployeeId); + var employeeRollCallsForDate = rollCallsList.Where(y => y.EmployeeId == x.EmployeeId).ToList(); + return new RollCallViewModel() + { + EmployeeFullName = x.EmployeeFullName, + EmployeeId = x.EmployeeId, + Reason = leave == null ? "" : $"{leave.LeaveType}-{leave.PaidLeaveType}", + RollCallTimesList = employeeRollCallsForDate.Select(y => new RollCallTimeViewModel() + { + EndDate = y.EndDate!.Value.ToString("HH:mm"), + StartDate = y.StartDate!.Value.ToString("HH:mm") + }), + HasLeave = leave != null, + IsAbsent = !employeeRollCallsForDate.Any(), + TotalWorkingHoursSpan = new TimeSpan(employeeRollCallsForDate.Sum(y => (y.EndDate!.Value - y.StartDate!.Value).Ticks)), + PersonnelCode = personnelCodeList.FirstOrDefault(y => y.EmployeeId == x.EmployeeId)?.PersonnelCode.ToString() + }; + }) + }; + result.ActiveEmployees = result.ActiveEmployees.Select(x => new RollCallViewModel() + { + EmployeeFullName = x.EmployeeFullName, + EmployeeId = x.EmployeeId, + Reason = x.Reason, + RollCallTimesList = x.RollCallTimesList, + HasLeave = x.HasLeave, + IsAbsent = x.IsAbsent, + PersonnelCode = x.PersonnelCode, + TotalWorkingHours = $"{(int)x.TotalWorkingHoursSpan.TotalHours}:{(x.TotalWorkingHoursSpan.Minutes):00}" + }); + return result; + } - if (searchModel.EmployeeId > 0) - { - rollCallsQuery = rollCallsQuery.Where(x => x.EmployeeId == searchModel.EmployeeId); - activeEmployeesQuery = activeEmployeesQuery.Where(x => x.EmployeeId == searchModel.EmployeeId); - leavesQuery = leavesQuery.Where(x => x.EmployeeId == searchModel.EmployeeId); - } + //گزارش آنلاین حضور غیاب کارگاه + public CurrentDayRollCall GetWorkshopCurrentDayRollCalls(long workshopId) + { + var date = DateTime.Now.Date; - var personnelCodeList = - _context.PersonnelCodeSet.Where(x => activeEmployeesQuery.Any(y => y.EmployeeId == x.EmployeeId)); - var rollCallsList = rollCallsQuery.ToList(); - var activatedEmployeesList = activeEmployeesQuery.ToList(); - var leavesList = leavesQuery.ToList(); - - rollCallsList = rollCallsList.Where(x => leavesList.All(y => y.EmployeeId != x.EmployeeId)).ToList(); - var result = new RollCallsByDateViewModel() - { - DateGr = dateIndex, - DayOfWeekFa = dateIndex.DayOfWeek.DayOfWeeKToPersian(), - IsHoliday = _holidayItemApplication.IsHoliday(dateIndex), - DateFa = dateIndex.ToFarsi(), - ActiveEmployees = activatedEmployeesList.Select(x => - { - var leave = leavesList.FirstOrDefault(y => y.EmployeeId == x.EmployeeId); - var employeeRollCallsForDate = rollCallsList.Where(y => y.EmployeeId == x.EmployeeId).ToList(); - - return new RollCallViewModel() - { - EmployeeFullName = x.EmployeeFullName, - EmployeeId = x.EmployeeId, - Reason = leave == null ? "" : $"{leave.LeaveType}-{leave.PaidLeaveType}", - RollCallTimesList = employeeRollCallsForDate.Select(y => new RollCallTimeViewModel() - { - EndDate = y.EndDate!.Value.ToString("HH:mm"), - StartDate = y.StartDate!.Value.ToString("HH:mm") - }), - HasLeave = leave != null, - IsAbsent = !employeeRollCallsForDate.Any(), - TotalWorkingHoursSpan = new TimeSpan(employeeRollCallsForDate.Sum(y => (y.EndDate!.Value - y.StartDate!.Value).Ticks)), - PersonnelCode = personnelCodeList.FirstOrDefault(y => y.EmployeeId == x.EmployeeId)?.PersonnelCode.ToString() - }; - }) - }; - result.ActiveEmployees = result.ActiveEmployees.Select(x => new RollCallViewModel() - { - EmployeeFullName = x.EmployeeFullName, - EmployeeId = x.EmployeeId, - Reason = x.Reason, - RollCallTimesList = x.RollCallTimesList, - HasLeave = x.HasLeave, - IsAbsent = x.IsAbsent, - PersonnelCode = x.PersonnelCode, - TotalWorkingHours = $"{x.TotalWorkingHoursSpan.TotalHours.ToString("0")}:{x.TotalWorkingHoursSpan.Minutes.ToString("00")}" - }); - return result; - } - - - - //گزارش آنلاین حضور غیاب کارگاه - public CurrentDayRollCall GetWorkshopCurrentDayRollCalls(long workshopId) - { - var date = DateTime.Now.Date; - - - //get active leaves for workshop which are active today and accepted and are either روزانه and استحقاقی or استعلاجی - var leaves = _context.LeaveList - .Where(x => - (x.WorkshopId == workshopId && x.EndLeave.Date >= date && x.StartLeave.Date <= date && x.IsAccepted) && - ((x.LeaveType == "استعلاجی" || (x.LeaveType == "استحقاقی" && x.PaidLeaveType == "روزانه")) || (x.LeaveType == "استحقاقی" && x.PaidLeaveType == "ساعتی" && x.StartLeave <= DateTime.Now && x.EndLeave >= DateTime.Now)) - ); - - var personnelCodes = _context.PersonnelCodeSet.Where(x => x.WorkshopId == workshopId).ToList(); - - //get currently working employees with leftWork table - //var workingEmployees = - // _context.LeftWorkList.Where(x => x.WorkshopId == workshopId && x.StartWorkDate < date && x.LeftWorkDate.Date > date); - - - - //get activated employees - var activeEmployees = - _context.RollCallEmployees.Include(x => x.EmployeesStatus) - .Where(x => x.WorkshopId == workshopId && x.IsActiveString == "true" && x.EmployeesStatus.Any(y => - y.StartDate.Date <= date && - y.EndDate.Date >= date)); - - - //get today's roll calls - var rollCallsQuery = _context.RollCalls.Where(x => - x.WorkshopId == workshopId && x.StartDate.Value.Date == date); - - - - - var mustBePresent = activeEmployees.Where(x => !leaves.Any(y => y.EmployeeId == x.EmployeeId)); - - - - var filteredRollCallQuery = rollCallsQuery.Where(x => mustBePresent - .Any(y => x.EmployeeId == y.EmployeeId)).ToList(); - - - var nameReferences = activeEmployees.ToList(); - - //presents list is ready - var presentEmployees = filteredRollCallQuery.GroupBy(x => x.EmployeeId).Select(x => new RollCallViewModel() - { - PersonnelCode = personnelCodes - .FirstOrDefault(y => y.EmployeeId == x.Key)? - .PersonnelCode.ToString(), - EmployeeFullName = nameReferences.FirstOrDefault(y => x.Key == y.EmployeeId)?.EmployeeFullName??"-", - EmployeeId = x.FirstOrDefault()!.EmployeeId, - TotalWorkingHoursSpan = new TimeSpan(x.Where(y => y.EndDate != null).Sum(y => (y.EndDate!.Value - y.StartDate!.Value).Ticks)), - RollCallTimesList = x.Select(y => new RollCallTimeViewModel() - { - StartDate = y.StartDate!.Value.ToString("HH:mm"), - EndDate = y.EndDate?.ToString("HH:mm") - }).ToList() - - - }); - - presentEmployees = presentEmployees.Select(x => new RollCallViewModel() - { - PersonnelCode = x.PersonnelCode, - EmployeeFullName = x.EmployeeFullName, - EmployeeId = x.EmployeeId, - TotalWorkingHours = - $"{(int)x.TotalWorkingHoursSpan.TotalHours}:{x.TotalWorkingHoursSpan.Minutes.ToString("00")}", - RollCallTimesList = x.RollCallTimesList - }).OrderBy(x => x.RollCallTimesList.Any(y => y.EndDate != null)).ToList(); - - //absent ones are those who are active and not on the roll call list - var absentsQuery = activeEmployees.AsEnumerable() - .ExceptBy(presentEmployees.Select(x => x.EmployeeId), e => e.EmployeeId).ToList(); - - - - //get today's active leaves - var employeesWithLeave = leaves.AsEnumerable() - .Where(x => absentsQuery.Any(y => y.EmployeeId == x.EmployeeId)) - .Select(x => new { x.EmployeeId, x.LeaveType }).ToList(); - - //join leave and absents - var absentsViewModel = absentsQuery.Select(x => new AbsentEmployeeViewModel() - { - PersonnelCode = personnelCodes - .FirstOrDefault(y => y.EmployeeId == x.EmployeeId)? - .PersonnelCode.ToString(), - EmployeeId = x.EmployeeId, - EmployeeFullName = nameReferences.FirstOrDefault(y => x.EmployeeId == y.EmployeeId)?.EmployeeFullName ?? "-", - HasLeave = employeesWithLeave.Any(y => y.EmployeeId == x.EmployeeId), - Reason = employeesWithLeave.FirstOrDefault(y => y.EmployeeId == x.EmployeeId)?.LeaveType - }).ToList(); - - return new CurrentDayRollCall() - { - AbsentEmployees = absentsViewModel.ToList(), - PresentEmployees = presentEmployees.ToList() - }; - } - - #endregion - public long Flag(long employeeId, long workshopId) + //get active leaves for workshop which are active today and accepted and are either روزانه and استحقاقی or استعلاجی + var leaves = _context.LeaveList + .Where(x => + (x.WorkshopId == workshopId && x.EndLeave.Date >= date && x.StartLeave.Date <= date && x.IsAccepted) && + ((x.LeaveType == "استعلاجی" || (x.LeaveType == "استحقاقی" && x.PaidLeaveType == "روزانه")) || (x.LeaveType == "استحقاقی" && x.PaidLeaveType == "ساعتی" && x.StartLeave <= DateTime.Now && x.EndLeave >= DateTime.Now)) + ); + + var personnelCodes = _context.PersonnelCodeSet.Where(x => x.WorkshopId == workshopId).ToList(); + + //get currently working employees with leftWork table + //var workingEmployees = + // _context.LeftWorkList.Where(x => x.WorkshopId == workshopId && x.StartWorkDate < date && x.LeftWorkDate.Date > date); + + + + //get activated employees + var activeEmployees = + _context.RollCallEmployees.Include(x => x.EmployeesStatus) + .Where(x => x.WorkshopId == workshopId && x.IsActiveString == "true" && x.EmployeesStatus.Any(y => + y.StartDate.Date <= date && + y.EndDate.Date >= date)); + + + //get today's roll calls + var rollCallsQuery = _context.RollCalls.Where(x => + x.WorkshopId == workshopId && (x.StartDate.Value.Date == date || x.EndDate == null)); + + + + + var mustBePresent = activeEmployees.Where(x => !leaves.Any(y => y.EmployeeId == x.EmployeeId)); + + + + var filteredRollCallQuery = rollCallsQuery.Where(x => mustBePresent + .Any(y => x.EmployeeId == y.EmployeeId)).ToList(); + + + var nameReferences = activeEmployees.ToList(); + + //presents list is ready + var presentEmployees = filteredRollCallQuery.GroupBy(x => x.EmployeeId).Select(x => new RollCallViewModel() + { + PersonnelCode = personnelCodes + .FirstOrDefault(y => y.EmployeeId == x.Key)? + .PersonnelCode.ToString(), + EmployeeFullName = nameReferences.FirstOrDefault(y => x.Key == y.EmployeeId).EmployeeFullName, + EmployeeId = x.FirstOrDefault()!.EmployeeId, + TotalWorkingHoursSpan = new TimeSpan(x.Where(y => y.EndDate != null).Sum(y => (y.EndDate!.Value - y.StartDate!.Value).Ticks)), + RollCallTimesList = x.Select(y => new RollCallTimeViewModel() + { + StartDate = y.StartDate!.Value.ToString("HH:mm"), + EndDate = y.EndDate?.ToString("HH:mm") + }).ToList() + + + }); + + presentEmployees = presentEmployees.Select(x => new RollCallViewModel() + { + PersonnelCode = x.PersonnelCode, + EmployeeFullName = x.EmployeeFullName, + EmployeeId = x.EmployeeId, + TotalWorkingHours = + $"{(int)x.TotalWorkingHoursSpan.TotalHours}:{x.TotalWorkingHoursSpan.Minutes.ToString("00")}", + RollCallTimesList = x.RollCallTimesList + }).OrderBy(x => x.RollCallTimesList.Any(y => y.EndDate != null)).ToList(); + + //absent ones are those who are active and not on the roll call list + var absentsQuery = activeEmployees.AsEnumerable() + .ExceptBy(presentEmployees.Select(x => x.EmployeeId), e => e.EmployeeId).ToList(); + + + + //get today's active leaves + var employeesWithLeave = leaves.AsEnumerable() + .Where(x => absentsQuery.Any(y => y.EmployeeId == x.EmployeeId)) + .Select(x => new { x.EmployeeId, x.LeaveType }).ToList(); + + //join leave and absents + var absentsViewModel = absentsQuery.Select(x => new AbsentEmployeeViewModel() + { + PersonnelCode = personnelCodes + .FirstOrDefault(y => y.EmployeeId == x.EmployeeId)? + .PersonnelCode.ToString(), + EmployeeId = x.EmployeeId, + EmployeeFullName = nameReferences.FirstOrDefault(y => x.EmployeeId == y.EmployeeId).EmployeeFullName, + HasLeave = employeesWithLeave.Any(y => y.EmployeeId == x.EmployeeId), + Reason = employeesWithLeave.FirstOrDefault(y => y.EmployeeId == x.EmployeeId)?.LeaveType + }).ToList(); + + return new CurrentDayRollCall() + { + AbsentEmployees = absentsViewModel.ToList(), + PresentEmployees = presentEmployees.ToList() + }; + } + + public void RemoveEmployeeRollCallsInDate(long workshopId, long employeeId, DateTime date) + { + var rollCalls = _context.RollCalls.Where(x => x.WorkshopId == workshopId && x.EmployeeId == employeeId && x.StartDate.Value.Date == date.Date); + if (!rollCalls.Any()) + return; + _context.RollCalls.RemoveRange(rollCalls); + } + public List GetWorkshopEmployeeRollCallsForDate(long workshopId, long employeeId, DateTime date) + { + var names = _context.RollCallEmployees.Where(x => x.WorkshopId == workshopId && x.EmployeeId == employeeId).Select(x => new + { + x.EmployeeId, + x.EmployeeFullName + }).ToList(); + var rollcalls = _context.RollCalls + .Where(x => x.WorkshopId == workshopId && x.EmployeeId == employeeId && x.StartDate.Value.Date == date.Date) + .Select(x => new RollCallViewModel() + { + Id = x.id, + StartDate = x.StartDate.Value, + EndDate = x.EndDate.Value, + DateFa = x.StartDate.Value.Date.ToFarsi(), + StartDateFa = x.StartDate.Value.ToFarsi(), + EndDateFa = x.EndDate != null ? x.EndDate.Value.ToFarsi() : null + }).ToList(); + return rollcalls.Select(x => new RollCallViewModel() + { + Id = x.Id, + StartDate = x.StartDate, + EndDate = x.EndDate, + StartTimeString = x.StartDate!.Value.ToString("HH:mm"), + EndTimeString = x.EndDate?.ToString("HH:mm"), + DateFa = x.DateFa, + StartDateFa = x.StartDateFa, + EndDateFa = x.EndDateFa, + EmployeeId = names.FirstOrDefault(e => e.EmployeeId == employeeId)!.EmployeeId, + EmployeeFullName = names.FirstOrDefault(e => e.EmployeeId == employeeId)!.EmployeeFullName + }).ToList(); + } + + + #endregion + public long Flag(long employeeId, long workshopId) { var checkDate = DateTime.Now.AddDays(-3); var query = _context.RollCalls diff --git a/ServiceHost/Areas/AdminNew/Pages/Company/Task/Index.cshtml b/ServiceHost/Areas/AdminNew/Pages/Company/Task/Index.cshtml index eae69935..1eeb032f 100644 --- a/ServiceHost/Areas/AdminNew/Pages/Company/Task/Index.cshtml +++ b/ServiceHost/Areas/AdminNew/Pages/Company/Task/Index.cshtml @@ -60,7 +60,7 @@ @* *@ @@ -73,7 +73,7 @@ @* *@ } diff --git a/ServiceHost/Areas/AdminNew/Pages/Company/Task/Index.cshtml.cs b/ServiceHost/Areas/AdminNew/Pages/Company/Task/Index.cshtml.cs index 9d2b011e..d2c4da73 100644 --- a/ServiceHost/Areas/AdminNew/Pages/Company/Task/Index.cshtml.cs +++ b/ServiceHost/Areas/AdminNew/Pages/Company/Task/Index.cshtml.cs @@ -179,15 +179,15 @@ namespace ServiceHost.Areas.AdminNew.Pages.Company.Task }); } - //public IActionResult OnGetRequestCount() - //{ - // var requestCount = _taskApplication.GetRequestedTasksCount(); - // return new JsonResult(new - // { - // isSuccess = true, - // result = requestCount - // }); - //} + public IActionResult OnGetRequestCount() + { + var requestCount = _taskApplication.GetRequestedTasksCount(); + return new JsonResult(new + { + isSuccess = true, + result = requestCount + }); + } // برای ارجاع دادن public IActionResult OnPostCreateAssign(OperationModalViewModel command) diff --git a/ServiceHost/Areas/AdminNew/Pages/Company/Ticket/Index.cshtml b/ServiceHost/Areas/AdminNew/Pages/Company/Ticket/Index.cshtml index b9e0a200..bcaf4929 100644 --- a/ServiceHost/Areas/AdminNew/Pages/Company/Ticket/Index.cshtml +++ b/ServiceHost/Areas/AdminNew/Pages/Company/Ticket/Index.cshtml @@ -158,31 +158,30 @@ جزئیات - @if (item.Status != "بسته شده") - { - - } + + + + +
+
+
+ + +
+ + +
+
+
+ +
+ لیست سوابق حضور و غیاب +
+ +
+
+
+
@@ -203,6 +261,7 @@
خروج
تجمیع در خروج
مجموع ساعات کاری
+
عملیات
@@ -309,14 +368,26 @@ + + + + @section Script { + - + } \ No newline at end of file diff --git a/ServiceHost/Areas/Client/Pages/Company/RollCall/CaseHistory.cshtml.cs b/ServiceHost/Areas/Client/Pages/Company/RollCall/CaseHistory.cshtml.cs index 0bf265db..6945fa6e 100644 --- a/ServiceHost/Areas/Client/Pages/Company/RollCall/CaseHistory.cshtml.cs +++ b/ServiceHost/Areas/Client/Pages/Company/RollCall/CaseHistory.cshtml.cs @@ -1,4 +1,6 @@ using _0_Framework.Application; +using Company.Domain.EmployeeAgg; +using CompanyManagment.App.Contracts.Error; using CompanyManagment.App.Contracts.RollCall; using CompanyManagment.App.Contracts.RollCallEmployee; using CompanyManagment.App.Contracts.Workshop; @@ -7,6 +9,9 @@ using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc.RazorPages; using System.Security.Claims; +using CompanyManagment.App.Contracts.Leave; +using static Microsoft.EntityFrameworkCore.DbLoggerCategory.Database; +using static System.Runtime.InteropServices.JavaScript.JSType; namespace ServiceHost.Areas.Client.Pages.Company.RollCall { @@ -19,6 +24,7 @@ namespace ServiceHost.Areas.Client.Pages.Company.RollCall private readonly IRollCallEmployeeApplication _rollCallEmployeeApplication; private readonly IRollCallApplication _rollCallApplication; private readonly IYearlySalaryApplication _yearlySalaryApplication; + private readonly ILeaveApplication _leaveApplication; public RollCallsByDateViewModel RollCallViewModels { get; set; } public EmployeeRollCallsByMonthViewModel RollCallEmployeeViewModels { get; set; } @@ -28,7 +34,7 @@ namespace ServiceHost.Areas.Client.Pages.Company.RollCall public RollCallSearchModel SearchModel { get; set; } = new(); public List YearlyList { get; set; } - public CaseHistoryModel(IAuthHelper authHelper, IPasswordHasher passwordHasher, IRollCallEmployeeApplication rollCallEmployeeApplication, IWorkshopApplication workshopApplication, IRollCallApplication rollCallApplication, IYearlySalaryApplication yearlySalaryApplication) + public CaseHistoryModel(IAuthHelper authHelper, IPasswordHasher passwordHasher, IRollCallEmployeeApplication rollCallEmployeeApplication, IWorkshopApplication workshopApplication, IRollCallApplication rollCallApplication, IYearlySalaryApplication yearlySalaryApplication, ILeaveApplication leaveApplication) { _authHelper = authHelper; _passwordHasher = passwordHasher; @@ -36,6 +42,7 @@ namespace ServiceHost.Areas.Client.Pages.Company.RollCall _workshopApplication = workshopApplication; _rollCallApplication = rollCallApplication; _yearlySalaryApplication = yearlySalaryApplication; + _leaveApplication = leaveApplication; } @@ -111,5 +118,141 @@ namespace ServiceHost.Areas.Client.Pages.Company.RollCall }); } } + + + public IActionResult OnGetEmployeeList() + { + var workshopHash = User.FindFirstValue("WorkshopSlug"); + var workshopId = _passwordHasher.SlugDecrypt(workshopHash); + if (workshopId <= 0) + return new JsonResult(new + { + success = false, + message = "کارگاه ای یافت نشد", + }); + + var resultData = _rollCallEmployeeApplication.GetRollCallEmployeesByWorkshopId(workshopId); + + return new JsonResult(new + { + success = true, + data = resultData + }); + } + + + public IActionResult OnGetCreate() + { + var command = new CreateOrEditEmployeeRollCall(); + return Partial("ModalAddRollCall", command); + } + + public IActionResult OnGetCheckEmployeeData(long employeeId, string date) + { + bool isSuccess = false; + + + var workshopHash = User.FindFirstValue("WorkshopSlug"); + var workshopId = _passwordHasher.SlugDecrypt(workshopHash); + if (workshopId < 1) + return new JsonResult(new + { + success = false, + message = "کارگاهی یافت نشد!", + }); + + List resultData= new List(); + + if(!string.IsNullOrWhiteSpace(date)) + { + resultData = _rollCallApplication.GetWorkshopEmployeeRollCallsForDate(workshopId, employeeId, date); + isSuccess = resultData.Any(); + } + + var result=_leaveApplication.HasLeave(workshopId, employeeId, date); + var isLeave = result.IsSuccedded ? result.Data : false; + + var isNullEndDate = resultData.Any(x => x.EndDate == null); + + + return new JsonResult(new + { + success = isSuccess, + data = resultData, + hasLeave = isLeave, + hasNullEndDate = isNullEndDate + }); + } + + + public IActionResult OnGetEdit(long employeeId, string date) + { + var workshopHash = User.FindFirstValue("WorkshopSlug"); + var workshopId = _passwordHasher.SlugDecrypt(workshopHash); + if (workshopId < 1) + { + var resultError = new ErrorViewModel() + { + Message = "کارگاه شما یافت نشده است." + }; + return Partial("../Error/_ErrorModal", resultError); + } + + + var result = _rollCallApplication.GetWorkshopEmployeeRollCallsForDate(workshopId, employeeId, date); + + var name = _rollCallEmployeeApplication.GetByEmployeeIdAndWorkshopId(employeeId, workshopId); + var command = new EmployeeRollCallsViewModel() + { + EmployeeFullName = name.EmployeeFullName, + EmployeeId = employeeId, + DateFa = date, + RollCalls = result + }; + + return Partial("ModalEditRollCall", command); + } + + public IActionResult OnPostManualCreateOrEdit(CreateOrEditEmployeeRollCall command) + { + var workshopHash = User.FindFirstValue("WorkshopSlug"); + var workshopId = _passwordHasher.SlugDecrypt(workshopHash); + if (workshopId < 1) + return new JsonResult(new + { + success = false, + message = "هیچ کارگاهی یافت نشده است!", + }); + + command.WorkshopId = workshopId; + var result = _rollCallApplication.ManualEdit(command); + + return new JsonResult(new + { + success = result.IsSuccedded, + message = result.Message, + }); + } + + public IActionResult OnPostRemoveEmployeeRollCallsInDate(long employeeId,string date) + { + var workshopHash = User.FindFirstValue("WorkshopSlug"); + var workshopId = _passwordHasher.SlugDecrypt(workshopHash); + if (workshopId < 1) + return new JsonResult(new + { + success = false, + message = "هیچ کارگاهی یافت نشده است!", + }); + + var result = _rollCallApplication.RemoveEmployeeRollCallsInDate(workshopId, employeeId, date); + + return new JsonResult(new + { + success = result.IsSuccedded, + message = result.Message, + }); + + } } } diff --git a/ServiceHost/Areas/Client/Pages/Company/RollCall/CurrentDay.cshtml b/ServiceHost/Areas/Client/Pages/Company/RollCall/CurrentDay.cshtml index 5c32f913..1aa2cc64 100644 --- a/ServiceHost/Areas/Client/Pages/Company/RollCall/CurrentDay.cshtml +++ b/ServiceHost/Areas/Client/Pages/Company/RollCall/CurrentDay.cshtml @@ -25,20 +25,55 @@
-
-
-
-
+
+ + +
+
+
+
-
تاریخ امروز @Model.NowDate
+
@@ -50,7 +85,7 @@
-
+
ردیف
نام پرسنل
شماره پرسنلی
@@ -65,7 +100,7 @@ { @foreach (var item in Model.RollCallViewModels.PresentEmployees) { -
+
ردیف @@ -79,7 +114,7 @@
نام پرسنل
-
+
@item.EmployeeFullName
@@ -185,7 +220,7 @@ { if (!item.HasLeave) { -
+
ردیف @@ -199,7 +234,7 @@
نام پرسنل
-
+
@item.EmployeeFullName
@@ -247,7 +282,7 @@ { if (item.HasLeave) { -
+
ردیف @@ -261,7 +296,7 @@
نام پرسنل
-
+
@item.EmployeeFullName
@@ -319,11 +354,10 @@ @section Script { - + } diff --git a/ServiceHost/Areas/Client/Pages/Company/RollCall/EmployeeUploadPicture.cshtml b/ServiceHost/Areas/Client/Pages/Company/RollCall/EmployeeUploadPicture.cshtml index 79a8f558..a0824913 100644 --- a/ServiceHost/Areas/Client/Pages/Company/RollCall/EmployeeUploadPicture.cshtml +++ b/ServiceHost/Areas/Client/Pages/Company/RollCall/EmployeeUploadPicture.cshtml @@ -1,4 +1,4 @@ -@page + @page @model ServiceHost.Areas.Client.Pages.Company.RollCall.EmployeeUploadPictureModel @{ string clientVersion = _0_Framework.Application.Version.StyleVersion; diff --git a/ServiceHost/Areas/Client/Pages/Company/RollCall/EmployeeUploadPicture.cshtml.cs b/ServiceHost/Areas/Client/Pages/Company/RollCall/EmployeeUploadPicture.cshtml.cs index 186e0f98..3539c23a 100644 --- a/ServiceHost/Areas/Client/Pages/Company/RollCall/EmployeeUploadPicture.cshtml.cs +++ b/ServiceHost/Areas/Client/Pages/Company/RollCall/EmployeeUploadPicture.cshtml.cs @@ -1,5 +1,4 @@ -using System.Security.Claims; -using _0_Framework.Application; +using _0_Framework.Application; using CompanyManagment.App.Contracts.Employee; using CompanyManagment.App.Contracts.Error; using CompanyManagment.App.Contracts.RollCallEmployee; @@ -9,58 +8,73 @@ using CompanyManagment.App.Contracts.Workshop; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc.RazorPages; -using ServiceHost.Pages; +using System.Diagnostics; +using System.Security.Claims; namespace ServiceHost.Areas.Client.Pages.Company.RollCall { - [Authorize] + [Authorize] public class EmployeeUploadPictureModel : PageModel { - public string WorkshopFullName; - public RollCallEmployeeViewModel Employees; - public bool HasEmployees; - public int MaxPersonValid; - public long WorkshopId; - public int PageIndex; + public string WorkshopFullName; + public RollCallEmployeeViewModel Employees; + public bool HasEmployees; + public int MaxPersonValid; + public long WorkshopId; + public int PageIndex; - private readonly IWorkshopApplication _workshopApplication; - private readonly IEmployeeApplication _employeeApplication; - private readonly IRollCallEmployeeApplication _rollCallEmployeeApplication; - private readonly IRollCallServiceApplication _rollCallServiceApplication; - private readonly IWebHostEnvironment _webHostEnvironment; - private readonly IPasswordHasher _passwordHasher; - private readonly IRollCallEmployeeStatusApplication _rollCallEmployeeStatusApplication; - public EmployeeUploadPictureModel(IWorkshopApplication workshopApplication, IPasswordHasher passwordHasher, IRollCallEmployeeApplication rollCallEmployeeApplication, IRollCallServiceApplication rollCallServiceApplication, IWebHostEnvironment webHostEnvironment, IEmployeeApplication employeeApplication, IRollCallEmployeeStatusApplication rollCallEmployeeStatusApplication) - { - _workshopApplication = workshopApplication; - _passwordHasher = passwordHasher; - _rollCallEmployeeApplication = rollCallEmployeeApplication; - _rollCallServiceApplication = rollCallServiceApplication; - _webHostEnvironment = webHostEnvironment; - _employeeApplication = employeeApplication; - _rollCallEmployeeStatusApplication = rollCallEmployeeStatusApplication; - } - - public IActionResult OnGet() + private readonly IWorkshopApplication _workshopApplication; + private readonly IEmployeeApplication _employeeApplication; + private readonly IRollCallEmployeeApplication _rollCallEmployeeApplication; + private readonly IRollCallServiceApplication _rollCallServiceApplication; + private readonly IWebHostEnvironment _webHostEnvironment; + private readonly IPasswordHasher _passwordHasher; + private readonly IRollCallEmployeeStatusApplication _rollCallEmployeeStatusApplication; + public EmployeeUploadPictureModel(IWorkshopApplication workshopApplication, IPasswordHasher passwordHasher, IRollCallEmployeeApplication rollCallEmployeeApplication, IRollCallServiceApplication rollCallServiceApplication, IWebHostEnvironment webHostEnvironment, IEmployeeApplication employeeApplication, IRollCallEmployeeStatusApplication rollCallEmployeeStatusApplication) { - var workshopHash = User.FindFirstValue("WorkshopSlug"); - var workshopId = _passwordHasher.SlugDecrypt(workshopHash); - if (workshopId > 0) + _workshopApplication = workshopApplication; + _passwordHasher = passwordHasher; + _rollCallEmployeeApplication = rollCallEmployeeApplication; + _rollCallServiceApplication = rollCallServiceApplication; + _webHostEnvironment = webHostEnvironment; + _employeeApplication = employeeApplication; + _rollCallEmployeeStatusApplication = rollCallEmployeeStatusApplication; + } + + public IActionResult OnGet() + { + var watch = new Stopwatch(); + watch.Start(); + Console.WriteLine("on get started"); + + var workshopHash = User.FindFirstValue("WorkshopSlug"); + var workshopId = _passwordHasher.SlugDecrypt(workshopHash); + if (workshopId > 0) { var serviceActive = _rollCallServiceApplication.GetActiveServiceByWorkshopId(workshopId); + Console.WriteLine("GetActiveServiceByWorkshopId >>>>>>" + watch.Elapsed); + if (serviceActive == null) return Redirect("/Client/Company/RollCall"); - var workshop = _workshopApplication.GetWorkshopInfo(workshopId); - WorkshopFullName = workshop.WorkshopFullName; + var workshop = _workshopApplication.GetWorkshopInfo(workshopId); + Console.WriteLine("GetWorkshopInfo >>>>>>" + watch.Elapsed); - MaxPersonValid = _rollCallServiceApplication.GetActiveServiceByWorkshopId(workshopId).MaxPersonValid; + WorkshopFullName = workshop.WorkshopFullName; + MaxPersonValid = serviceActive.MaxPersonValid; + //var distinctEmployees = _rollCallEmployeeApplication.GetPersonnelRollCallListPaginate(new RollCallEmployeeSearchModel() + //{ + + //}); + WorkshopId = workshopId; + PageIndex = 0; HasEmployees = _rollCallEmployeeApplication.HasEmployees(workshopId); + Console.WriteLine("finish >>>>>>" + watch.Elapsed); - return Page(); + return Page(); } else { @@ -70,23 +84,28 @@ namespace ServiceHost.Areas.Client.Pages.Company.RollCall public IActionResult OnGetEmployeeUploadDataAjax(int pageIndex, string searchName) { + var watch = new Stopwatch(); + watch.Start(); + Console.WriteLine("started"); var workshopHash = User.FindFirstValue("WorkshopSlug"); var workshopId = _passwordHasher.SlugDecrypt(workshopHash); if (workshopId > 0) { MaxPersonValid = _rollCallServiceApplication.GetActiveServiceByWorkshopId(workshopId).MaxPersonValid; - + Console.WriteLine("GetActiveServiceByWorkshopId >>>>>>" + watch.Elapsed); var distinctEmployees = _rollCallEmployeeApplication.GetPersonnelRollCallListPaginate(new RollCallEmployeeSearchModel() { WorkshopId = workshopId, PageIndex = pageIndex, Name = searchName }); + Console.WriteLine("GetPersonnelRollCallListPaginate >>>>>>" + watch.Elapsed); + Employees = new RollCallEmployeeViewModel { PersonnelInfoViewModels = distinctEmployees }; - + Console.WriteLine("employee >>>>>>" + watch.Elapsed); return new JsonResult(new { isSuccedded = true, @@ -104,91 +123,90 @@ namespace ServiceHost.Areas.Client.Pages.Company.RollCall } } - public IActionResult OnGetLoadInfoCount() - { - var workshopHash = User.FindFirstValue("WorkshopSlug"); - var workshopId = _passwordHasher.SlugDecrypt(workshopHash); - if (workshopId <= 0) - { - return new JsonResult(new - { - isSuccedded = false, - message = "کارگاهی یافت نشد" - }); - } + public IActionResult OnGetLoadInfoCount() + { + var workshopHash = User.FindFirstValue("WorkshopSlug"); + var workshopId = _passwordHasher.SlugDecrypt(workshopHash); + if (workshopId <= 0) + { + return new JsonResult(new + { + isSuccedded = false, + message = "کارگاهی یافت نشد" + }); + } - var activeService = _rollCallServiceApplication.GetActiveServiceByWorkshopId(workshopId); - var maxPersonValid = activeService.MaxPersonValid; + var activeService = _rollCallServiceApplication.GetActiveServiceByWorkshopId(workshopId); + var maxPersonValid = activeService.MaxPersonValid; - var employees = _rollCallEmployeeApplication.GetPersonnelRollCallListAll(workshopId); - var activeCount = employees.Count(e => e.IsActiveString == "true"); - var inactiveCount = employees.Count(e => e.IsActiveString == "false"); + var employeesCount = _rollCallEmployeeApplication.GetActiveAndDeActiveRollCallEmployees(workshopId); - return new JsonResult(new - { - isSuccedded = true, - maxPersonValid = maxPersonValid == -1 ? "نامحدود" : maxPersonValid.ToString(), - isTrueActiveCount = activeCount, - isFalseActiveCount = inactiveCount, - message = "موفق" - }); - } - public IActionResult OnGetCheckModalTakeImage() - { - var workshopHash = User.FindFirstValue("WorkshopSlug"); - var workshopId = _passwordHasher.SlugDecrypt(workshopHash); + return new JsonResult(new + { + isSuccedded = true, + maxPersonValid = maxPersonValid == -1 ? "نامحدود" : maxPersonValid.ToString(), + isTrueActiveCount = employeesCount.activeEmployees, + isFalseActiveCount = employeesCount.deActiveEmployees, + message = "موفق" + }); + } - if (workshopId <= 0) - { - return new JsonResult(new - { - isSuccedded = false, - message = "کارگاه شما یافت نشده است" - }); - } + public IActionResult OnGetCheckModalTakeImage() + { + var workshopHash = User.FindFirstValue("WorkshopSlug"); + var workshopId = _passwordHasher.SlugDecrypt(workshopHash); - var plan = _rollCallServiceApplication.GetActiveServiceByWorkshopId(workshopId); + if (workshopId <= 0) + { + return new JsonResult(new + { + isSuccedded = false, + message = "کارگاه شما یافت نشده است" + }); + } - if (plan == null) - { - return new JsonResult(new - { - isSuccedded = false, - message = "شما سرویس خریداری شده ندارید" - }); - } + var plan = _rollCallServiceApplication.GetActiveServiceByWorkshopId(workshopId); - if (plan.IsActiveString != "true") - { - return new JsonResult(new - { - isSuccedded = false, - message = "سرویس شما فعال نیست" - }); - } + if (plan == null) + { + return new JsonResult(new + { + isSuccedded = false, + message = "شما سرویس خریداری شده ندارید" + }); + } - var maxValid = plan.MaxPersonValid; + if (plan.IsActiveString != "true") + { + return new JsonResult(new + { + isSuccedded = false, + message = "سرویس شما فعال نیست" + }); + } - if (maxValid == -1 || _rollCallEmployeeApplication.activedPerson(workshopId) < maxValid) - { - return new JsonResult(new - { - isSuccedded = true, - message = "موفق" - }); - } + var maxValid = plan.MaxPersonValid; - return new JsonResult(new - { - isSuccedded = false, - message = "محدودیت افزودن پرسنل" - }); - } + if (maxValid == -1 || _rollCallEmployeeApplication.activedPerson(workshopId) < maxValid) + { + return new JsonResult(new + { + isSuccedded = true, + message = "موفق" + }); + } - public IActionResult OnGetModalTakeImages(long employeeId) - { + return new JsonResult(new + { + isSuccedded = false, + message = "محدودیت افزودن پرسنل" + }); + } + + public IActionResult OnGetModalTakeImages(long employeeId) + { var workshopHash = User.FindFirstValue("WorkshopSlug"); var workshopId = _passwordHasher.SlugDecrypt(workshopHash); if (workshopId > 0) @@ -202,60 +220,61 @@ namespace ServiceHost.Areas.Client.Pages.Company.RollCall var employeeDetails = _employeeApplication.GetDetails(employeeId); - string employeeName = employeeWorkshopInfo?.EmployeeFullName ?? employeeDetails.EmployeeFullName; + string employeeName = string.Empty; + if (employeeDetails != null) + employeeName = employeeDetails.EmployeeFullName; + string pic1 = ""; + string pic2 = ""; + if (hasPicture) + { + string path1 = $"{_webHostEnvironment.ContentRootPath}\\Faces\\{workshopId}\\{employeeId}\\{1}.jpg"; + string path2 = $"{_webHostEnvironment.ContentRootPath}\\Faces\\{workshopId}\\{employeeId}\\{2}.jpg"; - string pic1 = ""; - string pic2 = ""; - if (hasPicture) - { - string path1 = $"{_webHostEnvironment.ContentRootPath}\\Faces\\{workshopId}\\{employeeId}\\{1}.jpg"; - string path2 = $"{_webHostEnvironment.ContentRootPath}\\Faces\\{workshopId}\\{employeeId}\\{2}.jpg"; + if (System.IO.File.Exists(path1)) + { + byte[] fileContent1 = System.IO.File.ReadAllBytes(path1); + pic1 = Convert.ToBase64String(fileContent1); + } - if (System.IO.File.Exists(path1)) - { - byte[] fileContent1 = System.IO.File.ReadAllBytes(path1); - pic1 = Convert.ToBase64String(fileContent1); - } + if (System.IO.File.Exists(path2)) + { + byte[] fileContent2 = System.IO.File.ReadAllBytes(path2); + pic2 = Convert.ToBase64String(fileContent2); + } - if (System.IO.File.Exists(path2)) - { - byte[] fileContent2 = System.IO.File.ReadAllBytes(path2); - pic2 = Convert.ToBase64String(fileContent2); - } - - //byte[] fileContent1 = System.IO.File.ReadAllBytes($"{_webHostEnvironment.ContentRootPath}\\Faces\\{workshopId}\\{employeeId}\\{1}.jpg"); - //pic1 = Convert.ToBase64String(fileContent1); - //byte[] fileContent2 = System.IO.File.ReadAllBytes($"{_webHostEnvironment.ContentRootPath}\\Faces\\{workshopId}\\{employeeId}\\{2}.jpg"); - //pic2 = Convert.ToBase64String(fileContent2); - } - - var res = new TakePictureModel() - { - HasPicture = hasPicture, - EmployeeId = employeeId, - WorkshopId = workshopId, - Name = employeeName, - Pic1 = pic1, - Pic2 = pic2, - }; + //byte[] fileContent1 = System.IO.File.ReadAllBytes($"{_webHostEnvironment.ContentRootPath}\\Faces\\{workshopId}\\{employeeId}\\{1}.jpg"); + //pic1 = Convert.ToBase64String(fileContent1); + //byte[] fileContent2 = System.IO.File.ReadAllBytes($"{_webHostEnvironment.ContentRootPath}\\Faces\\{workshopId}\\{employeeId}\\{2}.jpg"); + //pic2 = Convert.ToBase64String(fileContent2); + } + var res = new TakePictureModel() + { + HasPicture = hasPicture, + EmployeeId = employeeId, + WorkshopId = workshopId, + Name = employeeName, + Pic1 = pic1, + Pic2 = pic2, + }; + return Partial("ModalTakeImages", res); } - else - { - var resultError = new ErrorViewModel() - { - IsSuccedded = false, - Message = "هیج کارگاهی یافت نشد" - }; - return Partial("../Error/_ErrorModal", resultError); - } - } + else + { + var resultError = new ErrorViewModel() + { + IsSuccedded = false, + Message = "هیج کارگاهی یافت نشد" + }; + return Partial("../Error/_ErrorModal", resultError); + } + } - public IActionResult OnPostTakePicture(string base64pic1, string base64pic2, long workshopId, long employeeId) - { + public IActionResult OnPostTakePicture(string base64pic1, string base64pic2, long workshopId, long employeeId) + { try { var directoryPath = $"{_webHostEnvironment.ContentRootPath}\\Faces\\{workshopId}\\{employeeId}"; @@ -285,14 +304,14 @@ namespace ServiceHost.Areas.Client.Pages.Company.RollCall HasUploadedImage = "true", }; result = _rollCallEmployeeApplication.Create(createCommand); - _rollCallEmployeeStatusApplication.Create(new CreateRollCallEmployeeStatus() - { RollCallEmployeeId = result.SendId }); - } + _rollCallEmployeeStatusApplication.Create(new CreateRollCallEmployeeStatus() + { RollCallEmployeeId = result.SendId }); + } else { - result = _rollCallEmployeeApplication.UploadedImage(employeeId, workshopId); + result = _rollCallEmployeeApplication.UploadedImage(employeeId, workshopId); } - + if (result.IsSuccedded) { return new JsonResult(new @@ -317,121 +336,152 @@ namespace ServiceHost.Areas.Client.Pages.Company.RollCall return new JsonResult(new { IsSuccedded = false, - Message = e.Message, - }); + Message = e.Message, + }); } } - public void CreateImageFromBase64(string base64, string imagePathWithExtension) - { - var subBase64 = base64.Substring(base64.LastIndexOf(',') + 1); - byte[] bytes = Convert.FromBase64String(subBase64); - System.IO.File.WriteAllBytes(imagePathWithExtension, bytes); - } + public void CreateImageFromBase64(string base64, string imagePathWithExtension) + { + var subBase64 = base64.Substring(base64.LastIndexOf(',') + 1); + byte[] bytes = Convert.FromBase64String(subBase64); + System.IO.File.WriteAllBytes(imagePathWithExtension, bytes); + } public IActionResult OnPostActivePersonnel(long id) + { + var workshopHash = User.FindFirstValue("WorkshopSlug"); + var workshopId = _passwordHasher.SlugDecrypt(workshopHash); + if (workshopId > 0) + { + var hasRollCallEmployee = _rollCallEmployeeApplication.GetDetails(id); + + if (hasRollCallEmployee == null) + { + return new JsonResult(new + { + isSuccedded = false, + message = "برای این پرسنل، هنوز هیچ عکسی آپلود نشده است. بعد از آپلود عکس بطور خودکار فعال خواهد شد", + }); + } + else + { + if (hasRollCallEmployee.HasUploadedImage == "false") + return new JsonResult(new + { + isSuccedded = false, + message = "برای این پرسنل، هنوز هیچ عکسی آپلود نشده است. بعد از آپلود عکس بطور خودکار فعال خواهد شد", + }); + + var result = _rollCallEmployeeApplication.Active(hasRollCallEmployee.Id); + if (result.IsSuccedded) + { + return new JsonResult(new + { + isSuccedded = result.IsSuccedded, + message = result.Message, + }); + } + else + { + return new JsonResult(new + { + isSuccedded = result.IsSuccedded, + message = result.Message, + }); + } + } + return new JsonResult(new + { + isSuccedded = false, + message = "خطایی رخ آمده است", + }); + } + else + { + return new JsonResult(new + { + isSuccedded = false, + message = "کارگاه شما یافت نشد", + }); + } + } + + public IActionResult OnPostDeActivePersonnel(long id) + { + var workshopHash = User.FindFirstValue("WorkshopSlug"); + var workshopId = _passwordHasher.SlugDecrypt(workshopHash); + if (workshopId > 0) + { + var result = _rollCallEmployeeApplication.DeActive(id); + if (result.IsSuccedded) + { + return new JsonResult(new + { + isSuccedded = result.IsSuccedded, + message = result.Message, + }); + } + + return new JsonResult(new + { + isSuccedded = result.IsSuccedded, + message = result.Message, + }); + } + else + { + return new JsonResult(new + { + isSuccedded = false, + message = "کارگاه شما یافت نشد", + }); + } + } + + public IActionResult OnGetLoadFirstImage(long employeeId, long workshopId) + { + var directoryPath = $"{_webHostEnvironment.ContentRootPath}\\Faces\\{workshopId}\\{employeeId}"; + var imageDir = Path.Combine(directoryPath, "1.jpg"); + return PhysicalFile(imageDir, "image/jpeg"); + } + + public IActionResult OnGetLoadSecondImage(long employeeId, long workshopId) + { + var directoryPath = $"{_webHostEnvironment.ContentRootPath}\\Faces\\{workshopId}\\{employeeId}"; + var imageDir = Path.Combine(directoryPath, "2.jpg"); + return PhysicalFile(imageDir, "image/jpeg"); + } + + public IActionResult OnGetModalChangeName(long employeeId) { var workshopHash = User.FindFirstValue("WorkshopSlug"); var workshopId = _passwordHasher.SlugDecrypt(workshopHash); if (workshopId > 0) { - var hasRollCallEmployee = _rollCallEmployeeApplication.GetDetails(id); + var command = _rollCallEmployeeApplication.GetByEmployeeIdAndWorkshopId(employeeId, workshopId); - if (hasRollCallEmployee == null) - { - return new JsonResult(new - { - isSuccedded = false, - message = "برای این پرسنل، هنوز هیچ عکسی آپلود نشده است. بعد از آپلود عکس بطور خودکار فعال خواهد شد", - }); - } - else - { - if (hasRollCallEmployee.HasUploadedImage == "false") - return new JsonResult(new - { - isSuccedded = false, - message = "برای این پرسنل، هنوز هیچ عکسی آپلود نشده است. بعد از آپلود عکس بطور خودکار فعال خواهد شد", - }); - - var result = _rollCallEmployeeApplication.Active(hasRollCallEmployee.Id); - if (result.IsSuccedded) - { - return new JsonResult(new - { - isSuccedded = result.IsSuccedded, - message = result.Message, - }); - } - else - { - return new JsonResult(new - { - isSuccedded = result.IsSuccedded, - message = result.Message, - }); - } - } - return new JsonResult(new - { - isSuccedded = false, - message = "خطایی رخ آمده است", - }); + return Partial("ModalChangeName", command); } else { - return new JsonResult(new + var resultError = new ErrorViewModel() { - isSuccedded = false, - message = "کارگاه شما یافت نشد", - }); + IsSuccedded = false, + Message = "هیج کارگاهی یافت نشد" + }; + return Partial("../Error/_ErrorModal", resultError); } } - public IActionResult OnPostDeActivePersonnel(long id) + public IActionResult OnPostChangeName(long rollCallEmployeeId, string fName, string lName) { - var workshopHash = User.FindFirstValue("WorkshopSlug"); - var workshopId = _passwordHasher.SlugDecrypt(workshopHash); - if (workshopId > 0) + var result = _rollCallEmployeeApplication.ChangeEmployeeRollCallName(rollCallEmployeeId, fName, lName); + return new JsonResult(new { - var result = _rollCallEmployeeApplication.DeActive(id); - if (result.IsSuccedded) - { - return new JsonResult(new - { - isSuccedded = result.IsSuccedded, - message = result.Message, - }); - } - - return new JsonResult(new - { - isSuccedded = result.IsSuccedded, - message = result.Message, - }); - } - else - { - return new JsonResult(new - { - isSuccedded = false, - message = "کارگاه شما یافت نشد", - }); - } - } - - public IActionResult OnGetLoadFirstImage(long employeeId, long workshopId) - { - var directoryPath = $"{_webHostEnvironment.ContentRootPath}\\Faces\\{workshopId}\\{employeeId}"; - var imageDir = Path.Combine(directoryPath, "1.jpg"); - return PhysicalFile(imageDir, "image/jpeg"); - } - - public IActionResult OnGetLoadSecondImage(long employeeId, long workshopId) - { - var directoryPath = $"{_webHostEnvironment.ContentRootPath}\\Faces\\{workshopId}\\{employeeId}"; - var imageDir = Path.Combine(directoryPath, "2.jpg"); - return PhysicalFile(imageDir, "image/jpeg"); + isSuccedded = result.IsSuccedded, + message = result.Message, + }); } } } diff --git a/ServiceHost/Areas/Client/Pages/Company/RollCall/ModalAddRollCall.cshtml b/ServiceHost/Areas/Client/Pages/Company/RollCall/ModalAddRollCall.cshtml new file mode 100644 index 00000000..cf2a1b74 --- /dev/null +++ b/ServiceHost/Areas/Client/Pages/Company/RollCall/ModalAddRollCall.cshtml @@ -0,0 +1,193 @@ +@model CompanyManagment.App.Contracts.RollCall.CreateOrEditEmployeeRollCall +@{ + string clientVersion = _0_Framework.Application.Version.StyleVersion; + + + +} + +
+ + +
+ + + + + + \ No newline at end of file diff --git a/ServiceHost/Areas/Client/Pages/Company/RollCall/ModalChangeName.cshtml b/ServiceHost/Areas/Client/Pages/Company/RollCall/ModalChangeName.cshtml new file mode 100644 index 00000000..fe2253dc --- /dev/null +++ b/ServiceHost/Areas/Client/Pages/Company/RollCall/ModalChangeName.cshtml @@ -0,0 +1,92 @@ +@model CompanyManagment.App.Contracts.RollCallEmployee.RollCallEmployeeViewModel + +@{ + string clientVersion = _0_Framework.Application.Version.StyleVersion; + + + +} + +
+ + +
+ + + \ No newline at end of file diff --git a/ServiceHost/Areas/Client/Pages/Company/RollCall/ModalEditRollCall.cshtml b/ServiceHost/Areas/Client/Pages/Company/RollCall/ModalEditRollCall.cshtml new file mode 100644 index 00000000..9c0fa809 --- /dev/null +++ b/ServiceHost/Areas/Client/Pages/Company/RollCall/ModalEditRollCall.cshtml @@ -0,0 +1,318 @@ +@model CompanyManagment.App.Contracts.RollCall.EmployeeRollCallsViewModel +@{ + string clientVersion = _0_Framework.Application.Version.StyleVersion; + var index = 0; + var count = Model.RollCalls.Count; + string countString; + string txtString; + + + + +} + +
+ + +
+ + + + + + \ No newline at end of file diff --git a/ServiceHost/Areas/Client/Pages/Index.cshtml b/ServiceHost/Areas/Client/Pages/Index.cshtml index 14750b8b..8298597c 100644 --- a/ServiceHost/Areas/Client/Pages/Index.cshtml +++ b/ServiceHost/Areas/Client/Pages/Index.cshtml @@ -90,7 +90,7 @@
@if (Model.HasApkToDownload) { -
+
@@ -102,7 +102,7 @@ -

دانلود اپلیکشن

+

دانلود نرم افزار مخصوص موبایل

diff --git a/ServiceHost/Faces/170/30368/1.jpg b/ServiceHost/Faces/170/30368/1.jpg new file mode 100644 index 00000000..2a937809 Binary files /dev/null and b/ServiceHost/Faces/170/30368/1.jpg differ diff --git a/ServiceHost/Faces/170/30368/2.jpg b/ServiceHost/Faces/170/30368/2.jpg new file mode 100644 index 00000000..1c5cf02a Binary files /dev/null and b/ServiceHost/Faces/170/30368/2.jpg differ diff --git a/ServiceHost/Faces/170/30368/Thumbnail.jpg b/ServiceHost/Faces/170/30368/Thumbnail.jpg new file mode 100644 index 00000000..11620e09 Binary files /dev/null and b/ServiceHost/Faces/170/30368/Thumbnail.jpg differ diff --git a/ServiceHost/Faces/170/30369/1.jpg b/ServiceHost/Faces/170/30369/1.jpg new file mode 100644 index 00000000..6e5e15fc Binary files /dev/null and b/ServiceHost/Faces/170/30369/1.jpg differ diff --git a/ServiceHost/Faces/170/30369/2.jpg b/ServiceHost/Faces/170/30369/2.jpg new file mode 100644 index 00000000..c0ad31ce Binary files /dev/null and b/ServiceHost/Faces/170/30369/2.jpg differ diff --git a/ServiceHost/Faces/170/30369/Thumbnail.jpg b/ServiceHost/Faces/170/30369/Thumbnail.jpg new file mode 100644 index 00000000..301a5b78 Binary files /dev/null and b/ServiceHost/Faces/170/30369/Thumbnail.jpg differ diff --git a/ServiceHost/Faces/170/30370/1.jpg b/ServiceHost/Faces/170/30370/1.jpg new file mode 100644 index 00000000..9b670848 Binary files /dev/null and b/ServiceHost/Faces/170/30370/1.jpg differ diff --git a/ServiceHost/Faces/170/30370/2.jpg b/ServiceHost/Faces/170/30370/2.jpg new file mode 100644 index 00000000..24cc1ba0 Binary files /dev/null and b/ServiceHost/Faces/170/30370/2.jpg differ diff --git a/ServiceHost/Faces/170/30370/Thumbnail.jpg b/ServiceHost/Faces/170/30370/Thumbnail.jpg new file mode 100644 index 00000000..63a3bd79 Binary files /dev/null and b/ServiceHost/Faces/170/30370/Thumbnail.jpg differ diff --git a/ServiceHost/Faces/170/30374/1.jpg b/ServiceHost/Faces/170/30374/1.jpg new file mode 100644 index 00000000..89e7a5ea Binary files /dev/null and b/ServiceHost/Faces/170/30374/1.jpg differ diff --git a/ServiceHost/Faces/170/30374/2.jpg b/ServiceHost/Faces/170/30374/2.jpg new file mode 100644 index 00000000..77d4e248 Binary files /dev/null and b/ServiceHost/Faces/170/30374/2.jpg differ diff --git a/ServiceHost/Faces/170/30374/Thumbnail.jpg b/ServiceHost/Faces/170/30374/Thumbnail.jpg new file mode 100644 index 00000000..a3cff3ab Binary files /dev/null and b/ServiceHost/Faces/170/30374/Thumbnail.jpg differ diff --git a/ServiceHost/Faces/170/30376/1.jpg b/ServiceHost/Faces/170/30376/1.jpg new file mode 100644 index 00000000..f7697095 Binary files /dev/null and b/ServiceHost/Faces/170/30376/1.jpg differ diff --git a/ServiceHost/Faces/170/30376/2.jpg b/ServiceHost/Faces/170/30376/2.jpg new file mode 100644 index 00000000..2747c4c1 Binary files /dev/null and b/ServiceHost/Faces/170/30376/2.jpg differ diff --git a/ServiceHost/Faces/170/30376/Thumbnail.jpg b/ServiceHost/Faces/170/30376/Thumbnail.jpg new file mode 100644 index 00000000..576a1279 Binary files /dev/null and b/ServiceHost/Faces/170/30376/Thumbnail.jpg differ diff --git a/ServiceHost/Faces/170/3396/1.jpg b/ServiceHost/Faces/170/3396/1.jpg new file mode 100644 index 00000000..d77b99ae Binary files /dev/null and b/ServiceHost/Faces/170/3396/1.jpg differ diff --git a/ServiceHost/Faces/170/3396/2.jpg b/ServiceHost/Faces/170/3396/2.jpg new file mode 100644 index 00000000..97826fe6 Binary files /dev/null and b/ServiceHost/Faces/170/3396/2.jpg differ diff --git a/ServiceHost/Faces/170/3396/Thumbnail.jpg b/ServiceHost/Faces/170/3396/Thumbnail.jpg new file mode 100644 index 00000000..4c62b9cc Binary files /dev/null and b/ServiceHost/Faces/170/3396/Thumbnail.jpg differ diff --git a/ServiceHost/Faces/170/4023/Thumbnail.jpg b/ServiceHost/Faces/170/4023/Thumbnail.jpg new file mode 100644 index 00000000..f0a96c80 Binary files /dev/null and b/ServiceHost/Faces/170/4023/Thumbnail.jpg differ diff --git a/ServiceHost/Faces/170/4024/Thumbnail.jpg b/ServiceHost/Faces/170/4024/Thumbnail.jpg new file mode 100644 index 00000000..fd512f07 Binary files /dev/null and b/ServiceHost/Faces/170/4024/Thumbnail.jpg differ diff --git a/ServiceHost/Faces/170/4027/Thumbnail.jpg b/ServiceHost/Faces/170/4027/Thumbnail.jpg new file mode 100644 index 00000000..5db9df1a Binary files /dev/null and b/ServiceHost/Faces/170/4027/Thumbnail.jpg differ diff --git a/ServiceHost/Faces/170/4029/1.jpg b/ServiceHost/Faces/170/4029/1.jpg new file mode 100644 index 00000000..dd3727b4 Binary files /dev/null and b/ServiceHost/Faces/170/4029/1.jpg differ diff --git a/ServiceHost/Faces/170/4029/2.jpg b/ServiceHost/Faces/170/4029/2.jpg new file mode 100644 index 00000000..7c1e92a4 Binary files /dev/null and b/ServiceHost/Faces/170/4029/2.jpg differ diff --git a/ServiceHost/Faces/170/4029/Thumbnail.jpg b/ServiceHost/Faces/170/4029/Thumbnail.jpg new file mode 100644 index 00000000..af864717 Binary files /dev/null and b/ServiceHost/Faces/170/4029/Thumbnail.jpg differ diff --git a/ServiceHost/Faces/170/4031/1.jpg b/ServiceHost/Faces/170/4031/1.jpg new file mode 100644 index 00000000..c4d0f392 Binary files /dev/null and b/ServiceHost/Faces/170/4031/1.jpg differ diff --git a/ServiceHost/Faces/170/4031/2.jpg b/ServiceHost/Faces/170/4031/2.jpg new file mode 100644 index 00000000..0ba294b0 Binary files /dev/null and b/ServiceHost/Faces/170/4031/2.jpg differ diff --git a/ServiceHost/Faces/170/4031/Thumbnail.jpg b/ServiceHost/Faces/170/4031/Thumbnail.jpg new file mode 100644 index 00000000..bf95f17d Binary files /dev/null and b/ServiceHost/Faces/170/4031/Thumbnail.jpg differ diff --git a/ServiceHost/Faces/170/4034/1.jpg b/ServiceHost/Faces/170/4034/1.jpg new file mode 100644 index 00000000..7e0bc6a3 Binary files /dev/null and b/ServiceHost/Faces/170/4034/1.jpg differ diff --git a/ServiceHost/Faces/170/4034/2.jpg b/ServiceHost/Faces/170/4034/2.jpg new file mode 100644 index 00000000..49ffcd0b Binary files /dev/null and b/ServiceHost/Faces/170/4034/2.jpg differ diff --git a/ServiceHost/Faces/170/4034/Thumbnail.jpg b/ServiceHost/Faces/170/4034/Thumbnail.jpg new file mode 100644 index 00000000..c3c4c551 Binary files /dev/null and b/ServiceHost/Faces/170/4034/Thumbnail.jpg differ diff --git a/ServiceHost/Faces/170/4039/1.jpg b/ServiceHost/Faces/170/4039/1.jpg new file mode 100644 index 00000000..60de22f2 Binary files /dev/null and b/ServiceHost/Faces/170/4039/1.jpg differ diff --git a/ServiceHost/Faces/170/4039/2.jpg b/ServiceHost/Faces/170/4039/2.jpg new file mode 100644 index 00000000..01dd2591 Binary files /dev/null and b/ServiceHost/Faces/170/4039/2.jpg differ diff --git a/ServiceHost/Faces/170/4039/Thumbnail.jpg b/ServiceHost/Faces/170/4039/Thumbnail.jpg new file mode 100644 index 00000000..c4483f95 Binary files /dev/null and b/ServiceHost/Faces/170/4039/Thumbnail.jpg differ diff --git a/ServiceHost/Faces/170/4042/1.jpg b/ServiceHost/Faces/170/4042/1.jpg new file mode 100644 index 00000000..296957a5 Binary files /dev/null and b/ServiceHost/Faces/170/4042/1.jpg differ diff --git a/ServiceHost/Faces/170/4042/2.jpg b/ServiceHost/Faces/170/4042/2.jpg new file mode 100644 index 00000000..8593039a Binary files /dev/null and b/ServiceHost/Faces/170/4042/2.jpg differ diff --git a/ServiceHost/Faces/170/4042/Thumbnail.jpg b/ServiceHost/Faces/170/4042/Thumbnail.jpg new file mode 100644 index 00000000..21728b80 Binary files /dev/null and b/ServiceHost/Faces/170/4042/Thumbnail.jpg differ diff --git a/ServiceHost/Faces/170/4047/1.jpg b/ServiceHost/Faces/170/4047/1.jpg new file mode 100644 index 00000000..0a508cd1 Binary files /dev/null and b/ServiceHost/Faces/170/4047/1.jpg differ diff --git a/ServiceHost/Faces/170/4047/2.jpg b/ServiceHost/Faces/170/4047/2.jpg new file mode 100644 index 00000000..bcd62396 Binary files /dev/null and b/ServiceHost/Faces/170/4047/2.jpg differ diff --git a/ServiceHost/Faces/170/4047/Thumbnail.jpg b/ServiceHost/Faces/170/4047/Thumbnail.jpg new file mode 100644 index 00000000..3d6b7900 Binary files /dev/null and b/ServiceHost/Faces/170/4047/Thumbnail.jpg differ diff --git a/ServiceHost/Faces/170/40564/1.jpg b/ServiceHost/Faces/170/40564/1.jpg new file mode 100644 index 00000000..d5e4357f Binary files /dev/null and b/ServiceHost/Faces/170/40564/1.jpg differ diff --git a/ServiceHost/Faces/170/40564/2.jpg b/ServiceHost/Faces/170/40564/2.jpg new file mode 100644 index 00000000..d40fa578 Binary files /dev/null and b/ServiceHost/Faces/170/40564/2.jpg differ diff --git a/ServiceHost/Faces/170/40564/Thumbnail.jpg b/ServiceHost/Faces/170/40564/Thumbnail.jpg new file mode 100644 index 00000000..43c00753 Binary files /dev/null and b/ServiceHost/Faces/170/40564/Thumbnail.jpg differ diff --git a/ServiceHost/Faces/170/40567/1.jpg b/ServiceHost/Faces/170/40567/1.jpg new file mode 100644 index 00000000..585c8e2d Binary files /dev/null and b/ServiceHost/Faces/170/40567/1.jpg differ diff --git a/ServiceHost/Faces/170/40567/2.jpg b/ServiceHost/Faces/170/40567/2.jpg new file mode 100644 index 00000000..0225754b Binary files /dev/null and b/ServiceHost/Faces/170/40567/2.jpg differ diff --git a/ServiceHost/Faces/170/40567/Thumbnail.jpg b/ServiceHost/Faces/170/40567/Thumbnail.jpg new file mode 100644 index 00000000..466db785 Binary files /dev/null and b/ServiceHost/Faces/170/40567/Thumbnail.jpg differ diff --git a/ServiceHost/Faces/170/40811/1.jpg b/ServiceHost/Faces/170/40811/1.jpg new file mode 100644 index 00000000..b4823a09 Binary files /dev/null and b/ServiceHost/Faces/170/40811/1.jpg differ diff --git a/ServiceHost/Faces/170/40811/2.jpg b/ServiceHost/Faces/170/40811/2.jpg new file mode 100644 index 00000000..1e6aba32 Binary files /dev/null and b/ServiceHost/Faces/170/40811/2.jpg differ diff --git a/ServiceHost/Faces/170/40811/Thumbnail.jpg b/ServiceHost/Faces/170/40811/Thumbnail.jpg new file mode 100644 index 00000000..a7807853 Binary files /dev/null and b/ServiceHost/Faces/170/40811/Thumbnail.jpg differ diff --git a/ServiceHost/Faces/170/40812/Thumbnail.jpg b/ServiceHost/Faces/170/40812/Thumbnail.jpg new file mode 100644 index 00000000..0e71e2c6 Binary files /dev/null and b/ServiceHost/Faces/170/40812/Thumbnail.jpg differ diff --git a/ServiceHost/Faces/170/40888/Thumbnail.jpg b/ServiceHost/Faces/170/40888/Thumbnail.jpg new file mode 100644 index 00000000..424abe68 Binary files /dev/null and b/ServiceHost/Faces/170/40888/Thumbnail.jpg differ diff --git a/ServiceHost/Faces/170/40891/1.jpg b/ServiceHost/Faces/170/40891/1.jpg new file mode 100644 index 00000000..cdf7eb99 Binary files /dev/null and b/ServiceHost/Faces/170/40891/1.jpg differ diff --git a/ServiceHost/Faces/170/40891/2.jpg b/ServiceHost/Faces/170/40891/2.jpg new file mode 100644 index 00000000..d5048aac Binary files /dev/null and b/ServiceHost/Faces/170/40891/2.jpg differ diff --git a/ServiceHost/Faces/170/40891/Thumbnail.jpg b/ServiceHost/Faces/170/40891/Thumbnail.jpg new file mode 100644 index 00000000..f9c45936 Binary files /dev/null and b/ServiceHost/Faces/170/40891/Thumbnail.jpg differ diff --git a/ServiceHost/Faces/170/40892/1.jpg b/ServiceHost/Faces/170/40892/1.jpg new file mode 100644 index 00000000..7eb2f0a6 Binary files /dev/null and b/ServiceHost/Faces/170/40892/1.jpg differ diff --git a/ServiceHost/Faces/170/40892/2.jpg b/ServiceHost/Faces/170/40892/2.jpg new file mode 100644 index 00000000..832cfe54 Binary files /dev/null and b/ServiceHost/Faces/170/40892/2.jpg differ diff --git a/ServiceHost/Faces/170/40892/Thumbnail.jpg b/ServiceHost/Faces/170/40892/Thumbnail.jpg new file mode 100644 index 00000000..43483e5a Binary files /dev/null and b/ServiceHost/Faces/170/40892/Thumbnail.jpg differ diff --git a/ServiceHost/Faces/170/41032/Thumbnail.jpg b/ServiceHost/Faces/170/41032/Thumbnail.jpg new file mode 100644 index 00000000..9dae038c Binary files /dev/null and b/ServiceHost/Faces/170/41032/Thumbnail.jpg differ diff --git a/ServiceHost/Faces/170/41037/1.jpg b/ServiceHost/Faces/170/41037/1.jpg new file mode 100644 index 00000000..a7e55111 Binary files /dev/null and b/ServiceHost/Faces/170/41037/1.jpg differ diff --git a/ServiceHost/Faces/170/41037/2.jpg b/ServiceHost/Faces/170/41037/2.jpg new file mode 100644 index 00000000..c272db94 Binary files /dev/null and b/ServiceHost/Faces/170/41037/2.jpg differ diff --git a/ServiceHost/Faces/170/41037/Thumbnail.jpg b/ServiceHost/Faces/170/41037/Thumbnail.jpg new file mode 100644 index 00000000..576092ee Binary files /dev/null and b/ServiceHost/Faces/170/41037/Thumbnail.jpg differ diff --git a/ServiceHost/Faces/170/41050/1.jpg b/ServiceHost/Faces/170/41050/1.jpg new file mode 100644 index 00000000..8b572e92 Binary files /dev/null and b/ServiceHost/Faces/170/41050/1.jpg differ diff --git a/ServiceHost/Faces/170/41050/2.jpg b/ServiceHost/Faces/170/41050/2.jpg new file mode 100644 index 00000000..039ee56d Binary files /dev/null and b/ServiceHost/Faces/170/41050/2.jpg differ diff --git a/ServiceHost/Faces/170/41050/Thumbnail.jpg b/ServiceHost/Faces/170/41050/Thumbnail.jpg new file mode 100644 index 00000000..47d58fe8 Binary files /dev/null and b/ServiceHost/Faces/170/41050/Thumbnail.jpg differ diff --git a/ServiceHost/Faces/170/41051/Thumbnail.jpg b/ServiceHost/Faces/170/41051/Thumbnail.jpg new file mode 100644 index 00000000..23521ef6 Binary files /dev/null and b/ServiceHost/Faces/170/41051/Thumbnail.jpg differ diff --git a/ServiceHost/Faces/170/41253/1.jpg b/ServiceHost/Faces/170/41253/1.jpg new file mode 100644 index 00000000..f2772488 Binary files /dev/null and b/ServiceHost/Faces/170/41253/1.jpg differ diff --git a/ServiceHost/Faces/170/41253/2.jpg b/ServiceHost/Faces/170/41253/2.jpg new file mode 100644 index 00000000..4b690bbd Binary files /dev/null and b/ServiceHost/Faces/170/41253/2.jpg differ diff --git a/ServiceHost/Faces/170/41253/Thumbnail.jpg b/ServiceHost/Faces/170/41253/Thumbnail.jpg new file mode 100644 index 00000000..15387252 Binary files /dev/null and b/ServiceHost/Faces/170/41253/Thumbnail.jpg differ diff --git a/ServiceHost/Faces/170/41359/1.jpg b/ServiceHost/Faces/170/41359/1.jpg new file mode 100644 index 00000000..2f409653 Binary files /dev/null and b/ServiceHost/Faces/170/41359/1.jpg differ diff --git a/ServiceHost/Faces/170/41359/2.jpg b/ServiceHost/Faces/170/41359/2.jpg new file mode 100644 index 00000000..97e589f8 Binary files /dev/null and b/ServiceHost/Faces/170/41359/2.jpg differ diff --git a/ServiceHost/Faces/170/41359/Thumbnail.jpg b/ServiceHost/Faces/170/41359/Thumbnail.jpg new file mode 100644 index 00000000..2a97338b Binary files /dev/null and b/ServiceHost/Faces/170/41359/Thumbnail.jpg differ diff --git a/ServiceHost/Faces/170/41363/Thumbnail.jpg b/ServiceHost/Faces/170/41363/Thumbnail.jpg new file mode 100644 index 00000000..ee301cb6 Binary files /dev/null and b/ServiceHost/Faces/170/41363/Thumbnail.jpg differ diff --git a/ServiceHost/Faces/170/4138/1.jpg b/ServiceHost/Faces/170/4138/1.jpg index f3ce5cda..ee31813f 100644 Binary files a/ServiceHost/Faces/170/4138/1.jpg and b/ServiceHost/Faces/170/4138/1.jpg differ diff --git a/ServiceHost/Faces/170/4138/2.jpg b/ServiceHost/Faces/170/4138/2.jpg index bb3f1d20..2fd411b1 100644 Binary files a/ServiceHost/Faces/170/4138/2.jpg and b/ServiceHost/Faces/170/4138/2.jpg differ diff --git a/ServiceHost/Faces/170/4138/Thumbnail.jpg b/ServiceHost/Faces/170/4138/Thumbnail.jpg new file mode 100644 index 00000000..c065fdab Binary files /dev/null and b/ServiceHost/Faces/170/4138/Thumbnail.jpg differ diff --git a/ServiceHost/Faces/170/4143/1.jpg b/ServiceHost/Faces/170/4143/1.jpg new file mode 100644 index 00000000..10c90b88 Binary files /dev/null and b/ServiceHost/Faces/170/4143/1.jpg differ diff --git a/ServiceHost/Faces/170/4143/2.jpg b/ServiceHost/Faces/170/4143/2.jpg new file mode 100644 index 00000000..622466a5 Binary files /dev/null and b/ServiceHost/Faces/170/4143/2.jpg differ diff --git a/ServiceHost/Faces/170/4143/Thumbnail.jpg b/ServiceHost/Faces/170/4143/Thumbnail.jpg new file mode 100644 index 00000000..aa4b6292 Binary files /dev/null and b/ServiceHost/Faces/170/4143/Thumbnail.jpg differ diff --git a/ServiceHost/Faces/170/41430/1.jpg b/ServiceHost/Faces/170/41430/1.jpg new file mode 100644 index 00000000..009ba94d Binary files /dev/null and b/ServiceHost/Faces/170/41430/1.jpg differ diff --git a/ServiceHost/Faces/170/41430/2.jpg b/ServiceHost/Faces/170/41430/2.jpg new file mode 100644 index 00000000..df441651 Binary files /dev/null and b/ServiceHost/Faces/170/41430/2.jpg differ diff --git a/ServiceHost/Faces/170/41430/Thumbnail.jpg b/ServiceHost/Faces/170/41430/Thumbnail.jpg new file mode 100644 index 00000000..56b13272 Binary files /dev/null and b/ServiceHost/Faces/170/41430/Thumbnail.jpg differ diff --git a/ServiceHost/Faces/170/4145/1.jpg b/ServiceHost/Faces/170/4145/1.jpg new file mode 100644 index 00000000..58b0f0da Binary files /dev/null and b/ServiceHost/Faces/170/4145/1.jpg differ diff --git a/ServiceHost/Faces/170/4145/2.jpg b/ServiceHost/Faces/170/4145/2.jpg new file mode 100644 index 00000000..86cdb4d9 Binary files /dev/null and b/ServiceHost/Faces/170/4145/2.jpg differ diff --git a/ServiceHost/Faces/170/4145/Thumbnail.jpg b/ServiceHost/Faces/170/4145/Thumbnail.jpg new file mode 100644 index 00000000..a6555e53 Binary files /dev/null and b/ServiceHost/Faces/170/4145/Thumbnail.jpg differ diff --git a/ServiceHost/Faces/170/4146/1.jpg b/ServiceHost/Faces/170/4146/1.jpg new file mode 100644 index 00000000..69528999 Binary files /dev/null and b/ServiceHost/Faces/170/4146/1.jpg differ diff --git a/ServiceHost/Faces/170/4146/2.jpg b/ServiceHost/Faces/170/4146/2.jpg new file mode 100644 index 00000000..e0b2a6a4 Binary files /dev/null and b/ServiceHost/Faces/170/4146/2.jpg differ diff --git a/ServiceHost/Faces/170/4146/Thumbnail.jpg b/ServiceHost/Faces/170/4146/Thumbnail.jpg new file mode 100644 index 00000000..73fd4e59 Binary files /dev/null and b/ServiceHost/Faces/170/4146/Thumbnail.jpg differ diff --git a/ServiceHost/Faces/170/4147/1.jpg b/ServiceHost/Faces/170/4147/1.jpg new file mode 100644 index 00000000..c71fe37f Binary files /dev/null and b/ServiceHost/Faces/170/4147/1.jpg differ diff --git a/ServiceHost/Faces/170/4147/2.jpg b/ServiceHost/Faces/170/4147/2.jpg new file mode 100644 index 00000000..e89854f6 Binary files /dev/null and b/ServiceHost/Faces/170/4147/2.jpg differ diff --git a/ServiceHost/Faces/170/4147/Thumbnail.jpg b/ServiceHost/Faces/170/4147/Thumbnail.jpg new file mode 100644 index 00000000..83b33f80 Binary files /dev/null and b/ServiceHost/Faces/170/4147/Thumbnail.jpg differ diff --git a/ServiceHost/Faces/170/4150/1.jpg b/ServiceHost/Faces/170/4150/1.jpg new file mode 100644 index 00000000..50cde0c3 Binary files /dev/null and b/ServiceHost/Faces/170/4150/1.jpg differ diff --git a/ServiceHost/Faces/170/4150/2.jpg b/ServiceHost/Faces/170/4150/2.jpg new file mode 100644 index 00000000..77a9a573 Binary files /dev/null and b/ServiceHost/Faces/170/4150/2.jpg differ diff --git a/ServiceHost/Faces/170/4150/Thumbnail.jpg b/ServiceHost/Faces/170/4150/Thumbnail.jpg new file mode 100644 index 00000000..bc5d1347 Binary files /dev/null and b/ServiceHost/Faces/170/4150/Thumbnail.jpg differ diff --git a/ServiceHost/Faces/170/41532/1.jpg b/ServiceHost/Faces/170/41532/1.jpg new file mode 100644 index 00000000..2d0fb0c7 Binary files /dev/null and b/ServiceHost/Faces/170/41532/1.jpg differ diff --git a/ServiceHost/Faces/170/41532/2.jpg b/ServiceHost/Faces/170/41532/2.jpg new file mode 100644 index 00000000..e55a912e Binary files /dev/null and b/ServiceHost/Faces/170/41532/2.jpg differ diff --git a/ServiceHost/Faces/170/41532/Thumbnail.jpg b/ServiceHost/Faces/170/41532/Thumbnail.jpg new file mode 100644 index 00000000..c027fa57 Binary files /dev/null and b/ServiceHost/Faces/170/41532/Thumbnail.jpg differ diff --git a/ServiceHost/Faces/170/4158/1.jpg b/ServiceHost/Faces/170/4158/1.jpg new file mode 100644 index 00000000..dc3a6949 Binary files /dev/null and b/ServiceHost/Faces/170/4158/1.jpg differ diff --git a/ServiceHost/Faces/170/4158/2.jpg b/ServiceHost/Faces/170/4158/2.jpg new file mode 100644 index 00000000..fa34763b Binary files /dev/null and b/ServiceHost/Faces/170/4158/2.jpg differ diff --git a/ServiceHost/Faces/170/4158/Thumbnail.jpg b/ServiceHost/Faces/170/4158/Thumbnail.jpg new file mode 100644 index 00000000..eb6f2a03 Binary files /dev/null and b/ServiceHost/Faces/170/4158/Thumbnail.jpg differ diff --git a/ServiceHost/Faces/170/41615/1.jpg b/ServiceHost/Faces/170/41615/1.jpg new file mode 100644 index 00000000..b8c43306 Binary files /dev/null and b/ServiceHost/Faces/170/41615/1.jpg differ diff --git a/ServiceHost/Faces/170/41615/2.jpg b/ServiceHost/Faces/170/41615/2.jpg new file mode 100644 index 00000000..fb88a578 Binary files /dev/null and b/ServiceHost/Faces/170/41615/2.jpg differ diff --git a/ServiceHost/Faces/170/41615/Thumbnail.jpg b/ServiceHost/Faces/170/41615/Thumbnail.jpg new file mode 100644 index 00000000..7abd0504 Binary files /dev/null and b/ServiceHost/Faces/170/41615/Thumbnail.jpg differ diff --git a/ServiceHost/Faces/170/4166/Thumbnail.jpg b/ServiceHost/Faces/170/4166/Thumbnail.jpg new file mode 100644 index 00000000..625652fa Binary files /dev/null and b/ServiceHost/Faces/170/4166/Thumbnail.jpg differ diff --git a/ServiceHost/Faces/170/4174/1.jpg b/ServiceHost/Faces/170/4174/1.jpg new file mode 100644 index 00000000..a8006758 Binary files /dev/null and b/ServiceHost/Faces/170/4174/1.jpg differ diff --git a/ServiceHost/Faces/170/4174/2.jpg b/ServiceHost/Faces/170/4174/2.jpg new file mode 100644 index 00000000..ade3a5ef Binary files /dev/null and b/ServiceHost/Faces/170/4174/2.jpg differ diff --git a/ServiceHost/Faces/170/4174/Thumbnail.jpg b/ServiceHost/Faces/170/4174/Thumbnail.jpg new file mode 100644 index 00000000..153d36ac Binary files /dev/null and b/ServiceHost/Faces/170/4174/Thumbnail.jpg differ diff --git a/ServiceHost/Faces/170/41758/1.jpg b/ServiceHost/Faces/170/41758/1.jpg new file mode 100644 index 00000000..ba99a1ed Binary files /dev/null and b/ServiceHost/Faces/170/41758/1.jpg differ diff --git a/ServiceHost/Faces/170/41758/2.jpg b/ServiceHost/Faces/170/41758/2.jpg new file mode 100644 index 00000000..3f44eefa Binary files /dev/null and b/ServiceHost/Faces/170/41758/2.jpg differ diff --git a/ServiceHost/Faces/170/41758/Thumbnail.jpg b/ServiceHost/Faces/170/41758/Thumbnail.jpg new file mode 100644 index 00000000..6133641d Binary files /dev/null and b/ServiceHost/Faces/170/41758/Thumbnail.jpg differ diff --git a/ServiceHost/Faces/170/4177/1.jpg b/ServiceHost/Faces/170/4177/1.jpg new file mode 100644 index 00000000..82af5e76 Binary files /dev/null and b/ServiceHost/Faces/170/4177/1.jpg differ diff --git a/ServiceHost/Faces/170/4177/2.jpg b/ServiceHost/Faces/170/4177/2.jpg new file mode 100644 index 00000000..fdda7aa8 Binary files /dev/null and b/ServiceHost/Faces/170/4177/2.jpg differ diff --git a/ServiceHost/Faces/170/4177/Thumbnail.jpg b/ServiceHost/Faces/170/4177/Thumbnail.jpg new file mode 100644 index 00000000..2ed8632f Binary files /dev/null and b/ServiceHost/Faces/170/4177/Thumbnail.jpg differ diff --git a/ServiceHost/Faces/170/4185/1.jpg b/ServiceHost/Faces/170/4185/1.jpg new file mode 100644 index 00000000..b6c22bc1 Binary files /dev/null and b/ServiceHost/Faces/170/4185/1.jpg differ diff --git a/ServiceHost/Faces/170/4185/2.jpg b/ServiceHost/Faces/170/4185/2.jpg new file mode 100644 index 00000000..dd1938d5 Binary files /dev/null and b/ServiceHost/Faces/170/4185/2.jpg differ diff --git a/ServiceHost/Faces/170/4185/Thumbnail.jpg b/ServiceHost/Faces/170/4185/Thumbnail.jpg new file mode 100644 index 00000000..58bc8b8a Binary files /dev/null and b/ServiceHost/Faces/170/4185/Thumbnail.jpg differ diff --git a/ServiceHost/Faces/170/4191/Thumbnail.jpg b/ServiceHost/Faces/170/4191/Thumbnail.jpg new file mode 100644 index 00000000..cbf863fc Binary files /dev/null and b/ServiceHost/Faces/170/4191/Thumbnail.jpg differ diff --git a/ServiceHost/Faces/170/42082/1.jpg b/ServiceHost/Faces/170/42082/1.jpg new file mode 100644 index 00000000..392cb8c0 Binary files /dev/null and b/ServiceHost/Faces/170/42082/1.jpg differ diff --git a/ServiceHost/Faces/170/42082/2.jpg b/ServiceHost/Faces/170/42082/2.jpg new file mode 100644 index 00000000..0be37a1f Binary files /dev/null and b/ServiceHost/Faces/170/42082/2.jpg differ diff --git a/ServiceHost/Faces/170/42082/Thumbnail.jpg b/ServiceHost/Faces/170/42082/Thumbnail.jpg new file mode 100644 index 00000000..8174d5bd Binary files /dev/null and b/ServiceHost/Faces/170/42082/Thumbnail.jpg differ diff --git a/ServiceHost/Faces/170/42083/1.jpg b/ServiceHost/Faces/170/42083/1.jpg new file mode 100644 index 00000000..1828bd0a Binary files /dev/null and b/ServiceHost/Faces/170/42083/1.jpg differ diff --git a/ServiceHost/Faces/170/42083/2.jpg b/ServiceHost/Faces/170/42083/2.jpg new file mode 100644 index 00000000..b9cb8b80 Binary files /dev/null and b/ServiceHost/Faces/170/42083/2.jpg differ diff --git a/ServiceHost/Faces/170/42083/Thumbnail.jpg b/ServiceHost/Faces/170/42083/Thumbnail.jpg new file mode 100644 index 00000000..09bb9ce2 Binary files /dev/null and b/ServiceHost/Faces/170/42083/Thumbnail.jpg differ diff --git a/ServiceHost/Faces/170/42086/Thumbnail.jpg b/ServiceHost/Faces/170/42086/Thumbnail.jpg new file mode 100644 index 00000000..c3c7beeb Binary files /dev/null and b/ServiceHost/Faces/170/42086/Thumbnail.jpg differ diff --git a/ServiceHost/Faces/170/42087/1.jpg b/ServiceHost/Faces/170/42087/1.jpg new file mode 100644 index 00000000..b2eb3327 Binary files /dev/null and b/ServiceHost/Faces/170/42087/1.jpg differ diff --git a/ServiceHost/Faces/170/42087/2.jpg b/ServiceHost/Faces/170/42087/2.jpg new file mode 100644 index 00000000..e4ad9e53 Binary files /dev/null and b/ServiceHost/Faces/170/42087/2.jpg differ diff --git a/ServiceHost/Faces/170/42087/Thumbnail.jpg b/ServiceHost/Faces/170/42087/Thumbnail.jpg new file mode 100644 index 00000000..5e4cc6c3 Binary files /dev/null and b/ServiceHost/Faces/170/42087/Thumbnail.jpg differ diff --git a/ServiceHost/Faces/170/42142/1.jpg b/ServiceHost/Faces/170/42142/1.jpg new file mode 100644 index 00000000..d70655d2 Binary files /dev/null and b/ServiceHost/Faces/170/42142/1.jpg differ diff --git a/ServiceHost/Faces/170/42142/2.jpg b/ServiceHost/Faces/170/42142/2.jpg new file mode 100644 index 00000000..bc08e87e Binary files /dev/null and b/ServiceHost/Faces/170/42142/2.jpg differ diff --git a/ServiceHost/Faces/170/42142/Thumbnail.jpg b/ServiceHost/Faces/170/42142/Thumbnail.jpg new file mode 100644 index 00000000..6034b515 Binary files /dev/null and b/ServiceHost/Faces/170/42142/Thumbnail.jpg differ diff --git a/ServiceHost/Faces/170/42143/1.jpg b/ServiceHost/Faces/170/42143/1.jpg new file mode 100644 index 00000000..ed72fe29 Binary files /dev/null and b/ServiceHost/Faces/170/42143/1.jpg differ diff --git a/ServiceHost/Faces/170/42143/2.jpg b/ServiceHost/Faces/170/42143/2.jpg new file mode 100644 index 00000000..c0940f21 Binary files /dev/null and b/ServiceHost/Faces/170/42143/2.jpg differ diff --git a/ServiceHost/Faces/170/42143/Thumbnail.jpg b/ServiceHost/Faces/170/42143/Thumbnail.jpg new file mode 100644 index 00000000..7d3eb264 Binary files /dev/null and b/ServiceHost/Faces/170/42143/Thumbnail.jpg differ diff --git a/ServiceHost/Faces/170/42145/1.jpg b/ServiceHost/Faces/170/42145/1.jpg new file mode 100644 index 00000000..4887746a Binary files /dev/null and b/ServiceHost/Faces/170/42145/1.jpg differ diff --git a/ServiceHost/Faces/170/42145/2.jpg b/ServiceHost/Faces/170/42145/2.jpg new file mode 100644 index 00000000..c9be5fdb Binary files /dev/null and b/ServiceHost/Faces/170/42145/2.jpg differ diff --git a/ServiceHost/Faces/170/42145/Thumbnail.jpg b/ServiceHost/Faces/170/42145/Thumbnail.jpg new file mode 100644 index 00000000..cdafaada Binary files /dev/null and b/ServiceHost/Faces/170/42145/Thumbnail.jpg differ diff --git a/ServiceHost/Faces/170/42398/1.jpg b/ServiceHost/Faces/170/42398/1.jpg new file mode 100644 index 00000000..8e69e0c9 Binary files /dev/null and b/ServiceHost/Faces/170/42398/1.jpg differ diff --git a/ServiceHost/Faces/170/42398/2.jpg b/ServiceHost/Faces/170/42398/2.jpg new file mode 100644 index 00000000..36d8c663 Binary files /dev/null and b/ServiceHost/Faces/170/42398/2.jpg differ diff --git a/ServiceHost/Faces/170/42398/Thumbnail.jpg b/ServiceHost/Faces/170/42398/Thumbnail.jpg new file mode 100644 index 00000000..aef54ba3 Binary files /dev/null and b/ServiceHost/Faces/170/42398/Thumbnail.jpg differ diff --git a/ServiceHost/Faces/170/42416/1.jpg b/ServiceHost/Faces/170/42416/1.jpg new file mode 100644 index 00000000..33fa32f5 Binary files /dev/null and b/ServiceHost/Faces/170/42416/1.jpg differ diff --git a/ServiceHost/Faces/170/42416/2.jpg b/ServiceHost/Faces/170/42416/2.jpg new file mode 100644 index 00000000..aca22f8e Binary files /dev/null and b/ServiceHost/Faces/170/42416/2.jpg differ diff --git a/ServiceHost/Faces/170/42416/Thumbnail.jpg b/ServiceHost/Faces/170/42416/Thumbnail.jpg new file mode 100644 index 00000000..7d15fb19 Binary files /dev/null and b/ServiceHost/Faces/170/42416/Thumbnail.jpg differ diff --git a/ServiceHost/Faces/170/42565/1.jpg b/ServiceHost/Faces/170/42565/1.jpg new file mode 100644 index 00000000..e6cda47f Binary files /dev/null and b/ServiceHost/Faces/170/42565/1.jpg differ diff --git a/ServiceHost/Faces/170/42565/2.jpg b/ServiceHost/Faces/170/42565/2.jpg new file mode 100644 index 00000000..c4f0e186 Binary files /dev/null and b/ServiceHost/Faces/170/42565/2.jpg differ diff --git a/ServiceHost/Faces/170/42565/Thumbnail.jpg b/ServiceHost/Faces/170/42565/Thumbnail.jpg new file mode 100644 index 00000000..036c537a Binary files /dev/null and b/ServiceHost/Faces/170/42565/Thumbnail.jpg differ diff --git a/ServiceHost/Faces/170/42566/Thumbnail.jpg b/ServiceHost/Faces/170/42566/Thumbnail.jpg new file mode 100644 index 00000000..0b180193 Binary files /dev/null and b/ServiceHost/Faces/170/42566/Thumbnail.jpg differ diff --git a/ServiceHost/Faces/170/42614/1.jpg b/ServiceHost/Faces/170/42614/1.jpg new file mode 100644 index 00000000..cba6d553 Binary files /dev/null and b/ServiceHost/Faces/170/42614/1.jpg differ diff --git a/ServiceHost/Faces/170/42614/2.jpg b/ServiceHost/Faces/170/42614/2.jpg new file mode 100644 index 00000000..8530f132 Binary files /dev/null and b/ServiceHost/Faces/170/42614/2.jpg differ diff --git a/ServiceHost/Faces/170/42614/Thumbnail.jpg b/ServiceHost/Faces/170/42614/Thumbnail.jpg new file mode 100644 index 00000000..c6daebc9 Binary files /dev/null and b/ServiceHost/Faces/170/42614/Thumbnail.jpg differ diff --git a/ServiceHost/Faces/170/42650/1.jpg b/ServiceHost/Faces/170/42650/1.jpg new file mode 100644 index 00000000..55151b36 Binary files /dev/null and b/ServiceHost/Faces/170/42650/1.jpg differ diff --git a/ServiceHost/Faces/170/42650/2.jpg b/ServiceHost/Faces/170/42650/2.jpg new file mode 100644 index 00000000..88dc5efa Binary files /dev/null and b/ServiceHost/Faces/170/42650/2.jpg differ diff --git a/ServiceHost/Faces/170/42650/Thumbnail.jpg b/ServiceHost/Faces/170/42650/Thumbnail.jpg new file mode 100644 index 00000000..3d523937 Binary files /dev/null and b/ServiceHost/Faces/170/42650/Thumbnail.jpg differ diff --git a/ServiceHost/Faces/170/42819/1.jpg b/ServiceHost/Faces/170/42819/1.jpg new file mode 100644 index 00000000..41e46bdc Binary files /dev/null and b/ServiceHost/Faces/170/42819/1.jpg differ diff --git a/ServiceHost/Faces/170/42819/2.jpg b/ServiceHost/Faces/170/42819/2.jpg new file mode 100644 index 00000000..44a38cdf Binary files /dev/null and b/ServiceHost/Faces/170/42819/2.jpg differ diff --git a/ServiceHost/Faces/170/42819/Thumbnail.jpg b/ServiceHost/Faces/170/42819/Thumbnail.jpg new file mode 100644 index 00000000..f32ea552 Binary files /dev/null and b/ServiceHost/Faces/170/42819/Thumbnail.jpg differ diff --git a/ServiceHost/Faces/170/42821/1.jpg b/ServiceHost/Faces/170/42821/1.jpg new file mode 100644 index 00000000..5c1dd8b5 Binary files /dev/null and b/ServiceHost/Faces/170/42821/1.jpg differ diff --git a/ServiceHost/Faces/170/42821/2.jpg b/ServiceHost/Faces/170/42821/2.jpg new file mode 100644 index 00000000..9c018097 Binary files /dev/null and b/ServiceHost/Faces/170/42821/2.jpg differ diff --git a/ServiceHost/Faces/170/42821/Thumbnail.jpg b/ServiceHost/Faces/170/42821/Thumbnail.jpg new file mode 100644 index 00000000..5667c602 Binary files /dev/null and b/ServiceHost/Faces/170/42821/Thumbnail.jpg differ diff --git a/ServiceHost/Faces/170/43063/1.jpg b/ServiceHost/Faces/170/43063/1.jpg new file mode 100644 index 00000000..b7feb65c Binary files /dev/null and b/ServiceHost/Faces/170/43063/1.jpg differ diff --git a/ServiceHost/Faces/170/43063/2.jpg b/ServiceHost/Faces/170/43063/2.jpg new file mode 100644 index 00000000..83f27f2f Binary files /dev/null and b/ServiceHost/Faces/170/43063/2.jpg differ diff --git a/ServiceHost/Faces/170/43063/Thumbnail.jpg b/ServiceHost/Faces/170/43063/Thumbnail.jpg new file mode 100644 index 00000000..abae9ac2 Binary files /dev/null and b/ServiceHost/Faces/170/43063/Thumbnail.jpg differ diff --git a/ServiceHost/Faces/170/43064/Thumbnail.jpg b/ServiceHost/Faces/170/43064/Thumbnail.jpg new file mode 100644 index 00000000..237c8bfa Binary files /dev/null and b/ServiceHost/Faces/170/43064/Thumbnail.jpg differ diff --git a/ServiceHost/Faces/170/43133/1.jpg b/ServiceHost/Faces/170/43133/1.jpg new file mode 100644 index 00000000..e4904b76 Binary files /dev/null and b/ServiceHost/Faces/170/43133/1.jpg differ diff --git a/ServiceHost/Faces/170/43133/2.jpg b/ServiceHost/Faces/170/43133/2.jpg new file mode 100644 index 00000000..6a7e96a4 Binary files /dev/null and b/ServiceHost/Faces/170/43133/2.jpg differ diff --git a/ServiceHost/Faces/170/43133/Thumbnail.jpg b/ServiceHost/Faces/170/43133/Thumbnail.jpg new file mode 100644 index 00000000..733eadc4 Binary files /dev/null and b/ServiceHost/Faces/170/43133/Thumbnail.jpg differ diff --git a/ServiceHost/Faces/170/43134/1.jpg b/ServiceHost/Faces/170/43134/1.jpg new file mode 100644 index 00000000..7b7fbe7d Binary files /dev/null and b/ServiceHost/Faces/170/43134/1.jpg differ diff --git a/ServiceHost/Faces/170/43134/2.jpg b/ServiceHost/Faces/170/43134/2.jpg new file mode 100644 index 00000000..e702e730 Binary files /dev/null and b/ServiceHost/Faces/170/43134/2.jpg differ diff --git a/ServiceHost/Faces/170/43134/Thumbnail.jpg b/ServiceHost/Faces/170/43134/Thumbnail.jpg new file mode 100644 index 00000000..f0d94c43 Binary files /dev/null and b/ServiceHost/Faces/170/43134/Thumbnail.jpg differ diff --git a/ServiceHost/Faces/170/43137/1.jpg b/ServiceHost/Faces/170/43137/1.jpg new file mode 100644 index 00000000..f4b387d6 Binary files /dev/null and b/ServiceHost/Faces/170/43137/1.jpg differ diff --git a/ServiceHost/Faces/170/43137/2.jpg b/ServiceHost/Faces/170/43137/2.jpg new file mode 100644 index 00000000..e014457e Binary files /dev/null and b/ServiceHost/Faces/170/43137/2.jpg differ diff --git a/ServiceHost/Faces/170/43137/Thumbnail.jpg b/ServiceHost/Faces/170/43137/Thumbnail.jpg new file mode 100644 index 00000000..f899a356 Binary files /dev/null and b/ServiceHost/Faces/170/43137/Thumbnail.jpg differ diff --git a/ServiceHost/Faces/170/4328/1.jpg b/ServiceHost/Faces/170/4328/1.jpg new file mode 100644 index 00000000..62e7c05a Binary files /dev/null and b/ServiceHost/Faces/170/4328/1.jpg differ diff --git a/ServiceHost/Faces/170/4328/2.jpg b/ServiceHost/Faces/170/4328/2.jpg new file mode 100644 index 00000000..dcb0be0b Binary files /dev/null and b/ServiceHost/Faces/170/4328/2.jpg differ diff --git a/ServiceHost/Faces/170/4328/Thumbnail.jpg b/ServiceHost/Faces/170/4328/Thumbnail.jpg new file mode 100644 index 00000000..a0493a25 Binary files /dev/null and b/ServiceHost/Faces/170/4328/Thumbnail.jpg differ diff --git a/ServiceHost/Faces/170/4329/Thumbnail.jpg b/ServiceHost/Faces/170/4329/Thumbnail.jpg new file mode 100644 index 00000000..497419c1 Binary files /dev/null and b/ServiceHost/Faces/170/4329/Thumbnail.jpg differ diff --git a/ServiceHost/Faces/170/4332/1.jpg b/ServiceHost/Faces/170/4332/1.jpg new file mode 100644 index 00000000..fb1d0b79 Binary files /dev/null and b/ServiceHost/Faces/170/4332/1.jpg differ diff --git a/ServiceHost/Faces/170/4332/2.jpg b/ServiceHost/Faces/170/4332/2.jpg new file mode 100644 index 00000000..18238615 Binary files /dev/null and b/ServiceHost/Faces/170/4332/2.jpg differ diff --git a/ServiceHost/Faces/170/4332/Thumbnail.jpg b/ServiceHost/Faces/170/4332/Thumbnail.jpg new file mode 100644 index 00000000..89696b69 Binary files /dev/null and b/ServiceHost/Faces/170/4332/Thumbnail.jpg differ diff --git a/ServiceHost/Faces/170/4333/1.jpg b/ServiceHost/Faces/170/4333/1.jpg new file mode 100644 index 00000000..93f02ebc Binary files /dev/null and b/ServiceHost/Faces/170/4333/1.jpg differ diff --git a/ServiceHost/Faces/170/4333/2.jpg b/ServiceHost/Faces/170/4333/2.jpg new file mode 100644 index 00000000..a36b08f7 Binary files /dev/null and b/ServiceHost/Faces/170/4333/2.jpg differ diff --git a/ServiceHost/Faces/170/4333/Thumbnail.jpg b/ServiceHost/Faces/170/4333/Thumbnail.jpg new file mode 100644 index 00000000..7a958adf Binary files /dev/null and b/ServiceHost/Faces/170/4333/Thumbnail.jpg differ diff --git a/ServiceHost/Faces/170/4335/1.jpg b/ServiceHost/Faces/170/4335/1.jpg new file mode 100644 index 00000000..915b0213 Binary files /dev/null and b/ServiceHost/Faces/170/4335/1.jpg differ diff --git a/ServiceHost/Faces/170/4335/2.jpg b/ServiceHost/Faces/170/4335/2.jpg new file mode 100644 index 00000000..fb07033c Binary files /dev/null and b/ServiceHost/Faces/170/4335/2.jpg differ diff --git a/ServiceHost/Faces/170/4335/Thumbnail.jpg b/ServiceHost/Faces/170/4335/Thumbnail.jpg new file mode 100644 index 00000000..6a197af3 Binary files /dev/null and b/ServiceHost/Faces/170/4335/Thumbnail.jpg differ diff --git a/ServiceHost/Faces/170/4337/1.jpg b/ServiceHost/Faces/170/4337/1.jpg new file mode 100644 index 00000000..87bfb2d9 Binary files /dev/null and b/ServiceHost/Faces/170/4337/1.jpg differ diff --git a/ServiceHost/Faces/170/4337/2.jpg b/ServiceHost/Faces/170/4337/2.jpg new file mode 100644 index 00000000..f321f350 Binary files /dev/null and b/ServiceHost/Faces/170/4337/2.jpg differ diff --git a/ServiceHost/Faces/170/4337/Thumbnail.jpg b/ServiceHost/Faces/170/4337/Thumbnail.jpg new file mode 100644 index 00000000..4ae6e80d Binary files /dev/null and b/ServiceHost/Faces/170/4337/Thumbnail.jpg differ diff --git a/ServiceHost/Faces/170/4339/1.jpg b/ServiceHost/Faces/170/4339/1.jpg new file mode 100644 index 00000000..887503b4 Binary files /dev/null and b/ServiceHost/Faces/170/4339/1.jpg differ diff --git a/ServiceHost/Faces/170/4339/2.jpg b/ServiceHost/Faces/170/4339/2.jpg new file mode 100644 index 00000000..d652e3db Binary files /dev/null and b/ServiceHost/Faces/170/4339/2.jpg differ diff --git a/ServiceHost/Faces/170/4339/Thumbnail.jpg b/ServiceHost/Faces/170/4339/Thumbnail.jpg new file mode 100644 index 00000000..1e06c589 Binary files /dev/null and b/ServiceHost/Faces/170/4339/Thumbnail.jpg differ diff --git a/ServiceHost/Faces/170/4342/Thumbnail.jpg b/ServiceHost/Faces/170/4342/Thumbnail.jpg new file mode 100644 index 00000000..41ba3461 Binary files /dev/null and b/ServiceHost/Faces/170/4342/Thumbnail.jpg differ diff --git a/ServiceHost/Faces/170/4347/1.jpg b/ServiceHost/Faces/170/4347/1.jpg new file mode 100644 index 00000000..80ba5b77 Binary files /dev/null and b/ServiceHost/Faces/170/4347/1.jpg differ diff --git a/ServiceHost/Faces/170/4347/2.jpg b/ServiceHost/Faces/170/4347/2.jpg new file mode 100644 index 00000000..663f2288 Binary files /dev/null and b/ServiceHost/Faces/170/4347/2.jpg differ diff --git a/ServiceHost/Faces/170/4347/Thumbnail.jpg b/ServiceHost/Faces/170/4347/Thumbnail.jpg new file mode 100644 index 00000000..0a7d3239 Binary files /dev/null and b/ServiceHost/Faces/170/4347/Thumbnail.jpg differ diff --git a/ServiceHost/Faces/170/43776/1.jpg b/ServiceHost/Faces/170/43776/1.jpg new file mode 100644 index 00000000..3a759b30 Binary files /dev/null and b/ServiceHost/Faces/170/43776/1.jpg differ diff --git a/ServiceHost/Faces/170/43776/2.jpg b/ServiceHost/Faces/170/43776/2.jpg new file mode 100644 index 00000000..37e00801 Binary files /dev/null and b/ServiceHost/Faces/170/43776/2.jpg differ diff --git a/ServiceHost/Faces/170/43776/Thumbnail.jpg b/ServiceHost/Faces/170/43776/Thumbnail.jpg new file mode 100644 index 00000000..3c2ab0ac Binary files /dev/null and b/ServiceHost/Faces/170/43776/Thumbnail.jpg differ diff --git a/ServiceHost/Faces/170/43778/1.jpg b/ServiceHost/Faces/170/43778/1.jpg new file mode 100644 index 00000000..e676409f Binary files /dev/null and b/ServiceHost/Faces/170/43778/1.jpg differ diff --git a/ServiceHost/Faces/170/43778/2.jpg b/ServiceHost/Faces/170/43778/2.jpg new file mode 100644 index 00000000..c201d194 Binary files /dev/null and b/ServiceHost/Faces/170/43778/2.jpg differ diff --git a/ServiceHost/Faces/170/43778/Thumbnail.jpg b/ServiceHost/Faces/170/43778/Thumbnail.jpg new file mode 100644 index 00000000..f236d8a0 Binary files /dev/null and b/ServiceHost/Faces/170/43778/Thumbnail.jpg differ diff --git a/ServiceHost/Faces/170/43792/1.jpg b/ServiceHost/Faces/170/43792/1.jpg new file mode 100644 index 00000000..640c9996 Binary files /dev/null and b/ServiceHost/Faces/170/43792/1.jpg differ diff --git a/ServiceHost/Faces/170/43792/2.jpg b/ServiceHost/Faces/170/43792/2.jpg new file mode 100644 index 00000000..1ee2b41d Binary files /dev/null and b/ServiceHost/Faces/170/43792/2.jpg differ diff --git a/ServiceHost/Faces/170/43792/Thumbnail.jpg b/ServiceHost/Faces/170/43792/Thumbnail.jpg new file mode 100644 index 00000000..633bb927 Binary files /dev/null and b/ServiceHost/Faces/170/43792/Thumbnail.jpg differ diff --git a/ServiceHost/Faces/170/43849/1.jpg b/ServiceHost/Faces/170/43849/1.jpg new file mode 100644 index 00000000..4e2ec069 Binary files /dev/null and b/ServiceHost/Faces/170/43849/1.jpg differ diff --git a/ServiceHost/Faces/170/43849/2.jpg b/ServiceHost/Faces/170/43849/2.jpg new file mode 100644 index 00000000..e24fb0d7 Binary files /dev/null and b/ServiceHost/Faces/170/43849/2.jpg differ diff --git a/ServiceHost/Faces/170/43849/Thumbnail.jpg b/ServiceHost/Faces/170/43849/Thumbnail.jpg new file mode 100644 index 00000000..9c9212c7 Binary files /dev/null and b/ServiceHost/Faces/170/43849/Thumbnail.jpg differ diff --git a/ServiceHost/Faces/170/43850/1.jpg b/ServiceHost/Faces/170/43850/1.jpg new file mode 100644 index 00000000..656f46f2 Binary files /dev/null and b/ServiceHost/Faces/170/43850/1.jpg differ diff --git a/ServiceHost/Faces/170/43850/2.jpg b/ServiceHost/Faces/170/43850/2.jpg new file mode 100644 index 00000000..9b3355a9 Binary files /dev/null and b/ServiceHost/Faces/170/43850/2.jpg differ diff --git a/ServiceHost/Faces/170/43850/Thumbnail.jpg b/ServiceHost/Faces/170/43850/Thumbnail.jpg new file mode 100644 index 00000000..900bbbbf Binary files /dev/null and b/ServiceHost/Faces/170/43850/Thumbnail.jpg differ diff --git a/ServiceHost/Faces/170/43851/1.jpg b/ServiceHost/Faces/170/43851/1.jpg new file mode 100644 index 00000000..53802f93 Binary files /dev/null and b/ServiceHost/Faces/170/43851/1.jpg differ diff --git a/ServiceHost/Faces/170/43851/2.jpg b/ServiceHost/Faces/170/43851/2.jpg new file mode 100644 index 00000000..8b74d4e9 Binary files /dev/null and b/ServiceHost/Faces/170/43851/2.jpg differ diff --git a/ServiceHost/Faces/170/43851/Thumbnail.jpg b/ServiceHost/Faces/170/43851/Thumbnail.jpg new file mode 100644 index 00000000..392ce09e Binary files /dev/null and b/ServiceHost/Faces/170/43851/Thumbnail.jpg differ diff --git a/ServiceHost/Faces/170/43855/1.jpg b/ServiceHost/Faces/170/43855/1.jpg new file mode 100644 index 00000000..334d6a87 Binary files /dev/null and b/ServiceHost/Faces/170/43855/1.jpg differ diff --git a/ServiceHost/Faces/170/43855/2.jpg b/ServiceHost/Faces/170/43855/2.jpg new file mode 100644 index 00000000..951b177f Binary files /dev/null and b/ServiceHost/Faces/170/43855/2.jpg differ diff --git a/ServiceHost/Faces/170/43855/Thumbnail.jpg b/ServiceHost/Faces/170/43855/Thumbnail.jpg new file mode 100644 index 00000000..15b734d1 Binary files /dev/null and b/ServiceHost/Faces/170/43855/Thumbnail.jpg differ diff --git a/ServiceHost/Faces/170/43856/1.jpg b/ServiceHost/Faces/170/43856/1.jpg new file mode 100644 index 00000000..ae7cbf61 Binary files /dev/null and b/ServiceHost/Faces/170/43856/1.jpg differ diff --git a/ServiceHost/Faces/170/43856/2.jpg b/ServiceHost/Faces/170/43856/2.jpg new file mode 100644 index 00000000..2f6c0b5d Binary files /dev/null and b/ServiceHost/Faces/170/43856/2.jpg differ diff --git a/ServiceHost/Faces/170/43856/Thumbnail.jpg b/ServiceHost/Faces/170/43856/Thumbnail.jpg new file mode 100644 index 00000000..4c3ff06b Binary files /dev/null and b/ServiceHost/Faces/170/43856/Thumbnail.jpg differ diff --git a/ServiceHost/Faces/170/4421/1.jpg b/ServiceHost/Faces/170/4421/1.jpg new file mode 100644 index 00000000..3f281b15 Binary files /dev/null and b/ServiceHost/Faces/170/4421/1.jpg differ diff --git a/ServiceHost/Faces/170/4421/2.jpg b/ServiceHost/Faces/170/4421/2.jpg new file mode 100644 index 00000000..fee407fe Binary files /dev/null and b/ServiceHost/Faces/170/4421/2.jpg differ diff --git a/ServiceHost/Faces/170/4421/Thumbnail.jpg b/ServiceHost/Faces/170/4421/Thumbnail.jpg new file mode 100644 index 00000000..761ec14b Binary files /dev/null and b/ServiceHost/Faces/170/4421/Thumbnail.jpg differ diff --git a/ServiceHost/Faces/170/4463/Thumbnail.jpg b/ServiceHost/Faces/170/4463/Thumbnail.jpg new file mode 100644 index 00000000..362b8cfc Binary files /dev/null and b/ServiceHost/Faces/170/4463/Thumbnail.jpg differ diff --git a/ServiceHost/Faces/170/4486/1.jpg b/ServiceHost/Faces/170/4486/1.jpg new file mode 100644 index 00000000..a3ccc50e Binary files /dev/null and b/ServiceHost/Faces/170/4486/1.jpg differ diff --git a/ServiceHost/Faces/170/4486/2.jpg b/ServiceHost/Faces/170/4486/2.jpg new file mode 100644 index 00000000..a80199ba Binary files /dev/null and b/ServiceHost/Faces/170/4486/2.jpg differ diff --git a/ServiceHost/Faces/170/4486/Thumbnail.jpg b/ServiceHost/Faces/170/4486/Thumbnail.jpg new file mode 100644 index 00000000..711a2ca3 Binary files /dev/null and b/ServiceHost/Faces/170/4486/Thumbnail.jpg differ diff --git a/ServiceHost/Faces/170/4745/1.jpg b/ServiceHost/Faces/170/4745/1.jpg new file mode 100644 index 00000000..87d33c07 Binary files /dev/null and b/ServiceHost/Faces/170/4745/1.jpg differ diff --git a/ServiceHost/Faces/170/4745/2.jpg b/ServiceHost/Faces/170/4745/2.jpg new file mode 100644 index 00000000..19f11ebf Binary files /dev/null and b/ServiceHost/Faces/170/4745/2.jpg differ diff --git a/ServiceHost/Faces/170/4745/Thumbnail.jpg b/ServiceHost/Faces/170/4745/Thumbnail.jpg new file mode 100644 index 00000000..2d577f94 Binary files /dev/null and b/ServiceHost/Faces/170/4745/Thumbnail.jpg differ diff --git a/ServiceHost/Faces/170/4896/Thumbnail.jpg b/ServiceHost/Faces/170/4896/Thumbnail.jpg new file mode 100644 index 00000000..d0d1eb5b Binary files /dev/null and b/ServiceHost/Faces/170/4896/Thumbnail.jpg differ diff --git a/ServiceHost/Faces/170/4897/1.jpg b/ServiceHost/Faces/170/4897/1.jpg new file mode 100644 index 00000000..26779c1b Binary files /dev/null and b/ServiceHost/Faces/170/4897/1.jpg differ diff --git a/ServiceHost/Faces/170/4897/2.jpg b/ServiceHost/Faces/170/4897/2.jpg new file mode 100644 index 00000000..fa48af75 Binary files /dev/null and b/ServiceHost/Faces/170/4897/2.jpg differ diff --git a/ServiceHost/Faces/170/4897/Thumbnail.jpg b/ServiceHost/Faces/170/4897/Thumbnail.jpg new file mode 100644 index 00000000..db3e7d84 Binary files /dev/null and b/ServiceHost/Faces/170/4897/Thumbnail.jpg differ diff --git a/ServiceHost/Faces/170/4899/Thumbnail.jpg b/ServiceHost/Faces/170/4899/Thumbnail.jpg new file mode 100644 index 00000000..e1a0cf70 Binary files /dev/null and b/ServiceHost/Faces/170/4899/Thumbnail.jpg differ diff --git a/ServiceHost/Faces/170/4901/1.jpg b/ServiceHost/Faces/170/4901/1.jpg new file mode 100644 index 00000000..abf699fd Binary files /dev/null and b/ServiceHost/Faces/170/4901/1.jpg differ diff --git a/ServiceHost/Faces/170/4901/2.jpg b/ServiceHost/Faces/170/4901/2.jpg new file mode 100644 index 00000000..420e8af0 Binary files /dev/null and b/ServiceHost/Faces/170/4901/2.jpg differ diff --git a/ServiceHost/Faces/170/4901/Thumbnail.jpg b/ServiceHost/Faces/170/4901/Thumbnail.jpg new file mode 100644 index 00000000..5d807676 Binary files /dev/null and b/ServiceHost/Faces/170/4901/Thumbnail.jpg differ diff --git a/ServiceHost/Faces/170/5023/1.jpg b/ServiceHost/Faces/170/5023/1.jpg new file mode 100644 index 00000000..d5a0559f Binary files /dev/null and b/ServiceHost/Faces/170/5023/1.jpg differ diff --git a/ServiceHost/Faces/170/5023/2.jpg b/ServiceHost/Faces/170/5023/2.jpg new file mode 100644 index 00000000..998519a5 Binary files /dev/null and b/ServiceHost/Faces/170/5023/2.jpg differ diff --git a/ServiceHost/Faces/170/5023/Thumbnail.jpg b/ServiceHost/Faces/170/5023/Thumbnail.jpg new file mode 100644 index 00000000..65860ece Binary files /dev/null and b/ServiceHost/Faces/170/5023/Thumbnail.jpg differ diff --git a/ServiceHost/Faces/170/5049/1.jpg b/ServiceHost/Faces/170/5049/1.jpg new file mode 100644 index 00000000..2f5ba6c8 Binary files /dev/null and b/ServiceHost/Faces/170/5049/1.jpg differ diff --git a/ServiceHost/Faces/170/5049/2.jpg b/ServiceHost/Faces/170/5049/2.jpg new file mode 100644 index 00000000..dd926db7 Binary files /dev/null and b/ServiceHost/Faces/170/5049/2.jpg differ diff --git a/ServiceHost/Faces/170/5049/Thumbnail.jpg b/ServiceHost/Faces/170/5049/Thumbnail.jpg new file mode 100644 index 00000000..f2de18d1 Binary files /dev/null and b/ServiceHost/Faces/170/5049/Thumbnail.jpg differ diff --git a/ServiceHost/Faces/170/5212/Thumbnail.jpg b/ServiceHost/Faces/170/5212/Thumbnail.jpg new file mode 100644 index 00000000..9839c3b5 Binary files /dev/null and b/ServiceHost/Faces/170/5212/Thumbnail.jpg differ diff --git a/ServiceHost/Faces/170/5453/Thumbnail.jpg b/ServiceHost/Faces/170/5453/Thumbnail.jpg new file mode 100644 index 00000000..60d76b7d Binary files /dev/null and b/ServiceHost/Faces/170/5453/Thumbnail.jpg differ diff --git a/ServiceHost/Faces/170/5461/Thumbnail.jpg b/ServiceHost/Faces/170/5461/Thumbnail.jpg new file mode 100644 index 00000000..fe1d3b81 Binary files /dev/null and b/ServiceHost/Faces/170/5461/Thumbnail.jpg differ diff --git a/ServiceHost/Faces/170/5469/1.jpg b/ServiceHost/Faces/170/5469/1.jpg new file mode 100644 index 00000000..536ca1d3 Binary files /dev/null and b/ServiceHost/Faces/170/5469/1.jpg differ diff --git a/ServiceHost/Faces/170/5469/2.jpg b/ServiceHost/Faces/170/5469/2.jpg new file mode 100644 index 00000000..25804584 Binary files /dev/null and b/ServiceHost/Faces/170/5469/2.jpg differ diff --git a/ServiceHost/Faces/170/5469/Thumbnail.jpg b/ServiceHost/Faces/170/5469/Thumbnail.jpg new file mode 100644 index 00000000..f76a8d5b Binary files /dev/null and b/ServiceHost/Faces/170/5469/Thumbnail.jpg differ diff --git a/ServiceHost/Faces/170/5498/1.jpg b/ServiceHost/Faces/170/5498/1.jpg new file mode 100644 index 00000000..f586d3a0 Binary files /dev/null and b/ServiceHost/Faces/170/5498/1.jpg differ diff --git a/ServiceHost/Faces/170/5498/2.jpg b/ServiceHost/Faces/170/5498/2.jpg new file mode 100644 index 00000000..914a532d Binary files /dev/null and b/ServiceHost/Faces/170/5498/2.jpg differ diff --git a/ServiceHost/Faces/170/5498/Thumbnail.jpg b/ServiceHost/Faces/170/5498/Thumbnail.jpg new file mode 100644 index 00000000..6beb5783 Binary files /dev/null and b/ServiceHost/Faces/170/5498/Thumbnail.jpg differ diff --git a/ServiceHost/Faces/170/5503/1.jpg b/ServiceHost/Faces/170/5503/1.jpg new file mode 100644 index 00000000..cad91340 Binary files /dev/null and b/ServiceHost/Faces/170/5503/1.jpg differ diff --git a/ServiceHost/Faces/170/5503/2.jpg b/ServiceHost/Faces/170/5503/2.jpg new file mode 100644 index 00000000..43abb878 Binary files /dev/null and b/ServiceHost/Faces/170/5503/2.jpg differ diff --git a/ServiceHost/Faces/170/5503/Thumbnail.jpg b/ServiceHost/Faces/170/5503/Thumbnail.jpg new file mode 100644 index 00000000..41469c31 Binary files /dev/null and b/ServiceHost/Faces/170/5503/Thumbnail.jpg differ diff --git a/ServiceHost/Faces/170/5684/1.jpg b/ServiceHost/Faces/170/5684/1.jpg new file mode 100644 index 00000000..a5f01eec Binary files /dev/null and b/ServiceHost/Faces/170/5684/1.jpg differ diff --git a/ServiceHost/Faces/170/5684/2.jpg b/ServiceHost/Faces/170/5684/2.jpg new file mode 100644 index 00000000..927d416f Binary files /dev/null and b/ServiceHost/Faces/170/5684/2.jpg differ diff --git a/ServiceHost/Faces/170/5684/Thumbnail.jpg b/ServiceHost/Faces/170/5684/Thumbnail.jpg new file mode 100644 index 00000000..cd0ad99f Binary files /dev/null and b/ServiceHost/Faces/170/5684/Thumbnail.jpg differ diff --git a/ServiceHost/Faces/170/5705/1.jpg b/ServiceHost/Faces/170/5705/1.jpg new file mode 100644 index 00000000..2fc25f78 Binary files /dev/null and b/ServiceHost/Faces/170/5705/1.jpg differ diff --git a/ServiceHost/Faces/170/5705/2.jpg b/ServiceHost/Faces/170/5705/2.jpg new file mode 100644 index 00000000..23f4cca2 Binary files /dev/null and b/ServiceHost/Faces/170/5705/2.jpg differ diff --git a/ServiceHost/Faces/170/5705/Thumbnail.jpg b/ServiceHost/Faces/170/5705/Thumbnail.jpg new file mode 100644 index 00000000..8faffc44 Binary files /dev/null and b/ServiceHost/Faces/170/5705/Thumbnail.jpg differ diff --git a/ServiceHost/Faces/170/5734/1.jpg b/ServiceHost/Faces/170/5734/1.jpg new file mode 100644 index 00000000..2af96b60 Binary files /dev/null and b/ServiceHost/Faces/170/5734/1.jpg differ diff --git a/ServiceHost/Faces/170/5734/2.jpg b/ServiceHost/Faces/170/5734/2.jpg new file mode 100644 index 00000000..fe5b5534 Binary files /dev/null and b/ServiceHost/Faces/170/5734/2.jpg differ diff --git a/ServiceHost/Faces/170/5734/Thumbnail.jpg b/ServiceHost/Faces/170/5734/Thumbnail.jpg new file mode 100644 index 00000000..34883738 Binary files /dev/null and b/ServiceHost/Faces/170/5734/Thumbnail.jpg differ diff --git a/ServiceHost/Faces/170/5890/Thumbnail.jpg b/ServiceHost/Faces/170/5890/Thumbnail.jpg new file mode 100644 index 00000000..22f05b5e Binary files /dev/null and b/ServiceHost/Faces/170/5890/Thumbnail.jpg differ diff --git a/ServiceHost/Faces/170/5977/Thumbnail.jpg b/ServiceHost/Faces/170/5977/Thumbnail.jpg new file mode 100644 index 00000000..d05f688d Binary files /dev/null and b/ServiceHost/Faces/170/5977/Thumbnail.jpg differ diff --git a/ServiceHost/Faces/170/6045/Thumbnail.jpg b/ServiceHost/Faces/170/6045/Thumbnail.jpg new file mode 100644 index 00000000..5df7666c Binary files /dev/null and b/ServiceHost/Faces/170/6045/Thumbnail.jpg differ diff --git a/ServiceHost/Faces/170/6145/1.jpg b/ServiceHost/Faces/170/6145/1.jpg new file mode 100644 index 00000000..3134a423 Binary files /dev/null and b/ServiceHost/Faces/170/6145/1.jpg differ diff --git a/ServiceHost/Faces/170/6145/2.jpg b/ServiceHost/Faces/170/6145/2.jpg new file mode 100644 index 00000000..6b3d42f1 Binary files /dev/null and b/ServiceHost/Faces/170/6145/2.jpg differ diff --git a/ServiceHost/Faces/170/6145/Thumbnail.jpg b/ServiceHost/Faces/170/6145/Thumbnail.jpg new file mode 100644 index 00000000..faeb4096 Binary files /dev/null and b/ServiceHost/Faces/170/6145/Thumbnail.jpg differ diff --git a/ServiceHost/Faces/170/6227/Thumbnail.jpg b/ServiceHost/Faces/170/6227/Thumbnail.jpg new file mode 100644 index 00000000..3904532e Binary files /dev/null and b/ServiceHost/Faces/170/6227/Thumbnail.jpg differ diff --git a/ServiceHost/Faces/170/6236/Thumbnail.jpg b/ServiceHost/Faces/170/6236/Thumbnail.jpg new file mode 100644 index 00000000..e9ccc071 Binary files /dev/null and b/ServiceHost/Faces/170/6236/Thumbnail.jpg differ diff --git a/ServiceHost/Faces/170/6238/1.jpg b/ServiceHost/Faces/170/6238/1.jpg new file mode 100644 index 00000000..11e9f9e0 Binary files /dev/null and b/ServiceHost/Faces/170/6238/1.jpg differ diff --git a/ServiceHost/Faces/170/6238/2.jpg b/ServiceHost/Faces/170/6238/2.jpg new file mode 100644 index 00000000..89b7f9e1 Binary files /dev/null and b/ServiceHost/Faces/170/6238/2.jpg differ diff --git a/ServiceHost/Faces/170/6238/Thumbnail.jpg b/ServiceHost/Faces/170/6238/Thumbnail.jpg new file mode 100644 index 00000000..f048a0b0 Binary files /dev/null and b/ServiceHost/Faces/170/6238/Thumbnail.jpg differ diff --git a/ServiceHost/Faces/170/6745/1.jpg b/ServiceHost/Faces/170/6745/1.jpg new file mode 100644 index 00000000..85d4ae81 Binary files /dev/null and b/ServiceHost/Faces/170/6745/1.jpg differ diff --git a/ServiceHost/Faces/170/6745/2.jpg b/ServiceHost/Faces/170/6745/2.jpg new file mode 100644 index 00000000..db02859b Binary files /dev/null and b/ServiceHost/Faces/170/6745/2.jpg differ diff --git a/ServiceHost/Faces/170/6745/Thumbnail.jpg b/ServiceHost/Faces/170/6745/Thumbnail.jpg new file mode 100644 index 00000000..d42e7769 Binary files /dev/null and b/ServiceHost/Faces/170/6745/Thumbnail.jpg differ diff --git a/ServiceHost/Faces/170/7138/1.jpg b/ServiceHost/Faces/170/7138/1.jpg new file mode 100644 index 00000000..0d4b9348 Binary files /dev/null and b/ServiceHost/Faces/170/7138/1.jpg differ diff --git a/ServiceHost/Faces/170/7138/2.jpg b/ServiceHost/Faces/170/7138/2.jpg new file mode 100644 index 00000000..6f7e4bc9 Binary files /dev/null and b/ServiceHost/Faces/170/7138/2.jpg differ diff --git a/ServiceHost/Faces/170/7138/Thumbnail.jpg b/ServiceHost/Faces/170/7138/Thumbnail.jpg new file mode 100644 index 00000000..3b0b673d Binary files /dev/null and b/ServiceHost/Faces/170/7138/Thumbnail.jpg differ diff --git a/ServiceHost/Faces/170/7139/1.jpg b/ServiceHost/Faces/170/7139/1.jpg new file mode 100644 index 00000000..379a3aed Binary files /dev/null and b/ServiceHost/Faces/170/7139/1.jpg differ diff --git a/ServiceHost/Faces/170/7139/2.jpg b/ServiceHost/Faces/170/7139/2.jpg new file mode 100644 index 00000000..119f1e31 Binary files /dev/null and b/ServiceHost/Faces/170/7139/2.jpg differ diff --git a/ServiceHost/Faces/170/7139/Thumbnail.jpg b/ServiceHost/Faces/170/7139/Thumbnail.jpg new file mode 100644 index 00000000..cd6863af Binary files /dev/null and b/ServiceHost/Faces/170/7139/Thumbnail.jpg differ diff --git a/ServiceHost/Faces/170/7375/Thumbnail.jpg b/ServiceHost/Faces/170/7375/Thumbnail.jpg new file mode 100644 index 00000000..a8a34db9 Binary files /dev/null and b/ServiceHost/Faces/170/7375/Thumbnail.jpg differ diff --git a/ServiceHost/Faces/170/7408/1.jpg b/ServiceHost/Faces/170/7408/1.jpg new file mode 100644 index 00000000..00eff2d7 Binary files /dev/null and b/ServiceHost/Faces/170/7408/1.jpg differ diff --git a/ServiceHost/Faces/170/7408/2.jpg b/ServiceHost/Faces/170/7408/2.jpg new file mode 100644 index 00000000..4d0f7109 Binary files /dev/null and b/ServiceHost/Faces/170/7408/2.jpg differ diff --git a/ServiceHost/Faces/170/7408/Thumbnail.jpg b/ServiceHost/Faces/170/7408/Thumbnail.jpg new file mode 100644 index 00000000..637cb7c2 Binary files /dev/null and b/ServiceHost/Faces/170/7408/Thumbnail.jpg differ diff --git a/ServiceHost/Faces/170/7542/Thumbnail.jpg b/ServiceHost/Faces/170/7542/Thumbnail.jpg new file mode 100644 index 00000000..8868e5e2 Binary files /dev/null and b/ServiceHost/Faces/170/7542/Thumbnail.jpg differ diff --git a/ServiceHost/Faces/170/7544/1.jpg b/ServiceHost/Faces/170/7544/1.jpg new file mode 100644 index 00000000..b9e651ce Binary files /dev/null and b/ServiceHost/Faces/170/7544/1.jpg differ diff --git a/ServiceHost/Faces/170/7544/2.jpg b/ServiceHost/Faces/170/7544/2.jpg new file mode 100644 index 00000000..d5462ebf Binary files /dev/null and b/ServiceHost/Faces/170/7544/2.jpg differ diff --git a/ServiceHost/Faces/170/7544/Thumbnail.jpg b/ServiceHost/Faces/170/7544/Thumbnail.jpg new file mode 100644 index 00000000..3a6524ee Binary files /dev/null and b/ServiceHost/Faces/170/7544/Thumbnail.jpg differ diff --git a/ServiceHost/Faces/170/7546/1.jpg b/ServiceHost/Faces/170/7546/1.jpg new file mode 100644 index 00000000..6086f936 Binary files /dev/null and b/ServiceHost/Faces/170/7546/1.jpg differ diff --git a/ServiceHost/Faces/170/7546/2.jpg b/ServiceHost/Faces/170/7546/2.jpg new file mode 100644 index 00000000..a6220f01 Binary files /dev/null and b/ServiceHost/Faces/170/7546/2.jpg differ diff --git a/ServiceHost/Faces/170/7546/Thumbnail.jpg b/ServiceHost/Faces/170/7546/Thumbnail.jpg new file mode 100644 index 00000000..01b374a9 Binary files /dev/null and b/ServiceHost/Faces/170/7546/Thumbnail.jpg differ diff --git a/ServiceHost/Faces/170/7685/Thumbnail.jpg b/ServiceHost/Faces/170/7685/Thumbnail.jpg new file mode 100644 index 00000000..780da086 Binary files /dev/null and b/ServiceHost/Faces/170/7685/Thumbnail.jpg differ diff --git a/ServiceHost/Faces/170/7715/1.jpg b/ServiceHost/Faces/170/7715/1.jpg new file mode 100644 index 00000000..57872a20 Binary files /dev/null and b/ServiceHost/Faces/170/7715/1.jpg differ diff --git a/ServiceHost/Faces/170/7715/2.jpg b/ServiceHost/Faces/170/7715/2.jpg new file mode 100644 index 00000000..072893a8 Binary files /dev/null and b/ServiceHost/Faces/170/7715/2.jpg differ diff --git a/ServiceHost/Faces/170/7715/Thumbnail.jpg b/ServiceHost/Faces/170/7715/Thumbnail.jpg new file mode 100644 index 00000000..ff1e11ea Binary files /dev/null and b/ServiceHost/Faces/170/7715/Thumbnail.jpg differ diff --git a/ServiceHost/Faces/170/7779/Thumbnail.jpg b/ServiceHost/Faces/170/7779/Thumbnail.jpg new file mode 100644 index 00000000..a9222c6b Binary files /dev/null and b/ServiceHost/Faces/170/7779/Thumbnail.jpg differ diff --git a/ServiceHost/Faces/170/8272/1.jpg b/ServiceHost/Faces/170/8272/1.jpg new file mode 100644 index 00000000..dde6c0dd Binary files /dev/null and b/ServiceHost/Faces/170/8272/1.jpg differ diff --git a/ServiceHost/Faces/170/8272/2.jpg b/ServiceHost/Faces/170/8272/2.jpg new file mode 100644 index 00000000..ef5a571e Binary files /dev/null and b/ServiceHost/Faces/170/8272/2.jpg differ diff --git a/ServiceHost/Faces/170/8272/Thumbnail.jpg b/ServiceHost/Faces/170/8272/Thumbnail.jpg new file mode 100644 index 00000000..0f192902 Binary files /dev/null and b/ServiceHost/Faces/170/8272/Thumbnail.jpg differ diff --git a/ServiceHost/Faces/170/8395/Thumbnail.jpg b/ServiceHost/Faces/170/8395/Thumbnail.jpg new file mode 100644 index 00000000..d7516de5 Binary files /dev/null and b/ServiceHost/Faces/170/8395/Thumbnail.jpg differ diff --git a/ServiceHost/Faces/170/8520/1.jpg b/ServiceHost/Faces/170/8520/1.jpg new file mode 100644 index 00000000..7d56ed72 Binary files /dev/null and b/ServiceHost/Faces/170/8520/1.jpg differ diff --git a/ServiceHost/Faces/170/8520/2.jpg b/ServiceHost/Faces/170/8520/2.jpg new file mode 100644 index 00000000..0aef6cc6 Binary files /dev/null and b/ServiceHost/Faces/170/8520/2.jpg differ diff --git a/ServiceHost/Faces/170/8520/Thumbnail.jpg b/ServiceHost/Faces/170/8520/Thumbnail.jpg new file mode 100644 index 00000000..4db660db Binary files /dev/null and b/ServiceHost/Faces/170/8520/Thumbnail.jpg differ diff --git a/ServiceHost/Faces/170/8523/Thumbnail.jpg b/ServiceHost/Faces/170/8523/Thumbnail.jpg new file mode 100644 index 00000000..35675b0b Binary files /dev/null and b/ServiceHost/Faces/170/8523/Thumbnail.jpg differ diff --git a/ServiceHost/Faces/170/8766/Thumbnail.jpg b/ServiceHost/Faces/170/8766/Thumbnail.jpg new file mode 100644 index 00000000..c1bd1c60 Binary files /dev/null and b/ServiceHost/Faces/170/8766/Thumbnail.jpg differ diff --git a/ServiceHost/Faces/170/8903/1.jpg b/ServiceHost/Faces/170/8903/1.jpg new file mode 100644 index 00000000..cbc8815a Binary files /dev/null and b/ServiceHost/Faces/170/8903/1.jpg differ diff --git a/ServiceHost/Faces/170/8903/2.jpg b/ServiceHost/Faces/170/8903/2.jpg new file mode 100644 index 00000000..1abbf1e0 Binary files /dev/null and b/ServiceHost/Faces/170/8903/2.jpg differ diff --git a/ServiceHost/Faces/170/8903/Thumbnail.jpg b/ServiceHost/Faces/170/8903/Thumbnail.jpg new file mode 100644 index 00000000..fae1fc91 Binary files /dev/null and b/ServiceHost/Faces/170/8903/Thumbnail.jpg differ diff --git a/ServiceHost/Faces/170/8905/Thumbnail.jpg b/ServiceHost/Faces/170/8905/Thumbnail.jpg new file mode 100644 index 00000000..ba2fca80 Binary files /dev/null and b/ServiceHost/Faces/170/8905/Thumbnail.jpg differ diff --git a/ServiceHost/Faces/170/9308/Thumbnail.jpg b/ServiceHost/Faces/170/9308/Thumbnail.jpg new file mode 100644 index 00000000..72914fdd Binary files /dev/null and b/ServiceHost/Faces/170/9308/Thumbnail.jpg differ diff --git a/ServiceHost/Faces/170/9319/1.jpg b/ServiceHost/Faces/170/9319/1.jpg new file mode 100644 index 00000000..ef09b877 Binary files /dev/null and b/ServiceHost/Faces/170/9319/1.jpg differ diff --git a/ServiceHost/Faces/170/9319/2.jpg b/ServiceHost/Faces/170/9319/2.jpg new file mode 100644 index 00000000..f9b86c5c Binary files /dev/null and b/ServiceHost/Faces/170/9319/2.jpg differ diff --git a/ServiceHost/Faces/170/9319/Thumbnail.jpg b/ServiceHost/Faces/170/9319/Thumbnail.jpg new file mode 100644 index 00000000..095b94e5 Binary files /dev/null and b/ServiceHost/Faces/170/9319/Thumbnail.jpg differ diff --git a/ServiceHost/Faces/170/9329/1.jpg b/ServiceHost/Faces/170/9329/1.jpg new file mode 100644 index 00000000..39dd9384 Binary files /dev/null and b/ServiceHost/Faces/170/9329/1.jpg differ diff --git a/ServiceHost/Faces/170/9329/2.jpg b/ServiceHost/Faces/170/9329/2.jpg new file mode 100644 index 00000000..1b1a93e8 Binary files /dev/null and b/ServiceHost/Faces/170/9329/2.jpg differ diff --git a/ServiceHost/Faces/170/9329/Thumbnail.jpg b/ServiceHost/Faces/170/9329/Thumbnail.jpg new file mode 100644 index 00000000..a29408bf Binary files /dev/null and b/ServiceHost/Faces/170/9329/Thumbnail.jpg differ diff --git a/ServiceHost/Faces/170/9330/1.jpg b/ServiceHost/Faces/170/9330/1.jpg new file mode 100644 index 00000000..fd7861a8 Binary files /dev/null and b/ServiceHost/Faces/170/9330/1.jpg differ diff --git a/ServiceHost/Faces/170/9330/2.jpg b/ServiceHost/Faces/170/9330/2.jpg new file mode 100644 index 00000000..9e839c9a Binary files /dev/null and b/ServiceHost/Faces/170/9330/2.jpg differ diff --git a/ServiceHost/Faces/170/9330/Thumbnail.jpg b/ServiceHost/Faces/170/9330/Thumbnail.jpg new file mode 100644 index 00000000..04230eec Binary files /dev/null and b/ServiceHost/Faces/170/9330/Thumbnail.jpg differ diff --git a/ServiceHost/Faces/170/9332/Thumbnail.jpg b/ServiceHost/Faces/170/9332/Thumbnail.jpg new file mode 100644 index 00000000..61ff7065 Binary files /dev/null and b/ServiceHost/Faces/170/9332/Thumbnail.jpg differ diff --git a/ServiceHost/Faces/170/9339/1.jpg b/ServiceHost/Faces/170/9339/1.jpg new file mode 100644 index 00000000..6ca825bb Binary files /dev/null and b/ServiceHost/Faces/170/9339/1.jpg differ diff --git a/ServiceHost/Faces/170/9339/2.jpg b/ServiceHost/Faces/170/9339/2.jpg new file mode 100644 index 00000000..363bd37e Binary files /dev/null and b/ServiceHost/Faces/170/9339/2.jpg differ diff --git a/ServiceHost/Faces/170/9339/Thumbnail.jpg b/ServiceHost/Faces/170/9339/Thumbnail.jpg new file mode 100644 index 00000000..df97c74a Binary files /dev/null and b/ServiceHost/Faces/170/9339/Thumbnail.jpg differ diff --git a/ServiceHost/Pages/Index.cshtml b/ServiceHost/Pages/Index.cshtml index 1cead2de..e7f99d03 100644 --- a/ServiceHost/Pages/Index.cshtml +++ b/ServiceHost/Pages/Index.cshtml @@ -196,7 +196,7 @@
@if (Model.HasApkToDownload) { -
+ } diff --git a/ServiceHost/ServiceHost.csproj b/ServiceHost/ServiceHost.csproj index 23fd2e83..91b80ffa 100644 --- a/ServiceHost/ServiceHost.csproj +++ b/ServiceHost/ServiceHost.csproj @@ -3044,8 +3044,4 @@ <_ContentIncludedByDefault Remove="Areas\Admin\Pages\Accounts\Account\AccountLeftWork.cshtml" /> - - - - diff --git a/ServiceHost/appsettings.Development.json b/ServiceHost/appsettings.Development.json index 7c296bf8..05ca5ad0 100644 --- a/ServiceHost/appsettings.Development.json +++ b/ServiceHost/appsettings.Development.json @@ -15,7 +15,7 @@ //"MesbahDb": "Data Source=171.22.24.15;Initial Catalog=mesbah_db;Persist Security Info=False;User ID=ir_db;Password=R2rNp[170]is[3019]#@ATt;TrustServerCertificate=true;" //local - // "MesbahDb": "Data Source=.;Initial Catalog=Mesbah_db;Integrated Security=True;TrustServerCertificate=true;" + "MesbahDb": "Data Source=.;Initial Catalog=Mesbah_db;Integrated Security=True;TrustServerCertificate=true;" //teamwork diff --git a/ServiceHost/wwwroot/AssetsAdminNew/Tasks/css/.config/dotnet-tools.json b/ServiceHost/wwwroot/AssetsAdminNew/Tasks/css/.config/dotnet-tools.json deleted file mode 100644 index 93ec8eb6..00000000 --- a/ServiceHost/wwwroot/AssetsAdminNew/Tasks/css/.config/dotnet-tools.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "version": 1, - "isRoot": true, - "tools": { - "dotnet-ef": { - "version": "8.0.5", - "commands": [ - "dotnet-ef" - ] - } - } -} \ No newline at end of file diff --git a/ServiceHost/wwwroot/AssetsAdminNew/Tasks/css/DetailModal.css b/ServiceHost/wwwroot/AssetsAdminNew/Tasks/css/DetailModal.css index a6bbbeb0..1d0b4513 100644 --- a/ServiceHost/wwwroot/AssetsAdminNew/Tasks/css/DetailModal.css +++ b/ServiceHost/wwwroot/AssetsAdminNew/Tasks/css/DetailModal.css @@ -808,6 +808,7 @@ .actionBtnsection { gap: 4px; + position: fixed; } .actionBtnsection .actionBtn { diff --git a/ServiceHost/wwwroot/AssetsAdminNew/Tasks/js/Index.js b/ServiceHost/wwwroot/AssetsAdminNew/Tasks/js/Index.js index b8bbf806..d3e2ca7d 100644 --- a/ServiceHost/wwwroot/AssetsAdminNew/Tasks/js/Index.js +++ b/ServiceHost/wwwroot/AssetsAdminNew/Tasks/js/Index.js @@ -863,8 +863,8 @@ function loadRequestCount() { url: `${loadRequestCountAjax}`, headers: { "RequestVerificationToken": `${antiForgeryToken}` }, success: function (response) { - $('#badgeRequestCount').text(response.result); - + $('#badgeRequestCount1').html(response.result); + $('#badgeRequestCount2').html(response.result); }, error: function (err) { console.log(err); diff --git a/ServiceHost/wwwroot/AssetsAdminNew/Tasks/js/OperationRequestModal.js b/ServiceHost/wwwroot/AssetsAdminNew/Tasks/js/OperationRequestModal.js index 5801c43d..baa91106 100644 --- a/ServiceHost/wwwroot/AssetsAdminNew/Tasks/js/OperationRequestModal.js +++ b/ServiceHost/wwwroot/AssetsAdminNew/Tasks/js/OperationRequestModal.js @@ -428,6 +428,8 @@ function saveRequestAjax(url, data, assignId) { $('.alert-success-msg p').text(''); }, 1500); + loadRequestCount(); + var countAssign = CountAssignViewModel - 1; $(`#Assign_${assignId}`).remove(); @@ -450,7 +452,7 @@ function saveRequestAjax(url, data, assignId) { $('#MainModal').modal('toggle'); //$('#btnTaskRequest').click(); $(`.section-btns-task button.active`).click(); - loadRequestCount(); + //loadRequestCount(); } else if (countAssign > 1) { @@ -474,19 +476,19 @@ function saveRequestAjax(url, data, assignId) { }); } -function loadRequestCount() { - $.ajax({ - async: false, - dataType: 'json', - type: 'GET', - url: `${loadRequestCountAjax}`, - headers: { "RequestVerificationToken": `${antiForgeryToken}` }, - success: function (response) { - $('#badgeRequestCount').text(response.result); +//function loadRequestCount() { +// $.ajax({ +// async: false, +// dataType: 'json', +// type: 'GET', +// url: `${loadRequestCountAjax}`, +// headers: { "RequestVerificationToken": `${antiForgeryToken}` }, +// success: function (response) { +// $('#badgeRequestCount').text(response.result); - }, - error: function (err) { - console.log(err); - } - }); -} \ No newline at end of file +// }, +// error: function (err) { +// console.log(err); +// } +// }); +//} \ No newline at end of file diff --git a/ServiceHost/wwwroot/AssetsClient/css/dropdown.css b/ServiceHost/wwwroot/AssetsClient/css/dropdown.css index fb3bad60..ac126fe6 100644 --- a/ServiceHost/wwwroot/AssetsClient/css/dropdown.css +++ b/ServiceHost/wwwroot/AssetsClient/css/dropdown.css @@ -1,5 +1,5 @@ /*--SCROLL--*/ -::-webkit-scrollbar { +/*::-webkit-scrollbar { width: 0px; } @@ -7,7 +7,7 @@ ::-webkit-scrollbar-thumb, ::-webkit-scrollbar-thumb:hover { background: transparent; -} +}*/ .scroll { --dashoffset: 0; diff --git a/ServiceHost/wwwroot/AssetsClient/css/rollcall-list-table.css b/ServiceHost/wwwroot/AssetsClient/css/rollcall-list-table.css index d6f59c21..e5105047 100644 --- a/ServiceHost/wwwroot/AssetsClient/css/rollcall-list-table.css +++ b/ServiceHost/wwwroot/AssetsClient/css/rollcall-list-table.css @@ -98,7 +98,11 @@ } .table-rollcall .width8 { - width: 10% !important; + width: 8% !important; +} + +.table-rollcall .width9 { + width: 6% !important; } .table-rollcall .width4.bg-filter, diff --git a/ServiceHost/wwwroot/AssetsClient/css/ticket-global/ticket-create-global.css b/ServiceHost/wwwroot/AssetsClient/css/ticket-global/ticket-create-global.css index 7ce77feb..174c8d1c 100644 --- a/ServiceHost/wwwroot/AssetsClient/css/ticket-global/ticket-create-global.css +++ b/ServiceHost/wwwroot/AssetsClient/css/ticket-global/ticket-create-global.css @@ -75,7 +75,30 @@ box-shadow: 0px 3px 5px rgba(22, 52, 80, 0.15); border-radius: 16px; transform: rotate(0.12deg); - z-index: 1000; + z-index: 9999; +} + +/* tooltip */ +.btn-ticket-global .tooltip-text { + visibility: hidden; + width: 100px; + background-color: #fff; + color: #535353; + text-align: center; + border-radius: 4px; + padding: 5px; + position: absolute; + bottom: 8px; + left: 53px; + z-index: 1; + opacity: 0; + transition: opacity 0.3s; + box-shadow: 0px 3px 5px rgba(22, 52, 80, 0.15); +} + +.btn-ticket-global:hover .tooltip-text { + visibility: visible; + opacity: 1; } .screenshot-border-global { @@ -474,12 +497,18 @@ .btn-ticket-global { width: 40px; height: 40px; + border-radius: 10px; } - .btn-ticket-global img { - width: 30px; - height: 30px; - } + .btn-ticket-global .tooltip-text { + bottom: 3px; + left: 43px; + } + + .btn-ticket-global img { + width: 30px; + height: 30px; + } } @media (max-width:992px) { diff --git a/ServiceHost/wwwroot/AssetsClient/pages/RollCall/css/CaseHistory.css b/ServiceHost/wwwroot/AssetsClient/pages/RollCall/css/CaseHistory.css index bd9d48ee..a8b73456 100644 --- a/ServiceHost/wwwroot/AssetsClient/pages/RollCall/css/CaseHistory.css +++ b/ServiceHost/wwwroot/AssetsClient/pages/RollCall/css/CaseHistory.css @@ -45,4 +45,18 @@ position: absolute; bottom: -10px; right: 20px; +} + +.close-btn-search { + position: absolute; + top: 50%; + left: 4px; + transform: translateY(-50%); + color: #fff; + background-color: #f87171; + width: 26px; + height: 26px; + display: flex; + align-items: center; + justify-content: center; } \ No newline at end of file diff --git a/ServiceHost/wwwroot/AssetsClient/pages/RollCall/css/CurrentDay.css b/ServiceHost/wwwroot/AssetsClient/pages/RollCall/css/CurrentDay.css index 3499a12f..284c53d1 100644 --- a/ServiceHost/wwwroot/AssetsClient/pages/RollCall/css/CurrentDay.css +++ b/ServiceHost/wwwroot/AssetsClient/pages/RollCall/css/CurrentDay.css @@ -52,3 +52,17 @@ top: 0; z-index: 10; } + +.close-btn-search { + position: absolute; + top: 50%; + left: 4px; + transform: translateY(-50%); + color: #fff; + background-color: #f87171; + width: 26px; + height: 26px; + display: flex; + align-items: center; + justify-content: center; +} \ No newline at end of file diff --git a/ServiceHost/wwwroot/AssetsClient/pages/RollCall/js/CaseHistory.js b/ServiceHost/wwwroot/AssetsClient/pages/RollCall/js/CaseHistory.js index a7626ef1..91ac6a83 100644 --- a/ServiceHost/wwwroot/AssetsClient/pages/RollCall/js/CaseHistory.js +++ b/ServiceHost/wwwroot/AssetsClient/pages/RollCall/js/CaseHistory.js @@ -54,9 +54,61 @@ $(document).ready(function () { } }); }); + + $('#search').on('keyup', searchEmployees); + //$('#search').on('keyup', function () { + // let searchValue = $(this).val().toLowerCase(); + + // $('.employee-row').filter(function () { + // $(this).toggle($(this).find('.employee-name').text().toLowerCase().includes(searchValue)); + // }); + + // updateIndexes(); + + // if ($(this).val().length > 0) { + // $('#clear-search').removeClass('d-none').addClass('d-flex'); + // } else { + // $('#clear-search').removeClass('d-flex').addClass('d-none'); + // } + //}); + + $('#clear-search').on('click', function () { + $('#search').val(''); + + $('.employee-row').show(); + + updateIndexes(); + + $(this).removeClass('d-flex').addClass('d-none'); + }); + }); +function searchEmployees() { + let searchValue = $('#search').val().toLowerCase(); + $('.employee-row').filter(function () { + $(this).toggle($(this).find('.employee-name').text().toLowerCase().includes(searchValue)); + }); + + updateIndexes(); + + if (searchValue.length > 0) { + $('#clear-search').removeClass('d-none').addClass('d-flex'); + } else { + $('#clear-search').removeClass('d-flex').addClass('d-none'); + } + + loadUntilHeightExceeds(); +} + +function updateIndexes() { + let index = 1; + + $('.employee-row:visible .table-number').each(function () { + $(this).text(index++); + }); +} // *************************** مربوط به جستجو در دسکتاپ ******************************** const selectedAll = document.querySelectorAll(".wrapper-dropdown"); @@ -99,7 +151,7 @@ $(document).ready(function () { $('.btn-search-click').click(function () { - if ($('#StartDate').val().trim() !== '' && validDate === false) { + if ($('#StartDate').val().trim() !=='' && validDate === false) { $('.date').addClass('errored'); $('.alert-msg').show(); $('.alert-msg p').text('لطفا تاریخ را بصورت صحیح وارد کنید.'); @@ -197,15 +249,11 @@ if (sendDropdownMonth) { selectedMonthDisplay.text(itemDropdownMonth.text()); } - $(".date").on('input', function () { var value = $(this).val(); $(this).val(convertPersianNumbersToEnglish(value)); }).mask("0000/00/00"); - -//setInterval(caseHistoryLoadAjax, 1000); - function caseHistoryLoadAjax() { var filterEmployeeId = 0; @@ -248,7 +296,7 @@ function caseHistoryLoadAjax() { if (response.isSuccedded) { if (caseHistoryData == null) { - + if (caseHistoryEmployeeData.dateGr !== null) { $('#dateFaEmployee').show(); @@ -263,7 +311,7 @@ function caseHistoryLoadAjax() {
-
${caseHistoryEmployeeData.rollCalls[0].employeeFullName} +
${caseHistoryEmployeeData.rollCalls.length > 0 ? caseHistoryEmployeeData.rollCalls[0].employeeFullName : `-`}
@@ -271,10 +319,11 @@ function caseHistoryLoadAjax() {
`; + $.each(caseHistoryEmployeeData.rollCalls, function (i, item) { - html += ` -
+ html += ` +
ردیف @@ -288,7 +337,7 @@ function caseHistoryLoadAjax() {
نام پرسنل
-
+
${item.employeeFullName}
@@ -323,39 +372,39 @@ function caseHistoryLoadAjax() {
`; - if (item.rollCallTimesList.length > 0) { - item.rollCallTimesList.forEach(function (itemTime) { - html += `
ساعت ورود
+ if (item.rollCallTimesList.length > 0) { + item.rollCallTimesList.forEach(function (itemTime) { + html += `
ساعت ورود
${itemTime.startDate ?? `-`}
`; - }); - } else { - html += `
ساعت ورود
+ }); + } else { + html += `
ساعت ورود
-
`; - } + } - html += `
+ html += `
`; - if (item.rollCallTimesList.length > 0) { - item.rollCallTimesList.forEach(function (itemTime) { - html += `
ساعت خروج
+ if (item.rollCallTimesList.length > 0) { + item.rollCallTimesList.forEach(function (itemTime) { + html += `
ساعت خروج
${itemTime.endDate ?? `-`}
`; - }); - } else { - html += `
ساعت خروج
+ }); + } else { + html += `
ساعت خروج
-
`; - } + } - html += `
+ html += `
@@ -369,6 +418,29 @@ function caseHistoryLoadAjax() {
مجموع ساعات کاری:
${item.totalWorkingHours}
+
+
+
+
عملیات:
+ + + + +
`; html += `
-
`; @@ -410,8 +482,8 @@ function caseHistoryLoadAjax() { html += `
`; - if (!(!item.hasLeave && item.isAbsent)) { - html += `
+ if (!item.hasLeave) { + html += `
@@ -442,18 +514,43 @@ function caseHistoryLoadAjax() {
+ + + +
+
+ + +
+
`; - } - }); + } + }); //dateIndex++; dateEmployeeIndex = caseHistoryEmployeeData.dateIndex; + $('#caseHistoryLoadData').append(html); if (dateEmployeeIndex == null) hasData = false; + } else { hasData = false; } @@ -478,8 +575,8 @@ function caseHistoryLoadAjax() { $.each(caseHistoryData.activeEmployees, function (i, item) { - html += ` -
+ html += ` +
ردیف @@ -493,7 +590,7 @@ function caseHistoryLoadAjax() {
نام پرسنل
-
+
${item.employeeFullName}
@@ -514,39 +611,39 @@ function caseHistoryLoadAjax() {
`; - if (item.rollCallTimesList.length > 0) { - item.rollCallTimesList.forEach(function (itemTime) { - html += `
ساعت ورود
+ if (item.rollCallTimesList.length > 0) { + item.rollCallTimesList.forEach(function (itemTime) { + html += `
ساعت ورود
${itemTime.startDate ?? `-`}
`; - }); - } else { - html += `
ساعت ورود
+ }); + } else { + html += `
ساعت ورود
-
`; - } + } - html += `
+ html += `
`; - if (item.rollCallTimesList.length > 0) { - item.rollCallTimesList.forEach(function (itemTime) { - html += `
ساعت خروج
+ if (item.rollCallTimesList.length > 0) { + item.rollCallTimesList.forEach(function (itemTime) { + html += `
ساعت خروج
${itemTime.endDate ?? `-`}
`; - }); - } else { - html += `
ساعت خروج
+ }); + } else { + html += `
ساعت خروج
-
`; - } + } - html += `
+ html += `
@@ -560,50 +657,73 @@ function caseHistoryLoadAjax() {
مجموع ساعات کاری:
${item.totalWorkingHours}
-
`; +
+
+
+
عملیات:
+ + + + +
+
`; - html += `
-
`; + html += `
-
`; - html += `
`; - if (item.rollCallTimesList.length > 0) { - item.rollCallTimesList.forEach(function (itemTime) { - html += ` + html += `
`; + if (item.rollCallTimesList.length > 0) { + item.rollCallTimesList.forEach(function (itemTime) { + html += `
${itemTime.startDate ?? "-"}
`; - }); - } else { - html += ` + }); + } else { + html += `
-
`; - } - html += `
`; + } + html += `
`; - html += `
`; - if (item.rollCallTimesList.length > 0) { - item.rollCallTimesList.forEach(function (itemTime) { - html += ` + html += `
`; + if (item.rollCallTimesList.length > 0) { + item.rollCallTimesList.forEach(function (itemTime) { + html += `
${itemTime.endDate ?? "-"}
`; - }); - } else { - html += ` + }); + } else { + html += `
-
`; - } - html += `
`; + } + html += `
`; - html += - `
-
`; + html += + `
-
`; - html += `
`; + html += `
`; - if (!(!item.hasLeave && item.isAbsent)) { - html += `
+ if (!item.hasLeave) { + html += `
@@ -615,19 +735,40 @@ function caseHistoryLoadAjax() {
-
+
مجموع ساعات کارکرد: ${item.totalWorkingHours}
+ +
+ +
+
+ +
`; - } + } - }); + }); dateIndex++; $('#caseHistoryLoadData').append(html); @@ -639,12 +780,14 @@ function caseHistoryLoadAjax() { } else { hasData = false; } + + searchEmployees(); }, failure: function (response) { console.log(response); hasData = false; } - }); + }); } function loadUntilHeightExceeds() { @@ -659,33 +802,28 @@ if (hasData) { loadUntilHeightExceeds(); } -$('.goToTop').on('click', function () { +$('.goToTop').on('click',function () { $('html, body').animate({ scrollTop: 0 }, 360); return false; }); $(window).scroll(function () { - if (hasData) { + if (hasData) { if ($(window).scrollTop() + $(window).height() > $(document).height() - 600) { caseHistoryLoadAjax(); } } if ($(this).scrollTop() > 100) { - $('.goToTop').show().fadeIn(); + $('.goToTop').show().fadeIn(); } else { - $('.goToTop').fadeOut().hide(); + $('.goToTop').fadeOut().hide(); } }); - - - - - //************************************ برای مشاهده زمان و ساعت **********************************/ //$(".date").mask("0000/00/00"); $(".date").on('input', function () { @@ -1513,4 +1651,79 @@ if ($(window).width() < 768) { } } } -//******************** نمایش تاریخ در موبایل ******************** \ No newline at end of file +//******************** نمایش تاریخ در موبایل ******************** + + + + + +function addWorkTime() { + window.location.href = `#showmodal=/Client/Company/RollCall/CaseHistory?handler=Create`; +} + + +$(document).on('click', '.btn-edit', function () { + var employeeId = $(this).data('edit-id'); + var editDate = $(this).data('edit-date'); + window.location.href = `#showmodal=/Client/Company/RollCall/CaseHistory?employeeId=${employeeId}&date=${editDate}&handler=Edit`; +}) + +$(document).on('click', '.btn-delete', function () { + var removeEmployeeId = $(this).data('remove-id'); + var removeDate = $(this).data('remove-date'); + + swal({ + title: "آیااز حذف کردن اطمینان دارید؟", + text: "", + type: "warning", + showCancelButton: true, + confirmButtonColor: "#DD6B55", + confirmButtonText: "بله", + cancelButtonText: "خیر", + closeOnConfirm: true, + closeOnCancel: true + }, function (isConfirm) { + if (isConfirm) { + removeAction(removeEmployeeId, removeDate); + } + }); + +}) + + +function removeAction(removeEmployeeId, removeDate) { + $.ajax({ + async: false, + dataType: 'json', + type: 'POST', + url: deleteRollCallData, + headers: { "RequestVerificationToken": antiForgeryToken }, + data: { employeeId: removeEmployeeId, date: removeDate }, + success: function (response) { + if (response.success) { + $('.alert-success-msg').show(); + $('.alert-success-msg p').text(response.message); + + hasData = true; + dateIndex = 0; + dateEmployeeIndex = null; + $('#caseHistoryLoadData').html(''); + caseHistoryLoadAjax(); + loadUntilHeightExceeds(); + + setTimeout(function () { + $('.alert-success-msg').hide(); + $('.alert-success-msg p').text(''); + }, 2000); + } else { + setTimeout(function () { + $('.alert-msg').hide(); + $('.alert-msg p').text(''); + }, 3500); + } + }, + error: function (err) { + console.log(err); + } + }); +} \ No newline at end of file diff --git a/ServiceHost/wwwroot/AssetsClient/pages/RollCall/js/CurrentDay.js b/ServiceHost/wwwroot/AssetsClient/pages/RollCall/js/CurrentDay.js index cc460caf..48bb692e 100644 --- a/ServiceHost/wwwroot/AssetsClient/pages/RollCall/js/CurrentDay.js +++ b/ServiceHost/wwwroot/AssetsClient/pages/RollCall/js/CurrentDay.js @@ -17,7 +17,58 @@ }); loadRollCallStatus('all'); - loadRollCallCount(); + loadRollCallCount(); + + // --------------------------------------------- search + $('#search').on('keyup', function () { + let searchValue = $(this).val().toLowerCase(); + + $('.employee-row').filter(function () { + $(this).toggle($(this).find('.employee-name').text().toLowerCase().includes(searchValue)); + }); + + $('.absenceItem-row').filter(function () { + $(this).toggle($(this).find('.employee-name').text().toLowerCase().includes(searchValue)); + }); + + $('.leaveItem-row').filter(function () { + $(this).toggle($(this).find('.employee-name').text().toLowerCase().includes(searchValue)); + }); + + updateIndexes(); + + if ($(this).val().length > 0) { + $('#clear-search').removeClass('d-none').addClass('d-flex'); + } else { + $('#clear-search').removeClass('d-flex').addClass('d-none'); + } + }); + + $('#clear-search').on('click', function () { + $('#search').val(''); + + $('.employee-row, .absenceItem-row, .leaveItem-row').show(); + + updateIndexes(); + + $(this).removeClass('d-flex').addClass('d-none'); + }); + + function updateIndexes() { + let index = 1; + + $('.employee-row:visible .table-number').each(function () { + $(this).text(index++); + }); + + $('.absenceItem-row:visible .table-number').each(function () { + $(this).text(index++); + }); + + $('.leaveItem-row:visible .table-number').each(function () { + $(this).text(index++); + }); + } }); function loadRollCallCount() { @@ -39,9 +90,6 @@ function loadRollCallCount() { } function loadRollCallStatus(type) { - - console.log(type); - var index = 1; var html = ''; let colorDivStyle = ''; diff --git a/ServiceHost/wwwroot/AssetsClient/pages/RollCall/js/EditSettingWorkTime.js b/ServiceHost/wwwroot/AssetsClient/pages/RollCall/js/EditSettingWorkTime.js index 80c27b43..17fe38b7 100644 --- a/ServiceHost/wwwroot/AssetsClient/pages/RollCall/js/EditSettingWorkTime.js +++ b/ServiceHost/wwwroot/AssetsClient/pages/RollCall/js/EditSettingWorkTime.js @@ -1,5 +1,7 @@ var isTabPressed = false; $(document).ready(function () { + updateRemoveButtons(); + $('.loading').hide(); $(".dateTime").on("blur", function () { @@ -112,8 +114,12 @@ $(document).ready(function () { if (currentCount + 1 === 3) { $(".btnAddTimeWork").hide(); } + + // Update Remove button enable/disable state + updateRemoveButtons(); } }); + $(document).on("click", ".btnRemoveTimeWork", function () { $(this).closest(".groupBox").remove(); var currentCount = $('.groupBox').length; @@ -123,9 +129,17 @@ $(document).ready(function () { if (currentCount < 3) { $(".btnAddTimeWork").show(); } + + // Update Remove button enable/disable state + updateRemoveButtons(); }); }); +function updateRemoveButtons() { + $(".btnRemoveTimeWork").addClass("disable"); + $(".btnRemoveTimeWork").last().removeClass("disable"); +} + //updateAddButtonText(1); function updateAddButtonText(currentCount) { if (currentCount === 1) { diff --git a/ServiceHost/wwwroot/AssetsClient/pages/RollCall/js/EmployeeUploadPicture.js b/ServiceHost/wwwroot/AssetsClient/pages/RollCall/js/EmployeeUploadPicture.js index 68333885..831276de 100644 --- a/ServiceHost/wwwroot/AssetsClient/pages/RollCall/js/EmployeeUploadPicture.js +++ b/ServiceHost/wwwroot/AssetsClient/pages/RollCall/js/EmployeeUploadPicture.js @@ -2,10 +2,10 @@ var searchName = ''; $(document).ready(function () { - $('.loadingButton').on('click', function () { - var button = $(this); - var loadingDiv = button.find('.loading'); - loadingDiv.show(); + $('.loadingButton').on('click', function () { + var button = $(this); + var loadingDiv = button.find('.loading'); + loadingDiv.show(); }); @@ -77,10 +77,13 @@ function loadDataAjax() { }, headers: { "RequestVerificationToken": `${antiForgeryToken}` }, success: function (response) { - + console.log(response); if (response.pageIndex > 0) { var n = pageIndexMain + 1; var dataLoad = response.data.personnelInfoViewModels; + let startDate = new Date().getTime(); + + dataLoad.forEach(function (item) { html += ` @@ -100,7 +103,7 @@ function loadDataAjax() {
نام و نام خانوادگی
-
`; +
`; if (item.hasUploadedImage === "true") { if (item.imagePath === "") { @@ -112,7 +115,7 @@ function loadDataAjax() { else { html += ``; } - html += `${item.employeeFullName} + html += `
${item.employeeFullName}
@@ -149,6 +152,12 @@ function loadDataAjax() {
+
+ +
+
-
${item.employeeFullName}
+
${item.employeeFullName}
`; if (item.hasUploadedImage === "true") { html += `

عکس پرسنل آپلود شده است

`; @@ -193,9 +202,19 @@ function loadDataAjax() {
- +
+ + +
فعال