Compare commits

...

38 Commits

Author SHA1 Message Date
SamSys
f93991db96 change 2025-11-05 13:37:14 +03:30
sadegh Farokhi
bca3e1dd42 Delete .github/workflows/dad-mehrPublish.yaml 2025-11-05 13:36:44 +03:30
syntax24
c7e22e4ca6 testtest 2025-11-05 13:27:46 +03:30
syntax24
7386bd5750 test 2025-11-05 13:25:35 +03:30
sadegh Farokhi
5c8a521f8e Update dad-mehrPublish.yaml 2025-11-05 13:20:28 +03:30
syntax24
22973fe47b test 2025-11-05 13:17:59 +03:30
syntax24
48c83e648d update yaml 2025-11-05 11:51:39 +03:30
sadegh Farokhi
494b80c461 Update dad-mehrPublish.yaml 2025-11-05 11:35:52 +03:30
sadegh Farokhi
7cdb431d98 Update dad-mehrPublish.yaml 2025-11-04 19:13:50 +03:30
SamSys
f7ae463544 Merge branch 'WorskhopClassifiedPlan' of https://github.com/samsyntax24/OriginalGozareshgir into WorskhopClassifiedPlan 2025-11-04 19:09:22 +03:30
sadegh Farokhi
1913147f89 Rename dad-mehrPublish to dad-mehrPublish.yaml 2025-11-04 18:54:43 +03:30
sadegh Farokhi
77798eaccb Update dad-mehrPublish 2025-11-04 18:50:22 +03:30
SamSys
f17c1f0d8e test 2025-11-04 18:43:47 +03:30
sadegh Farokhi
bd4f2d18f5 Update dad-mehrPublish 2025-11-04 18:41:51 +03:30
SamSys
0bbed013d2 Merge branch 'WorskhopClassifiedPlan' of https://github.com/samsyntax24/OriginalGozareshgir into WorskhopClassifiedPlan 2025-11-04 18:41:05 +03:30
SamSys
3455c8a786 change appsetting 2025-11-04 18:40:45 +03:30
sadegh Farokhi
9981116caa Create dad-mehrPublish 2025-11-04 18:33:18 +03:30
SamSys
10e7400611 test moda completed 2025-11-02 19:11:04 +03:30
SamSys
23c99e60d5 ClassificationEmployee add to group or edit membrize completed 2025-10-26 19:10:20 +03:30
SamSys
490393acbc ClassficationScheme > EditSalariesAndCoefficient front completed 2025-10-25 01:32:09 +03:30
SamSys
c6874b33cf ClassificationSalariestab and create front completed 2025-10-19 23:11:39 +03:30
SamSys
596e21b712 craetejobs modal front 2025-10-14 04:21:50 +03:30
SamSys
e9c3176dfc change createjobe modal 2025-10-12 00:04:33 +03:30
SamSys
4a956a1397 createJobs load modal 2025-10-11 16:04:46 +03:30
SamSys
fc3053dd17 Merge branch 'master' into WorskhopClassifiedPlan 2025-10-11 15:10:12 +03:30
SamSys
bb79380ce5 add Classification Tab group list frontEnd 2025-10-11 15:05:01 +03:30
SamSys
849369fea3 GroupAndJobs tab Query 2025-10-08 17:41:23 +03:30
SamSys
283f66ab32 Merge branch 'master' into WorskhopClassifiedPlan 2025-10-07 17:36:14 +03:30
SamSys
abf00884a4 Create ClassificationGroup With CreateScheme - EditScheme 2025-10-07 01:38:01 +03:30
SamSys
50718eda93 Merge branch 'master' into WorskhopClassifiedPlan 2025-10-06 23:54:50 +03:30
SamSys
a3dc27f08e SchemeTab, create scheme , scheme list 2025-10-06 13:26:36 +03:30
SamSys
055ce2b2a7 merge from master 2025-10-04 16:35:11 +03:30
SamSys
8171e06965 Create razorPage for classificationScheme , add isClassificationCompleted bool to workshop Table 2025-09-30 21:20:05 +03:30
SamSys
bfa8688c38 Merge branch 'master' into WorskhopClassifiedPlan 2025-09-30 00:15:53 +03:30
SamSys
66c903045f ClassiicationChemeApplication 2025-09-23 18:49:56 +03:30
SamSys
b245023dd2 Static file for GroupRate 2025-09-22 02:06:39 +03:30
SamSys
8044d64d5e Classification tables Mapping 2025-09-18 05:16:00 +03:30
SamSys
1ef86d5e9c Classification Tables Designed 2025-09-16 05:26:20 +03:30
73 changed files with 42018 additions and 440 deletions

View File

@@ -0,0 +1,237 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace _0_Framework.Application;
/// <summary>
/// دامنه امتیازات گروه های طبقه بندی مشاغل
/// </summary>
public static class ClassificationRangeOfGroupRate
{
/// <summary>
/// دریافت فاصله امتیاز گروه
/// </summary>
/// <param name="groupNo"></param>
/// <returns></returns>
public static ClassificationGroupRate GetGroupDistanceRate(string groupNo)
{
switch (groupNo)
{
case "1":
return new ClassificationGroupRate()
{
GroupNo = groupNo,
LowRate = 0,
HighRate = 80,
DistanceRate = 0,
};
break;
case "2":
return new ClassificationGroupRate()
{
GroupNo = groupNo,
LowRate = 81,
HighRate = 95,
DistanceRate = 15,
};
break;
case "3":
return new ClassificationGroupRate()
{
GroupNo = groupNo,
LowRate = 96,
HighRate = 110,
DistanceRate = 30, //فاصله سقف این گروه تا سقف گروه یک
};
break;
case "4":
return new ClassificationGroupRate()
{
GroupNo = groupNo,
LowRate = 111,
HighRate = 125,
DistanceRate = 45, //فاصله سقف این گروه تا سقف گروه یک
};
break;
case "5":
return new ClassificationGroupRate()
{
GroupNo = groupNo,
LowRate = 126,
HighRate = 145,
DistanceRate = 65, //فاصله سقف این گروه تا سقف گروه یک
};
break;
case "6":
return new ClassificationGroupRate()
{
GroupNo = groupNo,
LowRate = 146,
HighRate = 165,
DistanceRate = 85,
};
break;
case "7":
return new ClassificationGroupRate()
{
GroupNo = groupNo,
LowRate = 166,
HighRate = 185,
DistanceRate = 105,
};
break;
case "8":
return new ClassificationGroupRate()
{
GroupNo = groupNo,
LowRate = 186,
HighRate = 210,
DistanceRate = 130,
};
break;
case "9":
return new ClassificationGroupRate()
{
GroupNo = groupNo,
LowRate = 211,
HighRate = 235,
DistanceRate = 155,
};
break;
case "10":
return new ClassificationGroupRate()
{
GroupNo = groupNo,
LowRate = 236,
HighRate = 265,
DistanceRate = 185,
};
break;
case "11":
return new ClassificationGroupRate()
{
GroupNo = groupNo,
LowRate = 266,
HighRate = 295,
DistanceRate = 215,
};
break;
case "12":
return new ClassificationGroupRate()
{
GroupNo = groupNo,
LowRate = 296,
HighRate = 325,
DistanceRate = 245,
};
break;
case "13":
return new ClassificationGroupRate()
{
GroupNo = groupNo,
LowRate = 326,
HighRate = 365,
DistanceRate = 285,
};
break;
case "14":
return new ClassificationGroupRate()
{
GroupNo = groupNo,
LowRate = 366,
HighRate = 405,
DistanceRate = 325,
};
break;
case "15":
return new ClassificationGroupRate()
{
GroupNo = groupNo,
LowRate = 406,
HighRate = 445,
DistanceRate = 365,
};
break;
case "16":
return new ClassificationGroupRate()
{
GroupNo = groupNo,
LowRate = 446,
HighRate = 495,
DistanceRate = 415,
};
break;
case "17":
return new ClassificationGroupRate()
{
GroupNo = groupNo,
LowRate = 496,
HighRate = 545,
DistanceRate = 465,
};
break;
case "18":
return new ClassificationGroupRate()
{
GroupNo = groupNo,
LowRate = 546,
HighRate = 605,
DistanceRate = 525,
};
break;
case "19":
return new ClassificationGroupRate()
{
GroupNo = groupNo,
LowRate = 606,
HighRate = 665,
DistanceRate = 585,
};
break;
case "20":
return new ClassificationGroupRate()
{
GroupNo = groupNo,
LowRate = 666,
HighRate = 740,
DistanceRate = 660,
};
break;
}
return new ClassificationGroupRate();
}
}
/// <summary>
/// دیتای امتیازات هر گرو
/// </summary>
public class ClassificationGroupRate
{
/// <summary>
/// شمازه گروه
/// </summary>
public string GroupNo { get; set; }
/// <summary>
/// امتیاز کف
/// </summary>
public int LowRate { get; set; }
/// <summary>
/// امتیاز سقف
/// </summary>
public int HighRate { get; set; }
/// <summary>
/// فاصله امتیاز
/// </summary>
public int DistanceRate { get; set; }
}

View File

@@ -0,0 +1,14 @@
namespace _0_Framework.Application.Enums;
public enum TypeOfCoefficient
{
/// <summary>
/// ضریب ریالی طرح
/// </summary>
RialCoefficient,
/// <summary>
/// ضریب ریالی اداره کار
/// </summary>
JobOrganization,
}

View File

@@ -33,6 +33,35 @@ public static class Tools
public static string[] DayNames = { "شنبه", "یکشنبه", "دو شنبه", "سه شنبه", "چهار شنبه", "پنج شنبه", "جمعه" }; public static string[] DayNames = { "شنبه", "یکشنبه", "دو شنبه", "سه شنبه", "چهار شنبه", "پنج شنبه", "جمعه" };
public static string[] DayNamesG = { "یکشنبه", "دو شنبه", "سه شنبه", "چهار شنبه", "پنج شنبه", "جمعه", "شنبه" }; public static string[] DayNamesG = { "یکشنبه", "دو شنبه", "سه شنبه", "چهار شنبه", "پنج شنبه", "جمعه", "شنبه" };
/// <summary>
/// نام ستون از جدول مزد سنوات طبثه بندی را میگیرد و دیتای داخل آن ستون را برمیگرداند
/// </summary>
/// <param name="obj"></param>
/// <param name="propertyName"></param>
/// <returns></returns>
public static double? GetDynamicDouble(object obj, string propertyName)
{
if (obj == null || string.IsNullOrWhiteSpace(propertyName))
return null;
var propertyInfo = obj.GetType().GetProperty(propertyName);
if (propertyInfo == null)
return null;
var value = propertyInfo.GetValue(obj);
if (value == null)
return null;
try
{
return Convert.ToDouble(value);
}
catch
{
return null;
}
}
public static bool IsMobileValid(this string mobileNo) public static bool IsMobileValid(this string mobileNo)
{ {

View File

@@ -0,0 +1,80 @@
using _0_Framework.Domain;
using System;
namespace Company.Domain.ClassificationSchemeAgg;
public class ClassificationEmployee : EntityBase
{
/// <summary>
/// ایجاد پرسنل طرح
/// </summary>
/// <param name="workshopId"></param>
/// <param name="employeeId"></param>
/// <param name="classificationSchemeId"></param>
/// <param name="classificationGroupId"></param>
/// <param name="classificationGroupJobId"></param>
public ClassificationEmployee(long workshopId, long employeeId, long classificationSchemeId, long classificationGroupId, long classificationGroupJobId)
{
WorkshopId = workshopId;
EmployeeId = employeeId;
ClassificationSchemeId = classificationSchemeId;
ClassificationGroupId = classificationGroupId;
ClassificationGroupJobId = classificationGroupJobId;
}
/// <summary>
/// آی دی کارگاه
/// </summary>
public long WorkshopId { get; private set; }
/// <summary>
/// آی دی پرسنل
/// </summary>
public long EmployeeId { get; private set; }
/// <summary>
/// آی دی طرح
/// </summary>
public long ClassificationSchemeId { get; private set; }
/// <summary>
/// آی دی گروه
/// </summary>
public long ClassificationGroupId { get; private set; }
/// <summary>
/// آی دی شغل
/// </summary>
public long ClassificationGroupJobId { get; private set; }
/// <summary>
/// تاریخ شروع استفاده از گروه
/// </summary>
public DateTime? StartGroupDate{ get; private set; }
/// <summary>
/// تاریخ پایان استفاده از گروه
/// </summary>
public DateTime? EndGroupDate { get; private set; }
public ClassificationGroup ClassificationGroup { get; set; }
/// <summary>
/// ویرایش پرسنل طرح
/// </summary>
/// <param name="workshopId"></param>
/// <param name="employeeId"></param>
/// <param name="classificationSchemeId"></param>
/// <param name="classificationGroupId"></param>
/// <param name="classificationGroupJobId"></param>
public void Edit(long classificationGroupId, long classificationGroupJobId)
{
ClassificationGroupId = classificationGroupId;
ClassificationGroupJobId = classificationGroupJobId;
}
}

View File

@@ -0,0 +1,43 @@
using System.Collections.Generic;
using _0_Framework.Domain;
namespace Company.Domain.ClassificationSchemeAgg;
public class ClassificationGroup : EntityBase
{
/// <summary>
/// ایجاد گروه های بیست گانه طرح طبقه بندی
/// </summary>
/// <param name="groupNo"></param>
/// <param name="workshopId"></param>
/// <param name="classificationSchemeId"></param>
public ClassificationGroup(string groupNo, long workshopId, long classificationSchemeId)
{
GroupNo = groupNo;
WorkshopId = workshopId;
ClassificationSchemeId = classificationSchemeId;
}
/// <summary>
/// شماره گروه
/// </summary>
public string GroupNo { get; private set; }
/// <summary>
/// آی دی کارگاه
/// </summary>
public long WorkshopId { get; private set; }
/// <summary>
/// آی دی طرح
/// </summary>
public long ClassificationSchemeId { get; private set; }
public ClassificationScheme ClassificationScheme { get; set; }
public List<ClassificationGroupJob> ClassificationGroupJobs { get; set; }
public List<ClassificationGroupSalary> ClassificationGroupSalaries { get; set; }
public List<ClassificationEmployee> ClassificationEmployees { get; set; }
}

View File

@@ -0,0 +1,55 @@
using _0_Framework.Domain;
using _0_Framework_b.Domain;
namespace Company.Domain.ClassificationSchemeAgg;
public class ClassificationGroupJob : EntityBaseWithoutCreationDate
{
/// <summary>
/// ایجاد لیست مشغال برای گروه های طرح طبقه بندی
/// </summary>
/// <param name="jobId"></param>
/// <param name="jobName"></param>
/// <param name="jobCode"></param>
/// <param name="classificationGroupId"></param>
/// <param name="groupNo"></param>
public ClassificationGroupJob(long jobId, string jobName, string jobCode, long classificationGroupId, string groupNo)
{
JobId = jobId;
JobName = jobName;
JobCode = jobCode;
ClassificationGroupId = classificationGroupId;
GroupNo = groupNo;
}
/// <summary>
/// آی دی شغل
/// </summary>
public long JobId { get; private set; }
/// <summary>
/// نام شغل
/// </summary>
public string JobName { get; private set; }
/// <summary>
/// کد شغل
/// </summary>
public string JobCode { get; private set; }
/// <summary>
/// آی دی گروه
/// </summary>
public long ClassificationGroupId { get; private set; }
/// <summary>
/// شماره گروه
/// </summary>
public string GroupNo { get; private set; }
public ClassificationGroup ClassificationGroup { get; set; }
}

View File

@@ -0,0 +1,82 @@
using _0_Framework.Domain;
using System;
namespace Company.Domain.ClassificationSchemeAgg;
public class ClassificationGroupSalary : EntityBase
{
/// <summary>
/// ایجاد دستمزد برای گروه
/// </summary>
/// <param name="classificationGroupId"></param>
/// <param name="groupNo"></param>
/// <param name="groupSalary"></param>
/// <param name="startDate"></param>
/// <param name="endDate"></param>
/// <param name="year"></param>
public ClassificationGroupSalary(long classificationGroupId, string groupNo, double groupSalary, DateTime startDate, DateTime endDate, int year, long schemeId)
{
ClassificationGroupId = classificationGroupId;
GroupNo = groupNo;
GroupSalary = groupSalary;
StartDate = startDate;
EndDate = endDate;
Year = year;
SchemeId = schemeId;
}
/// <summary>
/// آی دی گروه
/// </summary>
public long ClassificationGroupId { get; private set; }
/// <summary>
/// شماره گروه
/// </summary>
public string GroupNo { get; private set; }
/// <summary>
/// دستمزد گروه
/// </summary>
public double GroupSalary { get; private set; }
/// <summary>
/// تاریخ شروع
/// </summary>
public DateTime StartDate { get; private set; }
/// <summary>
/// تاریخ پایان
/// </summary>
public DateTime EndDate { get; private set; }
/// <summary>
/// سال
/// </summary>
public int Year { get; private set; }
public long SchemeId { get; private set; }
public ClassificationGroup ClassificationGroup { get; set; }
/// <summary>
/// ویرایش دستمزد گروه
/// </summary>
/// <param name="groupSalary"></param>
/// <param name="startDate"></param>
/// <param name="endDate"></param>
/// <param name="year"></param>
public void Edit(double groupSalary, DateTime startDate, DateTime endDate, int year)
{
GroupSalary = groupSalary;
StartDate = startDate;
EndDate = endDate;
Year = year;
}
}

View File

@@ -0,0 +1,68 @@
using System;
using _0_Framework.Domain;
namespace Company.Domain.ClassificationSchemeAgg;
public class ClassificationRialCoefficient : EntityBaseWithoutCreationDate
{
/// <summary>
/// ایچاد ضریب ریالی
/// </summary>
/// <param name="classificationSchemeId"></param>
/// <param name="rialCoefficient"></param>
/// <param name="startDate"></param>
/// <param name="endDate"></param>
/// <param name="year"></param>
public ClassificationRialCoefficient(long classificationSchemeId, double rialCoefficient, DateTime startDate, DateTime endDate, int year)
{
ClassificationSchemeId = classificationSchemeId;
RialCoefficient = rialCoefficient;
StartDate = startDate;
EndDate = endDate;
Year = year;
}
//آی دی طرح
public long ClassificationSchemeId { get; private set; }
/// <summary>
/// ضریب ریالی
/// </summary>
public double RialCoefficient { get; private set; }
/// <summary>
/// تاریخ شروع
/// </summary>
public DateTime StartDate { get; private set; }
/// <summary>
/// تاریخ پایان
/// </summary>
public DateTime EndDate { get; private set; }
/// <summary>
/// سال
/// </summary>
public int Year { get; private set; }
public ClassificationScheme ClassificationScheme { get; set; }
/// <summary>
/// ویرایش ضریب ریالی
/// </summary>
/// <param name="classificationSchemeId"></param>
/// <param name="rialCoefficient"></param>
/// <param name="startDate"></param>
/// <param name="endDate"></param>
/// <param name="year"></param>
public void Edit(double rialCoefficient, DateTime startDate, DateTime endDate, int year)
{
RialCoefficient = rialCoefficient;
StartDate = startDate;
EndDate = endDate;
Year = year;
}
}

View File

@@ -0,0 +1,88 @@
using System;
using System.Collections.Generic;
using _0_Framework.Application.Enums;
using _0_Framework.Domain;
namespace Company.Domain.ClassificationSchemeAgg;
public class ClassificationScheme : EntityBase
{
/// <summary>
/// ایجاد طرح طبقه بندی مشاغل
/// </summary>
/// <param name="includingDateGr"></param>
/// <param name="executionDateGr"></param>
/// <param name="designerFullName"></param>
/// <param name="designerPhone"></param>
/// <param name="workshopId"></param>
/// <param name="typeOfCoefficient"></param>
public ClassificationScheme(DateTime includingDateGr, DateTime executionDateGr, string designerFullName, string designerPhone, long workshopId, TypeOfCoefficient typeOfCoefficient)
{
IncludingDateGr = includingDateGr;
ExecutionDateGr = executionDateGr;
DesignerFullName = designerFullName;
DesignerPhone = designerPhone;
WorkshopId = workshopId;
TypeOfCoefficient = typeOfCoefficient;
}
/// <summary>
/// تاریخ شمول طرح
/// </summary>
public DateTime IncludingDateGr { get; private set; }
/// <summary>
/// تاریخ اجرای طرح
/// </summary>
public DateTime ExecutionDateGr { get; private set; }
/// <summary>
/// تاریخ پایان طرح
/// </summary>
public DateTime? EndSchemeDateGr { get; private set; }
/// <summary>
/// نام کامل طراح
/// </summary>
public string DesignerFullName { get; private set; }
/// <summary>
/// شماره همراه طراح
/// </summary>
public string DesignerPhone { get; private set; }
/// <summary>
/// آی دی کارگاه
/// </summary>
public long WorkshopId { get; private set; }
/// <summary>
/// نوع ضریب
/// </summary>
public TypeOfCoefficient TypeOfCoefficient { get; private set; }
public List<ClassificationGroup> ClassificationGroups { get; set; }
public List<ClassificationRialCoefficient> ClassificationRialCoefficients { get; set; }
/// <summary>
/// ویرایش طرح
/// </summary>
/// <param name="includingDateGr"></param>
/// <param name="executionDateGr"></param>
/// <param name="designerFullName"></param>
/// <param name="designerPhone"></param>
/// <param name="workshopId"></param>
public void Edit(DateTime includingDateGr, DateTime executionDateGr,string designerFullName, string designerPhone, TypeOfCoefficient typeOfCoefficient)
{
IncludingDateGr = includingDateGr;
ExecutionDateGr = executionDateGr;
DesignerFullName = designerFullName;
DesignerPhone = designerPhone;
TypeOfCoefficient = typeOfCoefficient;
}
}

View File

@@ -0,0 +1,25 @@
using _0_Framework.Domain;
using CompanyManagment.App.Contracts.ClassificationScheme;
using System.Collections.Generic;
using System.Threading.Tasks;
namespace Company.Domain.ClassificationSchemeAgg;
public interface IClassificationEmployeeRepository : IRepository<long, ClassificationEmployee>
{
/// <summary>
/// دریافت لیست پرسنل کارگاه
/// تب افزودن پرسنل
/// </summary>
/// <param name="schemeId"></param>
/// <returns></returns>
Task<List<EmployeeInfoList>> GetEmployeeListData(long schemeId);
/// <summary>
/// دریافت اطلاعات عضویتی پرسنل در گروه
/// </summary>
/// <param name="employeeId"></param>
/// <returns></returns>
Task<ClassificationEmployee> GetEmployeeMemberizeData(long employeeId);
}

View File

@@ -0,0 +1,61 @@
using System.Collections.Generic;
using System.Threading.Tasks;
using _0_Framework.Domain;
using CompanyManagment.App.Contracts.ClassificationScheme;
namespace Company.Domain.ClassificationSchemeAgg;
public interface IClassificationGroupRepository : IRepository<long, ClassificationGroup>
{
/// <summary>
/// دریافت گروه های طرح
/// </summary>
/// <param name="schemeId"></param>
/// <returns></returns>
Task<List<ClassificationGroupList>> GetGroups(long schemeId);
/// <summary>
/// دریافت گروه ها و مشاغلشان برای تب تعیین مشاغل
/// </summary>
/// <param name="schemeId"></param>
/// <returns></returns>
Task<List<ClassificationGroupAndJobModel>> GetGroupAndJobs(long schemeId);
/// <summary>
/// دریافت مشاغل گروه توسط آی دی گروه
/// </summary>
/// <param name="groupId"></param>
/// <returns></returns>
Task<List<EditClassificationGroupJob>> GetGroupJobs(long groupId);
/// <summary>
/// چک میکند که آی پرسنلی وجود دارد که این شغل به او نسبت داده شده
/// </summary>
/// <param name="id"></param>
/// <param name="groupId"></param>
/// <returns></returns>
Task<bool> CheckEmployeeHasThisJob(long id, long groupId);
/// <summary>
/// ایجاد مشاغل
/// </summary>
/// <param name="createClassificationGroupJob"></param>
/// <param name="deleteJobList"></param>
/// <returns></returns>
Task<bool> CreateJobs(List<ClassificationGroupJob> createClassificationGroupJob, List<long> deleteJobList);
/// <summary>
/// در یافت اطلاعات گروه برای لود مودال ایجاد دستمزد های
/// </summary>
/// <returns></returns>
Task<SalaryAndRialCoefficientModel> GetGroupToCreateSalariesModal(long schemeId);
/// <summary>
/// ایجاد گروه های بیست گانه
/// </summary>
/// <param name="groupList"></param>
/// <returns></returns>
Task CreateGroups(List<ClassificationGroup> groupList);
}

View File

@@ -0,0 +1,34 @@
using _0_Framework.Domain;
using CompanyManagment.App.Contracts.ClassificationScheme;
using System.Collections.Generic;
using System.Threading.Tasks;
namespace Company.Domain.ClassificationSchemeAgg;
public interface IClassificationGroupSalariesRepository : IRepository<long, ClassificationGroupSalary>
{
/// <summary>
/// ایجاد دستمزدهای گروه ها
/// </summary>
/// <param name="createClassificationGroupSalary"></param>
/// <returns></returns>
Task CreateSalaries(List<ClassificationGroupSalary> createClassificationGroupSalary);
/// <summary>
/// دریافت دستمزدها و ضریب ریالی برای مودال ویرایش
/// </summary>
/// <param name="schemeId"></param>
/// <param name="startDate"></param>
/// <param name="endDate"></param>
/// <returns></returns>
Task<SalaryAndRialCoefficientModel> GetEditSalariesData(long schemeId, string startDate, string endDate);
/// <summary>
/// لیست دستمزدها بر اساس تاریخ و سال برای تب دستمزدها
/// </summary>
/// <param name="schemeId"></param>
/// <returns></returns>
Task<SalaryAndRialCoefficientTab> GetSalariesTabData(long schemeId);
}

View File

@@ -0,0 +1,8 @@
using _0_Framework.Domain;
namespace Company.Domain.ClassificationSchemeAgg;
public interface IClassificationRialCoefficientRepository : IRepository<long, ClassificationRialCoefficient>
{
}

View File

@@ -0,0 +1,42 @@
using _0_Framework.Application;
using _0_Framework.Domain;
using CompanyManagment.App.Contracts.ClassificationScheme;
using CompanyManagment.App.Contracts.YearlySalary;
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
namespace Company.Domain.ClassificationSchemeAgg;
public interface IClassificationSchemeRepository : IRepository<long, ClassificationScheme>
{
/// <summary>
/// پارشیال صفحه ایجاد طرح
/// </summary>
/// <param name="worskhopId"></param>
/// <returns></returns>
Task<ClassificationSchemePartialModel> ClassificationSchemePartialModel(long workshopId);
/// <summary>
/// دریافت اطلاعات طرح برای ویرایش
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
Task<EditClassificationScheme> GetClassificationScheme(long id);
/// <summary>
/// متد محاسبه پایه سنوات برا افراد تک گروه
/// </summary>
/// <param name="schemeStart">تاریخ شروع طرح</param>
/// <param name="schemeEnd">تاریخ پاین طرح، اجباری نیست</param>
/// <param name="contractStart">تاریخ شروع قراداد</param>
/// <param name="contractEnd">تاریخ پایان قراداد</param>
/// <param name="groupNo">شماره گروه</param>
/// <param name="employeeId">آی دی پرسنل</param>
/// <param name="workshopId">آی دی کارگاه</param>
/// <returns></returns>
Task<BaseYearDataViewModel> BaseYearComputeOneGroup(DateTime schemeStart, DateTime? schemeEnd,
DateTime contractStart, DateTime contractEnd, string groupNo, long employeeId, long workshopId);
}

View File

@@ -11,6 +11,13 @@ public interface IJobRepository : IRepository<long, Job>
EditJob GetDetails(long id); EditJob GetDetails(long id);
List<JobViewModel> Search(JobSearchModel searchModel); List<JobViewModel> Search(JobSearchModel searchModel);
List<JobViewModel> SearchJobForMain(JobSearchModel searchModel); List<JobViewModel> SearchJobForMain(JobSearchModel searchModel);
/// <summary>
/// جستجوس مشاغل
/// </summary>
/// <param name="searchtText"></param>
/// <returns></returns>
Task<List<JobViewModel>> JobSearchSelect(string searchtText);
// Task<List<JobViewModel>> GetJobListByText(string searchtText); // Task<List<JobViewModel>> GetJobListByText(string searchtText);
List<JobViewModel> GetJobListByText(string searchtText); List<JobViewModel> GetJobListByText(string searchtText);
List<JobViewModel> GetJobListByWorkshopId(long workshopId); List<JobViewModel> GetJobListByWorkshopId(long workshopId);

View File

@@ -185,8 +185,17 @@ public class Workshop : EntityBase
public bool AddLeavePay { get; private set; } public bool AddLeavePay { get; private set; }
public string ZoneName { get; private set; } public string ZoneName { get; private set; }
public bool TotalPaymentHide { get; private set; } public bool TotalPaymentHide { get; private set; }
/// <summary>
/// آیا طبقه بندی شده است
/// [کارگاه دارای طرح طبقه بندی می باشد ؟]
/// </summary>
public bool IsClassified { get; private set; } public bool IsClassified { get; private set; }
/// <summary>
/// آیا طرح طبقه بندی تکمیل شده است
/// </summary>
public bool IsClassificationSchemeCompleted { get; private set; }
//نحوه محاسبه مزد مرخصی //نحوه محاسبه مزد مرخصی
public string ComputeOptions { get; private set; } public string ComputeOptions { get; private set; }

View File

@@ -0,0 +1,84 @@
using System.Collections.Generic;
namespace CompanyManagment.App.Contracts.ClassificationScheme;
/// <summary>
/// مدل برای مدال افزودن پرسنل ب گروه
/// </summary>
public class AddEmployeeToGroup
{
/// <summary>
/// آی دی
/// </summary>
public long Id { get; set; }
/// <summary>
/// نام کامل پرسنل
/// </summary>
public string EmployeeFullName { get; set; }
/// <summary>
/// آی دی پرسنل
/// </summary>
public long EmployeeId { get; set; }
/// <summary>
/// آی دی طرح
/// </summary>
public long SchemeId { get; set; }
/// <summary>
/// آی دی گروه
/// </summary>
public long GroupId { get; set; }
/// <summary>
/// شماره گروه
/// </summary>
public string GoroupNo { get; set; }
/// <summary>
/// آی دی شغل
/// </summary>
public long JobId { get; set; }
/// <summary>
/// نام شغل
/// </summary>
public string JobName { get; set; }
/// <summary>
/// کد شغل
/// </summary>
public string JobCode { get; set; }
/// <summary>
/// لیست گروه ها
/// </summary>
public List<ClassificationGroupList> ClassificationGroupList{ get; set; }
}
/// <summary>
/// لیست گروه ها
/// </summary>
public class ClassificationGroupList
{
/// <summary>
/// آی دی گروه
/// </summary>
public long GroupId { get; set; }
/// <summary>
/// شماره گروه
/// استرینگ
/// </summary>
public string GroupNo { get; set; }
/// <summary>
/// شماره گروه
/// اینتیجر
/// </summary>
public int GroupNoInt { get; set; }
}

View File

@@ -0,0 +1,104 @@
using System.Collections.Generic;
namespace CompanyManagment.App.Contracts.ClassificationScheme;
/// <summary>
/// ایجاد گروه
/// </summary>
public class ClassificationGroupAndJobModel
{
/// <summary>
/// آی دی گروه
/// </summary>
public long GroupId { get; set; }
/// <summary>
/// شماره گروه
/// استرینگ
/// </summary>
public string GroupNo { get; set; }
/// <summary>
/// شماره گروه نوع عددی
/// </summary>
public int GroupNoInt { get; set; }
/// <summary>
/// آی دی کارگاه
/// </summary>
public long WorkshopId { get; set; }
/// <summary>
/// آی دی طرح
/// </summary>
public long ClassificationSchemeId { get; set; }
/// <summary>
/// لیست مشاغل
/// </summary>
public List<EditClassificationGroupJob> EditClassificationGroupJob { get; set; }
}
/// <summary>
/// ایجاد مشاغل گروه
/// </summary>
public class CreateClassificationGroupJob
{
/// <summary>
/// آی دی شغل
/// </summary>
public long JobId { get; set; }
/// <summary>
/// نام شغل
/// </summary>
public string JobName { get; set; }
/// <summary>
/// کد شغل
/// </summary>
public string JobCode { get; set; }
/// <summary>
/// آی دی گروه
/// </summary>
public long ClassificationGroupId { get; set; }
/// <summary>
/// شماره گروه
/// </summary>
public string GroupNo { get; set; }
}
/// <summary>
/// ویرایش مشاغل گروه
/// </summary>
public class EditClassificationGroupJob : CreateClassificationGroupJob
{
/// <summary>
/// ای دی شغل
/// </summary>
public long Id { get; set; }
}
/// <summary>
/// ایجاد یا ویرایش مشاغل
/// </summary>
public class CreateOrEditGroupJobs
{
/// <summary>
/// آی دی گروه
/// </summary>
public long GroupId { get; set; }
/// <summary>
/// شماره گروه
/// استرینگ
/// </summary>
public string GroupNo { get; set; }
/// <summary>
/// آی دی مشاغل
/// </summary>
public List<long> JobIdList { get; set; }
}

View File

@@ -0,0 +1,24 @@
using System.Collections.Generic;
namespace CompanyManagment.App.Contracts.ClassificationScheme;
/// <summary>
/// پارشیال صفحه ایجاد طرح
/// </summary>
public class ClassificationSchemePartialModel
{
/// <summary>
/// آیا طرح دارد
/// </summary>
public bool HasScheme { get; set; }
/// <summary>
/// آی دی کارگاه
/// </summary>
public long WorkshopId { get; set; }
/// <summary>
/// لیست طرح
/// </summary>
public List<EditClassificationScheme> ClassificationSchemesList { get; set; }
}

View File

@@ -0,0 +1,204 @@
using _0_Framework.Application.Enums;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CompanyManagment.App.Contracts.ClassificationScheme;
/// <summary>
/// ایجاد دستمزد گروه و ضریب ریالی
/// </summary>
public class CreateClassificationGroupSalaryAndRialCoefficient
{
/// <summary>
/// آی دی گروه
/// </summary>
public long ClassificationGroupId { get; set; }
/// <summary>
/// شماره گروه
/// </summary>
public string GroupNo { get; set; }
/// <summary>
/// دستمزد گروه
/// </summary>
public double GroupSalary { get; set; }
/// <summary>
/// تاریخ شروع
/// </summary>
public DateTime StartDate { get; set; }
/// <summary>
/// تاریخ پایان
/// </summary>
public DateTime EndDate { get; set; }
/// <summary>
/// سال
/// </summary>
public int Year { get; set; }
}
/// <summary>
/// ویرایش دستمزد
/// </summary>
public class EditClassificationGroupSalaryAndRialCoefficient : CreateClassificationGroupSalaryAndRialCoefficient
{
/// <summary>
/// آی دی
/// </summary>
public long Id { get; set; }
/// <summary>
/// تاریخ شروع
/// شمسی
/// </summary>
[DataType(DataType.Text)]
public string StartDateFa { get; set; }
/// <summary>
/// تاریخ پایان
/// شمسی
/// </summary>
[DataType(DataType.Text)]
public string EndDateFa { get; set; }
/// <summary>
/// دستمزد گروه
/// </summary>
public string GroupSalaryStr { get; set; }
}
/// <summary>
/// لیست دستمزدها و ضرایب ریالی
/// </summary>
public class SalaryAndRialCoefficientModel
{
/// <summary>
/// تاریخ شروع
/// میلادی
/// </summary>
public DateTime StartDate { get; set; }
/// <summary>
/// تاریخ شروع
/// شمسی
/// </summary>
[DataType(DataType.Text)]
public string StartDateFa { get; set; }
/// <summary>
/// تاریخ پایان
/// میلادی
/// </summary>
public DateTime EndDate { get; set; }
/// <summary>
/// تاریخ پایان
/// شمسی
/// </summary>
[DataType(DataType.Text)]
public string EndDateFa { get; set; }
/// <summary>
/// سال
/// </summary>
public int Year { get; set; }
/// <summary>
/// ضریب ریالی
/// string
/// </summary>
public string RialCoefficientStr { get; set; }
/// <summary>
/// ضریب ریالی
/// double
/// </summary>
public double RialCoefficient { get; set; }
/// <summary>
/// آی دی طرح
/// </summary>
public long SchemeId { get; set; }
/// <summary>
/// نوع ضریب
/// </summary>
public TypeOfCoefficient TypeOfCoefficient { get; set; }
/// <summary>
/// آی دی ضریب ریالی
/// </summary>
public long CoefficientId { get; set; }
/// <summary>
/// لیست دستمزدها و ضرایب بر اساس سال
/// </summary>
public List<EditClassificationGroupSalaryAndRialCoefficient> SalariesAndCoefficientList { get; set; }
}
/// <summary>
/// تب دستمزد ها و ضرایب ریالی
/// </summary>
public class SalaryAndRialCoefficientTab
{
/// <summary>
/// آی دی طرح
/// </summary>
public long SchemeId { get; set; }
/// <summary>
/// آیا دستمزدی قبلا ایجاد شده است؟
/// </summary>
public bool HasAnySalaries { get; set; }
/// <summary>
/// لیست دستمزدها و ضرایب
/// </summary>
public List<SalaryAndRialCoefficientTabDataList> SalaryAndRialCoefficientTabDataList { get; set; }
}
/// <summary>
/// لیست دستمزدها
/// </summary>
public class SalaryAndRialCoefficientTabDataList
{
/// <summary>
/// تاریخ شروع
/// شمسی
/// </summary>
[DataType(DataType.Text)]
public string StartDateFa { get; set; }
/// <summary>
/// تاریخ پایان
/// شمسی
/// </summary>
[DataType(DataType.Text)]
public string EndDateFa { get; set; }
/// <summary>
/// سال
/// </summary>
public int Year { get; set; }
/// <summary>
/// ضریب ریالی
/// string
/// </summary>
public string RialCoefficientStr { get; set; }
}

View File

@@ -0,0 +1,63 @@
using _0_Framework.Application.Enums;
using System;
using System.ComponentModel.DataAnnotations;
namespace CompanyManagment.App.Contracts.ClassificationScheme;
/// <summary>
/// ایجاد طرح
/// </summary>
public class CreateClassificationScheme
{
/// <summary>
/// تاریخ شمول طرح
/// میلادی
/// </summary>
public DateTime IncludingDateGr { get; set; }
/// <summary>
/// تاریخ شمول طرح
/// شمسی
/// </summary>
public string IncludingDateFa { get; set; }
/// <summary>
/// تاریخ اجرای طرح
/// میلادی
/// </summary>
public DateTime ExecutionDateGr { get; set; }
/// <summary>
/// تاریخ اجرای طرح
/// شمسی
/// </summary>
public string ExecutionDateFa { get; set; }
/// <summary>
/// تاریخ پایان طرح
/// </summary>
public DateTime? EndSchemeDateGr { get; set; }
/// <summary>
/// نام کامل طراح
/// </summary>
public string DesignerFullName { get; set; }
/// <summary>
/// شماره همراه طراح
/// </summary>
[RegularExpression("^[0-9]*$", ErrorMessage = "لطفا فقط عدد وارد کنید")]
public string DesignerPhone { get; set; }
/// <summary>
/// آی دی کارگاه
/// </summary>
public long WorkshopId { get; set; }
/// <summary>
/// نوع ضریب
/// </summary>
public TypeOfCoefficient TypeOfCoefficient { get; set; }
}

View File

@@ -0,0 +1,12 @@
namespace CompanyManagment.App.Contracts.ClassificationScheme;
/// <summary>
/// ویرایش طرح
/// </summary>
public class EditClassificationScheme : CreateClassificationScheme
{
/// <summary>
/// آی دی طرح
/// </summary>
public long Id { get; set; }
}

View File

@@ -0,0 +1,110 @@
using System.Collections.Generic;
namespace CompanyManagment.App.Contracts.ClassificationScheme;
/// <summary>
/// جستجوی پرسنل
/// تب افزودن پرسنل طبقه بندی مشاغل
/// </summary>
public class EmployeeInfoTab
{
/// <summary>
/// آی دی کارگاه
/// </summary>
public long WorkshopId { get; set; }
/// <summary>
/// آی دی پرسنل
/// </summary>
public long EmployeeId { get; set; }
/// <summary>
/// نام کامل پرسنل
/// </summary>
public string FullName { get; set; }
/// <summary>
/// آی دی طرح
/// </summary>
public long SchemeId { get; set; }
/// <summary>
/// لیست پرسنل
/// </summary>
public List<EmployeeInfoList> EmployeeInfoList { get; set; }
public List<string> YearlyList { get; set; }
}
/// <summary>
/// لیست پرسنل
/// تب افزودن پرسنل طبقه بندی مشاغل
/// </summary>
public class EmployeeInfoList
{
/// <summary>
/// آی دی پرسنل
/// </summary>
public long EmployeeId { get; set; }
/// <summary>
/// نام کامل پرسنل
/// </summary>
public string FullName { get; set; }
/// <summary>
/// شماره گروه یا گره هایی که پرسنل در آن اضافه شده
/// </summary>
public string GroupNo { get; set; }
/// <summary>
/// آیا پرسنل هیچ گروهی دارد؟
/// </summary>
public bool HasGroup { get; set; }
/// <summary>
/// آخرین تاریخ شروع بکار قراداد
/// </summary>
public string LastStartContractWork { get; set; }
/// <summary>
/// آخرین تاریخ ترک کار قراداد
/// </summary>
public string LastLeftContractWork { get; set; }
/// <summary>
/// آخرین تاریخ شروع بکار بیمه
/// </summary>
public string LastStartInsuranceWork { get; set; }
/// <summary>
/// آخرین تاریخ ترک کار بیمه
/// </summary>
public string LastLeftInsuranceWork { get; set; }
/// <summary>
/// آیا پرسنل قرداد است
/// </summary>
public bool ContractPerson { get; set; }
/// <summary>
/// آیا پرسنل بیمه است
/// </summary>
public bool InsurancePerson { get; set; }
/// <summary>
/// آیا ترک کار قرارداد دارد
/// </summary>
public bool ContractLeft { get; set; }
/// <summary>
/// آیا ترک کار بیمه دارد
/// </summary>
public bool InsuranceLeft { get; set; }
/// <summary>
/// آیا کلا ترک کار کرده است
/// </summary>
public bool Black { get; set; }
}

View File

@@ -0,0 +1,167 @@
using _0_Framework.Application;
using CompanyManagment.App.Contracts.TemporaryClientRegistration;
using CompanyManagment.App.Contracts.YearlySalary;
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
namespace CompanyManagment.App.Contracts.ClassificationScheme;
/// <summary>
/// اپلیکیش طرح طبقه بندی مشاغل
/// </summary>
public interface IClassificationSchemeApplication
{
/// <summary>
/// پارشیال صفحه ایجاد طرح
/// </summary>
/// <param name="worskhopId"></param>
/// <returns></returns>
Task<ClassificationSchemePartialModel> ClassificationSchemePartialModel(long workshopId);
/// <summary>
/// ایجاد طرح
/// </summary>
/// <param name="command"></param>
/// <returns></returns>
Task<OperationResult> CreateClassificationScheme(CreateClassificationScheme command);
/// <summary>
/// دریافت اطلاعات طرح برای مودال ویرایش
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
Task<EditClassificationScheme> GetClassificationScheme(long id);
/// <summary>
/// ویرایش طرح
/// </summary>
/// <param name="command"></param>
/// <returns></returns>
Task<OperationResult> EditClassificationScheme(EditClassificationScheme command);
/// <summary>
/// دریافت گروه ها و مشاغلشان برای تب تعیین مشاغل
/// </summary>
/// <param name="schemeId"></param>
/// <returns></returns>
Task<List<ClassificationGroupAndJobModel>> GetGroupAndJobs(long schemeId);
/// <summary>
/// دریافت مشاغل گروه توسط آی دی گروه
/// </summary>
/// <param name="groupId"></param>
/// <returns></returns>
Task<List<EditClassificationGroupJob>> GetGroupJobs(long groupId);
/// <summary>
/// چک میکند که آی پرسنلی وجود دارد که این شغل به او نسبت داده شده
/// </summary>
/// <param name="id"></param>
/// <param name="groupId"></param>
/// <returns></returns>
Task<bool> CheckEmployeeHasThisJob(long id, long groupId);
/// <summary>
/// ایجاد مشاغل گروه
/// </summary>
/// <param name="createClassificationGroupJob"></param>
/// <param name="deleteJobList"></param>
/// <returns></returns>
Task<bool> CreateGroupJobs(List<CreateClassificationGroupJob> createClassificationGroupJob, List<long> deleteJobList);
/// <summary>
/// چک میکند که آیا برای این طرح تابحال دستمزدی ایجاد شده یا نه
/// </summary>
/// <param name="schemeId"></param>
/// <returns></returns>
Task<SalaryAndRialCoefficientTab> GetSalariesTabData(long schemeId);
/// <summary>
/// در یافت اطلاعات گروه برای لود مودال ایجاد دستمزد های
/// </summary>
/// <returns></returns>
Task<SalaryAndRialCoefficientModel> GetGroupToCreateSalariesModal(long schemeId);
/// <summary>
/// ایجاد دستمزدها و ضرایب ریالی هر گروه در هر سال
/// </summary>
/// <param name="command"></param>
/// <returns></returns>
Task<OperationResult> CreateGroupSalaryAndCoefficient(SalaryAndRialCoefficientModel command);
/// <summary>
/// دریافت دستمزدها و ضریب ریالی برای مودال ویرایش
/// </summary>
/// <param name="schemeId"></param>
/// <param name="startDate"></param>
/// <param name="endDate"></param>
/// <returns></returns>
Task<SalaryAndRialCoefficientModel> GetEditSalariesData(long schemeId, string startDate, string endDate);
/// <summary>
/// ثبت ویرایش دستمزدها و ضریب
/// </summary>
/// <param name="command"></param>
/// <returns></returns>
Task<OperationResult> EditGroupSalaryAndCoefficient(SalaryAndRialCoefficientModel command);
/// <summary>
/// دریافت لیست پرسنل برای تب افزودن پرسنل
/// </summary>
/// <param name="command"></param>
/// <returns></returns>
Task<EmployeeInfoTab> GetEmployeeDataTab(EmployeeInfoTab command);
/// <summary>
/// دریافت گروه های طرح
/// </summary>
/// <param name="schemeId"></param>
/// <returns></returns>
Task<List<ClassificationGroupList>> GetGroups(long schemeId);
/// <summary>
/// ذخیره پرسنل افزوده شده در گروه
/// </summary>
/// <param name="command"></param>
/// <returns></returns>
Task<OperationResult> AddEmployeeToGroup(AddEmployeeToGroup command);
/// <summary>
/// ذخیره ویرایش گروه پرسنل
/// </summary>
/// <param name="command"></param>
/// <returns></returns>
Task<OperationResult> EditGroupMember(AddEmployeeToGroup command);
/// <summary>
/// دریافت اطلاعات عضویتی پرسنل در گروه
/// </summary>
/// <param name="employeeId"></param>
/// <returns></returns>
Task<AddEmployeeToGroup> GetEmployeeMemberizeData(long employeeId);
/// <summary>
/// متد محاسبه پایه سنوات برا افراد تک گروه
/// </summary>
/// <param name="schemeStart">تاریخ شروع طرح</param>
/// <param name="schemeEnd">تاریخ پاین طرح، اجباری نیست</param>
/// <param name="contractStart">تاریخ شروع قراداد</param>
/// <param name="contractEnd">تاریخ پایان قراداد</param>
/// <param name="groupNo">شماره گروه</param>
/// <param name="employeeId">آی دی پرسنل</param>
/// <param name="workshopId">آی دی کارگاه</param>
/// <returns></returns>
Task<BaseYearDataViewModel> BaseYearComputeOneGroup(DateTime schemeStart, DateTime? schemeEnd,
DateTime contractStart, DateTime contractEnd, string groupNo, long employeeId, long workshopId);
}

View File

@@ -13,6 +13,13 @@ public interface IJobApplication
List<JobViewModel> Search(JobSearchModel searchModel); List<JobViewModel> Search(JobSearchModel searchModel);
List<JobViewModel> SearchJobForMain(JobSearchModel searchModel); List<JobViewModel> SearchJobForMain(JobSearchModel searchModel);
//Task<List<JobViewModel>> GetJobListByText(string searchtText); //Task<List<JobViewModel>> GetJobListByText(string searchtText);
/// <summary>
/// جستجوی مشاغل برای سلکت تو
/// </summary>
/// <param name="searchtText"></param>
/// <returns></returns>
Task<List<JobViewModel>> JobSearchSelect(string searchtText);
List<JobViewModel> GetJobListByText(string searchtText); List<JobViewModel> GetJobListByText(string searchtText);
List<JobViewModel> GetJobListByWorkshopId(long workshopId); List<JobViewModel> GetJobListByWorkshopId(long workshopId);
List<JobViewModel> GetJobListByTextAndWorkshopId(string textSearch, long workshopId); List<JobViewModel> GetJobListByTextAndWorkshopId(string textSearch, long workshopId);

View File

@@ -0,0 +1,408 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using _0_Framework.Application;
using _0_Framework.Application.Enums;
using Company.Domain.ClassificationSchemeAgg;
using CompanyManagment.App.Contracts.ClassificationScheme;
using CompanyManagment.App.Contracts.YearlySalary;
using Microsoft.EntityFrameworkCore;
namespace CompanyManagment.Application;
public class ClassificationSchemeApplication : IClassificationSchemeApplication
{
private readonly IClassificationSchemeRepository _classificationSchemeRepository;
private readonly IClassificationGroupRepository _classificationGroupRepository;
private readonly IClassificationGroupSalariesRepository _classificationGroupSalariesRepository;
private readonly IClassificationRialCoefficientRepository _classificationRialCoefficientRepository;
private readonly IClassificationEmployeeRepository _classificationEmployeeRepository;
public ClassificationSchemeApplication(IClassificationSchemeRepository classificationSchemeRepository, IClassificationGroupRepository classificationGroupRepository, IClassificationGroupSalariesRepository classificationGroupSalariesRepository, IClassificationRialCoefficientRepository classificationRialCoefficientRepository, IClassificationEmployeeRepository classificationEmployeeRepository)
{
_classificationSchemeRepository = classificationSchemeRepository;
_classificationGroupRepository = classificationGroupRepository;
_classificationGroupSalariesRepository = classificationGroupSalariesRepository;
_classificationRialCoefficientRepository = classificationRialCoefficientRepository;
_classificationEmployeeRepository = classificationEmployeeRepository;
}
public Task<ClassificationSchemePartialModel> ClassificationSchemePartialModel(long workshopId)
{
return _classificationSchemeRepository.ClassificationSchemePartialModel(workshopId);
}
public async Task<OperationResult> CreateClassificationScheme(CreateClassificationScheme command)
{
var op = new OperationResult();
#region Validation
if (!command.ExecutionDateFa.TryToGeorgianDateTime(out var executionDateGr))
{
return op.Failed("تاریخ اجرا صحیح نمی باشد");
}
if (!command.IncludingDateFa.TryToGeorgianDateTime(out var includingDateGr))
{
return op.Failed("تاریخ شمول صحیح نمی باشد");
}
#endregion
//ایجاد طرح
var create = new ClassificationScheme(includingDateGr, executionDateGr,
command.DesignerFullName, command.DesignerPhone, command.WorkshopId, command.TypeOfCoefficient);
_classificationSchemeRepository.Create(create);
await _classificationSchemeRepository.SaveChangesAsync();
//ایجاد گروه های طرح
var groups = new List<ClassificationGroup>()
{
new ClassificationGroup("1",command.WorkshopId,create.id),
new ClassificationGroup("2",command.WorkshopId,create.id),
new ClassificationGroup("3",command.WorkshopId,create.id),
new ClassificationGroup("4",command.WorkshopId,create.id),
new ClassificationGroup("5",command.WorkshopId,create.id),
new ClassificationGroup("6",command.WorkshopId,create.id),
new ClassificationGroup("7",command.WorkshopId,create.id),
new ClassificationGroup("8",command.WorkshopId,create.id),
new ClassificationGroup("9",command.WorkshopId,create.id),
new ClassificationGroup("10",command.WorkshopId,create.id),
new ClassificationGroup("11",command.WorkshopId,create.id),
new ClassificationGroup("12",command.WorkshopId,create.id),
new ClassificationGroup("13",command.WorkshopId,create.id),
new ClassificationGroup("14",command.WorkshopId,create.id),
new ClassificationGroup("15",command.WorkshopId,create.id),
new ClassificationGroup("16",command.WorkshopId,create.id),
new ClassificationGroup("17",command.WorkshopId,create.id),
new ClassificationGroup("18",command.WorkshopId,create.id),
new ClassificationGroup("19",command.WorkshopId,create.id),
new ClassificationGroup("20",command.WorkshopId,create.id),
};
await _classificationGroupRepository.CreateGroups(groups);
return op.Succcedded();
}
public Task<EditClassificationScheme> GetClassificationScheme(long id)
{
return _classificationSchemeRepository.GetClassificationScheme(id);
}
public async Task<OperationResult> EditClassificationScheme(EditClassificationScheme command)
{
var op = new OperationResult();
#region Validation
if (!command.ExecutionDateFa.TryToGeorgianDateTime(out var executionDateGr))
{
return op.Failed("تاریخ اجرا صحیح نمی باشد");
}
if (!command.IncludingDateFa.TryToGeorgianDateTime(out var includingDateGr))
{
return op.Failed("تاریخ شمول صحیح نمی باشد");
}
var scheme = _classificationSchemeRepository.Get(command.Id);
if (scheme == null)
return op.Failed("رکورد مورد نظر وجود ندارد");
#endregion
scheme.Edit(includingDateGr, executionDateGr, command.DesignerFullName,command.DesignerPhone,command.TypeOfCoefficient);
await _classificationSchemeRepository.SaveChangesAsync();
return op.Succcedded();
}
public async Task<List<ClassificationGroupAndJobModel>> GetGroupAndJobs(long schemeId)
{
return await _classificationGroupRepository.GetGroupAndJobs(schemeId);
}
public async Task<List<EditClassificationGroupJob>> GetGroupJobs(long groupId)
{
return await _classificationGroupRepository.GetGroupJobs(groupId);
}
public async Task<bool> CheckEmployeeHasThisJob(long id, long groupId)
{
return await _classificationGroupRepository.CheckEmployeeHasThisJob(id, groupId);
}
public async Task<bool> CreateGroupJobs(List<CreateClassificationGroupJob> createClassificationGroupJob, List<long> deleteJobList)
{
var newJoblist = new List<ClassificationGroupJob>();
if (createClassificationGroupJob.Count > 0)
{
foreach (var item in createClassificationGroupJob)
{
var newJob = new ClassificationGroupJob(item.JobId, item.JobName, item.JobCode, item.ClassificationGroupId,
item.GroupNo);
newJoblist.Add(newJob);
}
}
return await _classificationGroupRepository.CreateJobs(newJoblist, deleteJobList);
}
public async Task<SalaryAndRialCoefficientTab> GetSalariesTabData(long schemeId)
{
return await _classificationGroupSalariesRepository.GetSalariesTabData(schemeId);
}
public async Task<SalaryAndRialCoefficientModel> GetGroupToCreateSalariesModal(long schemeId)
{
return await _classificationGroupRepository.GetGroupToCreateSalariesModal(schemeId);
}
public async Task<OperationResult> CreateGroupSalaryAndCoefficient(SalaryAndRialCoefficientModel command)
{
var op = new OperationResult();
#region Validation
if (string.IsNullOrWhiteSpace(command.StartDateFa) || string.IsNullOrWhiteSpace(command.StartDateFa))
return op.Failed("تاریخ شروع و پایان نمی توانند خالی باشند");
if (command.TypeOfCoefficient == TypeOfCoefficient.RialCoefficient && command.RialCoefficient == 0)
return op.Failed("ضریب ریالی وارد نشده است");
if (command.SalariesAndCoefficientList.Any(x=> string.IsNullOrWhiteSpace(x.GroupSalaryStr) || x.GroupSalaryStr =="0"))
return op.Failed("دستمزد تمامی گروه ها می بایست تعیین شود");
if (!command.StartDateFa.TryToGeorgianDateTime(out var startDate))
{
return op.Failed("تاریخ شروع وارد شده صحیح نمی باشد");
}
if (!command.EndDateFa.TryToGeorgianDateTime(out var endDate))
{
return op.Failed("تاریخ پایان وارد شده صحیح نمی باشد");
}
if (_classificationGroupSalariesRepository.Exists(x => x.StartDate <= endDate && x.EndDate >= startDate && x.SchemeId == command.SchemeId))
{
return op.Failed("بازه تاریخ وارد شده با داده های ذخیره شده قبل تداخل دارد");
}
var year = Convert.ToInt32(command.StartDateFa.Substring(0, 4));
var endDateYear = Convert.ToInt32(command.EndDateFa.Substring(0, 4));
if(year != endDateYear)
return op.Failed("سال تاریخ شروع از سال تاریخ پایان متفاوت است");
#endregion
var createSalaries = new List<ClassificationGroupSalary>();
foreach (var item in command.SalariesAndCoefficientList)
{
item.GroupSalary = item.GroupSalaryStr.MoneyToDouble();
var create = new ClassificationGroupSalary(item.ClassificationGroupId,item.GroupNo,item.GroupSalary,startDate, endDate, year, command.SchemeId);
createSalaries.Add(create);
}
await _classificationGroupSalariesRepository.CreateSalaries(createSalaries);
if (command.TypeOfCoefficient == TypeOfCoefficient.RialCoefficient)
{
try
{
command.RialCoefficient = command.RialCoefficient;
await _classificationRialCoefficientRepository.CreateAsync(new ClassificationRialCoefficient(command.SchemeId,
command.RialCoefficient, startDate, endDate, year));
await _classificationRialCoefficientRepository.SaveChangesAsync();
}
catch (Exception e)
{
return op.Failed("فرمت مبلغ ضریب ریالی اشتباه است");
}
}
op.SendId = command.SchemeId;
return op.Succcedded();
}
public async Task<SalaryAndRialCoefficientModel> GetEditSalariesData(long schemeId, string startDate, string endDate)
{
return await _classificationGroupSalariesRepository.GetEditSalariesData(schemeId, startDate, endDate);
}
public async Task<OperationResult> EditGroupSalaryAndCoefficient(SalaryAndRialCoefficientModel command)
{
var op = new OperationResult();
#region Validation
if (string.IsNullOrWhiteSpace(command.StartDateFa) || string.IsNullOrWhiteSpace(command.StartDateFa))
return op.Failed("تاریخ شروع و پایان نمی توانند خالی باشند");
if (command.TypeOfCoefficient == TypeOfCoefficient.RialCoefficient && command.RialCoefficient == 0)
return op.Failed("ضریب ریالی وارد نشده است");
if (command.SalariesAndCoefficientList.Any(x => string.IsNullOrWhiteSpace(x.GroupSalaryStr) || x.GroupSalaryStr == "0"))
return op.Failed("دستمزد تمامی گروه ها می بایست تعیین شود");
if (!command.StartDateFa.TryToGeorgianDateTime(out var startDate))
{
return op.Failed("تاریخ شروع وارد شده صحیح نمی باشد");
}
if (!command.EndDateFa.TryToGeorgianDateTime(out var endDate))
{
return op.Failed("تاریخ پایان وارد شده صحیح نمی باشد");
}
var salariesId = command.SalariesAndCoefficientList.Select(x => x.Id).ToList();
if (_classificationGroupSalariesRepository.Exists(x => x.StartDate <= endDate && x.EndDate >= startDate && x.SchemeId == command.SchemeId && !salariesId.Contains(x.id)))
{
return op.Failed("بازه تاریخ وارد شده با داده های ذخیره شده قبل تداخل دارد");
}
var year = Convert.ToInt32(command.StartDateFa.Substring(0, 4));
var endDateYear = Convert.ToInt32(command.EndDateFa.Substring(0, 4));
if (year != endDateYear)
return op.Failed("سال تاریخ شروع از سال تاریخ پایان متفاوت است");
#endregion
foreach (var item in command.SalariesAndCoefficientList)
{
var editSalary = _classificationGroupSalariesRepository.Get(item.Id);
item.GroupSalary = item.GroupSalaryStr.MoneyToDouble();
editSalary.Edit(item.GroupSalary, startDate, endDate, year);
await _classificationGroupSalariesRepository.SaveChangesAsync();
}
if (command.TypeOfCoefficient == TypeOfCoefficient.RialCoefficient)
{
var editRialCoefficient = _classificationRialCoefficientRepository.Get(command.CoefficientId);
editRialCoefficient.Edit(command.RialCoefficient, startDate, endDate, year);
await _classificationRialCoefficientRepository.SaveChangesAsync();
}
return op.Succcedded();
}
public async Task<EmployeeInfoTab> GetEmployeeDataTab(EmployeeInfoTab command)
{
var employeeInfoTab = new EmployeeInfoTab();
var employeeInfoList = _classificationEmployeeRepository.GetEmployeeListData(command.SchemeId).GetAwaiter().GetResult();
if (employeeInfoList.Any())
{
if (!string.IsNullOrWhiteSpace(command.FullName))
employeeInfoList = employeeInfoList.Where(x => x.FullName.Contains(command.FullName)).ToList();
employeeInfoTab.EmployeeInfoList = employeeInfoList;
employeeInfoTab.FullName = command.FullName;
}
return employeeInfoTab;
}
public async Task<List<ClassificationGroupList>> GetGroups(long schemeId)
{
return await _classificationGroupRepository.GetGroups(schemeId);
}
public async Task<OperationResult> AddEmployeeToGroup(AddEmployeeToGroup command)
{
var op = new OperationResult();
#region Validation
if (command.GroupId == 0)
return op.Failed("لطفا گروه را انتخاب کنید");
if (command.JobId == 0)
return op.Failed("لطفا سمت را انتخاب کنید");
#endregion
var scheme = _classificationSchemeRepository.GetClassificationScheme(command.SchemeId).GetAwaiter().GetResult();
var create = new ClassificationEmployee(scheme.WorkshopId, command.EmployeeId, command.SchemeId,
command.GroupId, command.JobId);
await _classificationEmployeeRepository.CreateAsync(create);
await _classificationEmployeeRepository.SaveChangesAsync();
return op.Succcedded();
}
public async Task<OperationResult> EditGroupMember(AddEmployeeToGroup command)
{
var op = new OperationResult();
#region Validation
if (command.GroupId == 0)
return op.Failed("لطفا گروه را انتخاب کنید");
if (command.JobId == 0)
return op.Failed("لطفا سمت را انتخاب کنید");
#endregion
var editGroup = _classificationEmployeeRepository.Get(command.Id);
editGroup.Edit(command.GroupId, command.JobId);
await _classificationEmployeeRepository.SaveChangesAsync();
return op.Succcedded();
}
/// <summary>
/// دریافت اطلاعات عضویتی پرسنل در گروه
/// </summary>
/// <param name="employeeId"></param>
/// <returns></returns>
public async Task<AddEmployeeToGroup> GetEmployeeMemberizeData(long employeeId)
{
var result = new AddEmployeeToGroup();
var res = await _classificationEmployeeRepository.GetEmployeeMemberizeData(employeeId);
result.EmployeeId = employeeId;
result.GroupId = res.ClassificationGroupId;
result.JobId = res.ClassificationGroupJobId;
result.Id = res.id;
return result;
}
public async Task<BaseYearDataViewModel> BaseYearComputeOneGroup(DateTime schemeStart, DateTime? schemeEnd, DateTime contractStart, DateTime contractEnd,
string groupNo, long employeeId, long workshopId)
{
return await _classificationSchemeRepository.BaseYearComputeOneGroup(schemeStart, schemeEnd, contractStart,
contractEnd, groupNo, employeeId, workshopId);
}
}

View File

@@ -1868,6 +1868,10 @@ public class InsuranceListApplication : IInsuranceListApplication
bool isManager = jobId is 10 or 16 or 17 or 18 or 3498; bool isManager = jobId is 10 or 16 or 17 or 18 or 3498;
if (isManager && !includeStatus) if (isManager && !includeStatus)
return 0;
//پرسنل استثناء سیدعسکر موسوی زاده - فروشگاه ولی عصر
if (employeeId == 1496)
return 0; return 0;
//پرسنل استثناء //پرسنل استثناء
if (employeeId == 42783) if (employeeId == 42783)

View File

@@ -1,4 +1,5 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.Threading.Tasks;
using _0_Framework.Application; using _0_Framework.Application;
using Company.Domain.JobAgg; using Company.Domain.JobAgg;
using CompanyManagment.App.Contracts.Job; using CompanyManagment.App.Contracts.Job;
@@ -66,6 +67,11 @@ public class JobApplication : IJobApplication
return _jobRepository.SearchJobForMain(searchModel); return _jobRepository.SearchJobForMain(searchModel);
} }
public async Task<List<JobViewModel>> JobSearchSelect(string searchtText)
{
return await _jobRepository.JobSearchSelect(searchtText);
}
//public Task<List<JobViewModel>> GetJobListByText(string searchtText) //public Task<List<JobViewModel>> GetJobListByText(string searchtText)
//{ //{
// return _jobRepository.GetJobListByText(searchtText); // return _jobRepository.GetJobListByText(searchtText);

View File

@@ -113,37 +113,37 @@ public class WorkshopAppliction : IWorkshopApplication
return operation.Failed("لطفا جمعیت شهر را انتخاب کنید"); return operation.Failed("لطفا جمعیت شهر را انتخاب کنید");
} }
if (command.IsClassified) //if (command.IsClassified)
{ //{
if (string.IsNullOrWhiteSpace(command.CreatePlan.ExecutionDateFa) || command.CreatePlan.ExecutionDateFa.Length < 10) // if (string.IsNullOrWhiteSpace(command.CreatePlan.ExecutionDateFa) || command.CreatePlan.ExecutionDateFa.Length < 10)
return operation.Failed("تاریخ اجرای طرح را بصورت صحیح وارد کنید"); // return operation.Failed("تاریخ اجرای طرح را بصورت صحیح وارد کنید");
if(string.IsNullOrWhiteSpace(command.CreatePlan.IncludingDateFa) || command.CreatePlan.IncludingDateFa.Length <10) // if(string.IsNullOrWhiteSpace(command.CreatePlan.IncludingDateFa) || command.CreatePlan.IncludingDateFa.Length <10)
return operation.Failed("تاریخ شمول طرح را بصورت صحیح وارد کنید"); // return operation.Failed("تاریخ شمول طرح را بصورت صحیح وارد کنید");
var groupCounter = 0; // var groupCounter = 0;
// var planEmployeeCounter = command.CreatePlan.EditWorkshopPlanEmployeeList == null ? 0 : command.CreatePlan.EditWorkshopPlanEmployeeList.Count; // // var planEmployeeCounter = command.CreatePlan.EditWorkshopPlanEmployeeList == null ? 0 : command.CreatePlan.EditWorkshopPlanEmployeeList.Count;
for (int i = 0; i <= command.CreatePlan.EditGroupPlanlist.Count - 1; i++) // for (int i = 0; i <= command.CreatePlan.EditGroupPlanlist.Count - 1; i++)
{ // {
if (!string.IsNullOrWhiteSpace(command.CreatePlan.EditGroupPlanlist[i].AnnualSalaryStr) // if (!string.IsNullOrWhiteSpace(command.CreatePlan.EditGroupPlanlist[i].AnnualSalaryStr)
&& !string.IsNullOrWhiteSpace(command.CreatePlan.EditGroupPlanlist[i].BaseSalaryStr) // && !string.IsNullOrWhiteSpace(command.CreatePlan.EditGroupPlanlist[i].BaseSalaryStr)
&& !string.IsNullOrWhiteSpace(command.CreatePlan.EditGroupPlanlist[i].JobSalaryStr) // && !string.IsNullOrWhiteSpace(command.CreatePlan.EditGroupPlanlist[i].JobSalaryStr)
&& command.CreatePlan.EditGroupPlanlist[i].JobIdList.Count > 0) // && command.CreatePlan.EditGroupPlanlist[i].JobIdList.Count > 0)
{ // {
groupCounter += 1; // groupCounter += 1;
} // }
} // }
if (groupCounter >= 1) // if (groupCounter >= 1)
{ // {
createPlanValidations = true; // createPlanValidations = true;
} // }
else // else
{ // {
createPlanValidations = false; // createPlanValidations = false;
return operation.Failed("وارد کردن اطلاعات تمامی گروه ها الزامی است"); // return operation.Failed("وارد کردن اطلاعات تمامی گروه ها الزامی است");
} // }
} //}
//if (string.IsNullOrWhiteSpace(command.TypeOfInsuranceSend)) //if (string.IsNullOrWhiteSpace(command.TypeOfInsuranceSend))
// return operation.Failed("لطفا نوع ارسال لیست بیمه را مشخص کنید"); // return operation.Failed("لطفا نوع ارسال لیست بیمه را مشخص کنید");
var account = new AccountViewModel(); var account = new AccountViewModel();

View File

@@ -6,6 +6,7 @@ using Company.Domain.Board;
using Company.Domain.BoardType; using Company.Domain.BoardType;
using Company.Domain.ChapterAgg; using Company.Domain.ChapterAgg;
using Company.Domain.CheckoutAgg; using Company.Domain.CheckoutAgg;
using Company.Domain.ClassificationSchemeAgg;
using Company.Domain.ClassifiedSalaryAgg; using Company.Domain.ClassifiedSalaryAgg;
using Company.Domain.ClientEmployeeWorkshopAgg; using Company.Domain.ClientEmployeeWorkshopAgg;
using Company.Domain.Contact2Agg; using Company.Domain.Contact2Agg;
@@ -211,6 +212,42 @@ public class CompanyContext : DbContext
public DbSet<PlanPercentage> PlanPercentages { get; set; } public DbSet<PlanPercentage> PlanPercentages { get; set; }
#region ClassificationScheme
/// <summary>
/// جدول طرح طبقه بندی
/// </summary>
public DbSet<ClassificationScheme> ClassificationSchemes { get; set; }
/// <summary>
/// جدول گروه های طرح
/// </summary>
public DbSet<ClassificationGroup> ClassificationGroups { get; set; }
/// <summary>
/// جدول ضرایب ریالی
/// </summary>
public DbSet<ClassificationRialCoefficient> ClassificationRialCoefficients { get; set; }
/// <summary>
/// جدول شغل های گروه
/// </summary>
public DbSet<ClassificationGroupJob> ClassificationGroupJobs { get; set; }
/// <summary>
/// جدول مزد شغل گروه ها
/// </summary>
public DbSet<ClassificationGroupSalary> ClassificationGroupSalaries { get; set; }
/// <summary>
/// جدول پرسنل طرح
/// </summary>
public DbSet<ClassificationEmployee> ClassificationEmployees { get; set; }
#endregion
#region TemporaryClientRegisteration #region TemporaryClientRegisteration
public DbSet<ContractingPartyTemp> ContractingPartyTemps { get; set; } public DbSet<ContractingPartyTemp> ContractingPartyTemps { get; set; }

View File

@@ -0,0 +1,22 @@
using Company.Domain.ClassificationSchemeAgg;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
namespace CompanyManagment.EFCore.Mapping;
public class ClassificationEmployeeMapping : IEntityTypeConfiguration<ClassificationEmployee>
{
public void Configure(EntityTypeBuilder<ClassificationEmployee> builder)
{
builder.ToTable("ClassificationEmployee");
builder.HasKey(x => x.id);
builder.Property(x => x.StartGroupDate).IsRequired(false);
builder.Property(x => x.EndGroupDate).IsRequired(false);
builder.HasOne(x => x.ClassificationGroup)
.WithMany(x => x.ClassificationEmployees)
.HasForeignKey(x => x.ClassificationGroupId);
}
}

View File

@@ -0,0 +1,22 @@
using Company.Domain.ClassificationSchemeAgg;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
namespace CompanyManagment.EFCore.Mapping;
public class ClassificationGroupJobMapping : IEntityTypeConfiguration<ClassificationGroupJob>
{
public void Configure(EntityTypeBuilder<ClassificationGroupJob> builder)
{
builder.ToTable("ClassificationGroupJobs");
builder.HasKey(x => x.id);
builder.Property(x => x.JobName).HasMaxLength(255);
builder.Property(x => x.JobCode).HasMaxLength(100);
builder.Property(x => x.GroupNo).HasMaxLength(2);
builder.HasOne(x => x.ClassificationGroup)
.WithMany(x => x.ClassificationGroupJobs)
.HasForeignKey(x => x.ClassificationGroupId);
}
}

View File

@@ -0,0 +1,35 @@
using Company.Domain.ClassificationSchemeAgg;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
namespace CompanyManagment.EFCore.Mapping;
public class ClassificationGroupMapping : IEntityTypeConfiguration<ClassificationGroup>
{
public void Configure(EntityTypeBuilder<ClassificationGroup> builder)
{
builder.ToTable("ClassificationGroups");
builder.HasKey(x => x.id);
builder.Property(x => x.GroupNo).HasMaxLength(2);
builder.HasOne(x => x.ClassificationScheme)
.WithMany(x => x.ClassificationGroups)
.HasForeignKey(x => x.ClassificationSchemeId);
builder.HasMany(x => x.ClassificationGroupJobs)
.WithOne(x => x.ClassificationGroup)
.HasForeignKey(x => x.ClassificationGroupId);
builder.HasMany(x => x.ClassificationEmployees)
.WithOne(x => x.ClassificationGroup)
.HasForeignKey(x => x.ClassificationGroupId);
builder.HasMany(x => x.ClassificationGroupSalaries)
.WithOne(x => x.ClassificationGroup)
.HasForeignKey(x => x.ClassificationGroupId);
}
}

View File

@@ -0,0 +1,20 @@
using Company.Domain.ClassificationSchemeAgg;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
namespace CompanyManagment.EFCore.Mapping;
public class ClassificationGroupSalaryMapping : IEntityTypeConfiguration<ClassificationGroupSalary>
{
public void Configure(EntityTypeBuilder<ClassificationGroupSalary> builder)
{
builder.ToTable("ClassificationGroupSalaries");
builder.HasKey(x => x.id);
builder.Property(x => x.GroupNo).HasMaxLength(2);
builder.HasOne(x => x.ClassificationGroup)
.WithMany(x => x.ClassificationGroupSalaries)
.HasForeignKey(x => x.ClassificationGroupId);
}
}

View File

@@ -0,0 +1,18 @@
using Company.Domain.ClassificationSchemeAgg;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
namespace CompanyManagment.EFCore.Mapping;
public class ClassificationRialCoefficientMapping : IEntityTypeConfiguration<ClassificationRialCoefficient>
{
public void Configure(EntityTypeBuilder<ClassificationRialCoefficient> builder)
{
builder.ToTable("ClassificationRialCoefficients");
builder.HasKey(x => x.id);
builder.HasOne(x => x.ClassificationScheme)
.WithMany(x => x.ClassificationRialCoefficients)
.HasForeignKey(x => x.ClassificationSchemeId);
}
}

View File

@@ -0,0 +1,38 @@
using System;
using _0_Framework.Application.Enums;
using Company.Domain.ClassificationSchemeAgg;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
namespace CompanyManagment.EFCore.Mapping;
public class ClassificationSchemeMapping : IEntityTypeConfiguration<ClassificationScheme>
{
public void Configure(EntityTypeBuilder<ClassificationScheme> builder)
{
builder.ToTable("ClassificationSchemes");
builder.HasKey(x => x.id);
builder.Property(x => x.IncludingDateGr);
builder.Property(x => x.ExecutionDateGr);
builder.Property(x => x.EndSchemeDateGr).IsRequired(false);
builder.Property(x => x.DesignerFullName).HasMaxLength(50);
builder.Property(x => x.DesignerPhone).HasMaxLength(20);
builder.Property(x => x.WorkshopId);
builder.Property(x => x.WorkshopId);
builder.Property(x => x.TypeOfCoefficient).HasConversion(
v => v.ToString(),
v => (TypeOfCoefficient)Enum.Parse(typeof(TypeOfCoefficient), v)).HasMaxLength(30);
builder.HasMany(x => x.ClassificationGroups)
.WithOne(x => x.ClassificationScheme)
.HasForeignKey(x => x.ClassificationSchemeId);
builder.HasMany(x => x.ClassificationRialCoefficients)
.WithOne(x => x.ClassificationScheme)
.HasForeignKey(x => x.ClassificationSchemeId);
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,201 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace CompanyManagment.EFCore.Migrations
{
/// <inheritdoc />
public partial class ClassificationScheme : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "ClassificationSchemes",
columns: table => new
{
id = table.Column<long>(type: "bigint", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
IncludingDateGr = table.Column<DateTime>(type: "datetime2", nullable: false),
ExecutionDateGr = table.Column<DateTime>(type: "datetime2", nullable: false),
EndSchemeDateGr = table.Column<DateTime>(type: "datetime2", nullable: true),
DesignerFullName = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
DesignerPhone = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
WorkshopId = table.Column<long>(type: "bigint", nullable: false),
TypeOfCoefficient = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: false),
CreationDate = table.Column<DateTime>(type: "datetime2", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_ClassificationSchemes", x => x.id);
});
migrationBuilder.CreateTable(
name: "ClassificationGroups",
columns: table => new
{
id = table.Column<long>(type: "bigint", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
GroupNo = table.Column<string>(type: "nvarchar(2)", maxLength: 2, nullable: true),
WorkshopId = table.Column<long>(type: "bigint", nullable: false),
ClassificationSchemeId = table.Column<long>(type: "bigint", nullable: false),
CreationDate = table.Column<DateTime>(type: "datetime2", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_ClassificationGroups", x => x.id);
table.ForeignKey(
name: "FK_ClassificationGroups_ClassificationSchemes_ClassificationSchemeId",
column: x => x.ClassificationSchemeId,
principalTable: "ClassificationSchemes",
principalColumn: "id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "ClassificationRialCoefficients",
columns: table => new
{
id = table.Column<long>(type: "bigint", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
ClassificationSchemeId = table.Column<long>(type: "bigint", nullable: false),
RialCoefficient = table.Column<double>(type: "float", nullable: false),
StartDate = table.Column<DateTime>(type: "datetime2", nullable: false),
EndDate = table.Column<DateTime>(type: "datetime2", nullable: false),
Year = table.Column<int>(type: "int", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_ClassificationRialCoefficients", x => x.id);
table.ForeignKey(
name: "FK_ClassificationRialCoefficients_ClassificationSchemes_ClassificationSchemeId",
column: x => x.ClassificationSchemeId,
principalTable: "ClassificationSchemes",
principalColumn: "id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "ClassificationEmployee",
columns: table => new
{
id = table.Column<long>(type: "bigint", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
WorkshopId = table.Column<long>(type: "bigint", nullable: false),
EmployeeId = table.Column<long>(type: "bigint", nullable: false),
ClassificationSchemeId = table.Column<long>(type: "bigint", nullable: false),
ClassificationGroupId = table.Column<long>(type: "bigint", nullable: false),
ClassificationGroupJobId = table.Column<long>(type: "bigint", nullable: false),
StartGroupDate = table.Column<DateTime>(type: "datetime2", nullable: true),
EndGroupDate = table.Column<DateTime>(type: "datetime2", nullable: true),
CreationDate = table.Column<DateTime>(type: "datetime2", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_ClassificationEmployee", x => x.id);
table.ForeignKey(
name: "FK_ClassificationEmployee_ClassificationGroups_ClassificationGroupId",
column: x => x.ClassificationGroupId,
principalTable: "ClassificationGroups",
principalColumn: "id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "ClassificationGroupJobs",
columns: table => new
{
id = table.Column<long>(type: "bigint", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
JobId = table.Column<long>(type: "bigint", nullable: false),
JobName = table.Column<string>(type: "nvarchar(255)", maxLength: 255, nullable: true),
JobCode = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: true),
ClassificationGroupId = table.Column<long>(type: "bigint", nullable: false),
GroupNo = table.Column<string>(type: "nvarchar(2)", maxLength: 2, nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_ClassificationGroupJobs", x => x.id);
table.ForeignKey(
name: "FK_ClassificationGroupJobs_ClassificationGroups_ClassificationGroupId",
column: x => x.ClassificationGroupId,
principalTable: "ClassificationGroups",
principalColumn: "id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "ClassificationGroupSalaries",
columns: table => new
{
id = table.Column<long>(type: "bigint", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
ClassificationGroupId = table.Column<long>(type: "bigint", nullable: false),
GroupNo = table.Column<string>(type: "nvarchar(2)", maxLength: 2, nullable: true),
GroupSalary = table.Column<double>(type: "float", nullable: false),
StartDate = table.Column<DateTime>(type: "datetime2", nullable: false),
EndDate = table.Column<DateTime>(type: "datetime2", nullable: false),
Year = table.Column<int>(type: "int", nullable: false),
CreationDate = table.Column<DateTime>(type: "datetime2", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_ClassificationGroupSalaries", x => x.id);
table.ForeignKey(
name: "FK_ClassificationGroupSalaries_ClassificationGroups_ClassificationGroupId",
column: x => x.ClassificationGroupId,
principalTable: "ClassificationGroups",
principalColumn: "id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateIndex(
name: "IX_ClassificationEmployee_ClassificationGroupId",
table: "ClassificationEmployee",
column: "ClassificationGroupId");
migrationBuilder.CreateIndex(
name: "IX_ClassificationGroupJobs_ClassificationGroupId",
table: "ClassificationGroupJobs",
column: "ClassificationGroupId");
migrationBuilder.CreateIndex(
name: "IX_ClassificationGroups_ClassificationSchemeId",
table: "ClassificationGroups",
column: "ClassificationSchemeId");
migrationBuilder.CreateIndex(
name: "IX_ClassificationGroupSalaries_ClassificationGroupId",
table: "ClassificationGroupSalaries",
column: "ClassificationGroupId");
migrationBuilder.CreateIndex(
name: "IX_ClassificationRialCoefficients_ClassificationSchemeId",
table: "ClassificationRialCoefficients",
column: "ClassificationSchemeId");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "ClassificationEmployee");
migrationBuilder.DropTable(
name: "ClassificationGroupJobs");
migrationBuilder.DropTable(
name: "ClassificationGroupSalaries");
migrationBuilder.DropTable(
name: "ClassificationRialCoefficients");
migrationBuilder.DropTable(
name: "ClassificationGroups");
migrationBuilder.DropTable(
name: "ClassificationSchemes");
}
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,29 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace CompanyManagment.EFCore.Migrations
{
/// <inheritdoc />
public partial class newPropToWorkshop : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<bool>(
name: "IsClassificationSchemeCompleted",
table: "Workshops",
type: "bit",
nullable: false,
defaultValue: false);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "IsClassificationSchemeCompleted",
table: "Workshops");
}
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,29 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace CompanyManagment.EFCore.Migrations
{
/// <inheritdoc />
public partial class SchemeIdAdded : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<long>(
name: "SchemeId",
table: "ClassificationGroupSalaries",
type: "bigint",
nullable: false,
defaultValue: 0L);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "SchemeId",
table: "ClassificationGroupSalaries");
}
}
}

View File

@@ -443,6 +443,217 @@ namespace CompanyManagment.EFCore.Migrations
b.ToTable("Checkouts", (string)null); b.ToTable("Checkouts", (string)null);
}); });
modelBuilder.Entity("Company.Domain.ClassificationSchemeAgg.ClassificationEmployee", b =>
{
b.Property<long>("id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<long>("id"));
b.Property<long>("ClassificationGroupId")
.HasColumnType("bigint");
b.Property<long>("ClassificationGroupJobId")
.HasColumnType("bigint");
b.Property<long>("ClassificationSchemeId")
.HasColumnType("bigint");
b.Property<DateTime>("CreationDate")
.HasColumnType("datetime2");
b.Property<long>("EmployeeId")
.HasColumnType("bigint");
b.Property<DateTime?>("EndGroupDate")
.HasColumnType("datetime2");
b.Property<DateTime?>("StartGroupDate")
.HasColumnType("datetime2");
b.Property<long>("WorkshopId")
.HasColumnType("bigint");
b.HasKey("id");
b.HasIndex("ClassificationGroupId");
b.ToTable("ClassificationEmployee", (string)null);
});
modelBuilder.Entity("Company.Domain.ClassificationSchemeAgg.ClassificationGroup", b =>
{
b.Property<long>("id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<long>("id"));
b.Property<long>("ClassificationSchemeId")
.HasColumnType("bigint");
b.Property<DateTime>("CreationDate")
.HasColumnType("datetime2");
b.Property<string>("GroupNo")
.HasMaxLength(2)
.HasColumnType("nvarchar(2)");
b.Property<long>("WorkshopId")
.HasColumnType("bigint");
b.HasKey("id");
b.HasIndex("ClassificationSchemeId");
b.ToTable("ClassificationGroups", (string)null);
});
modelBuilder.Entity("Company.Domain.ClassificationSchemeAgg.ClassificationGroupJob", b =>
{
b.Property<long>("id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<long>("id"));
b.Property<long>("ClassificationGroupId")
.HasColumnType("bigint");
b.Property<string>("GroupNo")
.HasMaxLength(2)
.HasColumnType("nvarchar(2)");
b.Property<string>("JobCode")
.HasMaxLength(100)
.HasColumnType("nvarchar(100)");
b.Property<long>("JobId")
.HasColumnType("bigint");
b.Property<string>("JobName")
.HasMaxLength(255)
.HasColumnType("nvarchar(255)");
b.HasKey("id");
b.HasIndex("ClassificationGroupId");
b.ToTable("ClassificationGroupJobs", (string)null);
});
modelBuilder.Entity("Company.Domain.ClassificationSchemeAgg.ClassificationGroupSalary", b =>
{
b.Property<long>("id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<long>("id"));
b.Property<long>("ClassificationGroupId")
.HasColumnType("bigint");
b.Property<DateTime>("CreationDate")
.HasColumnType("datetime2");
b.Property<DateTime>("EndDate")
.HasColumnType("datetime2");
b.Property<string>("GroupNo")
.HasMaxLength(2)
.HasColumnType("nvarchar(2)");
b.Property<double>("GroupSalary")
.HasColumnType("float");
b.Property<long>("SchemeId")
.HasColumnType("bigint");
b.Property<DateTime>("StartDate")
.HasColumnType("datetime2");
b.Property<int>("Year")
.HasColumnType("int");
b.HasKey("id");
b.HasIndex("ClassificationGroupId");
b.ToTable("ClassificationGroupSalaries", (string)null);
});
modelBuilder.Entity("Company.Domain.ClassificationSchemeAgg.ClassificationRialCoefficient", b =>
{
b.Property<long>("id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<long>("id"));
b.Property<long>("ClassificationSchemeId")
.HasColumnType("bigint");
b.Property<DateTime>("EndDate")
.HasColumnType("datetime2");
b.Property<double>("RialCoefficient")
.HasColumnType("float");
b.Property<DateTime>("StartDate")
.HasColumnType("datetime2");
b.Property<int>("Year")
.HasColumnType("int");
b.HasKey("id");
b.HasIndex("ClassificationSchemeId");
b.ToTable("ClassificationRialCoefficients", (string)null);
});
modelBuilder.Entity("Company.Domain.ClassificationSchemeAgg.ClassificationScheme", b =>
{
b.Property<long>("id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<long>("id"));
b.Property<DateTime>("CreationDate")
.HasColumnType("datetime2");
b.Property<string>("DesignerFullName")
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.Property<string>("DesignerPhone")
.HasMaxLength(20)
.HasColumnType("nvarchar(20)");
b.Property<DateTime?>("EndSchemeDateGr")
.HasColumnType("datetime2");
b.Property<DateTime>("ExecutionDateGr")
.HasColumnType("datetime2");
b.Property<DateTime>("IncludingDateGr")
.HasColumnType("datetime2");
b.Property<string>("TypeOfCoefficient")
.IsRequired()
.HasMaxLength(30)
.HasColumnType("nvarchar(30)");
b.Property<long>("WorkshopId")
.HasColumnType("bigint");
b.HasKey("id");
b.ToTable("ClassificationSchemes", (string)null);
});
modelBuilder.Entity("Company.Domain.ClassifiedSalaryAgg.ClassifiedSalary", b => modelBuilder.Entity("Company.Domain.ClassifiedSalaryAgg.ClassifiedSalary", b =>
{ {
b.Property<long>("id") b.Property<long>("id")
@@ -5958,6 +6169,9 @@ namespace CompanyManagment.EFCore.Migrations
.HasMaxLength(10) .HasMaxLength(10)
.HasColumnType("nvarchar(10)"); .HasColumnType("nvarchar(10)");
b.Property<bool>("IsClassificationSchemeCompleted")
.HasColumnType("bit");
b.Property<bool>("IsClassified") b.Property<bool>("IsClassified")
.HasColumnType("bit"); .HasColumnType("bit");
@@ -6669,6 +6883,61 @@ namespace CompanyManagment.EFCore.Migrations
b.Navigation("Workshop"); b.Navigation("Workshop");
}); });
modelBuilder.Entity("Company.Domain.ClassificationSchemeAgg.ClassificationEmployee", b =>
{
b.HasOne("Company.Domain.ClassificationSchemeAgg.ClassificationGroup", "ClassificationGroup")
.WithMany("ClassificationEmployees")
.HasForeignKey("ClassificationGroupId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("ClassificationGroup");
});
modelBuilder.Entity("Company.Domain.ClassificationSchemeAgg.ClassificationGroup", b =>
{
b.HasOne("Company.Domain.ClassificationSchemeAgg.ClassificationScheme", "ClassificationScheme")
.WithMany("ClassificationGroups")
.HasForeignKey("ClassificationSchemeId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("ClassificationScheme");
});
modelBuilder.Entity("Company.Domain.ClassificationSchemeAgg.ClassificationGroupJob", b =>
{
b.HasOne("Company.Domain.ClassificationSchemeAgg.ClassificationGroup", "ClassificationGroup")
.WithMany("ClassificationGroupJobs")
.HasForeignKey("ClassificationGroupId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("ClassificationGroup");
});
modelBuilder.Entity("Company.Domain.ClassificationSchemeAgg.ClassificationGroupSalary", b =>
{
b.HasOne("Company.Domain.ClassificationSchemeAgg.ClassificationGroup", "ClassificationGroup")
.WithMany("ClassificationGroupSalaries")
.HasForeignKey("ClassificationGroupId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("ClassificationGroup");
});
modelBuilder.Entity("Company.Domain.ClassificationSchemeAgg.ClassificationRialCoefficient", b =>
{
b.HasOne("Company.Domain.ClassificationSchemeAgg.ClassificationScheme", "ClassificationScheme")
.WithMany("ClassificationRialCoefficients")
.HasForeignKey("ClassificationSchemeId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("ClassificationScheme");
});
modelBuilder.Entity("Company.Domain.ClientEmployeeWorkshopAgg.ClientEmployeeWorkshop", b => modelBuilder.Entity("Company.Domain.ClientEmployeeWorkshopAgg.ClientEmployeeWorkshop", b =>
{ {
b.HasOne("Company.Domain.EmployeeAgg.Employee", "Employee") b.HasOne("Company.Domain.EmployeeAgg.Employee", "Employee")
@@ -9932,6 +10201,22 @@ namespace CompanyManagment.EFCore.Migrations
b.Navigation("PetitionsList"); b.Navigation("PetitionsList");
}); });
modelBuilder.Entity("Company.Domain.ClassificationSchemeAgg.ClassificationGroup", b =>
{
b.Navigation("ClassificationEmployees");
b.Navigation("ClassificationGroupJobs");
b.Navigation("ClassificationGroupSalaries");
});
modelBuilder.Entity("Company.Domain.ClassificationSchemeAgg.ClassificationScheme", b =>
{
b.Navigation("ClassificationGroups");
b.Navigation("ClassificationRialCoefficients");
});
modelBuilder.Entity("Company.Domain.ContarctingPartyAgg.PersonalContractingParty", b => modelBuilder.Entity("Company.Domain.ContarctingPartyAgg.PersonalContractingParty", b =>
{ {
b.Navigation("ContractingPartyBankAccounts"); b.Navigation("ContractingPartyBankAccounts");

View File

@@ -0,0 +1,192 @@
using System.Collections.Generic;
using System.Linq;
using System;
using System.Threading.Tasks;
using _0_Framework.Application;
using _0_Framework.InfraStructure;
using Company.Domain.ClassificationSchemeAgg;
using CompanyManagment.App.Contracts.ClassificationScheme;
using CompanyManagment.App.Contracts.Workshop;
using Microsoft.EntityFrameworkCore;
namespace CompanyManagment.EFCore.Repository;
public class ClassificationEmployeeRepository : RepositoryBase<long, ClassificationEmployee>, IClassificationEmployeeRepository
{
private readonly CompanyContext _context;
public ClassificationEmployeeRepository(CompanyContext context) : base(context)
{
_context = context;
}
public async Task<List<EmployeeInfoList>> GetEmployeeListData(long schemeId)
{
var leftDate = new DateTime(2121, 3, 21);
var workshopId = _context.ClassificationSchemes.FirstOrDefault(x => x.id == schemeId)!.WorkshopId;
var join = new List<PersonnelInfoViewModel>();
var contractLeftWork =await _context.LeftWorkList.Include(em=>em.Employee).Select(x => new PersonnelInfoViewModel()
{
WorkshopId = x.WorkshopId,
EmployeeId = x.EmployeeId,
FullName = x.Employee.FullName,
PersonnelCode = 0,
ContractPerson = true,
ContractLeft = x.LeftWorkDate != leftDate,
StartWork = x.StartWorkDate,
LeftWork = x.LeftWorkDate,
LastStartInsuranceWork = "-",
LastLeftInsuranceWork = "-",
}).Where(x => x.WorkshopId == workshopId)
.OrderByDescending(x => x.StartWork)
.ToListAsync();
contractLeftWork = contractLeftWork.Select(x => new PersonnelInfoViewModel()
{
WorkshopId = x.WorkshopId,
EmployeeId = x.EmployeeId,
FullName = x.FullName,
ContractPerson = true,
ContractLeft = x.ContractLeft,
LastStartContractWork = x.StartWork.ToFarsi(),
LastLeftContractWork = x.LeftWork != leftDate ? x.LeftWork.ToFarsi() : "-",
StartWork = x.StartWork,
LeftWork = x.LeftWork,
LastStartInsuranceWork = x.LastStartInsuranceWork,
LastLeftInsuranceWork = x.LastLeftInsuranceWork,
}).ToList();
var insuranceLeftWork =await _context.LeftWorkInsuranceList.Include(em=> em.Employee).Select(x => new PersonnelInfoViewModel()
{
WorkshopId = x.WorkshopId,
EmployeeId = x.EmployeeId,
FullName = x.Employee.FullName,
PersonnelCode = 0,
InsurancePerson = true,
InsuranceLeft = x.LeftWorkDate != null,
StartWork = x.StartWorkDate,
LastStartInsuranceWork = x.StartWorkDate.ToFarsi(),
LastLeftInsuranceWork = x.LeftWorkDate != null ? x.LeftWorkDate.ToFarsi() : "-",
}).Where(x => x.WorkshopId == workshopId)
.OrderByDescending(x => x.StartWork).ToListAsync();
insuranceLeftWork = insuranceLeftWork.Select(x => new PersonnelInfoViewModel()
{
WorkshopId = x.WorkshopId,
EmployeeId = x.EmployeeId,
FullName = x.FullName,
PersonnelCode = _context.PersonnelCodeSet.Any(p => p.EmployeeId == x.EmployeeId && p.WorkshopId == x.WorkshopId) ?
_context.PersonnelCodeSet.FirstOrDefault(p => p.EmployeeId == x.EmployeeId && p.WorkshopId == x.WorkshopId)!.PersonnelCode : 0,
InsurancePerson = true,
InsuranceLeft = x.InsuranceLeft,
StartWork = x.StartWork,
LastStartInsuranceWork = x.LastStartInsuranceWork,
LastLeftInsuranceWork = x.LastLeftInsuranceWork,
}).ToList();
var joinEqualList = contractLeftWork.Join(insuranceLeftWork,
x => x.EmployeeId,
c => c.EmployeeId,
(first, second) => new PersonnelInfoViewModel
{
EmployeeId = first.EmployeeId,
ContractPerson = first.ContractPerson,
ContractLeft = first.ContractLeft,
InsurancePerson = second.InsurancePerson,
InsuranceLeft = second.InsuranceLeft,
LastStartContractWork = first.LastStartContractWork,
LastLeftContractWork = first.LastLeftContractWork,
StartWork = first.StartWork,
LeftWork = first.LeftWork,
LastStartInsuranceWork = second.LastStartInsuranceWork,
LastLeftInsuranceWork = second.LastLeftInsuranceWork,
}).ToList();
if (contractLeftWork.Any() && !insuranceLeftWork.Any())
{
join = contractLeftWork.ToList();
}
else if (!contractLeftWork.Any() && insuranceLeftWork.Any())
{
join = insuranceLeftWork.ToList();
}
else if (contractLeftWork.Any() && insuranceLeftWork.Any())
{
join = contractLeftWork.Concat(insuranceLeftWork).ToList();
}
//if (joinEqualList.Count == 0)
// return new List<EmployeeInfoList>();
//join = join.GroupBy(x => x.EmployeeId).Select(d => d.First()).ToList();
var employeeWhitGroup = _context.ClassificationEmployees.Include(g=>g.ClassificationGroup)
.Where(x => x.ClassificationSchemeId == schemeId);
var finalList = join.Select(x =>
{
var hasGroup = employeeWhitGroup.Any(em => em.EmployeeId == x.EmployeeId);
var groupNo = "";
if (hasGroup)
{
var group = employeeWhitGroup.Where(g => g.EmployeeId == x.EmployeeId)
.Select(n => n.ClassificationGroup.GroupNo).ToList();
if (group.Count > 0)
groupNo = string.Join(" - ", group);
}
var contractPerson = joinEqualList.Any(c => c.EmployeeId == x.EmployeeId) ? joinEqualList.FirstOrDefault(c => c.EmployeeId == x.EmployeeId)!.ContractPerson : x.ContractPerson;
var insurancePerson = joinEqualList.Any(c => c.EmployeeId == x.EmployeeId) ? joinEqualList.FirstOrDefault(c => c.EmployeeId == x.EmployeeId)!.InsurancePerson : x.InsurancePerson;
var contractLeft = joinEqualList.Any(c => c.EmployeeId == x.EmployeeId) ? joinEqualList.FirstOrDefault(c => c.EmployeeId == x.EmployeeId)!.ContractLeft : x.ContractLeft;
var insuranceLeft = joinEqualList.Any(c => c.EmployeeId == x.EmployeeId) ? joinEqualList.FirstOrDefault(c => c.EmployeeId == x.EmployeeId)!.InsuranceLeft : x.InsuranceLeft;
var lastStartInsuranceWork = joinEqualList.Any(c => c.EmployeeId == x.EmployeeId) ? joinEqualList.FirstOrDefault(c => c.EmployeeId == x.EmployeeId)!.LastStartInsuranceWork : x.LastStartInsuranceWork;
var lastLeftInsuranceWork = joinEqualList.Any(c => c.EmployeeId == x.EmployeeId) ? joinEqualList.FirstOrDefault(c => c.EmployeeId == x.EmployeeId)!.LastLeftInsuranceWork : x.LastLeftInsuranceWork;
return new EmployeeInfoList
{
HasGroup = hasGroup,
GroupNo = groupNo,
EmployeeId = x.EmployeeId,
FullName = x.FullName,
ContractPerson = contractPerson,
InsurancePerson = insurancePerson,
ContractLeft = contractLeft,
InsuranceLeft = insuranceLeft,
Black = ((contractPerson && insurancePerson && insuranceLeft && contractLeft) || (contractPerson && !insurancePerson && contractLeft) || (insurancePerson && !contractPerson && insuranceLeft)) ? true : false,
LastStartContractWork = x.LastStartContractWork,
LastLeftContractWork = x.LastLeftContractWork,
LastStartInsuranceWork = lastStartInsuranceWork,
LastLeftInsuranceWork = lastLeftInsuranceWork,
};
}).ToList();
var final = finalList.GroupBy(x => x.EmployeeId).Select(x => x.First()).ToList();
return final;
}
/// <summary>
/// دریافت اطلاعات عضویتی پرسنل در گروه
/// </summary>
/// <param name="employeeId"></param>
/// <returns></returns>
public async Task<ClassificationEmployee> GetEmployeeMemberizeData(long employeeId)
{
return await _context.ClassificationEmployees.FirstOrDefaultAsync(x => x.EmployeeId == employeeId);
}
}

View File

@@ -0,0 +1,167 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using _0_Framework.InfraStructure;
using Company.Domain.ClassificationSchemeAgg;
using CompanyManagment.App.Contracts.ClassificationScheme;
using Microsoft.EntityFrameworkCore;
namespace CompanyManagment.EFCore.Repository;
public class ClassificationGroupRepository : RepositoryBase<long, ClassificationGroup>, IClassificationGroupRepository
{
private readonly CompanyContext _context;
public ClassificationGroupRepository(CompanyContext context) : base(context)
{
_context = context;
}
/// <summary>
/// دریافت گروه های طرح
/// </summary>
/// <param name="schemeId"></param>
/// <returns></returns>
public async Task<List<ClassificationGroupList>> GetGroups(long schemeId)
{
return await _context.ClassificationGroups
.Where(x => x.ClassificationSchemeId == schemeId)
.Select(x=> new ClassificationGroupList
{
GroupId = x.id,
GroupNo = x.GroupNo,
GroupNoInt = Convert.ToInt32(x.GroupNo)
}).OrderBy(x=>x.GroupNoInt).ToListAsync();
}
/// <summary>
/// دریافت گروه ها و مشاغلشان برای تب تعیین مشاغل
/// </summary>
/// <param name="schemeId"></param>
/// <returns></returns>
public async Task<List<ClassificationGroupAndJobModel>> GetGroupAndJobs(long schemeId)
{
return await _context.ClassificationGroups.Where(x => x.ClassificationSchemeId == schemeId)
.Include(x => x.ClassificationGroupJobs).Select(x => new ClassificationGroupAndJobModel
{
GroupId = x.id,
GroupNo = x.GroupNo,
GroupNoInt = Convert.ToInt32(x.GroupNo),
WorkshopId = x.WorkshopId,
ClassificationSchemeId = x.ClassificationSchemeId,
EditClassificationGroupJob = x.ClassificationGroupJobs.Select(jobs => new EditClassificationGroupJob()
{
Id = jobs.id,
JobId = jobs.JobId,
JobName = jobs.JobName,
JobCode = jobs.JobCode,
ClassificationGroupId = jobs.ClassificationGroupId,
GroupNo = jobs.GroupNo,
}).ToList(),
}).OrderBy(x=>x.GroupNoInt).ToListAsync();
}
/// <summary>
/// دریافت مشاغل گروه توسط آی دی گروه
/// </summary>
/// <param name="groupId"></param>
/// <returns></returns>
public async Task<List<EditClassificationGroupJob>> GetGroupJobs(long groupId)
{
return await _context.ClassificationGroupJobs
.Where(x => x.ClassificationGroupId == groupId).Select(jobs => new EditClassificationGroupJob()
{
Id = jobs.id,
JobId = jobs.JobId,
JobName = jobs.JobName,
JobCode = jobs.JobCode,
ClassificationGroupId = jobs.ClassificationGroupId,
GroupNo = jobs.GroupNo,
}).ToListAsync();
}
/// <summary>
/// چک میکند که آی پرسنلی وجود دارد که این شغل به او نسبت داده شده
/// </summary>
/// <param name="id"></param>
/// <param name="groupId"></param>
/// <returns></returns>
public async Task<bool> CheckEmployeeHasThisJob(long id, long groupId)
{
return await _context.ClassificationEmployees.AnyAsync(x =>
x.ClassificationGroupJobId == id && x.ClassificationGroupId == groupId);
}
/// <summary>
/// ایجاد مشاغل
/// </summary>
/// <param name="createClassificationGroupJob"></param>
/// <param name="deleteJobList"></param>
/// <returns></returns>
public async Task<bool> CreateJobs(List<ClassificationGroupJob> createClassificationGroupJob, List<long> deleteJobList)
{
if (createClassificationGroupJob.Count > 0)
{
await _context.ClassificationGroupJobs.AddRangeAsync(createClassificationGroupJob);
await _context.SaveChangesAsync();
}
if (deleteJobList.Count > 0)
{
var deleteItems = _context.ClassificationGroupJobs.Where(x => deleteJobList.Contains(x.id));
_context.ClassificationGroupJobs.RemoveRange(deleteItems);
await _context.SaveChangesAsync();
}
return true;
}
/// <summary>
/// در یافت اطلاعات گروه برای لود مودال ایجاد دستمزد های
/// </summary>
/// <returns></returns>
public async Task<SalaryAndRialCoefficientModel> GetGroupToCreateSalariesModal(long schemeId)
{
var result = new SalaryAndRialCoefficientModel();
var scheme =await _context.ClassificationSchemes.FirstOrDefaultAsync(x => x.id == schemeId);
var groups =await _context.ClassificationGroups.Where(x => x.ClassificationSchemeId == schemeId).ToListAsync();
if (scheme != null)
{
result.TypeOfCoefficient = scheme.TypeOfCoefficient;
result.SchemeId = schemeId;
result.SalariesAndCoefficientList = groups.Select(x => new EditClassificationGroupSalaryAndRialCoefficient
{
ClassificationGroupId = x.id,
GroupNo = x.GroupNo,
}).ToList();
}
return result;
}
/// <summary>
/// ایجاد گروه های بیست گانه
/// </summary>
/// <param name="groupList"></param>
/// <returns></returns>
public async Task CreateGroups(List<ClassificationGroup> groupList)
{
await _context.AddRangeAsync(groupList);
await _context.SaveChangesAsync();
}
}

View File

@@ -0,0 +1,143 @@
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using _0_Framework.Application;
using _0_Framework.Application.Enums;
using _0_Framework.InfraStructure;
using Company.Domain.ClassificationSchemeAgg;
using CompanyManagment.App.Contracts.ClassificationScheme;
using Microsoft.EntityFrameworkCore;
namespace CompanyManagment.EFCore.Repository;
public class ClassificationGroupSalariesRepository : RepositoryBase<long, ClassificationGroupSalary>, IClassificationGroupSalariesRepository
{
private readonly CompanyContext _context;
public ClassificationGroupSalariesRepository(CompanyContext context) : base(context)
{
_context = context;
}
public async Task CreateSalaries(List<ClassificationGroupSalary> createClassificationGroupSalary)
{
if (createClassificationGroupSalary.Count > 0)
{
await _context.ClassificationGroupSalaries.AddRangeAsync(createClassificationGroupSalary);
await _context.SaveChangesAsync();
}
}
/// <summary>
/// دریافت دستمزدها و ضریب ریالی برای مودال ویرایش
/// </summary>
/// <param name="schemeId"></param>
/// <param name="startDate"></param>
/// <param name="endDate"></param>
/// <returns></returns>
public async Task<SalaryAndRialCoefficientModel> GetEditSalariesData(long schemeId, string startDate, string endDate)
{
var salaryAndRialCoefficientModel = new SalaryAndRialCoefficientModel();
try
{
var scheme = _context.ClassificationSchemes.FirstOrDefaultAsync(x => x.id == schemeId).GetAwaiter().GetResult();
var startDatGr = startDate.ToGeorgian();
var rialCoEfficient = await _context.ClassificationRialCoefficients
.FirstOrDefaultAsync(x => x.ClassificationSchemeId == schemeId && x.StartDate == startDatGr);
salaryAndRialCoefficientModel.SchemeId = schemeId;
salaryAndRialCoefficientModel.StartDateFa = startDate;
salaryAndRialCoefficientModel.EndDateFa = endDate;
salaryAndRialCoefficientModel.TypeOfCoefficient = scheme.TypeOfCoefficient;
if (rialCoEfficient == null)
{
salaryAndRialCoefficientModel.RialCoefficient = 0;
salaryAndRialCoefficientModel.CoefficientId = 0;
}
else
{
salaryAndRialCoefficientModel.RialCoefficient = scheme.TypeOfCoefficient == TypeOfCoefficient.RialCoefficient ? rialCoEfficient.RialCoefficient : 0;
salaryAndRialCoefficientModel.CoefficientId = scheme.TypeOfCoefficient == TypeOfCoefficient.RialCoefficient ? rialCoEfficient.id : 0;
}
salaryAndRialCoefficientModel.SalariesAndCoefficientList = _context.ClassificationGroupSalaries.Where(x => x.SchemeId == schemeId && x.StartDate == startDatGr).Select(x => new EditClassificationGroupSalaryAndRialCoefficient
{
Id = x.id,
ClassificationGroupId = x.ClassificationGroupId,
GroupNo = x.GroupNo,
GroupSalaryStr = x.GroupSalary.ToMoney(),
GroupSalary = x.GroupSalary
})
.ToList();
}
catch (System.Exception)
{
return new SalaryAndRialCoefficientModel();
}
return salaryAndRialCoefficientModel;
}
public async Task<SalaryAndRialCoefficientTab> GetSalariesTabData(long schemeId)
{
var scheme = await _context.ClassificationSchemes.Include(xc=>xc.ClassificationRialCoefficients)
.Include(xg => xg.ClassificationGroups)
.ThenInclude(xs => xs.ClassificationGroupSalaries)
.FirstOrDefaultAsync(x => x.id == schemeId);
if (scheme == null)
return null;
// جمع‌آوری همه‌ی حقوق‌ها از تمام گروه‌ها
var allSalaries = scheme.ClassificationGroups
.SelectMany(g => g.ClassificationGroupSalaries)
.ToList();
// اگر هیچ حقوقی وجود ندارد
if (!allSalaries.Any())
{
return new SalaryAndRialCoefficientTab
{
SchemeId = scheme.id,
HasAnySalaries = false,
SalaryAndRialCoefficientTabDataList = new List<SalaryAndRialCoefficientTabDataList>()
};
}
// گروه‌بندی بر اساس StartDate و EndDate برای حذف موارد تکراری
var distinctPeriods = allSalaries
.GroupBy(s => new { s.StartDate, s.EndDate })
.Select(g => g.First()) // فقط یکی از هر بازه تاریخ
.OrderByDescending(x => x.StartDate)
.ToList();
//تبدیل به مدل خروجی
var dataList = distinctPeriods
.Select(s => new SalaryAndRialCoefficientTabDataList
{
RialCoefficientStr = $"{scheme.ClassificationRialCoefficients.FirstOrDefault(x=>x.StartDate.Date == s.StartDate.Date && x.EndDate.Date == s.EndDate.Date)?.RialCoefficient}",
StartDateFa = s.StartDate.ToFarsi(),
EndDateFa = s.EndDate.ToFarsi(),
Year = s.Year// یا هر روش سال شمسی که داری
})
.ToList();
var result = new SalaryAndRialCoefficientTab
{
SchemeId = scheme.id,
HasAnySalaries = allSalaries.Any(),
SalaryAndRialCoefficientTabDataList = dataList
};
return result;
}
}

View File

@@ -0,0 +1,18 @@
using System;
using System.Collections.Generic;
using System.Linq.Expressions;
using System.Threading.Tasks;
using _0_Framework.InfraStructure;
using Company.Domain.ClassificationSchemeAgg;
using Microsoft.EntityFrameworkCore;
namespace CompanyManagment.EFCore.Repository;
public class ClassificationRialCoefficientRepository : RepositoryBase<long, ClassificationRialCoefficient>, IClassificationRialCoefficientRepository
{
private readonly CompanyContext _context;
public ClassificationRialCoefficientRepository(CompanyContext context) : base(context)
{
_context = context;
}
}

View File

@@ -0,0 +1,542 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using _0_Framework.Application;
using _0_Framework.InfraStructure;
using Company.Domain.ClassificationSchemeAgg;
using CompanyManagment.App.Contracts.ClassificationScheme;
using CompanyManagment.App.Contracts.LeftWork;
using CompanyManagment.App.Contracts.YearlySalary;
using Microsoft.EntityFrameworkCore;
using PersianTools.Core;
namespace CompanyManagment.EFCore.Repository;
public class ClassificationSchemeRepository :RepositoryBase<long, ClassificationScheme>, IClassificationSchemeRepository
{
private readonly CompanyContext _context;
public ClassificationSchemeRepository(CompanyContext context) : base(context)
{
_context = context;
}
public async Task<ClassificationSchemePartialModel> ClassificationSchemePartialModel(long workshopId)
{
var hasScheme =await _context.ClassificationSchemes.AnyAsync(x => x.WorkshopId == workshopId);
if (!hasScheme)
return new ClassificationSchemePartialModel()
{
HasScheme = false,
};
var schemeList = _context.ClassificationSchemes.Where(x => x.WorkshopId == workshopId).Select(x =>
new EditClassificationScheme()
{
Id = x.id,
WorkshopId = x.WorkshopId,
IncludingDateGr = x.IncludingDateGr,
ExecutionDateGr = x.ExecutionDateGr,
EndSchemeDateGr = x.EndSchemeDateGr,
IncludingDateFa = x.IncludingDateGr.ToFarsi(),
ExecutionDateFa = x.ExecutionDateGr.ToFarsi(),
DesignerFullName = x.DesignerFullName,
DesignerPhone = x.DesignerPhone,
TypeOfCoefficient = x.TypeOfCoefficient
}).ToListAsync();
return new ClassificationSchemePartialModel()
{
HasScheme = true,
WorkshopId = workshopId,
ClassificationSchemesList = schemeList.GetAwaiter().GetResult()
};
}
/// <summary>
/// دریافت اطلاعات طرح برای ویرایش
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
public Task<EditClassificationScheme> GetClassificationScheme(long id)
{
return _context.ClassificationSchemes.Select(x =>
new EditClassificationScheme()
{
Id = x.id,
WorkshopId = x.WorkshopId,
IncludingDateGr = x.IncludingDateGr,
ExecutionDateGr = x.ExecutionDateGr,
EndSchemeDateGr = x.EndSchemeDateGr,
IncludingDateFa = x.IncludingDateGr.ToFarsi(),
ExecutionDateFa = x.ExecutionDateGr.ToFarsi(),
DesignerFullName = x.DesignerFullName,
DesignerPhone = x.DesignerPhone,
TypeOfCoefficient = x.TypeOfCoefficient
}).FirstOrDefaultAsync(x => x.Id == id);
}
/// <summary>
/// متد محاسبه پایه سنوات برا افراد تک گروه
/// </summary>
/// <param name="schemeStart">تاریخ شروع طرح</param>
/// <param name="schemeEnd">تاریخ پاین طرح، اجباری نیست</param>
/// <param name="contractStart">تاریخ شروع قراداد</param>
/// <param name="contractEnd">تاریخ پایان قراداد</param>
/// <param name="groupNo">شماره گروه</param>
/// <param name="employeeId">آی دی پرسنل</param>
/// <param name="workshopId">آی دی کارگاه</param>
/// <returns></returns>
public async Task<BaseYearDataViewModel> BaseYearComputeOneGroup(DateTime schemeStart, DateTime? schemeEnd,
DateTime contractStart, DateTime contractEnd, string groupNo, long employeeId, long workshopId)
{
//خروجی متد
var baseYearResult = new BaseYearDataViewModel();
baseYearResult.WorkshopId = workshopId;
baseYearResult.EmployeeId = employeeId;
//لیست شروع بکار / ترک کار پرسنل
var leftWorkList = await _context.LeftWorkList
.Where(x => x.EmployeeId == employeeId && x.WorkshopId == workshopId).Select(x=> new LeftWorkViewModel
{
Id = x.id,
StartWorkDateGr = x.StartWorkDate,
StartWorkDate = x.StartWorkDate.ToFarsi(),
LeftWorkDateGr = x.LeftWorkDate,
HasLeft = x.HasLeft,
}).OrderBy(x=>x.StartWorkDateGr).ToListAsync();
//اولین شروع بکار
var firstStartWorkDate = leftWorkList.First().StartWorkDateGr;
var firstStartWork = leftWorkList.First().StartWorkDate;
//اگر شروع طرح بعد از اولین شروع بکار بود
if (schemeStart > firstStartWorkDate)
{
var leftWorkStart = leftWorkList.FirstOrDefault(x => x.StartWorkDateGr <= schemeStart && x.LeftWorkDateGr > schemeStart);
if (leftWorkStart != null)
{
//اگر تاریخ شروع طرح بین بازه اولین شروع بکار و ترک کار قرار گرفت
if (leftWorkStart.StartWorkDateGr == firstStartWorkDate)
{
var changedLeftwork = new LeftWorkViewModel()
{
Id = leftWorkStart.Id,
StartWorkDateGr = schemeStart,
StartWorkDate = schemeStart.ToFarsi(),
LeftWorkDateGr = leftWorkStart.LeftWorkDateGr,
HasLeft = leftWorkStart.HasLeft,
};
leftWorkList.Remove(leftWorkStart);
leftWorkList.Add(changedLeftwork);
firstStartWork = schemeStart.ToFarsi();
}
else //اگر تاریخ شروع طرح در بازه شروع به ترک کارهایی بعد از اولین قرارگرفت
{
//لیست شروع بکار/ ترک کارهایی که باید حذف شوند
var leftWorksToBeRemove = leftWorkList.Where(x => x.StartWorkDateGr < leftWorkStart.StartWorkDateGr)
.ToList();
foreach (var item in leftWorksToBeRemove.ToList())
{
leftWorkList.Remove(item);
}
var changedLeftwork = new LeftWorkViewModel()
{
Id = leftWorkStart.Id,
StartWorkDateGr = schemeStart,
StartWorkDate = schemeStart.ToFarsi(),
LeftWorkDateGr = leftWorkStart.LeftWorkDateGr,
HasLeft = leftWorkStart.HasLeft,
};
firstStartWork = schemeStart.ToFarsi();
leftWorkList.Remove(leftWorkStart);
leftWorkList.Add(changedLeftwork);
}
}
else //اگر شروع طرح در فاصله بین شروع بکار/ترک کارها بود
{
//لیست شروع بکار/ ترک کارهایی که باید حذف شوند
var leftWorksToBeRemove = leftWorkList.Where(x => x.StartWorkDateGr < schemeStart)
.ToList();
foreach (var item in leftWorksToBeRemove.ToList())
{
leftWorkList.Remove(item);
}
leftWorkList = leftWorkList.OrderBy(x => x.StartWorkDateGr).ToList();
firstStartWork = leftWorkList.First().StartWorkDate;
}
}
//مرتب سازی
leftWorkList = leftWorkList.OrderBy(x => x.StartWorkDateGr).ToList();
//مقادیر سالانه
var salary = await _context.YearlySalaries.OrderByDescending(x => x.EndDate).Include(x => x.YearlySalaryItemsList).ToListAsync();
//مزد سنوات طبقه بندی
var classifiedBaseYearList =await _context.ClassifiedSalaries.ToListAsync();
//آیا در حلقه کبیشه بودن چک شود
bool checkKabiseh = true;
var isKabiseh = false;
var EndOfYaerDate = new DateTime();
//لیست تاریخ هایی که پایه سنوات تعلق گرفته
var baseYearDateList = new List<DateTime>();
double baseYear = 0;
//اگر تاریخ پایان طرح خالی نبود
if (schemeEnd.HasValue)
{
//اگر تاریخ پایان طرخ از تاریخ پایان قرارداد کوچکتر بود
//در نتیجه تاریخ پاینه محاسبات همان پایان طرح است
if (schemeEnd.Value < contractEnd)
contractEnd = schemeEnd.Value;
}
//اگر فقط یک شروع بکار داشت
if (leftWorkList.Count < 2)
{
var leftWork = leftWorkList.First();
//اگر ترک کار کرده بود پایان چرخه تاریخ آخرین روز کاری اوست
var endComputeDate = leftWork.HasLeft && leftWork.LeftWorkDateGr <= contractEnd ? leftWork.LeftWorkDateGr.AddDays(-1) : contractEnd;
//شروع چرخه شروع بکار پرسنل
var startComputeDate = leftWork.StartWorkDateGr;
for (var current = startComputeDate; current <= endComputeDate; current = current.AddDays(1))
{
var currentChanges = new DateTime(current.Year, current.Month, current.Day);
if (checkKabiseh)
{
isKabiseh = ($"{current.ToFarsi()}").YearTotalDays() == 367 ? true : false;
string kabise = "";
if (isKabiseh)
kabise = "kabise";
var currentChangesPc = currentChanges.ToPersianDateTime();
EndOfYaerDate = isKabiseh ? ($"{currentChangesPc.AddDays(365)}").ToGeorgianDateTime() : ($"{currentChangesPc.AddDays(364)}").ToGeorgianDateTime();
Console.WriteLine($" start : {current.ToFarsi()} {kabise}");
}
checkKabiseh = false;
if (current == EndOfYaerDate)
{
var a = current.AddDays(1);
if (a <= endComputeDate)
{
checkKabiseh = true;
baseYearDateList.Add(a);
Console.WriteLine($" End : {a.ToFarsi()}");
}
}
}
}
else //اگر بیش از یک شروع بکار داشت
{
int max365 = 0;
int dayCounter = 0;
bool hasCute = false;
foreach (var leftWork in leftWorkList)
{
//اگر ترک کار کرده بود پایان چرخه تاریخ آخرین روز کاری اوست
var endComputeDate = leftWork.HasLeft && leftWork.LeftWorkDateGr <= contractEnd ? leftWork.LeftWorkDateGr.AddDays(-1) : contractEnd;
//شروع چرخه شروع بکار پرسنل
var startComputeDate = leftWork.StartWorkDateGr;
for (var current = startComputeDate; current <= endComputeDate; current = current.AddDays(1))
{
if (checkKabiseh && dayCounter == 0)
{
isKabiseh = ($"{current.ToFarsi()}").YearTotalDays() == 367 ? true : false;
string kabise = "";
if (isKabiseh)
kabise = "kabise";
max365 = isKabiseh ? 366 : 365;
Console.WriteLine($" start : {current.ToFarsi()} {kabise}");
}
dayCounter += 1;
checkKabiseh = false;
if (dayCounter == max365)
{
var a = !hasCute ? current.AddDays(1) : current;
if (a <= endComputeDate)
{
checkKabiseh = true;
baseYearDateList.Add(a);
Console.WriteLine($" End : {a.ToFarsi()}");
Console.WriteLine(dayCounter);
if (hasCute)
{
dayCounter = 1;
isKabiseh = ($"{current.ToFarsi()}").YearTotalDays() == 367 ? true : false;
max365 = isKabiseh ? 366 : 365;
string kabise = "";
if (isKabiseh)
kabise = "kabise";
Console.WriteLine($" start : {current.ToFarsi()} {kabise}");
}
else
{
dayCounter = 0;
}
hasCute = false;
}
else
{
hasCute = true;
max365 += 1;
}
}
}
}
}
double selectBase = 0;
var baseList = new List<(double baseYaer, DateTime start, DateTime end, string baseYearPay, DateTime baseYearPayGr, string year, bool hasStartWork, bool hasLeftWork)>();
if (baseYearDateList.Count > 0)
{
var firstBaseYearDate = baseYearDateList.First();
var res = MonthByMonthList(firstBaseYearDate, contractEnd);
var firstbasicSalari =
salary.FirstOrDefault(x => x.StartDate <= firstBaseYearDate && x.EndDate >= firstBaseYearDate);
var firstClassifiedBaseYear = classifiedBaseYearList.FirstOrDefault(x => x.StartDate <= firstBaseYearDate && x.EndDate >= firstBaseYearDate);
//پایه سنوات سال جاری
var firstBasicObject = Tools.GetDynamicDouble(firstClassifiedBaseYear, $"Group{groupNo}");
double firstBasic = firstBasicObject != null ? firstBasicObject.Value : 0;
var firstfixFeePercentage = firstbasicSalari
.YearlySalaryItemsList.Where(x => x.ItemName == "درصد مزد ثابت").Select(x => x.ItemValue).FirstOrDefault();
// پایه سنوات سال قبل ضربدر درصد مزد ثابت تقسیم بر صد
//var beforePercntBaseYear = ((beforBaseStart * firstfixFeePercentage) / 100) + beforBaseStart;
//firstBasic += beforePercntBaseYear;
baseYear = firstBasic;
res = res.Where(x => x.start != firstBaseYearDate).OrderBy(x => x.start).ToList();
//var afterSalary = salary.Where(x => x.StartDate > firstbasicSalari.EndDate).ToList();
var first = (firstBasic, firstbasicSalari.StartDate, firstbasicSalari.EndDate, firstBaseYearDate.ToFarsi(), firstBaseYearDate, firstbasicSalari.Year, false, false);
baseList.Add(first);
Console.ForegroundColor = ConsoleColor.Green;
Console.WriteLine($"{1398} -> firstBasic : {firstBasic}");
var lastItem = res.Count > 1 ? res.Last() : res.FirstOrDefault();
foreach (var item in res)
{
var lastReecord = baseList.Last();
var year = Convert.ToInt32(item.start.ToFarsi().Substring(0, 4));
if (item.start > lastReecord.end && lastReecord.year != $"{year}")
{
var selectedSalary = salary.Where(x => x.Year == $"{year}").OrderBy(x => x.StartDate).ToList();
var currentSalary = selectedSalary.First();
if (selectedSalary.Count > 1)
{
currentSalary = selectedSalary.Last();
var firstSalery = selectedSalary.First();
if (baseYearDateList.Any(x => x >= firstSalery.StartDate && x <= firstSalery.EndDate) || lastItem.end < currentSalary.StartDate)
{
currentSalary = firstSalery;
}
}
var selectedBaseYear = classifiedBaseYearList.Where(x => x.Year == year).OrderBy(x => x.StartDate).ToList();
var currentBaseYear = selectedBaseYear.First();
if (selectedBaseYear.Count > 1)
{
currentBaseYear = selectedBaseYear.Last();
var firstBaseYear = selectedBaseYear.First();
if (baseYearDateList.Any(x => x >= firstBaseYear.StartDate && x <= firstBaseYear.EndDate) || lastItem.end < currentBaseYear.StartDate)
{
currentBaseYear = firstBaseYear;
}
}
//درصد مزد ثابت تاریخ جاری
var fixFeePercentage = currentSalary
.YearlySalaryItemsList.Where(x => x.ItemName == "درصد مزد ثابت").Select(x => x.ItemValue).FirstOrDefault();
// پایه سنوات سال قبل ضربدر درصد مزد ثابت تقسیم بر صد
var percntBaseYear = ((lastReecord.baseYaer * fixFeePercentage) / 100) + lastReecord.baseYaer;
Console.ForegroundColor = ConsoleColor.Green;
var currentBasicObject = Tools.GetDynamicDouble(currentBaseYear, $"Group{groupNo}");
double currentBasic = currentBasicObject != null ? currentBasicObject.Value : 0;
//var currentBasic = currentSalary
// .YearlySalaryItemsList.Where(x => x.ItemName == "پایه سنوات").Select(x => x.ItemValue).FirstOrDefault();
Console.WriteLine($"{year} -> [{lastReecord.baseYaer} * {fixFeePercentage} /100 + {lastReecord.baseYaer}] = {percntBaseYear} => [{currentBasic} + {percntBaseYear}] = {currentBasic + percntBaseYear} ");
if (!baseYearDateList.Any(x => x >= currentBaseYear.StartDate && x <= currentBaseYear.EndDate))
currentBasic = 0;
var currentBase = currentBasic + percntBaseYear;
baseYear = currentBase;
var baseYearPay = "-";
var baseYearPayDayGr = new DateTime();
if (baseYearDateList.Any(x => x >= currentBaseYear.StartDate && x <= currentBaseYear.EndDate))
{
var existBaseYear = baseYearDateList.FirstOrDefault(x => x >= currentBaseYear.StartDate && x <= currentBaseYear.EndDate);
baseYearPay = existBaseYear.ToFarsi();
baseYearPayDayGr = new DateTime(existBaseYear.Year, existBaseYear.Month, existBaseYear.Day, 17, 01, 01);
}
else
{
baseYearPayDayGr = new DateTime(item.start.Year, item.start.Month, item.start.Day, 17, 01, 01);
}
Console.ForegroundColor = ConsoleColor.DarkYellow;
Console.WriteLine(baseYearPay);
Console.ResetColor();
// var round = GetCurrectFirstDailyFee(currentBase, $"{year}");
var record = (baseYear, currentSalary.StartDate, currentSalary.EndDate, baseYearPay, baseYearPayDayGr, currentSalary.Year, false, false);
baseList.Add(record);
}
}
Console.ResetColor();
}
selectBase = baseList.Any() ? baseList.Last().baseYaer : 0;
//افزودن تاریخ های شروع بکار و ترک کار به لیست
foreach (var left in leftWorkList)
{
var startWork = (0, new DateTime(), new DateTime(), left.StartWorkDateGr.ToFarsi(), left.StartWorkDateGr, "-", true, false);
baseList.Add(startWork);
if (left.HasLeft)
{
var leftWork = (0, new DateTime(), new DateTime(), left.LeftWorkDateGr.ToFarsi(), left.LeftWorkDateGr, "-", false, true);
baseList.Add(leftWork);
}
}
baseYearResult = new BaseYearDataViewModel()
{
WorkshopId = workshopId,
EmployeeId = employeeId,
BaseYearResult = selectBase,
FirstWorkDayInLeftWork = firstStartWork,
BaseYearDataList = baseList.Select(x => new BaseYearDataList()
{
BaseYear = x.baseYaer,
StartDateGr = x.start,
EndDateGr = x.end,
BaseYearPayDay = x.baseYearPay,
BaseYearPayDayGr = x.baseYearPayGr,
StartDateFa = x.start.ToFarsi(),
EndDateFa = x.end.ToFarsi(),
Year = x.year,
HasLeftWork = x.hasLeftWork,
HasStartWork = x.hasStartWork,
}).OrderBy(x => x.BaseYearPayDayGr).ToList(),
};
Console.WriteLine("BaseYear : " + selectBase);
return baseYearResult;
}
/// <summary>
/// متد کمکی پایه سنوات
/// </summary>
/// <param name="startDate"></param>
/// <param name="endDate"></param>
/// <returns></returns>
private List<(DateTime start, DateTime end)> MonthByMonthList(DateTime startDate, DateTime endDate)
{
var start = startDate.ToFarsi();
var end = endDate.ToFarsi();
var ContractPreiodsList = new List<(DateTime start, DateTime end)>();
var syear = Convert.ToInt32(start.Substring(0, 4));
var smonth = Convert.ToInt32(start.Substring(5, 2));
var sday = Convert.ToInt32(start.Substring(8, 2));
var eyear = Convert.ToInt32(end.Substring(0, 4));
var emonth = Convert.ToInt32(end.Substring(5, 2));
var eday = Convert.ToInt32(end.Substring(8, 2));
var PersianStartDate = new PersianDateTime(syear, smonth, sday);
var PersianStartDateAddingMount = new PersianDateTime(syear, smonth, 1);
var PersianEndDate = new PersianDateTime(eyear, emonth, eday);
var totalmonth = ((PersianEndDate.Year - PersianStartDateAddingMount.Year) * 12) + (PersianEndDate.Month - PersianStartDateAddingMount.Month) + 1;
for (int i = 0; i < totalmonth; i++)
{
var currentEndDate = PersianStartDateAddingMount.AddMonths(1).AddDays(-1);
if (currentEndDate > PersianEndDate)
{
currentEndDate = PersianEndDate;
}
DateTime startPeriod = ($"{PersianStartDate}").ToGeorgianDateTime();
DateTime endPeriod = ($"{currentEndDate}").ToGeorgianDateTime();
var record = (startPeriod, endPeriod);
ContractPreiodsList.Add(record);
//Console.WriteLine($"Month {i + 1} : {PersianStartDate.ToString("yyyy-MM-dd")} to {currentEndDate.ToString("yyyy-MM-dd")}");
PersianStartDate = PersianStartDate.AddMonths(1);
PersianStartDate = new PersianDateTime(PersianStartDate.Year, PersianStartDate.Month, 1);
}
return ContractPreiodsList;
}
}

View File

@@ -1,5 +1,6 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Threading.Tasks;
using _0_Framework.InfraStructure; using _0_Framework.InfraStructure;
using Company.Domain.JobAgg; using Company.Domain.JobAgg;
using CompanyManagment.App.Contracts.Job; using CompanyManagment.App.Contracts.Job;
@@ -83,6 +84,32 @@ public class JobRepository: RepositoryBase<long, Job>, IJobRepository
} }
public async Task<List<JobViewModel>> JobSearchSelect(string searchtText)
{
if (!string.IsNullOrWhiteSpace(searchtText))
{
var query =_context.Jobs.Select(x => new JobViewModel
{
Id = x.id,
JobName = x.JobName,
JobCode = x.JobCode
});
query = query.Where(x => x.JobName.Contains(searchtText));
var jobViewModelList =await query.Take(100).Select(x => new JobViewModel
{
Id = x.Id,
JobName = x.JobName,
JobCode = x.JobCode
}).ToListAsync();
return jobViewModelList;
}
else
{
return new List<JobViewModel>();
}
}
// public async Task<List<JobViewModel>> GetJobListByText(string searchtText) // public async Task<List<JobViewModel>> GetJobListByText(string searchtText)
public List<JobViewModel> GetJobListByText(string searchtText) public List<JobViewModel> GetJobListByText(string searchtText)
{ {

View File

@@ -209,10 +209,12 @@ using Company.Domain.ContactUsAgg;
using CompanyManagment.App.Contracts.ContactUs; using CompanyManagment.App.Contracts.ContactUs;
using Company.Domain.EmployeeAuthorizeTempAgg; using Company.Domain.EmployeeAuthorizeTempAgg;
using Company.Domain.AdminMonthlyOverviewAgg; using Company.Domain.AdminMonthlyOverviewAgg;
using Company.Domain.ClassificationSchemeAgg;
using Company.Domain.ContractingPartyBankAccountsAgg; using Company.Domain.ContractingPartyBankAccountsAgg;
using Company.Domain.PaymentInstrumentAgg; using Company.Domain.PaymentInstrumentAgg;
using Company.Domain.PaymentTransactionAgg; using Company.Domain.PaymentTransactionAgg;
using CompanyManagment.App.Contracts.AdminMonthlyOverview; using CompanyManagment.App.Contracts.AdminMonthlyOverview;
using CompanyManagment.App.Contracts.ClassificationScheme;
using CompanyManagment.App.Contracts.ContractingPartyBankAccounts; using CompanyManagment.App.Contracts.ContractingPartyBankAccounts;
using CompanyManagment.App.Contracts.PaymentInstrument; using CompanyManagment.App.Contracts.PaymentInstrument;
using CompanyManagment.App.Contracts.PaymentTransaction; using CompanyManagment.App.Contracts.PaymentTransaction;
@@ -493,11 +495,25 @@ public class PersonalBootstrapper
services.AddTransient<IPlanPercentageRepository, PlanPercentageRepository>(); services.AddTransient<IPlanPercentageRepository, PlanPercentageRepository>();
services.AddTransient<IInstitutionPlanApplication, InstitutionPlanApplication>(); services.AddTransient<IInstitutionPlanApplication, InstitutionPlanApplication>();
//=========End Of Main====================================
//---File Project------------------------------------
services.AddTransient<IBoardApplication, BoardApplication>(); #region ClassificationScheme
services.AddTransient<IClassificationSchemeApplication, ClassificationSchemeApplication>();
services.AddTransient<IClassificationSchemeRepository, ClassificationSchemeRepository>();
services.AddTransient<IClassificationGroupRepository, ClassificationGroupRepository>();
services.AddTransient<IClassificationGroupSalariesRepository, ClassificationGroupSalariesRepository>();
services.AddTransient<IClassificationRialCoefficientRepository, ClassificationRialCoefficientRepository>();
services.AddTransient<IClassificationEmployeeRepository, ClassificationEmployeeRepository>();
#endregion
//=========End Of Main====================================
//---File Project------------------------------------
services.AddTransient<IBoardApplication, BoardApplication>();
services.AddTransient<IBoardRepository, BoardRepository>(); services.AddTransient<IBoardRepository, BoardRepository>();
services.AddTransient<IFileApplication, FileApplication>(); services.AddTransient<IFileApplication, FileApplication>();

View File

@@ -0,0 +1,242 @@
@page
@model ServiceHost.Areas.Admin.Pages.Company.Workshops.ClassificationSchemeModel
@{
string adminVersion = _0_Framework.Application.Version.AdminVersion;
<link href="~/admintheme/css/workshop-create.css?ver=@adminVersion" rel="stylesheet" />
<style>
body{
background-color: #fefefe;
background-image: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11 18c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm48 25c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm-43-7c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm63 31c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM34 90c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm56-76c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM12 86c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm28-65c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm23-11c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-6 60c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm29 22c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zM32 63c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm57-13c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-9-21c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM60 91c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM35 41c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM12 60c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2z' fill='%232ebfbf' fill-opacity='0.1' fill-rule='evenodd'/%3E%3C/svg%3E");
}
.hiddenTab{
display: none;
}
.errored {
animation: shake 300ms;
box-shadow: inset 0 0 2px #eb3434, 0 0 5px #eb3434 !important;
border: 1px solid #eb3434 !important;
}
.date-input {
text-align: center;
}
</style>
}
<div class="container">
<div class="row">
<div style="max-width: 88%;margin: 0 auto;">
<div class="col-xs-12" style="float: unset;">
<div class="handle-title">
<h3 id="titleHead">تنظیمات طرح طبقه بندی مشاغل <span style="color: #eb3434"> > @Model.WorkshopName</span></h3>
<a asp-page="./index" class="btn btn-rounded" type="button">
<span>بازگشت</span>
</a>
</div>
</div>
<div class="col-xs-12" style="float: unset;">
<div class="card card-pattern">
<ul class="nav nav-tabs nav-fill wizard" id="myTab" role="tablist">
<li class="li-wizard step active" id="schemeTab" data-url="/Admin/Company/Workshops/ClassificationScheme?handler=SchemeTab">
<a class="nav-link">
<div class="success-icon" id="success-icon1" style="display:none;">
<svg width="11" height="8" viewBox="0 0 11 8" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M1.25 4L4.14393 6.89393C4.20251 6.95251 4.29749 6.95251 4.35607 6.89393L10.25 1" stroke="#222222" stroke-width="1.2" />
</svg>
</div>
<span> لیست طرح </span>
</a>
</li>
<li class="li-wizard step" id="jobsTab" data-url="/Admin/Company/Workshops/ClassificationScheme?handler=GroupJobsTab">
<a class="nav-link">
<div class="success-icon" id="success-icon2" style="display:none;">
<svg width="11" height="8" viewBox="0 0 11 8" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M1.25 4L4.14393 6.89393C4.20251 6.95251 4.29749 6.95251 4.35607 6.89393L10.25 1" stroke="#222222" stroke-width="1.2" />
</svg>
</div>
<span>تعیین مشاغل گروه ها</span>
</a>
</li>
<li class="li-wizard step" id="salariesTab" data-url="/Admin/Company/Workshops/ClassificationScheme?handler=SalariesTab">
<a class="nav-link">
<div class="success-icon" id="success-icon2" style="display:none;">
<svg width="11" height="8" viewBox="0 0 11 8" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M1.25 4L4.14393 6.89393C4.20251 6.95251 4.29749 6.95251 4.35607 6.89393L10.25 1" stroke="#222222" stroke-width="1.2" />
</svg>
</div>
<span>تعیین دستمزد گروه ها</span>
</a>
</li>
<li class="li-wizard step" id="addEmployeesTab" data-url="/Admin/Company/Workshops/ClassificationScheme?handler=AddEmployeesTab">
<a class="nav-link">
<div class="success-icon" id="success-icon3" style="display:none;">
<svg width="11" height="8" viewBox="0 0 11 8" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M1.25 4L4.14393 6.89393C4.20251 6.95251 4.29749 6.95251 4.35607 6.89393L10.25 1" stroke="#222222" stroke-width="1.2" />
</svg>
</div>
<span>افزودن پرسنل به طرح</span>
</a>
</li>
</ul>
</div>
<div class="partial-tabs" id="partialContainer"></div>
</div>
</div>
</div>
</div>
@section Script
{
<script src="~/AdminTheme/assets/js/site.js"></script>
<script src="~/AdminTheme/js/numeral.min.js"></script>
<script src="~/admintheme/js/jquery.mask_1.14.16.min.js"></script>
<script>
$(document).ready(function () {
var workshopId = '@Model.WorkshopId';
var schemeId = '@Model.SchemeId';
var hasScheme = '@Model.HasScheme.ToString().ToLower()';
console.log(hasScheme);
// پیش‌فرض: لود تب اول با workshopId
loadPartial("/Admin/Company/Workshops/ClassificationScheme?handler=SchemeTab&workshopId=" + workshopId);
$("#schemeTab").addClass("active");
// کلیک روی تب‌ها
$("#schemeTab, #jobsTab, #salariesTab, #addEmployeesTab").click(function (e) {
e.preventDefault();
let url = $(this).data("url");
switch(this.id){
case "schemeTab" :
url += "&workshopId=" + workshopId;
loadPartial(url);
$("#schemeTab, #jobsTab, #salariesTab, #addEmployeesTab").removeClass("active");
$(this).addClass("active");
break;
case "jobsTab" :
if(hasScheme === "true" && schemeId > 0){
url += "&schemeId=" + schemeId;
loadPartial(url);
$("#schemeTab, #jobsTab, #salariesTab, #addEmployeesTab").removeClass("active");
$(this).addClass("active");
}else{
$.Notification.autoHideNotify('error', 'top center', 'پیام سیستم ', 'ابتدا باید طرح ایجاد کنید');
}
break;
case "salariesTab" :
if(hasScheme === "true"){
checkEmptyGroup(function (result) {
if (result) {
$.Notification.autoHideNotify('error', 'top center', 'پیام سیستم ', 'لطفا ابتدا مشاغل تمامی گروه ها را تعیین نمایید');
} else {
url += "&schemeId=" + schemeId;
loadPartial(url);
$("#schemeTab, #jobsTab, #salariesTab, #addEmployeesTab").removeClass("active");
$('#salariesTab').addClass("active");
}
});
}else{
$.Notification.autoHideNotify('error', 'top center', 'پیام سیستم ', 'ابتدا باید طرح ایجاد کنید');
}
break;
case "addEmployeesTab" :
if(hasScheme === "true"){
checkEmptyGroup(function (result) {
if (result) {
$.Notification.autoHideNotify('error', 'top center', 'پیام سیستم ', 'لطفا ابتدا مشاغل تمامی گروه ها را تعیین نمایید');
} else {
url += "&schemeId=" + schemeId;
loadPartial(url);
$("#schemeTab, #jobsTab, #salariesTab").removeClass("active");
$('#addEmployeesTab').addClass("active");
}
});
}else{
$.Notification.autoHideNotify('error', 'top center', 'پیام سیستم ', 'ابتدا باید طرح ایجاد کنید');
}
break;
}
});
function loadPartial(url) {
$.get(url, function (data) {
$("#partialContainer").html(data);
});
}
function checkEmptyGroup(callback) {
var url = `/Admin/Company/Workshops/ClassificationScheme?handler=CheckEmptyGroup&schemeId=${schemeId}`;
$.get(url, function (data) {
callback(data.hasEmptyGroup);
});
}
});
// $(document).ready(function () {
// // پیش‌فرض: لود تب اول
// loadPartial("/Admin/Company/Workshops/ClassificationScheme?handler=CreateScheme");
// $("#creatScheme").addClass("active"); // تب اول اکتیو بشه
// // کلیک روی تب‌ها
// $("#creatScheme, #createJobs, #createSalaies, #addEmployees").click(function (e) {
// e.preventDefault();
// // حذف active از همه تب‌ها
// $("#creatScheme, #createJobs, #createSalaies, #addEmployees").removeClass("active");
// // اضافه کردن active به تب کلیک شده
// $(this).addClass("active");
// // گرفتن آدرس هندلر بر اساس id
// let handlerUrl = "";
// if (this.id === "creatScheme")
// handlerUrl = "/Admin/Company/Workshops/ClassificationScheme?handler=CreateScheme";
// else if (this.id === "createJobs")
// handlerUrl = "/Admin/Company/Workshops/ClassificationScheme?handler=CreateJobs";
// else if (this.id === "createSalaies")
// handlerUrl = "/Admin/Company/Workshops/ClassificationScheme?handler=CreateSalaries";
// else if (this.id === "addEmployees")
// handlerUrl = "/Admin/Company/Workshops/ClassificationScheme?handler=AddEmployees";
// loadPartial(handlerUrl);
// });
// function loadPartial(url) {
// $.get(url, function (data) {
// $("#partialContainer").html(data);
// });
// }
// });
</script>
}

View File

@@ -0,0 +1,568 @@
using _0_Framework.Application;
using _0_Framework.Application.Enums;
using Company.Domain.ClassificationSchemeAgg;
using CompanyManagment.App.Contracts.ClassificationScheme;
using CompanyManagment.App.Contracts.Job;
using CompanyManagment.App.Contracts.Workshop;
using CompanyManagment.App.Contracts.YearlySalary;
using CompanyManagment.EFCore.Migrations;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
namespace ServiceHost.Areas.Admin.Pages.Company.Workshops;
/// <summary>
/// صفحه تنظیمات طرح طبقه بندی مشاغل
/// </summary>
public class ClassificationSchemeModel : PageModel
{
private readonly IClassificationSchemeApplication _classificationSchemeApplication;
private readonly IJobApplication _jobApplication;
private readonly IYearlySalaryApplication _yearlySalaryApplication;
public ClassificationSchemeModel(IClassificationSchemeApplication classificationSchemeApplication, IJobApplication jobApplication, IYearlySalaryApplication yearlySalaryApplication)
{
_classificationSchemeApplication = classificationSchemeApplication;
_jobApplication = jobApplication;
_yearlySalaryApplication = yearlySalaryApplication;
}
/// <summary>
/// آی دی کارگاه
/// </summary>
public long WorkshopId { get; set; }
/// <summary>
/// نام کارگاه
/// </summary>
public string WorkshopName { get; set; }
/// <summary>
/// آیا طرح ایجاد شده
/// </summary>
public bool HasScheme { get; set; }
/// <summary>
/// آی دی طرح
/// </summary>
public long SchemeId { get; set; }
public void OnGet(long workshopId, string workshopName)
{
WorkshopId = workshopId;
WorkshopName = workshopName;
var scheme = _classificationSchemeApplication.ClassificationSchemePartialModel(workshopId).GetAwaiter().GetResult();
HasScheme = scheme.HasScheme;
SchemeId = scheme.HasScheme ? scheme.ClassificationSchemesList.FirstOrDefault()!.Id : 0;
}
//تب لیست طرح
#region ClassificationSchemetTab
/// <summary>
/// تب ایجاد طرح
/// </summary>
/// <returns></returns>
public IActionResult OnGetSchemeTab(long workshopId)
{
//دریافت طرح
var scheme = _classificationSchemeApplication.ClassificationSchemePartialModel(workshopId).GetAwaiter().GetResult();
scheme.WorkshopId = workshopId;
return Partial("_ClassificationPartials/ClassificationSchemeTab", scheme);
}
/// <summary>
/// لود مودال ایجاد طرح
/// </summary>
/// <returns></returns>
public IActionResult OnGetCreateScheme(long workshopId)
{
var model = new CreateClassificationScheme();
model.WorkshopId = workshopId;
return Partial("_ClassificationPartials/CreateScheme", model);
}
/// <summary>
/// ایجاد طرح
/// </summary>
/// <returns></returns>
public async Task<JsonResult> OnPostCreateScheme(CreateClassificationScheme command)
{
var result = await _classificationSchemeApplication.CreateClassificationScheme(command);
return new JsonResult(result);
}
/// <summary>
/// لود مودال ویرایش طرح
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
public IActionResult OnGetEditScheme(long id)
{
var model = _classificationSchemeApplication.GetClassificationScheme(id).GetAwaiter().GetResult();
return Partial("_ClassificationPartials/EditScheme", model);
}
/// <summary>
/// ویرایش طرح
/// </summary>
/// <param name="command"></param>
/// <returns></returns>
public async Task<JsonResult> OnPostEditScheme(EditClassificationScheme command)
{
var result = _classificationSchemeApplication.EditClassificationScheme(command).GetAwaiter().GetResult();
return new JsonResult(result);
}
#endregion
//تب تعیین مشاغل
#region GroupJobsTab
/// <summary>
/// تب تعیین مشاغل گروه
/// </summary>
/// <param name="schemeId"></param>
/// <returns></returns>
public IActionResult OnGetGroupJobsTab(long schemeId)
{
var groupAndJobs = _classificationSchemeApplication.GetGroupAndJobs(schemeId).GetAwaiter().GetResult();
return Partial("_ClassificationPartials/ClassificationGroupJobsTab", groupAndJobs);
}
/// <summary>
/// لود مدال ایجاد یا ویرایش مشاغل گروه
/// </summary>
/// <param name="groupId"></param>
/// <param name="groupNo"></param>
/// <returns></returns>
public IActionResult OnGetCreateOrEditJobs(long groupId, string groupNo)
{
var model = new ClassificationGroupAndJobModel();
model.GroupId = groupId;
model.GroupNo = groupNo;
model.EditClassificationGroupJob =
_classificationSchemeApplication.GetGroupJobs(groupId).GetAwaiter().GetResult();
return Partial("_ClassificationPartials/CreateOrEditGroupJobs", model);
}
/// <summary>
/// جستجو شغل
/// </summary>
/// <param name="textSearch"></param>
/// <returns></returns>
public IActionResult OnPostJobByTextSearch(string textSearch)
{
var jobs = _jobApplication.JobSearchSelect(textSearch).GetAwaiter().GetResult();
jobs = jobs.OrderBy(x => x.JobName.Length).ToList().Select(x => new JobViewModel
{
Id = x.Id,
JobName = x.JobName,
JobCode = x.JobCode,
SearchResultTitle = x.JobName,
SearchResultCode = x.JobCode
}).ToList();
return new JsonResult(new
{
IsSuccedded = true,
List = jobs
});
}
/// <summary>
/// بررسی امکان حذف شغل
/// </summary>
/// <returns></returns>
public IActionResult OnGetCheckDeleteJob(long id, long groupId)
{
var checkExist = _classificationSchemeApplication.CheckEmployeeHasThisJob(id, groupId).GetAwaiter().GetResult();
return new JsonResult(new
{
existEmployeHasThisJob = checkExist,
});
}
/// <summary>
/// ذخیره مشاغل
/// </summary>
/// <returns></returns>
public IActionResult OnPostCreateJob(List<CreateClassificationGroupJob> createJobList, List<long> deleteJobList)
{
var result = _classificationSchemeApplication.CreateGroupJobs(createJobList, deleteJobList).GetAwaiter().GetResult();
return new JsonResult(new
{
isSuccess = result,
message = result == true ? "عملیات با موفقیت انجام شد" : "خطا در ذخیره اطلاعات",
});
}
#endregion
#region SalariesTab
/// <summary>
/// چک میکند که آیا گروه بدون شغل وجود دارد یا نه
/// </summary>
/// <param name="schemeId"></param>
/// <returns></returns>
public IActionResult OnGetCheckEmptyGroup(long schemeId)
{
var groupAndJobs = _classificationSchemeApplication.GetGroupAndJobs(schemeId).GetAwaiter().GetResult();
// خروجی: لیست بولین که برای هر گروه مشخص می‌کند آیا Job دارد یا نه
var hasJobsList = groupAndJobs
.Select(g => g.EditClassificationGroupJob != null && g.EditClassificationGroupJob.Count > 0)
.ToList();
// حالا می‌تونی بررسی کنی آیا گروهی بدون Job وجود دارد یا نه:
bool hasEmptyGroup = hasJobsList.Contains(false);
// bool hasEmptyGroup = groupAndJobs.Any(g => g.EditClassificationGroupJob == null || g.EditClassificationGroupJob.Count == 0);
return new JsonResult(new
{
hasEmptyGroup = hasEmptyGroup,
});
}
/// <summary>
/// تب لیست دستمزد ها
/// </summary>
/// <returns></returns>
public IActionResult OnGetSalariesTab(long schemeId)
{
var salariesList = _classificationSchemeApplication.GetSalariesTabData(schemeId).GetAwaiter().GetResult();
return Partial("_ClassificationPartials/ClassificationGroupSalariesTab", salariesList);
}
/// <summary>
///لود مودال ایجاد دستمزدها
/// </summary>
/// <param name="schemeId"></param>
/// <returns></returns>
public IActionResult OnGetCreateSalaries(long schemeId)
{
var groupList = _classificationSchemeApplication.GetGroupToCreateSalariesModal(schemeId).GetAwaiter().GetResult();
groupList.SchemeId = schemeId;
return Partial("_ClassificationPartials/CreateSalariesAndCoefficient", groupList);
}
/// <summary>
/// ذخیره دستمزدها
/// </summary>
/// <param name="command"></param>
/// <returns></returns>
public IActionResult OnPostCreateSalaries(SalaryAndRialCoefficientModel command)
{
var result = _classificationSchemeApplication.CreateGroupSalaryAndCoefficient(command).GetAwaiter().GetResult();
return new JsonResult(result);
}
/// <summary>
/// دریافت دستمزدها و ضریب ریالی برای مودال ویرایش
/// </summary>
/// <param name="schemeId"></param>
/// <param name="startDate"></param>
/// <param name="endDate"></param>
/// <returns></returns>
public IActionResult OnGetEditSalariesData(long schemeId, string startDate, string endDate)
{
var editData = _classificationSchemeApplication.GetEditSalariesData(schemeId, startDate, endDate).GetAwaiter()
.GetResult();
return Partial("_ClassificationPartials/EditSalariesAndCoefficient", editData);
}
/// <summary>
/// ثبت تغییرات ویرایش دستمزدها
/// </summary>
/// <param name="command"></param>
/// <returns></returns>
public IActionResult OnPostEditSalariesData(SalaryAndRialCoefficientModel command)
{
var result = _classificationSchemeApplication.EditGroupSalaryAndCoefficient(command).GetAwaiter().GetResult();
return new JsonResult(result);
}
#endregion
#region EmployeesTab
/// <summary>
/// تب افزودن پرسنل
/// </summary>
/// <param name="schemeId"></param>
/// <returns></returns>
public IActionResult OnGetAddEmployeesTab(long schemeId)
{
var model = new EmployeeInfoTab
{
SchemeId = schemeId,
};
//var result = _classificationSchemeApplication.GetEmployeeDataTab(command).GetAwaiter().GetResult();
return Partial("_ClassificationPartials/ClassificationEmployeesTab", model);
}
/// <summary>
/// دریافت نتیجه جستجو در تب پرسنل
/// </summary>
/// <param name="schemeId"></param>
/// <param name="fullName"></param>
/// <returns></returns>
public IActionResult OnGetAjaxDataLoading(long schemeId, string fullName)
{
var command = new EmployeeInfoTab
{
SchemeId = schemeId,
FullName = fullName,
};
var result = _classificationSchemeApplication.GetEmployeeDataTab(command).GetAwaiter().GetResult();
if (result.EmployeeInfoList == null || !result.EmployeeInfoList.Any())
return new JsonResult(new
{
hasEmployee = false
});
var personnelList = result.EmployeeInfoList.OrderBy(x => x.Black ? 1 : 0);
return new JsonResult(new
{
hasEmployee = true,
personnelList
});
}
/// <summary>
///لود مودال افزودن پرسنل به گروه
/// </summary>
/// <param name="employeeId"></param>
/// <param name="schemeId"></param>
/// <param name="employeeFullName"></param>
/// <returns></returns>
public IActionResult OnGetAddToGroup(long employeeId, long schemeId, string employeeFullName)
{
var model = new AddEmployeeToGroup();
var groups = _classificationSchemeApplication.GetGroups(schemeId).GetAwaiter().GetResult();
model.SchemeId = schemeId;
model.EmployeeId = employeeId;
model.EmployeeFullName = employeeFullName;
model.ClassificationGroupList = groups;
return Partial("_ClassificationPartials/AddEmployeeToGroup", model);
}
/// <summary>
/// ذخیره انتخاب گروه و شغل برای پرسنل
/// </summary>
/// <param name="command"></param>
/// <returns></returns>
public IActionResult OnPostAddToGroup(AddEmployeeToGroup command)
{
var result = _classificationSchemeApplication.AddEmployeeToGroup(command).GetAwaiter().GetResult();
if (!result.IsSuccedded)
{
return new JsonResult(new
{
isSuccess = false,
message = result.Message,
});
}
return new JsonResult(new
{
isSuccess = true,
message = result.Message,
});
}
/// <summary>
/// دریافت لیست مشاغل با ای دی گروه
/// </summary>
/// <param name="schemeId"></param>
/// <param name="groupId"></param>
/// <returns></returns>
public IActionResult OnGetJobList(long schemeId, long groupId)
{
var jobList = _classificationSchemeApplication.GetGroupJobs(groupId).GetAwaiter().GetResult();
return new JsonResult(new
{
jobs = jobList,
});
}
/// <summary>
///لود مودال ویرایش پرسنل گروه
/// </summary>
/// <param name="employeeId"></param>
/// <param name="schemeId"></param>
/// <param name="employeeFullName"></param>
/// <returns></returns>
public IActionResult OnGetEditGroupMember(long employeeId, long schemeId, string employeeFullName)
{
var model = new AddEmployeeToGroup();
var groups = _classificationSchemeApplication.GetGroups(schemeId).GetAwaiter().GetResult();
var employeeMemberizeData = _classificationSchemeApplication.GetEmployeeMemberizeData(employeeId).GetAwaiter().GetResult();
model.SchemeId = schemeId;
model.EmployeeId = employeeId;
model.EmployeeFullName = employeeFullName;
model.ClassificationGroupList = groups;
model.GroupId = employeeMemberizeData.GroupId;
model.JobId = employeeMemberizeData.JobId;
model.Id = employeeMemberizeData.Id;
return Partial("_ClassificationPartials/EditGroupMember", model);
}
/// <summary>
/// ذخیره ویرایش گروه پرسنل
/// </summary>
/// <param name="command"></param>
/// <returns></returns>
public IActionResult OnPostEditGroupMember(AddEmployeeToGroup command)
{
var result = _classificationSchemeApplication.EditGroupMember(command).GetAwaiter().GetResult();
if (!result.IsSuccedded)
{
return new JsonResult(new
{
isSuccess = false,
message = result.Message,
});
}
return new JsonResult(new
{
isSuccess = true,
message = result.Message,
});
}
#endregion
//تست طرح
#region TestScheme
/// <summary>
/// لود مودال تست
/// </summary>
/// <param name="schemeId"></param>
/// <returns></returns>
public IActionResult OnGetTestScheme(long schemeId)
{
var command = new EmployeeInfoTab
{
SchemeId = schemeId,
};
var result = _classificationSchemeApplication.GetEmployeeDataTab(command).GetAwaiter().GetResult();
var employeeWithGroup = result.EmployeeInfoList.Where(x => x.HasGroup).ToList();
var years =
_yearlySalaryApplication.GetYears();
var model = new EmployeeInfoTab()
{
SchemeId = schemeId,
EmployeeInfoList = employeeWithGroup,
YearlyList = years
};
return Partial("_ClassificationPartials/TestScheme", model);
}
/// <summary>
/// متد محاسبه تست
/// </summary>
/// <param name="schemeId"></param>
/// <param name="employeeId"></param>
/// <param name="year"></param>
/// <param name="month"></param>
/// <returns></returns>
public IActionResult OnGetComputeTest(long schemeId, long employeeId, string year, string month)
{
var scheme = _classificationSchemeApplication.GetClassificationScheme(schemeId).GetAwaiter().GetResult();
var typeOfCoefficient = scheme.TypeOfCoefficient;
var startDate = $"{year}/{month}/01";
var endDate = startDate.FindeEndOfMonth();
var startDateGr = startDate.ToGeorgianDateTime();
var endDateGr = endDate.ToGeorgianDateTime();
double salaryResult = 0;
double salary = 0;
double coefficient = 0;
double rate = 0;
string mathModel = "";
var employeeMemberizeData = _classificationSchemeApplication.GetEmployeeMemberizeData(employeeId).GetAwaiter().GetResult();
var groupId = employeeMemberizeData.GroupId;
var group = _classificationSchemeApplication.GetGroups(schemeId).GetAwaiter().GetResult();
var groupNo = group.FirstOrDefault(x => x.GroupId == groupId)!.GroupNo;
var groupSalaryData = _classificationSchemeApplication.GetEditSalariesData(schemeId, startDate, endDate).GetAwaiter()
.GetResult();
var salaryData = groupSalaryData.SalariesAndCoefficientList.FirstOrDefault(x => x.GroupNo == groupNo);
if (salaryData != null)
{
salary = salaryData.GroupSalary;
coefficient = groupSalaryData.RialCoefficient;
}
if (typeOfCoefficient != TypeOfCoefficient.RialCoefficient)
{
coefficient = 0;
}
rate = ClassificationRangeOfGroupRate.GetGroupDistanceRate(groupNo).DistanceRate;
if (groupNo != "1")
{
salaryResult = (coefficient * rate) + salary;
mathModel = $"{salaryResult} = {salary} + ( x {rate} {coefficient} )";
}
else
{
salaryResult = salary;
}
var baseYearResult = _classificationSchemeApplication.BaseYearComputeOneGroup(scheme.ExecutionDateGr,
scheme.EndSchemeDateGr, startDateGr, endDateGr, groupNo, employeeId, scheme.WorkshopId).GetAwaiter().GetResult();
var baseYearResultFa = baseYearResult.BaseYearResult > 0 ? baseYearResult.BaseYearResult.ToMoney() : "0";
var salaryResultFa = salaryResult.ToMoney();
double baseYearResultRound = baseYearResultFa != "0" ? baseYearResultFa.MoneyToDouble() : 0;
double salaryResultRound = salaryResultFa.MoneyToDouble();
return new JsonResult(new
{
salaryResult = salaryResultFa,
salary = salary,
rate = rate,
coefficient = coefficient,
salaryResultDouble = salaryResult,
baseYearResult = baseYearResultFa,
mabnaDailyWage = (baseYearResultRound + salaryResultRound).ToMoney(),
baseYearDataList = baseYearResult.BaseYearDataList,
});
}
#endregion
}

File diff suppressed because it is too large Load Diff

View File

@@ -617,6 +617,11 @@
}); });
</script> </script>
<div class="" style="display: flex; align-items: center;">
<input id="isClassified" type="checkbox" asp-for="Command.IsClassified" class="form-control" style="width: 15px;margin: 0 0 0 10px;" />
<label asp-for="Command.IsClassified" style="margin: 0;">فعال سازی طرح طبقه بندی مشاغل</label>
</div>
</div> </div>
</div> </div>
<div class="row" id="form5" style="display: none"> <div class="row" id="form5" style="display: none">

View File

@@ -10,218 +10,217 @@ using Microsoft.AspNetCore.Mvc.Rendering;
using Microsoft.AspNetCore.SignalR; using Microsoft.AspNetCore.SignalR;
using ServiceHost.Hubs; using ServiceHost.Hubs;
namespace ServiceHost.Areas.Admin.Pages.Company.Workshops namespace ServiceHost.Areas.Admin.Pages.Company.Workshops;
[Authorize]
public class CreateWorkshopModel : PageModel
{ {
[Authorize] private readonly IWorkshopApplication _workshopApplication;
public class CreateWorkshopModel : PageModel private readonly IEmployerApplication _EmployerApplication;
private readonly IAccountRepository _accountRepository;
private readonly IInsuranceJobApplication _insuranceJobApplication;
private readonly IAuthHelper _authHelper;
public CreateWorkshop Command;
public SelectList Employers;
public CreateWorkshopModel(IWorkshopApplication workshopApplication, IEmployerApplication employerApplication, IAccountRepository accountRepository, IInsuranceJobApplication insuranceJobApplication, IAuthHelper authHelper)
{ {
private readonly IWorkshopApplication _workshopApplication; _workshopApplication = workshopApplication;
private readonly IEmployerApplication _EmployerApplication; _EmployerApplication = employerApplication;
private readonly IAccountRepository _accountRepository; _accountRepository = accountRepository;
private readonly IInsuranceJobApplication _insuranceJobApplication; _insuranceJobApplication = insuranceJobApplication;
private readonly IAuthHelper _authHelper; _authHelper = authHelper;
public CreateWorkshop Command; }
public SelectList Employers;
public CreateWorkshopModel(IWorkshopApplication workshopApplication, IEmployerApplication employerApplication, IAccountRepository accountRepository, IInsuranceJobApplication insuranceJobApplication, IAuthHelper authHelper) public void OnGet()
{
var permissionIds = _authHelper.GetPermissions();
var list = _insuranceJobApplication.GetInsurancJob();
var insuranceJob = list.Select(x => new InsuranceJobViewModel()
{ {
_workshopApplication = workshopApplication; Id = x.Id,
_EmployerApplication = employerApplication; InsuranceJobTitle = x.InsuranceJobTitle + " | " + x.EconomicCode,
_accountRepository = accountRepository; }).ToList();
_insuranceJobApplication = insuranceJobApplication; var accounts = _accountRepository.GetAdminAccountsNew();
_authHelper = authHelper; var command = new CreateWorkshop
}
public void OnGet()
{ {
var permissionIds = _authHelper.GetPermissions(); Employers = _EmployerApplication.GetAllEmployers(),
var list = _insuranceJobApplication.GetInsurancJob(); AccountsList = accounts,
var insuranceJob = list.Select(x => new InsuranceJobViewModel() SeniorContractAccountsList = accounts.Where(x => x.RoleId == 3).ToList(),
{ JuniorContractAccountsList = accounts.Where(x => x.RoleId == 5).ToList(),
Id = x.Id, SeniorInsuranceAccountList = accounts.Where(x => x.RoleId == 7).ToList(),
InsuranceJobTitle = x.InsuranceJobTitle + " | " + x.EconomicCode, JuniorInsuranceAccountsList = accounts.Where(x => x.RoleId == 8).ToList(),
}).ToList(); InsuranceJobViewModels = new SelectList(insuranceJob, "Id", "InsuranceJobTitle"),
var accounts = _accountRepository.GetAdminAccountsNew(); CutContractEndOfYear = IsActive.None,
var command = new CreateWorkshop RotatingShiftCompute = true
{ };
Employers = _EmployerApplication.GetAllEmployers(),
AccountsList = accounts,
SeniorContractAccountsList = accounts.Where(x => x.RoleId == 3).ToList(),
JuniorContractAccountsList = accounts.Where(x => x.RoleId == 5).ToList(),
SeniorInsuranceAccountList = accounts.Where(x => x.RoleId == 7).ToList(),
JuniorInsuranceAccountsList = accounts.Where(x => x.RoleId == 8).ToList(),
InsuranceJobViewModels = new SelectList(insuranceJob, "Id", "InsuranceJobTitle"),
CutContractEndOfYear = IsActive.None,
RotatingShiftCompute = true
};
var res = _workshopApplication.GetWorkshop(); var res = _workshopApplication.GetWorkshop();
var checkOk = res.Any(); var checkOk = res.Any();
int item = 0; int item = 0;
var codes = new List<int>(); var codes = new List<int>();
foreach (var i in res) foreach (var i in res)
{
string bb = string.Empty;
if (i.ArchiveCode != null)
{
for (int x = 0; x < i.ArchiveCode.Length; x++)
{
if (char.IsDigit(i.ArchiveCode[x]))
bb += i.ArchiveCode[x];
}
if (bb.Length > 0)
{
int convert = int.Parse(bb);
codes.Add(convert);
}
}
}
if (checkOk)
{
item = codes.Max();
}
int sum = item + 1;
string newcode = sum.ToString();
command.ArchiveCode = newcode;
command.PermissionIds = permissionIds;
// command.CurrentAccoutRoleId = currentAccout.RoleId;
Command = command;
}
public IActionResult OnPostCreate(CreateWorkshop command)
{ {
#region checkIsLegalAndNotIsLegal
OperationResult resultIsLegal = new OperationResult();
var selectEmployerList = _EmployerApplication.GetEmployers().Where(x => command.EmployerIdList.Contains(x.Id)).ToList();
var isNotlegal = selectEmployerList.Where(x => x.IsLegal == "حقیقی").FirstOrDefault();
var islegal = selectEmployerList.Where(x => x.IsLegal == "حقوقی").FirstOrDefault();
if (isNotlegal != null && islegal != null)
return new JsonResult(resultIsLegal.Failed("امکان انتخاب کارفرمای حقیقی و حقوقی به دلیل موانع قانونی در نرم افزار بصورت همزمان امکان پذیر نمی باشد"));
#endregion
var res = _workshopApplication.GetWorkshop();
bool checkNumber = false;
bool checkExist = false;
string a = command.ArchiveCode;
string bb = string.Empty; string bb = string.Empty;
int convert2 = 0;
if (!string.IsNullOrWhiteSpace(a)) if (i.ArchiveCode != null)
{ {
for (int x = 0; x < a.Length; x++) for (int x = 0; x < i.ArchiveCode.Length; x++)
{ {
if (char.IsDigit(a[x])) if (char.IsDigit(i.ArchiveCode[x]))
bb += a[x]; bb += i.ArchiveCode[x];
} }
if (bb.Length > 0) if (bb.Length > 0)
{ {
checkNumber = true; int convert = int.Parse(bb);
convert2 = int.Parse(bb); codes.Add(convert);
}
else
{
checkNumber = false;
} }
} }
else }
if (checkOk)
{
item = codes.Max();
}
int sum = item + 1;
string newcode = sum.ToString();
command.ArchiveCode = newcode;
command.PermissionIds = permissionIds;
// command.CurrentAccoutRoleId = currentAccout.RoleId;
Command = command;
}
public IActionResult OnPostCreate(CreateWorkshop command)
{
#region checkIsLegalAndNotIsLegal
OperationResult resultIsLegal = new OperationResult();
var selectEmployerList = _EmployerApplication.GetEmployers().Where(x => command.EmployerIdList.Contains(x.Id)).ToList();
var isNotlegal = selectEmployerList.Where(x => x.IsLegal == "حقیقی").FirstOrDefault();
var islegal = selectEmployerList.Where(x => x.IsLegal == "حقوقی").FirstOrDefault();
if (isNotlegal != null && islegal != null)
return new JsonResult(resultIsLegal.Failed("امکان انتخاب کارفرمای حقیقی و حقوقی به دلیل موانع قانونی در نرم افزار بصورت همزمان امکان پذیر نمی باشد"));
#endregion
var res = _workshopApplication.GetWorkshop();
bool checkNumber = false;
bool checkExist = false;
string a = command.ArchiveCode;
string bb = string.Empty;
int convert2 = 0;
if (!string.IsNullOrWhiteSpace(a))
{
for (int x = 0; x < a.Length; x++)
{
if (char.IsDigit(a[x]))
bb += a[x];
}
if (bb.Length > 0)
{ {
checkNumber = true; checkNumber = true;
convert2 = int.Parse(bb);
}
var codes = new List<int>();
foreach (var i in res)
{
string b2 = string.Empty;
if (i.ArchiveCode != null)
{
for (int x = 0; x < i.ArchiveCode.Length; x++)
{
if (char.IsDigit(i.ArchiveCode[x]))
b2 += i.ArchiveCode[x];
}
if (b2.Length > 0)
{
int convert = int.Parse(b2);
codes.Add(convert);
}
}
}
foreach (var item in codes)
{
if (item == convert2)
checkExist = true;
}
if (checkNumber)
{
//if (checkExist)
//{
// var res3 = _workshopApplication.ExistErr();
// return new JsonResult(res3);
//}
//Thread.Sleep(5000);
command.TypeOfInsuranceSend = command.TypeOfInsuranceSend == "false" ? "" : command.TypeOfInsuranceSend;
command.InsuranceCode = !string.IsNullOrWhiteSpace(command.InsuranceCode) ? command.InsuranceCode.ConvertToEnglish() : "";
command.ArchiveCode = !string.IsNullOrWhiteSpace(command.ArchiveCode) ? command.ArchiveCode.ConvertToEnglish() : "";
command.AgreementNumber = !string.IsNullOrWhiteSpace(command.AgreementNumber) ? command.AgreementNumber.ConvertToEnglish() : "";
command.TypeOfInsuranceSend = command.TypeOfInsuranceSend == "false" ? null : command.TypeOfInsuranceSend;
if (command.HasRollCallFreeVip == "on")
{
command.HasRollCallFreeVip = "true";
if (command.HasCustomizeCheckoutService == "on")
command.HasCustomizeCheckoutService = "true";
}
else
{
command.HasRollCallFreeVip = "false";
}
var result = _workshopApplication.Create(command);
return new JsonResult(result);
} }
else else
{ {
var res2 = _workshopApplication.Err(); checkNumber = false;
return new JsonResult(res2);
} }
} }
else
public IActionResult OnGetWorkshopName(string searchText)
{ {
var result = _workshopApplication.GetWorkshopByTextSearch(searchText); checkNumber = true;
result = result.OrderBy(x => x.WorkshopFullName.Length).ToList();
return new JsonResult(new
{
IsSuccedded = true,
mylist = result,
});
} }
public IActionResult OnGetEmployerName(string searchText) var codes = new List<int>();
foreach (var i in res)
{ {
var result = _EmployerApplication.GetEmployerWithFNameOrLName(searchText);
result = result.OrderBy(x => x.LName.Length).ToList(); string b2 = string.Empty;
return new JsonResult(new
if (i.ArchiveCode != null)
{ {
IsSuccedded = true, for (int x = 0; x < i.ArchiveCode.Length; x++)
mylist = result, {
}); if (char.IsDigit(i.ArchiveCode[x]))
b2 += i.ArchiveCode[x];
}
if (b2.Length > 0)
{
int convert = int.Parse(b2);
codes.Add(convert);
}
}
}
foreach (var item in codes)
{
if (item == convert2)
checkExist = true;
}
if (checkNumber)
{
//if (checkExist)
//{
// var res3 = _workshopApplication.ExistErr();
// return new JsonResult(res3);
//}
//Thread.Sleep(5000);
command.TypeOfInsuranceSend = command.TypeOfInsuranceSend == "false" ? "" : command.TypeOfInsuranceSend;
command.InsuranceCode = !string.IsNullOrWhiteSpace(command.InsuranceCode) ? command.InsuranceCode.ConvertToEnglish() : "";
command.ArchiveCode = !string.IsNullOrWhiteSpace(command.ArchiveCode) ? command.ArchiveCode.ConvertToEnglish() : "";
command.AgreementNumber = !string.IsNullOrWhiteSpace(command.AgreementNumber) ? command.AgreementNumber.ConvertToEnglish() : "";
command.TypeOfInsuranceSend = command.TypeOfInsuranceSend == "false" ? null : command.TypeOfInsuranceSend;
if (command.HasRollCallFreeVip == "on")
{
command.HasRollCallFreeVip = "true";
if (command.HasCustomizeCheckoutService == "on")
command.HasCustomizeCheckoutService = "true";
}
else
{
command.HasRollCallFreeVip = "false";
}
var result = _workshopApplication.Create(command);
return new JsonResult(result);
}
else
{
var res2 = _workshopApplication.Err();
return new JsonResult(res2);
} }
} }
public IActionResult OnGetWorkshopName(string searchText)
{
var result = _workshopApplication.GetWorkshopByTextSearch(searchText);
result = result.OrderBy(x => x.WorkshopFullName.Length).ToList();
return new JsonResult(new
{
IsSuccedded = true,
mylist = result,
});
}
public IActionResult OnGetEmployerName(string searchText)
{
var result = _EmployerApplication.GetEmployerWithFNameOrLName(searchText);
result = result.OrderBy(x => x.LName.Length).ToList();
return new JsonResult(new
{
IsSuccedded = true,
mylist = result,
});
}
} }

View File

@@ -662,6 +662,11 @@
}); });
</script> </script>
<div class="" style="display: flex; align-items: center;">
<input id="isClassified" type="checkbox" asp-for="Command.IsClassified" class="form-control" style="width: 15px;margin: 0 0 0 10px;"/>
<label asp-for="Command.IsClassified" style="margin: 0;">فعال سازی طرح طبقه بندی مشاغل</label>
</div>
</div> </div>
</div> </div>
<div class="row" id="form5" style="display: none"> <div class="row" id="form5" style="display: none">

View File

@@ -13,260 +13,259 @@ using CompanyManagment.App.Contracts.RollCall;
using CompanyManagment.App.Contracts.RollCallService; using CompanyManagment.App.Contracts.RollCallService;
using CompanyManagment.EFCore.Repository; using CompanyManagment.EFCore.Repository;
namespace ServiceHost.Areas.Admin.Pages.Company.Workshops namespace ServiceHost.Areas.Admin.Pages.Company.Workshops;
[Authorize]
public class EditWorkshopModel : PageModel
{ {
[Authorize] public string Message { get; set; }
public class EditWorkshopModel : PageModel private readonly IWorkshopApplication _workshopApplication;
private readonly IWorkshopRepository _workshopRepository;
private readonly IEmployerApplication _EmployerApplication;
private readonly IAccountRepository _accountRepository;
private readonly IInsuranceJobApplication _insuranceJobApplication;
private readonly IRollCallServiceApplication _rollCallServiceApplication;
private readonly IAuthHelper _authHelper;
public EditWorkshop Command;
public SelectList Employers;
public RollCallServiceViewModel RollCallService;
public bool HasPermissionWorkshopInfo;
public bool HasPermissionContract;
public bool HasPermissionInsurance;
public bool HasPermissionAccount;
public List<AccountViewModel> DeactivatedAccounts;
public EditWorkshopModel(IWorkshopApplication workshopApplication, IWorkshopRepository workshopRepository, IEmployerApplication employerApplication, IAccountRepository accountRepository, IInsuranceJobApplication insuranceJobApplication, IAuthHelper authHelper, IRollCallServiceApplication rollCallServiceApplication)
{ {
public string Message { get; set; } _workshopApplication = workshopApplication;
private readonly IWorkshopApplication _workshopApplication; _workshopRepository = workshopRepository;
private readonly IWorkshopRepository _workshopRepository; _EmployerApplication = employerApplication;
private readonly IEmployerApplication _EmployerApplication; _accountRepository = accountRepository;
private readonly IAccountRepository _accountRepository; _insuranceJobApplication = insuranceJobApplication;
private readonly IInsuranceJobApplication _insuranceJobApplication; _authHelper = authHelper;
private readonly IRollCallServiceApplication _rollCallServiceApplication; _rollCallServiceApplication = rollCallServiceApplication;
private readonly IAuthHelper _authHelper; }
public EditWorkshop Command;
public SelectList Employers;
public RollCallServiceViewModel RollCallService;
public bool HasPermissionWorkshopInfo;
public bool HasPermissionContract;
public bool HasPermissionInsurance;
public bool HasPermissionAccount;
public List<AccountViewModel> DeactivatedAccounts;
public EditWorkshopModel(IWorkshopApplication workshopApplication, IWorkshopRepository workshopRepository, IEmployerApplication employerApplication, IAccountRepository accountRepository, IInsuranceJobApplication insuranceJobApplication, IAuthHelper authHelper, IRollCallServiceApplication rollCallServiceApplication) public void OnGet(long id)
{
var permissions = _authHelper.GetPermissions();
HasPermissionWorkshopInfo = permissions.Any(x => x == 10326);
HasPermissionContract = permissions.Any(x => x == 10323);
HasPermissionInsurance = permissions.Any(x => x == 10324);
HasPermissionAccount = permissions.Any(x => x == 10330);
var permissionIds = _authHelper.GetPermissions();
// var currentAccout = _authHelper.CurrentAccountInfo();
var list = _insuranceJobApplication.GetInsurancJob();
var insuranceJob = list.Select(x => new InsuranceJobViewModel()
{ {
_workshopApplication = workshopApplication; Id = x.Id,
_workshopRepository = workshopRepository; InsuranceJobTitle = x.InsuranceJobTitle + " | " + x.EconomicCode,
_EmployerApplication = employerApplication; }).ToList();
_accountRepository = accountRepository;
_insuranceJobApplication = insuranceJobApplication;
_authHelper = authHelper;
_rollCallServiceApplication = rollCallServiceApplication;
}
public void OnGet(long id) RollCallService = _rollCallServiceApplication.GetActiveServiceByWorkshopId(id);
{ if (RollCallService != null)
var permissions = _authHelper.GetPermissions(); RollCallService.EndServiceToFarsiDuration = RollCallService.EndServiceStr.ToFarsiDuration2();
HasPermissionWorkshopInfo = permissions.Any(x => x == 10326);
HasPermissionContract = permissions.Any(x => x == 10323);
HasPermissionInsurance = permissions.Any(x => x == 10324);
HasPermissionAccount = permissions.Any(x => x == 10330);
var permissionIds = _authHelper.GetPermissions(); var allAccounts = _accountRepository.GetAccountsToEditWorkshop(id);
// var currentAccout = _authHelper.CurrentAccountInfo();
var list = _insuranceJobApplication.GetInsurancJob();
var insuranceJob = list.Select(x => new InsuranceJobViewModel()
{
Id = x.Id,
InsuranceJobTitle = x.InsuranceJobTitle + " | " + x.EconomicCode,
}).ToList();
RollCallService = _rollCallServiceApplication.GetActiveServiceByWorkshopId(id);
if (RollCallService != null)
RollCallService.EndServiceToFarsiDuration = RollCallService.EndServiceStr.ToFarsiDuration2();
var allAccounts = _accountRepository.GetAccountsToEditWorkshop(id);
var activeAccounts = allAccounts.Where(x => x.IsActiveString == "true").ToList();
DeactivatedAccounts = allAccounts.Except(activeAccounts).ToList();
var workshop = _workshopApplication.GetDetails(id);
workshop.Employers = _EmployerApplication.GetAllEmployers();
workshop.AccountsList = activeAccounts;
var adminAccounts = _accountRepository.GetAdminAccountsNew();
workshop.SeniorContractAccountsList = adminAccounts.Where(x => x.RoleId == 3).ToList();
workshop.JuniorContractAccountsList = adminAccounts.Where(x => x.RoleId == 5).ToList();
workshop.SeniorInsuranceAccountList = adminAccounts.Where(x => x.RoleId == 7).ToList();
workshop.JuniorInsuranceAccountsList = adminAccounts.Where(x => x.RoleId == 8).ToList();
workshop.EmployerIdList = _workshopRepository.GetRelation(id);
workshop.AccountIdsList = _workshopRepository.GetWorkshopAccountRelation(id);
workshop.DeActiveAccounts = allAccounts.Except(activeAccounts).ToList();
workshop.ActiveAccounts = activeAccounts;
//workshop.InAccountIdsList = _accountRepository.GetAccounts()
// .Where(x => _workshopRepository.GetWorkshopAccountRelation(id).Contains(x.Id))
// .ToList();
workshop.InsuranceJobViewModels = new SelectList(insuranceJob, "Id", "InsuranceJobTitle");
Message = workshop.ArchiveCode;
workshop.PermissionIds = permissionIds;
Command = workshop;
}
public IActionResult OnPostEdit(EditWorkshop command)
{
var aaa = command;
if (ModelState.IsValid)
{
}
#region checkIsLegalAndNotIsLegal
OperationResult resultIsLegal = new OperationResult();
var selectEmployerList = _EmployerApplication.GetEmployers().Where(x => command.EmployerIdList.Contains(x.Id)).ToList();
var isNotlegal = selectEmployerList.Where(x => x.IsLegal == "حقیقی").FirstOrDefault();
var islegal = selectEmployerList.Where(x => x.IsLegal == "حقوقی").FirstOrDefault();
if (isNotlegal != null && islegal != null)
return new JsonResult(resultIsLegal.Failed("امکان انتخاب کارفرمای حقیقی و حقوقی به دلیل موانع قانونی در نرم افزار بصورت همزمان امکان پذیر نمی باشد"));
#endregion
var workshop = _workshopApplication.GetDetails(command.Id);
var lastNumber = workshop.ArchiveCode;
var res = _workshopApplication.GetWorkshop();
bool checkNumber = false;
bool checkExist = false;
var pration = new OperationResult();
string a = command.ArchiveCode;
string bb = string.Empty;
int convert2 = 0;
if (!string.IsNullOrWhiteSpace(a))
{
for (int x = 0; x < a.Length; x++)
{
if (char.IsDigit(a[x]))
bb += a[x];
}
if (bb.Length > 0)
{
checkNumber = true;
convert2 = int.Parse(bb);
}
else
{
checkNumber = false;
}
}
else
{
checkNumber = true;
}
var codes = new List<int>();
foreach (var i in res)
{
string b2 = string.Empty;
if (i.ArchiveCode != null && i.ArchiveCode != lastNumber)
{
for (int x = 0; x < i.ArchiveCode.Length; x++)
{
if (char.IsDigit(i.ArchiveCode[x]))
b2 += i.ArchiveCode[x];
}
if (b2.Length > 0)
{
int convert = int.Parse(b2);
codes.Add(convert);
}
}
}
foreach (var item in codes)
{
if (item == convert2)
checkExist = true;
}
if (checkNumber)
{
//var EmpoyersSelected = _EmployerRepository.Get(command.EmployerId);
//if (EmpoyersSelected.EmployerNo == null)
//{
// EmpoyersSelected.EditEmployerNo(command.ArchiveCode);
//}
command.InsuranceCode = !string.IsNullOrWhiteSpace(command.InsuranceCode) ? command.InsuranceCode.ConvertToEnglish() : "";
command.ArchiveCode = !string.IsNullOrWhiteSpace(command.ArchiveCode) ? command.ArchiveCode.ConvertToEnglish() : "";
command.AgreementNumber = !string.IsNullOrWhiteSpace(command.AgreementNumber) ? command.AgreementNumber.ConvertToEnglish() : "";
command.TypeOfInsuranceSend = command.TypeOfInsuranceSend == "false" ? null : command.TypeOfInsuranceSend;
#region Vafa
if (command.HasRollCallFreeVip == "ture")
{
//var todayPersianDate = DateTime.Now.ToFirstDayOfNextMonth();
// var financialWorkshop
//double amount = Convert.ToDouble(0);
//var commandSaveRollCall = new CreateRollCallService()
//{
// AccountId = _authHelper.CurrentAccountId(),
// WorkshopId = command.Id,
// ServiceType = "VIP",
// EndService = command.EndService,
// Amount = amount,
// MaxPersonValid = -1,
// Duration = command.Duration,
//};
//var resultRollCall = _rollCallServiceApplication.Create(commandSaveRollCall);
}
#endregion
if (command.HasRollCallFreeVip == "on")
{
command.HasRollCallFreeVip = "true";
if (command.HasCustomizeCheckoutService == "on")
{
command.HasCustomizeCheckoutService = "true";
}
else
{
command.HasCustomizeCheckoutService = "false";
}
}
else
{
command.HasRollCallFreeVip = "false";
}
var result = _workshopApplication.Edit(command);
return new JsonResult(result);
}
else
{
var res2 = _workshopApplication.Err();
return new JsonResult(res2);
}
//else
//{
// var res3 = _workshopApplication.ExistErr();
// return new JsonResult(res3);
//}
}
var activeAccounts = allAccounts.Where(x => x.IsActiveString == "true").ToList();
DeactivatedAccounts = allAccounts.Except(activeAccounts).ToList();
var workshop = _workshopApplication.GetDetails(id);
workshop.Employers = _EmployerApplication.GetAllEmployers();
workshop.AccountsList = activeAccounts;
var adminAccounts = _accountRepository.GetAdminAccountsNew();
workshop.SeniorContractAccountsList = adminAccounts.Where(x => x.RoleId == 3).ToList();
workshop.JuniorContractAccountsList = adminAccounts.Where(x => x.RoleId == 5).ToList();
workshop.SeniorInsuranceAccountList = adminAccounts.Where(x => x.RoleId == 7).ToList();
workshop.JuniorInsuranceAccountsList = adminAccounts.Where(x => x.RoleId == 8).ToList();
workshop.EmployerIdList = _workshopRepository.GetRelation(id);
workshop.AccountIdsList = _workshopRepository.GetWorkshopAccountRelation(id);
workshop.DeActiveAccounts = allAccounts.Except(activeAccounts).ToList();
workshop.ActiveAccounts = activeAccounts;
//workshop.InAccountIdsList = _accountRepository.GetAccounts()
// .Where(x => _workshopRepository.GetWorkshopAccountRelation(id).Contains(x.Id))
// .ToList();
workshop.InsuranceJobViewModels = new SelectList(insuranceJob, "Id", "InsuranceJobTitle");
Message = workshop.ArchiveCode;
workshop.PermissionIds = permissionIds;
Command = workshop;
} }
public IActionResult OnPostEdit(EditWorkshop command)
{
var aaa = command;
if (ModelState.IsValid)
{
}
#region checkIsLegalAndNotIsLegal
OperationResult resultIsLegal = new OperationResult();
var selectEmployerList = _EmployerApplication.GetEmployers().Where(x => command.EmployerIdList.Contains(x.Id)).ToList();
var isNotlegal = selectEmployerList.Where(x => x.IsLegal == "حقیقی").FirstOrDefault();
var islegal = selectEmployerList.Where(x => x.IsLegal == "حقوقی").FirstOrDefault();
if (isNotlegal != null && islegal != null)
return new JsonResult(resultIsLegal.Failed("امکان انتخاب کارفرمای حقیقی و حقوقی به دلیل موانع قانونی در نرم افزار بصورت همزمان امکان پذیر نمی باشد"));
#endregion
var workshop = _workshopApplication.GetDetails(command.Id);
var lastNumber = workshop.ArchiveCode;
var res = _workshopApplication.GetWorkshop();
bool checkNumber = false;
bool checkExist = false;
var pration = new OperationResult();
string a = command.ArchiveCode;
string bb = string.Empty;
int convert2 = 0;
if (!string.IsNullOrWhiteSpace(a))
{
for (int x = 0; x < a.Length; x++)
{
if (char.IsDigit(a[x]))
bb += a[x];
}
if (bb.Length > 0)
{
checkNumber = true;
convert2 = int.Parse(bb);
}
else
{
checkNumber = false;
}
}
else
{
checkNumber = true;
}
var codes = new List<int>();
foreach (var i in res)
{
string b2 = string.Empty;
if (i.ArchiveCode != null && i.ArchiveCode != lastNumber)
{
for (int x = 0; x < i.ArchiveCode.Length; x++)
{
if (char.IsDigit(i.ArchiveCode[x]))
b2 += i.ArchiveCode[x];
}
if (b2.Length > 0)
{
int convert = int.Parse(b2);
codes.Add(convert);
}
}
}
foreach (var item in codes)
{
if (item == convert2)
checkExist = true;
}
if (checkNumber)
{
//var EmpoyersSelected = _EmployerRepository.Get(command.EmployerId);
//if (EmpoyersSelected.EmployerNo == null)
//{
// EmpoyersSelected.EditEmployerNo(command.ArchiveCode);
//}
command.InsuranceCode = !string.IsNullOrWhiteSpace(command.InsuranceCode) ? command.InsuranceCode.ConvertToEnglish() : "";
command.ArchiveCode = !string.IsNullOrWhiteSpace(command.ArchiveCode) ? command.ArchiveCode.ConvertToEnglish() : "";
command.AgreementNumber = !string.IsNullOrWhiteSpace(command.AgreementNumber) ? command.AgreementNumber.ConvertToEnglish() : "";
command.TypeOfInsuranceSend = command.TypeOfInsuranceSend == "false" ? null : command.TypeOfInsuranceSend;
#region Vafa
if (command.HasRollCallFreeVip == "ture")
{
//var todayPersianDate = DateTime.Now.ToFirstDayOfNextMonth();
// var financialWorkshop
//double amount = Convert.ToDouble(0);
//var commandSaveRollCall = new CreateRollCallService()
//{
// AccountId = _authHelper.CurrentAccountId(),
// WorkshopId = command.Id,
// ServiceType = "VIP",
// EndService = command.EndService,
// Amount = amount,
// MaxPersonValid = -1,
// Duration = command.Duration,
//};
//var resultRollCall = _rollCallServiceApplication.Create(commandSaveRollCall);
}
#endregion
if (command.HasRollCallFreeVip == "on")
{
command.HasRollCallFreeVip = "true";
if (command.HasCustomizeCheckoutService == "on")
{
command.HasCustomizeCheckoutService = "true";
}
else
{
command.HasCustomizeCheckoutService = "false";
}
}
else
{
command.HasRollCallFreeVip = "false";
}
var result = _workshopApplication.Edit(command);
return new JsonResult(result);
}
else
{
var res2 = _workshopApplication.Err();
return new JsonResult(res2);
}
//else
//{
// var res3 = _workshopApplication.ExistErr();
// return new JsonResult(res3);
//}
}
} }

View File

@@ -762,7 +762,17 @@
<div class="more-buttons flexible-div"> <div class="more-buttons flexible-div">
<a class="btn pull-left employee-operations">عملیات</a> <a class="btn pull-left employee-operations">عملیات</a>
<div class="buttons-container"> <div class="buttons-container">
<a permission="10317" asp-page="/Company/PersonnelInfo/Index" asp-route-workshopID="@item.Id" class="btn btn-success rad btn-rounded @(item.HasBlockContractingParty?"disabled":"")"> @if (item.IsClassified)
{
<a permission="10317" asp-page="./ClassificationScheme" asp-route-workshopId="@item.Id" asp-route-workshopName="@item.WorkshopFullName" class="btn btn-success rad btn-rounded @(item.HasBlockContractingParty ? "disabled" : "")" style="background-color: #ec407a; border:#ec407a;">
<i class="fa fa-user"></i>
<p>
طرح طبقه بندی
</p>
</a>
}
<a permission="10317" asp-page="/Company/PersonnelInfo/Index" asp-route-workshopID="@item.Id" class="btn btn-success rad btn-rounded @(item.HasBlockContractingParty ? "disabled" : "")">
<i class="fa fa-user"></i> <i class="fa fa-user"></i>
<p> <p>
اطلاعات پرسنل اطلاعات پرسنل
@@ -771,13 +781,13 @@
@* <a href="#showmodal=@Url.Page("./Index", "ShowPersonnelList", new { id = item.Id })" class="btn btn-success rad btn-rounded @(item.HasBlockContractingParty?"disabled":"")"> *@ @* <a href="#showmodal=@Url.Page("./Index", "ShowPersonnelList", new { id = item.Id })" class="btn btn-success rad btn-rounded @(item.HasBlockContractingParty?"disabled":"")"> *@
<a permission="10319" asp-page="/Company/ConnectedPersonnels/Index" asp-route-workshopID="@item.Id" class="btn btn-success rad btn-rounded custom-btn-technical @(item.HasBlockContractingParty ? "disabled" : "")"> <a permission="10319" asp-page="/Company/ConnectedPersonnels/Index" asp-route-workshopID="@item.Id" class="btn btn-success rad btn-rounded custom-btn-technical @(item.HasBlockContractingParty ? "disabled" : "")">
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"> <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M13.3249 15.0763C12.8883 15.0257 12.4456 15 12 15C10.0188 15 8.09292 15.5085 6.52112 16.4465C5.30069 17.1749 4.34666 18.1307 3.74108 19.2183C3.46638 19.7117 3.79562 20.2902 4.34843 20.4054C7.85678 21.1365 11.4437 21.3594 15 21.074V21H14C12.3431 21 11 19.6569 11 18C11 16.5753 11.9932 15.3825 13.3249 15.0763Z" fill="white" /> <path fill-rule="evenodd" clip-rule="evenodd" d="M13.3249 15.0763C12.8883 15.0257 12.4456 15 12 15C10.0188 15 8.09292 15.5085 6.52112 16.4465C5.30069 17.1749 4.34666 18.1307 3.74108 19.2183C3.46638 19.7117 3.79562 20.2902 4.34843 20.4054C7.85678 21.1365 11.4437 21.3594 15 21.074V21H14C12.3431 21 11 19.6569 11 18C11 16.5753 11.9932 15.3825 13.3249 15.0763Z" fill="white"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M13.3249 15.0763C12.8883 15.0257 12.4456 15 12 15C10.0188 15 8.09292 15.5085 6.52112 16.4465C5.30069 17.1749 4.34666 18.1307 3.74108 19.2183C3.46638 19.7117 3.79562 20.2902 4.34843 20.4054C7.85678 21.1365 11.4437 21.3594 15 21.074V21H14C12.3431 21 11 19.6569 11 18C11 16.5753 11.9932 15.3825 13.3249 15.0763Z" fill="white" /> <path fill-rule="evenodd" clip-rule="evenodd" d="M13.3249 15.0763C12.8883 15.0257 12.4456 15 12 15C10.0188 15 8.09292 15.5085 6.52112 16.4465C5.30069 17.1749 4.34666 18.1307 3.74108 19.2183C3.46638 19.7117 3.79562 20.2902 4.34843 20.4054C7.85678 21.1365 11.4437 21.3594 15 21.074V21H14C12.3431 21 11 19.6569 11 18C11 16.5753 11.9932 15.3825 13.3249 15.0763Z" fill="white"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M13.3249 15.0763C12.8883 15.0257 12.4456 15 12 15C10.0188 15 8.09292 15.5085 6.52112 16.4465C5.30069 17.1749 4.34666 18.1307 3.74108 19.2183C3.46638 19.7117 3.79562 20.2902 4.34843 20.4054C7.85678 21.1365 11.4437 21.3594 15 21.074V21H14C12.3431 21 11 19.6569 11 18C11 16.5753 11.9932 15.3825 13.3249 15.0763Z" fill="white" /> <path fill-rule="evenodd" clip-rule="evenodd" d="M13.3249 15.0763C12.8883 15.0257 12.4456 15 12 15C10.0188 15 8.09292 15.5085 6.52112 16.4465C5.30069 17.1749 4.34666 18.1307 3.74108 19.2183C3.46638 19.7117 3.79562 20.2902 4.34843 20.4054C7.85678 21.1365 11.4437 21.3594 15 21.074V21H14C12.3431 21 11 19.6569 11 18C11 16.5753 11.9932 15.3825 13.3249 15.0763Z" fill="white"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M13.3249 15.0763C12.8883 15.0257 12.4456 15 12 15C10.0188 15 8.09292 15.5085 6.52112 16.4465C5.30069 17.1749 4.34666 18.1307 3.74108 19.2183C3.46638 19.7117 3.79562 20.2902 4.34843 20.4054C7.85678 21.1365 11.4437 21.3594 15 21.074V21H14C12.3431 21 11 19.6569 11 18C11 16.5753 11.9932 15.3825 13.3249 15.0763Z" fill="white" /> <path fill-rule="evenodd" clip-rule="evenodd" d="M13.3249 15.0763C12.8883 15.0257 12.4456 15 12 15C10.0188 15 8.09292 15.5085 6.52112 16.4465C5.30069 17.1749 4.34666 18.1307 3.74108 19.2183C3.46638 19.7117 3.79562 20.2902 4.34843 20.4054C7.85678 21.1365 11.4437 21.3594 15 21.074V21H14C12.3431 21 11 19.6569 11 18C11 16.5753 11.9932 15.3825 13.3249 15.0763Z" fill="white"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M13.3249 15.0763C12.8883 15.0257 12.4456 15 12 15C10.0188 15 8.09292 15.5085 6.52112 16.4465C5.30069 17.1749 4.34666 18.1307 3.74108 19.2183C3.46638 19.7117 3.79562 20.2902 4.34843 20.4054C7.85678 21.1365 11.4437 21.3594 15 21.074V21H14C12.3431 21 11 19.6569 11 18C11 16.5753 11.9932 15.3825 13.3249 15.0763Z" fill="white" /> <path fill-rule="evenodd" clip-rule="evenodd" d="M13.3249 15.0763C12.8883 15.0257 12.4456 15 12 15C10.0188 15 8.09292 15.5085 6.52112 16.4465C5.30069 17.1749 4.34666 18.1307 3.74108 19.2183C3.46638 19.7117 3.79562 20.2902 4.34843 20.4054C7.85678 21.1365 11.4437 21.3594 15 21.074V21H14C12.3431 21 11 19.6569 11 18C11 16.5753 11.9932 15.3825 13.3249 15.0763Z" fill="white"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M17.5439 14C17.8028 14 18.0196 14.1962 18.0454 14.4538C18.0854 14.8539 18.5548 15.0483 18.866 14.7937C19.0663 14.6298 19.3584 14.6443 19.5414 14.8274L19.8393 15.1252C20.0223 15.3083 20.0369 15.6003 19.8729 15.8007C19.6183 16.1119 19.8128 16.5813 20.2128 16.6213C20.4705 16.647 20.6667 16.8638 20.6667 17.1227V17.544C20.6667 17.8028 20.4705 18.0196 20.2129 18.0454C19.8129 18.0854 19.6184 18.5547 19.873 18.8659C20.0369 19.0662 20.0224 19.3582 19.8393 19.5413L19.5414 19.8391C19.3584 20.0222 19.0664 20.0368 18.866 19.8728C18.5548 19.6182 18.0854 19.8127 18.0454 20.2128C18.0196 20.4704 17.8028 20.6667 17.5439 20.6667H17.1227C16.8638 20.6667 16.647 20.4705 16.6213 20.2129C16.5813 19.8128 16.1119 19.6183 15.8007 19.873C15.6003 20.0369 15.3083 20.0223 15.1252 19.8393L14.8274 19.5414C14.6443 19.3584 14.6297 19.0664 14.7937 18.866C15.0483 18.5548 14.8539 18.0854 14.4538 18.0454C14.1962 18.0196 14 17.8028 14 17.5439V17.1228C14 16.8639 14.1962 16.647 14.4539 16.6213C14.854 16.5813 15.0484 16.1118 14.7938 15.8006C14.6298 15.6002 14.6443 15.3081 14.8274 15.125L15.1252 14.8273C15.3083 14.6442 15.6003 14.6296 15.8007 14.7936C16.1119 15.0482 16.5813 14.8538 16.6213 14.4538C16.647 14.1962 16.8638 14 17.1227 14H17.5439ZM17.3333 18.6667C18.0697 18.6667 18.6667 18.0697 18.6667 17.3333C18.6667 16.597 18.0697 16 17.3333 16C16.597 16 16 16.597 16 17.3333C16 18.0697 16.597 18.6667 17.3333 18.6667Z" fill="white" /> <path fill-rule="evenodd" clip-rule="evenodd" d="M17.5439 14C17.8028 14 18.0196 14.1962 18.0454 14.4538C18.0854 14.8539 18.5548 15.0483 18.866 14.7937C19.0663 14.6298 19.3584 14.6443 19.5414 14.8274L19.8393 15.1252C20.0223 15.3083 20.0369 15.6003 19.8729 15.8007C19.6183 16.1119 19.8128 16.5813 20.2128 16.6213C20.4705 16.647 20.6667 16.8638 20.6667 17.1227V17.544C20.6667 17.8028 20.4705 18.0196 20.2129 18.0454C19.8129 18.0854 19.6184 18.5547 19.873 18.8659C20.0369 19.0662 20.0224 19.3582 19.8393 19.5413L19.5414 19.8391C19.3584 20.0222 19.0664 20.0368 18.866 19.8728C18.5548 19.6182 18.0854 19.8127 18.0454 20.2128C18.0196 20.4704 17.8028 20.6667 17.5439 20.6667H17.1227C16.8638 20.6667 16.647 20.4705 16.6213 20.2129C16.5813 19.8128 16.1119 19.6183 15.8007 19.873C15.6003 20.0369 15.3083 20.0223 15.1252 19.8393L14.8274 19.5414C14.6443 19.3584 14.6297 19.0664 14.7937 18.866C15.0483 18.5548 14.8539 18.0854 14.4538 18.0454C14.1962 18.0196 14 17.8028 14 17.5439V17.1228C14 16.8639 14.1962 16.647 14.4539 16.6213C14.854 16.5813 15.0484 16.1118 14.7938 15.8006C14.6298 15.6002 14.6443 15.3081 14.8274 15.125L15.1252 14.8273C15.3083 14.6442 15.6003 14.6296 15.8007 14.7936C16.1119 15.0482 16.5813 14.8538 16.6213 14.4538C16.647 14.1962 16.8638 14 17.1227 14H17.5439ZM17.3333 18.6667C18.0697 18.6667 18.6667 18.0697 18.6667 17.3333C18.6667 16.597 18.0697 16 17.3333 16C16.597 16 16 16.597 16 17.3333C16 18.0697 16.597 18.6667 17.3333 18.6667Z" fill="white"/>
<circle cx="12" cy="8" r="5" fill="white" /> <circle cx="12" cy="8" r="5" fill="white"/>
</svg> </svg>
<p> <p>

View File

@@ -0,0 +1,185 @@
@model CompanyManagment.App.Contracts.ClassificationScheme.AddEmployeeToGroup
@Html.AntiForgeryToken()
@{
<style>
.modal .modal-dialog .modal-content {
padding-bottom: 10px !important;
}
.modal-footer {
padding: 0.5rem 1rem !important; /* کوچکتر کردن فاصله */
margin-top: -10px; /* کمی بالا آوردن */
}
.modal .modal-dialog .modal-content {
padding-bottom: 10px;
}
</style>
}
<div class="modal-header">
<h5 class="modal-title">افزودن پرسنل به گروه</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="بستن">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
<div class="row m-t-10">
<h5 class="modal-title">@Model.EmployeeFullName</h5>
</div>
<div class="card shadow-sm border-0" style="margin-top: 31px;">
<div class="card-body">
<div class="lineDiv"></div>
<div class="row m-t-10">
<div class="col-md-6 mb-3">
<select id="groupList" asp-for="GroupId" class="form-select form-control" onchange="selectGroup(this)">
<option value="0">انتخاب گروه</option>
@foreach (var item in @Model.ClassificationGroupList)
{
<option value="@item.GroupId" data-groupno="@item.GroupNo"><span>گروه</span><span>&nbsp;</span><span>@item.GroupNo</span></option>
}
</select>
</div>
<div class="col-md-6 mb-3">
<select id="jobList" asp-for="JobId" class="form-select form-control">
<option value="0">انتخاب سمت</option>
</select>
</div>
<div id="groupHiddenInputs">
</div>
<div id="jobHiddenInputs">
</div>
</div>
<div class="lineDiv"></div>
</div>
</div>
</div>
<input type="hidden" asp-for="SchemeId" value="@Model.SchemeId" />
<input type="hidden" asp-for="EmployeeId" value="@Model.EmployeeId" />
<div class="modal-footer border-0">
<button type="button" onclick="saveBtn()" class="btn btn-success px-4 rounded-pill">ذخیره</button>
<button type="button" class="btn btn-outline-secondary px-4 rounded-pill" data-dismiss="modal">بستن</button>
</div>
<script>
function selectGroup(selectElement) {
const selectedOption = selectElement.options[selectElement.selectedIndex];
const groupId = selectedOption.value;
// const groupNo = selectedOption.getAttribute("data-groupno");
// $('#groupHiddenInputs').html('');
// const inputs =`
// <input type="hidden" name="GroupId" value="${groupId}" />
// `;
// $('#groupHiddenInputs').append(inputs);
let schemeId = '@Model.SchemeId';
var url = `/Admin/Company/Workshops/ClassificationScheme?handler=JobList&schemeId=${schemeId}&groupId=${groupId}`;
console.log("Request URL:", url);
$.get(url, function (data) {
// فرض بر این است که data.jobs یک آرایه از آبجکت‌هایی مثل { jobId, jobName, jobCode } باشد
const jobList = $("#jobList");
jobList.empty(); // پاک کردن آیتم‌های قبلی
jobList.append('<option value="0">انتخاب سمت</option>');
data.jobs.forEach(item => {
jobList.append(
`<option value="${item.jobId}" data-jobname="${item.jobName}" data-jobcode="${item.jobCode}">
${item.jobCode} - ${item.jobName}
</option>`
);
});
});
}
// function selectJob(selectElement) {
// const selectedOption = selectElement.options[selectElement.selectedIndex];
// const jobId = selectedOption.value;
// // const jobname = selectedOption.getAttribute("data-jobname");
// // const jobcode = selectedOption.getAttribute("data-jobcode");
// $('#jobHiddenInputs').html('');
// const inputs =`
// <input type="hidden" name="jobId" value="${jobId}" />
// `;
// $('#jobHiddenInputs').append(inputs);
// }
function saveBtn() {
const groupSelect = document.getElementById("groupList");
const jobSelect = document.getElementById("jobList");
const groupId = groupSelect.options[groupSelect.selectedIndex].value;
const jobId = jobSelect.options[jobSelect.selectedIndex].value;
if (groupId == 0) {
$.Notification.autoHideNotify('error', 'top center', 'پیام سیستم', "گروه را انتخاب کنید");
return;
}
if (jobId == 0) {
$.Notification.autoHideNotify('error', 'top center', 'پیام سیستم', "سمت را انتخاب کنید");
return;
}
const command = {
employeeId: '@Model.EmployeeId',
schemeId: '@Model.SchemeId',
groupId: Number(groupId),
jobId: Number(jobId)
};
var urlAjaxToSave = '@Url.Page("/Company/Workshops/ClassificationScheme", "AddToGroup")';
$.ajax({
dataType: 'json',
type: 'POST',
url: urlAjaxToSave,
headers: { "RequestVerificationToken": $('input[name="__RequestVerificationToken"]').val() },
data: command,
success: function (response) {
if(response.isSuccess){
$.Notification.autoHideNotify('success', 'top center', 'پیام سیستم ', response.message);
$('.close').click();
setTimeout(function () {
$('#addEmployeesTab').click();
}, 1000);
}else{
$.Notification.autoHideNotify('error', 'top center', 'پیام سیستم ', response.message);
}
},
failure: function (response) {
//console.log(5, response);
}
});
}
</script>

View File

@@ -0,0 +1,697 @@
@model CompanyManagment.App.Contracts.ClassificationScheme.EmployeeInfoTab
@{
<style>
.container .searchPannel {
background: #fbfbff;
border-radius: 20px;
margin-bottom: 20px;
box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
border: 1px solid #e6e6e6;
min-height: 680px;
padding: 8px;
}
.container .filter {
background: #fbfbff;
border-radius: 20px;
margin: 20px 0px;
box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
border: 1px solid #e6e6e6;
}
table {
border-collapse: separate;
border-spacing: 0;
padding: 0 0 0 4px;
}
.table > thead > tr > th {
border-bottom: 2px #fbfbff !important;
background-color: #2dbcbc;
color: #fff;
font-weight: 200;
vertical-align: middle;
}
.table > tbody > tr > td {
color: #131313;
border-top: 2px solid #fbfbff !important;
background-color: #ddf4f4;
text-wrap: nowrap;
}
.table > tbody > tr.withdraw > td {
background-color: #b5b5b5 !important;
}
tr td:first-child {
border-top-right-radius: 10px;
border-bottom-right-radius: 10px;
}
tr td:last-child {
border-top-left-radius: 10px;
border-bottom-left-radius: 10px;
}
tr:nth-child(even) td {
background-color: #b0e0e08f !important;
}
tr th:first-child {
border-top-right-radius: 10px;
border-bottom-right-radius: 10px;
}
tr th:last-child {
border-top-left-radius: 10px;
border-bottom-left-radius: 10px;
}
.successSend {
background-color: #b8e3bc;
color: #638f6e;
padding: 2px 7px;
border-radius: 5px;
}
.numbers {
background-color: rgb(187, 240, 240);
color: #0B5959;
display: flex;
width: 30px;
border-radius: 5px;
height: 30px;
align-items: center;
justify-content: center;
}
.errored {
animation: shake 300ms;
box-shadow: inset 0 0 2px #eb3434, 0 0 5px #eb3434 !important;
border: 1px solid #eb3434 !important;
}
@@media screen and (min-width: 1600px) {
.table > thead > tr > th {
font-size: 12px;
}
.table > tbody > tr > td {
font-size: 11px;
}
}
.date-box {
display: flex;
background-color: #e7dbff;
align-items: center;
padding: 7px;
border-radius: 10px;
margin: 3px;
width: 24.6%;
color: #131313;
}
.selectTo {
background-color: #ceebeb;
align-items: center;
padding: 7px;
border-radius: 10px;
}
.bottomRow {
background-color: #e7dbff;
align-items: center;
padding: 7px;
border-radius: 10px;
margin: 3px;
width: 24.6%
}
.searchAll {
background-color: #8892b3;
border-color: #8892b3;
font-family: 'Web_Yekan' !important;
}
.searchOne {
border-bottom-left-radius: 0px;
border-top-left-radius: 0px;
background-color: #3da9c6;
border-color: #3da9c6;
font-family: 'Web_Yekan' !important;
margin-left: -3px;
}
.searchOne:hover, .searchOne:focus, .searchOne:active {
background-color: #8fe1e9;
border-color: #8fe1e9;
}
.searchAll:hover, .searchAll:focus, .searchAll:active {
background-color: #40424b;
border-color: #40424b;
}
.searchOne i {
padding-left: 3px;
font-size: 14px;
}
@@media only screen and (max-width : 1820px) {
.date-box {
width: 24.2%
}
.selectTo {
width: 24.2%
}
.bottomRow {
width: 24.2%
}
}
@@media only screen and (max-width : 992px) {
.date-box {
width: 100%;
margin: 0px 0px 2px 0px;
}
.selectTo {
width: 49%;
margin: 0px 0px 2px 0px;
}
.contractingParty {
width: 100%;
margin: 0px 0px 2px 0px;
}
.startDate {
margin: 0px 0px 2px 0px;
width: 50%;
}
.endDate {
margin: 0px 0px 2px 0px;
width: 50%
}
.bottomRow {
margin: 0px 0px 2px 0px;
width: 50%
}
.searchAll {
width: 49.5%;
}
.searchOne {
width: 49.8%;
}
}
@@media only screen and (max-width : 375px) {
.date-box {
width: 100%;
margin: 0px 0px 2px 0px;
}
.selectTo {
width: 49%;
margin: 0px 0px 2px 0px;
}
.contractingParty {
width: 100%;
margin: 0px 0px 2px 0px;
}
.startDate {
margin: 0px 0px 2px 0px;
width: 50%;
}
.endDate {
margin: 0px 0px 2px 0px;
width: 50%
}
.bottomRow {
margin: 0px 0px 2px 0px;
width: 50%
}
}
.panel-title {
padding: 2px 10px;
}
::-webkit-scrollbar {
width: 8px;
}
::-webkit-scrollbar-track {
background: #dfdfdf;
border-radius: 5px;
}
::-webkit-scrollbar-thumb {
background: #3c8397;
border-radius: 5px;
}
.goToTop {
position: fixed;
bottom: 40px;
}
.titlePanel {
display: flex;
align-items: center;
justify-content: space-between;
margin: 2px 0;
}
.btn-print-all {
background: #06b6d4;
border: 0;
padding: 4px 8px;
border-radius: 5px;
color: #fff;
transition: all .1s ease-in;
}
.btn-print-all:hover {
background: #0891b2;
}
.btn-print {
background: #8892b3;
padding: 4px 6px;
border-radius: 5px;
transition: all .1s ease-in;
border: 0;
color: #fff;
height: 32px;
width: 32px;
display: flex;
float: left;
}
.btn-print:hover {
background: #0284c7;
color: #ffffff;
}
.table-wrapper {
height: 630px;
overflow-y: scroll;
scrollbar-width: thin;
}
tr.sticky {
position: sticky;
top: 0;
z-index: 1;
}
.tooltiptext {
cursor: text;
font-size: 1rem;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}
.new-tooltip {
cursor: pointer;
position: relative;
display: inline-block;
}
.new-tooltip .tooltiptext {
width: 100px;
background-color: rgba(0, 0, 0, 0.8);
color: #fff;
-webkit-backdrop-filter: blur(1px);
backdrop-filter: blur(1px);
text-align: center;
border-radius: 6px;
font-weight: semi-bold;
padding: 5px 5px 5px 8px;
transition: opacity 0.5s, visibility 0.5s;
opacity: 0;
visibility: hidden;
pointer-events: none;
position: absolute;
z-index: 1;
bottom: 25px;
left: -45px;
}
.new-tooltip:hover .tooltiptext {
pointer-events: auto;
opacity: 1;
visibility: visible;
}
.skeleton-loader {
width: 100%;
height: 35px;
background: linear-gradient(90deg, #EEEEEE 25%, #DEDEDE 50%, #EEEEEE 75%);
background-size: 200% 100%;
animation: loading 2s infinite ease-in-out;
border-radius: 8px;
margin-bottom: 3px
}
@@keyframes loading {
0% {
background-position: 200% 0;
}
100% {
background-position: -200% 0;
}
}
@@media (max-width: 991px) {
.responsive {
border-collapse: separate;
border-spacing: 0 10px;
}
.responsive > thead th {
display: none;
}
.responsive > tbody td,
.responsive > tbody th {
display: block;
}
.responsive > tbody > tr:nth-child(even) td,
.responsive > tbody > tr:nth-child(even) th {
background-color: #eee;
}
.responsive > tbody > tr > td {
font-size: 11px;
display: flex;
align-items: center;
border-top: 1px solid #fbfbff !important;
}
.responsive > tbody > tr td:first-child {
border-radius: 10px 10px 0 0;
}
.responsive > tbody > tr td:last-child {
border-radius: 0 0 10px 10px;
}
[row-header] {
position: relative;
/* width: 50%;*/
vertical-align: middle;
}
[row-header]:before {
content: attr(row-header);
display: flex;
text-align: right;
width: 125px;
padding-left: 30px;
white-space: break-spaces;
overflow: hidden;
align-items: center;
}
}
.icon-span {
display: inline-block;
text-align: center;
vertical-align: middle;
line-height: 14px;
border-radius: 5px;
padding: 2px;
}
.icon-span{
cursor: pointer;
}
.icon-span svg {
vertical-align: middle;
}
.add-to-group {
background-color: #84cc16;
color: white !important;
}
.edit-group-member {
background-color: #009ee2;
color: white !important;
}
.transfer-group-member{
background-color: #75aea7;
color: white !important;
}
.job-btn-text{
color: white !important;
}
</style>
var i = 1;
var successSend = "successSend";
}
<div class="container filter">
<h3 class="panel-title" style="display: inline-block;color: #7a96a6"><i class="fa fa-search" style="padding-left: 3px; font-size: 14px"></i> جستجو</h3>
<div class="row" style="padding: 15px 10px">
<div class="col-md-3 col-sm-6 col-xs-12 pull-right contractingParty">
<div class="form-group selectTo" style="width: 100% !important; margin: 0 auto;">
<input style="width: 100%" id="FullName" placeholder="نام پرسنل" class="form-control"/>
</div>
</div>
</div>
</div>
<div class="container searchPannel">
<div class="titlePanel">
<h3 class="panel-title" style="display: inline-block;color: #131313;font-size: 15px;">
<i class="fa fa-list" style="padding-left: 3px; font-size: 14px"></i>
لیست پرسنل
</h3>
</div>
<div class="table-wrapper">
<div id="loading" style="padding: 0 0 0 5px;">
@for (var j = 0; j < 16; j++)
{
<div class="skeleton-loader"></div>
}
</div>
<div id="RealodData"></div>
</div>
</div>
<script>
$(document).ready(function() {
let schemeId = '@Model.SchemeId';
$("#FullName").keyup(function() {
const fullname = $(this).val();
LoadData(schemeId, fullname);
});
LoadData(schemeId, fullname = "");
function LoadData(schemeId, fullName) {
$.ajax({
dataType: 'json',
url: '@Url.Page("/Company/Workshops/ClassificationScheme", "AjaxDataLoading")',
type: 'GET',
data: {schemeId: schemeId, fullName: fullName},
success: function(response) {
$('#loading').hide();
$('#RealodData').html('');
var DataTableHtml = '';
if (!response.hasEmployee) {
DataTableHtml += '<h1 style="height: 600px;display: flex;align-items: center;justify-content: center;">این کارگاه پرسنلی ندارد!</h1>';
} else {
const data = response.personnelList;
var i = 0;
DataTableHtml += `<table class="table responsive">
<thead>
<tr class="sticky">
<th>ردیف</th>
<th>نام و نام خانوادگی</th>
<th style="text-align: center;">آخرین تاریخ شروع بکار قرارداد</th>
<th style="text-align: center;">تاریخ ترک کار قرارداد</th>
<th style="text-align: center;">آخرین تاریخ شروع بکار بیمه</th>
<th style="text-align: center;">تاریخ ترک کار بیمه</th>
<th style="text-align: center;">وضعیت گروه</th>
<th style="text-align: center;">عضویت گروه</th>`;
DataTableHtml += `<th style="text-align: left;">عملیات</th>`;
DataTableHtml += `</tr>
</thead>
<tbody class="tb">`;
data.forEach(function(item) {
DataTableHtml += `
<tr class="${item.black ? "withdraw" : ""}">
<td row-header="ردیف" style="text-align: center">
<span class="numbers">
${i += 1}
<span class="idPersonnel" style="display: none;">${item.employeeId}</span>
</span>
</td>
<td row-header="نام و نام خانوادگی">${item.fullName}</td>`;
DataTableHtml += `</td>
<td row-header="آخرین تاریخ شروع بکار قرارداد" class="text-center">`;
if (item.lastStartContractWork == null || item.lastStartContractWork == "") {
DataTableHtml += `<span>-</span>`;
} else {
DataTableHtml += `${item.lastStartContractWork}`;
}
DataTableHtml += `</td>
<td row-header="تاریخ ترک کار قرارداد" class="text-center">`;
if (item.lastLeftContractWork == null || item.lastLeftContractWork == "") {
DataTableHtml += `<span>-</span>`;
} else {
DataTableHtml += `${item.lastLeftContractWork}`;
}
DataTableHtml += `</td>
<td row-header="آخرین تاریخ شروع بکار بیمه" class="text-center">`;
if (item.lastStartInsuranceWork == null || item.lastStartInsuranceWork == "") {
DataTableHtml += `<span>-</span>`;
} else {
DataTableHtml += `${item.lastStartInsuranceWork}`;
}
DataTableHtml += `</td>
<td row-header="تاریخ ترک کار بیمه" class="text-center">`;
if (item.lastLeftInsuranceWork == null || item.lastLeftInsuranceWork == "") {
DataTableHtml += `<span>-</span>`;
} else {
DataTableHtml += `${item.lastLeftInsuranceWork}`;
}
DataTableHtml += `</td>
<td row-header="وضعیت گروه" class="text-center">`;
if (item.hasGroup) {
DataTableHtml += `<span style="background-color: #99d0b0;padding: 5px;border-radius: 5px;">دارای گروه</span>`;
} else {
DataTableHtml += `<span style="background-color: #ffbfbf;padding: 5px;border-radius: 5px;">فاقد گروه</span>`;
}
DataTableHtml += `</td>
<td row-header="عضویت گروه" class="text-center">`;
if (item.hasGroup) {
DataTableHtml += `${item.groupNo}`;;
} else {
DataTableHtml += `<span>-</span>`;
}
DataTableHtml += `<td row-header="عملیات" style="direction: ltr;">`;
if (item.hasGroup)
{
DataTableHtml += `
<span class="icon-span edit-group-member" style="padding: 4px;font-size: 11px;">
<a onclick="editGroupMember(${item.employeeId}, '${item.fullName}')" >
<span class="job-btn-text">ویرایش</span>
<svg width="19" height="18" viewBox="0 0 22 22" fill="none" xmlns="http://www.w3.org/2000/svg">
<circle cx="11" cy="11" r="8.25" stroke="white" />
<path d="M11 13.75L11 8.25" stroke="white" stroke-linecap="round" />
<path d="M13.75 11L8.25 11" stroke="white" stroke-linecap="round" />
</svg>
</a>
</span>`;
DataTableHtml += `
<span class="icon-span transfer-group-member" style="padding: 4px;font-size: 11px;">
<a href="#" onclick="editGroupMember(${item.employeeId}, '${item.fullName}')" >
<span class="job-btn-text">انتقال</span>
<svg width="19" height="18" viewBox="0 0 22 22" fill="none" xmlns="http://www.w3.org/2000/svg">
<circle cx="11" cy="11" r="8.25" stroke="white" />
<path d="M11 13.75L11 8.25" stroke="white" stroke-linecap="round" />
<path d="M13.75 11L8.25 11" stroke="white" stroke-linecap="round" />
</svg>
</a>
</span>`;
}
else
{
DataTableHtml += `
<span class="icon-span add-to-group" style="padding: 4px 18px;font-size: 11px;">
<a onclick="addToGroup(${item.employeeId}, '${item.fullName}')">
<span class="job-btn-text">افزودن به گروه</span>
<svg width="19" height="18" viewBox="0 0 22 22" fill="none" xmlns="http://www.w3.org/2000/svg">
<circle cx="11" cy="11" r="8.25" stroke="white" />
<path d="M11 13.75L11 8.25" stroke="white" stroke-linecap="round" />
<path d="M13.75 11L8.25 11" stroke="white" stroke-linecap="round" />
</svg>
</a>
</span>`;
}
DataTableHtml += `</td></tr>`;
});
DataTableHtml += `</tbody></table>`;
}
$('#RealodData').append(DataTableHtml);
},
error: function(xhr, status, error) {
console.error(xhr.responseText);
}
});
}
});
function addToGroup(employeeId, fullName){
let schemeId = '@Model.SchemeId';
const parametr = `&employeeId=${employeeId}&schemeId=${schemeId}&employeeFullName=${fullName}`;
const url = '#showmodal=@Url.Page("/Company/Workshops/ClassificationScheme", "AddToGroup")';
window.location.href = url + parametr;
}
function editGroupMember(employeeId, fullName){
let schemeId = '@Model.SchemeId';
const parametr = `&employeeId=${employeeId}&schemeId=${schemeId}&employeeFullName=${fullName}`;
const url = '#showmodal=@Url.Page("/Company/Workshops/ClassificationScheme", "EditGroupMember")';
window.location.href = url + parametr;
}
</script>

View File

@@ -0,0 +1,162 @@
@model List<CompanyManagment.App.Contracts.ClassificationScheme.ClassificationGroupAndJobModel>
@{
<style>
.tr-table-add {
background-color: #dfdfdf;
border-radius: 5px;
padding: 7px 1px;
margin: 20px;
}
.tr-table-edit {
background-color: #ddf4f4;
border-radius: 5px;
padding: 7px 1px;
margin: 20px;
}
.row-number {
background-color: rgb(187, 240, 240);
color: #0B5959;
width: 80px;
height: 24px;
line-height: 24px;
text-align: center;
border-radius: 5px;
}
.icon-span {
display: inline-block;
text-align: center;
vertical-align: middle;
line-height: 14px;
border-radius: 5px;
padding: 2px;
}
.icon-span svg {
vertical-align: middle;
}
.add-jobs{
background-color: #84cc16;
color:white;
}
.edit-jobs {
background-color: #009ee2;
color: white;
}
</style>
}
<div class="card card-pattern m-t-10">
<div class="row">
<!-- گروه 1 تا 10 -->
<div class="col-12 col-md-6">
@foreach (var itemRight in Model.Take(10))
{
<div class="row align-items-center mb-2 p-2 @(itemRight.EditClassificationGroupJob.Count < 1 ? "tr-table-add" : "tr-table-edit")" data-groupid="@itemRight.GroupId">
<div class="col-3 col-md-3">
<div class="row-number">
<span>گروه</span>
<span>&nbsp;</span>
<span>@itemRight.GroupNo</span>
</div>
</div>
<div class="col-6 col-md-6"></div>
<div class="col-3 col-md-3 align-items-center" style="float:left; direction:ltr">
<a href="#showmodal=@Url.Page("./ClassificationScheme", "CreateOrEditJobs" ,new {groupId = itemRight.GroupId , groupNo = itemRight.GroupNo})">
<span class="icon-span @(itemRight.EditClassificationGroupJob.Count < 1 ? "add-jobs" : "edit-jobs")" style="padding: 4px;font-size: 11px;">
@if (itemRight.EditClassificationGroupJob.Count < 1)
{
<span class="job-btn-text">افزودن شغل</span>
<svg width="19" height="18" viewBox="0 0 22 22" fill="none" xmlns="http://www.w3.org/2000/svg">
<circle cx="11" cy="11" r="8.25" stroke="white" />
<path d="M11 13.75L11 8.25" stroke="white" stroke-linecap="round" />
<path d="M13.75 11L8.25 11" stroke="white" stroke-linecap="round" />
</svg>
}
else
{
<span class="job-btn-text">ویرایش شغل</span>
<svg width="19" height="18" viewBox="0 0 19 20" fill="none" xmlns="http://www.w3.org/2000/svg" >
<rect width="18.5047" height="18.5047" transform="translate(0.074707 0.679688)" fill="#ADE7F2"></rect>
<path d="M11.3213 5.25293C11.5664 5.19964 11.8217 5.20913 12.0635 5.28027L12.2178 5.33691C12.3659 5.40344 12.4945 5.49613 12.6152 5.59766C12.7711 5.72874 12.9467 5.90375 13.1504 6.10742L13.4326 6.39258C13.5184 6.48132 13.5946 6.56459 13.6602 6.64258C13.7953 6.80336 13.914 6.97832 13.9775 7.19434L14.0049 7.29883C14.0506 7.50888 14.0506 7.72647 14.0049 7.93652L13.9775 8.04102C13.914 8.25701 13.7953 8.43201 13.6602 8.59277C13.5946 8.67073 13.5184 8.75407 13.4326 8.84277L13.1504 9.12793L7.75879 14.5186C7.62672 14.6506 7.50929 14.7722 7.37793 14.8701L7.24121 14.959C7.14574 15.013 7.04539 15.0527 6.93848 15.0859L6.59766 15.1768L4.85938 15.6113C4.69519 15.6524 4.51668 15.6984 4.36816 15.7129C4.23271 15.7261 4.01567 15.7249 3.82324 15.584L3.74316 15.5146C3.53379 15.3053 3.52979 15.0444 3.54492 14.8896C3.55945 14.7411 3.60544 14.5626 3.64648 14.3984L4.08105 12.6602L4.17188 12.3193C4.20508 12.2124 4.24479 12.1121 4.29883 12.0166L4.3877 11.8799C4.48563 11.7485 4.60719 11.6311 4.73926 11.499L10.1299 6.10742L10.415 5.8252C10.5036 5.7396 10.5862 5.66312 10.6641 5.59766C10.8249 5.46245 11.0007 5.34385 11.2168 5.28027L11.3213 5.25293Z" stroke="#009EE2"></path>
<path d="M9.7124 6.46393L12.0255 4.92188L14.3386 7.23496L12.7965 9.54804L9.7124 6.46393Z" fill="#009EE2"></path>
</svg>
}
</span>
</a>
</div>
</div>
}
</div>
<!-- گروه 11 تا 20 -->
<div class="col-12 col-md-6">
@foreach (var itemLeft in Model.Skip(10))
{
<div class="row align-items-center mb-2 p-2 @(itemLeft.EditClassificationGroupJob.Count < 1 ? "tr-table-add" : "tr-table-edit")" data-groupid="@itemLeft.GroupId">
<div class="col-3 col-md-3">
<div class="row-number">
<span>گروه</span>
<span>&nbsp;</span>
<span>@itemLeft.GroupNo</span>
</div>
</div>
<div class="col-6 col-md-6"></div>
<div class="col-3 col-md-3 align-items-center" style="float:left; direction:ltr">
<a href="#showmodal=@Url.Page("./ClassificationScheme", "CreateOrEditJobs" ,new {groupId = itemLeft.GroupId , groupNo = itemLeft.GroupNo})">
<span class="icon-span @(itemLeft.EditClassificationGroupJob.Count < 1 ? "add-jobs" : "edit-jobs")" style="padding: 4px;font-size: 11px;">
@if (itemLeft.EditClassificationGroupJob.Count < 1)
{
<span class="job-btn-text">افزودن شغل</span>
<svg width="19" height="18" viewBox="0 0 22 22" fill="none" xmlns="http://www.w3.org/2000/svg">
<circle cx="11" cy="11" r="8.25" stroke="white" />
<path d="M11 13.75L11 8.25" stroke="white" stroke-linecap="round" />
<path d="M13.75 11L8.25 11" stroke="white" stroke-linecap="round" />
</svg>
}
else
{
<span class="job-btn-text">ویرایش شغل</span>
<svg width="19" height="18" viewBox="0 0 19 20" fill="none" xmlns="http://www.w3.org/2000/svg">
<rect width="18.5047" height="18.5047" transform="translate(0.074707 0.679688)" fill="#ADE7F2"></rect>
<path d="M11.3213 5.25293C11.5664 5.19964 11.8217 5.20913 12.0635 5.28027L12.2178 5.33691C12.3659 5.40344 12.4945 5.49613 12.6152 5.59766C12.7711 5.72874 12.9467 5.90375 13.1504 6.10742L13.4326 6.39258C13.5184 6.48132 13.5946 6.56459 13.6602 6.64258C13.7953 6.80336 13.914 6.97832 13.9775 7.19434L14.0049 7.29883C14.0506 7.50888 14.0506 7.72647 14.0049 7.93652L13.9775 8.04102C13.914 8.25701 13.7953 8.43201 13.6602 8.59277C13.5946 8.67073 13.5184 8.75407 13.4326 8.84277L13.1504 9.12793L7.75879 14.5186C7.62672 14.6506 7.50929 14.7722 7.37793 14.8701L7.24121 14.959C7.14574 15.013 7.04539 15.0527 6.93848 15.0859L6.59766 15.1768L4.85938 15.6113C4.69519 15.6524 4.51668 15.6984 4.36816 15.7129C4.23271 15.7261 4.01567 15.7249 3.82324 15.584L3.74316 15.5146C3.53379 15.3053 3.52979 15.0444 3.54492 14.8896C3.55945 14.7411 3.60544 14.5626 3.64648 14.3984L4.08105 12.6602L4.17188 12.3193C4.20508 12.2124 4.24479 12.1121 4.29883 12.0166L4.3877 11.8799C4.48563 11.7485 4.60719 11.6311 4.73926 11.499L10.1299 6.10742L10.415 5.8252C10.5036 5.7396 10.5862 5.66312 10.6641 5.59766C10.8249 5.46245 11.0007 5.34385 11.2168 5.28027L11.3213 5.25293Z" stroke="#009EE2"></path>
<path d="M9.7124 6.46393L12.0255 4.92188L14.3386 7.23496L12.7965 9.54804L9.7124 6.46393Z" fill="#009EE2"></path>
</svg>
}
</span>
</a>
</div>
</div>
}
</div>
</div>
</div>

View File

@@ -0,0 +1,154 @@
@model CompanyManagment.App.Contracts.ClassificationScheme.SalaryAndRialCoefficientTab
@{
<style>
.card-scroll {
/* ارتفاع از بالا تا پایین صفحه، با در نظر گرفتن فاصله از پایین */
height: calc(100vh - 270px); /* فاصله از بالا یا هدر */
margin-bottom: 10px; /* فاصله از پایین صفحه */
display: flex;
flex-direction: column;
}
.card-scroll .card-content {
flex: 1; /* پر کردن فضای باقیمانده */
overflow-y: auto; /* فقط وقتی نیاز شد اسکرول بده */
padding: 10px;
}
.head-table {
font-size: 14px;
background-color: #2dbcbc;
padding: 4px 1px;
border-radius: 5px;
color: aliceblue;
margin-bottom: 9px;
}
.tr-table {
background-color: #ddf4f4;
border-radius: 5px;
padding: 4px 1px;
margin-bottom: 5px;
font-family: "IranText" !important;
}
.row-number {
background-color: rgb(187, 240, 240);
color: #0B5959;
width: 24px;
height: 24px;
line-height: 24px;
text-align: center;
border-radius: 5px;
}
.icon-span {
display: inline-block;
text-align: center;
vertical-align: middle;
line-height: 14px;
border-radius: 5px;
padding: 2px;
}
.icon-span svg {
vertical-align: middle;
}
.addSalaries{
font-size: 16px;
align-self: center;
border-radius: 5px;
}
</style>
int rowIndex = 1;
}
<div class="card card-pattern m-t-10 card-scroll">
<div class="card-content">
<div class="container-fluid">
<div class="row" style="margin-bottom: 10px">
<a class="btn btn-success addSalaries" href="#showmodal=@Url.Page("./ClassificationScheme", "CreateSalaries" ,new {schemeId = @Model.SchemeId})">
افزودن دستمزدها
</a>
</div>
<!-- هدر -->
<div class="row fw-bold mb-2 head-table">
<div class="col-2 col-md-1">ردیف</div>
<div class="col-10 col-md-2">سال</div>
<div class="col-6 col-md-2">تاریخ شروع</div>
<div class="col-6 col-md-2">تاریخ پایان</div>
<div class="col-6 col-md-2" style="direction:ltr"> ضریب ریالی </div>
<div class="col-12 col-md-3" style="float:left; direction:ltr">عملیات</div>
</div>
@if (!Model.HasAnySalaries)
{
<h2 style="color: #c2b8b4;text-align: center;margin-top: 55px;">
هنوز هیچ دستمزدی افزده نشده است
</h2>
}
else
{
<!-- لیست -->
@foreach (var item in Model.SalaryAndRialCoefficientTabDataList)
{
<div class="row align-items-center p-2 tr-table">
<div class="col-2 col-md-1"><div class="row-number">@rowIndex</div></div>
<div class="col-10 col-md-2">@item.Year</div>
<div class="col-6 col-md-2">
@item.StartDateFa
</div>
<div class="col-6 col-md-2">@item.EndDateFa</div>
<div class="col-6 col-md-2" style="direction:ltr">@item.RialCoefficientStr</div>
@{
rowIndex++;
}
<div class="col-12 col-md-3 align-items-center" style="float:left; direction:ltr">
<a href="#showmodal=@Url.Page("./ClassificationScheme", "EditSalariesData" ,new {schemeId = Model.SchemeId, startDate = item.StartDateFa, endDate = item.EndDateFa})">
<span class="icon-span" style="background-color:#ade7f2">
<svg width="19" height="18" viewBox="0 0 19 20" fill="none" xmlns="http://www.w3.org/2000/svg">
<rect width="18.5047" height="18.5047" transform="translate(0.074707 0.679688)" fill="#ADE7F2"></rect>
<path d="M11.3213 5.25293C11.5664 5.19964 11.8217 5.20913 12.0635 5.28027L12.2178 5.33691C12.3659 5.40344 12.4945 5.49613 12.6152 5.59766C12.7711 5.72874 12.9467 5.90375 13.1504 6.10742L13.4326 6.39258C13.5184 6.48132 13.5946 6.56459 13.6602 6.64258C13.7953 6.80336 13.914 6.97832 13.9775 7.19434L14.0049 7.29883C14.0506 7.50888 14.0506 7.72647 14.0049 7.93652L13.9775 8.04102C13.914 8.25701 13.7953 8.43201 13.6602 8.59277C13.5946 8.67073 13.5184 8.75407 13.4326 8.84277L13.1504 9.12793L7.75879 14.5186C7.62672 14.6506 7.50929 14.7722 7.37793 14.8701L7.24121 14.959C7.14574 15.013 7.04539 15.0527 6.93848 15.0859L6.59766 15.1768L4.85938 15.6113C4.69519 15.6524 4.51668 15.6984 4.36816 15.7129C4.23271 15.7261 4.01567 15.7249 3.82324 15.584L3.74316 15.5146C3.53379 15.3053 3.52979 15.0444 3.54492 14.8896C3.55945 14.7411 3.60544 14.5626 3.64648 14.3984L4.08105 12.6602L4.17188 12.3193C4.20508 12.2124 4.24479 12.1121 4.29883 12.0166L4.3877 11.8799C4.48563 11.7485 4.60719 11.6311 4.73926 11.499L10.1299 6.10742L10.415 5.8252C10.5036 5.7396 10.5862 5.66312 10.6641 5.59766C10.8249 5.46245 11.0007 5.34385 11.2168 5.28027L11.3213 5.25293Z" stroke="#009EE2"></path>
<path d="M9.7124 6.46393L12.0255 4.92188L14.3386 7.23496L12.7965 9.54804L9.7124 6.46393Z" fill="#009EE2"></path>
</svg>
</span>
</a>
<a href="#">
<span class="icon-span" style="background-color: #ade7f2;padding: 4px;font-size: 11px;color: #009ee2;">
جزئیات
</span>
</a>
</div>
</div>
}
}
</div>
</div>
</div>

View File

@@ -0,0 +1,157 @@
@model CompanyManagment.App.Contracts.ClassificationScheme.ClassificationSchemePartialModel
@{
int index = 1;
<style>
.head-table{
font-size: 14px;
background-color: #2dbcbc;
padding: 4px 1px;
border-radius: 5px;
color: aliceblue;
margin-bottom: 9px;
}
.tr-table{
background-color: #ddf4f4;
border-radius: 5px;
padding: 4px 1px;
}
.row-number{
background-color: rgb(187, 240, 240);
color: #0B5959;
width: 24px;
height: 24px;
line-height: 24px;
text-align: center;
border-radius: 5px;
}
.icon-span {
display: inline-block;
text-align: center;
vertical-align: middle;
line-height: 14px;
border-radius: 5px;
padding: 2px;
}
.icon-span svg {
vertical-align: middle;
}
</style>
}
<div class="card card-pattern m-t-10">
@if (!Model.HasScheme)
{
<a class="btn btn-success"
style="border-radius:5px;" href="#showmodal=@Url.Page("./ClassificationScheme", "CreateScheme" ,new {workshopId = @Model.WorkshopId})">
@* <i class="fa fa-user-plus" aria-hidden="true" style="margin: 0px 5px;"></i> *@
<span class="icon-span">
<svg width="19" height="19" viewBox="0 0 22 22" fill="none" xmlns="http://www.w3.org/2000/svg">
<circle cx="11" cy="11" r="8.25" stroke="white" />
<path d="M11 13.75L11 8.25" stroke="white" stroke-linecap="round" />
<path d="M13.75 11L8.25 11" stroke="white" stroke-linecap="round" />
</svg>
<span style="margin-right:4px">ایجاد طرح</span>
</span>
</a>
}
else
{
<div class="container-fluid">
<!-- هدر -->
<div class="row fw-bold mb-2 head-table">
<div class="col-2 col-md-1">ردیف</div>
<div class="col-10 col-md-3">نام طراح</div>
<div class="col-6 col-md-2">تاریخ شمول</div>
<div class="col-6 col-md-3">تاریخ اجرا</div>
<div class="col-12 col-md-3" style="float:left; direction:ltr">عملیات</div>
</div>
<!-- لیست -->
@foreach (var item in Model.ClassificationSchemesList)
{
<div class="row align-items-center mb-2 p-2 tr-table">
<div class="col-2 col-md-1"><div class="row-number">@index</div></div>
<div class="col-10 col-md-3">@item.DesignerFullName</div>
<div class="col-6 col-md-2">@item.IncludingDateFa</div>
<div class="col-6 col-md-3">@item.ExecutionDateFa</div>
@{
index++;
}
<div class="col-12 col-md-3 align-items-center" style="float:left; direction:ltr">
<a
style="border-radius:5px;" href="#showmodal=@Url.Page("./ClassificationScheme", "CreateScheme" ,new {workshopId = @Model.WorkshopId})" >
<span class="icon-span" style="background-color:#ddd3e0">
<svg width="19" height="18" fill="none" xmlns="http://www.w3.org/2000/svg" >
<rect width="18.5047" height="18.5047" transform="translate(0.523438 0.523438)" fill="#DDD3E0"></rect>
<path d="M7.84814 11.7031L7.84814 9.39004" stroke="#BF3737" stroke-linecap="round"></path>
<path d="M11.7031 11.7031L11.7031 9.39004" stroke="#BF3737" stroke-linecap="round"></path>
<path d="M2.83643 5.53125H16.7149V5.53125C16.0652 5.53125 15.7403 5.53125 15.4745 5.60604C14.8039 5.79477 14.2799 6.31884 14.0911 6.98943C14.0163 7.25518 14.0163 7.58007 14.0163 8.22985V11.5546C14.0163 13.4402 14.0163 14.383 13.4305 14.9688C12.8448 15.5546 11.902 15.5546 10.0163 15.5546H9.53502C7.64941 15.5546 6.7066 15.5546 6.12081 14.9688C5.53502 14.383 5.53502 13.4402 5.53502 11.5546V8.22985C5.53502 7.58007 5.53502 7.25518 5.46023 6.98943C5.27151 6.31884 4.74744 5.79477 4.07685 5.60604C3.8111 5.53125 3.48621 5.53125 2.83643 5.53125V5.53125Z" stroke="#BF3737" stroke-linecap="round"></path>
<path d="M7.84799 3.22434C7.84799 3.22434 8.2335 2.45312 9.77556 2.45312C11.3176 2.45312 11.7031 3.22415 11.7031 3.22415" stroke="#BF3737" stroke-linecap="round"></path>
</svg>
</span>
</a>
<a href="#showmodal=@Url.Page("./ClassificationScheme", "EditScheme" ,new {id = item.Id})">
<span class="icon-span" style="background-color:#ade7f2">
<svg width="19" height="18" viewBox="0 0 19 20" fill="none" xmlns="http://www.w3.org/2000/svg" >
<rect width="18.5047" height="18.5047" transform="translate(0.074707 0.679688)" fill="#ADE7F2"></rect>
<path d="M11.3213 5.25293C11.5664 5.19964 11.8217 5.20913 12.0635 5.28027L12.2178 5.33691C12.3659 5.40344 12.4945 5.49613 12.6152 5.59766C12.7711 5.72874 12.9467 5.90375 13.1504 6.10742L13.4326 6.39258C13.5184 6.48132 13.5946 6.56459 13.6602 6.64258C13.7953 6.80336 13.914 6.97832 13.9775 7.19434L14.0049 7.29883C14.0506 7.50888 14.0506 7.72647 14.0049 7.93652L13.9775 8.04102C13.914 8.25701 13.7953 8.43201 13.6602 8.59277C13.5946 8.67073 13.5184 8.75407 13.4326 8.84277L13.1504 9.12793L7.75879 14.5186C7.62672 14.6506 7.50929 14.7722 7.37793 14.8701L7.24121 14.959C7.14574 15.013 7.04539 15.0527 6.93848 15.0859L6.59766 15.1768L4.85938 15.6113C4.69519 15.6524 4.51668 15.6984 4.36816 15.7129C4.23271 15.7261 4.01567 15.7249 3.82324 15.584L3.74316 15.5146C3.53379 15.3053 3.52979 15.0444 3.54492 14.8896C3.55945 14.7411 3.60544 14.5626 3.64648 14.3984L4.08105 12.6602L4.17188 12.3193C4.20508 12.2124 4.24479 12.1121 4.29883 12.0166L4.3877 11.8799C4.48563 11.7485 4.60719 11.6311 4.73926 11.499L10.1299 6.10742L10.415 5.8252C10.5036 5.7396 10.5862 5.66312 10.6641 5.59766C10.8249 5.46245 11.0007 5.34385 11.2168 5.28027L11.3213 5.25293Z" stroke="#009EE2"></path>
<path d="M9.7124 6.46393L12.0255 4.92188L14.3386 7.23496L12.7965 9.54804L9.7124 6.46393Z" fill="#009EE2"></path>
</svg>
</span>
</a>
<a href="#">
<span class="icon-span" style="background-color: #ade7f2;padding: 4px;font-size: 11px;color: #009ee2;">
بازنگری
</span>
</a>
</div>
</div>
}
</div>
}
</div>
@if (Model.HasScheme)
{
<div class="card card-pattern m-t-10">
<a class="btn btn-success"
style="border-radius:5px;" href="#showmodal=@Url.Page("./ClassificationScheme", "TestScheme" ,new {schemeId = @Model.ClassificationSchemesList.FirstOrDefault()!.Id})">
@* <i class="fa fa-user-plus" aria-hidden="true" style="margin: 0px 5px;"></i> *@
<span class="icon-span">
<svg width="19" height="19" viewBox="0 0 22 22" fill="none" xmlns="http://www.w3.org/2000/svg">
<circle cx="11" cy="11" r="8.25" stroke="white" />
<path d="M11 13.75L11 8.25" stroke="white" stroke-linecap="round" />
<path d="M13.75 11L8.25 11" stroke="white" stroke-linecap="round" />
</svg>
<span style="margin-right:4px">تست طرح</span>
</span>
</a>
</div>
}

View File

@@ -0,0 +1,576 @@
@model CompanyManagment.App.Contracts.ClassificationScheme.ClassificationGroupAndJobModel
@Html.AntiForgeryToken()
@{
<link href="@Href("~/DadmehrSelect/dad-mehr-select.css")" rel="stylesheet" />
<style>
.modal .modal-dialog .modal-content{
padding-bottom: 10px !important;
}
.name-right{
position:inherit !important;
}
.dadmehr-select-search .options li{
padding: 4px 12px;
margin-top: 6px;
font-size: 12px;
box-shadow: 0 1px 2px 0 rgba(0,0,0,.1);
border-top: none;
border-radius: 7px;
background-color: #e8e8e8;
cursor: pointer;
color: #504f4f;
}
.dadmehr-select-search .custom-select{
borderRadius: 5px!important;
border-top-right-radius : 5px;
}
.job-item{
background-color: #bdeae9;
flex: 0 0 calc(33.333% - 8px); /* دقیقاً سه‌تا در هر سطر */
box-sizing: border-box;
direction: rtl;
justify-content: flex-start;
align-items: flex-start; /* آیتم‌ها در یک راستا از بالا */
padding: 6px 10px;
border-radius: 5px;
min-height: 36px; /* برای ارتفاع یکنواخت */
}
.tr-job {
display: flex;
flex-wrap: wrap;
gap: 8px;
box-sizing: border-box;
}
.arrowselected{
background-color: #69a3a3 !important;
color: #ffffff !important;
}
</style>
}
<div class="modal-header">
<h5 class="modal-title"> تعیین مشاغل گروه @Model.GroupNo </h5>
<button type="button" class="close" data-dismiss="modal" aria-label="بستن">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
<div class="card shadow-sm border-0">
<div class="card-body">
<div class=" dadmehr-select-search" onclick="inputFocus(this)">
<div class="custom-select text-right">
<ul class="ul-search single text-right" data-url="@Url.Page("/Company/Workshops/ClassificationScheme", "JobByTextSearch")">
<li>
<input id="searchingJob" placeholder="جستجوی شغل..." job-id="" onkeyup="searchText(event, this, '@Url.Page("/Company/Workshops/ClassificationScheme", "JobByTextSearch")', true)" class="text-right input-text" />
</li>
</ul>
<ul class="result options text-right">
</ul>
</div>
<span class="span-input"></span>
</div>
</div>
</div>
<div class="shadow-sm border-0 m-t-10">
<button onclick="addJobs()" class="btn btn-success" style="position: relative;border-radius: 10px; padding:1px 5px;">
<span class="icon-span" style="padding: 4px;font-size: 11px;">
<svg width="19" height="18" viewBox="0 0 22 22" fill="none" xmlns="http://www.w3.org/2000/svg">
<circle cx="11" cy="11" r="8.25" stroke="white" />
<path d="M11 13.75L11 8.25" stroke="white" stroke-linecap="round" />
<path d="M13.75 11L8.25 11" stroke="white" stroke-linecap="round" />
</svg>
<span class="job-btn-text" >افزودن شغل</span>
</span>
</button>
</div>
<div class="card shadow-sm border-0 m-t-10" style="height:300px; overflow-y:scroll">
<div class="card-body">
<div class="align-items-center mb-2 p-2 tr-table tr-job">
@if (Model.EditClassificationGroupJob.Count > 0)
{
@foreach (var item in Model.EditClassificationGroupJob)
{
<div class="col-xs-12 col-md-4 job-item">
<span>@item.JobName</span>
<span>&nbsp;</span>
<span>-</span>
<span>&nbsp;</span>
<span>@item.JobCode</span>
<input type="hidden" data-id="@item.Id" job-id="@item.JobId" job-code="@item.JobCode" job-name="@item.JobName" name="job-data"/>
<a href="#" class="delete-job-already-added" style="float: left;">
<span class="icon-span" style="background-color:#ddd3e0">
<svg width="19" height="18" fill="none" xmlns="http://www.w3.org/2000/svg" >
<rect width="18.5047" height="18.5047" transform="translate(0.523438 0.523438)" fill="#DDD3E0"></rect>
<path d="M7.84814 11.7031L7.84814 9.39004" stroke="#BF3737" stroke-linecap="round"></path>
<path d="M11.7031 11.7031L11.7031 9.39004" stroke="#BF3737" stroke-linecap="round"></path>
<path d="M2.83643 5.53125H16.7149V5.53125C16.0652 5.53125 15.7403 5.53125 15.4745 5.60604C14.8039 5.79477 14.2799 6.31884 14.0911 6.98943C14.0163 7.25518 14.0163 7.58007 14.0163 8.22985V11.5546C14.0163 13.4402 14.0163 14.383 13.4305 14.9688C12.8448 15.5546 11.902 15.5546 10.0163 15.5546H9.53502C7.64941 15.5546 6.7066 15.5546 6.12081 14.9688C5.53502 14.383 5.53502 13.4402 5.53502 11.5546V8.22985C5.53502 7.58007 5.53502 7.25518 5.46023 6.98943C5.27151 6.31884 4.74744 5.79477 4.07685 5.60604C3.8111 5.53125 3.48621 5.53125 2.83643 5.53125V5.53125Z" stroke="#BF3737" stroke-linecap="round"></path>
<path d="M7.84799 3.22434C7.84799 3.22434 8.2335 2.45312 9.77556 2.45312C11.3176 2.45312 11.7031 3.22415 11.7031 3.22415" stroke="#BF3737" stroke-linecap="round"></path>
</svg>
</span>
</a>
</div>
}
}
</div>
</div>
</div>
</div>
@* <input type="hidden" asp-for="WorkshopId" value="@Model.GroupId" /> *@
<div class="modal-footer border-0">
<button type="button" onclick="saveBtn()" class="btn btn-success px-4 rounded-pill">ذخیره</button>
<button type="button" class="btn btn-outline-secondary px-4 rounded-pill closeModal" data-dismiss="modal">بستن</button>
</div>
<script>
//ذخیره لیست مشاغل
function saveBtn(){
var createJobList = [];
var deleteJobList =[];
let jobItems = document.querySelectorAll(".job-item-data");
let deletedJobItems = document.querySelectorAll(".deleted-job");
let groupNo = '@Model.GroupNo';
let groupId = '@Model.GroupId';
//افزودن مشاغل جدید به مدل
jobItems.forEach((jobItem) => {
const createClassificationGroupJob = {};
createClassificationGroupJob.JobId = Number($(jobItem).attr("job-id"));
createClassificationGroupJob.JobName = $(jobItem).attr("job-name");
createClassificationGroupJob.JobCode = $(jobItem).attr("job-code");
createClassificationGroupJob.ClassificationGroupId = Number(groupId);
createClassificationGroupJob.GroupNo = groupNo;
console.log(createClassificationGroupJob);
createJobList.push(createClassificationGroupJob);
});
deletedJobItems.forEach((deletedItem) => {
let deletItemId = Number($(deletedItem).val());
deleteJobList.push(deletItemId);
});
let alreadyCreated = document.querySelectorAll(".job-item");
let createNewCount = Number(createJobList.length);
let deleteCount = Number(deleteJobList);
let alreadyCreatedCount = Number(alreadyCreated.length);
if(createNewCount == 0 && deleteCount == 0 && alreadyCreatedCount == 0){
$.Notification.autoHideNotify('error', 'top center', 'پیام سیستم ', "هیچ شغلی اضافه نشده است");
}else{
var createJobUrlAjax = '@Url.Page("/Company/Workshops/ClassificationScheme", "CreateJob")';
let targetDiv = $(`div[data-groupid='${groupId}']`);
$.ajax({
dataType: 'json',
type: 'POST',
url: createJobUrlAjax,
headers: { "RequestVerificationToken": $('input[name="__RequestVerificationToken"]').val() },
data: { createJobList , deleteJobList},
success: function (response) {
if(response.isSuccess){
$.Notification.autoHideNotify('success', 'top center', 'پیام سیستم ', response.message);
if (targetDiv.hasClass('tr-table-add')) {
targetDiv.removeClass('tr-table-add').addClass('tr-table-edit');
// پیدا کردن span با کلاس add-jobs درون همون div
let spanAdd = targetDiv.find('span.add-jobs');
spanAdd.find('svg').remove();
spanAdd.append(`<svg width="19" height="18" viewBox="0 0 19 20" fill="none" xmlns="http://www.w3.org/2000/svg">
<rect width="18.5047" height="18.5047" transform="translate(0.074707 0.679688)" fill="#ADE7F2"></rect>
<path d="M11.3213 5.25293C11.5664 5.19964 11.8217 5.20913 12.0635 5.28027L12.2178 5.33691C12.3659 5.40344 12.4945 5.49613 12.6152 5.59766C12.7711 5.72874 12.9467 5.90375 13.1504 6.10742L13.4326 6.39258C13.5184 6.48132 13.5946 6.56459 13.6602 6.64258C13.7953 6.80336 13.914 6.97832 13.9775 7.19434L14.0049 7.29883C14.0506 7.50888 14.0506 7.72647 14.0049 7.93652L13.9775 8.04102C13.914 8.25701 13.7953 8.43201 13.6602 8.59277C13.5946 8.67073 13.5184 8.75407 13.4326 8.84277L13.1504 9.12793L7.75879 14.5186C7.62672 14.6506 7.50929 14.7722 7.37793 14.8701L7.24121 14.959C7.14574 15.013 7.04539 15.0527 6.93848 15.0859L6.59766 15.1768L4.85938 15.6113C4.69519 15.6524 4.51668 15.6984 4.36816 15.7129C4.23271 15.7261 4.01567 15.7249 3.82324 15.584L3.74316 15.5146C3.53379 15.3053 3.52979 15.0444 3.54492 14.8896C3.55945 14.7411 3.60544 14.5626 3.64648 14.3984L4.08105 12.6602L4.17188 12.3193C4.20508 12.2124 4.24479 12.1121 4.29883 12.0166L4.3877 11.8799C4.48563 11.7485 4.60719 11.6311 4.73926 11.499L10.1299 6.10742L10.415 5.8252C10.5036 5.7396 10.5862 5.66312 10.6641 5.59766C10.8249 5.46245 11.0007 5.34385 11.2168 5.28027L11.3213 5.25293Z" stroke="#009EE2"></path>
<path d="M9.7124 6.46393L12.0255 4.92188L14.3386 7.23496L12.7965 9.54804L9.7124 6.46393Z" fill="#009EE2"></path>
</svg>`)
// اگر span مورد نظر وجود داشت، کلاس و متنش رو تغییر بده
if (spanAdd.length) {
spanAdd.removeClass('add-jobs').addClass('edit-jobs');
// تغییر متن داخل span فرزند (که نوشته "افزودن شغل" است)
spanAdd.find('span').text('ویرایش شغل');
}
}
if(createNewCount == 0 && alreadyCreatedCount == 0){
if (targetDiv.hasClass('tr-table-edit')) {
targetDiv.removeClass('tr-table-edit').addClass('tr-table-add');
// پیدا کردن span با کلاس add-jobs درون همون div
let spanAdd = targetDiv.find('span.edit-jobs');
spanAdd.find('svg').remove();
spanAdd.append(`<svg width="19" height="18" viewBox="0 0 22 22" fill="none" xmlns="http://www.w3.org/2000/svg">
<circle cx="11" cy="11" r="8.25" stroke="white" />
<path d="M11 13.75L11 8.25" stroke="white" stroke-linecap="round" />
<path d="M13.75 11L8.25 11" stroke="white" stroke-linecap="round" />
</svg>`)
// اگر span مورد نظر وجود داشت، کلاس و متنش رو تغییر بده
if (spanAdd.length) {
spanAdd.removeClass('edit-jobs').addClass('add-jobs');
// تغییر متن داخل span فرزند (که نوشته "ویرایش شغل" است)
spanAdd.find('span').text('افزودن شغل');
}
}
}
$('.closeModal').click();
}else{
$.Notification.autoHideNotify('error', 'top center', 'پیام سیستم ', response.message);
}
},
failure: function (response) {
//console.log(5, response);
}
});
}
}
//حذف شغل اضافه شده جدید
$(document).on('click', '.delete-job-new-added', function (e) {
e.preventDefault();
$(this).closest('.job-item').remove();
});
//حذف شغلی که قبلا در دیتابیس ذخیره شده بود
$(document).on('click', '.delete-job-already-added', function (e) {
e.preventDefault();
let current = $(e.currentTarget);
var checkDeleteUrlAjax = '@Url.Page("/Company/Workshops/ClassificationScheme", "CheckDeleteJob")';
let id = Number($(this).siblings('input[name="job-data"]').attr('data-id'));
let groupId = Number('@Model.GroupId');
$.ajax({
dataType: 'json',
type: 'GET',
url: checkDeleteUrlAjax,
headers: { "RequestVerificationToken": $('input[name="__RequestVerificationToken"]').val() },
data: { "id": id , "groupId" : groupId},
success: function (response) {
if (response.checkExist) {
$.Notification.autoHideNotify('error', 'top center', 'پیام سیستم ',
'پرسنل یا پرسنل‌هایی در این گروه وجود دارند که این سمت به آنها اختصاص داده شده');
} else {
if ($(`input.deleted-job[value='${id}']`).length === 0){
$('.tr-job').append(`<input type="hidden" class="deleted-job" name="deletedjob" value="${id}" />`);
}
current.closest('.job-item').remove();
}
},
failure: function (response) {
//console.log(5, response);
}
});
});
//افزودن شغل
function addJobs() {
let jobHiddenInput = $('.span-input').find('.selectedJob');
// اگر وجود داشت
if (jobHiddenInput.length > 0) {
let jobItems = document.querySelectorAll(".job-item-data");
// خواندن مقادیر از اتریبیوت‌ها
let jobName = jobHiddenInput.attr('selectedJob-name');
let jobCode = jobHiddenInput.attr('selectedJob-code');
let jobId = jobHiddenInput.attr('selectedJob-id');
var checkExist = false;
jobItems.forEach((jobItem) => {
if($(jobItem).attr("job-id") == jobId){
$.Notification.autoHideNotify('error', 'top center', 'پیام سیستم ', 'این شغل قبلا اضافه شده است');
checkExist = true;
}
});
if(checkExist == false){
let html = `
<div class="col-xs-12 job-item">
<span>${jobName}</span>
<span>&nbsp;</span>
<span>-</span>
<span>&nbsp;</span>
<span>${jobCode}</span>
<input class="job-item-data" type="hidden"
job-id="${jobId}"
job-code="${jobCode}"
job-name="${jobName}"
name="job-data"/>
<a href="#" class="delete-job-new-added" style="float: left;">
<span class="icon-span" style="background-color:#ddd3e0">
<svg width="19" height="18" fill="none" xmlns="http://www.w3.org/2000/svg" >
<rect width="18.5047" height="18.5047" transform="translate(0.523438 0.523438)" fill="#DDD3E0"></rect>
<path d="M7.84814 11.7031L7.84814 9.39004" stroke="#BF3737" stroke-linecap="round"></path>
<path d="M11.7031 11.7031L11.7031 9.39004" stroke="#BF3737" stroke-linecap="round"></path>
<path d="M2.83643 5.53125H16.7149V5.53125C16.0652 5.53125 15.7403 5.53125 15.4745 5.60604C14.8039 5.79477 14.2799 6.31884 14.0911 6.98943C14.0163 7.25518 14.0163 7.58007 14.0163 8.22985V11.5546C14.0163 13.4402 14.0163 14.383 13.4305 14.9688C12.8448 15.5546 11.902 15.5546 10.0163 15.5546H9.53502C7.64941 15.5546 6.7066 15.5546 6.12081 14.9688C5.53502 14.383 5.53502 13.4402 5.53502 11.5546V8.22985C5.53502 7.58007 5.53502 7.25518 5.46023 6.98943C5.27151 6.31884 4.74744 5.79477 4.07685 5.60604C3.8111 5.53125 3.48621 5.53125 2.83643 5.53125V5.53125Z" stroke="#BF3737" stroke-linecap="round"></path>
<path d="M7.84799 3.22434C7.84799 3.22434 8.2335 2.45312 9.77556 2.45312C11.3176 2.45312 11.7031 3.22415 11.7031 3.22415" stroke="#BF3737" stroke-linecap="round"></path>
</svg>
</span>
</a>
</div>`;
// افزودن به div مقصد
$('.tr-job').append(html);
}
}
}
function inputFocus(element) {
$(element).find('ul.ul-search').find('.input-text').focus();
}
//جستوی مشاغل
function searchText(e,element, urlPost, hasCode) {
var code = e.code;
if (code != "ArrowDown" && code != "ArrowUp" && code != "Enter") {
var text = $(element).val();
textlength = text.length;
$(element).parent().parent().parent('.custom-select').children('.result').html('');
if (text != "") {
$(element).parent().parent().parent('.custom-select').children('.result').html('');
$(element).parent().parent().parent('.custom-select').children('ul.result').show();
$.ajax({
dataType: 'json',
type: 'POST',
url: urlPost,
headers: { "RequestVerificationToken": $('input[name="__RequestVerificationToken"]').val() },
data: { "textSearch": text },
success: function (response) {
index = 0;
$(element).parent().parent().parent('.custom-select').children('.result').html('');
if (response.list.length > 0) {
var ids = [];
$(element).parent().parent().parent('.custom-select').children('.result').find("li.select-item:not(.hasinput)").remove();
$('.custom-select').children('ul.ul-search').find('span.items-selected').each(function (x) {
ids.push(Number($(this).attr('data-value')));
});
$.each(response.list, function (i, item) {
if (jQuery.inArray(item.id, ids) == -1) {
if (hasCode) {
$(element).parent().parent().parent('.custom-select').children('.result').append('<li class="select-item" onclick="selectItemSearch(this)" data-code="' + item.searchResultCode + '" data-name="' + item.searchResultTitle + '" data-value="' + item.id + '"><span class="name-right">' + item.searchResultTitle + ' - ' + item.searchResultCode + '</span></li>');
$('.code-left').each(function () {
var spanContent = $(this).text();
if (/\D/.test(spanContent)) { // Check if the content of the span contains non-digits
$(this).css('color', 'red');
}
});
}
else {
$(element).parent().parent().parent('.custom-select').children('.result').append('<li class="select-item" onclick="selectItemSearch(this)" data-name="' + item.searchResultTitle + '" data-value="' + item.id + '"><span class="name-right">' + item.searchResultTitle + '</span></li>');
}
}
});
$(element).parent().parent().parent('.custom-select').children('.result').find("li.select-item:not(.hasinput)").first().focus();
$(element).parent().parent().parent('.custom-select').children('.result').find("li.select-item:not(.hasinput)").first().addClass('arrowselected');
}
else {
$(element).parent().parent().parent('.custom-select').children('.result').html('');
$(element).parent().parent().parent('.custom-select').children('.result').append('<li class="select-item"><span>هیچ نتیجه ای یافت نشد</span></li>');
}
},
failure: function (response) {
//console.log(5, response);
}
});
}
else {
$(element).parent().parent().parent('.custom-select').children('.result').find("li.select-item:not(.hasinput)").remove();
}
}
}
var selectItemSearch = function (element) {
$('.selectedJob').remove();
let activeTabPane = $('.card-body');
var name = activeTabPane.find(element).attr("data-name");
var code = activeTabPane.find(element).attr("data-code");
var value = activeTabPane.find(element).attr("data-value");
//وقنی اسکرول بالا رفت اینطور شود
//$(element).parent().parent('.custom-select').children('ul.result').removeClass('posistion-static');
//$(element).parent().parent('.custom-select').children('ul.result').removeClass('posistion-absolute');
activeTabPane.find(element).parent().parent().children('ul.ul-search').find('input').val(name + ' - ' + code);
activeTabPane.find(element).parent().parent().children('ul.ul-search').find('input').attr("job-id", value);
// activeTabPane.find(element).parent().parent().children('ul.ul-search').find('input').parent('li').remove();
activeTabPane.find(element).parent().parent('.custom-select').children('ul.result').hide();
$('.span-input')
.append('<input class="selectedJob" type="hidden" selectedJob-id="' + value + '" selectedJob-code="' + code + '" selectedJob-name="' + name + '" name="selectedjob-data"/>');
// activeTabPane.find(element).parent().parent().children('ul.ul-search').find('.singleItem').remove();
// if (code == 'undefined' || code == null) {
// activeTabPane.find(element).parent().parent().children('ul.ul-search').append('<li onclick="openSearchResult(this)" class="singleItem"><span data-value="' + value + '" >' + name + '</li>');
// }
// else
// activeTabPane.find(element).parent().parent().children('ul.ul-search').append('<li onclick="openSearchResultByCode(this)" class="singleItem"><span class="value" data-value="' + value + '" >' + name + '</span>|<span class="code" data-code="' + code + '" >' + code + '</span></li>');
//$(element).parent().parent().children('ul.ul-search').append('<li> <input onkeyup="searchText(this)" onkeypress="searchTextResize(this)" class="text-right input-text" /></li>');
}
$(document).on('input', '#searchingJob', function () {
var value = $(this).val().trim();
if (value === "") {
$('.selectedJob').remove();
}
});
$(document).click(
function (e) {
// console.log($(e.target).attr('class'));
var classElement = $(e.target).parent().attr('class');
if (classElement != "input-text-single" && classElement != "select-item hasinput" && classElement != "del-selected" && classElement != "singleItem" && classElement != "select-item" && classElement !="result options text-right" ) {
$(".dadmehr-select-search").find('.result').hide();
}
});
function handleClick(event) {
const customSelect = $(event.target).closest(".custom-select input");
const divOffset = customSelect.offset();
$(".options").css("top", divOffset.top - 5);
if ($(window).width() < 1550) {
$(".options").css("top", divOffset.top + 10);
// console.log(1);
}
}
document.onkeydown = function (e) {
var ul = $('.dadmehr-select-search').find('.result');
if (ul.is(":visible")) {
switch (e.which) {
case 38: // Up arrow
e.preventDefault();
ul.find("li").removeClass('arrowselected');
if ((index - 1) >= 0) {
index--;
ul.find("li.select-item:eq(" + index + ")").addClass('arrowselected');
ul.scrollTop(index * (ul.find("li.select-item:eq(" + index + ")").outerHeight()+5));
ul.find("li.arrowselected").focus();
} else {
index = -1;
}
break;
case 40: // Down arrow
e.preventDefault();
if ((index + 1) < ul.find("li").length) {
ul.find("li.select-item").removeClass('arrowselected');
index++;
//console.log(index);
console.log(index);
ul.find("li.select-item:eq(" + index + ")").addClass('arrowselected');
ul.scrollTop(index * (ul.find("li.select-item:eq(" + index + ")").outerHeight()+5));
ul.find("li.arrowselected").focus();
console.log(index * ul.find("li.select-item:eq(" + index + ")").outerHeight());
console.log(ul.find("li.select-item:eq(" + index + ")").outerHeight());
}
break;
case 13: // Enter
if (index > -1) {
var selectItem = ul.find('li.arrowselected');
selectItemSearch(selectItem);
}
index = -1;
//proposalList.empty();
//params.onSubmit(input.val());
break;
case 9: // Tab
if (index > -1) {
var selectItem = ul.find('li.arrowselected');
selectItemSearch(selectItem);
}
index = -1;
//proposalList.empty();
//params.onSubmit(input.val());
break;
case 27: // Esc button
index = -1;
//proposalList.empty();
//input.val('');
break;
}
}
};
</script>

View File

@@ -0,0 +1,174 @@
@using _0_Framework.Application.Enums
@model CompanyManagment.App.Contracts.ClassificationScheme.SalaryAndRialCoefficientModel
@{
<style>
.modal .modal-dialog .modal-content {
padding-bottom: 10px !important;
}
.row-number-salaries {
background-color: rgb(187, 240, 240);
color: #0B5959;
width: 82px;
height: 31px;
line-height: 33px;
text-align: center;
border-radius: 5px;
}
.tr-table-salaries {
background-color: #ddf4f4;
border-radius: 5px;
padding: 7px 1px;
margin: 5px;
}
</style>
var groupIndex = 0;
}
<div class="modal-header">
<h5 class="modal-title">ایجاد دستمزدها</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="بستن">
<span aria-hidden="true">&times;</span>
</button>
</div>
<form asp-page="./ClassificationScheme" asp-page-handler="CreateSalaries" method="post" autocomplete="off" novalidate="novalidate"
data-ajax="true" data-action="salariesTab" enctype="multipart/form-data">
<div class="modal-body">
<div class="card shadow-sm border-0">
<div class="card-body">
<div class="row">
<div class="col-xs-12 col-md-6 mb-3">
<label class="form-label">تاریخ شروع</label>
<input type="text" asp-for="StartDateFa" class="form-control date-input" data-val="false" />
<span asp-validation-for="StartDateFa" class="text-danger"></span>
</div>
<div class="col-xs-12 col-md-6 mb-3">
<label class="form-label">تاریخ پایان</label>
<input type="text" asp-for="EndDateFa" class="form-control date-input" data-val="false" />
<span asp-validation-for="EndDateFa" class="text-danger"></span>
</div>
</div>
@if (Model.TypeOfCoefficient == TypeOfCoefficient.RialCoefficient)
{
<div class="lineDiv"></div>
<div class="row m-t-10">
<div class="col-xs-12 col-md-6 mb-3">
<div class="form-control" style="border-color:#fff !important;">
<label asp-for="RialCoefficient" class="form-label" style="float: left;"> ضریب ریالی</label>
</div>
</div>
<div class="col-md-6 mb-3">
<input asp-for="RialCoefficient" class="form-control" />
<span asp-validation-for="RialCoefficient" class="text-danger"></span>
</div>
</div>
}
<div class="lineDiv"></div>
<div class="row m-t-10">
<!-- گروه 1 تا 10 -->
<div class="col-12 col-md-6">
@foreach (var itemRight in Model.SalariesAndCoefficientList.Take(10))
{
<div class="row align-items-center mb-2 p-2 tr-table-salaries" data-groupid="@itemRight.ClassificationGroupId">
<div class="col-xs-6 align-items-center" style="float:left; direction:ltr">
<input type="hidden" name="SalariesAndCoefficientList[@groupIndex].GroupNo" value="@itemRight.GroupNo" />
<input type="hidden" name="SalariesAndCoefficientList[@groupIndex].ClassificationGroupId" value="@itemRight.ClassificationGroupId" />
<input type="text" class="form-control amount" name="SalariesAndCoefficientList[@groupIndex].GroupSalaryStr" value="@itemRight.GroupSalaryStr" />
</div>
<div class="col-xs-3"></div>
<div class="col-xs-3">
<div class="row-number-salaries">
<span>گروه</span>
<span>&nbsp;</span>
<span>@itemRight.GroupNo</span>
</div>
</div>
</div>
groupIndex++;
}
</div>
<!-- گروه 11 تا 20 -->
<div class="col-12 col-md-6">
@foreach (var itemLeft in Model.SalariesAndCoefficientList.Skip(10))
{
<div class="row align-items-center mb-2 p-2 tr-table-salaries" data-groupid="@itemLeft.ClassificationGroupId">
<div class="col-xs-6 align-items-center" style="float:left; direction:ltr">
<input type="hidden" name="SalariesAndCoefficientList[@groupIndex].GroupNo" value="@itemLeft.GroupNo" />
<input type="hidden" name="SalariesAndCoefficientList[@groupIndex].ClassificationGroupId" value="@itemLeft.ClassificationGroupId" />
<input type="text" class="form-control amount" name="SalariesAndCoefficientList[@groupIndex].GroupSalaryStr" value="@itemLeft.GroupSalaryStr" />
</div>
<div class="col-xs-3"></div>
<div class="col-xs-3">
<div class="row-number-salaries">
<span>گروه</span>
<span>&nbsp;</span>
<span>@itemLeft.GroupNo</span>
</div>
</div>
</div>
groupIndex++;
}
</div>
</div>
</div>
</div>
</div>
<input type="hidden" id="schemeId" asp-for="@Model.SchemeId" value="@Model.SchemeId" />
<input type="hidden" asp-for="TypeOfCoefficient" value="TypeOfCoefficient" />
<div class="modal-footer border-0">
<button type="submit" class="btn btn-success px-4 rounded-pill">ذخیره</button>
<button type="button" class="btn btn-outline-secondary px-4 rounded-pill" data-dismiss="modal">بستن</button>
</div>
</form>
<script>
$(document).ready(function () {
$(".date-input").mask("0000/00/00");
$('.amount').on('input',
function() {
this.value = this.value.replace(/[^\d]/, '');
var contractAmount = $(this);
//setting format
numeral.defaultFormat("0,0 تومان");
contractAmount.on("keyup",
function(e) {
contractAmount.val(numeral(contractAmount.val()).format());
});
});
});
</script>

View File

@@ -0,0 +1,92 @@
@using _0_Framework.Application.Enums
@model CompanyManagment.App.Contracts.ClassificationScheme.CreateClassificationScheme
@{
<style>
.modal-footer {
padding: 0.5rem 1rem !important; /* کوچکتر کردن فاصله */
margin-top: -10px; /* کمی بالا آوردن */
}
.modal .modal-dialog .modal-content{
padding-bottom : 10px;
}
</style>
}
<div class="modal-header">
<h5 class="modal-title">ایجاد طرح جدید</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="بستن">
<span aria-hidden="true">&times;</span>
</button>
</div>
<form asp-page="./ClassificationScheme" asp-page-handler="CreateScheme" method="post" autocomplete="off"
data-ajax="true" data-action="Refresh" enctype="multipart/form-data">
<div class="modal-body">
<div class="card shadow-sm border-0">
<div class="card-body">
<div class="row">
<div class="col-md-6 mb-3">
<label asp-for="DesignerFullName" class="form-label">نام طراح</label>
<input asp-for="DesignerFullName" class="form-control" />
<span asp-validation-for="DesignerFullName" class="text-danger"></span>
</div>
<div class="col-md-6 mb-3">
<label asp-for="DesignerPhone" class="form-label">شماره تماس طراح</label>
<input asp-for="DesignerPhone" class="form-control" />
<span asp-validation-for="DesignerPhone" class="text-danger"></span>
</div>
</div>
<div class="row m-t-10" >
<div class="col-md-6 mb-3">
<label asp-for="IncludingDateFa" class="form-label">تاریخ شمول طرح</label>
<input type="text" asp-for="IncludingDateFa" class="form-control date-input"/>
</div>
<div class="col-md-6 mb-3">
<label asp-for="ExecutionDateFa" class="form-label">تاریخ اجرای طرح</label>
<input type="text" asp-for="ExecutionDateFa" class="form-control date-input"/>
</div>
</div>
<div class="lineDiv"></div>
<div class="row m-t-10">
<div class="col-md-6 mb-3">
<div class="form-control" style="border-color:#fff !important;">
<label asp-for="TypeOfCoefficient" class="form-label" style="float: left;">نوع محاسبه ضریب ریالی</label>
</div>
</div>
<div class="col-md-6 mb-3">
<select asp-for="TypeOfCoefficient" class="form-select form-control">
<option value="@((int)TypeOfCoefficient.RialCoefficient)">ضریب ریالی طرح</option>
<option value="@((int)TypeOfCoefficient.JobOrganization)">ضریب شورای عالی کار</option>
</select>
<span asp-validation-for="TypeOfCoefficient" class="text-danger"></span>
</div>
</div>
<div class="lineDiv"></div>
</div>
</div>
</div>
<input type="hidden" asp-for="WorkshopId" value="@Model.WorkshopId"/>
<div class="modal-footer border-0">
<button type="submit" class="btn btn-success px-4 rounded-pill">ذخیره</button>
<button type="button" class="btn btn-outline-secondary px-4 rounded-pill" data-dismiss="modal">بستن</button>
</div>
</form>
<script>
$(document).ready(function () {
$(".date-input").mask("0000/00/00");
});
</script>

View File

@@ -0,0 +1,228 @@
@model CompanyManagment.App.Contracts.ClassificationScheme.AddEmployeeToGroup
@Html.AntiForgeryToken()
@{
<style>
.modal .modal-dialog .modal-content {
padding-bottom: 10px !important;
}
.modal-footer {
padding: 0.5rem 1rem !important; /* کوچکتر کردن فاصله */
margin-top: -10px; /* کمی بالا آوردن */
}
.modal .modal-dialog .modal-content {
padding-bottom: 10px;
}
</style>
}
<div class="modal-header">
<h5 class="modal-title">افزودن پرسنل به گروه</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="بستن">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
<div class="row m-t-10">
<h5 class="modal-title">@Model.EmployeeFullName</h5>
</div>
<div class="card shadow-sm border-0" style="margin-top: 31px;">
<div class="card-body">
<div class="lineDiv"></div>
<div class="row m-t-10">
<div class="col-md-6 mb-3">
<select id="groupList" asp-for="GroupId" class="form-select form-control" onchange="selectGroup(this)">
<option value="0">انتخاب گروه</option>
@foreach (var item in @Model.ClassificationGroupList)
{
<option value="@item.GroupId" data-groupno="@item.GroupNo"><span>گروه</span><span>&nbsp;</span><span>@item.GroupNo</span></option>
}
</select>
</div>
<div class="col-md-6 mb-3">
<select id="jobList" asp-for="JobId" class="form-select form-control">
<option value="0">انتخاب سمت</option>
</select>
</div>
<div id="groupHiddenInputs">
</div>
<div id="jobHiddenInputs">
</div>
</div>
<div class="lineDiv"></div>
</div>
</div>
</div>
<input type="hidden" name="firstCheckjobId" value="@Model.JobId"/>
<input type="hidden" asp-for="SchemeId" value="@Model.SchemeId" />
<input type="hidden" asp-for="EmployeeId" value="@Model.EmployeeId" />
<div class="modal-footer border-0">
<button type="button" onclick="saveBtn()" class="btn btn-success px-4 rounded-pill">ذخیره</button>
<button type="button" class="btn btn-outline-secondary px-4 rounded-pill" data-dismiss="modal">بستن</button>
</div>
<script>
$(document).ready(function() {
let schemeId = '@Model.SchemeId';
const groupSelect = document.getElementById("groupList");
let jobId = '@Model.JobId';
const groupId = groupSelect.options[groupSelect.selectedIndex].value;
var url = `/Admin/Company/Workshops/ClassificationScheme?handler=JobList&schemeId=${schemeId}&groupId=${groupId}`;
$.get(url, function (data) {
// فرض بر این است که data.jobs یک آرایه از آبجکت‌هایی مثل { jobId, jobName, jobCode } باشد
const jobList = $("#jobList");
jobList.empty(); // پاک کردن آیتم‌های قبلی
jobList.append('<option value="0">انتخاب سمت</option>');
data.jobs.forEach(item => {
if(item.jobId == jobId){
jobList.append(`<option selected="selected" value="${item.jobId}" data-jobname="${item.jobName}" data-jobcode="${item.jobCode}">
${item.jobCode} - ${item.jobName}
</option>`);
}else{
jobList.append(`<option value="${item.jobId}" data-jobname="${item.jobName}" data-jobcode="${item.jobCode}">
${item.jobCode} - ${item.jobName}
</option>`);
}
});
});
});
function selectGroup(selectElement) {
const selectedOption = selectElement.options[selectElement.selectedIndex];
const groupId = selectedOption.value;
// const groupNo = selectedOption.getAttribute("data-groupno");
// $('#groupHiddenInputs').html('');
// const inputs =`
// <input type="hidden" name="GroupId" value="${groupId}" />
// `;
// $('#groupHiddenInputs').append(inputs);
let schemeId = '@Model.SchemeId';
var url = `/Admin/Company/Workshops/ClassificationScheme?handler=JobList&schemeId=${schemeId}&groupId=${groupId}`;
console.log("Request URL:", url);
$.get(url, function (data) {
// فرض بر این است که data.jobs یک آرایه از آبجکت‌هایی مثل { jobId, jobName, jobCode } باشد
const jobList = $("#jobList");
jobList.empty(); // پاک کردن آیتم‌های قبلی
jobList.append('<option value="0">انتخاب سمت</option>');
data.jobs.forEach(item => {
jobList.append(
`<option value="${item.jobId}" data-jobname="${item.jobName}" data-jobcode="${item.jobCode}">
${item.jobCode} - ${item.jobName}
</option>`
);
});
});
}
// function selectJob(selectElement) {
// const selectedOption = selectElement.options[selectElement.selectedIndex];
// const jobId = selectedOption.value;
// // const jobname = selectedOption.getAttribute("data-jobname");
// // const jobcode = selectedOption.getAttribute("data-jobcode");
// $('#jobHiddenInputs').html('');
// const inputs =`
// <input type="hidden" name="jobId" value="${jobId}" />
// `;
// $('#jobHiddenInputs').append(inputs);
// }
function saveBtn() {
const groupSelect = document.getElementById("groupList");
const jobSelect = document.getElementById("jobList");
const groupId = groupSelect.options[groupSelect.selectedIndex].value;
const jobId = jobSelect.options[jobSelect.selectedIndex].value;
if (groupId == 0) {
$.Notification.autoHideNotify('error', 'top center', 'پیام سیستم', "گروه را انتخاب کنید");
return;
}
if (jobId == 0) {
$.Notification.autoHideNotify('error', 'top center', 'پیام سیستم', "سمت را انتخاب کنید");
return;
}
const command = {
employeeId: '@Model.EmployeeId',
schemeId: '@Model.SchemeId',
id : '@Model.Id',
groupId: Number(groupId),
jobId: Number(jobId),
};
var urlAjaxToSave = '@Url.Page("/Company/Workshops/ClassificationScheme", "EditGroupMember")';
$.ajax({
dataType: 'json',
type: 'POST',
url: urlAjaxToSave,
headers: { "RequestVerificationToken": $('input[name="__RequestVerificationToken"]').val() },
data: command,
success: function (response) {
if(response.isSuccess){
$.Notification.autoHideNotify('success', 'top center', 'پیام سیستم ', response.message);
$('.close').click();
setTimeout(function () {
$('#addEmployeesTab').click();
}, 1000);
}else{
$.Notification.autoHideNotify('error', 'top center', 'پیام سیستم ', response.message);
}
},
failure: function (response) {
//console.log(5, response);
}
});
}
</script>

View File

@@ -0,0 +1,177 @@
@using _0_Framework.Application.Enums
@model CompanyManagment.App.Contracts.ClassificationScheme.SalaryAndRialCoefficientModel
@{
<style>
.modal .modal-dialog .modal-content {
padding-bottom: 10px !important;
}
.row-number-salaries {
background-color: rgb(187, 240, 240);
color: #0B5959;
width: 82px;
height: 31px;
line-height: 33px;
text-align: center;
border-radius: 5px;
}
.tr-table-salaries {
background-color: #ddf4f4;
border-radius: 5px;
padding: 7px 1px;
margin: 5px;
}
</style>
var groupIndex = 0;
}
<div class="modal-header">
<h5 class="modal-title">ایجاد دستمزدها</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="بستن">
<span aria-hidden="true">&times;</span>
</button>
</div>
<form asp-page="./ClassificationScheme" asp-page-handler="EditSalariesData" method="post" autocomplete="off" novalidate="novalidate"
data-ajax="true" data-action="salariesTab" enctype="multipart/form-data">
<div class="modal-body">
<div class="card shadow-sm border-0">
<div class="card-body">
<div class="row">
<div class="col-xs-12 col-md-6 mb-3">
<label class="form-label">تاریخ شروع</label>
<input type="text" asp-for="StartDateFa" class="form-control date-input" data-val="false" />
<span asp-validation-for="StartDateFa" class="text-danger"></span>
</div>
<div class="col-xs-12 col-md-6 mb-3">
<label class="form-label">تاریخ پایان</label>
<input type="text" asp-for="EndDateFa" class="form-control date-input" data-val="false" />
<span asp-validation-for="EndDateFa" class="text-danger"></span>
</div>
</div>
@if (Model.TypeOfCoefficient == TypeOfCoefficient.RialCoefficient)
{
<div class="lineDiv"></div>
<div class="row m-t-10">
<div class="col-xs-12 col-md-6 mb-3">
<div class="form-control" style="border-color:#fff !important;">
<label asp-for="RialCoefficient" class="form-label" style="float: left;"> ضریب ریالی</label>
</div>
</div>
<div class="col-md-6 mb-3">
<input asp-for="RialCoefficient" class="form-control" />
<span asp-validation-for="RialCoefficient" class="text-danger"></span>
<input type="hidden" asp-for="CoefficientId" value="@Model.CoefficientId"/>
</div>
</div>
}
<div class="lineDiv"></div>
<div class="row m-t-10">
<!-- گروه 1 تا 10 -->
<div class="col-12 col-md-6">
@foreach (var itemRight in Model.SalariesAndCoefficientList.Take(10))
{
<div class="row align-items-center mb-2 p-2 tr-table-salaries" data-groupid="@itemRight.ClassificationGroupId">
<div class="col-xs-6 align-items-center" style="float:left; direction:ltr">
<input type="hidden" name="SalariesAndCoefficientList[@groupIndex].Id" value="@itemRight.Id"/>
<input type="hidden" name="SalariesAndCoefficientList[@groupIndex].GroupNo" value="@itemRight.GroupNo"/>
<input type="hidden" name="SalariesAndCoefficientList[@groupIndex].ClassificationGroupId" value="@itemRight.ClassificationGroupId"/>
<input type="text" class="form-control amount" name="SalariesAndCoefficientList[@groupIndex].GroupSalaryStr" value="@itemRight.GroupSalaryStr"/>
</div>
<div class="col-xs-3"></div>
<div class="col-xs-3">
<div class="row-number-salaries">
<span>گروه</span>
<span>&nbsp;</span>
<span>@itemRight.GroupNo</span>
</div>
</div>
</div>
groupIndex++;
}
</div>
<!-- گروه 11 تا 20 -->
<div class="col-12 col-md-6">
@foreach (var itemLeft in Model.SalariesAndCoefficientList.Skip(10))
{
<div class="row align-items-center mb-2 p-2 tr-table-salaries" data-groupid="@itemLeft.ClassificationGroupId">
<div class="col-xs-6 align-items-center" style="float:left; direction:ltr">
<input type="hidden" name="SalariesAndCoefficientList[@groupIndex].Id" value="@itemLeft.Id" />
<input type="hidden" name="SalariesAndCoefficientList[@groupIndex].GroupNo" value="@itemLeft.GroupNo"/>
<input type="hidden" name="SalariesAndCoefficientList[@groupIndex].ClassificationGroupId" value="@itemLeft.ClassificationGroupId"/>
<input type="text" class="form-control amount" name="SalariesAndCoefficientList[@groupIndex].GroupSalaryStr" value="@itemLeft.GroupSalaryStr"/>
</div>
<div class="col-xs-3"></div>
<div class="col-xs-3">
<div class="row-number-salaries">
<span>گروه</span>
<span>&nbsp;</span>
<span>@itemLeft.GroupNo</span>
</div>
</div>
</div>
groupIndex++;
}
</div>
</div>
</div>
</div>
</div>
<input type="hidden" id="schemeId" asp-for="@Model.SchemeId" value="@Model.SchemeId" />
<input type="hidden" asp-for="TypeOfCoefficient" value="TypeOfCoefficient" />
<div class="modal-footer border-0">
<button type="submit" class="btn btn-success px-4 rounded-pill">ذخیره</button>
<button type="button" class="btn btn-outline-secondary px-4 rounded-pill" data-dismiss="modal">بستن</button>
</div>
</form>
<script>
$(document).ready(function () {
$(".date-input").mask("0000/00/00");
$('.amount').on('input',
function() {
this.value = this.value.replace(/[^\d]/, '');
var contractAmount = $(this);
//setting format
numeral.defaultFormat("0,0 تومان");
contractAmount.on("keyup",
function(e) {
contractAmount.val(numeral(contractAmount.val()).format());
});
});
});
</script>

View File

@@ -0,0 +1,94 @@
@using _0_Framework.Application.Enums
@model CompanyManagment.App.Contracts.ClassificationScheme.EditClassificationScheme
@{
<style>
.modal-footer {
padding: 0.5rem 1rem !important; /* کوچکتر کردن فاصله */
margin-top: -10px; /* کمی بالا آوردن */
}
.modal .modal-dialog .modal-content {
padding-bottom: 10px;
}
</style>
}
<div class="modal-header">
<h5 class="modal-title"> ویرایش طرح </h5>
<button type="button" class="close" data-dismiss="modal" aria-label="بستن">
<span aria-hidden="true">&times;</span>
</button>
</div>
<form asp-page="./ClassificationScheme" asp-page-handler="EditScheme" method="post" autocomplete="off"
data-ajax="true" data-action="Refresh" enctype="multipart/form-data">
<div class="modal-body">
<div class="card shadow-sm border-0">
<div class="card-body">
<div class="row">
<div class="col-md-6 mb-3">
<label asp-for="DesignerFullName" class="form-label">نام طراح</label>
<input asp-for="DesignerFullName" class="form-control" />
<span asp-validation-for="DesignerFullName" class="text-danger"></span>
</div>
<div class="col-md-6 mb-3">
<label asp-for="DesignerPhone" class="form-label">شماره تماس طراح</label>
<input asp-for="DesignerPhone" class="form-control" />
<span asp-validation-for="DesignerPhone" class="text-danger"></span>
</div>
</div>
<div class="row m-t-10">
<div class="col-md-6 mb-3">
<label asp-for="IncludingDateFa" class="form-label">تاریخ شمول طرح</label>
<input type="text" asp-for="IncludingDateFa" class="form-control date-input"/>
<span asp-validation-for="IncludingDateFa" class="text-danger"></span>
</div>
<div class="col-md-6 mb-3">
<label asp-for="ExecutionDateFa" class="form-label">تاریخ اجرای طرح</label>
<input type="text" asp-for="ExecutionDateFa" class="form-control date-input"/>
<span asp-validation-for="ExecutionDateFa" class="text-danger"></span>
</div>
</div>
<div class="lineDiv"></div>
<div class="row m-t-10">
<div class="col-md-6 mb-3">
<div class="form-control" style="border-color:#fff !important;">
<label asp-for="TypeOfCoefficient" class="form-label" style="float: left;">نوع محاسبه ضریب ریالی</label>
</div>
</div>
<div class="col-md-6 mb-3">
<select asp-for="TypeOfCoefficient" class="form-select form-control">
<option value="@((int)TypeOfCoefficient.RialCoefficient)">ضریب ریالی طرح</option>
<option value="@((int)TypeOfCoefficient.JobOrganization)">ضریب شورای عالی کار</option>
</select>
<span asp-validation-for="TypeOfCoefficient" class="text-danger"></span>
</div>
</div>
<div class="lineDiv"></div>
</div>
</div>
</div>
<input type="hidden" asp-for="WorkshopId" value="@Model.WorkshopId" />
<input type="hidden" asp-for="Id" value="@Model.Id" />
<div class="modal-footer border-0">
<button type="submit" class="btn btn-success px-4 rounded-pill">ذخیره</button>
<button type="button" class="btn btn-outline-secondary px-4 rounded-pill" data-dismiss="modal">بستن</button>
</div>
</form>
<script>
$(document).ready(function () {
$(".date-input").mask("0000/00/00");
});
</script>

View File

@@ -0,0 +1,386 @@
@using _0_Framework.Application.Enums
@model CompanyManagment.App.Contracts.ClassificationScheme.EmployeeInfoTab
@Html.AntiForgeryToken()
@{
<style>
.modal-footer {
padding: 0.5rem 1rem !important; /* کوچکتر کردن فاصله */
margin-top: -10px; /* کمی بالا آوردن */
}
.modal .modal-dialog .modal-content {
padding-bottom: 10px;
}
.items {
flex: 0 0 calc(33.333% - 8px); /* دقیقاً سه‌تا در هر سطر */
box-sizing: border-box;
direction: rtl;
justify-content: flex-start;
align-items: flex-start; /* آیتم‌ها در یک راستا از بالا */
padding: 6px 10px;
border-radius: 5px;
min-height: 36px; /* برای ارتفاع یکنواخت */
}
.hiddenCompute {
display: none !important;
}
.trTable {
background-color: cadetblue;
color: aliceblue;
border-radius: 5px;
padding: 3px;
margin: 3px;
}
.st {
background: #cecece;
border-radius: 8px;
padding: 0;
overflow: hidden;
box-sizing: border-box;
direction: rtl;
font-family: "IranSans", sans-serif;
margin: 5px 0px;
font-size: 13px;
}
.st .header {
background: #0d4c4c;
color: #fff;
padding: 10px 14px;
text-align: center;
font-weight: 700;
border-radius: 8px 8px 0 0;
}
.st .trTable {
padding: 4px 9px;
margin: 0;
display: block;
margin: 3px 3px;
}
.st .trTable .content {
display: flex;
justify-content: space-between;
align-items: center;
gap: 8px;
}
.st .trTable.green {
background: forestgreen;
color: #fff;
}
.st .trTable.red {
background: #d9534f;
color: #fff;
}
.st .trTable.teal {
background: #5fb0b0;
color: #fff;
}
.st .trTable.orange {
background: orangered;
color: #fff;
}
.date {
font-family: 'IranText' !important;
font-size: 12px;
}
</style>
}
<div class="modal-header">
<h5 class="modal-title">تست طرح</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="بستن">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
<div class="card shadow-sm border-0">
<div class="card-body">
<div class="lineDiv"></div>
<div class="row m-t-10">
<div class="col-md-6 mb-3">
<select id="employeeListSelect" asp-for="EmployeeId" class="form-select form-control">
<option value="0">انتخاب پرسنل </option>
@foreach (var item in @Model.EmployeeInfoList)
{
<option value="@item.EmployeeId"><span>@item.FullName</span></option>
}
</select>
</div>
<div class="col-md-6">
<div class="col-xs-4">
<select class="form-control" id="monthListSelect" asp-for="FullName" style="width: 100% !important">
<option value="0"> ماه</option>
<option value="01"> فروردین</option>
<option value="02"> اردیبهشت</option>
<option value="03"> خرداد</option>
<option value="04"> تیر</option>
<option value="05"> مرداد</option>
<option value="06"> شهریور</option>
<option value="07"> مهر</option>
<option value="08"> آبان</option>
<option value="09"> آذر</option>
<option value="10"> دی</option>
<option value="11"> بهمن</option>
<option value="12"> اسفند</option>
</select>
</div>
<div class="col-xs-4">
<select class="form-control " id="yearListSelect" asp-for="FullName" style="width: 100% !important">
<option value="0"> سال </option>
@foreach (string itemi in @Model.YearlyList)
{
<option style="font-family: 'IranSans' !important;" value="@itemi"> @itemi </option>
}
</select>
</div>
<div class="col-xs-4">
انتخاب تاریخ
</div>
</div>
</div>
<div class="lineDiv"></div>
<div class="row">
<div class="col-xs-6">
<span class="compute hiddenCompute" style="direction:ltr; display: flex; padding-left:13px;gap:9px;">
<span>
<h4> فرمول محاسبه مزد</h4>
</span>
</span>
</div>
<div class="col-xs-6">
<span class="compute hiddenCompute" style="display: flex; padding-left:13px;gap:9px">
<span>
<h4> مزد شغل</h4>
</span>
</span>
</div>
</div>
<div class="row" style="text-align center">
<div class="col-xs-6">
<span class="compute hiddenCompute" style="direction:ltr; display: flex; padding-left:13px;gap:9px;">
<span>
<h2>(</h2>
</span><span id="coeficient"></span>
<span>
<h2>x</h2>
</span><span id="rate"></span>
<span>
<h2>)</h2>
</span>
<span>
<h2>+</h2>
</span><span id="salary"></span>
<span>
<h2>=</h2>
</span><span id="salaryResultDouble"></span>
</span>
</div>
<div class="col-xs-6">
<span class="compute hiddenCompute" style="display: flex; padding-left:13px;gap:9px">
<span id="salaryResult"></span><span><h3>ریال</h3></span>
</span>
</div>
</div>
<div class="lineDiv compute hiddenCompute"></div>
<div class="row" style="text-align center">
<div class="st hiddenCompute">
</div>
<span class="compute hiddenCompute" style="display: flex; padding-right:8px;gap:9px">
<span ><h4>پایه سنوات</h4></span>
</span>
<span class="compute hiddenCompute" style="display: flex; padding-right:8px;gap:9px">
<span id="baseYearResult"></span>
<span>
<h3>ریال</h3></span>
</span>
</div>
<div class="lineDiv compute hiddenCompute"></div>
<div class="row">
<span class="compute hiddenCompute" style="display: flex; padding-right:8px;gap:9px">
<span ><h4>مزد مبنا</h4></span>
</span>
</div>
<div class="row" style="text-align center">
<span class="compute hiddenCompute" style="display: flex; padding-right:8px;gap:9px">
<span id="mabnaDailyWage"></span><span><h3>ریال</h3></span>
</span>
</div>
<div class="lineDiv compute hiddenCompute"></div>
</div>
</div>
</div>
<div class="modal-footer border-0">
<button type="button" onclick="computeTest()" class="btn btn-success px-4 rounded-pill">تست</button>
<button type="button" class="btn btn-outline-secondary px-4 rounded-pill" data-dismiss="modal">بستن</button>
</div>
<script>
$(document).ready(function () {
$(".date-input").mask("0000/00/00");
});
function computeTest(selectElement) {
const employeeSelect = document.getElementById("employeeListSelect");
const monthSelect = document.getElementById("monthListSelect");
const yearSelect = document.getElementById("yearListSelect");
const employeeId = employeeSelect.options[employeeSelect.selectedIndex].value;
const year = yearSelect.options[yearSelect.selectedIndex].value;
const month = monthSelect.options[monthSelect.selectedIndex].value;
if (employeeSelect == 0) {
$.Notification.autoHideNotify('error', 'top center', 'پیام سیستم', "پرسنل را انتخاب کنید");
return;
}
if (year == 0) {
$.Notification.autoHideNotify('error', 'top center', 'پیام سیستم', "سال را انتخاب کنید");
return;
}
if (month == 0) {
$.Notification.autoHideNotify('error', 'top center', 'پیام سیستم', "ماه را انتخاب کنید");
return;
}
let schemeId = '@Model.SchemeId';
var url = `/Admin/Company/Workshops/ClassificationScheme?handler=ComputeTest&schemeId=${schemeId}&employeeId=${employeeId}&year=${year}&month=${month}`;
// console.log("Request URL:", url);
$.get(url, function (data) {
$('.compute').removeClass('hiddenCompute');
$('.st').removeClass('hiddenCompute');
$('#coeficient').empty();
$('#coeficient').append(`<h2>${data.coefficient}</h2>`);
$('#rate').empty();
$('#rate').append(`<h2>${data.rate}</h2>`);
$('#salary').empty();
$('#salary').append(`<h2>${data.salary}</h2>`);
$('#salaryResultDouble').empty();
$('#salaryResultDouble').append(`<h2>${data.salaryResultDouble}</h2>`);
$('#salaryResult').empty();
$('#salaryResult').append(`<h2>${data.salaryResult}</h2>`);
$('#baseYearResult').empty();
$('#baseYearResult').append(`<h2>${data.baseYearResult}</h2>`);
$('#mabnaDailyWage').empty();
$('#mabnaDailyWage').append(`<h2>${data.mabnaDailyWage}</h2>`);
$('.st').empty();
if(data.baseYearResult != "0"){
$('.st').append(`
<div class="header">محاسبه پایه سنوات</div>
`);
data.baseYearDataList.forEach(item => {
if(item.hasStartWork){
$('.st').append(`
<div class="trTable green">
<div class="content">
<div class="date">${item.baseYearPayDay}</div>
<div>شروع بکار</div>
</div>
</div>`);
}else if(item.hasLeftWork){
$('.st').append(`
<div class="trTable red">
<div class="content">
<div class="date">${item.baseYearPayDay}</div>
<div>ترک کار</div>
</div>
</div>`);
}else{
if(item.baseYearPayDay == "-"){
$('.st').append(`
<div class="trTable orange">
<div class="content">
<div>
<span class="date">${item.baseYearPayDay}</span>
<span>فقط ارتقاء</span>
</div>
<div class="date">${item.baseYear}</div>
</div>
</div>`);
}else{
$('.st').append(`
<div class="trTable teal">
<div class="content">
<div class="date">${item.baseYearPayDay}</div>
<div class="date">${item.baseYear}</div>
</div>
</div>`);
}
}
});
}else{
$('.st').append(`
<div class="trTable">
<div class="trTable teal">
<div class="content">
<div>پایه سنوات ندارد</div>
</div>
</div>
</div>`);
}
});
}
</script>

View File

@@ -16,10 +16,10 @@
//local //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;",
//dad-mehr //dad-mehr
//"MesbahDb": "Data Source=.;Initial Catalog=teamWork;Integrated Security=True;TrustServerCertificate=true;", "MesbahDb": "Data Source=.;Initial Catalog=teamWork;Integrated Security=True;TrustServerCertificate=true;",
"TestDb": "Data Source=.;Initial Catalog=TestDb;Integrated Security=True;TrustServerCertificate=true;" "TestDb": "Data Source=.;Initial Catalog=TestDb;Integrated Security=True;TrustServerCertificate=true;"

View File

@@ -8,10 +8,10 @@
}, },
"ConnectionStrings": { "ConnectionStrings": {
//"MesbahDb": "Data Source=.\\MSSQLSERVER2019;Initial Catalog=mesbah_db;Persist Security Info=False;User ID=mesbah_db;Password=sa142857$@;" //"MesbahDb": "Data Source=.\\MSSQLSERVER2019;Initial Catalog=mesbah_db;Persist Security Info=False;User ID=mesbah_db;Password=sa142857$@;"
"MesbahDb": "Data Source=.;Initial Catalog=mesbah_db;Integrated Security=True;TrustServerCertificate=true;", //"MesbahDb": "Data Source=.;Initial Catalog=mesbah_db;Integrated Security=True;TrustServerCertificate=true;",
//dad-mehr //dad-mehr
//"MesbahDb": "Data Source=.;Initial Catalog=teamWork;Integrated Security=True;TrustServerCertificate=true;", "MesbahDb": "Data Source=.;Initial Catalog=teamWork;Integrated Security=True;TrustServerCertificate=true;",
//testDb //testDb
"TestDb": "Data Source=.;Initial Catalog=TestDb;Integrated Security=True;TrustServerCertificate=true;" "TestDb": "Data Source=.;Initial Catalog=TestDb;Integrated Security=True;TrustServerCertificate=true;"
@@ -27,6 +27,6 @@
}, },
"AllowedHosts": "*", "AllowedHosts": "*",
//"Domain": ".dad-mehr.ir" //"Domain": ".dad-mehr.ir"
"Domain": ".gozareshgir.ir" "Domain": ".dad-mehr.ir"
} }

View File

@@ -297,6 +297,27 @@ function CallBackHandler(data, action, form) {
}, 1000);
} else {
/*alert(data.message);*/
console.log(data.message)
$.Notification.autoHideNotify('error', 'top center', 'پیام سیستم ', data.message);
}
break;
case "salariesTab":
if (data.isSuccedded) {
$.Notification.autoHideNotify('success', 'top center', 'پیام سیستم ', data.message);
$('.close').click();
setTimeout(function () {
$('#salariesTab').click();
}, 1000); }, 1000);
} else { } else {
@@ -306,6 +327,7 @@ function CallBackHandler(data, action, form) {
} }
break; break;
case "RefereshList": case "RefereshList":
{ {
if(data.IsSucceedded==true) if(data.IsSucceedded==true)