From e09da14e15c522ace2bbbf8cbfab5f9aa3892144 Mon Sep 17 00:00:00 2001 From: SamSys Date: Sat, 10 Aug 2024 21:49:16 +0330 Subject: [PATCH] multiple select aoutoExtention - minuse OverTimeWorking And FridayWorking from checkout if has leaving --- .../Repository/LeaveRepository.cs | 23 +- .../Pages/Company/Checkouts/Create.cshtml | 3 +- .../Pages/Company/Checkouts/Index.cshtml.cs | 1148 +++++++++++-- .../Company/InstitutionContracts/Index.cshtml | 11 +- .../Pages/Company/SmsResult/Index.cshtml | 3 +- .../Company/Workshops/AutoExtension.cshtml | 1506 +++++++++-------- .../Company/Workshops/AutoExtension.cshtml.cs | 3 + 7 files changed, 1846 insertions(+), 851 deletions(-) diff --git a/CompanyManagment.EFCore/Repository/LeaveRepository.cs b/CompanyManagment.EFCore/Repository/LeaveRepository.cs index c95d6de5..ee7afa42 100644 --- a/CompanyManagment.EFCore/Repository/LeaveRepository.cs +++ b/CompanyManagment.EFCore/Repository/LeaveRepository.cs @@ -61,9 +61,26 @@ public class LeaveRepository : RepositoryBase, ILeaveRepository Year = x.Year, Month = x.Month }); - if (searchModel.WorkshopId != 0 && searchModel.EmployeeId != 0) - query = query.Where(x => x.WorkshopId == searchModel.WorkshopId && x.EmployeeId == searchModel.EmployeeId && x.LeaveType == searchModel.LeaveType); - return query.OrderByDescending(x => x.Id).ToList(); + + if (searchModel.WorkshopId != 0 && searchModel.EmployeeId != 0) + query = query.Where(x => x.WorkshopId == searchModel.WorkshopId && x.EmployeeId == searchModel.EmployeeId); + + if (!string.IsNullOrWhiteSpace(searchModel.LeaveType)) + query = query.Where(x => x.LeaveType == searchModel.LeaveType); + + if (!string.IsNullOrWhiteSpace(searchModel.PaidLeaveType)) + query = query.Where(x => x.PaidLeaveType == searchModel.PaidLeaveType); + if (!string.IsNullOrWhiteSpace(searchModel.StartLeave) && !string.IsNullOrWhiteSpace(searchModel.EndLeave)) + { + DateTime startSearch = searchModel.StartLeave.ToGeorgianDateTime(); + DateTime endSearch = searchModel.EndLeave.ToGeorgianDateTime(); + query = query.Where(x => (startSearch <= x.StartLeaveGr && endSearch >= x.StartLeaveGr) || + (startSearch <= x.EndLeaveGr && endSearch >= x.EndLeaveGr) || + (startSearch >= x.StartLeaveGr && startSearch <= x.EndLeaveGr) || + (endSearch >= x.StartLeaveGr && endSearch <= x.EndLeaveGr)); + } + + return query.OrderByDescending(x => x.Id).ToList(); } public List searchClient(LeaveSearchModel searchModel) diff --git a/ServiceHost/Areas/Admin/Pages/Company/Checkouts/Create.cshtml b/ServiceHost/Areas/Admin/Pages/Company/Checkouts/Create.cshtml index 0ea8611e..d49d37a3 100644 --- a/ServiceHost/Areas/Admin/Pages/Company/Checkouts/Create.cshtml +++ b/ServiceHost/Areas/Admin/Pages/Company/Checkouts/Create.cshtml @@ -1,4 +1,5 @@ @model CompanyManagment.App.Contracts.Checkout.CreateCheckout +@Html.AntiForgeryToken() @{ + @*heder*@ + .top-Bar { + background-color: #c1dcd8; + height: 100px; + border-radius: 15px; + margin: 0px 2px 10px 2px; + box-shadow: 0px 1px 15px 0 #749883; + + } + .workshopName { + color: #fff; + background-color: #1b9998; + font-size: 15px; + border-radius: 15px; + height: 25px; + line-height: 1.8; + } + .manual { + background-color: #efefef; + min-height: 160px; + border-radius: 15px; + width: 49%; + box-shadow: 0px 1px 15px 0 #0f8181; + } + .automatic { + background-color: #efefef; + min-height: 160px; + border-radius: 15px; + width: 49%; + box-shadow: 0px 1px 15px 0 #0f8181 + } + .discManual { + border-radius: 20px 5px 0px 0px; + cursor: unset; + font-size: 12px; + padding: 3px 10px; + } + .inptAutomatic { + display: inline-block; + border-radius: 15px; + text-align: center; + } + .trueStatusHide { + display: none; + } + .falseStatusHide { + display: none; + } + .progBar { + display: none; + } + #createProcess { + background-color: #fdfdfd; + height: 100px; + border-radius: 15px; + margin: 0px 2px 10px 2px; + box-shadow: 0px 1px 15px 0 #1ebb5f; + } + .progress-bar { + color: #fff!important; + font-size: 17px !important; + line-height: 23px !important; + border-radius: 10px !important; + + } + -} - var i = 1; - var zeropscode = "zero-ps-code tooltip-container"; + } + var i = 1; + var zeropscode = "zero-ps-code tooltip-container"; - - + } @@ -442,379 +459,428 @@ @{ - if (Model.HavingPersonel && Model.EmployerWarning == false) - { -
+ if (Model.HavingPersonel && Model.EmployerWarning == false) + { +
-
- +
+
+ +

ایجاد قرارداد گروهی خودکار

+
- -
-
-
- -

ایجاد قرارداد گروهی خودکار

-
- - -

@Model.workshopName

-
-
- - -
-
- @*اتوماتیک*@ -
-
- -

ایجاد قرارداد بصورت خودکار

- + +

@Model.workshopName

-
-
-
- تاریخ شروع - -
-
- تاریخ پایان - -
- -
- @*دستی*@ -
-
-
- قرارداد یک ماهه -
-
- قرارداد یک ماهه -
-
+
+
- +
+
+ انتخاب موردی + + + تایید + + + تازه سازی + +
+
+ +
+
+
+ @*اتوماتیک*@ +
+
+ +

ایجاد قرارداد بصورت خودکار

+ +
+
+
+
+
+ تاریخ شروع + + +
+
+ تاریخ پایان + +
-
- +
+ @*دستی*@ +
+
+
+ قرارداد یک ماهه +
+
+ قرارداد یک ماهه +
+
+ + +
+
+ + + +
+
+
+
+
+ بیشتر از یک ماه +
+
+ بیشتر از یک ماه +
+
+ تاریخ شروع + + +
+
+ + + تاریخ پایان + +
-
-
-
- بیشتر از یک ماه -
-
- بیشتر از یک ماه -
-
- تاریخ شروع - - -
-
- تاریخ پایان - +
+
+
+ +

درصد پیشرفت عملیات

+
+ + +
+
+ +
-
-
-
- -

درصد پیشرفت عملیات

-
+
+
+
+
+

لیست پرسنل

+
+
+
+
+ + + + + + + + + + + + + + + + -
-
-
- + + + + + + + + + + + + + + + @{ + i++; + } + + + + } + + + +
#وضعیتکد پرسنلیپرسنلسمتتاریخ شروعتاریخ پایان - - - - -
-
-
-
-

لیست پرسنل

-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - @foreach (var item in Model.EmployeeList) - { - - - - - - - - - - - - - - - - - - - - @{ - i++; - } - + عملیات + - } + + + + @foreach (var item in Model.EmployeeList) + { + + + -
# - - - - - - وضعیتکد پرسنلیپرسنلسمتتاریخ شروعتاریخ پایان - - عملیات -
@i - - - - - - - - - - - @item.PersonnelCode - - @{ - if (item.PersonnelCode == 0) - { - - این پرسنل کد پرسنلی ندارد
- می توانید در باکس زیر کد پرسنلی را تعیین نمایید
-  
- - - تایید - -
- } - } -
- - - @item.EmployeeName - - - - - - @item.JobType - @{ - if (item.JobType == null) - { - سمت پرسنل مشخص نشده است - } - } - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@i -
+ +
+ + + + + + + + + @item.PersonnelCode + + @{ + if (item.PersonnelCode == 0) + { + + این پرسنل کد پرسنلی ندارد
+ می توانید در باکس زیر کد پرسنلی را تعیین نمایید
+  
+ + + تایید + +
+ } + } +
+ + + @item.EmployeeName + + + + + + @item.JobType + @{ + if (item.JobType == null) + { + سمت پرسنل مشخص نشده است + } + } + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
-
- } - else - { - if (Model.EmployerWarning) - { -
- @Model.EmployerWarningMessage -
- } - if (Model.HavingPersonel == false) - { -
@Model.workshopName هیچ پرسنلی ندارد
- } - - بازگشت - - } + } + else + { + if (Model.EmployerWarning) + { +
+ @Model.EmployerWarningMessage +
+ } - // } @section Script { - - - - - - @* *@ - @* *@ + + + + + + @* *@ + @* *@ - - - - @*