Compare commits
48 Commits
83b045c2b1
...
Feature/Em
| Author | SHA1 | Date | |
|---|---|---|---|
| b2cb3ae173 | |||
| a6c25ec8e8 | |||
| 7b2eefa954 | |||
| 3303d4b54a | |||
| dba28b4d89 | |||
|
|
41ec3fb9cf | ||
|
|
7f98cf8f12 | ||
|
|
6c8385061e | ||
|
|
a49467ee44 | ||
| e9907650e9 | |||
|
|
0e66c5e1a0 | ||
|
|
27a92f5796 | ||
| 6e5788074c | |||
| 831b426f9f | |||
| b29b1335d3 | |||
|
|
befcc70d46 | ||
|
|
f249df5b49 | ||
| 24d41ffc68 | |||
|
|
c6d4d7d473 | ||
| c594cbf523 | |||
| 996adec188 | |||
| 6f47948e40 | |||
|
|
d135eb73ea | ||
|
|
86143a044c | ||
| 8a6d4e0af6 | |||
| 3b2fd137e4 | |||
| 52976d8965 | |||
| ec97274d5e | |||
| c9183fb57e | |||
|
|
c4d21be4aa | ||
|
|
e9386708dc | ||
|
|
d70abb60d7 | ||
| 2098e843a5 | |||
| f6b6dfa046 | |||
| 36cdde7e6a | |||
|
|
34358a36c9 | ||
|
|
babecda188 | ||
|
|
98c3e7c821 | ||
|
|
5d91b29f2b | ||
| 87b0d248a3 | |||
| a410d0c216 | |||
| a640f91703 | |||
|
|
99c8dcb764 | ||
|
|
d44935329f | ||
|
|
3a7fc7087b | ||
| 925f43214c | |||
|
|
c2fc7dabc1 | ||
|
|
dec5666eb7 |
@@ -1,8 +0,0 @@
|
||||
namespace _0_Framework.Application.Enums;
|
||||
|
||||
public enum ActivationStatus
|
||||
{
|
||||
None = 0,
|
||||
Active = 1,
|
||||
DeActive = 2
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
namespace _0_Framework.Application.Enums;
|
||||
|
||||
public enum LegalType
|
||||
{
|
||||
None = 0,
|
||||
Real = 1,
|
||||
Legal = 2
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
namespace _0_Framework.Application;
|
||||
|
||||
public class SelectListViewModel
|
||||
{
|
||||
public long Id { get; set; }
|
||||
public string Text { get; set; }
|
||||
}
|
||||
@@ -41,23 +41,6 @@ public static class Tools
|
||||
return Regex.IsMatch(mobileNo, "^((09))(\\d{9})$");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// تاریخ شروع و تعداد ماه را میگیرد و تاریخ پایان قراردا را بر میگرداند
|
||||
/// </summary>
|
||||
/// <param name="startDate"></param>
|
||||
/// <param name="monthPlus"></param>
|
||||
/// <returns></returns>
|
||||
public static (DateTime endDateGr, string endDateFa) FindEndOfContract(string startDate, string monthPlus)
|
||||
{
|
||||
|
||||
int startYear = Convert.ToInt32(startDate.Substring(0, 4));
|
||||
int startMonth = Convert.ToInt32(startDate.Substring(5, 2));
|
||||
int startDay = Convert.ToInt32(startDate.Substring(8, 2));
|
||||
var start = new PersianDateTime(startYear, startMonth, startDay);
|
||||
var end = (start.AddMonths(Convert.ToInt32(monthPlus))).AddDays(-1);
|
||||
return ($"{end}".ToGeorgianDateTime(), $"{end}");
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// دریافت روزهای کارکرد پرسنل در لیست بیمه ماه مشخص شده
|
||||
@@ -1413,6 +1396,73 @@ public static class Tools
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// چک میکند که در دو شیفت استاتیک تداخل زمانی وجود دارد یا خیر
|
||||
/// چک میکند که آیا ساعات وارد شده ولید هستند یا خیر
|
||||
/// </summary>
|
||||
/// <param name="start1"></param>
|
||||
/// <param name="end1"></param>
|
||||
/// <param name="start2"></param>
|
||||
/// <param name="end2"></param>
|
||||
/// <returns></returns>
|
||||
public static bool InterferenceTime(string start1, string end1, string start2, string end2)
|
||||
{
|
||||
if (!CheckValidHm(start1))
|
||||
return true;
|
||||
|
||||
if (!CheckValidHm(end1))
|
||||
return true;
|
||||
|
||||
if (!CheckValidHm(start2))
|
||||
return true;
|
||||
|
||||
if (!CheckValidHm(end2))
|
||||
return true;
|
||||
|
||||
//اگه دو شیفت نبود
|
||||
if (string.IsNullOrWhiteSpace(start1) || string.IsNullOrWhiteSpace(start2))
|
||||
return false;
|
||||
|
||||
|
||||
try
|
||||
{
|
||||
var start1Gr = Convert.ToDateTime(start1);
|
||||
var end1Gr = Convert.ToDateTime(end1);
|
||||
|
||||
if (end1Gr < start1Gr)
|
||||
end1Gr = end1Gr.AddDays(1);
|
||||
|
||||
var start2Gr = Convert.ToDateTime(start2);
|
||||
var end2Gr = Convert.ToDateTime(end2);
|
||||
|
||||
|
||||
start2Gr = new DateTime(end1Gr.Year, end1Gr.Month, end1Gr.Day, start2Gr.Hour, start2Gr.Minute,
|
||||
start2Gr.Second);
|
||||
|
||||
|
||||
end2Gr = new DateTime(end1Gr.Year, end1Gr.Month, end1Gr.Day, end2Gr.Hour, end2Gr.Minute,
|
||||
end2Gr.Second);
|
||||
if (end2Gr < start2Gr)
|
||||
end2Gr = end2Gr.AddDays(1);
|
||||
|
||||
var diff = (end1Gr - start1Gr).Add((end2Gr - start2Gr));
|
||||
if (diff > new TimeSpan(24,0,0))
|
||||
return true;
|
||||
|
||||
if (start2Gr <= end1Gr)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
public static DateTime FindFirstDayOfMonthGr(this DateTime date)
|
||||
{
|
||||
var pc = new PersianCalendar();
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
using AccountManagement.Domain.TaskAgg;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using AccountManagement.Domain.TaskMessageAgg;
|
||||
|
||||
namespace AccountManagement.Domain.AssignAgg;
|
||||
@@ -158,4 +159,24 @@ public class Assign : EntityBase
|
||||
IsDoneRequest=isDoneRequest;
|
||||
DoneDescription=doneDescription;
|
||||
}
|
||||
|
||||
public void ChangeAssignedId(long assignedId)
|
||||
{
|
||||
AssignedId = assignedId;
|
||||
}
|
||||
|
||||
public void SetAssignerId(long assignerId)
|
||||
{
|
||||
AssignerId = assignerId;
|
||||
}
|
||||
|
||||
public void ChangeSender(long senderId)
|
||||
{
|
||||
Task.SetSender(senderId);
|
||||
var taskMessageItemsEnumerable =TaskMessageList.SelectMany(m => m.TaskMessageItemsList);
|
||||
foreach (var taskMessageItems in taskMessageItemsEnumerable)
|
||||
{
|
||||
taskMessageItems.SetSenderId(senderId);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,12 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Security.AccessControl;
|
||||
using _0_Framework.Domain;
|
||||
using AccountManagement.Domain.AssignAgg;
|
||||
using AccountManagement.Domain.TaskMediaAgg;
|
||||
using AccountManagement.Domain.TaskScheduleAgg;
|
||||
using OfficeOpenXml.Style;
|
||||
|
||||
namespace AccountManagement.Domain.TaskAgg;
|
||||
|
||||
@@ -80,4 +82,40 @@ public class Tasks : EntityBase
|
||||
TaskScheduleId = taskScheduleId;
|
||||
}
|
||||
|
||||
public void ChangeSender(long senderId)
|
||||
{
|
||||
var prevSender = SenderId;
|
||||
|
||||
var assigners = Assigns.Where(x => x.AssignerId == prevSender).ToList();
|
||||
|
||||
foreach (var assigner in assigners)
|
||||
{
|
||||
assigner.SetAssignerId(senderId);
|
||||
}
|
||||
|
||||
var senderMessageItem = Assigns
|
||||
.SelectMany(x=>x.TaskMessageList
|
||||
.SelectMany(m=>m.TaskMessageItemsList)).Where(x=>x.SenderAccountId == prevSender).ToList();
|
||||
|
||||
var receiverMessageItem = Assigns.SelectMany(x=>x.TaskMessageList
|
||||
.SelectMany(m=>m.TaskMessageItemsList)).Where(x=>x.ReceiverAccountId == prevSender).ToList();
|
||||
|
||||
|
||||
SenderId = senderId;
|
||||
|
||||
foreach (var taskMessageItems in senderMessageItem)
|
||||
{
|
||||
taskMessageItems.SetSenderId(senderId);
|
||||
}
|
||||
foreach (var taskMessageItems in receiverMessageItem)
|
||||
{
|
||||
taskMessageItems.SetReceiver(senderId);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void SetSender(long senderId)
|
||||
{
|
||||
SenderId = senderId;
|
||||
}
|
||||
}
|
||||
@@ -19,4 +19,13 @@ public class TaskMessageItems:EntityBase
|
||||
public TaskMessage TaskMessage { get; set; }
|
||||
|
||||
|
||||
public void SetSenderId(long senderId)
|
||||
{
|
||||
SenderAccountId = senderId;
|
||||
}
|
||||
|
||||
public void SetReceiver(long receiverId)
|
||||
{
|
||||
ReceiverAccountId = receiverId;
|
||||
}
|
||||
}
|
||||
@@ -3,6 +3,7 @@ using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using _0_Framework.Application;
|
||||
using _0_Framework.Domain;
|
||||
using _0_Framework.Domain.CustomizeCheckoutShared.Enums;
|
||||
using Company.Domain.CheckoutAgg.ValueObjects;
|
||||
using Company.Domain.CustomizeCheckoutAgg.ValueObjects;
|
||||
using Company.Domain.WorkshopAgg;
|
||||
@@ -29,7 +30,7 @@ public class Checkout : EntityBase
|
||||
string overNightWorkValue, string fridayWorkValue, string rotatingShifValue, string absenceValue,
|
||||
string totalDayOfLeaveCompute, string totalDayOfYearsCompute, string totalDayOfBunosesCompute,
|
||||
ICollection<CheckoutLoanInstallment> loanInstallments,
|
||||
ICollection<CheckoutSalaryAid> salaryAids)
|
||||
ICollection<CheckoutSalaryAid> salaryAids,CheckoutRollCall checkoutRollCall)
|
||||
{
|
||||
EmployeeFullName = employeeFullName;
|
||||
FathersName = fathersName;
|
||||
@@ -88,6 +89,7 @@ public class Checkout : EntityBase
|
||||
TotalDayOfBunosesCompute = totalDayOfBunosesCompute;
|
||||
LoanInstallments = loanInstallments;
|
||||
SalaryAids = salaryAids;
|
||||
CheckoutRollCall = checkoutRollCall;
|
||||
}
|
||||
|
||||
public string EmployeeFullName { get; private set; }
|
||||
@@ -196,7 +198,8 @@ public class Checkout : EntityBase
|
||||
|
||||
public ICollection<CheckoutLoanInstallment> LoanInstallments { get; set; } = [];
|
||||
public ICollection<CheckoutSalaryAid> SalaryAids { get; set; } = [];
|
||||
#endregion
|
||||
public CheckoutRollCall CheckoutRollCall { get; private set; }
|
||||
#endregion
|
||||
|
||||
|
||||
public Workshop Workshop { get; set; }
|
||||
@@ -308,4 +311,149 @@ public class Checkout : EntityBase
|
||||
LoanInstallments = lonaInstallments;
|
||||
InstallmentDeduction = installmentsAmount;
|
||||
}
|
||||
|
||||
public void SetCheckoutRollCall(CheckoutRollCall checkoutRollCall)
|
||||
{
|
||||
CheckoutRollCall = checkoutRollCall;
|
||||
}
|
||||
}
|
||||
|
||||
public class CheckoutRollCall
|
||||
{
|
||||
private CheckoutRollCall(){}
|
||||
public CheckoutRollCall(TimeSpan totalMandatoryTimeSpan, TimeSpan totalPresentTimeSpan, TimeSpan totalBreakTimeSpan,
|
||||
TimeSpan totalWorkingTimeSpan, TimeSpan totalPaidLeaveTmeSpan, TimeSpan totalSickLeaveTimeSpan,
|
||||
ICollection<CheckoutRollCallDay> rollCallDaysCollection)
|
||||
{
|
||||
TotalMandatoryTimeSpan = totalMandatoryTimeSpan;
|
||||
TotalPresentTimeSpan = totalPresentTimeSpan;
|
||||
TotalBreakTimeSpan = totalBreakTimeSpan;
|
||||
TotalWorkingTimeSpan = totalWorkingTimeSpan;
|
||||
TotalPaidLeaveTmeSpan = totalPaidLeaveTmeSpan;
|
||||
TotalSickLeaveTimeSpan = totalSickLeaveTimeSpan;
|
||||
RollCallDaysCollection = rollCallDaysCollection;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// مجموع ساعت موظفی
|
||||
/// </summary>
|
||||
public TimeSpan TotalMandatoryTimeSpan { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// مجموع ساعت حضور
|
||||
/// </summary>
|
||||
public TimeSpan TotalPresentTimeSpan { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// مجموع ساعت استراحت
|
||||
/// </summary>
|
||||
public TimeSpan TotalBreakTimeSpan { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// مجموع ساعت کارکرد
|
||||
/// </summary>
|
||||
public TimeSpan TotalWorkingTimeSpan { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// مجموع ساعت مرخصی استحقاقی
|
||||
/// </summary>
|
||||
public TimeSpan TotalPaidLeaveTmeSpan { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// مجموع ساعت مرخصی استعلاجی
|
||||
/// </summary>
|
||||
public TimeSpan TotalSickLeaveTimeSpan { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// روز های حضور غیاب
|
||||
/// </summary>
|
||||
public ICollection<CheckoutRollCallDay> RollCallDaysCollection { get; private set; }
|
||||
}
|
||||
|
||||
public class CheckoutRollCallDay
|
||||
{
|
||||
private CheckoutRollCallDay(){}
|
||||
public CheckoutRollCallDay(DateTime date, string firstStartDate, string firstEndDate,
|
||||
string secondStartDate, string secondEndDate, TimeSpan breakTimeSpan,
|
||||
bool isSliced, TimeSpan workingTimeSpan, bool isAbsent, bool isFriday,
|
||||
bool isHoliday, string leaveType)
|
||||
{
|
||||
Date = date;
|
||||
FirstStartDate = firstStartDate;
|
||||
FirstEndDate = firstEndDate;
|
||||
SecondStartDate = secondStartDate;
|
||||
SecondEndDate = secondEndDate;
|
||||
BreakTimeSpan = breakTimeSpan;
|
||||
IsSliced = isSliced;
|
||||
WorkingTimeSpan = workingTimeSpan;
|
||||
IsAbsent = isAbsent;
|
||||
IsFriday = isFriday;
|
||||
IsHoliday = isHoliday;
|
||||
LeaveType = leaveType;
|
||||
}
|
||||
|
||||
public long Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// تاریخ
|
||||
/// </summary>
|
||||
public DateTime Date { get; private set; }
|
||||
/// <summary>
|
||||
/// ورود اول
|
||||
/// </summary>
|
||||
public string FirstStartDate { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// خروج اول
|
||||
/// </summary>
|
||||
public string FirstEndDate { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// ورود دوم
|
||||
/// </summary>
|
||||
public string SecondStartDate { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// خروج دوم
|
||||
/// </summary>
|
||||
public string SecondEndDate { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// ساعت استراحت
|
||||
/// </summary>
|
||||
public TimeSpan BreakTimeSpan { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// مقدار زمان کارکرد
|
||||
/// </summary>
|
||||
public TimeSpan WorkingTimeSpan { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// آیا منقطع است؟
|
||||
/// </summary>
|
||||
public bool IsSliced { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// آیا غیبت است
|
||||
/// </summary>
|
||||
public bool IsAbsent { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// آیا جمعه است
|
||||
/// </summary>
|
||||
public bool IsFriday { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// آیا تعطیل رسمی است
|
||||
/// </summary>
|
||||
public bool IsHoliday { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// نوع مرخصی - درصورت نداشتن مرخصی مقدارش null میباشد
|
||||
/// </summary>
|
||||
public string LeaveType { get; private set; }
|
||||
|
||||
public long CheckoutId { get; set; }
|
||||
|
||||
}
|
||||
@@ -1,26 +0,0 @@
|
||||
using _0_Framework.Domain;
|
||||
|
||||
namespace Company.Domain.ContactUsAgg;
|
||||
|
||||
public class ContactUs:EntityBase
|
||||
{
|
||||
public ContactUs(string firstName, string lastName, string email, string phoneNumber, string title, string message)
|
||||
{
|
||||
FirstName = firstName.Trim();
|
||||
LastName = lastName.Trim();
|
||||
Email = email;
|
||||
PhoneNumber = phoneNumber;
|
||||
Title = title;
|
||||
Message = message;
|
||||
FullName = FirstName + " " + LastName;
|
||||
}
|
||||
|
||||
public string FirstName { get; private set; }
|
||||
public string LastName { get; private set; }
|
||||
public string Email { get; private set; }
|
||||
public string PhoneNumber { get; private set; }
|
||||
public string Title { get; private set; }
|
||||
public string Message { get; private set; }
|
||||
public string FullName { get; private set; }
|
||||
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
using _0_Framework.Domain;
|
||||
|
||||
namespace Company.Domain.ContactUsAgg;
|
||||
|
||||
public interface IContactUsRepository : IRepository<long, ContactUs>
|
||||
{
|
||||
|
||||
}
|
||||
@@ -3,7 +3,6 @@ using System.Collections.Generic;
|
||||
using _0_Framework.Application;
|
||||
using _0_Framework.Domain;
|
||||
using AccountManagement.Application.Contracts.Account;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Company.Domain.ContarctingPartyAgg;
|
||||
|
||||
@@ -43,34 +42,6 @@ public interface IPersonalContractingPartyRepository :IRepository<long, Personal
|
||||
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
/// لیست طرف حساب ها
|
||||
/// </summary>
|
||||
/// <param name="searchModel"></param>
|
||||
/// <returns></returns>
|
||||
Task<ICollection<ContractingPartyGetListViewModel>> GetList(ContractingPartyGetListSearchModel searchModel);
|
||||
|
||||
/// <summary>
|
||||
/// لیست طرف حساب برای سلکت لیست سرچ
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
Task<List<ContractingPartySelectListViewModel>> GetSelectList();
|
||||
|
||||
/// <summary>
|
||||
/// لیستی از شماره ملی یا شناسه ملی بر اساس حقیقی یا حقوقی بودن
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
Task<List<GetContractingPartyNationalCodeOrNationalIdViewModel>> GetNationalCodeOrNationalId();
|
||||
|
||||
/// <summary>
|
||||
/// غیرفعال کردن طرف حساب و زیرمجموعه های آن
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
Task<OperationResult<string>> DeactivateWithSubordinates(long id);
|
||||
|
||||
void Remove(PersonalContractingParty entity);
|
||||
Task<GetRealContractingPartyDetailsViewModel> GetRealDetails(long id);
|
||||
Task<GetLegalContractingPartyDetailsViewModel> GetLegalDetails(long id);
|
||||
|
||||
}
|
||||
@@ -213,7 +213,6 @@ public class CustomizeWorkshopEmployeeSettings : BaseCustomizeEntity
|
||||
earlyExit.EarlyExitTimeFines.Select(x => new EarlyExitTimeFine(x.Minute, x.FineMoney))
|
||||
.ToList(), earlyExit.Value);
|
||||
}
|
||||
|
||||
public void UpdateIsShiftChange()
|
||||
{
|
||||
var groupSetting = CustomizeWorkshopGroupSettings;
|
||||
@@ -270,10 +269,4 @@ public class CustomizeWorkshopEmployeeSettings : BaseCustomizeEntity
|
||||
|
||||
IsShiftChanged = isShiftChange;
|
||||
}
|
||||
|
||||
|
||||
public void SetSalary(double salary)
|
||||
{
|
||||
Salary = salary;
|
||||
}
|
||||
}
|
||||
@@ -9,30 +9,83 @@ namespace Company.Domain.EmployeeComputeOptionsAgg
|
||||
{
|
||||
public class EmployeeComputeOptions : EntityBase
|
||||
{
|
||||
public EmployeeComputeOptions(long workshopId, long employeeId, string computeOptions, string bonusesOptions, string yearsOptions)
|
||||
{
|
||||
WorkshopId = workshopId;
|
||||
EmployeeId = employeeId;
|
||||
ComputeOptions = computeOptions;
|
||||
BonusesOptions = bonusesOptions;
|
||||
YearsOptions = yearsOptions;
|
||||
}
|
||||
public EmployeeComputeOptions(long workshopId, long employeeId, string computeOptions, string bonusesOptions, string yearsOptions,
|
||||
bool createContract, bool signContract, bool createCheckout, bool signCheckout)
|
||||
{
|
||||
WorkshopId = workshopId;
|
||||
EmployeeId = employeeId;
|
||||
ComputeOptions = computeOptions;
|
||||
BonusesOptions = bonusesOptions;
|
||||
YearsOptions = yearsOptions;
|
||||
|
||||
public long WorkshopId { get; private set;}
|
||||
public long EmployeeId { get; private set;}
|
||||
SetContractAndCheckoutOptions(createContract, signContract, createCheckout, signCheckout);
|
||||
}
|
||||
|
||||
//نحوه محاسبه مزد مرخصی
|
||||
public string ComputeOptions { get; private set; }
|
||||
//نحوه محاسبه عیدی
|
||||
public string BonusesOptions { get; private set; }
|
||||
//نحوه محاسبه سنوات
|
||||
public string YearsOptions { get; private set; }
|
||||
|
||||
public void Edit(string computeOptions, string bonusesOptions, string yearsOptions)
|
||||
{
|
||||
ComputeOptions = computeOptions;
|
||||
BonusesOptions = bonusesOptions;
|
||||
YearsOptions = yearsOptions;
|
||||
}
|
||||
}
|
||||
|
||||
public long WorkshopId { get; private set; }
|
||||
public long EmployeeId { get; private set; }
|
||||
|
||||
//نحوه محاسبه مزد مرخصی
|
||||
public string ComputeOptions { get; private set; }
|
||||
//نحوه محاسبه عیدی
|
||||
public string BonusesOptions { get; private set; }
|
||||
//نحوه محاسبه سنوات
|
||||
public string YearsOptions { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// ایجاد قرارداد
|
||||
/// </summary>
|
||||
public bool CreateContract { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// امضای قرارداد
|
||||
/// </summary>
|
||||
public bool SignContract { get; private set; }
|
||||
/// <summary>
|
||||
/// ایجاد تصفیه
|
||||
/// </summary>
|
||||
public bool CreateCheckout { get; private set; }
|
||||
/// <summary>
|
||||
/// امضای تصفیه
|
||||
/// </summary>
|
||||
public bool SignCheckout { get; private set; }
|
||||
|
||||
public void Edit(string computeOptions, string bonusesOptions, string yearsOptions, bool createContract, bool signContract, bool createCheckout,
|
||||
bool signCheckout)
|
||||
{
|
||||
ComputeOptions = computeOptions;
|
||||
BonusesOptions = bonusesOptions;
|
||||
YearsOptions = yearsOptions;
|
||||
SetContractAndCheckoutOptions(createContract, signContract, createCheckout, signCheckout);
|
||||
}
|
||||
|
||||
|
||||
|
||||
private void SetContractAndCheckoutOptions(bool createContract, bool signContract, bool createCheckout,
|
||||
bool signCheckout)
|
||||
{
|
||||
CreateContract = createContract;
|
||||
if (createContract)
|
||||
{
|
||||
SignContract = signContract;
|
||||
CreateCheckout = createCheckout;
|
||||
if (createCheckout)
|
||||
{
|
||||
SignCheckout = signCheckout;
|
||||
}
|
||||
else
|
||||
{
|
||||
SignCheckout = false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
SignContract = false;
|
||||
CreateCheckout = false;
|
||||
SignCheckout = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -64,9 +64,9 @@ public interface IInsuranceListRepository:IRepository<long, InsuranceList>
|
||||
#region Mahan
|
||||
Task<InsuranceListConfirmOperation> GetInsuranceOperationDetails(long id);
|
||||
|
||||
Task<InsuranceListTabsCountViewModel> GetTabCounts(long accountId,int month,int year);
|
||||
Task<InsuranceListTabsCountViewModel> GetTabCounts(InsuranceListSearchModel searchModel);
|
||||
|
||||
#endregion
|
||||
#endregion
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -38,12 +38,6 @@ public interface IRollCallMandatoryRepository : IRepository<long, RollCall>
|
||||
List<LateToWorkEarlyExistSpannig> LateToWorkEarlyExit(List<GroupedRollCalls> groupedRollCall,
|
||||
ICollection<CustomizeWorkshopEmployeeSettingsShift> shiftSettings, List<LeaveViewModel> leavList);
|
||||
|
||||
List<LoanInstallmentViewModel> LoanInstallmentForCheckout(long employeeId, long workshopId, DateTime contractStart,
|
||||
DateTime contractEnd);
|
||||
|
||||
List<SalaryAidViewModel> SalaryAidsForCheckout(long employeeId, long workshopId, DateTime checkoutStart,
|
||||
DateTime checkoutEnd);
|
||||
|
||||
/// <summary>
|
||||
/// گزارش نوبت کاری حضور غیاب
|
||||
/// </summary>
|
||||
@@ -53,6 +47,12 @@ public interface IRollCallMandatoryRepository : IRepository<long, RollCall>
|
||||
/// <param name="contractEnd"></param>
|
||||
/// <param name="shiftwork"></param>
|
||||
/// <returns></returns>
|
||||
List<LoanInstallmentViewModel> LoanInstallmentForCheckout(long employeeId, long workshopId, DateTime contractStart,
|
||||
DateTime contractEnd);
|
||||
|
||||
List<SalaryAidViewModel> SalaryAidsForCheckout(long employeeId, long workshopId, DateTime checkoutStart,
|
||||
DateTime checkoutEnd);
|
||||
|
||||
Task<ComputingViewModel> RotatingShiftReport(long workshopId, long employeeId, DateTime contractStart,
|
||||
DateTime contractEnd, string shiftwork, bool hasRollCall, CreateWorkingHoursTemp command,bool holidayWorking);
|
||||
}
|
||||
@@ -23,6 +23,7 @@ public class SalaryAid : EntityBase
|
||||
CalculationMonth = calculationMonth;
|
||||
CalculationYear = calculationYear;
|
||||
}
|
||||
|
||||
public long EmployeeId { get; private set; }
|
||||
public long WorkshopId { get; private set; }
|
||||
public double Amount { get; private set; }
|
||||
|
||||
@@ -14,7 +14,5 @@ public interface IWorkshopTempRepository : IRepository<long, WorkshopTemp>
|
||||
/// <returns></returns>
|
||||
Task<List<WorkshopTempViewModel>> GetWorkshopTemp(long contractingPartyTemp);
|
||||
|
||||
System.Threading.Tasks.Task RemoveWorkshopTemps(List<long> workshopTempIds);
|
||||
|
||||
|
||||
}
|
||||
@@ -34,14 +34,12 @@ public class InstitutionContractTemp : EntityBase
|
||||
/// بصورت یکجا
|
||||
/// -
|
||||
/// بصئورت ماهیانه
|
||||
/// OneTime
|
||||
/// </summary>
|
||||
public string PaymentModel { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// مدت قرارداد
|
||||
/// چند ماهه؟
|
||||
/// "12"
|
||||
/// </summary>
|
||||
public string PeriodModel { get; private set; }
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Security.AccessControl;
|
||||
using _0_Framework.Application;
|
||||
using _0_Framework.Domain;
|
||||
using Company.Domain.CheckoutAgg;
|
||||
using Company.Domain.ClientEmployeeWorkshopAgg;
|
||||
@@ -92,7 +93,7 @@ public class Workshop : EntityBase
|
||||
string state, string city, string address, string typeOfInsuranceSend, string typeOfContract, string contractTerm,
|
||||
string agreementNumber, bool fixedSalary, string population,long? insuranceJobId, string zoneName, bool addBonusesPay, bool addYearsPay, bool addLeavePay, bool totalPaymentHide,
|
||||
bool isClassified, string computeOptions, string bonusesOptions, string yearsOptions, string hasRollCallFreeVip, bool workshopHolidayWorking,
|
||||
bool insuranceCheckoutOvertime, bool insuranceCheckoutFamilyAllowance)
|
||||
bool insuranceCheckoutOvertime, bool insuranceCheckoutFamilyAllowance, bool createContract, bool signContract, bool createCheckout, bool signCheckout, IsActive cutContractEndOfYear)
|
||||
{
|
||||
WorkshopName = workshopName;
|
||||
WorkshopSureName = workshopSureName;
|
||||
@@ -136,7 +137,12 @@ public class Workshop : EntityBase
|
||||
WorkshopHolidayWorking = workshopHolidayWorking;
|
||||
InsuranceCheckoutOvertime = insuranceCheckoutOvertime;
|
||||
InsuranceCheckoutFamilyAllowance = insuranceCheckoutFamilyAllowance;
|
||||
}
|
||||
CreateContract = createContract;
|
||||
SignContract = signContract;
|
||||
CreateCheckout = createCheckout;
|
||||
SignCheckout = signCheckout;
|
||||
CutContractEndOfYear = cutContractEndOfYear;
|
||||
}
|
||||
|
||||
|
||||
public string WorkshopName { get; private set; }
|
||||
@@ -210,6 +216,19 @@ public class Workshop : EntityBase
|
||||
/// محاسبه حق اولاد در لیست بیمه
|
||||
/// </summary>
|
||||
public bool InsuranceCheckoutFamilyAllowance { get; private set; }
|
||||
|
||||
public bool CreateContract { get; private set; }
|
||||
public bool SignContract { get; private set; }
|
||||
public bool CreateCheckout { get; private set; }
|
||||
public bool SignCheckout { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// اگر قرارداد بیش از یک ماه باشد و گزینه انتخاب شده منتهی به پایان سال باشد
|
||||
/// این آیتم
|
||||
/// True
|
||||
/// است
|
||||
/// </summary>
|
||||
public IsActive CutContractEndOfYear { get; private set; }
|
||||
//public Employer Employer { get; private set; }
|
||||
|
||||
public Workshop()
|
||||
@@ -243,7 +262,7 @@ public class Workshop : EntityBase
|
||||
string state, string city, string address, string typeOfInsuranceSend, string typeOfContract, string contractTerm,
|
||||
string agreementNumber, bool fixedSalary, string population, long? insuranceJobId, string zoneName, bool addBonusesPay, bool addYearsPay, bool addLeavePay,
|
||||
bool totalPaymentHide, bool isClassified, string computeOptions, string bonusesOptions, string yearsOptions, string hasRollCallFreeVip, bool workshopHolidayWorking,
|
||||
bool insuranceCheckoutOvertime, bool insuranceCheckoutFamilyAllowance)
|
||||
bool insuranceCheckoutOvertime, bool insuranceCheckoutFamilyAllowance, bool createContract, bool signContract, bool createCheckout, bool signCheckout, IsActive cutContractEndOfYear)
|
||||
{
|
||||
WorkshopName = workshopName;
|
||||
WorkshopSureName = workshopSureName;
|
||||
@@ -284,7 +303,12 @@ public class Workshop : EntityBase
|
||||
WorkshopHolidayWorking = workshopHolidayWorking;
|
||||
InsuranceCheckoutOvertime = insuranceCheckoutOvertime;
|
||||
InsuranceCheckoutFamilyAllowance = insuranceCheckoutFamilyAllowance;
|
||||
}
|
||||
CreateContract = createContract;
|
||||
SignContract = signContract;
|
||||
CreateCheckout = createCheckout;
|
||||
SignCheckout = signCheckout;
|
||||
CutContractEndOfYear = cutContractEndOfYear;
|
||||
}
|
||||
|
||||
|
||||
public void Active(string archiveCode)
|
||||
|
||||
@@ -56,16 +56,6 @@ public interface IEmployerRepository : IRepository<long, Employer>
|
||||
|
||||
#endregion
|
||||
|
||||
#region Api
|
||||
Task<List<GetEmployerListViewModel>> GetEmployerList(GetEmployerSearchModel searchModel);
|
||||
|
||||
Task<GetLegalEmployerDetailViewModel> GetLegalEmployerDetail(long id);
|
||||
Task<GetRealEmployerDetailViewModel> GetRealEmployerDetail(long id);
|
||||
//Task<List<EmployerSelectListViewModel>> GetSelectList(string search);
|
||||
Task<OperationResult<string>> DeactivateWithSubordinates(long id);
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
}
|
||||
@@ -132,7 +132,115 @@ public class CheckoutViewModel
|
||||
/// مدت مرخصی استحقاقی
|
||||
/// </summary>
|
||||
public string TotalPaidLeave { get; set; }
|
||||
|
||||
public TimeSpan TotalHourlyLeave { get; set; }
|
||||
public List<CheckoutDailyRollCallViewModel> MonthlyRollCall { get; set; }
|
||||
public List<LoanInstallmentViewModel> InstallmentViewModels { get; set; }
|
||||
public List<SalaryAidViewModel> SalaryAidViewModels { get; set; }
|
||||
public CheckoutRollCallViewModel CheckoutRollCall { get; set; }
|
||||
|
||||
}
|
||||
|
||||
public class CheckoutRollCallViewModel
|
||||
{
|
||||
/// <summary>
|
||||
/// مجموع ساعت موظفی
|
||||
/// </summary>
|
||||
public TimeSpan TotalMandatoryTimeSpan { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// مجموع ساعت حضور
|
||||
/// </summary>
|
||||
public TimeSpan TotalPresentTimeSpan { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// مجموع ساعت استراحت
|
||||
/// </summary>
|
||||
public TimeSpan TotalBreakTimeSpan { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// مجموع ساعت کارکرد
|
||||
/// </summary>
|
||||
public TimeSpan TotalWorkingTimeSpan { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// مجموع ساعت مرخصی استحقاقی
|
||||
/// </summary>
|
||||
public TimeSpan TotalPaidLeaveTmeSpan { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// مجموع ساعت مرخصی استعلاجی
|
||||
/// </summary>
|
||||
public TimeSpan TotalSickLeaveTimeSpan { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// روز های حضور غیاب
|
||||
/// </summary>
|
||||
public ICollection<CheckoutRollCallDayViewModel> RollCallDaysCollection { get; set; }
|
||||
}
|
||||
|
||||
public class CheckoutRollCallDayViewModel
|
||||
{
|
||||
public long Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// تاریخ
|
||||
/// </summary>
|
||||
public DateTime Date { get; set; }
|
||||
/// <summary>
|
||||
/// ورود اول
|
||||
/// </summary>
|
||||
public string FirstStartDate { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// خروج اول
|
||||
/// </summary>
|
||||
public string FirstEndDate { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// ورود دوم
|
||||
/// </summary>
|
||||
public string SecondStartDate { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// خروج دوم
|
||||
/// </summary>
|
||||
public string SecondEndDate { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// ساعت استراحت
|
||||
/// </summary>
|
||||
public TimeSpan BreakTimeSpan { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// مقدار زمان کارکرد
|
||||
/// </summary>
|
||||
public TimeSpan WorkingTimeSpan { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// آیا منقطع است؟
|
||||
/// </summary>
|
||||
public bool IsSliced { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// آیا غیبت است
|
||||
/// </summary>
|
||||
public bool IsAbsent { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// آیا جمعه است
|
||||
/// </summary>
|
||||
public bool IsFriday { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// آیا تعطیل رسمی است
|
||||
/// </summary>
|
||||
public bool IsHoliday { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// نوع مرخصی - درصورت نداشتن مرخصی مقدارش null میباشد
|
||||
/// </summary>
|
||||
public string LeaveType { get; set; }
|
||||
|
||||
public long CheckoutId { get; set; }
|
||||
}
|
||||
@@ -5,6 +5,7 @@ using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using CompanyManagment.App.Contracts.Contract;
|
||||
using CompanyManagment.App.Contracts.Employee;
|
||||
using CompanyManagment.App.Contracts.RollCall;
|
||||
using CompanyManagment.App.Contracts.YearlySalary;
|
||||
using Microsoft.AspNetCore.Mvc.Rendering;
|
||||
|
||||
@@ -138,4 +139,20 @@ public class CreateCheckout
|
||||
|
||||
public string ShiftWork { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// محاسبه اضافه کار در بیمه
|
||||
/// </summary>
|
||||
public bool HasInsuranceChekoutOverTime {get; set; }
|
||||
|
||||
|
||||
public List<GroupedRollCalls> GroupedRollCalls { get; set; }
|
||||
|
||||
public TimeSpan TotalWorkingTimeSpan { get; set; }
|
||||
|
||||
public TimeSpan TotalBreakTimeSpan { get; set; }
|
||||
|
||||
public TimeSpan TotalPresentTimeSpan { get; set; }
|
||||
public TimeSpan TotalPaidLeave { get; set; }
|
||||
public TimeSpan TotalSickLeave { get; set; }
|
||||
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
using _0_Framework.Application;
|
||||
|
||||
namespace CompanyManagment.App.Contracts.ContactUs;
|
||||
|
||||
public interface IContactUsApplication
|
||||
{
|
||||
OperationResult Create(CreateContactUs command);
|
||||
}
|
||||
|
||||
public class CreateContactUs
|
||||
{
|
||||
public string FirstName { get; set; }
|
||||
public string LastName { get; set; }
|
||||
public string Email { get; set; }
|
||||
public string PhoneNumber { get; set; }
|
||||
public string Title { get; set; }
|
||||
public string Message { get; set; }
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using CompanyManagment.App.Contracts.Loan;
|
||||
using CompanyManagment.App.Contracts.RollCall;
|
||||
using CompanyManagment.App.Contracts.SalaryAid;
|
||||
using CompanyManagment.App.Contracts.WorkingHoursTemp;
|
||||
|
||||
@@ -45,6 +46,15 @@ public class ComputingViewModel
|
||||
|
||||
public bool HasRotatingShift { get; set; }
|
||||
|
||||
public List<GroupedRollCalls> GroupedRollCalls { get; set; }
|
||||
|
||||
public TimeSpan TotalWorkingTimeSpan { get; set; }
|
||||
|
||||
public TimeSpan TotalBreakTimeSpan { get; set; }
|
||||
|
||||
public TimeSpan TotalPresentTimeSpan { get; set; }
|
||||
public TimeSpan TotalPaidLeave { get; set; }
|
||||
public TimeSpan TotalSickLeave { get; set; }
|
||||
|
||||
//public List<string> holidays;
|
||||
}
|
||||
@@ -8,7 +8,6 @@ public class CustomizeWorkshopGroupSettingsViewModel
|
||||
{
|
||||
public long Id { get; set; }
|
||||
public double Salary { get; set; }
|
||||
public string SalaryStr { get; set; }
|
||||
public string GroupName { get; set; }
|
||||
public bool MainGroup { get; set; }
|
||||
public List<CustomizeWorkshopShiftViewModel> RollCallWorkshopShifts { get; set; }
|
||||
@@ -19,5 +18,4 @@ public class CustomizeWorkshopGroupSettingsViewModel
|
||||
public BreakTime BreakTime { get; set; }
|
||||
public FridayWork FridayWork { get; set; }
|
||||
public HolidayWork HolidayWork { get; set; }
|
||||
public int LeavePermitted { get; set; }
|
||||
}
|
||||
@@ -28,10 +28,8 @@ public class CreateEmployeeByClient
|
||||
public List<AddEmployeeDocumentItem> EmployeeDocumentItems { get; set; }
|
||||
public bool HasEmployeeDocument { get; set; }
|
||||
public bool HasRollCallService { get; set; }
|
||||
public bool HasCustomizeCheckoutService { get; set; }
|
||||
|
||||
|
||||
|
||||
public bool CanceledAuthorize { get; set; }
|
||||
public string BirthDate { get; set; }
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -17,6 +17,7 @@ public record EmployeeByNationalCodeInWorkshopViewModel
|
||||
public long PersonnelCode { get; set; }
|
||||
public List<EmployeeByNationalCodeEmployeeBankInfoViewModel> EmployeeBankInfos { get; set; }
|
||||
public EmployeeByNationalCodeEmployeeDocumentViewModel EmployeeDocument { get; set; }
|
||||
public bool AuthorizedCanceled { get; set; }
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -17,5 +17,22 @@ namespace CompanyManagment.App.Contracts.EmployeeComputeOptions
|
||||
public string BonusesOptions { get; set; }
|
||||
//نحوه محاسبه سنوات
|
||||
public string YearsOptions { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// ایجاد قرارداد
|
||||
/// </summary>
|
||||
public bool CreateContract { get; set; }
|
||||
/// <summary>
|
||||
/// امضای قرارداد
|
||||
/// </summary>
|
||||
public bool SignContract { get; set; }
|
||||
/// <summary>
|
||||
/// ایجاد تصفیه
|
||||
/// </summary>
|
||||
public bool CreateCheckout { get; set; }
|
||||
/// <summary>
|
||||
/// امضای تصفیه
|
||||
/// </summary>
|
||||
public bool SignCheckout { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,4 +12,20 @@ public class EmployeeComputeOptionsViewModel
|
||||
public string BonusesOptions { get; set; }
|
||||
//نحوه محاسبه سنوات
|
||||
public string YearsOptions { get; set; }
|
||||
/// <summary>
|
||||
/// ایجاد قرارداد
|
||||
/// </summary>
|
||||
public bool CreateContract { get; set; }
|
||||
/// <summary>
|
||||
/// امضای قرارداد
|
||||
/// </summary>
|
||||
public bool SignContract { get; set; }
|
||||
/// <summary>
|
||||
/// ایجاد تصفیه
|
||||
/// </summary>
|
||||
public bool CreateCheckout { get; set; }
|
||||
/// <summary>
|
||||
/// امضای تصفیه
|
||||
/// </summary>
|
||||
public bool SignCheckout { get; set; }
|
||||
}
|
||||
@@ -1,84 +0,0 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using _0_Framework.Application;
|
||||
using _0_Framework.Application.Enums;
|
||||
|
||||
namespace CompanyManagment.App.Contracts.Employer;
|
||||
|
||||
/// <summary>
|
||||
/// ایجاد کارفرمای حقیقی
|
||||
/// </summary>
|
||||
public class CreateLegalEmployer
|
||||
{
|
||||
/// <summary>
|
||||
/// آیدی طرف حساب
|
||||
/// </summary>
|
||||
[Required]
|
||||
public long ContractingPartyId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// نام شرکت
|
||||
/// </summary>
|
||||
public string CompanyName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// شناسه ملی
|
||||
/// </summary>
|
||||
public string NationalId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// شماره ثبت
|
||||
/// </summary>
|
||||
public string RegisterId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// شماره تلفن همراه
|
||||
/// </summary>
|
||||
public string PhoneNumber { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// شماره تلفن ثابت
|
||||
/// </summary>
|
||||
public string TelephoneNumber { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// نام مدیر عامل
|
||||
/// </summary>
|
||||
public string EmployerFName { get; set; }
|
||||
/// <summary>
|
||||
/// نام خانوادگی مدیر عامل
|
||||
/// </summary>
|
||||
public string EmployerLName { get; set; }
|
||||
/// <summary>
|
||||
/// جنسیت مدیر عامل
|
||||
/// </summary>
|
||||
public Gender EmployerGender { get; set; }
|
||||
/// <summary>
|
||||
/// کد ملی مدیر عامل
|
||||
/// </summary>
|
||||
public string EmployerNationalCode { get; set; }
|
||||
/// <summary>
|
||||
/// شماره شناسنامه مدیر عامل
|
||||
/// </summary>
|
||||
public string EmployerIdNumber { get; set; }
|
||||
/// <summary>
|
||||
/// نام پدر مدیر عامل
|
||||
/// </summary>
|
||||
public string EmployerFatherName { get; set; }
|
||||
/// <summary>
|
||||
/// تاریخ تولد مدیر عامل
|
||||
/// </summary>
|
||||
public string EmployerDateOfBirth { get; set; }
|
||||
/// <summary>
|
||||
/// تاریخ صدور شناسنامه مدیر عامل
|
||||
/// </summary>
|
||||
public string EmployerDateOfIssue { get; set; }
|
||||
/// <summary>
|
||||
/// محل صدور شناسنامه مدیر عامل
|
||||
/// </summary>
|
||||
public string EmployerPlaceOfIssue { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// اطلاعات سامانه ای
|
||||
/// </summary>
|
||||
public GovernmentSystemInfo GovernmentSystemInfo { get; set; }
|
||||
}
|
||||
@@ -1,80 +0,0 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using _0_Framework.Application;
|
||||
using _0_Framework.Application.Enums;
|
||||
|
||||
namespace CompanyManagment.App.Contracts.Employer;
|
||||
|
||||
/// <summary>
|
||||
/// ایجاد کارفرما حقیقی
|
||||
/// </summary>
|
||||
public class CreateRealEmployer
|
||||
{
|
||||
/// <summary>
|
||||
/// آیدی طرف حساب
|
||||
/// </summary>
|
||||
[Required]
|
||||
public long ContractingPartyId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// جنسیت
|
||||
/// </summary>
|
||||
[Required]
|
||||
public Gender Gender { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// نام
|
||||
/// </summary>
|
||||
[Required]
|
||||
public string FName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///نام خانوادگی
|
||||
/// </summary>
|
||||
[Required]
|
||||
public string LName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// کد ملی
|
||||
/// </summary>
|
||||
public string NationalCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// شماره شناسنامه
|
||||
/// </summary>
|
||||
public string IdNumber { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// شماره تلفن همراه
|
||||
/// </summary>
|
||||
public string PhoneNumber { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// شماره تلفن ثابت
|
||||
/// </summary>
|
||||
public string Telephone { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// تاریخ صدور شناسنامه
|
||||
/// </summary>
|
||||
public string DateOfIssue { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// محل صدور شناسنامه
|
||||
/// </summary>
|
||||
public string PlaceOfIssue { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// تاریخ تولد
|
||||
/// </summary>
|
||||
public string DateOfBirth { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// نام پدر
|
||||
/// </summary>
|
||||
public string FatherName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// اطلاعات سامانه ای
|
||||
/// </summary>
|
||||
public GovernmentSystemInfo GovernmentSystemInfo { get; set; }
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
namespace CompanyManagment.App.Contracts.Employer;
|
||||
|
||||
public class EditLegalEmployer: CreateLegalEmployer
|
||||
{
|
||||
/// <summary>
|
||||
/// آیدی کارفرما
|
||||
/// </summary>
|
||||
public long Id { get; set; }
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
namespace CompanyManagment.App.Contracts.Employer;
|
||||
|
||||
/// <summary>
|
||||
/// ویرایش کارفرما حقیقی
|
||||
/// </summary>
|
||||
public class EditRealEmployer:CreateRealEmployer
|
||||
{
|
||||
/// <summary>
|
||||
/// آیدی کارفرما
|
||||
/// </summary>
|
||||
public long Id { get; set; }
|
||||
}
|
||||
@@ -1,50 +0,0 @@
|
||||
using System.Collections.Generic;
|
||||
using _0_Framework.Application.Enums;
|
||||
|
||||
namespace CompanyManagment.App.Contracts.Employer;
|
||||
|
||||
/// <summary>
|
||||
/// مدل برای گرفتن لیست کارفرما
|
||||
/// </summary>
|
||||
public class GetEmployerListViewModel
|
||||
{
|
||||
/// <summary>
|
||||
/// آیدی کارفرما
|
||||
/// </summary>
|
||||
public long Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// کدملی / شناسه ملی
|
||||
/// </summary>
|
||||
public string NationalCodeOrNationalId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// نام کارفرما
|
||||
/// </summary>
|
||||
public string FullName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// نام های کارگاه
|
||||
/// </summary>
|
||||
public ICollection<string> WorkshopNames { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// دارای طرف حساب
|
||||
/// </summary>
|
||||
public bool HasContractingParty { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// طرف حساب بلاک شده یا نه
|
||||
/// </summary>
|
||||
public bool HasBlockContractingParty { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// نوع کارفرما
|
||||
/// </summary>
|
||||
public LegalType LegalType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// وضعیت کارفرما
|
||||
/// </summary>
|
||||
public ActivationStatus EmployerStatus { get; set; }
|
||||
}
|
||||
@@ -1,44 +0,0 @@
|
||||
using _0_Framework.Application.Enums;
|
||||
|
||||
namespace CompanyManagment.App.Contracts.Employer;
|
||||
|
||||
/// <summary>
|
||||
/// مدل جستجوی لیست کارفرما
|
||||
/// </summary>
|
||||
public class GetEmployerSearchModel
|
||||
{
|
||||
/// <summary>
|
||||
/// نام شرکت / نام و نام خانوادگی
|
||||
/// </summary>
|
||||
public string FullNameOrCompanyName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// کدملی/ شناسه ملی
|
||||
/// </summary>
|
||||
public string NationalCodeOrNationalId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// شماره شناسنامه یا شماره ثبت
|
||||
/// </summary>
|
||||
public string IdNumberOrRegisterId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// نام طرف حساب
|
||||
/// </summary>
|
||||
public string ContractingPartyName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// وضعیت کارفرما
|
||||
/// </summary>
|
||||
public ActivationStatus EmployerStatus { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// نوع کارفرما
|
||||
/// </summary>
|
||||
public LegalType EmployerType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// پیج ایندکس برای دسته بندی سی تایی
|
||||
/// </summary>
|
||||
public int PageIndex { get; set; }
|
||||
}
|
||||
@@ -1,120 +0,0 @@
|
||||
using _0_Framework.Application;
|
||||
using _0_Framework.Application.Enums;
|
||||
|
||||
namespace CompanyManagment.App.Contracts.Employer;
|
||||
|
||||
/// <summary>
|
||||
/// اطلاعات کارفرمای حقوقی
|
||||
/// </summary>
|
||||
public class GetLegalEmployerDetailViewModel
|
||||
{
|
||||
/// <summary>
|
||||
/// آیدی کارفرما
|
||||
/// </summary>
|
||||
public long Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// نام شرکت
|
||||
/// </summary>
|
||||
public string CompanyName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// شناسه ملی
|
||||
/// </summary>
|
||||
public string NationalId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// شماره ثبت
|
||||
/// </summary>
|
||||
public string RegisterId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// شماره تلفن همراه
|
||||
/// </summary>
|
||||
public string PhoneNumber { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// شماره تلفن ثابت
|
||||
/// </summary>
|
||||
public string TelephoneNumber { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// کد کارفرما
|
||||
/// </summary>
|
||||
public string EmployerNo { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// نام کارفرما
|
||||
/// </summary>
|
||||
public string ContractingPartyName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// نام کارفرما
|
||||
/// </summary>
|
||||
public long ContractingPartyId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// نام و خانوادگی مدیر عامل
|
||||
/// </summary>
|
||||
public string CeoFullName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// نام و خانوادگی مدیر عامل
|
||||
/// </summary>
|
||||
public string CeoFName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// نام و خانوادگی مدیر عامل
|
||||
/// </summary>
|
||||
public string CeoLName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// جنسیت مدیر عامل
|
||||
/// </summary>
|
||||
public Gender Gender { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// جنیست
|
||||
/// </summary>
|
||||
public string GenderStr { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// ملیت
|
||||
/// </summary>
|
||||
public string Nationality { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// نام پدر
|
||||
/// </summary>
|
||||
public string FatherName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// کد ملی
|
||||
/// </summary>
|
||||
public string NationalCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// شماره شناسنامه
|
||||
/// </summary>
|
||||
public string IdNumber { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// تاریخ تولد
|
||||
/// </summary>
|
||||
public string DateOfBirth { get; set; }
|
||||
/// <summary>
|
||||
/// تاریخ صدور شناسنامه
|
||||
/// </summary>
|
||||
public string DateOfIssue { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// محل صدور شناسنامه
|
||||
/// </summary>
|
||||
public string PlaceOfIssue { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// اطلاعات سامانه های دولتی
|
||||
/// </summary>
|
||||
public GovernmentSystemInfo GovernmentSystemInfo { get; set; }
|
||||
|
||||
}
|
||||
@@ -1,107 +0,0 @@
|
||||
using _0_Framework.Application;
|
||||
using _0_Framework.Application.Enums;
|
||||
|
||||
namespace CompanyManagment.App.Contracts.Employer;
|
||||
|
||||
/// <summary>
|
||||
/// اطلاعات کارفرمای حقوقی
|
||||
/// </summary>
|
||||
public class GetRealEmployerDetailViewModel
|
||||
{
|
||||
/// <summary>
|
||||
/// آیدی کارفرما
|
||||
/// </summary>
|
||||
public long Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// نام و نام خانوادگی
|
||||
/// </summary>
|
||||
public string FullName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// نام
|
||||
/// </summary>
|
||||
public string FName{ get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// نام خانوادگی
|
||||
/// </summary>
|
||||
public string LName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// کدملی
|
||||
/// </summary>
|
||||
public string NationalCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// جنسیت فارسی
|
||||
/// </summary>
|
||||
public string GenderStr { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// جنسیت
|
||||
/// </summary>
|
||||
public Gender Gender { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// ملیت
|
||||
/// </summary>
|
||||
public string Nationality { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// شماره تلفن همراه
|
||||
/// </summary>
|
||||
public string PhoneNumber { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// نام پدر
|
||||
/// </summary>
|
||||
public string FatherName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// شماره شناسنامه
|
||||
/// </summary>
|
||||
public string IdNumber { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// تاریخ تولد
|
||||
/// </summary>
|
||||
public string DateOfBirth { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// نام طرف حساب
|
||||
/// </summary>
|
||||
public string ContractingPartyName { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// آیدی طرف حساب
|
||||
/// </summary>
|
||||
public long ContractingPartyId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// کد کارفرما
|
||||
/// </summary>
|
||||
public string EmployerNo { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// شماره تلفن ثابت
|
||||
/// </summary>
|
||||
public string TelephoneNumber { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// تاریخ صدور شناسنامه
|
||||
/// </summary>
|
||||
public string DateOfIssue { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// محل صدور شناسنامه
|
||||
/// </summary>
|
||||
public string PlaceOfIssue { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// اطلاعات سامانه های دولتی
|
||||
/// </summary>
|
||||
public GovernmentSystemInfo GovernmentSystemInfo { get; set; }
|
||||
}
|
||||
@@ -1,54 +0,0 @@
|
||||
using System;
|
||||
|
||||
namespace CompanyManagment.App.Contracts.Employer;
|
||||
|
||||
/// <summary>
|
||||
/// اطلاعات سامانه های دولتی
|
||||
/// </summary>
|
||||
public class GovernmentSystemInfo
|
||||
{
|
||||
#region MCL
|
||||
/// <summary>
|
||||
/// نام کاربری اداره کار
|
||||
/// </summary>
|
||||
public string MclUsername { get; set; }
|
||||
/// <summary>
|
||||
/// رمز عبور اداره کار
|
||||
/// </summary>
|
||||
public string MclPassword { get; set; }
|
||||
#endregion
|
||||
|
||||
#region E-Service تامین اجتماعی
|
||||
/// <summary>
|
||||
/// نام کاربری سازمان تامین اجتماعی
|
||||
/// </summary>
|
||||
public string EServiceUsername { get; set; }
|
||||
/// <summary>
|
||||
/// رمز عبور سازمان تامین اجتماعی
|
||||
/// </summary>
|
||||
public string EServicePassword { get; set; }
|
||||
#endregion
|
||||
|
||||
#region Tax سامانه مالیاتی
|
||||
/// <summary>
|
||||
/// نام کاربری سامانه مالیاتی
|
||||
/// </summary>
|
||||
public string TaxUsername { get; set; }
|
||||
/// <summary>
|
||||
/// رمز عبور سامانه مالیاتی
|
||||
/// </summary>
|
||||
public string TaxPassword { get; set; }
|
||||
#endregion
|
||||
|
||||
#region Sana سامانه ثنا
|
||||
/// <summary>
|
||||
/// نام کاربری ثنا
|
||||
/// </summary>
|
||||
public string SanaUsername { get; set; }
|
||||
/// <summary>
|
||||
/// رمز عبور ثنا
|
||||
/// </summary>
|
||||
public string SanaPassword { get; set; }
|
||||
#endregion
|
||||
|
||||
}
|
||||
@@ -55,71 +55,4 @@ public interface IEmployerApplication
|
||||
|
||||
#endregion
|
||||
|
||||
#region Api
|
||||
|
||||
/// <summary>
|
||||
/// لیست کارفرما ها
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
Task<List<GetEmployerListViewModel>> GetEmployerList(GetEmployerSearchModel searchModel);
|
||||
|
||||
/// <summary>
|
||||
/// جزئیات کارفرما حقوقی
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
Task<GetLegalEmployerDetailViewModel> GetLegalEmployerDetail(long id);
|
||||
|
||||
/// <summary>
|
||||
/// جزئیات کارفرما حقیقی
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
Task<GetRealEmployerDetailViewModel> GetRealEmployerDetail(long id);
|
||||
|
||||
/// <summary>
|
||||
/// ایجاد کارفرمای حقیقی
|
||||
/// </summary>
|
||||
/// <param name="command"></param>
|
||||
/// <returns></returns>
|
||||
Task<OperationResult> CreateReal(CreateRealEmployer command);
|
||||
|
||||
/// <summary>
|
||||
/// ایجاد کارفرمای حقوقی
|
||||
/// </summary>
|
||||
/// <param name="command"></param>
|
||||
/// <returns></returns>
|
||||
Task<OperationResult> CreateLegal(CreateLegalEmployer command);
|
||||
|
||||
/// <summary>
|
||||
/// ویرایش کارفرمای حقیقی
|
||||
/// </summary>
|
||||
/// <param name="command"></param>
|
||||
/// <returns></returns>
|
||||
Task<OperationResult> EditReal(EditRealEmployer command);
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// ویرایش کارفرمای حقوقی
|
||||
/// </summary>
|
||||
/// <param name="command"></param>
|
||||
/// <returns></returns>
|
||||
Task<OperationResult> EditLegal(EditLegalEmployer command);
|
||||
|
||||
///// <summary>
|
||||
///// لیست نام کارفرما ها برای جستجو
|
||||
///// </summary>
|
||||
///// <param name="search"></param>
|
||||
///// <returns></returns>
|
||||
//public Task<List<EmployerSelectListViewModel>> GetSelectList(string search);
|
||||
|
||||
/// <summary>
|
||||
/// حذف کارفرما - درصورت داشتن کارگاه کارفرما غیرفعال میشود
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
public Task<OperationResult<string>> RemoveApi(long id);
|
||||
|
||||
#endregion
|
||||
}
|
||||
|
||||
}
|
||||
@@ -298,4 +298,6 @@ public class EmployeeDetailsForInsuranceListViewModel
|
||||
///// DSK_SPOUSE
|
||||
///// </summary>
|
||||
//public double SumOfMarriedAllowance { get; set; }
|
||||
public string Month { get; set; }
|
||||
public string Year { get; set; }
|
||||
}
|
||||
@@ -44,7 +44,7 @@ public interface IInsuranceListApplication
|
||||
Task<OperationResult> ConfirmInsuranceOperation(InsuranceListConfirmOperation command);
|
||||
Task<InsuranceListConfirmOperation> GetInsuranceOperationDetails(long id);
|
||||
|
||||
Task<InsuranceListTabsCountViewModel> GetTabCounts(long accountId, int month, int year);
|
||||
Task<InsuranceListTabsCountViewModel> GetTabCounts(InsuranceListSearchModel searchModel);
|
||||
|
||||
#endregion
|
||||
#endregion
|
||||
}
|
||||
@@ -3,6 +3,7 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using CompanyManagment.App.Contracts.InsuranceList.Enums;
|
||||
|
||||
namespace CompanyManagment.App.Contracts.InsuranceList;
|
||||
|
||||
@@ -32,6 +33,11 @@ public class InsuranceListViewModel
|
||||
public bool InspectionDone { get; set; }
|
||||
/// <summary>وضعیت بدهی</summary>
|
||||
public bool DebtDone { get; set; }
|
||||
/// <summary>وضعیت تاییدیه کارفرما</summary>
|
||||
/// <summary>تاییدیه کارفرما</summary>
|
||||
public bool EmployerApproved { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// نوع تاییدیه کارفرما
|
||||
/// </summary>
|
||||
public InsuranceListEmployerApprovalStatus EmployerApprovalStatus { get; set; }
|
||||
}
|
||||
@@ -1,37 +0,0 @@
|
||||
using _0_Framework.Application.Enums;
|
||||
|
||||
namespace CompanyManagment.App.Contracts.PersonalContractingParty;
|
||||
|
||||
public class ContractingPartyGetListSearchModel
|
||||
{
|
||||
/// <summary>
|
||||
/// تعدادی که برای لیست بعدی آیتم باید رد کنه
|
||||
/// </summary>
|
||||
public int PageIndex { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// نام شرکت یا نام و نام خانوادگی طرف حساب
|
||||
/// </summary>
|
||||
public string FullNameOrCompanyName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// شناسه ملی یا شماره ملی
|
||||
/// </summary>
|
||||
public string NationalIdOrNationalCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// نام معرف
|
||||
/// </summary>
|
||||
public string RepresentativeName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// نوع طرف حساب
|
||||
/// </summary>
|
||||
public LegalType ContractingPartyType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// وضعیت طرف حساب
|
||||
/// </summary>
|
||||
public ActivationStatus ContractingPartyStatus { get; set; }
|
||||
|
||||
}
|
||||
@@ -1,60 +0,0 @@
|
||||
using System.Collections.Generic;
|
||||
using _0_Framework.Application.Enums;
|
||||
|
||||
namespace CompanyManagment.App.Contracts.PersonalContractingParty;
|
||||
|
||||
public record ContractingPartyGetListEmployerViewModel(long EmployerId, string EmployerName);
|
||||
|
||||
public class ContractingPartyGetListViewModel
|
||||
{
|
||||
/// <summary>
|
||||
/// آیدی طرف حساب
|
||||
/// </summary>
|
||||
public long Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// کد طرف حساب
|
||||
/// </summary>
|
||||
public int ArchiveCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// شناسه ملی یا شماره ملی
|
||||
/// </summary>
|
||||
public string NationalIdOrNationalCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// نام طرف حساب
|
||||
/// </summary>
|
||||
public string ContractingPartyName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// لیست کارفرما ها
|
||||
/// </summary>
|
||||
public ICollection<ContractingPartyGetListEmployerViewModel> Employers { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// تعداد بلاک
|
||||
/// </summary>
|
||||
public int BlockTimes { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// آیا بلاک هست
|
||||
/// </summary>
|
||||
public bool IsBlock { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// آیا دارای قرارداد مالی است
|
||||
/// </summary>
|
||||
public bool HasInstitutionContract { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// نوع طرف حساب
|
||||
/// </summary>
|
||||
public LegalType ContractingPartyType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// وضعیت طرف حساب
|
||||
/// </summary>
|
||||
public ActivationStatus Status { get; set; }
|
||||
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
using _0_Framework.Application;
|
||||
|
||||
namespace CompanyManagment.App.Contracts.PersonalContractingParty;
|
||||
|
||||
public class ContractingPartySelectListViewModel: SelectListViewModel
|
||||
{
|
||||
|
||||
}
|
||||
@@ -1,74 +0,0 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace CompanyManagment.App.Contracts.PersonalContractingParty;
|
||||
|
||||
public class CreateLegalContractingParty
|
||||
{
|
||||
/// <summary>
|
||||
/// آیدی معرف
|
||||
/// </summary>
|
||||
[Required]
|
||||
public long RepresentativeId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// نام شرکت
|
||||
/// </summary>
|
||||
[Required]
|
||||
public string CompanyName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// شناسه ملی
|
||||
/// </summary>
|
||||
[Required]
|
||||
public string NationalId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// کد طرف حساب
|
||||
/// </summary>
|
||||
[Required]
|
||||
public int ArchiveCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// نام مستعار
|
||||
/// </summary>
|
||||
public string SureName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// شماره ثبت
|
||||
/// </summary>
|
||||
public string RegisterId { get; set; }
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// شماره تلفن
|
||||
/// </summary>
|
||||
public string PhoneNumber { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// شماره تلفن نماینده
|
||||
/// </summary>
|
||||
public string AgentPhone { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// استان
|
||||
/// </summary>
|
||||
public string State { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// شهر
|
||||
/// </summary>
|
||||
public string City { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// محله
|
||||
/// </summary>
|
||||
public string Zone { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// نشانی
|
||||
/// </summary>
|
||||
public string Address { get; set; }
|
||||
|
||||
|
||||
}
|
||||
@@ -1,77 +0,0 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace CompanyManagment.App.Contracts.PersonalContractingParty;
|
||||
|
||||
public class CreateRealContractingParty
|
||||
{
|
||||
/// <summary>
|
||||
/// نام
|
||||
/// </summary>
|
||||
[Required]
|
||||
public string FName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// نام خانوادگی
|
||||
/// </summary>
|
||||
[Required]
|
||||
public string LName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// آیدی معرف
|
||||
/// </summary>
|
||||
[Required]
|
||||
public long RepresentativeId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// کد ملی
|
||||
/// </summary>
|
||||
[Required]
|
||||
public string NationalCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// شماره شناسنامه
|
||||
/// </summary>
|
||||
[Required]
|
||||
public string IdNumber { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// کد طرف حساب
|
||||
/// </summary>
|
||||
[Required]
|
||||
public int ArchiveCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// نام مستعار
|
||||
/// </summary>
|
||||
public string SureName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// شماره تلفن
|
||||
/// </summary>
|
||||
public string PhoneNumber { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// شماره تلفن نماینده
|
||||
/// </summary>
|
||||
public string AgentPhone { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// استان
|
||||
/// </summary>
|
||||
public string State { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// شهر
|
||||
/// </summary>
|
||||
public string City { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// محله
|
||||
/// </summary>
|
||||
public string Zone { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// نشانی
|
||||
/// </summary>
|
||||
public string Address { get; set; }
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
namespace CompanyManagment.App.Contracts.PersonalContractingParty;
|
||||
|
||||
/// <summary>
|
||||
/// ویرایش طرف حساب حقوقی
|
||||
/// </summary>
|
||||
public class EditLegalContractingParty:CreateLegalContractingParty
|
||||
{
|
||||
/// <summary>
|
||||
/// آیدی طرف حساب
|
||||
/// </summary>
|
||||
public long Id { get; set; }
|
||||
}
|
||||
@@ -1,13 +0,0 @@
|
||||
namespace CompanyManagment.App.Contracts.PersonalContractingParty;
|
||||
|
||||
/// <summary>
|
||||
/// ویرایش طرف حساب حقیقی
|
||||
/// </summary>
|
||||
public class EditRealContractingParty:CreateRealContractingParty
|
||||
{
|
||||
/// <summary>
|
||||
/// آیدی طرف حساب
|
||||
/// </summary>
|
||||
public long Id { get; set; }
|
||||
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
namespace CompanyManagment.App.Contracts.PersonalContractingParty;
|
||||
|
||||
/// <summary>
|
||||
/// شماره ملی یا شناسه ملی بر اساس حقیقی یا حقوقی بودن
|
||||
/// </summary>
|
||||
public class GetContractingPartyNationalCodeOrNationalIdViewModel
|
||||
{
|
||||
/// <summary>
|
||||
/// شماره ملی یا شناسه ملی
|
||||
/// </summary>
|
||||
public string NationalCodeOrNationalId { get; set; }
|
||||
}
|
||||
@@ -1,83 +0,0 @@
|
||||
namespace CompanyManagment.App.Contracts.PersonalContractingParty;
|
||||
|
||||
/// <summary>
|
||||
/// ویو مدل جزئیات طرف حساب حقوقی
|
||||
/// </summary>
|
||||
public class GetLegalContractingPartyDetailsViewModel
|
||||
{
|
||||
/// <summary>
|
||||
/// آیدی طرف حساب
|
||||
/// </summary>
|
||||
public long Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// نام کامل شرکت(به همراه نام مستعار)ء
|
||||
/// </summary>
|
||||
public string CompanyFullName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// نام شرکت (بدون نام مستعار)ء
|
||||
/// </summary>
|
||||
public string CompanyName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// نام مستعار
|
||||
/// </summary>
|
||||
public string SureName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// شماره ثبت
|
||||
/// </summary>
|
||||
public string RegisterId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// شماره ملی
|
||||
/// </summary>
|
||||
public string NationalId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// شماره تماس
|
||||
/// </summary>
|
||||
public string PhoneNumber { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// شماره تماس نماینده
|
||||
/// </summary>
|
||||
public string AgentPhone { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// آدرس
|
||||
/// </summary>
|
||||
public string Address { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// معرف
|
||||
/// </summary>
|
||||
public string RepresentativeName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// آیدی معرف
|
||||
/// </summary>
|
||||
public long RepresentativeId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// کد طرف حساب
|
||||
/// </summary>
|
||||
public int ArchiveCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// استان
|
||||
/// </summary>
|
||||
public string State { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// شهر
|
||||
/// </summary>
|
||||
public string City { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// محله
|
||||
/// </summary>
|
||||
public string Zone { get; set; }
|
||||
|
||||
}
|
||||
@@ -1,94 +0,0 @@
|
||||
using System.Runtime.CompilerServices;
|
||||
using Microsoft.AspNetCore.Builder;
|
||||
|
||||
namespace CompanyManagment.App.Contracts.PersonalContractingParty;
|
||||
|
||||
/// <summary>
|
||||
/// ویو مدل جزئیات طرف حساب حقیقی
|
||||
/// </summary>
|
||||
public class GetRealContractingPartyDetailsViewModel
|
||||
{
|
||||
/// <summary>
|
||||
/// آیدی طرف حساب
|
||||
/// </summary>
|
||||
public long Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// نام
|
||||
/// </summary>
|
||||
public string FName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// نام خانوادگی
|
||||
/// </summary>
|
||||
public string LName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// نام و نام خانوادگی
|
||||
/// </summary>
|
||||
public string FullName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// کد ملی
|
||||
/// </summary>
|
||||
public string NationalCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// شماره شناسنامه
|
||||
/// </summary>
|
||||
public string IdNumber { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// شماره تلفن
|
||||
/// </summary>
|
||||
public string PhoneNumber { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// شماره تلفن نماینده
|
||||
/// </summary>
|
||||
public string AgentPhone { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// آدرس
|
||||
/// </summary>
|
||||
public string Address { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// نام معرف
|
||||
/// </summary>
|
||||
public string RepresentativeName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// آیدی معرف
|
||||
/// </summary>
|
||||
public long RepresentativeId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// نام مستعار
|
||||
/// </summary>
|
||||
public string SureName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// کد طرف حساب
|
||||
/// </summary>
|
||||
public int ArchiveCode { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// استان
|
||||
/// </summary>
|
||||
public string State { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// شهر
|
||||
/// </summary>
|
||||
public string City { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// محله
|
||||
/// </summary>
|
||||
public string Zone { get; set; }
|
||||
|
||||
|
||||
}
|
||||
@@ -1,6 +1,5 @@
|
||||
using _0_Framework.Application;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
|
||||
namespace CompanyManagment.App.Contracts.PersonalContractingParty;
|
||||
@@ -55,79 +54,4 @@ public interface IPersonalContractingPartyApp
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
#region Api
|
||||
/// <summary>
|
||||
/// لیست طرف حساب ها
|
||||
/// </summary>
|
||||
/// <param name="searchModel"></param>
|
||||
/// <returns></returns>
|
||||
Task<ICollection<ContractingPartyGetListViewModel>> GetList(ContractingPartyGetListSearchModel searchModel);
|
||||
|
||||
/// <summary>
|
||||
/// لیست طرف حساب برای سلکت لیست سرچ
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
Task<List<ContractingPartySelectListViewModel>> GetSelectList();
|
||||
|
||||
/// <summary>
|
||||
/// ایجاد طرف حساب حقیقی
|
||||
/// </summary>
|
||||
/// <param name="command"></param>
|
||||
/// <returns></returns>
|
||||
Task<OperationResult> CreateReal(CreateRealContractingParty command);
|
||||
|
||||
/// <summary>
|
||||
/// ایجاد ظرف حساب حقوقی
|
||||
/// </summary>
|
||||
/// <param name="command"></param>
|
||||
/// <returns></returns>
|
||||
Task<OperationResult> CreateLegal(CreateLegalContractingParty command);
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// لیستی از شماره ملی یا شناسه ملی بر اساس حقیقی یا حقوقی بودن
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
Task<List<GetContractingPartyNationalCodeOrNationalIdViewModel>> GetNationalCodeOrNationalId();
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// حذف طرف حساب. در صورتی که طرف حساب دارای قرارداد مالی یا دارای کارفرما باشد غیرفعال میشود
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
Task<OperationResult<string>> Delete(long id);
|
||||
|
||||
/// <summary>
|
||||
/// ویرایش طرف حساب حقیقی
|
||||
/// </summary>
|
||||
/// <param name="command"></param>
|
||||
/// <returns></returns>
|
||||
OperationResult EditRealApi(EditRealContractingParty command);
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// ویرایش طرف حساب حقوقی
|
||||
/// </summary>
|
||||
/// <param name="command"></param>
|
||||
/// <returns></returns>
|
||||
OperationResult EditLegal(EditLegalContractingParty command);
|
||||
|
||||
/// <summary>
|
||||
/// گرفتن جزئیات طرف حساب حقوقی
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
Task<GetRealContractingPartyDetailsViewModel> GetRealDetails(long id);
|
||||
|
||||
/// <summary>
|
||||
/// گرفتن جزئیات طرف حساب حقوقی
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
Task<GetLegalContractingPartyDetailsViewModel> GetLegalDetails(long id);
|
||||
|
||||
#endregion
|
||||
|
||||
}
|
||||
@@ -47,6 +47,4 @@ public class PersonalContractingPartyViewModel
|
||||
public bool IsAuthenticated { get; set; }
|
||||
public List<EmployerViewModel> EmployerList { get; set; }
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -6,10 +6,12 @@ public class ShiftList
|
||||
{
|
||||
public DateTime Start { get; set; }
|
||||
public DateTime End { get; set; }
|
||||
/// <summary>
|
||||
/// تاخیر در ورود (مدت زمانی که کارمند با تأخیر وارد شده است)
|
||||
/// </summary>
|
||||
public TimeSpan LateEntryDuration { get; set; }
|
||||
|
||||
public DateTime EndWithOutResTime { get; set; }
|
||||
/// <summary>
|
||||
/// تاخیر در ورود (مدت زمانی که کارمند با تأخیر وارد شده است)
|
||||
/// </summary>
|
||||
public TimeSpan LateEntryDuration { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// تعجیل در ورود (مدت زمانی که کارمند زودتر از زمان مشخص وارد شده است)
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using _0_Framework.Application;
|
||||
using CompanyManagment.App.Contracts.InstitutionPlan;
|
||||
@@ -39,7 +38,7 @@ public interface ITemporaryClientRegistrationApplication
|
||||
/// </summary>
|
||||
/// <param name="command"></param>
|
||||
/// <returns></returns>
|
||||
Task<OperationResult> CreateOrUpdateWorkshopTemp(List<WorkshopTempViewModel> command, long contractingPartyTempId);
|
||||
Task<OperationResult> CreateOrUpdateWorkshopTemp(List<WorkshopTempViewModel> command);
|
||||
|
||||
/// <summary>
|
||||
/// دریافت جمع کل خدمات برای یک کارگاه
|
||||
@@ -56,14 +55,14 @@ public interface ITemporaryClientRegistrationApplication
|
||||
/// <param name="paymentModel"></param>
|
||||
/// <returns></returns>
|
||||
Task<ReviewAndPaymentViewModel> GetTotalPaymentAndWorkshopList(long contractingPartyTempId,
|
||||
string periodModel = "12", string paymentModel = "OneTime", string contractStartType = "currentMonth");
|
||||
string periodModel = "12", string paymentModel = "OneTime");
|
||||
|
||||
/// <summary>
|
||||
/// ایجاد یا ویرایش قرارداد موقت
|
||||
/// </summary>
|
||||
/// <param name="contractingPartyTempId"></param>
|
||||
/// <returns></returns>
|
||||
Task<OperationResult> CreateOrUpdateInstitutionContractTemp(long contractingPartyTempId, string periodModel, string paymentModel, double totalPayment, double valueAddedTax, DateTime contractStart);
|
||||
Task<OperationResult> CreateOrUpdateInstitutionContractTemp(long contractingPartyTempId, string periodModel, string paymentModel, double totalPayment, double valueAddedTax);
|
||||
|
||||
/// <summary>
|
||||
/// دریافت کد برای کلاینت
|
||||
|
||||
@@ -1,25 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace CompanyManagment.App.Contracts.TemporaryClientRegistration;
|
||||
|
||||
public class MonthlyInstallment
|
||||
{
|
||||
/// <summary>
|
||||
/// مبلغ قسط ماهانه
|
||||
/// </summary>
|
||||
public string InstallmentAmountStr { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// تاریخ قسط ماهانه
|
||||
/// </summary>
|
||||
public string InstalmentDate { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// شمارنده قسط
|
||||
/// </summary>
|
||||
public string InstallmentCounter{ get; set; }
|
||||
}
|
||||
@@ -1,5 +1,4 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace CompanyManagment.App.Contracts.TemporaryClientRegistration;
|
||||
|
||||
@@ -24,54 +23,28 @@ public class ReviewAndPaymentViewModel
|
||||
/// مبلغ پرداخت بدون مالیات
|
||||
/// Double
|
||||
/// </summary>
|
||||
public double OneTimeWithoutTaxPaymentDouble { get; set; }
|
||||
public double WithoutTaxPaymentDouble { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// مبلغ پرداخت بدون مالیات
|
||||
/// string
|
||||
/// </summary>
|
||||
public string OneTimeWithoutTaxPaymentStr { get; set; }
|
||||
public string WithoutTaxPaymentStr { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// مبلغ پرداخت کامل
|
||||
/// Double
|
||||
/// </summary>
|
||||
public double OneTimeTotalPaymentDouble { get; set; }
|
||||
public double TotalPaymentDouble { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// مبلغ پرداخت کامل
|
||||
/// string
|
||||
/// </summary>
|
||||
public string OneTimeTotalPaymentStr { get; set; }
|
||||
public string TotalPaymentStr { get; set; }
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// مبلغ پرداخت بدون مالیات
|
||||
/// Double
|
||||
/// </summary>
|
||||
public double MonthlyWithoutTaxPaymentDouble { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// مبلغ پرداخت بدون مالیات
|
||||
/// string
|
||||
/// </summary>
|
||||
public string MonthlyWithoutTaxPaymentStr { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// مبلغ پرداخت کامل
|
||||
/// Double
|
||||
/// </summary>
|
||||
public double MonthlyTotalPaymentDouble { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// مبلغ پرداخت کامل
|
||||
/// string
|
||||
/// </summary>
|
||||
public string MonthlyTotalPaymentStr { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// مالیات بر ارزش افزوده
|
||||
/// Double
|
||||
@@ -110,52 +83,4 @@ public class ReviewAndPaymentViewModel
|
||||
/// آی دی طرف حساب
|
||||
/// </summary>
|
||||
public long ContractingPartTempId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// لیست اقساط ماهیانه
|
||||
/// </summary>
|
||||
public List<MonthlyInstallment> MonthlyInstallments { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// تاریخ شروع قرارداد در اول ماه جاری
|
||||
/// -
|
||||
/// شمسی
|
||||
/// </summary>
|
||||
public string ContractStartCurrentMonthFa { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// تاریخ شروع قرارداد در اول ماه جاری
|
||||
/// -
|
||||
/// میلادی
|
||||
/// </summary>
|
||||
public DateTime ContractStartCurrentMonthGr { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// تاریخ شروع قرارداد در اول ماه بعد
|
||||
/// -
|
||||
/// شمسی
|
||||
/// </summary>
|
||||
public string ContractStartNextMonthFa{ get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// تاریخ شروع قرارداد در اول ماه بعد
|
||||
/// -
|
||||
/// میلادی
|
||||
/// </summary>
|
||||
public DateTime ContractStartNextMonthGr { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// تاریخ پایان قرارداد
|
||||
/// -
|
||||
/// میلادی
|
||||
/// </summary>
|
||||
public DateTime ContractEndGr { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// تاریخ پایان قرارداد
|
||||
/// -
|
||||
/// شمسی
|
||||
/// </summary>
|
||||
public string ContractEndFa { get; set; }
|
||||
}
|
||||
@@ -26,4 +26,21 @@ public class ConnectedPersonnelViewModel
|
||||
public string BonusesOptions { get; set; }
|
||||
//نحوه محاسبه سنوات
|
||||
public string YearsOptions { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// ایجاد قرارداد
|
||||
/// </summary>
|
||||
public bool CreateContract { get; set; }
|
||||
/// <summary>
|
||||
/// امضای قرارداد
|
||||
/// </summary>
|
||||
public bool SignContract { get; set; }
|
||||
/// <summary>
|
||||
/// ایجاد تصفیه
|
||||
/// </summary>
|
||||
public bool CreateCheckout { get; set; }
|
||||
/// <summary>
|
||||
/// امضای تصفیه
|
||||
/// </summary>
|
||||
public bool SignCheckout { get; set; }
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using _0_Framework.Application;
|
||||
using AccountManagement.Application.Contracts.Account;
|
||||
using CompanyManagment.App.Contracts.Employer;
|
||||
using CompanyManagment.App.Contracts.InsuranceJob;
|
||||
@@ -116,4 +117,29 @@ public class CreateWorkshop
|
||||
/// </summary>
|
||||
public bool InsuranceCheckoutFamilyAllowance { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// ایجاد قرارداد
|
||||
/// </summary>
|
||||
public bool CreateContract { get; set; }
|
||||
/// <summary>
|
||||
/// امضاء قراداد
|
||||
/// </summary>
|
||||
public bool SignContract { get; set; }
|
||||
/// <summary>
|
||||
/// ایجات تصفیه حساب
|
||||
/// </summary>
|
||||
public bool CreateCheckout { get; set; }
|
||||
/// <summary>
|
||||
/// امضاء تصفیه حساب
|
||||
/// </summary>
|
||||
public bool SignCheckout { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// اگر قرارداد بیش از یک ماه باشد و گزینه انتخاب شده منتهی به پایان سال باشد
|
||||
/// این آیتم
|
||||
/// True
|
||||
/// است
|
||||
/// </summary>
|
||||
public IsActive CutContractEndOfYear { get; set; }
|
||||
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
using System.Collections.Generic;
|
||||
using _0_Framework.Application;
|
||||
using CompanyManagment.App.Contracts.Employee;
|
||||
using CompanyManagment.App.Contracts.Employer;
|
||||
using CompanyManagment.App.Contracts.LeftWork;
|
||||
@@ -80,5 +81,31 @@ public class WorkshopViewModel
|
||||
|
||||
public string HasRollCallFreeVip { get; set; }
|
||||
|
||||
#endregion
|
||||
#endregion
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// ایجاد قرارداد
|
||||
/// </summary>
|
||||
public bool CreateContract { get; set; }
|
||||
/// <summary>
|
||||
/// امضاء قراداد
|
||||
/// </summary>
|
||||
public bool SignContract { get; set; }
|
||||
/// <summary>
|
||||
/// ایجات تصفیه حساب
|
||||
/// </summary>
|
||||
public bool CreateCheckout { get; set; }
|
||||
/// <summary>
|
||||
/// امضاء تصفیه حساب
|
||||
/// </summary>
|
||||
public bool SignCheckout { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// اگر قرارداد بیش از یک ماه باشد و گزینه انتخاب شده منتهی به پایان سال باشد
|
||||
/// این آیتم
|
||||
/// True
|
||||
/// است
|
||||
/// </summary>
|
||||
public IsActive CutContractEndOfYear { get; set; }
|
||||
}
|
||||
@@ -25,4 +25,5 @@ public interface IYearlySalaryApplication
|
||||
InsuranceYearlySalaryModel GetInsuranceItems(DateTime startDate, DateTime endDate, string year);
|
||||
|
||||
#endregion
|
||||
|
||||
}
|
||||
@@ -48,9 +48,9 @@ public class AndroidApkVersionApplication : IAndroidApkVersionApplication
|
||||
|
||||
Directory.CreateDirectory(path);
|
||||
|
||||
var apk = new ApkReader.ApkReader().Read(file.OpenReadStream());
|
||||
//var apk = new ApkReader.ApkReader().Read(file.OpenReadStream());
|
||||
|
||||
string uniqueFileName = $"{Path.GetFileNameWithoutExtension(file.FileName)}.v{apk.VersionName}{Path.GetExtension(file.FileName)}";
|
||||
string uniqueFileName = $"{Path.GetFileNameWithoutExtension(file.FileName)}{Path.GetExtension(file.FileName)}";
|
||||
|
||||
|
||||
string filepath = Path.Combine(path, uniqueFileName);
|
||||
@@ -60,7 +60,7 @@ public class AndroidApkVersionApplication : IAndroidApkVersionApplication
|
||||
await file.CopyToAsync(stream);
|
||||
}
|
||||
|
||||
var entity = new AndroidApkVersion(apk.VersionName, apk.VersionCode, IsActive.True, filepath);
|
||||
var entity = new AndroidApkVersion("0", "0", IsActive.True, filepath);
|
||||
_androidApkVersionRepository.Create(entity);
|
||||
_androidApkVersionRepository.SaveChanges();
|
||||
return op.Succcedded();
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,70 +0,0 @@
|
||||
using System.Text.RegularExpressions;
|
||||
using _0_Framework.Application;
|
||||
using Company.Domain.ContactUsAgg;
|
||||
using CompanyManagment.App.Contracts.ContactUs;
|
||||
|
||||
namespace CompanyManagment.Application;
|
||||
|
||||
public class ContactUsApplication : IContactUsApplication
|
||||
{
|
||||
private readonly IContactUsRepository _contactUsRepository;
|
||||
|
||||
public ContactUsApplication(IContactUsRepository contactUsRepository)
|
||||
{
|
||||
_contactUsRepository = contactUsRepository;
|
||||
}
|
||||
|
||||
public OperationResult Create(CreateContactUs command)
|
||||
{
|
||||
var op = new OperationResult();
|
||||
if (string.IsNullOrWhiteSpace(command.FirstName))
|
||||
{
|
||||
return op.Failed("لطفا نام خود را وارد کنید");
|
||||
}
|
||||
|
||||
if (string.IsNullOrWhiteSpace(command.LastName))
|
||||
{
|
||||
return op.Failed("لطفا نام خانوادگی خود را وارد کنید");
|
||||
}
|
||||
|
||||
if (string.IsNullOrWhiteSpace(command.Email))
|
||||
{
|
||||
return op.Failed("لطفا ایمیل خود را وارد کنید");
|
||||
}
|
||||
|
||||
if (string.IsNullOrWhiteSpace(command.PhoneNumber))
|
||||
{
|
||||
return op.Failed("لطفا شماره تماس خود را وارد کنید");
|
||||
}
|
||||
|
||||
if (!Regex.IsMatch(command.PhoneNumber, @"^(\+98|0)?9\d{9}$"))
|
||||
{
|
||||
return op.Failed("شماره تماس وارد شده نامعتبر است");
|
||||
}
|
||||
|
||||
if (!Regex.IsMatch(command.Email, @"^[\w-\.]+@([\w-]+\.)+[\w-]{2,4}$"))
|
||||
{
|
||||
return op.Failed("ایمیل وارد شده نامعتبر است");
|
||||
}
|
||||
|
||||
if (string.IsNullOrWhiteSpace(command.Title))
|
||||
{
|
||||
return op.Failed("لطفا عنوان پیغام خود را وارد کنید");
|
||||
}
|
||||
|
||||
if (string.IsNullOrWhiteSpace(command.Message))
|
||||
{
|
||||
return op.Failed("لطفا پیغام خود را وارد کنید");
|
||||
}
|
||||
|
||||
var entity = new ContactUs(command.FirstName, command.LastName, command.Email, command.PhoneNumber,
|
||||
command.Title, command.Message);
|
||||
|
||||
_contactUsRepository.Create(entity);
|
||||
|
||||
_contactUsRepository.SaveChanges();
|
||||
|
||||
return op.Succcedded();
|
||||
|
||||
}
|
||||
}
|
||||
@@ -19,13 +19,12 @@ using System.IO;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using System.Transactions;
|
||||
using CompanyManagment.App.Contracts.RollCall;
|
||||
using Microsoft.EntityFrameworkCore.Query;
|
||||
using Company.Domain.CheckoutAgg;
|
||||
using Company.Domain.CustomizeCheckoutAgg;
|
||||
using Company.Domain.CustomizeCheckoutTempAgg;
|
||||
using CompanyManagment.App.Contracts.RollCall;
|
||||
using Hangfire.States;
|
||||
using Microsoft.AspNetCore.Mvc.ModelBinding.Validation;
|
||||
using Microsoft.EntityFrameworkCore.Query;
|
||||
using CompanyManagment.EFCore.Repository;
|
||||
|
||||
|
||||
namespace CompanyManagment.Application;
|
||||
@@ -373,10 +372,10 @@ public class CustomizeWorkshopSettingsApplication(ICustomizeWorkshopSettingsRepo
|
||||
}
|
||||
|
||||
if (customizeWorkshopGroupSettings.MainGroup)
|
||||
{
|
||||
var createDefaultEmployee = CreateEmployeeSettings(command);
|
||||
return createDefaultEmployee;
|
||||
}
|
||||
{
|
||||
var createDefaultEmployee = CreateEmployeeSettings(command);
|
||||
return createDefaultEmployee;
|
||||
}
|
||||
|
||||
|
||||
List<CustomizeWorkshopEmployeeSettingsShift> shiftCollection = new List<CustomizeWorkshopEmployeeSettingsShift>();
|
||||
@@ -558,13 +557,7 @@ public class CustomizeWorkshopSettingsApplication(ICustomizeWorkshopSettingsRepo
|
||||
|
||||
_customizeWorkshopEmployeeSettingsRepository.Create(entity);
|
||||
|
||||
entity.SimpleEdit(shiftCollection, command.IrregularShift, command.WorkshopShiftStatus, command.BreakTime, isChanged, command.FridayWork, command.HolidayWork, rotatingShift);
|
||||
var employeeSalary = command.Salary?.MoneyToDouble() ?? 0;
|
||||
|
||||
if (employeeSalary > 0)
|
||||
{
|
||||
entity.SetSalary(employeeSalary);
|
||||
}
|
||||
entity.SimpleEdit(shiftCollection, command.IrregularShift, command.WorkshopShiftStatus, command.BreakTime, isChanged, command.FridayWork, command.HolidayWork, rotatingShift);
|
||||
|
||||
_customizeWorkshopGroupSettingsRepository.SaveChanges();
|
||||
return op.Succcedded();
|
||||
@@ -688,7 +681,7 @@ public class CustomizeWorkshopSettingsApplication(ICustomizeWorkshopSettingsRepo
|
||||
return op.Succcedded();
|
||||
}
|
||||
public OperationResult EditSimpleRollCallGroupSetting(EditCustomizeWorkshopGroupSettings command,
|
||||
List<ReCalculateRollCallValues> reCalculateCommand)
|
||||
List<ReCalculateRollCallValues> reCalculateCommand)
|
||||
{
|
||||
OperationResult op = new();
|
||||
|
||||
@@ -719,15 +712,15 @@ public class CustomizeWorkshopSettingsApplication(ICustomizeWorkshopSettingsRepo
|
||||
{
|
||||
|
||||
groupSettingsShifts = command.ShiftViewModel.Select(x =>
|
||||
{
|
||||
if (!TimeOnly.TryParseExact(x.StartTime, "HH:mm", out TimeOnly start))
|
||||
throw new InvalidDataException();
|
||||
if (!TimeOnly.TryParseExact(x.EndTime, "HH:mm", out TimeOnly end))
|
||||
throw new InvalidDataException();
|
||||
{
|
||||
if (!TimeOnly.TryParseExact(x.StartTime, "HH:mm", out TimeOnly start))
|
||||
throw new InvalidDataException();
|
||||
if (!TimeOnly.TryParseExact(x.EndTime, "HH:mm", out TimeOnly end))
|
||||
throw new InvalidDataException();
|
||||
|
||||
return new CustomizeWorkshopGroupSettingsShift(start, end, x.Placement);
|
||||
return new CustomizeWorkshopGroupSettingsShift(start, end, x.Placement);
|
||||
|
||||
}).ToList();
|
||||
}).ToList();
|
||||
|
||||
if (groupSettingsShifts.All(x => workshopSettings.CustomizeWorkshopSettingsShifts.Any(y => x.Equals(y)))
|
||||
&& command.WorkshopShiftStatus == workshopSettings.WorkshopShiftStatus && command.FridayWork == workshopSettings.FridayWork &&
|
||||
@@ -1596,6 +1589,10 @@ public class CustomizeWorkshopSettingsApplication(ICustomizeWorkshopSettingsRepo
|
||||
return _customizeWorkshopGroupSettingsRepository.GetEmployeesGroupSettingsByEmployeeId(employeeId, workshopId);
|
||||
}
|
||||
|
||||
public bool HasAnyEmployeeWithoutGroup(long workshopId)
|
||||
{
|
||||
return _customizeWorkshopGroupSettingsRepository.HasAnyEmployeeWithoutGroup(workshopId);
|
||||
}
|
||||
public OperationResult<List<long>> ValidateReCalculateValueForGroupEdit(List<ReCalculateRollCallValues> commands,
|
||||
long workshopId)
|
||||
{
|
||||
@@ -1626,16 +1623,10 @@ public class CustomizeWorkshopSettingsApplication(ICustomizeWorkshopSettingsRepo
|
||||
|
||||
employeeIdsHasCheckout = employeeIdsHasCheckout.Distinct().ToList();
|
||||
return isSuccess ?
|
||||
operationResult.Succcedded(employeeIdsHasCheckout)
|
||||
operationResult.Succcedded(employeeIdsHasCheckout)
|
||||
:
|
||||
operationResult.Failed("پرسنل هایی دارای فیش هستند لطفا نسبت به تعیین تکلیف این ها اقدام نمایید", employeeIdsHasCheckout);
|
||||
}
|
||||
|
||||
public bool HasAnyEmployeeWithoutGroup(long workshopId)
|
||||
{
|
||||
return _customizeWorkshopGroupSettingsRepository.HasAnyEmployeeWithoutGroup(workshopId);
|
||||
}
|
||||
|
||||
public bool CheckEmployeeShiftHasChanged(EditCustomizeEmployeeSettings command)
|
||||
{
|
||||
return _customizeWorkshopEmployeeSettingsRepository.CheckEmployeeShiftHasChanged(command);
|
||||
|
||||
@@ -1,38 +1,35 @@
|
||||
using _0_Framework.Application;
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Collections.Generic;
|
||||
using _0_Framework.InfraStructure;
|
||||
using Company.Domain.EmployeeAgg;
|
||||
using Company.Domain.LeftWorkAgg;
|
||||
using Company.Domain.WorkshopAgg;
|
||||
using CompanyManagment.App.Contracts.Employee;
|
||||
using CompanyManagment.App.Contracts.EmployeeInsuranceRecord;
|
||||
using CompanyManagment.EFCore;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using _0_Framework.Application;
|
||||
using CompanyManagment.App.Contracts.EmployeeInsuranceRecord;
|
||||
using Company.Domain.EmployeeInsuranceRecordAgg;
|
||||
using Company.Domain.WorkshopAgg;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using System.Transactions;
|
||||
using Company.Domain.EmployeeClientTempAgg;
|
||||
using Company.Domain.PersonnelCodeAgg;
|
||||
using EmployeeInsuranceRecord = Company.Domain.EmployeeInsuranceRecordAgg.EmployeeInsuranceRecord;
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
using System.IO;
|
||||
using _0_Framework.Application.UID;
|
||||
using Company.Domain.CustomizeWorkshopEmployeeSettingsAgg;
|
||||
using Company.Domain.CustomizeWorkshopGroupSettingsAgg;
|
||||
using Company.Domain.EmployeeDocumentsAgg;
|
||||
using Company.Domain.LeftWorkTempAgg;
|
||||
using Company.Domain.RollCallEmployeeAgg;
|
||||
using CompanyManagment.App.Contracts.CustomizeWorkshopSettings;
|
||||
using CompanyManagment.App.Contracts.EmployeeBankInformation;
|
||||
using CompanyManagment.App.Contracts.EmployeeDocuments;
|
||||
using CompanyManagment.App.Contracts.RollCallEmployeeStatus;
|
||||
using RollCallEmployee = Company.Domain.RollCallEmployeeAgg.RollCallEmployee;
|
||||
using CompanyManagment.App.Contracts.Employee.DTO;
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
using System.IO;
|
||||
using System.Transactions;
|
||||
using Company.Domain.EmployeeClientTempAgg;
|
||||
using Company.Domain.LeftWorkTempAgg;
|
||||
using CompanyManagment.App.Contracts.LeftWorkTemp;
|
||||
using System.Reflection;
|
||||
using _0_Framework.Application.UID;
|
||||
using Company.Domain.CustomizeWorkshopEmployeeSettingsAgg;
|
||||
using Company.Domain.EmployeeDocumentsAgg;
|
||||
using Company.Domain.RollCallEmployeeAgg;
|
||||
using Company.Domain.CustomizeWorkshopGroupSettingsAgg;
|
||||
using Company.Domain.LeftWorkAgg;
|
||||
using CompanyManagment.App.Contracts.Employee.DTO;
|
||||
using Company.Domain.EmployeeAuthorizeTempAgg;
|
||||
using Company.Domain.RollCallServiceAgg;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Company.Domain.LeftWorkInsuranceAgg;
|
||||
|
||||
namespace CompanyManagment.Application;
|
||||
@@ -41,9 +38,6 @@ public class EmployeeAplication : RepositoryBase<long, Employee>, IEmployeeAppli
|
||||
{
|
||||
private readonly IEmployeeRepository _EmployeeRepository;
|
||||
private readonly IWorkshopRepository _WorkShopRepository;
|
||||
private readonly ILeftWorkRepository _leftWorkRepository;
|
||||
private readonly IPersonnelCodeRepository _personnelCodeRepository;
|
||||
private readonly IEmployeeClientTempRepository _employeeClientTempRepository;
|
||||
private readonly CompanyContext _context;
|
||||
public bool nationalCodValid = false;
|
||||
public bool idnumberIsOk = true;
|
||||
@@ -61,32 +55,17 @@ public class EmployeeAplication : RepositoryBase<long, Employee>, IEmployeeAppli
|
||||
private readonly ILeftWorkTempRepository _leftWorkTempRepository;
|
||||
private readonly IUidService _uidService;
|
||||
private readonly ICustomizeWorkshopEmployeeSettingsRepository _customizeWorkshopEmployeeSettingsRepository;
|
||||
private readonly ILeftWorkRepository _leftWorkRepository;
|
||||
private readonly IPersonnelCodeRepository _personnelCodeRepository;
|
||||
private readonly IEmployeeClientTempRepository _employeeClientTempRepository;
|
||||
private readonly ICustomizeWorkshopGroupSettingsRepository _customizeWorkshopGroupSettingsRepository;
|
||||
private readonly IEmployeeAuthorizeTempRepository _employeeAuthorizeTempRepository;
|
||||
private readonly ILeftWorkInsuranceRepository _leftWorkInsuranceRepository ;
|
||||
private readonly IRollCallServiceRepository _rollCallServiceRepository;
|
||||
|
||||
public EmployeeAplication(IEmployeeRepository employeeRepository, CompanyContext context,
|
||||
IWorkshopRepository workShopRepository,
|
||||
ILeftWorkRepository leftWorkRepository, IPersonnelCodeRepository personnelCodeRepository,
|
||||
IEmployeeClientTempRepository employeeClientTempRepository, IWebHostEnvironment webHostEnvironment,
|
||||
IRollCallEmployeeStatusApplication rollCallEmployeeStatusApplication,
|
||||
IRollCallEmployeeRepository rollCallEmployeeRepository,
|
||||
ICustomizeWorkshopGroupSettingsRepository customizeWorkshopGroupSettingsRepository,
|
||||
ICustomizeWorkshopSettingsApplication customizeWorkshopSettingsApplication,
|
||||
IEmployeeDocumentsApplication employeeDocumentsApplication,
|
||||
IEmployeeBankInformationApplication employeeBankInformationApplication,
|
||||
ILeftWorkTempRepository leftWorkTempRepository,
|
||||
IUidService uidService,
|
||||
ICustomizeWorkshopEmployeeSettingsRepository customizeWorkshopEmployeeSettingsRepository,
|
||||
IEmployeeAuthorizeTempRepository employeeAuthorizeTempRepository,
|
||||
IRollCallServiceRepository rollCallServiceRepository, ILeftWorkInsuranceRepository leftWorkInsuranceRepository) : base(context)
|
||||
public EmployeeAplication(IEmployeeRepository employeeRepository, CompanyContext context, IWorkshopRepository workShopRepository, IWebHostEnvironment webHostEnvironment, IRollCallEmployeeStatusApplication rollCallEmployeeStatusApplication, IRollCallEmployeeRepository rollCallEmployeeRepository, ICustomizeWorkshopSettingsApplication customizeWorkshopSettingsApplication, IEmployeeDocumentsApplication employeeDocumentsApplication, IEmployeeDocumentsRepository employeeDocumentsRepository, IEmployeeBankInformationApplication employeeBankInformationApplication, ILeftWorkTempRepository leftWorkTempRepository, IUidService uidService, ICustomizeWorkshopEmployeeSettingsRepository customizeWorkshopEmployeeSettingsRepository, IPersonnelCodeRepository personnelCodeRepository, IEmployeeClientTempRepository employeeClientTempRepository, ICustomizeWorkshopGroupSettingsRepository customizeWorkshopGroupSettingsRepository, ILeftWorkRepository leftWorkRepository, IEmployeeAuthorizeTempRepository employeeAuthorizeTempRepository, ILeftWorkInsuranceRepository leftWorkInsuranceRepository) : base(context)
|
||||
{
|
||||
_context = context;
|
||||
_WorkShopRepository = workShopRepository;
|
||||
_EmployeeRepository = employeeRepository;
|
||||
this._leftWorkRepository = leftWorkRepository;
|
||||
_personnelCodeRepository = personnelCodeRepository;
|
||||
_employeeClientTempRepository = employeeClientTempRepository;
|
||||
_webHostEnvironment = webHostEnvironment;
|
||||
_rollCallEmployeeStatusApplication = rollCallEmployeeStatusApplication;
|
||||
_rollCallEmployeeRepository = rollCallEmployeeRepository;
|
||||
@@ -96,17 +75,19 @@ public class EmployeeAplication : RepositoryBase<long, Employee>, IEmployeeAppli
|
||||
_leftWorkTempRepository = leftWorkTempRepository;
|
||||
_uidService = uidService;
|
||||
_customizeWorkshopEmployeeSettingsRepository = customizeWorkshopEmployeeSettingsRepository;
|
||||
_personnelCodeRepository = personnelCodeRepository;
|
||||
_employeeClientTempRepository = employeeClientTempRepository;
|
||||
_leftWorkRepository = leftWorkRepository;
|
||||
_employeeAuthorizeTempRepository = employeeAuthorizeTempRepository;
|
||||
_leftWorkInsuranceRepository = leftWorkInsuranceRepository;
|
||||
_EmployeeRepository = employeeRepository;
|
||||
_rollCallServiceRepository = rollCallServiceRepository;
|
||||
}
|
||||
|
||||
public OperationResult Create(CreateEmployee command)
|
||||
{
|
||||
var opration = new OperationResult();
|
||||
if (_EmployeeRepository.Exists(x =>
|
||||
x.LName == command.LName && x.NationalCode == command.NationalCode && !string.IsNullOrWhiteSpace(command.NationalCode) && x.NationalCode != null))
|
||||
x.LName == command.LName && x.NationalCode == command.NationalCode && !string.IsNullOrWhiteSpace(command.NationalCode) && x.NationalCode != null && x.IsActiveString == "true"))
|
||||
return opration.Failed("امکان ثبت رکورد تکراری وجود ندارد");
|
||||
|
||||
//if (_EmployeeRepository.Exists(x => x.IdNumber == command.IdNumber && x.IdNumber !=null))
|
||||
@@ -124,7 +105,7 @@ public class EmployeeAplication : RepositoryBase<long, Employee>, IEmployeeAppli
|
||||
|
||||
//}
|
||||
|
||||
|
||||
|
||||
|
||||
if (command.Address != null && command.State == null)
|
||||
{
|
||||
@@ -163,8 +144,8 @@ public class EmployeeAplication : RepositoryBase<long, Employee>, IEmployeeAppli
|
||||
{
|
||||
case "0000000000":
|
||||
case "1111111111":
|
||||
case "2222222222":
|
||||
case "3333333333":
|
||||
case "22222222222":
|
||||
case "33333333333":
|
||||
case "4444444444":
|
||||
case "5555555555":
|
||||
case "6666666666":
|
||||
@@ -216,9 +197,9 @@ public class EmployeeAplication : RepositoryBase<long, Employee>, IEmployeeAppli
|
||||
return opration.Failed("کد ملی وارد شده تکراری است");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
string initial = "1300/10/11";
|
||||
var dateOfBirth = command.DateOfBirth != null ? command.DateOfBirth.ToGeorgianDateTime() : initial.ToGeorgianDateTime();
|
||||
var dateOfIssue = command.DateOfIssue != null ? command.DateOfIssue.ToGeorgianDateTime() : initial.ToGeorgianDateTime();
|
||||
@@ -243,10 +224,9 @@ public class EmployeeAplication : RepositoryBase<long, Employee>, IEmployeeAppli
|
||||
|
||||
return opration.Succcedded(employeeData.id);
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
public OperationResult Edit(EditEmployee command)
|
||||
{
|
||||
var opration = new OperationResult();
|
||||
@@ -255,11 +235,11 @@ public class EmployeeAplication : RepositoryBase<long, Employee>, IEmployeeAppli
|
||||
return opration.Failed("رکورد مورد نظر یافت نشد");
|
||||
|
||||
if (_EmployeeRepository.Exists(x =>
|
||||
x.LName == command.LName && x.NationalCode == command.NationalCode && !string.IsNullOrWhiteSpace(command.NationalCode) && x.id != command.Id))
|
||||
x.LName == command.LName && x.NationalCode == command.NationalCode && !string.IsNullOrWhiteSpace(command.NationalCode) && x.id != command.Id && x.IsActiveString == "true"))
|
||||
return opration.Failed("امکان ثبت رکورد تکراری وجود ندارد");
|
||||
//if (_EmployeeRepository.Exists(x => x.IdNumber == command.IdNumber && x.IdNumber != null && x.id != command.Id))
|
||||
// return opration.Failed("شماره شناسنامه وارد شده تکراری است");
|
||||
|
||||
|
||||
if (command.Address != null && command.State == null)
|
||||
{
|
||||
StatCity = false;
|
||||
@@ -297,8 +277,8 @@ public class EmployeeAplication : RepositoryBase<long, Employee>, IEmployeeAppli
|
||||
{
|
||||
case "0000000000":
|
||||
case "1111111111":
|
||||
case "2222222222":
|
||||
case "3333333333":
|
||||
case "22222222222":
|
||||
case "33333333333":
|
||||
case "4444444444":
|
||||
case "5555555555":
|
||||
case "6666666666":
|
||||
@@ -351,7 +331,7 @@ public class EmployeeAplication : RepositoryBase<long, Employee>, IEmployeeAppli
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
string initial = "1300/10/11";
|
||||
var dateOfBirth = command.DateOfBirth != null ? command.DateOfBirth.ToGeorgianDateTime() : initial.ToGeorgianDateTime();
|
||||
var dateOfIssue = command.DateOfIssue != null ? command.DateOfIssue.ToGeorgianDateTime() : initial.ToGeorgianDateTime();
|
||||
@@ -359,7 +339,7 @@ public class EmployeeAplication : RepositoryBase<long, Employee>, IEmployeeAppli
|
||||
dateOfIssue,
|
||||
command.PlaceOfIssue, command.NationalCode, command.IdNumber, command.Gender, command.Nationality,
|
||||
command.Phone, command.Address,
|
||||
command.State, command.City, command.MaritalStatus, command.MilitaryService, command.LevelOfEducation,
|
||||
command.State,command.City, command.MaritalStatus, command.MilitaryService, command.LevelOfEducation,
|
||||
command.FieldOfStudy, command.BankCardNumber,
|
||||
command.BankBranch, command.InsuranceCode, command.InsuranceHistoryByYear,
|
||||
command.InsuranceHistoryByMonth, command.NumberOfChildren, command.OfficePhone
|
||||
@@ -372,7 +352,7 @@ public class EmployeeAplication : RepositoryBase<long, Employee>, IEmployeeAppli
|
||||
|
||||
return opration.Succcedded();
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
public EditEmployee GetDetails(long id)
|
||||
@@ -380,11 +360,6 @@ public class EmployeeAplication : RepositoryBase<long, Employee>, IEmployeeAppli
|
||||
return _EmployeeRepository.GetDetails(id);
|
||||
}
|
||||
|
||||
public EditEmployee GetDetailsIgnoreQueryFilter(long id)
|
||||
{
|
||||
return _EmployeeRepository.GetDetails(id);
|
||||
}
|
||||
|
||||
public OperationResult Active(long id)
|
||||
{
|
||||
var opration = new OperationResult();
|
||||
@@ -423,8 +398,8 @@ public class EmployeeAplication : RepositoryBase<long, Employee>, IEmployeeAppli
|
||||
|
||||
public async Task<List<EmployeeViewModel>> Search(EmployeeSearchModel searchModel)
|
||||
{
|
||||
var res = await _EmployeeRepository.Search(searchModel);
|
||||
|
||||
var res=await _EmployeeRepository.Search(searchModel);
|
||||
|
||||
foreach (var item in res)
|
||||
{
|
||||
var children = _context.EmployeeChildrenSet.Count(x => x.EmployeeId == item.Id);
|
||||
@@ -715,8 +690,8 @@ public class EmployeeAplication : RepositoryBase<long, Employee>, IEmployeeAppli
|
||||
{
|
||||
case "0000000000":
|
||||
case "1111111111":
|
||||
case "2222222222":
|
||||
case "3333333333":
|
||||
case "22222222222":
|
||||
case "33333333333":
|
||||
case "4444444444":
|
||||
case "5555555555":
|
||||
case "6666666666":
|
||||
@@ -845,8 +820,8 @@ public class EmployeeAplication : RepositoryBase<long, Employee>, IEmployeeAppli
|
||||
{
|
||||
case "0000000000":
|
||||
case "1111111111":
|
||||
case "2222222222":
|
||||
case "3333333333":
|
||||
case "22222222222":
|
||||
case "33333333333":
|
||||
case "4444444444":
|
||||
case "5555555555":
|
||||
case "6666666666":
|
||||
@@ -926,17 +901,11 @@ public class EmployeeAplication : RepositoryBase<long, Employee>, IEmployeeAppli
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
#region Pooya
|
||||
|
||||
|
||||
public List<EmployeeViewModel> GetWorkingEmployeesByWorkshopId(long workshopId)
|
||||
{
|
||||
return _EmployeeRepository.GetWorkingEmployeesByWorkshopId(workshopId);
|
||||
}
|
||||
|
||||
public EmployeeViewModel GetEmployeeByNationalCodeIfHasActiveLeftWork(string nationalCode, List<long> workshopIds)
|
||||
{
|
||||
if (nationalCode.NationalCodeValid() != "valid")
|
||||
@@ -944,6 +913,7 @@ public class EmployeeAplication : RepositoryBase<long, Employee>, IEmployeeAppli
|
||||
var workshopEmployeesWithLeftWork = _EmployeeRepository.GetWorkingEmployeesByWorkshopIdsAndNationalCodeAndDate(workshopIds, nationalCode, DateTime.Now.Date);
|
||||
return workshopEmployeesWithLeftWork.FirstOrDefault();
|
||||
}
|
||||
|
||||
public EmployeeViewModel GetEmployeeByNationalCodeIfHasLeftWork(string nationalCode, List<long> workshopIds)
|
||||
{
|
||||
if (nationalCode.NationalCodeValid() != "valid")
|
||||
@@ -951,8 +921,11 @@ public class EmployeeAplication : RepositoryBase<long, Employee>, IEmployeeAppli
|
||||
var workshopEmployeesWithLeftWork = _EmployeeRepository.GetWorkedEmployeesByWorkshopIdsAndNationalCodeAndDate(workshopIds, nationalCode, DateTime.Now.Date);
|
||||
return workshopEmployeesWithLeftWork.FirstOrDefault();
|
||||
}
|
||||
public List<EmployeeViewModel> GetWorkingEmployeesByWorkshopId(long workshopId)
|
||||
{
|
||||
return _EmployeeRepository.GetWorkingEmployeesByWorkshopId(workshopId);
|
||||
|
||||
|
||||
}
|
||||
|
||||
public List<EmployeeViewModel> GetRangeByIds(IEnumerable<long> employeeIds)
|
||||
{
|
||||
@@ -988,7 +961,6 @@ public class EmployeeAplication : RepositoryBase<long, Employee>, IEmployeeAppli
|
||||
}).ToList();
|
||||
}
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
#region Mahan
|
||||
@@ -1023,10 +995,24 @@ public class EmployeeAplication : RepositoryBase<long, Employee>, IEmployeeAppli
|
||||
//{
|
||||
// return op.Failed("این پرسنل قبلا افزوده شده است و در انتظار تایید میباشد");
|
||||
//}
|
||||
|
||||
|
||||
var employee = _EmployeeRepository.GetByNationalCodeIgnoreQueryFilter(command.NationalCode);
|
||||
|
||||
var workshop = _WorkShopRepository.GetDetails(command.WorkshopId);
|
||||
if (employee == null)
|
||||
|
||||
if (employee == null && command.CanceledAuthorize)
|
||||
{
|
||||
var birthDate = command.BirthDate.ToGeorgianDateTime();
|
||||
var dateOfIssue = new DateTime(1922, 1, 1);
|
||||
|
||||
employee = new Employee(command.FirstName, command.LastName, null, birthDate,
|
||||
dateOfIssue, null, command.NationalCode, null, command.Gender, "ایرانی", null, null);
|
||||
_EmployeeRepository.Create(employee);
|
||||
_EmployeeRepository.SaveChanges();
|
||||
|
||||
}
|
||||
if (employee == null)
|
||||
{
|
||||
return op.Failed("خطای سیستمی. لطفا دوباره تلاش کنید . درصورت تکرار این مشکل با تیم پشتیبان تماس بگیرید");
|
||||
}
|
||||
@@ -1080,7 +1066,6 @@ public class EmployeeAplication : RepositoryBase<long, Employee>, IEmployeeAppli
|
||||
_personnelCodeRepository.SaveChanges();
|
||||
}
|
||||
|
||||
var rollCallService = _rollCallServiceRepository.GetActiveServiceByWorkshopId(command.WorkshopId);
|
||||
|
||||
if (string.IsNullOrWhiteSpace(command.RollCallUploadEmployeePicture?.Picture1) == false &&
|
||||
string.IsNullOrWhiteSpace(command.RollCallUploadEmployeePicture?.Picture2) == false)
|
||||
@@ -1090,14 +1075,14 @@ public class EmployeeAplication : RepositoryBase<long, Employee>, IEmployeeAppli
|
||||
Directory.CreateDirectory(directoryPath);
|
||||
|
||||
var filePath1 = Path.Combine(directoryPath) + $@"\1.jpg";
|
||||
|
||||
CreateImageFromBase64(command.RollCallUploadEmployeePicture.Picture1, filePath1);
|
||||
|
||||
|
||||
CreateImageFromBase64(command.RollCallUploadEmployeePicture.Picture1, filePath1);
|
||||
|
||||
|
||||
var filePath2 = Path.Combine(directoryPath) + $@"\2.jpg";
|
||||
|
||||
CreateImageFromBase64(command.RollCallUploadEmployeePicture.Picture2, filePath2);
|
||||
|
||||
|
||||
CreateImageFromBase64(command.RollCallUploadEmployeePicture.Picture2, filePath2);
|
||||
|
||||
|
||||
|
||||
var rollCallEmployee =
|
||||
@@ -1130,16 +1115,6 @@ public class EmployeeAplication : RepositoryBase<long, Employee>, IEmployeeAppli
|
||||
|
||||
if (command.CreateCustomizeEmployeeSettings.GroupId > 0)
|
||||
{
|
||||
if (rollCallService?.HasCustomizeCheckoutService == "true")
|
||||
{
|
||||
var employeeSalary = command.CreateCustomizeEmployeeSettings.Salary?.MoneyToDouble() ?? 0;
|
||||
|
||||
if (employeeSalary < 1)
|
||||
{
|
||||
return op.Failed("لطفا حقوق پرسنل را وارد کنید");
|
||||
}
|
||||
|
||||
}
|
||||
if (_customizeWorkshopEmployeeSettingsRepository
|
||||
.Exists(x => x.WorkshopId == workshop.Id && x.EmployeeId == employee.id))
|
||||
{
|
||||
@@ -1167,16 +1142,6 @@ public class EmployeeAplication : RepositoryBase<long, Employee>, IEmployeeAppli
|
||||
}
|
||||
else if (command.CreateCustomizeEmployeeSettings.GroupId > 0)
|
||||
{
|
||||
if (rollCallService?.HasCustomizeCheckoutService == "true")
|
||||
{
|
||||
var employeeSalary = command.CreateCustomizeEmployeeSettings.Salary?.MoneyToDouble() ?? 0;
|
||||
|
||||
if (employeeSalary < 1)
|
||||
{
|
||||
return op.Failed("لطفا حقوق پرسنل را وارد کنید");
|
||||
}
|
||||
|
||||
}
|
||||
if (_customizeWorkshopEmployeeSettingsRepository
|
||||
.Exists(x => x.WorkshopId == workshop.Id && x.EmployeeId == employee.id))
|
||||
{
|
||||
@@ -1270,7 +1235,6 @@ public class EmployeeAplication : RepositoryBase<long, Employee>, IEmployeeAppli
|
||||
byte[] bytes = Convert.FromBase64String(subBase64);
|
||||
System.IO.File.WriteAllBytes(filePath, bytes);
|
||||
}
|
||||
|
||||
public async Task<OperationResult<EmployeeByNationalCodeInWorkshopViewModel>>
|
||||
ValidateCreateEmployeeClientByNationalCodeAndWorkshopId(string nationalCode, string birthDate, long workshopId)
|
||||
{
|
||||
@@ -1291,6 +1255,11 @@ public class EmployeeAplication : RepositoryBase<long, Employee>, IEmployeeAppli
|
||||
if (employee == null)
|
||||
{
|
||||
var personalInfo = await _uidService.GetPersonalInfo(nationalCode, birthDate);
|
||||
|
||||
if (personalInfo.ResponseContext.Status.Code == 14)
|
||||
{
|
||||
return op.Failed("سامانه احراز هویت در دسترس نمیباشد لطفا اطلاعات پرسنل را به صورت دستی وارد کنید",new EmployeeByNationalCodeInWorkshopViewModel(){AuthorizedCanceled = true});
|
||||
}
|
||||
if (personalInfo.ResponseContext.Status.Code != 0)
|
||||
{
|
||||
return op.Failed("کد ملی و تاریخ تولد با هم همخانی ندارند");
|
||||
@@ -1560,9 +1529,9 @@ public class EmployeeAplication : RepositoryBase<long, Employee>, IEmployeeAppli
|
||||
{
|
||||
employee.EditAuthorizeEmployee(employee.DateOfIssue, employee.PlaceOfIssue,
|
||||
employee.Phone, employee.Address, employee.State, employee.City, command.MaritalStatus,
|
||||
command.MilitaryService, employee.LevelOfEducation, employee.FieldOfStudy,
|
||||
command.MilitaryService, employee.LevelOfEducation, employee.FieldOfStudy,
|
||||
employee.BankCardNumber, employee.BankBranch, employee.InsuranceCode,
|
||||
employee.InsuranceHistoryByYear, employee.InsuranceHistoryByMonth, employee.NumberOfChildren,
|
||||
employee.InsuranceHistoryByYear, employee.InsuranceHistoryByMonth, employee.NumberOfChildren,
|
||||
employee.OfficePhone, employee.MclsUserName, employee.MclsPassword,
|
||||
employee.EserviceUserName, employee.EservicePassword, employee.TaxOfficeUserName,
|
||||
employee.TaxOfficepassword, employee.SanaUserName, employee.SanaPassword);
|
||||
@@ -1676,5 +1645,6 @@ public class EmployeeAplication : RepositoryBase<long, Employee>, IEmployeeAppli
|
||||
|
||||
}
|
||||
|
||||
|
||||
#endregion
|
||||
}
|
||||
@@ -21,41 +21,46 @@ public class EmployeeComputeOptionsApplication : IEmployeeComputeOptionsApplicat
|
||||
|
||||
public OperationResult Create(CreateEmployeeComputeOptions command)
|
||||
{
|
||||
var opration = new OperationResult();
|
||||
try
|
||||
{
|
||||
if (_employeeComputeOptionsRepository.Exists(x =>
|
||||
x.EmployeeId == command.EmployeeId && x.WorkshopId == command.WorkshopId))
|
||||
{
|
||||
var query = GetEmployeeOptions(command.WorkshopId, command.EmployeeId);
|
||||
var editOptions = _employeeComputeOptionsRepository.Get(query.Id);
|
||||
editOptions.Edit(command.ComputeOptions, command.BonusesOptions, command.YearsOptions);
|
||||
_employeeComputeOptionsRepository.SaveChanges();
|
||||
return opration.Succcedded();
|
||||
}
|
||||
else
|
||||
{
|
||||
var createOptions = new EmployeeComputeOptions(command.WorkshopId, command.EmployeeId,
|
||||
command.ComputeOptions, command.BonusesOptions, command.YearsOptions);
|
||||
_employeeComputeOptionsRepository.Create(createOptions);
|
||||
_employeeComputeOptionsRepository.SaveChanges();
|
||||
return opration.Succcedded();
|
||||
}
|
||||
}
|
||||
catch (Exception a)
|
||||
{
|
||||
return opration.Failed("ثبت با خطا مواجه شد");
|
||||
}
|
||||
|
||||
var opration = new OperationResult();
|
||||
try
|
||||
{
|
||||
if (_employeeComputeOptionsRepository.Exists(x =>
|
||||
x.EmployeeId == command.EmployeeId && x.WorkshopId == command.WorkshopId))
|
||||
{
|
||||
var query = GetEmployeeOptions(command.WorkshopId, command.EmployeeId);
|
||||
var editOptions = _employeeComputeOptionsRepository.Get(query.Id);
|
||||
|
||||
editOptions.Edit(command.ComputeOptions, command.BonusesOptions, command.YearsOptions,
|
||||
command.CreateContract, command.SignContract, command.CreateCheckout, command.SignCheckout);
|
||||
|
||||
_employeeComputeOptionsRepository.SaveChanges();
|
||||
return opration.Succcedded();
|
||||
}
|
||||
else
|
||||
{
|
||||
var createOptions = new EmployeeComputeOptions(command.WorkshopId, command.EmployeeId,
|
||||
command.ComputeOptions, command.BonusesOptions, command.YearsOptions, command.CreateContract,
|
||||
command.SignContract, command.CreateCheckout, command.SignCheckout);
|
||||
|
||||
_employeeComputeOptionsRepository.Create(createOptions);
|
||||
_employeeComputeOptionsRepository.SaveChanges();
|
||||
return opration.Succcedded();
|
||||
}
|
||||
}
|
||||
catch (Exception a)
|
||||
{
|
||||
return opration.Failed("ثبت با خطا مواجه شد");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public EmployeeComputeOptionsViewModel GetEmployeeOptions(long workshopId, long employeeId)
|
||||
{
|
||||
return _employeeComputeOptionsRepository.GetEmployeeOptions(workshopId, employeeId);
|
||||
return _employeeComputeOptionsRepository.GetEmployeeOptions(workshopId, employeeId);
|
||||
}
|
||||
|
||||
public List<EmployeeComputeOptionsViewModel> GetAllByWorkshopId(long workshopId)
|
||||
{
|
||||
return _employeeComputeOptionsRepository.GetAllByWorkshopId(workshopId);
|
||||
return _employeeComputeOptionsRepository.GetAllByWorkshopId(workshopId);
|
||||
}
|
||||
}
|
||||
@@ -3,7 +3,6 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using _0_Framework.Application;
|
||||
using _0_Framework.Exceptions;
|
||||
using Company.Domain.empolyerAgg;
|
||||
using Company.Domain.WorkshopAgg;
|
||||
using CompanyManagment.App.Contracts.Checkout;
|
||||
@@ -958,256 +957,4 @@ public class EmployerApplication : IEmployerApplication
|
||||
}
|
||||
|
||||
#endregion
|
||||
#region Api
|
||||
public async Task<List<GetEmployerListViewModel>> GetEmployerList(GetEmployerSearchModel searchModel)
|
||||
{
|
||||
return await _EmployerRepository.GetEmployerList(searchModel);
|
||||
}
|
||||
public async Task<GetLegalEmployerDetailViewModel> GetLegalEmployerDetail(long id)
|
||||
{
|
||||
var employer = await _EmployerRepository.GetLegalEmployerDetail(id);
|
||||
if (employer == null)
|
||||
{
|
||||
throw new NotFoundException("کارفرمای مورد نطر یافت نشد");
|
||||
}
|
||||
return employer;
|
||||
|
||||
}
|
||||
|
||||
public async Task<GetRealEmployerDetailViewModel> GetRealEmployerDetail(long id)
|
||||
{
|
||||
var employer = await _EmployerRepository.GetRealEmployerDetail(id);
|
||||
if (employer == null)
|
||||
{
|
||||
throw new NotFoundException("کارفرمای مورد نطر یافت نشد");
|
||||
}
|
||||
return employer;
|
||||
}
|
||||
|
||||
public async Task<OperationResult> CreateReal(CreateRealEmployer command)
|
||||
{
|
||||
var opration = new OperationResult();
|
||||
if (_EmployerRepository.Exists(x =>
|
||||
(x.FName == command.FName && x.LName == command.LName) && x.Nationalcode == command.NationalCode && x.Nationalcode != null))
|
||||
return opration.Failed("امکان ثبت رکورد تکراری وجود ندارد");
|
||||
|
||||
if (string.IsNullOrWhiteSpace(command.FName))
|
||||
return opration.Failed("لطفا نام را وارد کنید");
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(command.NationalCode))
|
||||
{
|
||||
if (command.NationalCode.NationalCodeValid() != "valid")
|
||||
{
|
||||
return opration.Failed("کدملی وارد شده نامعتبر است");
|
||||
}
|
||||
if (_EmployerRepository.Exists(x => x.Nationalcode == command.NationalCode && !string.IsNullOrWhiteSpace(command.NationalCode)))
|
||||
{
|
||||
return opration.Failed("کد ملی وارد شده تکراری است");
|
||||
}
|
||||
}
|
||||
string initial = "1300/10/11";
|
||||
var dateOfBirth = command.DateOfBirth?.ToGeorgianDateTime() ?? initial.ToGeorgianDateTime();
|
||||
var dateOfIssue = command.DateOfIssue?.ToGeorgianDateTime() ?? initial.ToGeorgianDateTime();
|
||||
|
||||
var gender = command.Gender switch
|
||||
{
|
||||
Gender.Male => "مرد",
|
||||
Gender.Female => "زن",
|
||||
Gender.None => null,
|
||||
_ => throw new BadRequestException("جنسیت وارد شده نامعتبر است")
|
||||
};
|
||||
|
||||
var employerData = new Employer(command.FName, command.LName, command.ContractingPartyId, gender,
|
||||
command.NationalCode, command.IdNumber, "ایرانی", command.FatherName, dateOfBirth,
|
||||
dateOfIssue, command.PlaceOfIssue, "*", "*", "*", "حقیقی", command.PhoneNumber,
|
||||
command.Telephone, "true", command.GovernmentSystemInfo.MclUsername, command.GovernmentSystemInfo.MclPassword, command.GovernmentSystemInfo.EServiceUsername, command.GovernmentSystemInfo.EServicePassword,
|
||||
command.GovernmentSystemInfo.TaxUsername, command.GovernmentSystemInfo.TaxPassword, command.GovernmentSystemInfo.SanaUsername, command.GovernmentSystemInfo.SanaPassword);
|
||||
|
||||
await _EmployerRepository.CreateAsync(employerData);
|
||||
await _EmployerRepository.SaveChangesAsync();
|
||||
|
||||
return opration.Succcedded();
|
||||
}
|
||||
|
||||
public async Task<OperationResult> CreateLegal(CreateLegalEmployer command)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(command.EmployerLName))
|
||||
command.EmployerLName = "#";
|
||||
var opration = new OperationResult();
|
||||
if (_EmployerRepository.Exists(x =>
|
||||
x.LName == command.CompanyName && x.NationalId == command.NationalId && x.EmployerLName == command.EmployerLName))
|
||||
return opration.Failed("امکان ثبت رکورد تکراری وجود ندارد");
|
||||
|
||||
if (_EmployerRepository.Exists(x => x.NationalId == command.NationalId && !string.IsNullOrWhiteSpace(command.NationalId) && x.NationalId != null))
|
||||
{
|
||||
return opration.Failed(" شناسه ملی وارد شده تکراری است");
|
||||
}
|
||||
if (_EmployerRepository.Exists(x => x.LName == command.CompanyName))
|
||||
{
|
||||
return opration.Failed("نام شرکت وارد شده تکراری است");
|
||||
}
|
||||
if (_EmployerRepository.Exists(x => x.RegisterId == command.RegisterId && !string.IsNullOrWhiteSpace(command.RegisterId) && x.RegisterId != null))
|
||||
{
|
||||
return opration.Failed(" شماره ثبت وارد شده تکراری است");
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(command.NationalId) && command.NationalId.Length != 11)
|
||||
{
|
||||
return opration.Failed(" شناسه ملی باید 11 رقم باشد");
|
||||
}
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(command.EmployerNationalCode))
|
||||
{
|
||||
if (command.EmployerNationalCode.NationalCodeValid() != "valid")
|
||||
{
|
||||
return opration.Failed("کد ملی وارد شده نا معتبر است");
|
||||
}
|
||||
}
|
||||
|
||||
string initial = "1300/10/11";
|
||||
var dateOfBirth = command.EmployerDateOfBirth?.ToGeorgianDateTime() ?? initial.ToGeorgianDateTime();
|
||||
var dateOfIssue = command.EmployerDateOfIssue?.ToGeorgianDateTime() ?? initial.ToGeorgianDateTime();
|
||||
|
||||
var gender = command.EmployerGender switch
|
||||
{
|
||||
Gender.Male => "مرد",
|
||||
Gender.Female => "زن",
|
||||
Gender.None => null,
|
||||
_ => throw new BadRequestException("جنسیت وارد شده نامعتبر است")
|
||||
};
|
||||
|
||||
|
||||
var legalEmployerData = new Employer(command.EmployerFName, command.CompanyName, command.ContractingPartyId, gender,
|
||||
command.EmployerNationalCode, command.EmployerIdNumber, "ایرانی", command.EmployerFatherName, dateOfBirth,
|
||||
dateOfIssue, command.EmployerPlaceOfIssue, command.RegisterId, command.NationalId, command.EmployerLName, "حقوقی", command.PhoneNumber,
|
||||
command.TelephoneNumber, "true", command.GovernmentSystemInfo.MclUsername, command.GovernmentSystemInfo.MclPassword,
|
||||
command.GovernmentSystemInfo.EServiceUsername, command.GovernmentSystemInfo.EServicePassword,
|
||||
command.GovernmentSystemInfo.TaxUsername, command.GovernmentSystemInfo.TaxPassword, command.GovernmentSystemInfo.SanaUsername, command.GovernmentSystemInfo.SanaPassword);
|
||||
|
||||
await _EmployerRepository.CreateAsync(legalEmployerData);
|
||||
await _EmployerRepository.SaveChangesAsync();
|
||||
|
||||
return opration.Succcedded();
|
||||
}
|
||||
|
||||
public async Task<OperationResult> EditReal(EditRealEmployer command)
|
||||
{
|
||||
var opration = new OperationResult();
|
||||
var employer = _EmployerRepository.Get(command.Id);
|
||||
if (employer == null)
|
||||
return opration.Failed("رکورد مورد نظر یافت نشد");
|
||||
|
||||
if (_EmployerRepository.Exists(x =>
|
||||
(x.FName == command.FName && x.LName == command.LName) && x.Nationalcode == command.NationalCode && x.id != command.Id))
|
||||
return opration.Failed("امکان ثبت رکورد تکراری وجود ندارد");
|
||||
if (!string.IsNullOrWhiteSpace(command.NationalCode))
|
||||
{
|
||||
if (command.NationalCode.NationalCodeValid() != "valid")
|
||||
{
|
||||
return opration.Failed("کد ملی وارد شده نا معتبر است");
|
||||
}
|
||||
}
|
||||
|
||||
if (_EmployerRepository.Exists(x => x.Nationalcode == command.NationalCode && !string.IsNullOrWhiteSpace(command.NationalCode) && x.id != command.Id))
|
||||
{
|
||||
|
||||
return opration.Failed(" کد ملی وارد شده تکراری است");
|
||||
}
|
||||
|
||||
|
||||
|
||||
string initial = "1300/10/11";
|
||||
|
||||
var dateOfBirth = command.DateOfBirth?.ToGeorgianDateTime() ?? initial.ToGeorgianDateTime();
|
||||
var dateOfIssue = command.DateOfIssue?.ToGeorgianDateTime() ?? initial.ToGeorgianDateTime();
|
||||
|
||||
var gender = command.Gender switch
|
||||
{
|
||||
Gender.Male => "مرد",
|
||||
Gender.Female => "زن",
|
||||
Gender.None => null,
|
||||
_ => throw new BadRequestException("جنسیت وارد شده نامعتبر است")
|
||||
};
|
||||
|
||||
employer.Edit(command.FName, command.LName, command.ContractingPartyId,
|
||||
gender, command.NationalCode, command.IdNumber, "ایرانی", command.FatherName,
|
||||
dateOfBirth, dateOfIssue, command.PlaceOfIssue, command.PhoneNumber, command.Telephone,
|
||||
command.GovernmentSystemInfo.MclUsername, command.GovernmentSystemInfo.MclPassword, command.GovernmentSystemInfo.EServiceUsername, command.GovernmentSystemInfo.EServicePassword,
|
||||
command.GovernmentSystemInfo.TaxUsername, command.GovernmentSystemInfo.TaxPassword, command.GovernmentSystemInfo.SanaUsername, command.GovernmentSystemInfo.SanaPassword, null);
|
||||
|
||||
await _EmployerRepository.SaveChangesAsync();
|
||||
return opration.Succcedded();
|
||||
}
|
||||
|
||||
public async Task<OperationResult> EditLegal(EditLegalEmployer command)
|
||||
{
|
||||
var opration = new OperationResult();
|
||||
var legalEmployer = _EmployerRepository.Get(command.Id);
|
||||
if (legalEmployer == null)
|
||||
return opration.Failed("رکورد مورد نظر یافت نشد");
|
||||
|
||||
if (_EmployerRepository.Exists(x =>
|
||||
x.LName == command.CompanyName && x.NationalId == command.NationalId && !string.IsNullOrWhiteSpace(command.NationalId) && x.id != command.Id))
|
||||
return opration.Failed("امکان ثبت رکورد تکراری وجود ندارد");
|
||||
|
||||
|
||||
if (!string.IsNullOrEmpty(command.NationalId) && command.NationalId.Length != 11)
|
||||
{
|
||||
return opration.Failed(" شناسه ملی باید 11 رقم باشد");
|
||||
}
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(command.EmployerNationalCode))
|
||||
{
|
||||
if (command.EmployerNationalCode.NationalCodeValid() != "valid")
|
||||
{
|
||||
return opration.Failed("کد ملی وارد شده نا معتبر است");
|
||||
}
|
||||
}
|
||||
|
||||
var gender = command.EmployerGender switch
|
||||
{
|
||||
Gender.Male => "مرد",
|
||||
Gender.Female => "زن",
|
||||
Gender.None => null,
|
||||
_ => throw new BadRequestException("جنسیت وارد شده نامعتبر است")
|
||||
};
|
||||
|
||||
string initial = "1300/10/11";
|
||||
var dateOfBirth = command.EmployerDateOfBirth?.ToGeorgianDateTime() ?? initial.ToGeorgianDateTime();
|
||||
var dateOfIssue = command.EmployerDateOfIssue?.ToGeorgianDateTime() ?? initial.ToGeorgianDateTime();
|
||||
legalEmployer.EditLegal(command.EmployerFName, command.CompanyName, command.ContractingPartyId, gender,
|
||||
command.EmployerNationalCode, command.EmployerIdNumber, "ایرانی", command.EmployerFatherName, dateOfBirth,
|
||||
dateOfIssue, command.EmployerPlaceOfIssue, command.RegisterId, command.NationalId, command.EmployerLName,
|
||||
command.PhoneNumber, command.TelephoneNumber, command.GovernmentSystemInfo.MclUsername, command.GovernmentSystemInfo.MclUsername, command.GovernmentSystemInfo.EServiceUsername, command.GovernmentSystemInfo.EServicePassword,
|
||||
command.GovernmentSystemInfo.TaxUsername, command.GovernmentSystemInfo.TaxPassword, command.GovernmentSystemInfo.SanaUsername, command.GovernmentSystemInfo.SanaPassword, null);
|
||||
|
||||
await _EmployerRepository.SaveChangesAsync();
|
||||
return opration.Succcedded();
|
||||
}
|
||||
|
||||
//public async Task<List<EmployerSelectListViewModel>> GetSelectList(string search)
|
||||
//{
|
||||
// return await _EmployerRepository.GetSelectList(search);
|
||||
//}
|
||||
|
||||
async Task<OperationResult<string>> IEmployerApplication.RemoveApi(long id)
|
||||
{
|
||||
var employer = _EmployerRepository.Get(id);
|
||||
if (employer == null)
|
||||
throw new NotFoundException("دیتای مورد نظر یافت نشد");
|
||||
|
||||
var workshops = _workshopRepository.GetWorkshopsByEmployerId([id]);
|
||||
|
||||
if (workshops.Any())
|
||||
{
|
||||
return await _EmployerRepository.DeactivateWithSubordinates(id);
|
||||
}
|
||||
|
||||
_EmployerRepository.Remove(id);
|
||||
|
||||
return new OperationResult<string>().Succcedded("Deleted");
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -176,6 +176,8 @@ public class LeftWorkTempApplication : ILeftWorkTempApplication
|
||||
_leftWorkTempRepository.Remove(leftWorkTemp);
|
||||
await _leftWorkRepository.SaveChangesAsync();
|
||||
await _leftWorkTempRepository.SaveChangesAsync();
|
||||
|
||||
|
||||
return op.Succcedded();
|
||||
}
|
||||
|
||||
|
||||
@@ -1,19 +1,17 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using _0_Framework.Application;
|
||||
using CompanyManagment.App.Contracts.PersonalContractingParty;
|
||||
using Company.Domain.ContarctingPartyAgg;
|
||||
using Company.Domain.empolyerAgg;
|
||||
using CompanyManagment.App.Contracts.Representative;
|
||||
using Company.Domain.InstitutionContractAgg;
|
||||
using CompanyManagment.EFCore.Repository;
|
||||
|
||||
namespace CompanyManagment.Application;
|
||||
|
||||
public class PersonalContractingPartyApplication : IPersonalContractingPartyApp
|
||||
{
|
||||
private readonly IPersonalContractingPartyRepository _personalContractingPartyRepository;
|
||||
private readonly IPersonalContractingPartyRepository _personalContractingPartyRepository2;
|
||||
private readonly IRepresentativeApplication _representativeApplication;
|
||||
private readonly IEmployerRepository _employerRepository;
|
||||
private readonly IInstitutionContractRepository _institutionContractRepository;
|
||||
@@ -28,7 +26,7 @@ public class PersonalContractingPartyApplication : IPersonalContractingPartyApp
|
||||
public PersonalContractingPartyApplication(
|
||||
IPersonalContractingPartyRepository personalContractingPartyRepository, IRepresentativeApplication representativeApplication, IEmployerRepository employerRepository, IInstitutionContractRepository institutionContractRepository)
|
||||
{
|
||||
_personalContractingPartyRepository = personalContractingPartyRepository;
|
||||
_personalContractingPartyRepository2 = personalContractingPartyRepository;
|
||||
_representativeApplication = representativeApplication;
|
||||
_employerRepository = employerRepository;
|
||||
_institutionContractRepository = institutionContractRepository;
|
||||
@@ -38,7 +36,7 @@ public class PersonalContractingPartyApplication : IPersonalContractingPartyApp
|
||||
public OperationResult Create(CreatePersonalContractingParty command)
|
||||
{
|
||||
var opration = new OperationResult();
|
||||
if (_personalContractingPartyRepository.Exists(x =>
|
||||
if (_personalContractingPartyRepository2.Exists(x =>
|
||||
x.LName == command.LName && x.Nationalcode == command.Nationalcode && x.SureName == command.SureName ))
|
||||
return opration.Failed("امکان ثبت رکورد تکراری وجود ندارد");
|
||||
if (command.RepresentativeId < 1)
|
||||
@@ -56,14 +54,14 @@ public class PersonalContractingPartyApplication : IPersonalContractingPartyApp
|
||||
// return opration.Failed("نام خانوادگی وارد شده تکراری است");
|
||||
|
||||
//}
|
||||
if (_personalContractingPartyRepository.Exists(x => x.Nationalcode == command.Nationalcode && x.LName != command.LName))
|
||||
if (_personalContractingPartyRepository2.Exists(x => x.Nationalcode == command.Nationalcode && x.LName != command.LName))
|
||||
{
|
||||
nationalcodeIsOk = false;
|
||||
|
||||
return opration.Failed("کد ملی وارد شده تکراری است");
|
||||
}
|
||||
|
||||
if (_personalContractingPartyRepository.Exists(x => x.ArchiveCode == command.ArchiveCode))
|
||||
if (_personalContractingPartyRepository2.Exists(x => x.ArchiveCode == command.ArchiveCode))
|
||||
return opration.Failed("کد طرف حساب تکراری است");
|
||||
|
||||
try
|
||||
@@ -134,8 +132,8 @@ public class PersonalContractingPartyApplication : IPersonalContractingPartyApp
|
||||
command.State,command.City,command.Zone,command.SureName);
|
||||
|
||||
|
||||
_personalContractingPartyRepository.Create(personalContractingParty);
|
||||
_personalContractingPartyRepository.SaveChanges();
|
||||
_personalContractingPartyRepository2.Create(personalContractingParty);
|
||||
_personalContractingPartyRepository2.SaveChanges();
|
||||
|
||||
return opration.Succcedded();
|
||||
|
||||
@@ -154,13 +152,13 @@ public class PersonalContractingPartyApplication : IPersonalContractingPartyApp
|
||||
public OperationResult Edit2(EditPersonalContractingParty command)
|
||||
{
|
||||
var opration = new OperationResult();
|
||||
var personalContractingParty = _personalContractingPartyRepository.Get(command.Id);
|
||||
var personalContractingParty = _personalContractingPartyRepository2.Get(command.Id);
|
||||
if (personalContractingParty == null)
|
||||
return opration.Failed("رکورد مورد نظر یافت نشد");
|
||||
|
||||
personalContractingParty.Edit2(command.Address);
|
||||
|
||||
_personalContractingPartyRepository.SaveChanges();
|
||||
_personalContractingPartyRepository2.SaveChanges();
|
||||
return opration.Succcedded();
|
||||
}
|
||||
|
||||
@@ -168,7 +166,7 @@ public class PersonalContractingPartyApplication : IPersonalContractingPartyApp
|
||||
{
|
||||
|
||||
var opration = new OperationResult();
|
||||
if (_personalContractingPartyRepository.Exists(x =>
|
||||
if (_personalContractingPartyRepository2.Exists(x =>
|
||||
x.LName == command.LName && x.RegisterId == command.RegisterId && x.SureName == command.SureName))
|
||||
return opration.Failed("امکان ثبت رکورد تکراری وجود ندارد");
|
||||
if (command.RepresentativeId < 1)
|
||||
@@ -176,23 +174,23 @@ public class PersonalContractingPartyApplication : IPersonalContractingPartyApp
|
||||
|
||||
|
||||
|
||||
if (_personalContractingPartyRepository.Exists(x => x.LName == command.LName && x.SureName == command.SureName))
|
||||
if (_personalContractingPartyRepository2.Exists(x => x.LName == command.LName && x.SureName == command.SureName))
|
||||
{
|
||||
legalNameIsOk = false;
|
||||
return opration.Failed("نام شرکت وارد شده تکراری است");
|
||||
}
|
||||
if (_personalContractingPartyRepository.Exists(x => x.RegisterId == command.RegisterId && x.LName != command.LName))
|
||||
if (_personalContractingPartyRepository2.Exists(x => x.RegisterId == command.RegisterId && x.LName != command.LName))
|
||||
{
|
||||
registerIdIsOk = false;
|
||||
return opration.Failed("شماره ثبت وارد شده تکراری است");
|
||||
|
||||
}
|
||||
if (_personalContractingPartyRepository.Exists(x => x.NationalId == command.NationalId && x.LName != command.LName))
|
||||
if (_personalContractingPartyRepository2.Exists(x => x.NationalId == command.NationalId && x.LName != command.LName))
|
||||
{
|
||||
nationalIdIsOk = false;
|
||||
return opration.Failed("شناسه ملی وارد شده تکراری است");
|
||||
}
|
||||
if (_personalContractingPartyRepository.Exists(x => x.ArchiveCode == command.ArchiveCode))
|
||||
if (_personalContractingPartyRepository2.Exists(x => x.ArchiveCode == command.ArchiveCode))
|
||||
return opration.Failed("کد طرف حساب تکراری است");
|
||||
|
||||
|
||||
@@ -206,8 +204,8 @@ public class PersonalContractingPartyApplication : IPersonalContractingPartyApp
|
||||
command.State, command.City, command.Zone,command.SureName);
|
||||
|
||||
|
||||
_personalContractingPartyRepository.Create(legalContractingParty);
|
||||
_personalContractingPartyRepository.SaveChanges();
|
||||
_personalContractingPartyRepository2.Create(legalContractingParty);
|
||||
_personalContractingPartyRepository2.SaveChanges();
|
||||
|
||||
return opration.Succcedded();
|
||||
|
||||
@@ -225,15 +223,15 @@ public class PersonalContractingPartyApplication : IPersonalContractingPartyApp
|
||||
{
|
||||
|
||||
var opration = new OperationResult();
|
||||
var personalContractingParty = _personalContractingPartyRepository.Get(command.Id);
|
||||
var personalContractingParty = _personalContractingPartyRepository2.Get(command.Id);
|
||||
if (personalContractingParty == null)
|
||||
return opration.Failed("رکورد مورد نظر یافت نشد");
|
||||
if (command.RepresentativeId < 1)
|
||||
return opration.Failed("لطفا معرف را انتخاب کنید");
|
||||
if (_personalContractingPartyRepository.Exists(x =>
|
||||
if (_personalContractingPartyRepository2.Exists(x =>
|
||||
x.LName == command.LName && x.Nationalcode == command.Nationalcode && x.SureName == command.SureName && x.id != command.Id))
|
||||
return opration.Failed("امکان ثبت رکورد تکراری وجود ندارد");
|
||||
if (_personalContractingPartyRepository.Exists(x => x.ArchiveCode == command.ArchiveCode && x.id != command.Id))
|
||||
if (_personalContractingPartyRepository2.Exists(x => x.ArchiveCode == command.ArchiveCode && x.id != command.Id))
|
||||
return opration.Failed("کد طرف حساب تکراری است");
|
||||
try
|
||||
{
|
||||
@@ -302,7 +300,7 @@ public class PersonalContractingPartyApplication : IPersonalContractingPartyApp
|
||||
command.Phone, command.AgentPhone, command.Address, command.RepresentativeId, representative.FullName, command.ArchiveCode,
|
||||
command.State, command.City, command.Zone,command.SureName);
|
||||
|
||||
_personalContractingPartyRepository.SaveChanges();
|
||||
_personalContractingPartyRepository2.SaveChanges();
|
||||
return opration.Succcedded();
|
||||
}
|
||||
else
|
||||
@@ -316,16 +314,16 @@ public class PersonalContractingPartyApplication : IPersonalContractingPartyApp
|
||||
{
|
||||
|
||||
var opration = new OperationResult();
|
||||
var legalContractingParty = _personalContractingPartyRepository.Get(command.Id);
|
||||
var legalContractingParty = _personalContractingPartyRepository2.Get(command.Id);
|
||||
if (legalContractingParty == null)
|
||||
return opration.Failed("رکورد مورد نظر یافت نشد");
|
||||
|
||||
if (_personalContractingPartyRepository.Exists(x =>
|
||||
if (_personalContractingPartyRepository2.Exists(x =>
|
||||
x.LName== command.LName && x.RegisterId == command.RegisterId &&x.SureName == command.SureName &&x.id != command.Id))
|
||||
return opration.Failed("امکان ثبت رکورد تکراری وجود ندارد");
|
||||
if (command.RepresentativeId < 1)
|
||||
return opration.Failed("لطفا معرف را انتخاب کنید");
|
||||
if (_personalContractingPartyRepository.Exists(x => x.ArchiveCode == command.ArchiveCode && x.id != command.Id))
|
||||
if (_personalContractingPartyRepository2.Exists(x => x.ArchiveCode == command.ArchiveCode && x.id != command.Id))
|
||||
return opration.Failed("کد طرف حساب تکراری است");
|
||||
var representative = _representativeApplication.GetDetails(command.RepresentativeId);
|
||||
legalContractingParty.EditLegal(command.LName, command.RegisterId,
|
||||
@@ -333,54 +331,54 @@ public class PersonalContractingPartyApplication : IPersonalContractingPartyApp
|
||||
command.Phone, command.AgentPhone, command.Address, command.RepresentativeId, representative.FullName,command.ArchiveCode,
|
||||
command.State, command.City, command.Zone, command.SureName);
|
||||
|
||||
_personalContractingPartyRepository.SaveChanges();
|
||||
_personalContractingPartyRepository2.SaveChanges();
|
||||
return opration.Succcedded();
|
||||
}
|
||||
|
||||
public EditPersonalContractingParty GetDetails(long id)
|
||||
{
|
||||
return _personalContractingPartyRepository.GetDetails(id);
|
||||
return _personalContractingPartyRepository2.GetDetails(id);
|
||||
}
|
||||
|
||||
public string IsBlockByEmployerId(long employerId)
|
||||
{
|
||||
return _personalContractingPartyRepository.IsBlockByEmployerId(employerId);
|
||||
return _personalContractingPartyRepository2.IsBlockByEmployerId(employerId);
|
||||
}
|
||||
|
||||
public EditPersonalContractingParty GetDetailsToEdit(long id)
|
||||
{
|
||||
return _personalContractingPartyRepository.GetDetailsToEdit(id);
|
||||
return _personalContractingPartyRepository2.GetDetailsToEdit(id);
|
||||
|
||||
}
|
||||
|
||||
public string GetFullName(long id)
|
||||
{
|
||||
return _personalContractingPartyRepository.GetFullName(id);
|
||||
return _personalContractingPartyRepository2.GetFullName(id);
|
||||
}
|
||||
|
||||
public List<PersonalContractingPartyViewModel> GetPersonalContractingParties()
|
||||
{
|
||||
return _personalContractingPartyRepository.GetPersonalContractingParties();
|
||||
return _personalContractingPartyRepository2.GetPersonalContractingParties();
|
||||
}
|
||||
|
||||
public List<PersonalContractingPartyViewModel> Search(PersonalContractingPartySearchModel searchModel2)
|
||||
{
|
||||
return _personalContractingPartyRepository.Search(searchModel2);
|
||||
return _personalContractingPartyRepository2.Search(searchModel2);
|
||||
}
|
||||
|
||||
public int GetLastArchiveCode()
|
||||
{
|
||||
return _personalContractingPartyRepository.GetLastArchiveCode();
|
||||
return _personalContractingPartyRepository2.GetLastArchiveCode();
|
||||
}
|
||||
#region Mahan
|
||||
public List<string> SearchByName(string name)
|
||||
{
|
||||
return _personalContractingPartyRepository.SearchByName(name);
|
||||
return _personalContractingPartyRepository2.SearchByName(name);
|
||||
}
|
||||
#endregion
|
||||
public ContractingPartyAndStatmentIdViewModel GetContractingpartyIdByAccountId(long accountId)
|
||||
{
|
||||
return _personalContractingPartyRepository.GetContractingpartyIdByAccountId(accountId);
|
||||
return _personalContractingPartyRepository2.GetContractingpartyIdByAccountId(accountId);
|
||||
}
|
||||
|
||||
|
||||
@@ -388,15 +386,15 @@ public class PersonalContractingPartyApplication : IPersonalContractingPartyApp
|
||||
|
||||
public List<PersonalContractingPartyViewModel> GetPersonalContractingPartiesForNationalcode(string searchText)
|
||||
{
|
||||
return _personalContractingPartyRepository.GetPersonalContractingPartiesForNationalcode(searchText);
|
||||
return _personalContractingPartyRepository2.GetPersonalContractingPartiesForNationalcode(searchText);
|
||||
|
||||
}
|
||||
public List<PersonalContractingPartyViewModel> SearchForMain(PersonalContractingPartySearchModel searchModel2)
|
||||
{
|
||||
var result= _personalContractingPartyRepository.SearchForMain(searchModel2);
|
||||
var result= _personalContractingPartyRepository2.SearchForMain(searchModel2);
|
||||
foreach (var item in result)
|
||||
{
|
||||
item.HasInstitutionContract = _personalContractingPartyRepository.GetHasContract(item.id);
|
||||
item.HasInstitutionContract = _personalContractingPartyRepository2.GetHasContract(item.id);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -413,12 +411,12 @@ public class PersonalContractingPartyApplication : IPersonalContractingPartyApp
|
||||
//اونهایی که کارفرما یا قرارداد غیر فعال دارند غیر فعال می شوند
|
||||
if (_employerRepository.Exists(x => x.ContractingPartyId == id)|| _institutionContractRepository.Exists(x => x.ContractingPartyId == id))
|
||||
{
|
||||
opration= _personalContractingPartyRepository.DeActiveAll(id);
|
||||
opration= _personalContractingPartyRepository2.DeActiveAll(id);
|
||||
return opration;
|
||||
}
|
||||
else
|
||||
{
|
||||
opration = _personalContractingPartyRepository.DeletePersonalContractingParties(id);
|
||||
opration = _personalContractingPartyRepository2.DeletePersonalContractingParties(id);
|
||||
}
|
||||
|
||||
return opration;
|
||||
@@ -430,10 +428,10 @@ public class PersonalContractingPartyApplication : IPersonalContractingPartyApp
|
||||
{
|
||||
|
||||
var opration = new OperationResult();
|
||||
var contract = _personalContractingPartyRepository.Get(id);
|
||||
var contract = _personalContractingPartyRepository2.Get(id);
|
||||
if (contract == null)
|
||||
return opration.Failed("رکورد مورد نظر یافت نشد");
|
||||
return _personalContractingPartyRepository.ActiveAll(id);
|
||||
return _personalContractingPartyRepository2.ActiveAll(id);
|
||||
|
||||
|
||||
//var opration = new OperationResult();
|
||||
@@ -448,44 +446,44 @@ public class PersonalContractingPartyApplication : IPersonalContractingPartyApp
|
||||
public OperationResult DeActive(long id)
|
||||
{
|
||||
var opration = new OperationResult();
|
||||
var personalContracting = _personalContractingPartyRepository.Get(id);
|
||||
var personalContracting = _personalContractingPartyRepository2.Get(id);
|
||||
if (personalContracting == null)
|
||||
return opration.Failed("رکورد مورد نظر یافت نشد");
|
||||
|
||||
personalContracting.DeActive();
|
||||
|
||||
|
||||
_personalContractingPartyRepository.SaveChanges();
|
||||
_personalContractingPartyRepository2.SaveChanges();
|
||||
return opration.Succcedded();
|
||||
}
|
||||
public bool GetHasContract(long id)
|
||||
{
|
||||
|
||||
return _personalContractingPartyRepository.GetHasContract(id);
|
||||
return _personalContractingPartyRepository2.GetHasContract(id);
|
||||
|
||||
}
|
||||
|
||||
public OperationResult Block(long id)
|
||||
{
|
||||
var opration = new OperationResult();
|
||||
var contract = _personalContractingPartyRepository.Get(id);
|
||||
var contract = _personalContractingPartyRepository2.Get(id);
|
||||
if (contract == null)
|
||||
return opration.Failed("رکورد مورد نظر یافت نشد");
|
||||
contract.Block();
|
||||
|
||||
_personalContractingPartyRepository.SaveChanges();
|
||||
_personalContractingPartyRepository2.SaveChanges();
|
||||
return opration.Succcedded();
|
||||
}
|
||||
public OperationResult DisableBlock(long id)
|
||||
{
|
||||
var opration = new OperationResult();
|
||||
var personalContracting = _personalContractingPartyRepository.Get(id);
|
||||
var personalContracting = _personalContractingPartyRepository2.Get(id);
|
||||
if (personalContracting == null)
|
||||
return opration.Failed("رکورد مورد نظر یافت نشد");
|
||||
|
||||
int blockTimes = personalContracting.BlockTimes + 1;
|
||||
personalContracting.DisableBlock(blockTimes);
|
||||
_personalContractingPartyRepository.SaveChanges();
|
||||
_personalContractingPartyRepository2.SaveChanges();
|
||||
|
||||
|
||||
|
||||
@@ -501,225 +499,7 @@ public class PersonalContractingPartyApplication : IPersonalContractingPartyApp
|
||||
|
||||
public bool IsBlockCheckByWorkshopId(long workshopId)
|
||||
{
|
||||
return _personalContractingPartyRepository.IsBlockCheckByWorkshopId(workshopId);
|
||||
}
|
||||
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
#region Api
|
||||
|
||||
|
||||
public async Task<ICollection<ContractingPartyGetListViewModel>> GetList(
|
||||
ContractingPartyGetListSearchModel searchModel)
|
||||
{
|
||||
return await _personalContractingPartyRepository.GetList(searchModel);
|
||||
}
|
||||
|
||||
public async Task<List<ContractingPartySelectListViewModel>> GetSelectList()
|
||||
{
|
||||
return await _personalContractingPartyRepository.GetSelectList();
|
||||
}
|
||||
public async Task<OperationResult> CreateReal(CreateRealContractingParty command)
|
||||
{
|
||||
var operation = new OperationResult();
|
||||
|
||||
if (_personalContractingPartyRepository.Exists(x =>
|
||||
x.LName == command.LName && x.Nationalcode == command.NationalCode && x.SureName == command.SureName))
|
||||
return operation.Failed("امکان ثبت رکورد تکراری وجود ندارد");
|
||||
|
||||
if (command.RepresentativeId < 1)
|
||||
return operation.Failed("لطفا معرف را انتخاب کنید");
|
||||
|
||||
if (_personalContractingPartyRepository.Exists(x => x.Nationalcode == command.NationalCode && x.LName != command.LName))
|
||||
{
|
||||
nationalcodeIsOk = false;
|
||||
|
||||
return operation.Failed("کد ملی وارد شده تکراری است");
|
||||
}
|
||||
|
||||
|
||||
if (_personalContractingPartyRepository.Exists(x => x.ArchiveCode == command.ArchiveCode))
|
||||
return operation.Failed("کد طرف حساب تکراری است");
|
||||
|
||||
if (command.NationalCode.NationalCodeValid() != "valid")
|
||||
{
|
||||
return operation.Failed("کد ملی وارد شده نا معتبر است");
|
||||
}
|
||||
|
||||
var representative = _representativeApplication.GetDetails(command.RepresentativeId);
|
||||
var personalContractingParty = new PersonalContractingParty(command.FName, command.LName,
|
||||
command.NationalCode, command.IdNumber, "*", "*",
|
||||
"حقیقی",
|
||||
command.PhoneNumber, command.AgentPhone, command.Address, command.RepresentativeId, representative.FullName, command.ArchiveCode,
|
||||
command.State, command.City, command.Zone, command.SureName);
|
||||
|
||||
|
||||
await _personalContractingPartyRepository.CreateAsync(personalContractingParty);
|
||||
await _personalContractingPartyRepository.SaveChangesAsync();
|
||||
|
||||
return operation.Succcedded();
|
||||
}
|
||||
|
||||
public async Task<OperationResult> CreateLegal(CreateLegalContractingParty command)
|
||||
{
|
||||
var opration = new OperationResult();
|
||||
|
||||
if (_personalContractingPartyRepository.Exists(x =>
|
||||
x.LName == command.CompanyName && x.RegisterId == command.RegisterId && x.SureName == command.SureName))
|
||||
return opration.Failed("امکان ثبت رکورد تکراری وجود ندارد");
|
||||
|
||||
if (command.RepresentativeId < 1)
|
||||
return opration.Failed("لطفا معرف را انتخاب کنید");
|
||||
|
||||
if (_personalContractingPartyRepository.Exists(x =>
|
||||
x.LName == command.CompanyName && x.SureName == command.SureName))
|
||||
{
|
||||
legalNameIsOk = false;
|
||||
return opration.Failed("نام شرکت وارد شده تکراری است");
|
||||
}
|
||||
|
||||
if (_personalContractingPartyRepository.Exists(x =>
|
||||
x.RegisterId == command.RegisterId && x.LName != command.CompanyName))
|
||||
{
|
||||
registerIdIsOk = false;
|
||||
return opration.Failed("شماره ثبت وارد شده تکراری است");
|
||||
|
||||
}
|
||||
|
||||
if (_personalContractingPartyRepository.Exists(x =>
|
||||
x.NationalId == command.NationalId && x.LName != command.CompanyName))
|
||||
{
|
||||
nationalIdIsOk = false;
|
||||
return opration.Failed("شناسه ملی وارد شده تکراری است");
|
||||
}
|
||||
|
||||
if (_personalContractingPartyRepository.Exists(x => x.ArchiveCode == command.ArchiveCode))
|
||||
return opration.Failed("کد طرف حساب تکراری است");
|
||||
|
||||
|
||||
|
||||
var representative = _representativeApplication.GetDetails(command.RepresentativeId);
|
||||
var legalContractingParty = new PersonalContractingParty("*", command.CompanyName,
|
||||
"*", "*", command.RegisterId, command.NationalId,
|
||||
"حقوقی",
|
||||
command.PhoneNumber, command.AgentPhone, command.Address, command.RepresentativeId, representative.FullName,
|
||||
command.ArchiveCode,
|
||||
command.State, command.City, command.Zone, command.SureName);
|
||||
|
||||
|
||||
await _personalContractingPartyRepository.CreateAsync(legalContractingParty);
|
||||
await _personalContractingPartyRepository.SaveChangesAsync();
|
||||
|
||||
return opration.Succcedded();
|
||||
|
||||
}
|
||||
|
||||
public async Task<List<GetContractingPartyNationalCodeOrNationalIdViewModel>> GetNationalCodeOrNationalId()
|
||||
{
|
||||
return await _personalContractingPartyRepository.GetNationalCodeOrNationalId();
|
||||
}
|
||||
|
||||
public async Task<OperationResult<string>> Delete(long id)
|
||||
{
|
||||
var operationResult = new OperationResult<string>();
|
||||
|
||||
try
|
||||
{
|
||||
//اگر دارای قرارداد یا دازای کارفرما باشد غیر فعال می شود
|
||||
if (_employerRepository.Exists(x => x.ContractingPartyId == id) || _institutionContractRepository.Exists(x => x.ContractingPartyId == id))
|
||||
{
|
||||
operationResult = await _personalContractingPartyRepository.DeactivateWithSubordinates(id);
|
||||
return operationResult;
|
||||
}
|
||||
|
||||
var entity = _personalContractingPartyRepository.Get(id);
|
||||
_personalContractingPartyRepository.Remove(entity);
|
||||
operationResult.Succcedded("Deleted");
|
||||
}
|
||||
catch
|
||||
{
|
||||
return operationResult.Failed("خطایی رخ داده است");
|
||||
}
|
||||
|
||||
return operationResult;
|
||||
}
|
||||
|
||||
public OperationResult EditRealApi(EditRealContractingParty command)
|
||||
{
|
||||
var opration = new OperationResult();
|
||||
var personalContractingParty = _personalContractingPartyRepository.Get(command.Id);
|
||||
|
||||
if (personalContractingParty == null)
|
||||
return opration.Failed("رکورد مورد نظر یافت نشد");
|
||||
|
||||
if (command.RepresentativeId < 1)
|
||||
return opration.Failed("لطفا معرف را انتخاب کنید");
|
||||
|
||||
if (_personalContractingPartyRepository.Exists(x =>
|
||||
x.LName == command.LName && x.Nationalcode == command.NationalCode && x.SureName == command.SureName && x.id != command.Id))
|
||||
return opration.Failed("امکان ثبت رکورد تکراری وجود ندارد");
|
||||
|
||||
if (_personalContractingPartyRepository.Exists(x => x.ArchiveCode == command.ArchiveCode && x.id != command.Id))
|
||||
return opration.Failed("کد طرف حساب تکراری است");
|
||||
|
||||
if (command.NationalCode.NationalCodeValid() != "valid")
|
||||
{
|
||||
return opration.Failed("کد ملی وارد شده نا معتبر است");
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
var representative = _representativeApplication.GetDetails(command.RepresentativeId);
|
||||
personalContractingParty.Edit(command.FName, command.LName,
|
||||
command.NationalCode, command.IdNumber,
|
||||
command.PhoneNumber, command.AgentPhone, command.Address, command.RepresentativeId, representative.FullName, command.ArchiveCode,
|
||||
command.State, command.City, command.Zone, command.SureName);
|
||||
|
||||
_personalContractingPartyRepository.SaveChanges();
|
||||
return opration.Succcedded();
|
||||
}
|
||||
catch
|
||||
{
|
||||
|
||||
return opration.Failed("خطایی رخ داده است");
|
||||
}
|
||||
}
|
||||
|
||||
public OperationResult EditLegal(EditLegalContractingParty command)
|
||||
{
|
||||
var opration = new OperationResult();
|
||||
var legalContractingParty = _personalContractingPartyRepository.Get(command.Id);
|
||||
if (legalContractingParty == null)
|
||||
return opration.Failed("رکورد مورد نظر یافت نشد");
|
||||
|
||||
if (_personalContractingPartyRepository.Exists(x =>
|
||||
x.LName == command.CompanyName && x.RegisterId == command.RegisterId && x.SureName == command.SureName && x.id != command.Id))
|
||||
return opration.Failed("امکان ثبت رکورد تکراری وجود ندارد");
|
||||
if (command.RepresentativeId < 1)
|
||||
return opration.Failed("لطفا معرف را انتخاب کنید");
|
||||
if (_personalContractingPartyRepository.Exists(x => x.ArchiveCode == command.ArchiveCode && x.id != command.Id))
|
||||
return opration.Failed("کد طرف حساب تکراری است");
|
||||
var representative = _representativeApplication.GetDetails(command.RepresentativeId);
|
||||
legalContractingParty.EditLegal(command.CompanyName, command.RegisterId,
|
||||
command.NationalId,
|
||||
command.PhoneNumber, command.AgentPhone, command.Address, command.RepresentativeId, representative.FullName, command.ArchiveCode,
|
||||
command.State, command.City, command.Zone, command.SureName);
|
||||
|
||||
_personalContractingPartyRepository.SaveChanges();
|
||||
return opration.Succcedded();
|
||||
}
|
||||
|
||||
public async Task<GetRealContractingPartyDetailsViewModel> GetRealDetails(long id)
|
||||
{
|
||||
return await _personalContractingPartyRepository.GetRealDetails(id);
|
||||
}
|
||||
|
||||
public async Task<GetLegalContractingPartyDetailsViewModel> GetLegalDetails(long id)
|
||||
{
|
||||
return await _personalContractingPartyRepository.GetLegalDetails(id);
|
||||
return _personalContractingPartyRepository2.IsBlockCheckByWorkshopId(workshopId);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -67,7 +67,7 @@ public class TemporaryClientRegistrationApplication : ITemporaryClientRegistrati
|
||||
return op.Failed("شماره همراه نا معتبر است");
|
||||
|
||||
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
@@ -141,8 +141,6 @@ public class TemporaryClientRegistrationApplication : ITemporaryClientRegistrati
|
||||
result.FName = createTemp.FName;
|
||||
result.LName = createTemp.LName;
|
||||
result.DateOfBirthFa = dateOfBirth;
|
||||
result.FatherName = createTemp.FatherName;
|
||||
result.IdNumberSerial = createTemp.IdNumberSerial;
|
||||
result.IdNumber = idNumber;
|
||||
|
||||
return op.Succcedded(result);
|
||||
@@ -190,7 +188,7 @@ public class TemporaryClientRegistrationApplication : ITemporaryClientRegistrati
|
||||
/// </summary>
|
||||
/// <param name="command"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<OperationResult> CreateOrUpdateWorkshopTemp(List<WorkshopTempViewModel> command, long contractingPartyTempId)
|
||||
public async Task<OperationResult> CreateOrUpdateWorkshopTemp(List<WorkshopTempViewModel> command)
|
||||
{
|
||||
var op = new OperationResult();
|
||||
var updateWorkshopList = command.Where(x => x.Id > 0).ToList();
|
||||
@@ -198,17 +196,10 @@ public class TemporaryClientRegistrationApplication : ITemporaryClientRegistrati
|
||||
|
||||
if (updateWorkshopList.Count == 0 && createNewWorkshopList.Count == 0)
|
||||
return op.Failed("هیچ مجموعه ای ایجاد نشده است");
|
||||
var oldWorkshops = await _workshopTempRepository.GetWorkshopTemp(contractingPartyTempId);
|
||||
|
||||
#region Update
|
||||
if (updateWorkshopList.Count > 0)
|
||||
{
|
||||
var updateListIds = updateWorkshopList.Select(x => x.Id).ToList();
|
||||
var oldWorkshopsIds = oldWorkshops.Select(x => x.Id).ToList();
|
||||
var exceptWorkshops = oldWorkshopsIds.Except(updateListIds).ToList();
|
||||
if (exceptWorkshops.Any())
|
||||
await _workshopTempRepository.RemoveWorkshopTemps(exceptWorkshops);
|
||||
|
||||
|
||||
foreach (var workshop in updateWorkshopList)
|
||||
{
|
||||
@@ -221,7 +212,6 @@ public class TemporaryClientRegistrationApplication : ITemporaryClientRegistrati
|
||||
workshop.RollCall == false && workshop.Insurance == false)
|
||||
op.Failed($"برای مجموعه {workshop.WorkshopName} هیچ سرویسی انتخاب نشده است");
|
||||
var existWorkshops = _workshopTempRepository.Get(workshop.Id);
|
||||
|
||||
if (existWorkshops != null)
|
||||
{
|
||||
if (workshop.ContractAndCheckout)
|
||||
@@ -266,8 +256,6 @@ public class TemporaryClientRegistrationApplication : ITemporaryClientRegistrati
|
||||
if (workshop.CustomizeCheckout)
|
||||
await _workshopServicesTempRepository.CreateAsync(
|
||||
new WorkshopServicesTemp("CustomizeCheckout", workshop.CountPerson, workshop.Id));
|
||||
|
||||
await _workshopServicesTempRepository.SaveChangesAsync();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -336,8 +324,6 @@ public class TemporaryClientRegistrationApplication : ITemporaryClientRegistrati
|
||||
if (workshop.CustomizeCheckout)
|
||||
await _workshopServicesTempRepository.CreateAsync(
|
||||
new WorkshopServicesTemp("CustomizeCheckout", workshop.CountPerson, createNewWorkshopTemp.id));
|
||||
|
||||
await _workshopServicesTempRepository.SaveChangesAsync();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -366,9 +352,8 @@ public class TemporaryClientRegistrationApplication : ITemporaryClientRegistrati
|
||||
/// </summary>
|
||||
/// <param name="contractingPartyTempId"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<ReviewAndPaymentViewModel> GetTotalPaymentAndWorkshopList(long contractingPartyTempId, string periodModel = "12", string paymentModel = "OneTime", string contractStartType = "currentMonth")
|
||||
public async Task<ReviewAndPaymentViewModel> GetTotalPaymentAndWorkshopList(long contractingPartyTempId, string periodModel = "12", string paymentModel = "OneTime")
|
||||
{
|
||||
|
||||
//دریافت کارگاه ها
|
||||
var workshops = await _workshopTempRepository.GetWorkshopTemp(contractingPartyTempId);
|
||||
|
||||
@@ -395,10 +380,9 @@ public class TemporaryClientRegistrationApplication : ITemporaryClientRegistrati
|
||||
_ => 12,
|
||||
};
|
||||
//رند کردن مبالغ کارگاه ها
|
||||
var roundAmount = (((Convert.ToInt64(totalPayment1MonthDouble))) / 1000000) * 1000000;
|
||||
double roundAmount2 = roundAmount;
|
||||
var roundAmount = (int)(totalPayment1MonthDouble / 1000000) * 1000000;
|
||||
//بدست آوردن جمع کل مبالغ کارگاه بر اساس مدت قراداد
|
||||
result.SumOfWorkshopsPaymentDouble = months * roundAmount2;
|
||||
result.SumOfWorkshopsPaymentDouble = roundAmount * months;
|
||||
result.SumOfWorkshopsPaymentPaymentStr = result.SumOfWorkshopsPaymentDouble.ToMoney();
|
||||
|
||||
|
||||
@@ -410,112 +394,31 @@ public class TemporaryClientRegistrationApplication : ITemporaryClientRegistrati
|
||||
//مالیات
|
||||
result.ValueAddedTaxDouble = tenPercent;
|
||||
result.ValueAddedTaxSt = tenPercent.ToMoney();
|
||||
//پرداخت یکجا
|
||||
#region OneTimePaymentResult
|
||||
|
||||
double discountOneTimePeyment = result.SumOfWorkshopsPaymentDouble - tenPercent;
|
||||
|
||||
|
||||
//مبلغ بدون مالیات و با تخفیف
|
||||
result.OneTimeWithoutTaxPaymentDouble = discountOneTimePeyment;
|
||||
result.OneTimeWithoutTaxPaymentStr = discountOneTimePeyment.ToMoney();
|
||||
|
||||
//مبلغ با مالیات
|
||||
result.OneTimeTotalPaymentDouble = discountOneTimePeyment + tenPercent;
|
||||
result.OneTimeTotalPaymentStr = result.OneTimeTotalPaymentDouble.ToMoney();
|
||||
|
||||
#endregion
|
||||
|
||||
//پرداخت ماهیانه
|
||||
#region MonthlyPaymentResult
|
||||
|
||||
//مبلغ بدون مالیات
|
||||
result.MonthlyWithoutTaxPaymentDouble = result.SumOfWorkshopsPaymentDouble;
|
||||
result.MonthlyWithoutTaxPaymentStr = result.SumOfWorkshopsPaymentDouble.ToMoney();
|
||||
|
||||
// مبلغ با مالیات
|
||||
result.MonthlyTotalPaymentDouble = result.SumOfWorkshopsPaymentDouble + tenPercent;
|
||||
result.MonthlyTotalPaymentStr = result.MonthlyTotalPaymentDouble.ToMoney();
|
||||
var installmentList = new List<MonthlyInstallment>();
|
||||
|
||||
var startDate = (DateTime.Now).ToFarsi();
|
||||
result.ContractStartCurrentMonthFa = $"{startDate.Substring(0, 8)}01";
|
||||
result.ContractStartCurrentMonthGr = result.ContractStartCurrentMonthFa.ToGeorgianDateTime();
|
||||
startDate = result.ContractStartCurrentMonthFa;
|
||||
|
||||
result.ContractStartNextMonthGr = ((startDate.FindeEndOfMonth()).ToGeorgianDateTime()).AddDays(1);
|
||||
result.ContractStartNextMonthFa = result.ContractStartNextMonthGr.ToFarsi();
|
||||
|
||||
if (contractStartType == "nextMonth")
|
||||
startDate = result.ContractStartNextMonthFa;
|
||||
|
||||
|
||||
|
||||
var findeEnd = Tools.FindEndOfContract(startDate, periodModel);
|
||||
var contractEndDate = findeEnd.endDateGr;
|
||||
result.ContractEndGr = contractEndDate;
|
||||
result.ContractEndFa = contractEndDate.ToFarsi();
|
||||
|
||||
if (periodModel == "1")
|
||||
if (paymentModel == "OneTime")//تخفیف 10 درصدی درصورت پرداخت یکجا
|
||||
{
|
||||
|
||||
installmentList.Add(new MonthlyInstallment()
|
||||
{
|
||||
InstallmentAmountStr = result.MonthlyTotalPaymentStr,
|
||||
InstallmentCounter = "سررسید پرداخت اول",
|
||||
InstalmentDate = (DateTime.Now).ToFarsi()
|
||||
double discountOneTimePeyment = result.SumOfWorkshopsPaymentDouble - tenPercent;
|
||||
|
||||
|
||||
});
|
||||
result.MonthlyInstallments = installmentList;
|
||||
//مبلغ بدون مالیات و با تخفیف
|
||||
result.WithoutTaxPaymentDouble = discountOneTimePeyment;
|
||||
result.WithoutTaxPaymentStr = discountOneTimePeyment.ToMoney();
|
||||
|
||||
//مبلغ با مالیات
|
||||
result.TotalPaymentDouble = discountOneTimePeyment + tenPercent;
|
||||
result.TotalPaymentStr = result.TotalPaymentDouble.ToMoney();
|
||||
}
|
||||
else
|
||||
{
|
||||
int instalmentCount = Convert.ToInt32(periodModel);
|
||||
var instalmentAmount = result.MonthlyTotalPaymentDouble / instalmentCount;
|
||||
var findEndOfMonth = startDate.FindeEndOfMonth();
|
||||
for (int i = 1; i <= instalmentCount; i++)
|
||||
{
|
||||
if (i == 1)
|
||||
{
|
||||
startDate = (DateTime.Now).ToFarsi();
|
||||
|
||||
}
|
||||
else if (i > 1)
|
||||
{
|
||||
var currentMonthStart = ((findEndOfMonth.ToGeorgianDateTime()).AddDays(1)).ToFarsi();
|
||||
startDate = currentMonthStart.FindeEndOfMonth();
|
||||
findEndOfMonth = startDate;
|
||||
}
|
||||
|
||||
installmentList.Add(new MonthlyInstallment()
|
||||
{
|
||||
InstallmentAmountStr = instalmentAmount.ToMoney(),
|
||||
InstallmentCounter = i switch
|
||||
{
|
||||
1 => "سررسید پرداخت اول",
|
||||
2 => "سررسید پرداخت دوم",
|
||||
3 => "سررسید پرداخت سوم",
|
||||
4 => "سررسید پرداخت چهارم",
|
||||
5 => "سررسید پرداخت پنجم",
|
||||
6 => "سررسید پرداخت ششم",
|
||||
7 => "سررسید پرداخت هفتم",
|
||||
8 => "سررسید پرداخت هشتم",
|
||||
9 => "سررسید پرداخت نهم",
|
||||
10 => "سررسید پرداخت دهم",
|
||||
11 => "سررسید پرداخت یازدهم",
|
||||
12 => "سررسید پرداخت دوازدهم",
|
||||
_ => "سررسید پرداخت دوازدهم",
|
||||
},
|
||||
InstalmentDate = startDate
|
||||
|
||||
});
|
||||
}
|
||||
//مبلغ بدون مالیات
|
||||
result.WithoutTaxPaymentDouble = result.SumOfWorkshopsPaymentDouble;
|
||||
result.WithoutTaxPaymentStr = result.SumOfWorkshopsPaymentDouble.ToMoney();
|
||||
|
||||
// مبلغ با مالیات
|
||||
result.TotalPaymentDouble = result.SumOfWorkshopsPaymentDouble + tenPercent;
|
||||
result.TotalPaymentStr = result.TotalPaymentDouble.ToMoney();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
result.MonthlyInstallments = installmentList;
|
||||
result.ContractingPartTempId = contractingPartyTempId;
|
||||
|
||||
return result;
|
||||
@@ -527,21 +430,19 @@ public class TemporaryClientRegistrationApplication : ITemporaryClientRegistrati
|
||||
/// </summary>
|
||||
/// <param name="contractingPartyTempId"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<OperationResult> CreateOrUpdateInstitutionContractTemp(long contractingPartyTempId, string periodModel, string paymentModel, double totalPayment, double valueAddedTax, DateTime contractStart)
|
||||
public async Task<OperationResult> CreateOrUpdateInstitutionContractTemp(long contractingPartyTempId, string periodModel, string paymentModel, double totalPayment, double valueAddedTax)
|
||||
{
|
||||
|
||||
var op = new OperationResult();
|
||||
var institutionContractTemp = await
|
||||
_institutionContractTempRepository.GetInstitutionContractTemp(0, contractingPartyTempId);
|
||||
var contractStartDate = contractStart;
|
||||
string contractStartFa = contractStart.ToFarsi();
|
||||
var findeEnd = Tools.FindEndOfContract(contractStartFa, periodModel);
|
||||
var contractEndDate = findeEnd.endDateGr;
|
||||
|
||||
if (institutionContractTemp == null)
|
||||
{
|
||||
var periodModelInt = Convert.ToInt32(periodModel);
|
||||
|
||||
var create = new InstitutionContractTemp(contractingPartyTempId, paymentModel, periodModel, totalPayment, contractStartDate, contractEndDate, "official", valueAddedTax, "", "BeforeSendVerifyCode", 0, null, null);
|
||||
var contractstart = DateTime.Now;
|
||||
var contractEnd = DateTime.Now.AddMonths(periodModelInt);
|
||||
var create = new InstitutionContractTemp(contractingPartyTempId,paymentModel,periodModel,totalPayment,contractstart,contractEnd,"official", valueAddedTax,"", "BeforeSendVerifyCode", 0,null,null);
|
||||
_institutionContractTempRepository.Create(create);
|
||||
_institutionContractTempRepository.SaveChanges();
|
||||
return op.Succcedded();
|
||||
@@ -550,20 +451,20 @@ public class TemporaryClientRegistrationApplication : ITemporaryClientRegistrati
|
||||
{
|
||||
if (institutionContractTemp.VerifyCodeEndTime != null)
|
||||
{
|
||||
var spaning = (DateTime.Now - institutionContractTemp.VerifyCodeEndTime.Value);
|
||||
var spaning = (institutionContractTemp.VerifyCodeEndTime.Value - DateTime.Now);
|
||||
if (institutionContractTemp.RegistrationStatus == "VerifyCodeSent" && spaning > new TimeSpan(0, 0, 0) && spaning < new TimeSpan(0, 1, 0))
|
||||
return op.Failed("شما به تازگی پیامک دریافت نموده اید دو دقیقه صبر کنید و دوباره تلاش کنید");
|
||||
}
|
||||
|
||||
|
||||
if (institutionContractTemp.RegistrationStatus == "Completed")
|
||||
return op.Failed("شما قبلا ثبت نام خود را تکمیل نموده اید");
|
||||
|
||||
|
||||
|
||||
var periodModelInt = Convert.ToInt32(periodModel);
|
||||
var contractstart = DateTime.Now;
|
||||
var contractEnd = DateTime.Now.AddMonths(periodModelInt);
|
||||
var update = _institutionContractTempRepository.Get(institutionContractTemp.Id);
|
||||
update.Edit(contractingPartyTempId, paymentModel, periodModel, totalPayment, contractStartDate, contractEndDate, "official", valueAddedTax, "", "BeforeSendVerifyCode", 0, null, null);
|
||||
update.Edit(contractingPartyTempId, paymentModel, periodModel, totalPayment, contractstart, contractEnd, "official", valueAddedTax, "", "BeforeSendVerifyCode", 0, null, null);
|
||||
_institutionContractTempRepository.SaveChanges();
|
||||
return op.Succcedded();
|
||||
}
|
||||
@@ -582,14 +483,14 @@ public class TemporaryClientRegistrationApplication : ITemporaryClientRegistrati
|
||||
{
|
||||
|
||||
var op = new OperationResult();
|
||||
var institutionContractTemp = await
|
||||
var institutionContractTemp = await
|
||||
_institutionContractTempRepository.GetInstitutionContractTemp(0, contractingPartyTempId);
|
||||
if (institutionContractTemp == null)
|
||||
return op.Failed("خطا");
|
||||
return op.Failed("خظا");
|
||||
|
||||
var update = _institutionContractTempRepository.Get(institutionContractTemp.Id);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if (institutionContractTemp.RegistrationStatus == "BeforeSendVerifyCode")
|
||||
@@ -615,29 +516,26 @@ public class TemporaryClientRegistrationApplication : ITemporaryClientRegistrati
|
||||
return op.Succcedded(1, "کد برای شما پیامک شد");
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
if (institutionContractTemp.RegistrationStatus == "VerifyCodeSent")
|
||||
|
||||
{
|
||||
|
||||
if (DateTime.Now < institutionContractTemp.VerifyCodeEndTime.Value)
|
||||
return op.Failed("کد دریافت شده را وارد کنید");
|
||||
var spaning = (DateTime.Now - institutionContractTemp.VerifyCodeEndTime.Value);
|
||||
if ((spaning > new TimeSpan(0, 0, 0) && spaning < new TimeSpan(0, 1, 0)))
|
||||
var spaning = (institutionContractTemp.VerifyCodeEndTime.Value - DateTime.Now);
|
||||
if ((spaning > new TimeSpan(0, 0, 0) && spaning < new TimeSpan(0, 1, 0)))
|
||||
return op.Failed("شما به تازگی پیامک دریافت نموده اید دو دقیقه صبر کنید و دوباره تلاش کنید");
|
||||
|
||||
if ((spaning > new TimeSpan(0, 1, 0)))
|
||||
if ((spaning > new TimeSpan(0, 0, 0) && spaning > new TimeSpan(0, 1, 0)))
|
||||
{
|
||||
//ساخت کد شش رقمی
|
||||
Random generator = new Random();
|
||||
String code = generator.Next(1, 1000000).ToString("D6");
|
||||
//ارسال اس ام اس
|
||||
var getContractingPaty = _contractingPartyTempRepository.GetByContractingPartyTempId(contractingPartyTempId);
|
||||
var sendResult = await _smsService.SendVerifyCodeToClient(getContractingPaty.Phone, code);
|
||||
var sendResult =await _smsService.SendVerifyCodeToClient(getContractingPaty.Phone, code);
|
||||
|
||||
if (!sendResult.IsSuccedded)
|
||||
if(!sendResult.IsSuccedded)
|
||||
return op.Failed($"{sendResult.Message}");
|
||||
|
||||
|
||||
@@ -646,16 +544,16 @@ public class TemporaryClientRegistrationApplication : ITemporaryClientRegistrati
|
||||
//ذخیره تاریخ ارسال و مهلت پایان
|
||||
//ذخیره آیدی پیامک
|
||||
//تغییر وضعیت به ارسال شده
|
||||
|
||||
|
||||
if (update != null)
|
||||
{
|
||||
update.Update(code, "VerifyCodeSent", sendResult.MessageId, DateTime.Now, DateTime.Now.AddMinutes(2));
|
||||
update.Update(code, "VerifyCodeSent",sendResult.MessageId, DateTime.Now, DateTime.Now.AddMinutes(2));
|
||||
_institutionContractTempRepository.SaveChanges();
|
||||
return op.Succcedded(1, "کد برای شما پیامک شد");
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -682,25 +580,25 @@ public class TemporaryClientRegistrationApplication : ITemporaryClientRegistrati
|
||||
_institutionContractTempRepository.GetInstitutionContractTemp(0, contractingPartyTempId);
|
||||
if (institutionContractTemp == null)
|
||||
return op.Failed("خظا");
|
||||
if (institutionContractTemp.RegistrationStatus != "VerifyCodeSent")
|
||||
if(institutionContractTemp.RegistrationStatus != "VerifyCodeSent")
|
||||
return op.Failed("خطا");
|
||||
|
||||
if (institutionContractTemp.VerifyCodeEndTime < DateTime.Now)
|
||||
if(institutionContractTemp.VerifyCodeEndTime < DateTime.Now)
|
||||
return op.Failed("کد شما منقضی شده است");
|
||||
|
||||
if (institutionContractTemp.SendVerifyCodeTime < DateTime.Now && institutionContractTemp.VerifyCodeEndTime >= DateTime.Now)
|
||||
if(institutionContractTemp.SendVerifyCodeTime < DateTime.Now && institutionContractTemp.VerifyCodeEndTime >= DateTime.Now)
|
||||
{
|
||||
if (institutionContractTemp.VerifyCode == verifyCode)
|
||||
{
|
||||
|
||||
|
||||
|
||||
return op.Succcedded();
|
||||
}
|
||||
else
|
||||
{
|
||||
return op.Failed("کد وارد شده صحیح نیست");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -73,10 +73,28 @@ public class WorkshopAppliction : IWorkshopApplication
|
||||
if (string.IsNullOrEmpty(command.WorkshopName) || string.IsNullOrEmpty(command.ArchiveCode))
|
||||
return operation.Failed("موارد اجباری را پر کنید");
|
||||
|
||||
//if (_workshopRepository.Exists(x => x.WorkshopName == command.WorkshopName))
|
||||
// return operation.Failed("نام کارگاه تکراری است");
|
||||
//if (_workshopRepository.Exists(x => x.WorkshopName == command.WorkshopName))
|
||||
// return operation.Failed("نام کارگاه تکراری است");
|
||||
|
||||
if (_workshopRepository.Exists(x => !string.IsNullOrEmpty(x.InsuranceCode) && x.InsuranceCode == command.InsuranceCode))
|
||||
if (command.ContractTerm != "1" && command.ContractTerm != "ForEver" && (command.CutContractEndOfYear != IsActive.False && command.CutContractEndOfYear != IsActive.True))
|
||||
return operation.Failed("لطفا تیک قرداداد منتهی به پایان سال را تعیین وضعیت کنید");
|
||||
|
||||
if (command.ContractTerm == "1" && command.ContractTerm == "ForEver")
|
||||
command.CutContractEndOfYear = IsActive.None;
|
||||
if (!command.CreateContract)
|
||||
{
|
||||
command.SignContract = false;
|
||||
command.CreateCheckout = false;
|
||||
command.SignCheckout = false;
|
||||
}
|
||||
|
||||
if (!command.CreateCheckout)
|
||||
{
|
||||
command.SignCheckout = false;
|
||||
}
|
||||
|
||||
|
||||
if (_workshopRepository.Exists(x => !string.IsNullOrEmpty(x.InsuranceCode) && x.InsuranceCode == command.InsuranceCode))
|
||||
return operation.Failed("کد بیمه کارگاه تکراری است");
|
||||
|
||||
if (!string.IsNullOrEmpty(command.Address) && string.IsNullOrEmpty(command.State))
|
||||
@@ -145,7 +163,11 @@ public class WorkshopAppliction : IWorkshopApplication
|
||||
command.ArchiveCode, command.AgentName, command.AgentPhone, command.State, command.City,
|
||||
command.Address,
|
||||
command.TypeOfInsuranceSend, command.TypeOfContract,command.ContractTerm,command.AgreementNumber
|
||||
,command.FixedSalary, command.Population,command.InsuranceJobId,command.ZoneName,command.AddBonusesPay,command.AddYearsPay,command.AddLeavePay,command.TotalPaymentHide,command.IsClassified,command.ComputeOptions,command.BonusesOptions,command.YearsOptions,command.HasRollCallFreeVip,command.WorkshopHolidayWorking, command.InsuranceCheckoutOvertime, command.InsuranceCheckoutFamilyAllowance);
|
||||
,command.FixedSalary, command.Population,command.InsuranceJobId,command.ZoneName,command.AddBonusesPay,
|
||||
command.AddYearsPay,command.AddLeavePay,command.TotalPaymentHide,command.IsClassified,command.ComputeOptions,
|
||||
command.BonusesOptions,command.YearsOptions,command.HasRollCallFreeVip,command.WorkshopHolidayWorking,
|
||||
command.InsuranceCheckoutOvertime, command.InsuranceCheckoutFamilyAllowance, command.CreateContract, command.SignContract,
|
||||
command.CreateCheckout, command.SignCheckout, command.CutContractEndOfYear);
|
||||
_workshopRepository.Create(workshop);
|
||||
_workshopRepository.SaveChanges();
|
||||
|
||||
@@ -211,10 +233,28 @@ public class WorkshopAppliction : IWorkshopApplication
|
||||
return operation.Failed("لطفا کارفرما را انتخاب نمایید");
|
||||
var employer = command.EmployerIdList.ToList();
|
||||
|
||||
//if (_workshopRepository.Exists(x => x.WorkshopName == command.WorkshopName && x.id != command.Id))
|
||||
// return operation.Failed(" نام کارگاه تکراری است ");
|
||||
//if (_workshopRepository.Exists(x => x.WorkshopName == command.WorkshopName && x.id != command.Id))
|
||||
// return operation.Failed(" نام کارگاه تکراری است ");
|
||||
|
||||
if (command.TypeOfInsuranceSend != null && string.IsNullOrEmpty(command.InsuranceCode))
|
||||
if (command.ContractTerm != "1" && command.ContractTerm != "ForEver" && (command.CutContractEndOfYear != IsActive.False && command.CutContractEndOfYear != IsActive.True))
|
||||
return operation.Failed("لطفا تیک قرداداد منتهی به پایان سال را تعیین وضعیت کنید");
|
||||
|
||||
if (command.ContractTerm == "1" && command.ContractTerm == "ForEver")
|
||||
command.CutContractEndOfYear = IsActive.None;
|
||||
if (!command.CreateContract)
|
||||
{
|
||||
command.SignContract = false;
|
||||
command.CreateCheckout = false;
|
||||
command.SignCheckout = false;
|
||||
}
|
||||
|
||||
if (!command.CreateCheckout)
|
||||
{
|
||||
command.SignCheckout = false;
|
||||
}
|
||||
|
||||
|
||||
if (command.TypeOfInsuranceSend != null && string.IsNullOrEmpty(command.InsuranceCode))
|
||||
return operation.Failed("لطفا کد بیمه کارگاه را وارد کنید");
|
||||
if (_workshopRepository.Exists(x => !string.IsNullOrEmpty(x.InsuranceCode) && x.InsuranceCode == command.InsuranceCode && x.id != command.Id))
|
||||
return operation.Failed("کد بیمه کارگاه تکراری است");
|
||||
@@ -315,7 +355,10 @@ public class WorkshopAppliction : IWorkshopApplication
|
||||
command.Address,
|
||||
command.TypeOfInsuranceSend, command.TypeOfContract,command.ContractTerm, command.AgreementNumber
|
||||
, command.FixedSalary, command.Population, command.InsuranceJobId, command.ZoneName,
|
||||
command.AddBonusesPay, command.AddYearsPay, command.AddLeavePay, command.TotalPaymentHide,command.IsClassified, command.ComputeOptions,command.BonusesOptions, command.YearsOptions,command.HasRollCallFreeVip, command.WorkshopHolidayWorking, command.InsuranceCheckoutOvertime,command.InsuranceCheckoutFamilyAllowance);
|
||||
command.AddBonusesPay, command.AddYearsPay, command.AddLeavePay, command.TotalPaymentHide,command.IsClassified,
|
||||
command.ComputeOptions,command.BonusesOptions, command.YearsOptions,command.HasRollCallFreeVip,
|
||||
command.WorkshopHolidayWorking, command.InsuranceCheckoutOvertime,command.InsuranceCheckoutFamilyAllowance,
|
||||
command.CreateContract, command.SignContract, command.CreateCheckout, command.SignCheckout, command.CutContractEndOfYear);
|
||||
_workshopRepository.SaveChanges();
|
||||
|
||||
_workshopRepository.RemoveOldRelation(command.Id);
|
||||
@@ -535,159 +578,169 @@ public class WorkshopAppliction : IWorkshopApplication
|
||||
{
|
||||
return _workshopRepository.SearchForClient(searchModel);
|
||||
}
|
||||
|
||||
public OperationResult CreateForClient(CreateWorkshop command)
|
||||
{
|
||||
|
||||
var accountIds = new List<long>();
|
||||
var operation = new OperationResult();
|
||||
//if (command.EmployerIdList == null)
|
||||
// return operation.Failed("لطفا کارفرما را انتخاب نمایید");
|
||||
var employer = command.EmployerIdList.ToList();
|
||||
if (command.AccountIdsList != null)
|
||||
{
|
||||
accountIds = command.AccountIdsList.ToList();
|
||||
}
|
||||
|
||||
if (string.IsNullOrEmpty(command.WorkshopName) || string.IsNullOrEmpty(command.ArchiveCode) || command.ArchiveCode == "0")
|
||||
return operation.Failed("موارد اجباری را پر کنید");
|
||||
//if (_workshopRepository.Exists(x => x.WorkshopName == command.WorkshopName))
|
||||
// return operation.Failed("نام کارگاه تکراری است");
|
||||
if (_workshopRepository.Exists(x => x.InsuranceCode != null && x.InsuranceCode == command.InsuranceCode))
|
||||
{
|
||||
if (_workshopRepository.ExistsWorkshopAccountInsuranceCode(command.InsuranceCode))
|
||||
return operation.Failed("کد بیمه کارگاه تکراری است");
|
||||
}
|
||||
|
||||
if (_workshopRepository.ExistsWorkshopAccountArchiveCode(command.ArchiveCode))
|
||||
return operation.Failed("شماره بایگانی تکراری است");
|
||||
|
||||
if (string.IsNullOrEmpty(command.State)) //(!string.IsNullOrEmpty(command.Address) && string.IsNullOrEmpty(command.State))
|
||||
return operation.Failed("لطفا استان و شهر را انتخاب کنید");
|
||||
|
||||
if (command.City == "0" || command.City == "شهرستان")
|
||||
return operation.Failed("لطفا شهر را انتخاب کنید");
|
||||
if (string.IsNullOrEmpty(command.Address))
|
||||
return operation.Failed("لطفا آدرس را وارد کنید");
|
||||
|
||||
if (!string.IsNullOrEmpty(command.TypeOfInsuranceSend) && command.TypeOfInsuranceSend != "false" && string.IsNullOrEmpty(command.InsuranceCode))
|
||||
return operation.Failed("لطفا کد بیمه کارگاه را وارد کنید");
|
||||
|
||||
if (command.FixedSalary)
|
||||
{
|
||||
if (command.InsuranceJobId == 0 || command.InsuranceJobId == null)
|
||||
return operation.Failed("لطفا صنف را انتخاب کنید");
|
||||
if (string.IsNullOrWhiteSpace(command.Population))
|
||||
return operation.Failed("لطفا جمعیت شهر را انتخاب کنید");
|
||||
}
|
||||
|
||||
//if (string.IsNullOrWhiteSpace(command.TypeOfInsuranceSend))
|
||||
// return operation.Failed("لطفا نوع ارسال لیست بیمه را مشخص کنید");
|
||||
|
||||
var workshop = new Workshop(command.WorkshopName, command.WorkshopSureName, command.InsuranceCode,command.TypeOfOwnership,
|
||||
command.ArchiveCode, command.AgentName, command.AgentPhone, command.State, command.City, command.Address,
|
||||
command.TypeOfInsuranceSend, command.TypeOfContract, command.ContractTerm, command.AgreementNumber, command.FixedSalary,
|
||||
command.Population, command.InsuranceJobId, command.ZoneName, command.AddBonusesPay,
|
||||
command.AddYearsPay, command.AddLeavePay,command.TotalPaymentHide, command.IsClassified, command.ComputeOptions,
|
||||
command.BonusesOptions, command.YearsOptions,command.HasRollCallFreeVip, command.WorkshopHolidayWorking,
|
||||
command.InsuranceCheckoutOvertime,command.InsuranceCheckoutFamilyAllowance);
|
||||
_workshopRepository.Create(workshop);
|
||||
_workshopRepository.SaveChanges();
|
||||
|
||||
|
||||
|
||||
foreach (var e in employer)
|
||||
{
|
||||
_workshopRepository.EmployerWorkshop(workshop.id, e);
|
||||
}
|
||||
|
||||
|
||||
_workshopRepository.CreateWorkshopAccounts(accountIds, workshop.id);
|
||||
|
||||
|
||||
|
||||
return operation.Succcedded();
|
||||
|
||||
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public OperationResult EditForClient(EditWorkshop command)
|
||||
{
|
||||
var leftSearch = new LeftWorkSearchModel()
|
||||
{
|
||||
WorkshopId = command.Id
|
||||
};
|
||||
var leftWork = _leftWorkRepository.search(leftSearch);
|
||||
var accountIds = new List<long>();
|
||||
var operation = new OperationResult();
|
||||
var workshop = _workshopRepository.Get(command.Id);
|
||||
if (command.AccountIdsList != null)
|
||||
{
|
||||
accountIds = command.AccountIdsList.ToList();
|
||||
}
|
||||
if (workshop == null)
|
||||
operation.Failed("رکورد مورد نظر وجود ندارد");
|
||||
if (command.EmployerIdList == null)
|
||||
return operation.Failed("لطفا کارفرما را انتخاب نمایید");
|
||||
var employer = command.EmployerIdList.ToList();
|
||||
|
||||
if (string.IsNullOrEmpty(command.WorkshopName) || string.IsNullOrEmpty(command.ArchiveCode) || command.ArchiveCode == "0")
|
||||
return operation.Failed("موارد اجباری را پر کنید");
|
||||
|
||||
//if (_workshopRepository.Exists(x => x.WorkshopName == command.WorkshopName && x.id != command.Id))
|
||||
// return operation.Failed(" رکورد مورد نظر تکراری است ");
|
||||
if (_workshopRepository.Exists(x =>
|
||||
x.InsuranceCode != null && x.InsuranceCode == command.InsuranceCode && x.id != command.Id))
|
||||
{
|
||||
if (_workshopRepository.ExistsWorkshopAccountInsuranceCodeByworkshopId(command.Id, command.InsuranceCode))
|
||||
return operation.Failed("کد بیمه کارگاه تکراری است");
|
||||
}
|
||||
|
||||
if (_workshopRepository.ExistsWorkshopAccountArchiveCodeByWorkshopId(command.Id, command.ArchiveCode))
|
||||
return operation.Failed("شماره بایگانی تکراری است");
|
||||
|
||||
if (command.State == null)
|
||||
return operation.Failed("لطفا استان و شهر را انتخاب کنید");
|
||||
if ((command.City == "0" || command.City == "شهرستان"))
|
||||
return operation.Failed("لطفا شهر را انتخاب کنید");
|
||||
if (command.TypeOfInsuranceSend != null && command.InsuranceCode == null)
|
||||
return operation.Failed("لطفا کد بیمه کارگاه را وارد کنید");
|
||||
if (command.Address == null)
|
||||
return operation.Failed("لطفا آدرس را وارد کنید");
|
||||
if (command.FixedSalary)
|
||||
{
|
||||
if (command.InsuranceJobId == 0 || command.InsuranceJobId == null)
|
||||
return operation.Failed("لطفا صنف را انتخاب کنید");
|
||||
if (string.IsNullOrWhiteSpace(command.Population))
|
||||
return operation.Failed("لطفا جمعیت شهر را انتخاب کنید");
|
||||
}
|
||||
|
||||
workshop.Edit(command.WorkshopName, command.WorkshopSureName, command.InsuranceCode, command.TypeOfOwnership,
|
||||
command.ArchiveCode, command.AgentName, command.AgentPhone, command.State, command.City,
|
||||
command.Address,
|
||||
command.TypeOfInsuranceSend, command.TypeOfContract, command.ContractTerm, command.AgreementNumber
|
||||
, command.FixedSalary, command.Population, command.InsuranceJobId, command.ZoneName,
|
||||
command.AddBonusesPay, command.AddYearsPay, command.AddLeavePay,command.TotalPaymentHide,command.IsClassified,
|
||||
command.ComputeOptions, command.BonusesOptions, command.YearsOptions,command.HasRollCallFreeVip, command.WorkshopHolidayWorking,
|
||||
command.InsuranceCheckoutOvertime, command.InsuranceCheckoutFamilyAllowance);
|
||||
_workshopRepository.SaveChanges();
|
||||
|
||||
//_workshopRepository.RemoveOldRelation(command.Id);
|
||||
_workshopRepository.RemoveEmployerWorkshop(command.Id);
|
||||
foreach (var e in employer)
|
||||
{
|
||||
_workshopRepository.EmployerWorkshop(workshop.id, e);
|
||||
}
|
||||
// _workshopRepository.WorkshopAccounts(accountIds, workshop.id);
|
||||
foreach (var item in leftWork)
|
||||
{
|
||||
var editLeft = _leftWorkRepository.Get(item.Id);
|
||||
|
||||
editLeft.EditBonuses(command.AddBonusesPay, command.AddYearsPay, command.AddLeavePay);
|
||||
_leftWorkRepository.SaveChanges();
|
||||
}
|
||||
return operation.Succcedded();
|
||||
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
//public OperationResult CreateForClient(CreateWorkshop command)
|
||||
//{
|
||||
|
||||
// var accountIds = new List<long>();
|
||||
// var operation = new OperationResult();
|
||||
// //if (command.EmployerIdList == null)
|
||||
// // return operation.Failed("لطفا کارفرما را انتخاب نمایید");
|
||||
// var employer = command.EmployerIdList.ToList();
|
||||
// if (command.AccountIdsList != null)
|
||||
// {
|
||||
// accountIds = command.AccountIdsList.ToList();
|
||||
// }
|
||||
|
||||
// if (string.IsNullOrEmpty(command.WorkshopName) || string.IsNullOrEmpty(command.ArchiveCode) || command.ArchiveCode == "0")
|
||||
// return operation.Failed("موارد اجباری را پر کنید");
|
||||
// //if (_workshopRepository.Exists(x => x.WorkshopName == command.WorkshopName))
|
||||
// // return operation.Failed("نام کارگاه تکراری است");
|
||||
// if (_workshopRepository.Exists(x => x.InsuranceCode != null && x.InsuranceCode == command.InsuranceCode))
|
||||
// {
|
||||
// if (_workshopRepository.ExistsWorkshopAccountInsuranceCode(command.InsuranceCode))
|
||||
// return operation.Failed("کد بیمه کارگاه تکراری است");
|
||||
// }
|
||||
|
||||
// if (_workshopRepository.ExistsWorkshopAccountArchiveCode(command.ArchiveCode))
|
||||
// return operation.Failed("شماره بایگانی تکراری است");
|
||||
|
||||
// if (string.IsNullOrEmpty(command.State)) //(!string.IsNullOrEmpty(command.Address) && string.IsNullOrEmpty(command.State))
|
||||
// return operation.Failed("لطفا استان و شهر را انتخاب کنید");
|
||||
|
||||
// if (command.City == "0" || command.City == "شهرستان")
|
||||
// return operation.Failed("لطفا شهر را انتخاب کنید");
|
||||
// if (string.IsNullOrEmpty(command.Address))
|
||||
// return operation.Failed("لطفا آدرس را وارد کنید");
|
||||
|
||||
// if (!string.IsNullOrEmpty(command.TypeOfInsuranceSend) && command.TypeOfInsuranceSend != "false" && string.IsNullOrEmpty(command.InsuranceCode))
|
||||
// return operation.Failed("لطفا کد بیمه کارگاه را وارد کنید");
|
||||
|
||||
// if (command.FixedSalary)
|
||||
// {
|
||||
// if (command.InsuranceJobId == 0 || command.InsuranceJobId == null)
|
||||
// return operation.Failed("لطفا صنف را انتخاب کنید");
|
||||
// if (string.IsNullOrWhiteSpace(command.Population))
|
||||
// return operation.Failed("لطفا جمعیت شهر را انتخاب کنید");
|
||||
// }
|
||||
|
||||
// //if (string.IsNullOrWhiteSpace(command.TypeOfInsuranceSend))
|
||||
// // return operation.Failed("لطفا نوع ارسال لیست بیمه را مشخص کنید");
|
||||
|
||||
// var workshop = new Workshop(command.WorkshopName, command.WorkshopSureName, command.InsuranceCode,command.TypeOfOwnership,
|
||||
// command.ArchiveCode, command.AgentName, command.AgentPhone, command.State, command.City, command.Address,
|
||||
// command.TypeOfInsuranceSend, command.TypeOfContract, command.ContractTerm, command.AgreementNumber, command.FixedSalary,
|
||||
// command.Population, command.InsuranceJobId, command.ZoneName, command.AddBonusesPay,
|
||||
// command.AddYearsPay, command.AddLeavePay,command.TotalPaymentHide, command.IsClassified, command.ComputeOptions,
|
||||
// command.BonusesOptions, command.YearsOptions,command.HasRollCallFreeVip, command.WorkshopHolidayWorking,
|
||||
// command.InsuranceCheckoutOvertime,command.InsuranceCheckoutFamilyAllowance);
|
||||
// _workshopRepository.Create(workshop);
|
||||
// _workshopRepository.SaveChanges();
|
||||
|
||||
|
||||
|
||||
// foreach (var e in employer)
|
||||
// {
|
||||
// _workshopRepository.EmployerWorkshop(workshop.id, e);
|
||||
// }
|
||||
|
||||
|
||||
// _workshopRepository.CreateWorkshopAccounts(accountIds, workshop.id);
|
||||
|
||||
|
||||
|
||||
// return operation.Succcedded();
|
||||
|
||||
|
||||
//}
|
||||
|
||||
//public OperationResult EditForClient(EditWorkshop command)
|
||||
//{
|
||||
// var leftSearch = new LeftWorkSearchModel()
|
||||
// {
|
||||
// WorkshopId = command.Id
|
||||
// };
|
||||
// var leftWork = _leftWorkRepository.search(leftSearch);
|
||||
// var accountIds = new List<long>();
|
||||
// var operation = new OperationResult();
|
||||
// var workshop = _workshopRepository.Get(command.Id);
|
||||
// if (command.AccountIdsList != null)
|
||||
// {
|
||||
// accountIds = command.AccountIdsList.ToList();
|
||||
// }
|
||||
// if (workshop == null)
|
||||
// operation.Failed("رکورد مورد نظر وجود ندارد");
|
||||
// if (command.EmployerIdList == null)
|
||||
// return operation.Failed("لطفا کارفرما را انتخاب نمایید");
|
||||
// var employer = command.EmployerIdList.ToList();
|
||||
|
||||
// if (string.IsNullOrEmpty(command.WorkshopName) || string.IsNullOrEmpty(command.ArchiveCode) || command.ArchiveCode == "0")
|
||||
// return operation.Failed("موارد اجباری را پر کنید");
|
||||
|
||||
// //if (_workshopRepository.Exists(x => x.WorkshopName == command.WorkshopName && x.id != command.Id))
|
||||
// // return operation.Failed(" رکورد مورد نظر تکراری است ");
|
||||
// if (_workshopRepository.Exists(x =>
|
||||
// x.InsuranceCode != null && x.InsuranceCode == command.InsuranceCode && x.id != command.Id))
|
||||
// {
|
||||
// if (_workshopRepository.ExistsWorkshopAccountInsuranceCodeByworkshopId(command.Id, command.InsuranceCode))
|
||||
// return operation.Failed("کد بیمه کارگاه تکراری است");
|
||||
// }
|
||||
|
||||
// if (_workshopRepository.ExistsWorkshopAccountArchiveCodeByWorkshopId(command.Id, command.ArchiveCode))
|
||||
// return operation.Failed("شماره بایگانی تکراری است");
|
||||
|
||||
// if (command.State == null)
|
||||
// return operation.Failed("لطفا استان و شهر را انتخاب کنید");
|
||||
// if ((command.City == "0" || command.City == "شهرستان"))
|
||||
// return operation.Failed("لطفا شهر را انتخاب کنید");
|
||||
// if (command.TypeOfInsuranceSend != null && command.InsuranceCode == null)
|
||||
// return operation.Failed("لطفا کد بیمه کارگاه را وارد کنید");
|
||||
// if (command.Address == null)
|
||||
// return operation.Failed("لطفا آدرس را وارد کنید");
|
||||
// if (command.FixedSalary)
|
||||
// {
|
||||
// if (command.InsuranceJobId == 0 || command.InsuranceJobId == null)
|
||||
// return operation.Failed("لطفا صنف را انتخاب کنید");
|
||||
// if (string.IsNullOrWhiteSpace(command.Population))
|
||||
// return operation.Failed("لطفا جمعیت شهر را انتخاب کنید");
|
||||
// }
|
||||
|
||||
// workshop.Edit(command.WorkshopName, command.WorkshopSureName, command.InsuranceCode, command.TypeOfOwnership,
|
||||
// command.ArchiveCode, command.AgentName, command.AgentPhone, command.State, command.City,
|
||||
// command.Address,
|
||||
// command.TypeOfInsuranceSend, command.TypeOfContract, command.ContractTerm, command.AgreementNumber
|
||||
// , command.FixedSalary, command.Population, command.InsuranceJobId, command.ZoneName,
|
||||
// command.AddBonusesPay, command.AddYearsPay, command.AddLeavePay,command.TotalPaymentHide,command.IsClassified,
|
||||
// command.ComputeOptions, command.BonusesOptions, command.YearsOptions,command.HasRollCallFreeVip, command.WorkshopHolidayWorking,
|
||||
// command.InsuranceCheckoutOvertime, command.InsuranceCheckoutFamilyAllowance);
|
||||
// _workshopRepository.SaveChanges();
|
||||
|
||||
// //_workshopRepository.RemoveOldRelation(command.Id);
|
||||
// _workshopRepository.RemoveEmployerWorkshop(command.Id);
|
||||
// foreach (var e in employer)
|
||||
// {
|
||||
// _workshopRepository.EmployerWorkshop(workshop.id, e);
|
||||
// }
|
||||
// // _workshopRepository.WorkshopAccounts(accountIds, workshop.id);
|
||||
// foreach (var item in leftWork)
|
||||
// {
|
||||
// var editLeft = _leftWorkRepository.Get(item.Id);
|
||||
|
||||
// editLeft.EditBonuses(command.AddBonusesPay, command.AddYearsPay, command.AddLeavePay);
|
||||
// _leftWorkRepository.SaveChanges();
|
||||
// }
|
||||
// return operation.Succcedded();
|
||||
|
||||
//}
|
||||
|
||||
public bool GetWorkshopAccountByAcountID(long acountID)
|
||||
{
|
||||
|
||||
@@ -160,7 +160,7 @@ public class YearlySalaryApplication : IYearlySalaryApplication
|
||||
public InsuranceYearlySalaryModel GetInsuranceItems(DateTime startDate, DateTime endDate, string year)
|
||||
{
|
||||
return _yearlySalaryRepository.GetInsuranceItems(startDate, endDate, year);
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
@@ -9,7 +9,6 @@ using Company.Domain.CheckoutAgg;
|
||||
using Company.Domain.ClassifiedSalaryAgg;
|
||||
using Company.Domain.ClientEmployeeWorkshopAgg;
|
||||
using Company.Domain.Contact2Agg;
|
||||
using Company.Domain.ContactUsAgg;
|
||||
using Company.Domain.ContarctingPartyAgg;
|
||||
using Company.Domain.ContractAgg;
|
||||
using Company.Domain.ContractingPartyAccountAgg;
|
||||
@@ -176,8 +175,6 @@ public class CompanyContext : DbContext
|
||||
|
||||
public DbSet<EmployeeClientTemp> EmployeeClientTemps { get; set; }
|
||||
public DbSet<LeftWorkTemp> LeftWorkTemps { get; set; }
|
||||
public DbSet<ContactUs> ContactUs { get; set; }
|
||||
|
||||
|
||||
public DbSet<EmployeeAuthorizeTemp> EmployeeAuthorizeTemps { get; set; }
|
||||
public DbSet<AdminMonthlyOverview> AdminMonthlyOverviews { get; set; }
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using _0_Framework.Application;
|
||||
using _0_Framework.InfraStructure;
|
||||
using Company.Domain.CheckoutAgg;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
||||
@@ -73,5 +74,28 @@ class CheckoutMapping : IEntityTypeConfiguration<Checkout>
|
||||
salaryAid.Property(x => x.Amount).HasMaxLength(25);
|
||||
salaryAid.Property(x => x.CalculationDateTimeFa).HasMaxLength(15);
|
||||
});
|
||||
|
||||
builder.OwnsOne(x => x.CheckoutRollCall, rollCall =>
|
||||
{
|
||||
rollCall.Property(x => x.TotalPresentTimeSpan).HasTimeSpanConversion();
|
||||
rollCall.Property(x => x.TotalBreakTimeSpan).HasTimeSpanConversion();
|
||||
rollCall.Property(x => x.TotalWorkingTimeSpan).HasTimeSpanConversion();
|
||||
rollCall.Property(x => x.TotalPaidLeaveTmeSpan).HasTimeSpanConversion();
|
||||
rollCall.Property(x => x.TotalSickLeaveTimeSpan).HasTimeSpanConversion();
|
||||
rollCall.Property(x => x.TotalMandatoryTimeSpan).HasTimeSpanConversion();
|
||||
rollCall.OwnsMany(x => x.RollCallDaysCollection, rollCallDay =>
|
||||
{
|
||||
rollCallDay.HasKey(x => x.Id);
|
||||
rollCallDay.WithOwner().HasForeignKey(x => x.CheckoutId);
|
||||
|
||||
rollCallDay.Property(x => x.WorkingTimeSpan).HasTimeSpanConversion();
|
||||
rollCallDay.Property(x => x.BreakTimeSpan).HasTimeSpanConversion();
|
||||
rollCallDay.Property(x => x.FirstStartDate).HasMaxLength(18);
|
||||
rollCallDay.Property(x => x.FirstEndDate).HasMaxLength(18);
|
||||
rollCallDay.Property(x => x.SecondStartDate).HasMaxLength(18);
|
||||
rollCallDay.Property(x => x.SecondEndDate).HasMaxLength(18);
|
||||
rollCallDay.Property(x => x.LeaveType).HasMaxLength(18);
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
using Company.Domain.ContactUsAgg;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
||||
|
||||
namespace CompanyManagment.EFCore.Mapping;
|
||||
|
||||
public class ContactUsMapping:IEntityTypeConfiguration<ContactUs>
|
||||
{
|
||||
public void Configure(EntityTypeBuilder<ContactUs> builder)
|
||||
{
|
||||
builder.HasKey(x => x.id);
|
||||
builder.Property(x => x.FullName).HasMaxLength(200);
|
||||
builder.Property(x => x.Title).HasMaxLength(200);
|
||||
builder.Property(x => x.Email).HasMaxLength(200);
|
||||
builder.Property(x => x.FirstName).HasMaxLength(100);
|
||||
builder.Property(x => x.LastName).HasMaxLength(100);
|
||||
builder.Property(x => x.Message).HasMaxLength(500);
|
||||
builder.Property(x => x.PhoneNumber).HasMaxLength(20);
|
||||
}
|
||||
}
|
||||
@@ -39,7 +39,7 @@ public class PersonalContractingpartyMapping : IEntityTypeConfiguration<Personal
|
||||
builder.Property(x => x.IdNumberSerial).HasMaxLength(15);
|
||||
builder.Property(x => x.FatherName).HasMaxLength(20);
|
||||
builder.Property(x => x.DateOfBirth).IsRequired(false);
|
||||
builder.Property(x => x.Gender).HasConversion(
|
||||
builder.Property(x => x.Gender).HasConversion(
|
||||
v => v.ToString(),
|
||||
v => string.IsNullOrWhiteSpace(v) ? Gender.None : (Gender)Enum.Parse(typeof(Gender), v)).HasMaxLength(6);
|
||||
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
using Company.Domain.InsurancWorkshopInfoAgg;
|
||||
using System;
|
||||
using _0_Framework.Application;
|
||||
using Company.Domain.InsurancWorkshopInfoAgg;
|
||||
using Company.Domain.WorkshopAgg;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
||||
@@ -38,10 +40,13 @@ partial class WorkshopMapping : IEntityTypeConfiguration<Workshop>
|
||||
builder.Property(x => x.IsOldContract);
|
||||
builder.Property(x => x.HasRollCallFreeVip).HasMaxLength(5);
|
||||
builder.Property(x => x.WorkshopHolidayWorking);
|
||||
//builder.HasOne(x => x.Employer)
|
||||
// .WithMany(x => x.Workshops)
|
||||
// .HasForeignKey(x => x.EmployerId);
|
||||
builder.HasMany(x => x.LeftWorks)
|
||||
|
||||
builder.Property(x => x.CutContractEndOfYear).HasConversion(x => x.ToString()
|
||||
, x => ((IsActive)Enum.Parse(typeof(IsActive), x))).HasMaxLength(5);
|
||||
//builder.HasOne(x => x.Employer)
|
||||
// .WithMany(x => x.Workshops)
|
||||
// .HasForeignKey(x => x.EmployerId);
|
||||
builder.HasMany(x => x.LeftWorks)
|
||||
.WithOne(x => x.Workshop)
|
||||
.HasForeignKey(x => x.WorkshopId);
|
||||
|
||||
|
||||
@@ -1,42 +0,0 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace CompanyManagment.EFCore.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class addcontactus : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.CreateTable(
|
||||
name: "ContactUs",
|
||||
columns: table => new
|
||||
{
|
||||
id = table.Column<long>(type: "bigint", nullable: false)
|
||||
.Annotation("SqlServer:Identity", "1, 1"),
|
||||
FirstName = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: true),
|
||||
LastName = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: true),
|
||||
Email = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: true),
|
||||
PhoneNumber = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
|
||||
Title = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: true),
|
||||
Message = table.Column<string>(type: "nvarchar(500)", maxLength: 500, nullable: true),
|
||||
FullName = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: true),
|
||||
CreationDate = table.Column<DateTime>(type: "datetime2", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_ContactUs", x => x.id);
|
||||
});
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "ContactUs");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,23 +0,0 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace CompanyManagment.EFCore.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class addsalaryAidcalculationdate : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,23 +0,0 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace CompanyManagment.EFCore.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class addsalaryAidcalculationdatetocustomizecheckouts : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
// <auto-generated />
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using CompanyManagment.EFCore;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
@@ -12,8 +13,8 @@ using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
namespace CompanyManagment.EFCore.Migrations
|
||||
{
|
||||
[DbContext(typeof(CompanyContext))]
|
||||
[Migration("20250427155240_add salaryAid calculation date")]
|
||||
partial class addsalaryAidcalculationdate
|
||||
[Migration("20250611105314_add rollcall in checkout")]
|
||||
partial class addrollcallincheckout
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
@@ -25,6 +26,36 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
|
||||
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
|
||||
|
||||
modelBuilder.Entity("Company.Domain.AdminMonthlyOverviewAgg.AdminMonthlyOverview", b =>
|
||||
{
|
||||
b.Property<long>("id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("bigint");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<long>("id"));
|
||||
|
||||
b.Property<DateTime>("CreationDate")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<int>("Month")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("Status")
|
||||
.IsRequired()
|
||||
.HasMaxLength(155)
|
||||
.HasColumnType("nvarchar(155)");
|
||||
|
||||
b.Property<long>("WorkshopId")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b.Property<int>("Year")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("id");
|
||||
|
||||
b.ToTable("AdminMonthlyOverviews");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Company.Domain.AndroidApkVersionAgg.AndroidApkVersion", b =>
|
||||
{
|
||||
b.Property<long>("id")
|
||||
@@ -1498,6 +1529,14 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
.HasMaxLength(20)
|
||||
.HasColumnType("nvarchar(20)");
|
||||
|
||||
b.Property<string>("IdNumberSeri")
|
||||
.HasMaxLength(25)
|
||||
.HasColumnType("nvarchar(25)");
|
||||
|
||||
b.Property<string>("IdNumberSerial")
|
||||
.HasMaxLength(25)
|
||||
.HasColumnType("nvarchar(25)");
|
||||
|
||||
b.Property<string>("InsuranceCode")
|
||||
.HasMaxLength(10)
|
||||
.HasColumnType("nvarchar(10)");
|
||||
@@ -1594,6 +1633,62 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
b.ToTable("Employees", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Company.Domain.EmployeeAuthorizeTempAgg.EmployeeAuthorizeTemp", b =>
|
||||
{
|
||||
b.Property<long>("id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("bigint");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<long>("id"));
|
||||
|
||||
b.Property<DateTime>("BirthDate")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<DateTime>("CreationDate")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<string>("FName")
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("nvarchar(100)");
|
||||
|
||||
b.Property<string>("FatherName")
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("nvarchar(100)");
|
||||
|
||||
b.Property<string>("Gender")
|
||||
.IsRequired()
|
||||
.HasMaxLength(15)
|
||||
.HasColumnType("nvarchar(15)");
|
||||
|
||||
b.Property<string>("IdNumber")
|
||||
.HasMaxLength(15)
|
||||
.HasColumnType("nvarchar(15)");
|
||||
|
||||
b.Property<string>("IdNumberSeri")
|
||||
.HasMaxLength(25)
|
||||
.HasColumnType("nvarchar(25)");
|
||||
|
||||
b.Property<string>("IdNumberSerial")
|
||||
.HasMaxLength(25)
|
||||
.HasColumnType("nvarchar(25)");
|
||||
|
||||
b.Property<string>("LName")
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("nvarchar(100)");
|
||||
|
||||
b.Property<string>("NationalCode")
|
||||
.HasMaxLength(15)
|
||||
.HasColumnType("nvarchar(15)");
|
||||
|
||||
b.HasKey("id");
|
||||
|
||||
b.HasIndex("NationalCode")
|
||||
.IsUnique()
|
||||
.HasFilter("[NationalCode] IS NOT NULL");
|
||||
|
||||
b.ToTable("EmployeeAuthorizeTemps", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Company.Domain.EmployeeBankInformationAgg.EmployeeBankInformation", b =>
|
||||
{
|
||||
b.Property<long>("id")
|
||||
@@ -1782,6 +1877,9 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
b.Property<long>("UploaderId")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b.Property<long>("UploaderRoleId")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b.Property<string>("UploaderType")
|
||||
.IsRequired()
|
||||
.HasMaxLength(20)
|
||||
@@ -1893,6 +1991,9 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
b.Property<long>("EmployeeId")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b.Property<double>("FamilyAllowance")
|
||||
.HasColumnType("float");
|
||||
|
||||
b.Property<bool>("IncludeStatus")
|
||||
.HasColumnType("bit");
|
||||
|
||||
@@ -1920,6 +2021,9 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
b.Property<double>("MonthlySalary")
|
||||
.HasColumnType("float");
|
||||
|
||||
b.Property<double>("OverTimePay")
|
||||
.HasColumnType("float");
|
||||
|
||||
b.Property<DateTime>("StartWorkDate")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
@@ -3149,6 +3253,9 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
b.Property<DateTime>("CreationDate")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<DateTime?>("EndDate")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<long>("InsuranceJobId")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
@@ -3164,6 +3271,9 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
b.Property<double>("SalaryMoreThan")
|
||||
.HasColumnType("float");
|
||||
|
||||
b.Property<DateTime?>("StartDate")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.HasKey("id");
|
||||
|
||||
b.HasIndex("InsuranceJobId");
|
||||
@@ -3244,6 +3354,64 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
.HasMaxLength(4)
|
||||
.HasColumnType("nvarchar(4)");
|
||||
|
||||
b.ComplexProperty<Dictionary<string, object>>("Debt", "Company.Domain.InsuranceListAgg.InsuranceList.Debt#InsuranceListDebt", b1 =>
|
||||
{
|
||||
b1.IsRequired();
|
||||
|
||||
b1.Property<double>("Amount")
|
||||
.HasColumnType("float");
|
||||
|
||||
b1.Property<DateTime>("DebtDate")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b1.Property<bool>("IsDone")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b1.Property<long>("MediaId")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b1.Property<string>("Type")
|
||||
.IsRequired()
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("nvarchar(50)");
|
||||
});
|
||||
|
||||
b.ComplexProperty<Dictionary<string, object>>("EmployerApproval", "Company.Domain.InsuranceListAgg.InsuranceList.EmployerApproval#InsuranceListEmployerApproval", b1 =>
|
||||
{
|
||||
b1.IsRequired();
|
||||
|
||||
b1.Property<string>("Description")
|
||||
.HasMaxLength(500)
|
||||
.HasColumnType("nvarchar(500)");
|
||||
|
||||
b1.Property<bool>("IsDone")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b1.Property<string>("Status")
|
||||
.IsRequired()
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("nvarchar(50)");
|
||||
});
|
||||
|
||||
b.ComplexProperty<Dictionary<string, object>>("Inspection", "Company.Domain.InsuranceListAgg.InsuranceList.Inspection#InsuranceListInspection", b1 =>
|
||||
{
|
||||
b1.IsRequired();
|
||||
|
||||
b1.Property<bool>("IsDone")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b1.Property<DateTime>("LastInspectionDateTime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b1.Property<long>("MediaId")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b1.Property<string>("Type")
|
||||
.IsRequired()
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("nvarchar(50)");
|
||||
});
|
||||
|
||||
b.HasKey("id");
|
||||
|
||||
b.ToTable("InsuranceLists", (string)null);
|
||||
@@ -4640,7 +4808,7 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
|
||||
b.HasKey("id");
|
||||
|
||||
b.HasIndex("AccountId");
|
||||
b.HasIndex("WorkshopId");
|
||||
|
||||
b.ToTable("RollCallServices", (string)null);
|
||||
});
|
||||
@@ -4659,6 +4827,12 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
b.Property<DateTime>("CalculationDate")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<int>("CalculationMonth")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("CalculationYear")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<long>("CreatedByAccountId")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
@@ -5485,6 +5659,12 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
.HasMaxLength(5)
|
||||
.HasColumnType("nvarchar(5)");
|
||||
|
||||
b.Property<bool>("InsuranceCheckoutFamilyAllowance")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<bool>("InsuranceCheckoutOvertime")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<string>("InsuranceCode")
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("nvarchar(100)");
|
||||
@@ -5991,6 +6171,210 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.OwnsOne("Company.Domain.CheckoutAgg.CheckoutRollCall", "CheckoutRollCall", b1 =>
|
||||
{
|
||||
b1.Property<long>("Checkoutid")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b1.Property<string>("TotalBreakTimeSpan")
|
||||
.IsRequired()
|
||||
.HasMaxLength(30)
|
||||
.HasColumnType("nvarchar(30)");
|
||||
|
||||
b1.Property<string>("TotalMandatoryTimeSpan")
|
||||
.IsRequired()
|
||||
.HasMaxLength(30)
|
||||
.HasColumnType("nvarchar(30)");
|
||||
|
||||
b1.Property<string>("TotalPaidLeaveTmeSpan")
|
||||
.IsRequired()
|
||||
.HasMaxLength(30)
|
||||
.HasColumnType("nvarchar(30)");
|
||||
|
||||
b1.Property<string>("TotalPresentTimeSpan")
|
||||
.IsRequired()
|
||||
.HasMaxLength(30)
|
||||
.HasColumnType("nvarchar(30)");
|
||||
|
||||
b1.Property<string>("TotalSickLeaveTimeSpan")
|
||||
.IsRequired()
|
||||
.HasMaxLength(30)
|
||||
.HasColumnType("nvarchar(30)");
|
||||
|
||||
b1.Property<string>("TotalWorkingTimeSpan")
|
||||
.IsRequired()
|
||||
.HasMaxLength(30)
|
||||
.HasColumnType("nvarchar(30)");
|
||||
|
||||
b1.HasKey("Checkoutid");
|
||||
|
||||
b1.ToTable("Checkouts");
|
||||
|
||||
b1.WithOwner()
|
||||
.HasForeignKey("Checkoutid");
|
||||
|
||||
b1.OwnsMany("Company.Domain.CheckoutAgg.CheckoutRollCallDay", "RollCallDaysCollection", b2 =>
|
||||
{
|
||||
b2.Property<long>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("bigint");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b2.Property<long>("Id"));
|
||||
|
||||
b2.Property<string>("BreakTimeSpan")
|
||||
.IsRequired()
|
||||
.HasMaxLength(30)
|
||||
.HasColumnType("nvarchar(30)");
|
||||
|
||||
b2.Property<long>("CheckoutId")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b2.Property<DateTime>("Date")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b2.Property<string>("FirstEndDate")
|
||||
.HasMaxLength(18)
|
||||
.HasColumnType("nvarchar(18)");
|
||||
|
||||
b2.Property<string>("FirstStartDate")
|
||||
.HasMaxLength(18)
|
||||
.HasColumnType("nvarchar(18)");
|
||||
|
||||
b2.Property<bool>("IsAbsent")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b2.Property<bool>("IsFriday")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b2.Property<bool>("IsHoliday")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b2.Property<bool>("IsSliced")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b2.Property<string>("LeaveType")
|
||||
.HasMaxLength(18)
|
||||
.HasColumnType("nvarchar(18)");
|
||||
|
||||
b2.Property<string>("SecondEndDate")
|
||||
.HasMaxLength(18)
|
||||
.HasColumnType("nvarchar(18)");
|
||||
|
||||
b2.Property<string>("SecondStartDate")
|
||||
.HasMaxLength(18)
|
||||
.HasColumnType("nvarchar(18)");
|
||||
|
||||
b2.Property<string>("WorkingTimeSpan")
|
||||
.IsRequired()
|
||||
.HasMaxLength(30)
|
||||
.HasColumnType("nvarchar(30)");
|
||||
|
||||
b2.HasKey("Id");
|
||||
|
||||
b2.HasIndex("CheckoutId");
|
||||
|
||||
b2.ToTable("CheckoutRollCallDay");
|
||||
|
||||
b2.WithOwner()
|
||||
.HasForeignKey("CheckoutId");
|
||||
});
|
||||
|
||||
b1.Navigation("RollCallDaysCollection");
|
||||
});
|
||||
|
||||
b.OwnsMany("Company.Domain.CheckoutAgg.ValueObjects.CheckoutLoanInstallment", "LoanInstallments", b1 =>
|
||||
{
|
||||
b1.Property<long>("Checkoutid")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b1.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b1.Property<int>("Id"));
|
||||
|
||||
b1.Property<string>("AmountForMonth")
|
||||
.HasMaxLength(25)
|
||||
.HasColumnType("nvarchar(25)");
|
||||
|
||||
b1.Property<long>("EntityId")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b1.Property<string>("IsActive")
|
||||
.IsRequired()
|
||||
.HasMaxLength(5)
|
||||
.HasColumnType("nvarchar(5)");
|
||||
|
||||
b1.Property<string>("LoanAmount")
|
||||
.HasMaxLength(30)
|
||||
.HasColumnType("nvarchar(30)");
|
||||
|
||||
b1.Property<string>("LoanRemaining")
|
||||
.HasMaxLength(25)
|
||||
.HasColumnType("nvarchar(25)");
|
||||
|
||||
b1.Property<string>("Month")
|
||||
.HasMaxLength(2)
|
||||
.HasColumnType("nvarchar(2)");
|
||||
|
||||
b1.Property<string>("Year")
|
||||
.HasMaxLength(4)
|
||||
.HasColumnType("nvarchar(4)");
|
||||
|
||||
b1.HasKey("Checkoutid", "Id");
|
||||
|
||||
b1.ToTable("CheckoutLoanInstallment");
|
||||
|
||||
b1.WithOwner()
|
||||
.HasForeignKey("Checkoutid");
|
||||
});
|
||||
|
||||
b.OwnsMany("Company.Domain.CheckoutAgg.ValueObjects.CheckoutSalaryAid", "SalaryAids", b1 =>
|
||||
{
|
||||
b1.Property<long>("Checkoutid")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b1.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b1.Property<int>("Id"));
|
||||
|
||||
b1.Property<string>("Amount")
|
||||
.HasMaxLength(25)
|
||||
.HasColumnType("nvarchar(25)");
|
||||
|
||||
b1.Property<DateTime>("CalculationDateTime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b1.Property<string>("CalculationDateTimeFa")
|
||||
.HasMaxLength(15)
|
||||
.HasColumnType("nvarchar(15)");
|
||||
|
||||
b1.Property<long>("EntityId")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b1.Property<DateTime>("SalaryAidDateTime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b1.Property<string>("SalaryAidDateTimeFa")
|
||||
.HasMaxLength(15)
|
||||
.HasColumnType("nvarchar(15)");
|
||||
|
||||
b1.HasKey("Checkoutid", "Id");
|
||||
|
||||
b1.ToTable("CheckoutSalaryAid");
|
||||
|
||||
b1.WithOwner()
|
||||
.HasForeignKey("Checkoutid");
|
||||
});
|
||||
|
||||
b.Navigation("CheckoutRollCall");
|
||||
|
||||
b.Navigation("LoanInstallments");
|
||||
|
||||
b.Navigation("SalaryAids");
|
||||
|
||||
b.Navigation("Workshop");
|
||||
});
|
||||
|
||||
@@ -6228,6 +6612,9 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
b1.Property<DateTime>("CreationDate")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b1.Property<long>("EntityId")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b1.Property<string>("FineDateFa")
|
||||
.HasMaxLength(12)
|
||||
.HasColumnType("nvarchar(12)");
|
||||
@@ -6267,6 +6654,9 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
.HasMaxLength(25)
|
||||
.HasColumnType("nvarchar(25)");
|
||||
|
||||
b1.Property<long>("EntityId")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b1.Property<string>("IsActive")
|
||||
.IsRequired()
|
||||
.HasMaxLength(5)
|
||||
@@ -6314,6 +6704,9 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
b1.Property<string>("Description")
|
||||
.HasColumnType("ntext");
|
||||
|
||||
b1.Property<long>("EntityId")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b1.Property<DateTime>("GrantDate")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
@@ -6353,6 +6746,16 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
.HasMaxLength(25)
|
||||
.HasColumnType("nvarchar(25)");
|
||||
|
||||
b1.Property<DateTime>("CalculationDateTime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b1.Property<string>("CalculationDateTimeFa")
|
||||
.HasMaxLength(15)
|
||||
.HasColumnType("nvarchar(15)");
|
||||
|
||||
b1.Property<long>("EntityId")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b1.Property<DateTime>("SalaryAidDateTime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
@@ -6503,6 +6906,9 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
b1.Property<DateTime>("CreationDate")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b1.Property<long>("EntityId")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b1.Property<string>("FineDateFa")
|
||||
.HasMaxLength(12)
|
||||
.HasColumnType("nvarchar(12)");
|
||||
@@ -6542,6 +6948,9 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
.HasMaxLength(25)
|
||||
.HasColumnType("nvarchar(25)");
|
||||
|
||||
b1.Property<long>("EntityId")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b1.Property<string>("IsActive")
|
||||
.IsRequired()
|
||||
.HasMaxLength(5)
|
||||
@@ -6589,6 +6998,9 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
b1.Property<string>("Description")
|
||||
.HasColumnType("ntext");
|
||||
|
||||
b1.Property<long>("EntityId")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b1.Property<DateTime>("GrantDate")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
@@ -6628,6 +7040,16 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
.HasMaxLength(25)
|
||||
.HasColumnType("nvarchar(25)");
|
||||
|
||||
b1.Property<DateTime>("CalculationDateTime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b1.Property<string>("CalculationDateTimeFa")
|
||||
.HasMaxLength(15)
|
||||
.HasColumnType("nvarchar(15)");
|
||||
|
||||
b1.Property<long>("EntityId")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b1.Property<DateTime>("SalaryAidDateTime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
@@ -8909,7 +9331,7 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
{
|
||||
b.HasOne("Company.Domain.WorkshopAgg.Workshop", "Workshop")
|
||||
.WithMany("RollCallServicesList")
|
||||
.HasForeignKey("AccountId")
|
||||
.HasForeignKey("WorkshopId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
@@ -0,0 +1,124 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace CompanyManagment.EFCore.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class addrollcallincheckout : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "CheckoutRollCall_TotalBreakTimeSpan",
|
||||
table: "Checkouts",
|
||||
type: "nvarchar(30)",
|
||||
maxLength: 30,
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "CheckoutRollCall_TotalMandatoryTimeSpan",
|
||||
table: "Checkouts",
|
||||
type: "nvarchar(30)",
|
||||
maxLength: 30,
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "CheckoutRollCall_TotalPaidLeaveTmeSpan",
|
||||
table: "Checkouts",
|
||||
type: "nvarchar(30)",
|
||||
maxLength: 30,
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "CheckoutRollCall_TotalPresentTimeSpan",
|
||||
table: "Checkouts",
|
||||
type: "nvarchar(30)",
|
||||
maxLength: 30,
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "CheckoutRollCall_TotalSickLeaveTimeSpan",
|
||||
table: "Checkouts",
|
||||
type: "nvarchar(30)",
|
||||
maxLength: 30,
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "CheckoutRollCall_TotalWorkingTimeSpan",
|
||||
table: "Checkouts",
|
||||
type: "nvarchar(30)",
|
||||
maxLength: 30,
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "CheckoutRollCallDay",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<long>(type: "bigint", nullable: false)
|
||||
.Annotation("SqlServer:Identity", "1, 1"),
|
||||
Date = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||||
FirstStartDate = table.Column<string>(type: "nvarchar(18)", maxLength: 18, nullable: true),
|
||||
FirstEndDate = table.Column<string>(type: "nvarchar(18)", maxLength: 18, nullable: true),
|
||||
SecondStartDate = table.Column<string>(type: "nvarchar(18)", maxLength: 18, nullable: true),
|
||||
SecondEndDate = table.Column<string>(type: "nvarchar(18)", maxLength: 18, nullable: true),
|
||||
BreakTimeSpan = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: false),
|
||||
WorkingTimeSpan = table.Column<string>(type: "nvarchar(30)", maxLength: 30, nullable: false),
|
||||
IsSliced = table.Column<bool>(type: "bit", nullable: false),
|
||||
IsAbsent = table.Column<bool>(type: "bit", nullable: false),
|
||||
IsFriday = table.Column<bool>(type: "bit", nullable: false),
|
||||
IsHoliday = table.Column<bool>(type: "bit", nullable: false),
|
||||
LeaveType = table.Column<string>(type: "nvarchar(18)", maxLength: 18, nullable: true),
|
||||
CheckoutId = table.Column<long>(type: "bigint", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_CheckoutRollCallDay", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_CheckoutRollCallDay_Checkouts_CheckoutId",
|
||||
column: x => x.CheckoutId,
|
||||
principalTable: "Checkouts",
|
||||
principalColumn: "id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_CheckoutRollCallDay_CheckoutId",
|
||||
table: "CheckoutRollCallDay",
|
||||
column: "CheckoutId");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "CheckoutRollCallDay");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "CheckoutRollCall_TotalBreakTimeSpan",
|
||||
table: "Checkouts");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "CheckoutRollCall_TotalMandatoryTimeSpan",
|
||||
table: "Checkouts");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "CheckoutRollCall_TotalPaidLeaveTmeSpan",
|
||||
table: "Checkouts");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "CheckoutRollCall_TotalPresentTimeSpan",
|
||||
table: "Checkouts");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "CheckoutRollCall_TotalSickLeaveTimeSpan",
|
||||
table: "Checkouts");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "CheckoutRollCall_TotalWorkingTimeSpan",
|
||||
table: "Checkouts");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
// <auto-generated />
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using CompanyManagment.EFCore;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
@@ -12,8 +13,8 @@ using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
namespace CompanyManagment.EFCore.Migrations
|
||||
{
|
||||
[DbContext(typeof(CompanyContext))]
|
||||
[Migration("20250427160638_add salaryAid calculation date to customize checkouts")]
|
||||
partial class addsalaryAidcalculationdatetocustomizecheckouts
|
||||
[Migration("20250611160351_add workshop create contract settings")]
|
||||
partial class addworkshopcreatecontractsettings
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
@@ -25,6 +26,36 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
|
||||
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
|
||||
|
||||
modelBuilder.Entity("Company.Domain.AdminMonthlyOverviewAgg.AdminMonthlyOverview", b =>
|
||||
{
|
||||
b.Property<long>("id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("bigint");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<long>("id"));
|
||||
|
||||
b.Property<DateTime>("CreationDate")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<int>("Month")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("Status")
|
||||
.IsRequired()
|
||||
.HasMaxLength(155)
|
||||
.HasColumnType("nvarchar(155)");
|
||||
|
||||
b.Property<long>("WorkshopId")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b.Property<int>("Year")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("id");
|
||||
|
||||
b.ToTable("AdminMonthlyOverviews");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Company.Domain.AndroidApkVersionAgg.AndroidApkVersion", b =>
|
||||
{
|
||||
b.Property<long>("id")
|
||||
@@ -1498,6 +1529,14 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
.HasMaxLength(20)
|
||||
.HasColumnType("nvarchar(20)");
|
||||
|
||||
b.Property<string>("IdNumberSeri")
|
||||
.HasMaxLength(25)
|
||||
.HasColumnType("nvarchar(25)");
|
||||
|
||||
b.Property<string>("IdNumberSerial")
|
||||
.HasMaxLength(25)
|
||||
.HasColumnType("nvarchar(25)");
|
||||
|
||||
b.Property<string>("InsuranceCode")
|
||||
.HasMaxLength(10)
|
||||
.HasColumnType("nvarchar(10)");
|
||||
@@ -1594,6 +1633,62 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
b.ToTable("Employees", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Company.Domain.EmployeeAuthorizeTempAgg.EmployeeAuthorizeTemp", b =>
|
||||
{
|
||||
b.Property<long>("id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("bigint");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<long>("id"));
|
||||
|
||||
b.Property<DateTime>("BirthDate")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<DateTime>("CreationDate")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<string>("FName")
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("nvarchar(100)");
|
||||
|
||||
b.Property<string>("FatherName")
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("nvarchar(100)");
|
||||
|
||||
b.Property<string>("Gender")
|
||||
.IsRequired()
|
||||
.HasMaxLength(15)
|
||||
.HasColumnType("nvarchar(15)");
|
||||
|
||||
b.Property<string>("IdNumber")
|
||||
.HasMaxLength(15)
|
||||
.HasColumnType("nvarchar(15)");
|
||||
|
||||
b.Property<string>("IdNumberSeri")
|
||||
.HasMaxLength(25)
|
||||
.HasColumnType("nvarchar(25)");
|
||||
|
||||
b.Property<string>("IdNumberSerial")
|
||||
.HasMaxLength(25)
|
||||
.HasColumnType("nvarchar(25)");
|
||||
|
||||
b.Property<string>("LName")
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("nvarchar(100)");
|
||||
|
||||
b.Property<string>("NationalCode")
|
||||
.HasMaxLength(15)
|
||||
.HasColumnType("nvarchar(15)");
|
||||
|
||||
b.HasKey("id");
|
||||
|
||||
b.HasIndex("NationalCode")
|
||||
.IsUnique()
|
||||
.HasFilter("[NationalCode] IS NOT NULL");
|
||||
|
||||
b.ToTable("EmployeeAuthorizeTemps", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Company.Domain.EmployeeBankInformationAgg.EmployeeBankInformation", b =>
|
||||
{
|
||||
b.Property<long>("id")
|
||||
@@ -1782,6 +1877,9 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
b.Property<long>("UploaderId")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b.Property<long>("UploaderRoleId")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b.Property<string>("UploaderType")
|
||||
.IsRequired()
|
||||
.HasMaxLength(20)
|
||||
@@ -1893,6 +1991,9 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
b.Property<long>("EmployeeId")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b.Property<double>("FamilyAllowance")
|
||||
.HasColumnType("float");
|
||||
|
||||
b.Property<bool>("IncludeStatus")
|
||||
.HasColumnType("bit");
|
||||
|
||||
@@ -1920,6 +2021,9 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
b.Property<double>("MonthlySalary")
|
||||
.HasColumnType("float");
|
||||
|
||||
b.Property<double>("OverTimePay")
|
||||
.HasColumnType("float");
|
||||
|
||||
b.Property<DateTime>("StartWorkDate")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
@@ -3149,6 +3253,9 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
b.Property<DateTime>("CreationDate")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<DateTime?>("EndDate")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<long>("InsuranceJobId")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
@@ -3164,6 +3271,9 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
b.Property<double>("SalaryMoreThan")
|
||||
.HasColumnType("float");
|
||||
|
||||
b.Property<DateTime?>("StartDate")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.HasKey("id");
|
||||
|
||||
b.HasIndex("InsuranceJobId");
|
||||
@@ -3244,6 +3354,64 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
.HasMaxLength(4)
|
||||
.HasColumnType("nvarchar(4)");
|
||||
|
||||
b.ComplexProperty<Dictionary<string, object>>("Debt", "Company.Domain.InsuranceListAgg.InsuranceList.Debt#InsuranceListDebt", b1 =>
|
||||
{
|
||||
b1.IsRequired();
|
||||
|
||||
b1.Property<double>("Amount")
|
||||
.HasColumnType("float");
|
||||
|
||||
b1.Property<DateTime>("DebtDate")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b1.Property<bool>("IsDone")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b1.Property<long>("MediaId")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b1.Property<string>("Type")
|
||||
.IsRequired()
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("nvarchar(50)");
|
||||
});
|
||||
|
||||
b.ComplexProperty<Dictionary<string, object>>("EmployerApproval", "Company.Domain.InsuranceListAgg.InsuranceList.EmployerApproval#InsuranceListEmployerApproval", b1 =>
|
||||
{
|
||||
b1.IsRequired();
|
||||
|
||||
b1.Property<string>("Description")
|
||||
.HasMaxLength(500)
|
||||
.HasColumnType("nvarchar(500)");
|
||||
|
||||
b1.Property<bool>("IsDone")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b1.Property<string>("Status")
|
||||
.IsRequired()
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("nvarchar(50)");
|
||||
});
|
||||
|
||||
b.ComplexProperty<Dictionary<string, object>>("Inspection", "Company.Domain.InsuranceListAgg.InsuranceList.Inspection#InsuranceListInspection", b1 =>
|
||||
{
|
||||
b1.IsRequired();
|
||||
|
||||
b1.Property<bool>("IsDone")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b1.Property<DateTime>("LastInspectionDateTime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b1.Property<long>("MediaId")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b1.Property<string>("Type")
|
||||
.IsRequired()
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("nvarchar(50)");
|
||||
});
|
||||
|
||||
b.HasKey("id");
|
||||
|
||||
b.ToTable("InsuranceLists", (string)null);
|
||||
@@ -4640,7 +4808,7 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
|
||||
b.HasKey("id");
|
||||
|
||||
b.HasIndex("AccountId");
|
||||
b.HasIndex("WorkshopId");
|
||||
|
||||
b.ToTable("RollCallServices", (string)null);
|
||||
});
|
||||
@@ -4659,6 +4827,12 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
b.Property<DateTime>("CalculationDate")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<int>("CalculationMonth")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("CalculationYear")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<long>("CreatedByAccountId")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
@@ -5475,9 +5649,20 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
.HasMaxLength(10)
|
||||
.HasColumnType("nvarchar(10)");
|
||||
|
||||
b.Property<bool>("CreateCheckout")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<bool>("CreateContract")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<DateTime>("CreationDate")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<string>("CutContractEndOfYear")
|
||||
.IsRequired()
|
||||
.HasMaxLength(5)
|
||||
.HasColumnType("nvarchar(5)");
|
||||
|
||||
b.Property<bool>("FixedSalary")
|
||||
.HasColumnType("bit");
|
||||
|
||||
@@ -5485,6 +5670,12 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
.HasMaxLength(5)
|
||||
.HasColumnType("nvarchar(5)");
|
||||
|
||||
b.Property<bool>("InsuranceCheckoutFamilyAllowance")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<bool>("InsuranceCheckoutOvertime")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<string>("InsuranceCode")
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("nvarchar(100)");
|
||||
@@ -5509,6 +5700,12 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
.HasMaxLength(25)
|
||||
.HasColumnType("nvarchar(25)");
|
||||
|
||||
b.Property<bool>("SignCheckout")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<bool>("SignContract")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<string>("State")
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("nvarchar(100)");
|
||||
@@ -5991,6 +6188,97 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.OwnsMany("Company.Domain.CheckoutAgg.ValueObjects.CheckoutLoanInstallment", "LoanInstallments", b1 =>
|
||||
{
|
||||
b1.Property<long>("Checkoutid")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b1.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b1.Property<int>("Id"));
|
||||
|
||||
b1.Property<string>("AmountForMonth")
|
||||
.HasMaxLength(25)
|
||||
.HasColumnType("nvarchar(25)");
|
||||
|
||||
b1.Property<long>("EntityId")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b1.Property<string>("IsActive")
|
||||
.IsRequired()
|
||||
.HasMaxLength(5)
|
||||
.HasColumnType("nvarchar(5)");
|
||||
|
||||
b1.Property<string>("LoanAmount")
|
||||
.HasMaxLength(30)
|
||||
.HasColumnType("nvarchar(30)");
|
||||
|
||||
b1.Property<string>("LoanRemaining")
|
||||
.HasMaxLength(25)
|
||||
.HasColumnType("nvarchar(25)");
|
||||
|
||||
b1.Property<string>("Month")
|
||||
.HasMaxLength(2)
|
||||
.HasColumnType("nvarchar(2)");
|
||||
|
||||
b1.Property<string>("Year")
|
||||
.HasMaxLength(4)
|
||||
.HasColumnType("nvarchar(4)");
|
||||
|
||||
b1.HasKey("Checkoutid", "Id");
|
||||
|
||||
b1.ToTable("CheckoutLoanInstallment");
|
||||
|
||||
b1.WithOwner()
|
||||
.HasForeignKey("Checkoutid");
|
||||
});
|
||||
|
||||
b.OwnsMany("Company.Domain.CheckoutAgg.ValueObjects.CheckoutSalaryAid", "SalaryAids", b1 =>
|
||||
{
|
||||
b1.Property<long>("Checkoutid")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b1.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b1.Property<int>("Id"));
|
||||
|
||||
b1.Property<string>("Amount")
|
||||
.HasMaxLength(25)
|
||||
.HasColumnType("nvarchar(25)");
|
||||
|
||||
b1.Property<DateTime>("CalculationDateTime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b1.Property<string>("CalculationDateTimeFa")
|
||||
.HasMaxLength(15)
|
||||
.HasColumnType("nvarchar(15)");
|
||||
|
||||
b1.Property<long>("EntityId")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b1.Property<DateTime>("SalaryAidDateTime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b1.Property<string>("SalaryAidDateTimeFa")
|
||||
.HasMaxLength(15)
|
||||
.HasColumnType("nvarchar(15)");
|
||||
|
||||
b1.HasKey("Checkoutid", "Id");
|
||||
|
||||
b1.ToTable("CheckoutSalaryAid");
|
||||
|
||||
b1.WithOwner()
|
||||
.HasForeignKey("Checkoutid");
|
||||
});
|
||||
|
||||
b.Navigation("LoanInstallments");
|
||||
|
||||
b.Navigation("SalaryAids");
|
||||
|
||||
b.Navigation("Workshop");
|
||||
});
|
||||
|
||||
@@ -6228,6 +6516,9 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
b1.Property<DateTime>("CreationDate")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b1.Property<long>("EntityId")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b1.Property<string>("FineDateFa")
|
||||
.HasMaxLength(12)
|
||||
.HasColumnType("nvarchar(12)");
|
||||
@@ -6267,6 +6558,9 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
.HasMaxLength(25)
|
||||
.HasColumnType("nvarchar(25)");
|
||||
|
||||
b1.Property<long>("EntityId")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b1.Property<string>("IsActive")
|
||||
.IsRequired()
|
||||
.HasMaxLength(5)
|
||||
@@ -6314,6 +6608,9 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
b1.Property<string>("Description")
|
||||
.HasColumnType("ntext");
|
||||
|
||||
b1.Property<long>("EntityId")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b1.Property<DateTime>("GrantDate")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
@@ -6360,6 +6657,9 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
.HasMaxLength(15)
|
||||
.HasColumnType("nvarchar(15)");
|
||||
|
||||
b1.Property<long>("EntityId")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b1.Property<DateTime>("SalaryAidDateTime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
@@ -6510,6 +6810,9 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
b1.Property<DateTime>("CreationDate")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b1.Property<long>("EntityId")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b1.Property<string>("FineDateFa")
|
||||
.HasMaxLength(12)
|
||||
.HasColumnType("nvarchar(12)");
|
||||
@@ -6549,6 +6852,9 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
.HasMaxLength(25)
|
||||
.HasColumnType("nvarchar(25)");
|
||||
|
||||
b1.Property<long>("EntityId")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b1.Property<string>("IsActive")
|
||||
.IsRequired()
|
||||
.HasMaxLength(5)
|
||||
@@ -6596,6 +6902,9 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
b1.Property<string>("Description")
|
||||
.HasColumnType("ntext");
|
||||
|
||||
b1.Property<long>("EntityId")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b1.Property<DateTime>("GrantDate")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
@@ -6642,6 +6951,9 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
.HasMaxLength(15)
|
||||
.HasColumnType("nvarchar(15)");
|
||||
|
||||
b1.Property<long>("EntityId")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b1.Property<DateTime>("SalaryAidDateTime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
@@ -8923,7 +9235,7 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
{
|
||||
b.HasOne("Company.Domain.WorkshopAgg.Workshop", "Workshop")
|
||||
.WithMany("RollCallServicesList")
|
||||
.HasForeignKey("AccountId")
|
||||
.HasForeignKey("WorkshopId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
@@ -0,0 +1,74 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace CompanyManagment.EFCore.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class addworkshopcreatecontractsettings : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "CreateCheckout",
|
||||
table: "Workshops",
|
||||
type: "bit",
|
||||
nullable: false,
|
||||
defaultValue: false);
|
||||
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "CreateContract",
|
||||
table: "Workshops",
|
||||
type: "bit",
|
||||
nullable: false,
|
||||
defaultValue: false);
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "CutContractEndOfYear",
|
||||
table: "Workshops",
|
||||
type: "nvarchar(5)",
|
||||
maxLength: 5,
|
||||
nullable: false,
|
||||
defaultValue: "");
|
||||
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "SignCheckout",
|
||||
table: "Workshops",
|
||||
type: "bit",
|
||||
nullable: false,
|
||||
defaultValue: false);
|
||||
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "SignContract",
|
||||
table: "Workshops",
|
||||
type: "bit",
|
||||
nullable: false,
|
||||
defaultValue: false);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "CreateCheckout",
|
||||
table: "Workshops");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "CreateContract",
|
||||
table: "Workshops");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "CutContractEndOfYear",
|
||||
table: "Workshops");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "SignCheckout",
|
||||
table: "Workshops");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "SignContract",
|
||||
table: "Workshops");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
// <auto-generated />
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using CompanyManagment.EFCore;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
@@ -12,8 +13,8 @@ using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
namespace CompanyManagment.EFCore.Migrations
|
||||
{
|
||||
[DbContext(typeof(CompanyContext))]
|
||||
[Migration("20250423184716_add contact us ")]
|
||||
partial class addcontactus
|
||||
[Migration("20250611172746_add settings for employee compute options")]
|
||||
partial class addsettingsforemployeecomputeoptions
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
@@ -25,6 +26,36 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
|
||||
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
|
||||
|
||||
modelBuilder.Entity("Company.Domain.AdminMonthlyOverviewAgg.AdminMonthlyOverview", b =>
|
||||
{
|
||||
b.Property<long>("id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("bigint");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<long>("id"));
|
||||
|
||||
b.Property<DateTime>("CreationDate")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<int>("Month")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("Status")
|
||||
.IsRequired()
|
||||
.HasMaxLength(155)
|
||||
.HasColumnType("nvarchar(155)");
|
||||
|
||||
b.Property<long>("WorkshopId")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b.Property<int>("Year")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("id");
|
||||
|
||||
b.ToTable("AdminMonthlyOverviews");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Company.Domain.AndroidApkVersionAgg.AndroidApkVersion", b =>
|
||||
{
|
||||
b.Property<long>("id")
|
||||
@@ -532,50 +563,6 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
b.ToTable("TextManager_Contact", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Company.Domain.ContactUsAgg.ContactUs", b =>
|
||||
{
|
||||
b.Property<long>("id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("bigint");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<long>("id"));
|
||||
|
||||
b.Property<DateTime>("CreationDate")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<string>("Email")
|
||||
.HasMaxLength(200)
|
||||
.HasColumnType("nvarchar(200)");
|
||||
|
||||
b.Property<string>("FirstName")
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("nvarchar(100)");
|
||||
|
||||
b.Property<string>("FullName")
|
||||
.HasMaxLength(200)
|
||||
.HasColumnType("nvarchar(200)");
|
||||
|
||||
b.Property<string>("LastName")
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("nvarchar(100)");
|
||||
|
||||
b.Property<string>("Message")
|
||||
.HasMaxLength(500)
|
||||
.HasColumnType("nvarchar(500)");
|
||||
|
||||
b.Property<string>("PhoneNumber")
|
||||
.HasMaxLength(20)
|
||||
.HasColumnType("nvarchar(20)");
|
||||
|
||||
b.Property<string>("Title")
|
||||
.HasMaxLength(200)
|
||||
.HasColumnType("nvarchar(200)");
|
||||
|
||||
b.HasKey("id");
|
||||
|
||||
b.ToTable("ContactUs");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Company.Domain.ContarctingPartyAgg.PersonalContractingParty", b =>
|
||||
{
|
||||
b.Property<long>("id")
|
||||
@@ -1542,6 +1529,14 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
.HasMaxLength(20)
|
||||
.HasColumnType("nvarchar(20)");
|
||||
|
||||
b.Property<string>("IdNumberSeri")
|
||||
.HasMaxLength(25)
|
||||
.HasColumnType("nvarchar(25)");
|
||||
|
||||
b.Property<string>("IdNumberSerial")
|
||||
.HasMaxLength(25)
|
||||
.HasColumnType("nvarchar(25)");
|
||||
|
||||
b.Property<string>("InsuranceCode")
|
||||
.HasMaxLength(10)
|
||||
.HasColumnType("nvarchar(10)");
|
||||
@@ -1638,6 +1633,62 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
b.ToTable("Employees", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Company.Domain.EmployeeAuthorizeTempAgg.EmployeeAuthorizeTemp", b =>
|
||||
{
|
||||
b.Property<long>("id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("bigint");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<long>("id"));
|
||||
|
||||
b.Property<DateTime>("BirthDate")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<DateTime>("CreationDate")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<string>("FName")
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("nvarchar(100)");
|
||||
|
||||
b.Property<string>("FatherName")
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("nvarchar(100)");
|
||||
|
||||
b.Property<string>("Gender")
|
||||
.IsRequired()
|
||||
.HasMaxLength(15)
|
||||
.HasColumnType("nvarchar(15)");
|
||||
|
||||
b.Property<string>("IdNumber")
|
||||
.HasMaxLength(15)
|
||||
.HasColumnType("nvarchar(15)");
|
||||
|
||||
b.Property<string>("IdNumberSeri")
|
||||
.HasMaxLength(25)
|
||||
.HasColumnType("nvarchar(25)");
|
||||
|
||||
b.Property<string>("IdNumberSerial")
|
||||
.HasMaxLength(25)
|
||||
.HasColumnType("nvarchar(25)");
|
||||
|
||||
b.Property<string>("LName")
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("nvarchar(100)");
|
||||
|
||||
b.Property<string>("NationalCode")
|
||||
.HasMaxLength(15)
|
||||
.HasColumnType("nvarchar(15)");
|
||||
|
||||
b.HasKey("id");
|
||||
|
||||
b.HasIndex("NationalCode")
|
||||
.IsUnique()
|
||||
.HasFilter("[NationalCode] IS NOT NULL");
|
||||
|
||||
b.ToTable("EmployeeAuthorizeTemps", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Company.Domain.EmployeeBankInformationAgg.EmployeeBankInformation", b =>
|
||||
{
|
||||
b.Property<long>("id")
|
||||
@@ -1761,12 +1812,24 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("nvarchar(50)");
|
||||
|
||||
b.Property<bool>("CreateCheckout")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<bool>("CreateContract")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<DateTime>("CreationDate")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<long>("EmployeeId")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b.Property<bool>("SignCheckout")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<bool>("SignContract")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<long>("WorkshopId")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
@@ -1826,6 +1889,9 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
b.Property<long>("UploaderId")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b.Property<long>("UploaderRoleId")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b.Property<string>("UploaderType")
|
||||
.IsRequired()
|
||||
.HasMaxLength(20)
|
||||
@@ -1937,6 +2003,9 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
b.Property<long>("EmployeeId")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b.Property<double>("FamilyAllowance")
|
||||
.HasColumnType("float");
|
||||
|
||||
b.Property<bool>("IncludeStatus")
|
||||
.HasColumnType("bit");
|
||||
|
||||
@@ -1964,6 +2033,9 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
b.Property<double>("MonthlySalary")
|
||||
.HasColumnType("float");
|
||||
|
||||
b.Property<double>("OverTimePay")
|
||||
.HasColumnType("float");
|
||||
|
||||
b.Property<DateTime>("StartWorkDate")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
@@ -2844,7 +2916,8 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("HasValueAddedTax")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
.HasMaxLength(10)
|
||||
.HasColumnType("nvarchar(10)");
|
||||
|
||||
b.Property<string>("IsActiveString")
|
||||
.HasMaxLength(5)
|
||||
@@ -3192,6 +3265,9 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
b.Property<DateTime>("CreationDate")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<DateTime?>("EndDate")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<long>("InsuranceJobId")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
@@ -3207,6 +3283,9 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
b.Property<double>("SalaryMoreThan")
|
||||
.HasColumnType("float");
|
||||
|
||||
b.Property<DateTime?>("StartDate")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.HasKey("id");
|
||||
|
||||
b.HasIndex("InsuranceJobId");
|
||||
@@ -3287,6 +3366,64 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
.HasMaxLength(4)
|
||||
.HasColumnType("nvarchar(4)");
|
||||
|
||||
b.ComplexProperty<Dictionary<string, object>>("Debt", "Company.Domain.InsuranceListAgg.InsuranceList.Debt#InsuranceListDebt", b1 =>
|
||||
{
|
||||
b1.IsRequired();
|
||||
|
||||
b1.Property<double>("Amount")
|
||||
.HasColumnType("float");
|
||||
|
||||
b1.Property<DateTime>("DebtDate")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b1.Property<bool>("IsDone")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b1.Property<long>("MediaId")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b1.Property<string>("Type")
|
||||
.IsRequired()
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("nvarchar(50)");
|
||||
});
|
||||
|
||||
b.ComplexProperty<Dictionary<string, object>>("EmployerApproval", "Company.Domain.InsuranceListAgg.InsuranceList.EmployerApproval#InsuranceListEmployerApproval", b1 =>
|
||||
{
|
||||
b1.IsRequired();
|
||||
|
||||
b1.Property<string>("Description")
|
||||
.HasMaxLength(500)
|
||||
.HasColumnType("nvarchar(500)");
|
||||
|
||||
b1.Property<bool>("IsDone")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b1.Property<string>("Status")
|
||||
.IsRequired()
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("nvarchar(50)");
|
||||
});
|
||||
|
||||
b.ComplexProperty<Dictionary<string, object>>("Inspection", "Company.Domain.InsuranceListAgg.InsuranceList.Inspection#InsuranceListInspection", b1 =>
|
||||
{
|
||||
b1.IsRequired();
|
||||
|
||||
b1.Property<bool>("IsDone")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b1.Property<DateTime>("LastInspectionDateTime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b1.Property<long>("MediaId")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b1.Property<string>("Type")
|
||||
.IsRequired()
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("nvarchar(50)");
|
||||
});
|
||||
|
||||
b.HasKey("id");
|
||||
|
||||
b.ToTable("InsuranceLists", (string)null);
|
||||
@@ -4683,7 +4820,7 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
|
||||
b.HasKey("id");
|
||||
|
||||
b.HasIndex("AccountId");
|
||||
b.HasIndex("WorkshopId");
|
||||
|
||||
b.ToTable("RollCallServices", (string)null);
|
||||
});
|
||||
@@ -4699,6 +4836,15 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
b.Property<double>("Amount")
|
||||
.HasColumnType("float");
|
||||
|
||||
b.Property<DateTime>("CalculationDate")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<int>("CalculationMonth")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("CalculationYear")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<long>("CreatedByAccountId")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
@@ -5515,9 +5661,20 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
.HasMaxLength(10)
|
||||
.HasColumnType("nvarchar(10)");
|
||||
|
||||
b.Property<bool>("CreateCheckout")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<bool>("CreateContract")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<DateTime>("CreationDate")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<string>("CutContractEndOfYear")
|
||||
.IsRequired()
|
||||
.HasMaxLength(5)
|
||||
.HasColumnType("nvarchar(5)");
|
||||
|
||||
b.Property<bool>("FixedSalary")
|
||||
.HasColumnType("bit");
|
||||
|
||||
@@ -5525,6 +5682,12 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
.HasMaxLength(5)
|
||||
.HasColumnType("nvarchar(5)");
|
||||
|
||||
b.Property<bool>("InsuranceCheckoutFamilyAllowance")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<bool>("InsuranceCheckoutOvertime")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<string>("InsuranceCode")
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("nvarchar(100)");
|
||||
@@ -5549,6 +5712,12 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
.HasMaxLength(25)
|
||||
.HasColumnType("nvarchar(25)");
|
||||
|
||||
b.Property<bool>("SignCheckout")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<bool>("SignContract")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<string>("State")
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("nvarchar(100)");
|
||||
@@ -6031,6 +6200,97 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.OwnsMany("Company.Domain.CheckoutAgg.ValueObjects.CheckoutLoanInstallment", "LoanInstallments", b1 =>
|
||||
{
|
||||
b1.Property<long>("Checkoutid")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b1.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b1.Property<int>("Id"));
|
||||
|
||||
b1.Property<string>("AmountForMonth")
|
||||
.HasMaxLength(25)
|
||||
.HasColumnType("nvarchar(25)");
|
||||
|
||||
b1.Property<long>("EntityId")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b1.Property<string>("IsActive")
|
||||
.IsRequired()
|
||||
.HasMaxLength(5)
|
||||
.HasColumnType("nvarchar(5)");
|
||||
|
||||
b1.Property<string>("LoanAmount")
|
||||
.HasMaxLength(30)
|
||||
.HasColumnType("nvarchar(30)");
|
||||
|
||||
b1.Property<string>("LoanRemaining")
|
||||
.HasMaxLength(25)
|
||||
.HasColumnType("nvarchar(25)");
|
||||
|
||||
b1.Property<string>("Month")
|
||||
.HasMaxLength(2)
|
||||
.HasColumnType("nvarchar(2)");
|
||||
|
||||
b1.Property<string>("Year")
|
||||
.HasMaxLength(4)
|
||||
.HasColumnType("nvarchar(4)");
|
||||
|
||||
b1.HasKey("Checkoutid", "Id");
|
||||
|
||||
b1.ToTable("CheckoutLoanInstallment");
|
||||
|
||||
b1.WithOwner()
|
||||
.HasForeignKey("Checkoutid");
|
||||
});
|
||||
|
||||
b.OwnsMany("Company.Domain.CheckoutAgg.ValueObjects.CheckoutSalaryAid", "SalaryAids", b1 =>
|
||||
{
|
||||
b1.Property<long>("Checkoutid")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b1.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b1.Property<int>("Id"));
|
||||
|
||||
b1.Property<string>("Amount")
|
||||
.HasMaxLength(25)
|
||||
.HasColumnType("nvarchar(25)");
|
||||
|
||||
b1.Property<DateTime>("CalculationDateTime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b1.Property<string>("CalculationDateTimeFa")
|
||||
.HasMaxLength(15)
|
||||
.HasColumnType("nvarchar(15)");
|
||||
|
||||
b1.Property<long>("EntityId")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b1.Property<DateTime>("SalaryAidDateTime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b1.Property<string>("SalaryAidDateTimeFa")
|
||||
.HasMaxLength(15)
|
||||
.HasColumnType("nvarchar(15)");
|
||||
|
||||
b1.HasKey("Checkoutid", "Id");
|
||||
|
||||
b1.ToTable("CheckoutSalaryAid");
|
||||
|
||||
b1.WithOwner()
|
||||
.HasForeignKey("Checkoutid");
|
||||
});
|
||||
|
||||
b.Navigation("LoanInstallments");
|
||||
|
||||
b.Navigation("SalaryAids");
|
||||
|
||||
b.Navigation("Workshop");
|
||||
});
|
||||
|
||||
@@ -6268,6 +6528,9 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
b1.Property<DateTime>("CreationDate")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b1.Property<long>("EntityId")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b1.Property<string>("FineDateFa")
|
||||
.HasMaxLength(12)
|
||||
.HasColumnType("nvarchar(12)");
|
||||
@@ -6307,6 +6570,9 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
.HasMaxLength(25)
|
||||
.HasColumnType("nvarchar(25)");
|
||||
|
||||
b1.Property<long>("EntityId")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b1.Property<string>("IsActive")
|
||||
.IsRequired()
|
||||
.HasMaxLength(5)
|
||||
@@ -6354,6 +6620,9 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
b1.Property<string>("Description")
|
||||
.HasColumnType("ntext");
|
||||
|
||||
b1.Property<long>("EntityId")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b1.Property<DateTime>("GrantDate")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
@@ -6393,6 +6662,16 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
.HasMaxLength(25)
|
||||
.HasColumnType("nvarchar(25)");
|
||||
|
||||
b1.Property<DateTime>("CalculationDateTime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b1.Property<string>("CalculationDateTimeFa")
|
||||
.HasMaxLength(15)
|
||||
.HasColumnType("nvarchar(15)");
|
||||
|
||||
b1.Property<long>("EntityId")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b1.Property<DateTime>("SalaryAidDateTime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
@@ -6543,6 +6822,9 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
b1.Property<DateTime>("CreationDate")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b1.Property<long>("EntityId")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b1.Property<string>("FineDateFa")
|
||||
.HasMaxLength(12)
|
||||
.HasColumnType("nvarchar(12)");
|
||||
@@ -6582,6 +6864,9 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
.HasMaxLength(25)
|
||||
.HasColumnType("nvarchar(25)");
|
||||
|
||||
b1.Property<long>("EntityId")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b1.Property<string>("IsActive")
|
||||
.IsRequired()
|
||||
.HasMaxLength(5)
|
||||
@@ -6629,6 +6914,9 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
b1.Property<string>("Description")
|
||||
.HasColumnType("ntext");
|
||||
|
||||
b1.Property<long>("EntityId")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b1.Property<DateTime>("GrantDate")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
@@ -6668,6 +6956,16 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
.HasMaxLength(25)
|
||||
.HasColumnType("nvarchar(25)");
|
||||
|
||||
b1.Property<DateTime>("CalculationDateTime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b1.Property<string>("CalculationDateTimeFa")
|
||||
.HasMaxLength(15)
|
||||
.HasColumnType("nvarchar(15)");
|
||||
|
||||
b1.Property<long>("EntityId")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b1.Property<DateTime>("SalaryAidDateTime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
@@ -8949,7 +9247,7 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
{
|
||||
b.HasOne("Company.Domain.WorkshopAgg.Workshop", "Workshop")
|
||||
.WithMany("RollCallServicesList")
|
||||
.HasForeignKey("AccountId")
|
||||
.HasForeignKey("WorkshopId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
@@ -0,0 +1,62 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace CompanyManagment.EFCore.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class addsettingsforemployeecomputeoptions : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "CreateCheckout",
|
||||
table: "EmployeeComputeOptions",
|
||||
type: "bit",
|
||||
nullable: false,
|
||||
defaultValue: false);
|
||||
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "CreateContract",
|
||||
table: "EmployeeComputeOptions",
|
||||
type: "bit",
|
||||
nullable: false,
|
||||
defaultValue: false);
|
||||
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "SignCheckout",
|
||||
table: "EmployeeComputeOptions",
|
||||
type: "bit",
|
||||
nullable: false,
|
||||
defaultValue: false);
|
||||
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "SignContract",
|
||||
table: "EmployeeComputeOptions",
|
||||
type: "bit",
|
||||
nullable: false,
|
||||
defaultValue: false);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "CreateCheckout",
|
||||
table: "EmployeeComputeOptions");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "CreateContract",
|
||||
table: "EmployeeComputeOptions");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "SignCheckout",
|
||||
table: "EmployeeComputeOptions");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "SignContract",
|
||||
table: "EmployeeComputeOptions");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -560,50 +560,6 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
b.ToTable("TextManager_Contact", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Company.Domain.ContactUsAgg.ContactUs", b =>
|
||||
{
|
||||
b.Property<long>("id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("bigint");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<long>("id"));
|
||||
|
||||
b.Property<DateTime>("CreationDate")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<string>("Email")
|
||||
.HasMaxLength(200)
|
||||
.HasColumnType("nvarchar(200)");
|
||||
|
||||
b.Property<string>("FirstName")
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("nvarchar(100)");
|
||||
|
||||
b.Property<string>("FullName")
|
||||
.HasMaxLength(200)
|
||||
.HasColumnType("nvarchar(200)");
|
||||
|
||||
b.Property<string>("LastName")
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("nvarchar(100)");
|
||||
|
||||
b.Property<string>("Message")
|
||||
.HasMaxLength(500)
|
||||
.HasColumnType("nvarchar(500)");
|
||||
|
||||
b.Property<string>("PhoneNumber")
|
||||
.HasMaxLength(20)
|
||||
.HasColumnType("nvarchar(20)");
|
||||
|
||||
b.Property<string>("Title")
|
||||
.HasMaxLength(200)
|
||||
.HasColumnType("nvarchar(200)");
|
||||
|
||||
b.HasKey("id");
|
||||
|
||||
b.ToTable("ContactUs");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Company.Domain.ContarctingPartyAgg.PersonalContractingParty", b =>
|
||||
{
|
||||
b.Property<long>("id")
|
||||
@@ -1853,12 +1809,24 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("nvarchar(50)");
|
||||
|
||||
b.Property<bool>("CreateCheckout")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<bool>("CreateContract")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<DateTime>("CreationDate")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<long>("EmployeeId")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b.Property<bool>("SignCheckout")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<bool>("SignContract")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<long>("WorkshopId")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
@@ -5690,9 +5658,20 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
.HasMaxLength(10)
|
||||
.HasColumnType("nvarchar(10)");
|
||||
|
||||
b.Property<bool>("CreateCheckout")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<bool>("CreateContract")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<DateTime>("CreationDate")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<string>("CutContractEndOfYear")
|
||||
.IsRequired()
|
||||
.HasMaxLength(5)
|
||||
.HasColumnType("nvarchar(5)");
|
||||
|
||||
b.Property<bool>("FixedSalary")
|
||||
.HasColumnType("bit");
|
||||
|
||||
@@ -5730,6 +5709,12 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
.HasMaxLength(25)
|
||||
.HasColumnType("nvarchar(25)");
|
||||
|
||||
b.Property<bool>("SignCheckout")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<bool>("SignContract")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<string>("State")
|
||||
.HasMaxLength(100)
|
||||
.HasColumnType("nvarchar(100)");
|
||||
@@ -6212,6 +6197,117 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.OwnsOne("Company.Domain.CheckoutAgg.CheckoutRollCall", "CheckoutRollCall", b1 =>
|
||||
{
|
||||
b1.Property<long>("Checkoutid")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b1.Property<string>("TotalBreakTimeSpan")
|
||||
.IsRequired()
|
||||
.HasMaxLength(30)
|
||||
.HasColumnType("nvarchar(30)");
|
||||
|
||||
b1.Property<string>("TotalMandatoryTimeSpan")
|
||||
.IsRequired()
|
||||
.HasMaxLength(30)
|
||||
.HasColumnType("nvarchar(30)");
|
||||
|
||||
b1.Property<string>("TotalPaidLeaveTmeSpan")
|
||||
.IsRequired()
|
||||
.HasMaxLength(30)
|
||||
.HasColumnType("nvarchar(30)");
|
||||
|
||||
b1.Property<string>("TotalPresentTimeSpan")
|
||||
.IsRequired()
|
||||
.HasMaxLength(30)
|
||||
.HasColumnType("nvarchar(30)");
|
||||
|
||||
b1.Property<string>("TotalSickLeaveTimeSpan")
|
||||
.IsRequired()
|
||||
.HasMaxLength(30)
|
||||
.HasColumnType("nvarchar(30)");
|
||||
|
||||
b1.Property<string>("TotalWorkingTimeSpan")
|
||||
.IsRequired()
|
||||
.HasMaxLength(30)
|
||||
.HasColumnType("nvarchar(30)");
|
||||
|
||||
b1.HasKey("Checkoutid");
|
||||
|
||||
b1.ToTable("Checkouts");
|
||||
|
||||
b1.WithOwner()
|
||||
.HasForeignKey("Checkoutid");
|
||||
|
||||
b1.OwnsMany("Company.Domain.CheckoutAgg.CheckoutRollCallDay", "RollCallDaysCollection", b2 =>
|
||||
{
|
||||
b2.Property<long>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("bigint");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b2.Property<long>("Id"));
|
||||
|
||||
b2.Property<string>("BreakTimeSpan")
|
||||
.IsRequired()
|
||||
.HasMaxLength(30)
|
||||
.HasColumnType("nvarchar(30)");
|
||||
|
||||
b2.Property<long>("CheckoutId")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b2.Property<DateTime>("Date")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b2.Property<string>("FirstEndDate")
|
||||
.HasMaxLength(18)
|
||||
.HasColumnType("nvarchar(18)");
|
||||
|
||||
b2.Property<string>("FirstStartDate")
|
||||
.HasMaxLength(18)
|
||||
.HasColumnType("nvarchar(18)");
|
||||
|
||||
b2.Property<bool>("IsAbsent")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b2.Property<bool>("IsFriday")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b2.Property<bool>("IsHoliday")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b2.Property<bool>("IsSliced")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b2.Property<string>("LeaveType")
|
||||
.HasMaxLength(18)
|
||||
.HasColumnType("nvarchar(18)");
|
||||
|
||||
b2.Property<string>("SecondEndDate")
|
||||
.HasMaxLength(18)
|
||||
.HasColumnType("nvarchar(18)");
|
||||
|
||||
b2.Property<string>("SecondStartDate")
|
||||
.HasMaxLength(18)
|
||||
.HasColumnType("nvarchar(18)");
|
||||
|
||||
b2.Property<string>("WorkingTimeSpan")
|
||||
.IsRequired()
|
||||
.HasMaxLength(30)
|
||||
.HasColumnType("nvarchar(30)");
|
||||
|
||||
b2.HasKey("Id");
|
||||
|
||||
b2.HasIndex("CheckoutId");
|
||||
|
||||
b2.ToTable("CheckoutRollCallDay");
|
||||
|
||||
b2.WithOwner()
|
||||
.HasForeignKey("CheckoutId");
|
||||
});
|
||||
|
||||
b1.Navigation("RollCallDaysCollection");
|
||||
});
|
||||
|
||||
b.OwnsMany("Company.Domain.CheckoutAgg.ValueObjects.CheckoutLoanInstallment", "LoanInstallments", b1 =>
|
||||
{
|
||||
b1.Property<long>("Checkoutid")
|
||||
@@ -6299,6 +6395,8 @@ namespace CompanyManagment.EFCore.Migrations
|
||||
.HasForeignKey("Checkoutid");
|
||||
});
|
||||
|
||||
b.Navigation("CheckoutRollCall");
|
||||
|
||||
b.Navigation("LoanInstallments");
|
||||
|
||||
b.Navigation("SalaryAids");
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,14 +0,0 @@
|
||||
using _0_Framework.InfraStructure;
|
||||
using Company.Domain.ContactUsAgg;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace CompanyManagment.EFCore.Repository;
|
||||
|
||||
public class ContactUsRepository:RepositoryBase<long,ContactUs>,IContactUsRepository
|
||||
{
|
||||
private readonly CompanyContext _companyContext;
|
||||
public ContactUsRepository(CompanyContext companyContext) : base(companyContext)
|
||||
{
|
||||
_companyContext = companyContext;
|
||||
}
|
||||
}
|
||||
@@ -8,351 +8,364 @@ using CompanyManagment.App.Contracts.CustomizeWorkshopSettings.ValueObjectsViewM
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
|
||||
namespace CompanyManagment.EFCore.Repository
|
||||
namespace CompanyManagment.EFCore.Repository;
|
||||
|
||||
public class CustomizeWorkshopSettingsRepository(CompanyContext companyContext, IAuthHelper authHelper, IEmployeeRepository employeeRepository)
|
||||
: RepositoryBase<long, CustomizeWorkshopSettings>(companyContext), ICustomizeWorkshopSettingsRepository
|
||||
{
|
||||
public class CustomizeWorkshopSettingsRepository(CompanyContext companyContext, IAuthHelper authHelper, IEmployeeRepository employeeRepository)
|
||||
: RepositoryBase<long, CustomizeWorkshopSettings>(companyContext), ICustomizeWorkshopSettingsRepository
|
||||
private readonly CompanyContext _companyContext = companyContext;
|
||||
private readonly IAuthHelper _authHelper = authHelper;
|
||||
private readonly IEmployeeRepository _employeeRepository = employeeRepository;
|
||||
|
||||
public CustomizeWorkshopSettingsViewModel GetWorkshopSettingsByWorkshopId(long workshopId, AuthViewModel auth)
|
||||
{
|
||||
private readonly CompanyContext _companyContext = companyContext;
|
||||
private readonly IAuthHelper _authHelper = authHelper;
|
||||
private readonly IEmployeeRepository _employeeRepository = employeeRepository;
|
||||
var entity = _companyContext.CustomizeWorkshopSettings.AsSplitQuery().Where(x => x.WorkshopId == workshopId)
|
||||
.Include(x => x.CustomizeWorkshopGroupSettingsCollection)
|
||||
.ThenInclude(x => x.CustomizeWorkshopEmployeeSettingsCollection).AsSplitQuery()
|
||||
.FirstOrDefault();
|
||||
if (entity == null)
|
||||
return new();
|
||||
|
||||
public CustomizeWorkshopSettingsViewModel GetWorkshopSettingsByWorkshopId(long workshopId, AuthViewModel auth)
|
||||
var employeeIds = entity.CustomizeWorkshopGroupSettingsCollection
|
||||
.SelectMany(x => x.CustomizeWorkshopEmployeeSettingsCollection)
|
||||
.Select(y => y.EmployeeId)
|
||||
.ToList();
|
||||
var employees = _employeeRepository.GetBy(employeeIds);
|
||||
return new CustomizeWorkshopSettingsViewModel()
|
||||
{
|
||||
var entity = _companyContext.CustomizeWorkshopSettings.AsSplitQuery().Where(x => x.WorkshopId == workshopId)
|
||||
.Include(x => x.CustomizeWorkshopGroupSettingsCollection)
|
||||
.ThenInclude(x => x.CustomizeWorkshopEmployeeSettingsCollection).AsSplitQuery()
|
||||
.FirstOrDefault();
|
||||
if (entity == null)
|
||||
return new();
|
||||
|
||||
var employeeIds = entity.CustomizeWorkshopGroupSettingsCollection
|
||||
.SelectMany(x => x.CustomizeWorkshopEmployeeSettingsCollection)
|
||||
.Select(y => y.EmployeeId)
|
||||
.ToList();
|
||||
var employees = _employeeRepository.GetBy(employeeIds);
|
||||
return new CustomizeWorkshopSettingsViewModel()
|
||||
{
|
||||
Id = entity.id,
|
||||
Name = auth.WorkshopList.FirstOrDefault(w => w.Id == entity.WorkshopId)?.Name,
|
||||
GroupSettings = entity.CustomizeWorkshopGroupSettingsCollection.Where(x => !x.MainGroup).Select(x =>
|
||||
new CustomizeWorkshopGroupSettingsViewModel()
|
||||
{
|
||||
Id = x.id,
|
||||
GroupName = x.GroupName,
|
||||
WorkshopShiftStatus = x.WorkshopShiftStatus,
|
||||
IrregularShift = x.IrregularShift,
|
||||
Salary = x.Salary,
|
||||
RollCallWorkshopShifts = x.CustomizeWorkshopGroupSettingsShifts.Select(s =>
|
||||
new CustomizeWorkshopShiftViewModel()
|
||||
{
|
||||
EndTime = s.EndTime.ToString("HH:mm"),
|
||||
Placement = s.Placement,
|
||||
StartTime = s.StartTime.ToString("HH:mm")
|
||||
|
||||
}).ToList(),
|
||||
MainGroup = x.MainGroup,
|
||||
CustomizeRotatingShiftsViewModels = x.CustomizeRotatingShifts.
|
||||
Select(r=>new CustomizeRotatingShiftsViewModel(){StartTime = r.StartTime.ToString("HH:mm"), EndTime = r.EndTime.ToString("HH:mm")}).ToList()
|
||||
}).ToList(),
|
||||
|
||||
};
|
||||
}
|
||||
public CustomizeWorkshopSettingsViewModel GetWorkshopSettingsByWorkshopIdForAdmin(long workshopId)
|
||||
{
|
||||
var entity = _companyContext.CustomizeWorkshopSettings.AsSplitQuery().Where(x => x.WorkshopId == workshopId)
|
||||
.Include(x => x.CustomizeWorkshopGroupSettingsCollection)
|
||||
.ThenInclude(x => x.CustomizeWorkshopEmployeeSettingsCollection).AsSplitQuery()
|
||||
.FirstOrDefault();
|
||||
if (entity == null)
|
||||
return new();
|
||||
|
||||
return new CustomizeWorkshopSettingsViewModel()
|
||||
{
|
||||
Id = entity.id,
|
||||
Offset = entity.EndTimeOffSet,
|
||||
GroupSettings = entity.CustomizeWorkshopGroupSettingsCollection.Where(x => !x.MainGroup).Select(x =>
|
||||
new CustomizeWorkshopGroupSettingsViewModel()
|
||||
{
|
||||
Id = x.id,
|
||||
GroupName = x.GroupName,
|
||||
RollCallWorkshopEmployeesSettings = x.CustomizeWorkshopEmployeeSettingsCollection.Select(y =>
|
||||
{
|
||||
var employee = _employeeRepository.Get(y.EmployeeId);
|
||||
return new CustomizeWorkshopEmployeeSettingsViewModel()
|
||||
{
|
||||
Id = y.id,
|
||||
EmployeeId = y.EmployeeId,
|
||||
IsSettingChanged = y.IsSettingChanged,
|
||||
IsShiftChanged = y.IsShiftChanged,
|
||||
Name = $"{employee?.FName} {employee?.LName}",
|
||||
RollCallWorkshopShifts = y.CustomizeWorkshopEmployeeSettingsShifts.Select(s =>
|
||||
new CustomizeWorkshopShiftViewModel()
|
||||
{
|
||||
EndTime = s.EndTime.ToString("HH:mm"),
|
||||
Placement = s.Placement,
|
||||
StartTime = s.StartTime.ToString("HH:mm")
|
||||
}).ToList(),
|
||||
Salary = y.Salary,
|
||||
CustomizeRotatingShiftsViewModels = y.CustomizeRotatingShifts.Select(r => new CustomizeRotatingShiftsViewModel
|
||||
{
|
||||
StartTime = r.StartTime.ToString("HH:mm"),
|
||||
EndTime = r.EndTime.ToString("HH:mm")
|
||||
}).ToList(),
|
||||
LeavePermittedDays = y.LeavePermittedDays,
|
||||
IrregularShift = y.IrregularShift,
|
||||
WorkshopShiftStatus = y.WorkshopShiftStatus
|
||||
};
|
||||
}).ToList(),
|
||||
Salary = x.Salary,
|
||||
RollCallWorkshopShifts = x.CustomizeWorkshopGroupSettingsShifts.Select(s =>
|
||||
new CustomizeWorkshopShiftViewModel()
|
||||
{
|
||||
EndTime = s.EndTime.ToString("HH:mm"),
|
||||
Placement = s.Placement,
|
||||
StartTime = s.StartTime.ToString("HH:mm")
|
||||
|
||||
}).ToList(),
|
||||
MainGroup = x.MainGroup,
|
||||
WorkshopShiftStatus = x.WorkshopShiftStatus,
|
||||
CustomizeRotatingShiftsViewModels = x.CustomizeRotatingShifts.Select(r=>new CustomizeRotatingShiftsViewModel
|
||||
{
|
||||
StartTime = r.StartTime.ToString("HH:mm"),
|
||||
EndTime = r.EndTime.ToString("HH:mm")
|
||||
}).ToList(),
|
||||
IrregularShift = x.IrregularShift
|
||||
|
||||
|
||||
|
||||
}).ToList(),
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
public EditCustomizeWorkshopSettings GetWorkshopSettingsDetails(long workshopId)
|
||||
{
|
||||
|
||||
var entity = _companyContext.CustomizeWorkshopSettings.AsSplitQuery().FirstOrDefault(x => x.WorkshopId == workshopId);
|
||||
if (entity == null)
|
||||
return new();
|
||||
var viewModel = new EditCustomizeWorkshopSettings()
|
||||
{
|
||||
FridayWork = entity.FridayWork,
|
||||
FridayPay = new() { FridayPayType = entity.FridayPay.FridayPayType, Value = entity.FridayPay.Value },
|
||||
LateToWork = new()
|
||||
{
|
||||
LateToWorkTimeFinesVewModels = entity.LateToWork.LateToWorkTimeFines.Select(x =>
|
||||
new LateToWorkTimeFineVewModel() { FineMoney = x.FineMoney, Minute = x.Minute }).ToList(),
|
||||
Value = entity.LateToWork.Value,
|
||||
LateToWorkType = entity.LateToWork.LateToWorkType
|
||||
},
|
||||
HolidayWork = entity.HolidayWork,
|
||||
FineAbsenceDeduction = new()
|
||||
{
|
||||
Value = entity.FineAbsenceDeduction.Value,
|
||||
FineAbsenceDayOfWeekViewModels = entity.FineAbsenceDeduction.FineAbsenceDayOfWeekCollection
|
||||
.Select(x => new FineAbsenceDayOfWeekViewModel() { DayOfWeek = x.DayOfWeek }).ToList(),
|
||||
FineAbsenceDeductionType = entity.FineAbsenceDeduction.FineAbsenceDeductionType
|
||||
},
|
||||
EarlyExit = new()
|
||||
{
|
||||
EarlyExitTimeFinesViewModels = entity.EarlyExit.EarlyExitTimeFines.Select(x =>
|
||||
new EarlyExitTimeFineViewModel() { FineMoney = x.FineMoney, Minute = x.Minute }).ToList(),
|
||||
Value = entity.EarlyExit.Value,
|
||||
EarlyExitType = entity.EarlyExit.EarlyExitType
|
||||
},
|
||||
BonusesPay = new()
|
||||
{
|
||||
Value = entity.BonusesPay.Value,
|
||||
BonusesPayType = entity.BonusesPay.BonusesPayType,
|
||||
PaymentType = entity.BonusesPay.PaymentType
|
||||
},
|
||||
ShiftPay = new()
|
||||
{
|
||||
Value = entity.ShiftPay.Value,
|
||||
ShiftPayType = entity.ShiftPay.ShiftPayType,
|
||||
ShiftType = entity.ShiftPay.ShiftType
|
||||
},
|
||||
InsuranceDeduction = new()
|
||||
{
|
||||
Value = entity.InsuranceDeduction.Value,
|
||||
InsuranceDeductionType = entity.InsuranceDeduction.InsuranceDeductionType
|
||||
},
|
||||
OverTimePay = new()
|
||||
{ OverTimePayType = entity.OverTimePay.OverTimePayType, Value = entity.OverTimePay.Value },
|
||||
BaseYearsPay = new()
|
||||
{
|
||||
BaseYearsPayType = entity.BaseYearsPay.BaseYearsPayType,
|
||||
Value = entity.BaseYearsPay.Value,
|
||||
PaymentType = entity.BaseYearsPay.PaymentType
|
||||
},
|
||||
NightWorkPay = new()
|
||||
{ NightWorkingType = entity.NightWorkPay.NightWorkingType, Value = entity.NightWorkPay.Value },
|
||||
LeavePay = new()
|
||||
{
|
||||
Value = entity.LeavePay.Value,
|
||||
LeavePayType = entity.LeavePay.LeavePayType
|
||||
},
|
||||
MarriedAllowance = new()
|
||||
{
|
||||
Value = entity.MarriedAllowance.Value,
|
||||
MarriedAllowanceType = entity.MarriedAllowance.MarriedAllowanceType
|
||||
},
|
||||
FamilyAllowance = new()
|
||||
{
|
||||
FamilyAllowanceType = entity.FamilyAllowance.FamilyAllowanceType,
|
||||
Value = entity.FamilyAllowance.Value
|
||||
},
|
||||
Currency = entity.Currency,
|
||||
MaxMonthDays = entity.MaxMonthDays,
|
||||
Id = entity.id,
|
||||
ShiftsList = entity.CustomizeWorkshopSettingsShifts.Select(x => new CustomizeWorkshopShiftViewModel()
|
||||
{ EndTime = x.EndTime.ToString("HH:mm"), Placement = x.Placement, StartTime = x.StartTime.ToString("HH:mm") }).ToList(),
|
||||
BonusesPaysInEndOfMonth = entity.BonusesPaysInEndOfMonth,
|
||||
LeavePermittedDays = entity.LeavePermittedDays,
|
||||
BaseYearsPayInEndOfYear = entity.BaseYearsPayInEndOfYear,
|
||||
WorkshopId = entity.WorkshopId,
|
||||
WorkshopShiftStatus = entity.WorkshopShiftStatus
|
||||
|
||||
};
|
||||
return viewModel;
|
||||
|
||||
}
|
||||
|
||||
public CustomizeWorkshopSettings GetBy(long workshopId)
|
||||
{
|
||||
return _companyContext.CustomizeWorkshopSettings.FirstOrDefault(x => x.WorkshopId == workshopId);
|
||||
}
|
||||
|
||||
public EditCustomizeWorkshopSettings GetSimpleWorkshopSettings(long workshopId)
|
||||
{
|
||||
var entity = _companyContext.CustomizeWorkshopSettings.AsSplitQuery().FirstOrDefault(x => x.WorkshopId == workshopId);
|
||||
if (entity == null)
|
||||
{
|
||||
return new();
|
||||
}
|
||||
|
||||
return new()
|
||||
{
|
||||
ShiftsList = entity.CustomizeWorkshopSettingsShifts.Select(x => new CustomizeWorkshopShiftViewModel()
|
||||
{
|
||||
EndTime = x.EndTime.ToString("HH:mm"),
|
||||
StartTime = x.StartTime.ToString("HH:mm"),
|
||||
Placement = x.Placement
|
||||
}).ToList(),
|
||||
Id = entity.id,
|
||||
WorkshopId = entity.WorkshopId,
|
||||
WorkshopShiftStatus = entity.WorkshopShiftStatus,
|
||||
FridayWork = entity.FridayWork,
|
||||
HolidayWork = entity.HolidayWork
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
public List<ChangedGroupedViewModel> GetShiftChangesGroupAndEmployees(long customizeWorkshopSettingsId)
|
||||
{
|
||||
|
||||
|
||||
var result = from groupSetting in _companyContext.CustomizeWorkshopGroupSettings.AsSplitQuery()
|
||||
where groupSetting.IsShiftChange // Filter parent tables where isChange is true
|
||||
join employeeSettings in _companyContext.CustomizeWorkshopEmployeeSettings on groupSetting.id equals employeeSettings.CustomizeWorkshopGroupSettingId
|
||||
where employeeSettings.IsShiftChanged// Filter child tables where isChange is true
|
||||
join employee in _companyContext.Employees on employeeSettings.EmployeeId equals employee.id
|
||||
group new { employee.FullName, groupSetting.GroupName } by groupSetting.id into grouped
|
||||
select new ChangedGroupedViewModel
|
||||
{
|
||||
GroupName = grouped.First().GroupName,
|
||||
EmployeeName = grouped.Select(e => e.FullName).ToList()
|
||||
};
|
||||
|
||||
return result.ToList();
|
||||
|
||||
}
|
||||
|
||||
public CustomizeWorkshopSettingsViewModel GetWorkshopIncludeGroupsByWorkshopId(long workshopId)
|
||||
{
|
||||
var customizeWorkshopSettings = _companyContext.CustomizeWorkshopSettings
|
||||
.AsNoTracking().AsSplitQuery().Where(x => x.WorkshopId == workshopId)
|
||||
.Include(x => x.CustomizeWorkshopGroupSettingsCollection)
|
||||
.Select(x => new CustomizeWorkshopSettingsViewModel()
|
||||
Id = entity.id,
|
||||
Name = auth.WorkshopList.FirstOrDefault(w => w.Id == entity.WorkshopId)?.Name,
|
||||
GroupSettings = entity.CustomizeWorkshopGroupSettingsCollection.Where(x => !x.MainGroup).Select(x =>
|
||||
new CustomizeWorkshopGroupSettingsViewModel()
|
||||
{
|
||||
Id = x.id,
|
||||
WorkshopShiftStatus = x.WorkshopShiftStatus,
|
||||
GroupSettings = x.CustomizeWorkshopGroupSettingsCollection.Select(g =>
|
||||
new CustomizeWorkshopGroupSettingsViewModel()
|
||||
GroupName = x.GroupName,
|
||||
RollCallWorkshopEmployeesSettings = x.CustomizeWorkshopEmployeeSettingsCollection.Select(y =>
|
||||
{
|
||||
var employee = employees.First(e => e.Id == y.EmployeeId);
|
||||
return new CustomizeWorkshopEmployeeSettingsViewModel()
|
||||
{
|
||||
Id = g.id,
|
||||
IrregularShift = g.IrregularShift,
|
||||
WorkshopShiftStatus = g.WorkshopShiftStatus,
|
||||
GroupName = g.GroupName,
|
||||
MainGroup = g.MainGroup,
|
||||
Salary = g.Salary,
|
||||
SalaryStr = g.Salary.ToMoney(),
|
||||
LeavePermitted = g.LeavePermittedDays,
|
||||
RollCallWorkshopShifts = g.CustomizeWorkshopGroupSettingsShifts.Select(s =>
|
||||
Id = y.id,
|
||||
EmployeeId = y.EmployeeId,
|
||||
IsSettingChanged = y.IsSettingChanged,
|
||||
IsShiftChanged = y.IsShiftChanged,
|
||||
Name = $"{employee}",
|
||||
RollCallWorkshopShifts = y.CustomizeWorkshopEmployeeSettingsShifts.Select(s =>
|
||||
new CustomizeWorkshopShiftViewModel()
|
||||
{
|
||||
StartTime = s.StartTime.ToString("HH:mm"),
|
||||
EndTime = s.EndTime.ToString("HH:mm"),
|
||||
Placement = s.Placement,
|
||||
StartTime = s.StartTime.ToString("HH:mm")
|
||||
}).ToList(),
|
||||
BreakTime = g.BreakTime,
|
||||
HolidayWork = g.HolidayWork,
|
||||
FridayWork = g.FridayWork,
|
||||
CustomizeRotatingShiftsViewModels = g.CustomizeRotatingShifts.Select(r=>new CustomizeRotatingShiftsViewModel()
|
||||
{
|
||||
EndTime = r.EndTime.ToString("HH:mm"),
|
||||
StartTime= r.StartTime.ToString("HH:mm")
|
||||
}).ToList()
|
||||
|
||||
}).ToList(),
|
||||
Salary = y.Salary,
|
||||
|
||||
|
||||
}).FirstOrDefault();
|
||||
|
||||
return customizeWorkshopSettings;
|
||||
}
|
||||
|
||||
public CustomizeWorkshopEmployeeSettingsViewModel GetEmployeeSettingsByWorkshopIdEmployeeId(long workshopId, long employeeId)
|
||||
{
|
||||
var employee = _companyContext.CustomizeWorkshopSettings
|
||||
.AsSplitQuery().Include(x => x.CustomizeWorkshopGroupSettingsCollection)
|
||||
.ThenInclude(x => x.CustomizeWorkshopEmployeeSettingsCollection)
|
||||
.FirstOrDefault(x => x.WorkshopId == workshopId)?.CustomizeWorkshopGroupSettingsCollection.SelectMany(x => x.CustomizeWorkshopEmployeeSettingsCollection)
|
||||
.FirstOrDefault(x => x.EmployeeId == employeeId);
|
||||
|
||||
if (employee == null)
|
||||
return new();
|
||||
|
||||
var employeeName = _companyContext.Employees.Select(x => new { x.FullName, x.id })
|
||||
.FirstOrDefault(x => x.id == employee.EmployeeId);
|
||||
return new CustomizeWorkshopEmployeeSettingsViewModel()
|
||||
{
|
||||
Id = employee.id,
|
||||
EmployeeId = employee.EmployeeId,
|
||||
IsSettingChanged = employee.IsSettingChanged,
|
||||
IsShiftChanged = employee.IsShiftChanged,
|
||||
Name = employeeName?.FullName,
|
||||
RollCallWorkshopShifts = employee.CustomizeWorkshopEmployeeSettingsShifts.Select(x =>
|
||||
new CustomizeWorkshopShiftViewModel()
|
||||
{
|
||||
EndTime = x.EndTime.ToString("HH:mm"),
|
||||
Placement = x.Placement,
|
||||
StartTime = x.StartTime.ToString("HH:mm")
|
||||
};
|
||||
}).ToList(),
|
||||
Salary = employee.Salary
|
||||
};
|
||||
WorkshopShiftStatus = x.WorkshopShiftStatus,
|
||||
IrregularShift = x.IrregularShift,
|
||||
Salary = x.Salary,
|
||||
RollCallWorkshopShifts = x.CustomizeWorkshopGroupSettingsShifts.Select(s =>
|
||||
new CustomizeWorkshopShiftViewModel()
|
||||
{
|
||||
EndTime = s.EndTime.ToString("HH:mm"),
|
||||
Placement = s.Placement,
|
||||
StartTime = s.StartTime.ToString("HH:mm")
|
||||
|
||||
}).ToList(),
|
||||
MainGroup = x.MainGroup,
|
||||
CustomizeRotatingShiftsViewModels = x.CustomizeRotatingShifts.
|
||||
Select(r=>new CustomizeRotatingShiftsViewModel(){StartTime = r.StartTime.ToString("HH:mm"), EndTime = r.EndTime.ToString("HH:mm")}).ToList()
|
||||
}).ToList(),
|
||||
|
||||
};
|
||||
}
|
||||
public CustomizeWorkshopSettingsViewModel GetWorkshopSettingsByWorkshopIdForAdmin(long workshopId)
|
||||
{
|
||||
var entity = _companyContext.CustomizeWorkshopSettings.AsSplitQuery().Where(x => x.WorkshopId == workshopId)
|
||||
.Include(x => x.CustomizeWorkshopGroupSettingsCollection)
|
||||
.ThenInclude(x => x.CustomizeWorkshopEmployeeSettingsCollection).AsSplitQuery()
|
||||
.FirstOrDefault();
|
||||
if (entity == null)
|
||||
return new();
|
||||
|
||||
return new CustomizeWorkshopSettingsViewModel()
|
||||
{
|
||||
Id = entity.id,
|
||||
Offset = entity.EndTimeOffSet,
|
||||
GroupSettings = entity.CustomizeWorkshopGroupSettingsCollection.Where(x => !x.MainGroup).Select(x =>
|
||||
new CustomizeWorkshopGroupSettingsViewModel()
|
||||
{
|
||||
Id = x.id,
|
||||
GroupName = x.GroupName,
|
||||
RollCallWorkshopEmployeesSettings = x.CustomizeWorkshopEmployeeSettingsCollection.Select(y =>
|
||||
{
|
||||
var employee = _employeeRepository.Get(y.EmployeeId);
|
||||
return new CustomizeWorkshopEmployeeSettingsViewModel()
|
||||
{
|
||||
Id = y.id,
|
||||
EmployeeId = y.EmployeeId,
|
||||
IsSettingChanged = y.IsSettingChanged,
|
||||
IsShiftChanged = y.IsShiftChanged,
|
||||
Name = $"{employee?.FName} {employee?.LName}",
|
||||
RollCallWorkshopShifts = y.CustomizeWorkshopEmployeeSettingsShifts.Select(s =>
|
||||
new CustomizeWorkshopShiftViewModel()
|
||||
{
|
||||
EndTime = s.EndTime.ToString("HH:mm"),
|
||||
Placement = s.Placement,
|
||||
StartTime = s.StartTime.ToString("HH:mm")
|
||||
}).ToList(),
|
||||
Salary = y.Salary,
|
||||
CustomizeRotatingShiftsViewModels = y.CustomizeRotatingShifts.Select(r => new CustomizeRotatingShiftsViewModel
|
||||
{
|
||||
StartTime = r.StartTime.ToString("HH:mm"),
|
||||
EndTime = r.EndTime.ToString("HH:mm")
|
||||
}).ToList(),
|
||||
LeavePermittedDays = y.LeavePermittedDays,
|
||||
IrregularShift = y.IrregularShift,
|
||||
WorkshopShiftStatus = y.WorkshopShiftStatus
|
||||
};
|
||||
}).ToList(),
|
||||
Salary = x.Salary,
|
||||
RollCallWorkshopShifts = x.CustomizeWorkshopGroupSettingsShifts.Select(s =>
|
||||
new CustomizeWorkshopShiftViewModel()
|
||||
{
|
||||
EndTime = s.EndTime.ToString("HH:mm"),
|
||||
Placement = s.Placement,
|
||||
StartTime = s.StartTime.ToString("HH:mm")
|
||||
|
||||
}).ToList(),
|
||||
MainGroup = x.MainGroup,
|
||||
WorkshopShiftStatus = x.WorkshopShiftStatus,
|
||||
CustomizeRotatingShiftsViewModels = x.CustomizeRotatingShifts.Select(r => new CustomizeRotatingShiftsViewModel
|
||||
{
|
||||
StartTime = r.StartTime.ToString("HH:mm"),
|
||||
EndTime = r.EndTime.ToString("HH:mm")
|
||||
}).ToList(),
|
||||
IrregularShift = x.IrregularShift
|
||||
|
||||
|
||||
|
||||
}).ToList(),
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
public EditCustomizeWorkshopSettings GetWorkshopSettingsDetails(long workshopId)
|
||||
{
|
||||
|
||||
var entity = _companyContext.CustomizeWorkshopSettings.AsSplitQuery().FirstOrDefault(x => x.WorkshopId == workshopId);
|
||||
if (entity == null)
|
||||
return new();
|
||||
var viewModel = new EditCustomizeWorkshopSettings()
|
||||
{
|
||||
FridayWork = entity.FridayWork,
|
||||
FridayPay = new() { FridayPayType = entity.FridayPay.FridayPayType, Value = entity.FridayPay.Value },
|
||||
LateToWork = new()
|
||||
{
|
||||
LateToWorkTimeFinesVewModels = entity.LateToWork.LateToWorkTimeFines.Select(x =>
|
||||
new LateToWorkTimeFineVewModel() { FineMoney = x.FineMoney, Minute = x.Minute }).ToList(),
|
||||
Value = entity.LateToWork.Value,
|
||||
LateToWorkType = entity.LateToWork.LateToWorkType
|
||||
},
|
||||
HolidayWork = entity.HolidayWork,
|
||||
FineAbsenceDeduction = new()
|
||||
{
|
||||
Value = entity.FineAbsenceDeduction.Value,
|
||||
FineAbsenceDayOfWeekViewModels = entity.FineAbsenceDeduction.FineAbsenceDayOfWeekCollection
|
||||
.Select(x => new FineAbsenceDayOfWeekViewModel() { DayOfWeek = x.DayOfWeek }).ToList(),
|
||||
FineAbsenceDeductionType = entity.FineAbsenceDeduction.FineAbsenceDeductionType
|
||||
},
|
||||
EarlyExit = new()
|
||||
{
|
||||
EarlyExitTimeFinesViewModels = entity.EarlyExit.EarlyExitTimeFines.Select(x =>
|
||||
new EarlyExitTimeFineViewModel() { FineMoney = x.FineMoney, Minute = x.Minute }).ToList(),
|
||||
Value = entity.EarlyExit.Value,
|
||||
EarlyExitType = entity.EarlyExit.EarlyExitType
|
||||
},
|
||||
BonusesPay = new()
|
||||
{
|
||||
Value = entity.BonusesPay.Value,
|
||||
BonusesPayType = entity.BonusesPay.BonusesPayType,
|
||||
PaymentType = entity.BonusesPay.PaymentType
|
||||
},
|
||||
ShiftPay = new()
|
||||
{
|
||||
Value = entity.ShiftPay.Value,
|
||||
ShiftPayType = entity.ShiftPay.ShiftPayType,
|
||||
ShiftType = entity.ShiftPay.ShiftType
|
||||
},
|
||||
InsuranceDeduction = new()
|
||||
{
|
||||
Value = entity.InsuranceDeduction.Value,
|
||||
InsuranceDeductionType = entity.InsuranceDeduction.InsuranceDeductionType
|
||||
},
|
||||
OverTimePay = new()
|
||||
{ OverTimePayType = entity.OverTimePay.OverTimePayType, Value = entity.OverTimePay.Value },
|
||||
BaseYearsPay = new()
|
||||
{
|
||||
BaseYearsPayType = entity.BaseYearsPay.BaseYearsPayType,
|
||||
Value = entity.BaseYearsPay.Value,
|
||||
PaymentType = entity.BaseYearsPay.PaymentType
|
||||
},
|
||||
NightWorkPay = new()
|
||||
{ NightWorkingType = entity.NightWorkPay.NightWorkingType, Value = entity.NightWorkPay.Value },
|
||||
LeavePay = new()
|
||||
{
|
||||
Value = entity.LeavePay.Value,
|
||||
LeavePayType = entity.LeavePay.LeavePayType
|
||||
},
|
||||
MarriedAllowance = new()
|
||||
{
|
||||
Value = entity.MarriedAllowance.Value,
|
||||
MarriedAllowanceType = entity.MarriedAllowance.MarriedAllowanceType
|
||||
},
|
||||
FamilyAllowance = new()
|
||||
{
|
||||
FamilyAllowanceType = entity.FamilyAllowance.FamilyAllowanceType,
|
||||
Value = entity.FamilyAllowance.Value
|
||||
},
|
||||
Currency = entity.Currency,
|
||||
MaxMonthDays = entity.MaxMonthDays,
|
||||
Id = entity.id,
|
||||
ShiftsList = entity.CustomizeWorkshopSettingsShifts.Select(x => new CustomizeWorkshopShiftViewModel()
|
||||
{ EndTime = x.EndTime.ToString("HH:mm"), Placement = x.Placement, StartTime = x.StartTime.ToString("HH:mm") }).ToList(),
|
||||
BonusesPaysInEndOfMonth = entity.BonusesPaysInEndOfMonth,
|
||||
LeavePermittedDays = entity.LeavePermittedDays,
|
||||
BaseYearsPayInEndOfYear = entity.BaseYearsPayInEndOfYear,
|
||||
WorkshopId = entity.WorkshopId,
|
||||
WorkshopShiftStatus = entity.WorkshopShiftStatus
|
||||
|
||||
};
|
||||
return viewModel;
|
||||
|
||||
}
|
||||
|
||||
|
||||
public EditCustomizeWorkshopSettings GetSimpleWorkshopSettings(long workshopId)
|
||||
{
|
||||
var entity = _companyContext.CustomizeWorkshopSettings.AsSplitQuery().FirstOrDefault(x => x.WorkshopId == workshopId);
|
||||
if (entity == null)
|
||||
{
|
||||
return new();
|
||||
}
|
||||
|
||||
#region Pooya
|
||||
public List<CustomizeWorkshopEmployeeSettingsViewModel> GetEmployeeSettingsWithMonthlySalary(long workshopId)
|
||||
return new()
|
||||
{
|
||||
var query = _companyContext.CustomizeWorkshopGroupSettings.Where(x => x.MainGroup == false).Include(x => x)
|
||||
.Include(x => x.CustomizeWorkshopEmployeeSettingsCollection).Where(x => x.CustomizeWorkshopEmployeeSettingsCollection.Any(y =>
|
||||
ShiftsList = entity.CustomizeWorkshopSettingsShifts.Select(x => new CustomizeWorkshopShiftViewModel()
|
||||
{
|
||||
EndTime = x.EndTime.ToString("HH:mm"),
|
||||
StartTime = x.StartTime.ToString("HH:mm"),
|
||||
Placement = x.Placement
|
||||
}).ToList(),
|
||||
Id = entity.id,
|
||||
WorkshopId = entity.WorkshopId,
|
||||
WorkshopShiftStatus = entity.WorkshopShiftStatus,
|
||||
FridayWork = entity.FridayWork,
|
||||
HolidayWork = entity.HolidayWork
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
public List<ChangedGroupedViewModel> GetShiftChangesGroupAndEmployees(long customizeWorkshopSettingsId)
|
||||
{
|
||||
|
||||
|
||||
var result = from groupSetting in _companyContext.CustomizeWorkshopGroupSettings.AsSplitQuery()
|
||||
where groupSetting.IsShiftChange // Filter parent tables where isChange is true
|
||||
join employeeSettings in _companyContext.CustomizeWorkshopEmployeeSettings on groupSetting.id equals employeeSettings.CustomizeWorkshopGroupSettingId
|
||||
where employeeSettings.IsShiftChanged// Filter child tables where isChange is true
|
||||
join employee in _companyContext.Employees on employeeSettings.EmployeeId equals employee.id
|
||||
group new { employee.FullName, groupSetting.GroupName } by groupSetting.id into grouped
|
||||
select new ChangedGroupedViewModel
|
||||
{
|
||||
GroupName = grouped.First().GroupName,
|
||||
EmployeeName = grouped.Select(e => e.FullName).ToList()
|
||||
};
|
||||
|
||||
return result.ToList();
|
||||
|
||||
}
|
||||
|
||||
public CustomizeWorkshopSettingsViewModel GetWorkshopIncludeGroupsByWorkshopId(long workshopId)
|
||||
{
|
||||
var customizeWorkshopSettings = _companyContext.CustomizeWorkshopSettings
|
||||
.AsNoTracking().AsSplitQuery().Where(x => x.WorkshopId == workshopId)
|
||||
.Include(x => x.CustomizeWorkshopGroupSettingsCollection)
|
||||
.Select(x => new CustomizeWorkshopSettingsViewModel()
|
||||
{
|
||||
Id = x.id,
|
||||
WorkshopShiftStatus = x.WorkshopShiftStatus,
|
||||
GroupSettings = x.CustomizeWorkshopGroupSettingsCollection.Select(g =>
|
||||
new CustomizeWorkshopGroupSettingsViewModel()
|
||||
{
|
||||
Id = g.id,
|
||||
IrregularShift = g.IrregularShift,
|
||||
WorkshopShiftStatus = g.WorkshopShiftStatus,
|
||||
GroupName = g.GroupName,
|
||||
MainGroup = g.MainGroup,
|
||||
RollCallWorkshopShifts = g.CustomizeWorkshopGroupSettingsShifts.Select(s =>
|
||||
new CustomizeWorkshopShiftViewModel()
|
||||
{
|
||||
StartTime = s.StartTime.ToString("HH:mm"),
|
||||
EndTime = s.EndTime.ToString("HH:mm"),
|
||||
Placement = s.Placement,
|
||||
}).ToList(),
|
||||
BreakTime = g.BreakTime,
|
||||
HolidayWork = g.HolidayWork,
|
||||
FridayWork = g.FridayWork,
|
||||
CustomizeRotatingShiftsViewModels = g.CustomizeRotatingShifts.Select(r => new CustomizeRotatingShiftsViewModel()
|
||||
{
|
||||
EndTime = r.EndTime.ToString("HH:mm"),
|
||||
StartTime = r.StartTime.ToString("HH:mm")
|
||||
}).ToList()
|
||||
|
||||
}).ToList(),
|
||||
|
||||
|
||||
}).FirstOrDefault();
|
||||
|
||||
return customizeWorkshopSettings;
|
||||
}
|
||||
|
||||
public CustomizeWorkshopEmployeeSettingsViewModel GetEmployeeSettingsByWorkshopIdEmployeeId(long workshopId, long employeeId)
|
||||
{
|
||||
var employee = _companyContext.CustomizeWorkshopSettings
|
||||
.AsSplitQuery().Include(x => x.CustomizeWorkshopGroupSettingsCollection)
|
||||
.ThenInclude(x => x.CustomizeWorkshopEmployeeSettingsCollection)
|
||||
.FirstOrDefault(x => x.WorkshopId == workshopId)?.CustomizeWorkshopGroupSettingsCollection.SelectMany(x => x.CustomizeWorkshopEmployeeSettingsCollection)
|
||||
.FirstOrDefault(x => x.EmployeeId == employeeId);
|
||||
|
||||
if (employee == null)
|
||||
return new();
|
||||
|
||||
var employeeName = _companyContext.Employees.Select(x => new { x.FullName, x.id })
|
||||
.FirstOrDefault(x => x.id == employee.EmployeeId);
|
||||
return new CustomizeWorkshopEmployeeSettingsViewModel()
|
||||
{
|
||||
Id = employee.id,
|
||||
EmployeeId = employee.EmployeeId,
|
||||
IsSettingChanged = employee.IsSettingChanged,
|
||||
IsShiftChanged = employee.IsShiftChanged,
|
||||
Name = employeeName?.FullName,
|
||||
RollCallWorkshopShifts = employee.CustomizeWorkshopEmployeeSettingsShifts.Select(x =>
|
||||
new CustomizeWorkshopShiftViewModel()
|
||||
{
|
||||
EndTime = x.EndTime.ToString("HH:mm"),
|
||||
Placement = x.Placement,
|
||||
StartTime = x.StartTime.ToString("HH:mm")
|
||||
}).ToList(),
|
||||
Salary = employee.Salary
|
||||
};
|
||||
}
|
||||
|
||||
#region Pooya
|
||||
public List<CustomizeWorkshopEmployeeSettingsViewModel> GetEmployeeSettingsWithMonthlySalary(long workshopId)
|
||||
{
|
||||
var query = _companyContext.CustomizeWorkshopGroupSettings.Where(x => x.MainGroup == false).Include(x => x)
|
||||
.Include(x => x.CustomizeWorkshopEmployeeSettingsCollection).Where(x => x.CustomizeWorkshopEmployeeSettingsCollection.Any(y =>
|
||||
y.WorkshopId == workshopId)).SelectMany(x => x.CustomizeWorkshopEmployeeSettingsCollection)
|
||||
.Where(x => x.Salary > 0).Select(x =>
|
||||
.Where(x => x.Salary > 0).Select(x =>
|
||||
new CustomizeWorkshopEmployeeSettingsViewModel()
|
||||
{
|
||||
WorkshopShiftStatus = x.WorkshopShiftStatus,
|
||||
@@ -361,26 +374,31 @@ namespace CompanyManagment.EFCore.Repository
|
||||
EmployeeId = x.EmployeeId,
|
||||
BreakTime = x.BreakTime
|
||||
});
|
||||
return query.ToList();
|
||||
}
|
||||
|
||||
public List<CustomizeWorkshopEmployeeSettingsViewModel> GetEmployeeSettingsByWorkshopId(long workshopId)
|
||||
{
|
||||
return _companyContext.CustomizeWorkshopSettings.AsNoTracking().Where(x => x.WorkshopId == workshopId).Include(x => x.CustomizeWorkshopGroupSettingsCollection)
|
||||
.ThenInclude(x => x.CustomizeWorkshopEmployeeSettingsCollection).SelectMany(x => x.CustomizeWorkshopGroupSettingsCollection
|
||||
.SelectMany(y => y.CustomizeWorkshopEmployeeSettingsCollection))
|
||||
.Select(x => new CustomizeWorkshopEmployeeSettingsViewModel
|
||||
{
|
||||
BreakTime = x.BreakTime,
|
||||
IsShiftChanged = x.IsShiftChanged,
|
||||
IsSettingChanged = x.IsSettingChanged,
|
||||
EmployeeId = x.EmployeeId,
|
||||
Id = x.id,
|
||||
Salary = x.Salary,
|
||||
GroupSettingsId = x.CustomizeWorkshopGroupSettingId
|
||||
}).ToList();
|
||||
}
|
||||
|
||||
#endregion
|
||||
return query.ToList();
|
||||
}
|
||||
|
||||
public List<CustomizeWorkshopEmployeeSettingsViewModel> GetEmployeeSettingsByWorkshopId(long workshopId)
|
||||
{
|
||||
return _companyContext.CustomizeWorkshopSettings.AsNoTracking().Where(x => x.WorkshopId == workshopId).Include(x => x.CustomizeWorkshopGroupSettingsCollection)
|
||||
.ThenInclude(x => x.CustomizeWorkshopEmployeeSettingsCollection).SelectMany(x => x.CustomizeWorkshopGroupSettingsCollection
|
||||
.SelectMany(y => y.CustomizeWorkshopEmployeeSettingsCollection))
|
||||
.Select(x => new CustomizeWorkshopEmployeeSettingsViewModel
|
||||
{
|
||||
BreakTime = x.BreakTime,
|
||||
IsShiftChanged = x.IsShiftChanged,
|
||||
IsSettingChanged = x.IsSettingChanged,
|
||||
EmployeeId = x.EmployeeId,
|
||||
Id = x.id,
|
||||
Salary = x.Salary,
|
||||
GroupSettingsId = x.CustomizeWorkshopGroupSettingId
|
||||
}).ToList();
|
||||
}
|
||||
|
||||
public CustomizeWorkshopSettings GetBy(long workshopId)
|
||||
{
|
||||
return _companyContext.CustomizeWorkshopSettings.AsSplitQuery()
|
||||
.FirstOrDefault(x => x.WorkshopId == workshopId);
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
@@ -30,8 +30,12 @@ public class EmployeeComputeOptionsRepository : RepositoryBase<long, EmployeeCom
|
||||
ComputeOptions = x.ComputeOptions,
|
||||
YearsOptions = x.YearsOptions,
|
||||
BonusesOptions = x.BonusesOptions,
|
||||
SignCheckout = x.SignCheckout,
|
||||
CreateCheckout = x.CreateCheckout,
|
||||
CreateContract = x.CreateContract,
|
||||
SignContract = x.SignContract,
|
||||
|
||||
}).FirstOrDefault(x => x.WorkshopId == workshopId && x.EmployeeId == employeeId);
|
||||
}).FirstOrDefault(x => x.WorkshopId == workshopId && x.EmployeeId == employeeId);
|
||||
|
||||
if (result == null)
|
||||
{
|
||||
@@ -45,7 +49,11 @@ public class EmployeeComputeOptionsRepository : RepositoryBase<long, EmployeeCom
|
||||
ComputeOptions = getFromWorkshop.ComputeOptions,
|
||||
YearsOptions = getFromWorkshop.YearsOptions,
|
||||
BonusesOptions= getFromWorkshop.BonusesOptions,
|
||||
};
|
||||
CreateCheckout = true,
|
||||
CreateContract = true,
|
||||
SignCheckout = true,
|
||||
SignContract = true
|
||||
};
|
||||
|
||||
result = fromWorkshop;
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -415,8 +415,9 @@ public class InsuranceListRepository : RepositoryBase<long, InsuranceList>, IIns
|
||||
EmployerId = result.employer.First().EmployerId,
|
||||
DebtDone = result.insurance.Debt.IsDone,
|
||||
EmployerApproved = result.insurance.EmployerApproval.IsDone,
|
||||
InspectionDone = result.insurance.Inspection.IsDone
|
||||
});
|
||||
InspectionDone = result.insurance.Inspection.IsDone,
|
||||
EmployerApprovalStatus = result.insurance.EmployerApproval.Status
|
||||
});
|
||||
|
||||
query = searchModel.Status switch
|
||||
{
|
||||
@@ -1492,33 +1493,108 @@ public class InsuranceListRepository : RepositoryBase<long, InsuranceList>, IIns
|
||||
return res.ToList();
|
||||
}
|
||||
|
||||
public async Task<InsuranceListTabsCountViewModel> GetTabCounts(long accountId, int month, int year)
|
||||
{
|
||||
var workshopIds = _context.WorkshopAccounts
|
||||
.Where(a => a.AccountId == accountId)
|
||||
.Select(a => a.WorkshopId);
|
||||
var res = await _context.InsuranceListSet
|
||||
.Where(x =>
|
||||
x.Year == year.ToString("0000") &&
|
||||
x.Month == month.ToString("00") &&
|
||||
workshopIds.Contains(x.WorkshopId)
|
||||
)
|
||||
.GroupBy(x => 1)
|
||||
.Select(g => new InsuranceListTabsCountViewModel
|
||||
{
|
||||
NotStarted = g.Count(x =>
|
||||
!x.Debt.IsDone && !x.EmployerApproval.IsDone && !x.Inspection.IsDone && !x.ConfirmSentlist),
|
||||
InProgress = g.Count(x =>
|
||||
(x.Debt.IsDone || x.EmployerApproval.IsDone || x.Inspection.IsDone)&& !(x.Debt.IsDone && x.EmployerApproval.IsDone && x.Inspection.IsDone) && !x.ConfirmSentlist),
|
||||
ReadyToSendList = g.Count(x =>
|
||||
x.Debt.IsDone && x.EmployerApproval.IsDone && x.Inspection.IsDone && !x.ConfirmSentlist),
|
||||
Done = g.Count(x => x.ConfirmSentlist)
|
||||
})
|
||||
.FirstOrDefaultAsync() ?? new InsuranceListTabsCountViewModel();
|
||||
public async Task<InsuranceListTabsCountViewModel> GetTabCounts(InsuranceListSearchModel searchModel)
|
||||
{
|
||||
var acountId = _authHelper.CurrentAccountId();
|
||||
|
||||
return res;
|
||||
var workshopIds = _context.WorkshopAccounts
|
||||
.Where(a => a.AccountId == acountId)
|
||||
.Select(a => a.WorkshopId);
|
||||
var query = _context.InsuranceListSet
|
||||
.Where(x => workshopIds.Contains(x.WorkshopId))
|
||||
.Join(_context.Workshops.Include(x => x.InsuranceWorkshopInfo),
|
||||
insurance => insurance.WorkshopId,
|
||||
workshop => workshop.id,
|
||||
(insurance, workshop) => new { insurance, workshop })
|
||||
.GroupJoin(_context.WorkshopEmployers,
|
||||
result => result.workshop.id,
|
||||
employer => employer.WorkshopId,
|
||||
(result, employer) => new { result.insurance, result.workshop, employer })
|
||||
.Select(result => new InsuranceListViewModel
|
||||
{
|
||||
Id = result.insurance.id,
|
||||
Year = result.insurance.Year,
|
||||
Month = result.insurance.Month,
|
||||
WorkShopId = result.insurance.WorkshopId,
|
||||
WorkShopCode = result.workshop.InsuranceWorkshopInfo != null ? result.workshop.InsuranceWorkshopInfo.InsuranceCode : result.workshop.InsuranceCode,
|
||||
WorkShopName = result.workshop.InsuranceWorkshopInfo != null ? result.workshop.InsuranceWorkshopInfo.WorkshopName : result.workshop.WorkshopFullName,
|
||||
TypeOfInsuranceSend = result.workshop.TypeOfInsuranceSend == "NormalList" ? "عادی" :
|
||||
result.workshop.TypeOfInsuranceSend == "Govermentlist" ? "کمک دولت" :
|
||||
result.workshop.TypeOfInsuranceSend == "Familylist" ? "خانوادگی" : "",
|
||||
FixedSalary = result.workshop.FixedSalary,
|
||||
EmployerName = result.workshop.InsuranceWorkshopInfo != null ? result.workshop.InsuranceWorkshopInfo.EmployerName : result.workshop.WorkshopFullName,
|
||||
ConfirmSentlist = result.insurance.ConfirmSentlist,
|
||||
EmployerId = result.employer.First().EmployerId,
|
||||
DebtDone = result.insurance.Debt.IsDone,
|
||||
EmployerApproved = result.insurance.EmployerApproval.IsDone,
|
||||
InspectionDone = result.insurance.Inspection.IsDone
|
||||
});
|
||||
|
||||
}
|
||||
if (!string.IsNullOrEmpty(searchModel.Year) && searchModel.Year != "0" && !string.IsNullOrEmpty(searchModel.Month) && searchModel.Month != "0")
|
||||
query = query.Where(x => x.Year == searchModel.Year && x.Month == searchModel.Month);
|
||||
else
|
||||
{
|
||||
if (!string.IsNullOrEmpty(searchModel.Month) && searchModel.Month != "0")
|
||||
query = query.Where(x => x.Month == searchModel.Month);
|
||||
|
||||
if (!string.IsNullOrEmpty(searchModel.Year) && searchModel.Year != "0")
|
||||
query = query.Where(x => x.Year == searchModel.Year);
|
||||
|
||||
}
|
||||
if (!string.IsNullOrEmpty(searchModel.WorkShopCode))
|
||||
query = query.Where(x => x.WorkShopCode == searchModel.WorkShopCode);
|
||||
|
||||
if (!string.IsNullOrEmpty(searchModel.WorkShopName))
|
||||
query = query.Where(x => x.WorkShopName.Contains(searchModel.WorkShopName));
|
||||
|
||||
|
||||
if (searchModel.WorkshopId > 0)
|
||||
{
|
||||
var workshopName = query.FirstOrDefault(u => u.WorkShopId == searchModel.WorkshopId)?.WorkShopName;
|
||||
|
||||
query = query.Where(x => x.WorkShopName.Contains(workshopName));
|
||||
}
|
||||
|
||||
if (searchModel.EmployerId > 0)
|
||||
{
|
||||
var employerName = query.FirstOrDefault(u => u.EmployerId == searchModel.EmployerId)?.EmployerName;
|
||||
query = query.Where(x => x.EmployerName.Contains(employerName));
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(searchModel.EmployerName))
|
||||
query = query.Where(x => x.EmployerName.Contains(searchModel.EmployerName));
|
||||
|
||||
|
||||
if (searchModel.FixedSalary != null)
|
||||
query = query.Where(x => x.FixedSalary == searchModel.FixedSalary);
|
||||
|
||||
if (!string.IsNullOrEmpty(searchModel.TypeOfInsuranceSend) && searchModel.TypeOfInsuranceSend != "0")
|
||||
query = query.Where(x => x.TypeOfInsuranceSend == searchModel.TypeOfInsuranceSend);
|
||||
|
||||
if (!string.IsNullOrEmpty(searchModel.City) && searchModel.City != "0")
|
||||
query = query.Where(x => x.City == searchModel.City);
|
||||
|
||||
if (!string.IsNullOrEmpty(searchModel.Branch))
|
||||
query = query.Where(x => x.Branch.Contains(searchModel.Branch));
|
||||
|
||||
|
||||
|
||||
var res = await query.GroupBy(x => 1)
|
||||
.Select(g => new InsuranceListTabsCountViewModel
|
||||
{
|
||||
NotStarted = g.Count(x =>
|
||||
!x.DebtDone && !x.EmployerApproved && !x.InspectionDone && !x.ConfirmSentlist),
|
||||
InProgress = g.Count(x =>
|
||||
(x.DebtDone || x.EmployerApproved || x.InspectionDone) && !(x.DebtDone && x.EmployerApproved && x.InspectionDone) && !x.ConfirmSentlist),
|
||||
ReadyToSendList = g.Count(x =>
|
||||
x.DebtDone && x.EmployerApproved && x.InspectionDone && !x.ConfirmSentlist),
|
||||
Done = g.Count(x => x.ConfirmSentlist)
|
||||
})
|
||||
.FirstOrDefaultAsync() ?? new InsuranceListTabsCountViewModel();
|
||||
|
||||
return res;
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
|
||||
@@ -1,10 +1,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using _0_Framework.Application;
|
||||
using _0_Framework.Application.Enums;
|
||||
using _0_Framework.Exceptions;
|
||||
using _0_Framework.InfraStructure;
|
||||
using AccountManagement.Application.Contracts.Account;
|
||||
using AccountMangement.Infrastructure.EFCore;
|
||||
@@ -481,248 +478,6 @@ public class PersonalContractingPartyRepository : RepositoryBase<long, PersonalC
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
#region Api
|
||||
public async Task<ICollection<ContractingPartyGetListViewModel>> GetList(ContractingPartyGetListSearchModel searchModel)
|
||||
{
|
||||
var personalContractingPartiesQuery = _context.PersonalContractingParties
|
||||
.Include(x => x.Representative)
|
||||
.Include(x => x.Employers).AsQueryable();
|
||||
|
||||
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(searchModel.NationalIdOrNationalCode))
|
||||
personalContractingPartiesQuery = personalContractingPartiesQuery
|
||||
.Where(x => x.Nationalcode.Contains(searchModel.NationalIdOrNationalCode) ||
|
||||
x.NationalId.Contains(searchModel.NationalIdOrNationalCode));
|
||||
|
||||
|
||||
if (searchModel.ContractingPartyType != LegalType.None)
|
||||
|
||||
{
|
||||
string type = searchModel.ContractingPartyType switch
|
||||
{
|
||||
LegalType.Legal => "حقوقی",
|
||||
LegalType.Real => "حقیقی",
|
||||
_ => ""
|
||||
};
|
||||
|
||||
personalContractingPartiesQuery = personalContractingPartiesQuery
|
||||
.Where(x => x.IsLegal == type);
|
||||
|
||||
}
|
||||
|
||||
|
||||
if (searchModel.ContractingPartyStatus != ActivationStatus.None)
|
||||
{
|
||||
string status = searchModel.ContractingPartyStatus switch
|
||||
{
|
||||
ActivationStatus.Active => "true",
|
||||
ActivationStatus.DeActive => "false",
|
||||
_ => ""
|
||||
};
|
||||
personalContractingPartiesQuery = personalContractingPartiesQuery
|
||||
.Where(x => x.IsActiveString == status);
|
||||
}
|
||||
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(searchModel.RepresentativeName))
|
||||
{
|
||||
personalContractingPartiesQuery = personalContractingPartiesQuery
|
||||
.Where(x => x.Representative.FullName.Contains(searchModel.RepresentativeName));
|
||||
}
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(searchModel.FullNameOrCompanyName))
|
||||
{
|
||||
personalContractingPartiesQuery = personalContractingPartiesQuery.Where(x =>
|
||||
(x.FName + " " + x.LName).Contains(searchModel.FullNameOrCompanyName));
|
||||
}
|
||||
var joinedQuery = personalContractingPartiesQuery
|
||||
.GroupJoin(_context.InstitutionContractSet.Where(x => personalContractingPartiesQuery.Any(p => p.id == x.ContractingPartyId)),
|
||||
contractingParty => contractingParty.id,
|
||||
institution => institution.ContractingPartyId,
|
||||
(contractingParty, institution) => new
|
||||
{
|
||||
contractingParty,
|
||||
institution
|
||||
});
|
||||
|
||||
var result = await joinedQuery.Skip(searchModel.PageIndex)
|
||||
.Take(30).Select(x => new ContractingPartyGetListViewModel()
|
||||
{
|
||||
ArchiveCode = x.contractingParty.ArchiveCode,
|
||||
BlockTimes = x.contractingParty.BlockTimes,
|
||||
|
||||
ContractingPartyName = x.contractingParty.IsLegal == "حقیقی" ?
|
||||
x.contractingParty.SureName == null ? $"{x.contractingParty.FName} {x.contractingParty.LName}"
|
||||
: $"{x.contractingParty.FName} {x.contractingParty.LName} {x.contractingParty.SureName}"
|
||||
: x.contractingParty.SureName == null ? $"{x.contractingParty.LName}"
|
||||
: $"{x.contractingParty.LName} {x.contractingParty.SureName}",
|
||||
|
||||
ContractingPartyType = x.contractingParty.IsLegal == "حقیقی" ? LegalType.Real : LegalType.Legal,
|
||||
Employers = x.contractingParty.Employers.Take(11).Select(e => new ContractingPartyGetListEmployerViewModel(e.id, e.FullName)).ToList(),
|
||||
Id = x.contractingParty.id,
|
||||
IsBlock = x.contractingParty.IsBlock == "true",
|
||||
HasInstitutionContract = x.institution.Any(i => i.IsActiveString == "true"),
|
||||
NationalIdOrNationalCode = x.contractingParty.IsLegal == "حقیقی" ? x.contractingParty.Nationalcode : x.contractingParty.NationalId,
|
||||
Status = x.contractingParty.IsActiveString == "true" ? ActivationStatus.Active : ActivationStatus.DeActive
|
||||
}).ToListAsync();
|
||||
return result;
|
||||
}
|
||||
|
||||
public async Task<List<ContractingPartySelectListViewModel>> GetSelectList()
|
||||
{
|
||||
return await _context.PersonalContractingParties.Select(x => new ContractingPartySelectListViewModel
|
||||
{
|
||||
Id = x.id,
|
||||
Text = x.IsLegal == "حقیقی" ? x.SureName == null
|
||||
? $"{x.FName} {x.LName}"
|
||||
: $"{x.FName} {x.LName} {x.SureName}"
|
||||
: x.SureName == null ? $"{x.LName}"
|
||||
: $"{x.LName} {x.SureName}",
|
||||
|
||||
}).ToListAsync();
|
||||
}
|
||||
|
||||
public async Task<List<GetContractingPartyNationalCodeOrNationalIdViewModel>> GetNationalCodeOrNationalId()
|
||||
{
|
||||
return await _context.PersonalContractingParties.Select(x => new GetContractingPartyNationalCodeOrNationalIdViewModel
|
||||
{
|
||||
NationalCodeOrNationalId = x.IsLegal == "true" ? x.NationalId : x.Nationalcode
|
||||
}).ToListAsync();
|
||||
}
|
||||
|
||||
public async Task<OperationResult<string>> DeactivateWithSubordinates(long id)
|
||||
{
|
||||
var op = new OperationResult<string>();
|
||||
;
|
||||
using (var transaction = await _context.Database.BeginTransactionAsync())
|
||||
{
|
||||
try
|
||||
{
|
||||
var contractingParty = await _context.PersonalContractingParties
|
||||
.Include(x => x.Employers)
|
||||
.ThenInclude(x => x.Contracts)
|
||||
.Include(x => x.Employers)
|
||||
.ThenInclude(x => x.WorkshopEmployers)
|
||||
.ThenInclude(x => x.Workshop)
|
||||
.ThenInclude(x => x.Checkouts).FirstOrDefaultAsync(x => x.id == id);
|
||||
if (contractingParty == null)
|
||||
{
|
||||
return op.Failed("چنین آیتمی وجود ندارد");
|
||||
}
|
||||
|
||||
var employers = contractingParty.Employers;
|
||||
|
||||
var workshops = employers.SelectMany(x => x.WorkshopEmployers).Select(x => x.Workshop).ToList();
|
||||
|
||||
var contracts = employers.SelectMany(x => x.Contracts).ToList();
|
||||
|
||||
var checkouts = workshops.SelectMany(x => x.Checkouts).ToList();
|
||||
|
||||
|
||||
contractingParty.DeActive();
|
||||
|
||||
foreach (var employer in employers)
|
||||
{
|
||||
employer.DeActive();
|
||||
}
|
||||
|
||||
foreach (var workshop in workshops)
|
||||
{
|
||||
workshop.DeActive(workshop.ArchiveCode);
|
||||
}
|
||||
|
||||
foreach (var contract in contracts)
|
||||
{
|
||||
contract.DeActive();
|
||||
}
|
||||
|
||||
foreach (var checkout in checkouts)
|
||||
{
|
||||
checkout.DeActive();
|
||||
}
|
||||
|
||||
await _context.SaveChangesAsync();
|
||||
|
||||
await transaction.CommitAsync();
|
||||
return op.Succcedded("DeActivate");
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
await transaction.RollbackAsync();
|
||||
return op.Failed("غیرفعال کردن طرف حساب با خطا مواجه شد");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public async Task<GetRealContractingPartyDetailsViewModel> GetRealDetails(long id)
|
||||
{
|
||||
var res = await _context.PersonalContractingParties.Where(x => x.IsLegal == "حقیقی").Select(x =>
|
||||
new GetRealContractingPartyDetailsViewModel()
|
||||
{
|
||||
Id = x.id,
|
||||
IdNumber = x.IdNumber,
|
||||
PhoneNumber = x.Phone,
|
||||
AgentPhone = x.AgentPhone,
|
||||
Address = x.Address,
|
||||
FullName = x.SureName == null
|
||||
? $"{x.FName} {x.LName}"
|
||||
: $"{x.FName} {x.LName} {x.SureName}",
|
||||
NationalCode = x.Nationalcode,
|
||||
RepresentativeName = x.RepresentativeFullName,
|
||||
ArchiveCode = x.ArchiveCode,
|
||||
City = x.City,
|
||||
FName = x.FName,
|
||||
LName = x.LName,
|
||||
SureName = x.SureName,
|
||||
RepresentativeId = x.RepresentativeId,
|
||||
State = x.State,
|
||||
Zone = x.Zone
|
||||
}).FirstOrDefaultAsync(x => x.Id == id);
|
||||
|
||||
if (res == null)
|
||||
{
|
||||
throw new BadRequestException("چنین طرف حسابی وجود ندارد");
|
||||
}
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
public async Task<GetLegalContractingPartyDetailsViewModel> GetLegalDetails(long id)
|
||||
{
|
||||
var res = await _context.PersonalContractingParties.Where(x => x.IsLegal == "حقوقی").Select(x =>
|
||||
new GetLegalContractingPartyDetailsViewModel()
|
||||
{
|
||||
Id = x.id,
|
||||
PhoneNumber = x.Phone,
|
||||
AgentPhone = x.AgentPhone,
|
||||
Address = x.Address,
|
||||
CompanyFullName = x.SureName == null
|
||||
? $"{x.LName}"
|
||||
: $"{x.LName} {x.SureName}",
|
||||
NationalId = x.NationalId,
|
||||
RegisterId = x.RegisterId,
|
||||
RepresentativeName = x.RepresentativeFullName,
|
||||
RepresentativeId = x.RepresentativeId,
|
||||
State = x.State,
|
||||
SureName = x.SureName,
|
||||
Zone = x.Zone,
|
||||
ArchiveCode = x.ArchiveCode,
|
||||
City = x.City,
|
||||
CompanyName = x.LName
|
||||
}).FirstOrDefaultAsync(x => x.Id == id);
|
||||
|
||||
if (res == null)
|
||||
{
|
||||
throw new BadRequestException("چنین طرف حسابی وجود ندارد");
|
||||
}
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Numerics;
|
||||
using _0_Framework.Application;
|
||||
using _0_Framework.InfraStructure;
|
||||
using Company.Domain.InstitutionPlanAgg;
|
||||
@@ -169,6 +170,7 @@ public class PlanPercentageRepository : RepositoryBase<long, PlanPercentage>, IP
|
||||
|
||||
}
|
||||
|
||||
|
||||
public InstitutionPlanViewModel GetInstitutionPlanForWorkshop(WorkshopTempViewModel command)
|
||||
{
|
||||
var planPercentage = _context.PlanPercentages.FirstOrDefault();
|
||||
@@ -182,10 +184,7 @@ public class PlanPercentageRepository : RepositoryBase<long, PlanPercentage>, IP
|
||||
|
||||
var dailyWage = dailyWageYearlySalery.YearlySalaryItemsList.Where(x => x.ItemName == "مزد روزانه")
|
||||
.Select(x => x.ItemValue).FirstOrDefault();
|
||||
if (command.ContractAndCheckout)
|
||||
command.ContractAndCheckoutInPerson = true;
|
||||
if(command.Insurance)
|
||||
command.InsuranceInPerson = true;
|
||||
|
||||
|
||||
if (command.CountPerson > 0)
|
||||
{
|
||||
@@ -194,28 +193,28 @@ public class PlanPercentageRepository : RepositoryBase<long, PlanPercentage>, IP
|
||||
.Select(plan => new InstitutionPlanViewModel
|
||||
{
|
||||
CountPerson = plan.CountPerson,
|
||||
|
||||
|
||||
ContractAndCheckoutDouble = command.ContractAndCheckout ?
|
||||
((dailyWage * planPercentage.ContractAndCheckoutPercent / 100) * plan.CountPerson * plan.IncreasePercentage) : 0,
|
||||
|
||||
|
||||
InsuranceDouble = command.Insurance ? (((dailyWage * planPercentage.InsurancePercent) / 100) * plan.CountPerson *
|
||||
plan.IncreasePercentage) : 0,
|
||||
|
||||
|
||||
RollCallDouble = command.RollCall ? (((dailyWage * planPercentage.RollCallPercent) / 100) * plan.CountPerson *
|
||||
plan.IncreasePercentage) : 0,
|
||||
|
||||
CustomizeCheckoutDouble =command.CustomizeCheckout ? (((dailyWage * planPercentage.CustomizeCheckoutPercent) / 100) * plan.CountPerson *
|
||||
plan.IncreasePercentage) : 0,
|
||||
|
||||
ContractAndCheckoutInPersonDouble = command.ContractAndCheckoutInPerson ? (((dailyWage * planPercentage.ContractAndCheckoutInPersonPercent) / 100) * plan.CountPerson *
|
||||
|
||||
CustomizeCheckoutDouble = (((dailyWage * planPercentage.CustomizeCheckoutPercent) / 100) * plan.CountPerson *
|
||||
plan.IncreasePercentage),
|
||||
|
||||
ContractAndCheckoutInPersonDouble = command.ContractAndCheckoutInPerson ? (((dailyWage * planPercentage.ContractAndCheckoutInPersonPercent) / 100) * plan.CountPerson *
|
||||
plan.IncreasePercentage) : 0,
|
||||
|
||||
|
||||
InsuranceInPersonDouble = command.InsuranceInPerson ? (((dailyWage * planPercentage.InsuranceInPersonPercent) / 100) * plan.CountPerson *
|
||||
plan.IncreasePercentage) : 0,
|
||||
|
||||
|
||||
}).FirstOrDefault();
|
||||
|
||||
if (planByCountPerson == null)
|
||||
if(planByCountPerson == null)
|
||||
return new InstitutionPlanViewModel();
|
||||
//مبلغ کل خدمات حضوری
|
||||
var inPersonSumAmount = planByCountPerson.ContractAndCheckoutDouble + planByCountPerson.InsuranceDouble +
|
||||
@@ -237,7 +236,7 @@ public class PlanPercentageRepository : RepositoryBase<long, PlanPercentage>, IP
|
||||
{
|
||||
CountPerson = planByCountPerson.CountPerson,
|
||||
|
||||
ContractAndCheckout = planByCountPerson.ContractAndCheckoutDouble > 0 ? planByCountPerson.ContractAndCheckoutDouble.ToMoney() : "0",
|
||||
ContractAndCheckout = planByCountPerson.ContractAndCheckoutDouble > 0 ? planByCountPerson.ContractAndCheckoutDouble.ToMoney() : "0",
|
||||
|
||||
Insurance = planByCountPerson.InsuranceDouble > 0 ? planByCountPerson.InsuranceDouble.ToMoney() : "0",
|
||||
|
||||
@@ -260,7 +259,7 @@ public class PlanPercentageRepository : RepositoryBase<long, PlanPercentage>, IP
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
return new InstitutionPlanViewModel();
|
||||
}
|
||||
|
||||
@@ -2089,6 +2089,7 @@ public class ReportRepository : IReportRepository
|
||||
|
||||
var notCompletedWorkshops = accountWorkshopList.Select(workshop =>
|
||||
{
|
||||
|
||||
var contractSigned = workshop.Contracts2.Count(x => x.Signature == "1");
|
||||
var contractCreated = workshop.Contracts2.Count();
|
||||
int contractSignedPercent = 0;
|
||||
@@ -2103,9 +2104,12 @@ public class ReportRepository : IReportRepository
|
||||
|
||||
if (contractSignedPercent < 100 && contractCreated > 0)
|
||||
{
|
||||
|
||||
var contractEmployeeIds = workshop.Contracts2.Where(x => x.Signature == "0")
|
||||
.Select(x => x.EmployeeId).ToList();
|
||||
var lefts = workshop.LeftWorks.Select(x => x.EmployeeId).Distinct().ToList();
|
||||
var contractNotNullEmployeeId = lefts.Where(x => contractEmployeeIds.Contains(x)).ToList();
|
||||
var employeeNotDone =
|
||||
workshop.Contracts2.Where(x => x.Signature == "0").Select(l => new EmployeeNotDone()
|
||||
workshop.Contracts2.Where(x => x.Signature == "0" && contractNotNullEmployeeId.Contains(x.EmployeeId)).Select(l => new EmployeeNotDone()
|
||||
{
|
||||
Id = l.EmployeeId,
|
||||
EmployeeFullName = workshop.LeftWorks.FirstOrDefault(x => x.EmployeeId == l.EmployeeId)!.EmployeeFullName,
|
||||
|
||||
@@ -60,8 +60,8 @@ public class RollCallMandatoryRepository : RepositoryBase<long, RollCall>, IRoll
|
||||
_leaveRepository = leaveRepository;
|
||||
_holidayItemRepository = holidayItemRepository;
|
||||
_testDbContext = testDbContext;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#region OfficialChckout
|
||||
public ComputingViewModel MandatoryCompute(long employeeId, long workshopId, DateTime contractStart,
|
||||
@@ -108,8 +108,8 @@ public class RollCallMandatoryRepository : RepositoryBase<long, RollCall>, IRoll
|
||||
.Include(x => x.CustomizeWorkshopGroupSettings).FirstOrDefault(x =>
|
||||
x.WorkshopId == workshopId && x.EmployeeId == employeeId);
|
||||
//اگر ساعت استراحت پرسنل وجود نداشت صفر است
|
||||
var breakTime = settings == null ? new BreakTime(false, new TimeOnly()) : settings.BreakTime;
|
||||
|
||||
var breakTimeEntity = settings == null ? new BreakTime(false, new TimeOnly()) : settings.BreakTime;
|
||||
var endOfFarvardin = "1404/01/31".ToGeorgianDateTime();
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -125,10 +125,11 @@ public class RollCallMandatoryRepository : RepositoryBase<long, RollCall>, IRoll
|
||||
groupedRollCall = rollCallResult.GroupBy(x => x.ShiftDate.Date).Select(x => new GroupedRollCalls()
|
||||
{
|
||||
CreationDate = x.Key,
|
||||
ShiftList = x.Select(s => new ShiftList() { Start = s.StartDate!.Value, End = s.EndDate!.Value }).ToList(),
|
||||
ShiftList = x.Select(s => new ShiftList() { Start = s.StartDate!.Value, End = s.EndDate!.Value,EndWithOutResTime = s.ShiftEndWithoutRest.Value != null ? s.ShiftEndWithoutRest.Value : new DateTime()}).ToList(),
|
||||
HasFriday = x.Any(s => s.StartDate != null && s.EndDate != null && (s.StartDate.Value.DayOfWeek == DayOfWeek.Friday || s.EndDate.Value!.DayOfWeek == DayOfWeek.Friday)),
|
||||
|
||||
SumOneDaySpan = new TimeSpan(x.Sum(shift => shift.ShiftSpan.Ticks))
|
||||
SumOneDaySpan = new TimeSpan(x.Sum(shift => shift.ShiftSpan.Ticks)),
|
||||
BreakTime = x.First().BreakTimeSpan
|
||||
|
||||
}).OrderBy(x => x.CreationDate).ToList();
|
||||
}
|
||||
@@ -145,16 +146,31 @@ public class RollCallMandatoryRepository : RepositoryBase<long, RollCall>, IRoll
|
||||
BreakTimeSpan = x.BreakTimeSpan
|
||||
}).ToList();
|
||||
|
||||
groupedRollCall = rollCallResult.GroupBy(x => x.CreationDate.Date).Select(x => new GroupedRollCalls()
|
||||
groupedRollCall = rollCallResult.GroupBy(x => x.CreationDate.Date).Select(x =>
|
||||
{
|
||||
CreationDate = x.Key,
|
||||
ShiftList = x.Select(s => new ShiftList() { Start = s.StartDate!.Value, End = s.EndDate!.Value }).ToList(),
|
||||
HasFriday = x.Any(s => s.StartDate != null && s.EndDate != null && (s.StartDate.Value.DayOfWeek == DayOfWeek.Friday || s.EndDate.Value!.DayOfWeek == DayOfWeek.Friday)),
|
||||
SumOneDaySpan = new TimeSpan(x.Sum(shift => shift.ShiftSpan.Ticks)) - CalculateBreakTime(x.First().BreakTimeSpan,
|
||||
new TimeSpan(x.Sum(shift => shift.ShiftSpan.Ticks))),
|
||||
|
||||
BreakTime = CalculateBreakTime(x.First().BreakTimeSpan, new TimeSpan(x.Sum(shift => shift.ShiftSpan.Ticks))),
|
||||
TimeSpan breakTime;
|
||||
if (contractStart > endOfFarvardin)
|
||||
{
|
||||
breakTime = CalculateBreakTime(
|
||||
x.First().BreakTimeSpan,
|
||||
new TimeSpan(x.Sum(shift => shift.ShiftSpan.Ticks)));
|
||||
}
|
||||
else
|
||||
{
|
||||
breakTime = CalculateBreakTime(breakTimeEntity, new TimeSpan(x.Sum(shift => shift.ShiftSpan.Ticks)));
|
||||
}
|
||||
return new GroupedRollCalls()
|
||||
{
|
||||
CreationDate = x.Key,
|
||||
ShiftList = x.Select(s => new ShiftList() { Start = s.StartDate!.Value, End = s.EndDate!.Value, EndWithOutResTime = s.EndDate!.Value })
|
||||
.ToList(),
|
||||
HasFriday = x.Any(s =>
|
||||
s.StartDate != null && s.EndDate != null && (s.StartDate.Value.DayOfWeek == DayOfWeek.Friday ||
|
||||
s.EndDate.Value!.DayOfWeek == DayOfWeek.Friday)),
|
||||
SumOneDaySpan = new TimeSpan(x.Sum(shift => shift.ShiftSpan.Ticks)) - breakTime,
|
||||
|
||||
BreakTime = breakTime,
|
||||
};
|
||||
}).OrderBy(x => x.CreationDate).ToList();
|
||||
}
|
||||
|
||||
@@ -228,9 +244,9 @@ public class RollCallMandatoryRepository : RepositoryBase<long, RollCall>, IRoll
|
||||
double minutesDecimal = (starndardHoursesPerTotalDays - hours) * 60;
|
||||
int minutes = (int)minutesDecimal;
|
||||
|
||||
|
||||
TimeSpan totalLeaveSpan = TimeSpan.Zero;
|
||||
TimeSpan starndardHoursesPerTotalDaysSapn = new TimeSpan(hours, minutes, 0);
|
||||
if (leaveSearchResult.Count > 0)
|
||||
if (leaveSearchResult.Count > 0 || hoursesleave.Count > 0)
|
||||
{
|
||||
if (leaveSearchResult.Any(x => x.HasShiftDuration))
|
||||
{
|
||||
@@ -261,8 +277,8 @@ public class RollCallMandatoryRepository : RepositoryBase<long, RollCall>, IRoll
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
totalLeaveSpan = totalLeave;
|
||||
}
|
||||
else
|
||||
{
|
||||
int leavingDayCout = 0;
|
||||
@@ -311,7 +327,9 @@ public class RollCallMandatoryRepository : RepositoryBase<long, RollCall>, IRoll
|
||||
{
|
||||
sumSpans = sumSpans.Add(sumLeave);
|
||||
}
|
||||
}
|
||||
|
||||
totalLeaveSpan = sumLeave;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -343,9 +361,9 @@ public class RollCallMandatoryRepository : RepositoryBase<long, RollCall>, IRoll
|
||||
|
||||
|
||||
//***********************************//
|
||||
var dailyFix = TimeSpan.Parse("07:20");
|
||||
TimeSpan mandatoryHoursTimeSpan = new TimeSpan(7, 20, 0).Multiply(mandatorDays);
|
||||
TimeSpan Mandatory = sumSpansWhitOutleaves.Subtract(mandatoryHoursTimeSpan);
|
||||
//var dailyFix = TimeSpan.Parse("07:20");
|
||||
//TimeSpan mandatoryHoursTimeSpan = new TimeSpan(7, 20, 0).Multiply(mandatorDays);
|
||||
//TimeSpan Mandatory = sumSpansWhitOutleaves.Subtract(mandatoryHoursTimeSpan);
|
||||
|
||||
double mandatoryWorkWithOutleaves = (sumSpansWhitOutleaves.TotalMinutes) / 60;
|
||||
double overTimeWork = 0;
|
||||
@@ -621,45 +639,75 @@ public class RollCallMandatoryRepository : RepositoryBase<long, RollCall>, IRoll
|
||||
}
|
||||
else if (totalDays >= 28) // بالای 28 روز حد اقل 8 تغییر شیفت
|
||||
{
|
||||
validCount = 8;
|
||||
validCount = 6;
|
||||
}
|
||||
else
|
||||
{
|
||||
// تناسب گیری - اگر برای 28 روز 8 تغییر پس برای ایکس روز چند تغییر لازم است
|
||||
validCount = (int)((totalDays * 8) / 28);
|
||||
validCount = (int)((totalDays * 6) / 28);
|
||||
}
|
||||
string maxName;
|
||||
int maxValue = moriningCount;
|
||||
|
||||
if (moriningCount >= validCount)
|
||||
RotatingfaName.Add("صبح");
|
||||
if (eveningCount >= validCount)
|
||||
RotatingfaName.Add("عصر");
|
||||
if (nightCount >= validCount)
|
||||
RotatingfaName.Add("شب");
|
||||
var rotatingFaResult = "";
|
||||
if (RotatingfaName.Count > 1)// اگر تعداد شیفت های محاسبه شده بیش از یک بود
|
||||
{
|
||||
shiftOver22Hours = "0";
|
||||
shiftOver22Minuts = "0";
|
||||
for (var rotateNumber = 0; rotateNumber < RotatingfaName.Count; rotateNumber++)
|
||||
{
|
||||
if (rotateNumber == 0)
|
||||
rotatingFaResult = $"{RotatingfaName[rotateNumber]}";
|
||||
if (rotateNumber == 1)
|
||||
rotatingFaResult += $" و {RotatingfaName[rotateNumber]}";
|
||||
if (rotateNumber == 2)
|
||||
rotatingFaResult += $" و {RotatingfaName[rotateNumber]}";
|
||||
}
|
||||
}
|
||||
else if (RotatingfaName.Count <= 1)
|
||||
{
|
||||
rotatingFaResult = "نوبت کاری ندارد";
|
||||
maxName = "moriningCount";
|
||||
if (eveningCount > maxValue)
|
||||
{
|
||||
maxValue = eveningCount;
|
||||
maxName = "eveningCount";
|
||||
}
|
||||
if (nightCount > maxValue)
|
||||
{
|
||||
maxValue = nightCount;
|
||||
maxName = "nightCount";
|
||||
}
|
||||
|
||||
var over22Hours = (int)over22.TotalHours;
|
||||
var over22Minuts = (int)(over22.TotalMinutes % 60);
|
||||
shiftOver22Hours = over22Hours.ToString();
|
||||
shiftOver22Minuts = over22Minuts.ToString();
|
||||
int countOutOfRange = 0;
|
||||
|
||||
}
|
||||
switch (maxName)
|
||||
{
|
||||
case "moriningCount":
|
||||
countOutOfRange = eveningCount + nightCount;
|
||||
break;
|
||||
case "eveningCount":
|
||||
countOutOfRange = moriningCount + nightCount;
|
||||
break;
|
||||
case "nightCount":
|
||||
countOutOfRange = moriningCount + eveningCount;
|
||||
break;
|
||||
}
|
||||
var rotatingFaResult = "";
|
||||
if (countOutOfRange >= validCount)
|
||||
{
|
||||
shiftOver22Hours = "0";
|
||||
shiftOver22Minuts = "0";
|
||||
if (moriningCount >= 1)
|
||||
RotatingfaName.Add("صبح");
|
||||
if (eveningCount >= 1)
|
||||
RotatingfaName.Add("عصر");
|
||||
if (nightCount >= 1)
|
||||
RotatingfaName.Add("شب");
|
||||
for (var rotateNumber = 0; rotateNumber < RotatingfaName.Count; rotateNumber++)
|
||||
{
|
||||
if (rotateNumber == 0)
|
||||
rotatingFaResult = $"{RotatingfaName[rotateNumber]}";
|
||||
if (rotateNumber == 1)
|
||||
rotatingFaResult += $" و {RotatingfaName[rotateNumber]}";
|
||||
if (rotateNumber == 2)
|
||||
rotatingFaResult += $" و {RotatingfaName[rotateNumber]}";
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
rotatingFaResult = "نوبت کاری ندارد";
|
||||
|
||||
var over22Hours = (int)over22.TotalHours;
|
||||
var over22Minuts = (int)(over22.TotalMinutes % 60);
|
||||
shiftOver22Hours = over22Hours.ToString();
|
||||
shiftOver22Minuts = over22Minuts.ToString();
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
//******* محاسبه مبلغ نوبت کاری *************
|
||||
#region ShiftPayPercent
|
||||
@@ -688,11 +736,30 @@ public class RollCallMandatoryRepository : RepositoryBase<long, RollCall>, IRoll
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
#endregion
|
||||
|
||||
#region Result
|
||||
#region Result
|
||||
LeaveSearchModel sickLeaveSearch = new LeaveSearchModel()
|
||||
{
|
||||
EmployeeId = employeeId,
|
||||
WorkshopId = workshopId,
|
||||
LeaveType = "استعلاجی",
|
||||
PaidLeaveType = "روزانه",
|
||||
StartLeaveGr = contractStart,
|
||||
EndLeaveGr = contractEnd,
|
||||
IsAccepted = true,
|
||||
};
|
||||
var sickLeaveSearchResult = _leaveRepository.search(sickLeaveSearch);
|
||||
|
||||
var res = new ComputingViewModel()
|
||||
var sickLeaveTimeSpans = sickLeaveSearchResult.Select(x =>
|
||||
{
|
||||
var startLeave = contractStart > x.StartLeaveGr ? contractStart : x.StartLeaveGr;
|
||||
var endLeave = contractEnd < x.EndLeaveGr ? contractEnd : x.EndLeaveGr;
|
||||
|
||||
return (endLeave - startLeave).Add(TimeSpan.FromDays(1));
|
||||
});
|
||||
var totalBreakTime = new TimeSpan(groupedRollCall.Sum(x => x.BreakTime.Ticks));
|
||||
var res = new ComputingViewModel()
|
||||
{
|
||||
|
||||
NumberOfWorkingDays = $"{groupedRollCall.Count}",
|
||||
@@ -720,60 +787,70 @@ public class RollCallMandatoryRepository : RepositoryBase<long, RollCall>, IRoll
|
||||
TotalHolidayAndNotM = totalHolidaysAndNotM.ToString(),
|
||||
DayliFeeComplete = dayliFeeComplete,
|
||||
MarriedAllowance = MarriedAllowanceStr,
|
||||
RotatingShiftValue = shiftPayValue
|
||||
};
|
||||
RotatingShiftValue = shiftPayValue,
|
||||
|
||||
#region SaveRollCall
|
||||
|
||||
GroupedRollCalls = groupedRollCall,
|
||||
TotalWorkingTimeSpan = sumSpansWhitOutleaves,
|
||||
TotalBreakTimeSpan = totalBreakTime,
|
||||
TotalPresentTimeSpan = sumSpansWhitOutleaves + totalBreakTime,
|
||||
TotalPaidLeave = totalLeaveSpan,
|
||||
TotalSickLeave = new TimeSpan(sickLeaveTimeSpans.Sum(x=>x.Ticks)),
|
||||
#endregion
|
||||
};
|
||||
|
||||
#endregion
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// محاسبه ساعات کارکرد پرسنل در صورت داشتن حضور غیاب
|
||||
/// </summary>
|
||||
/// <param name="employeeId"></param>
|
||||
/// <param name="workshopId"></param>
|
||||
/// <param name="contractStart"></param>
|
||||
/// <param name="contractEnd"></param>
|
||||
/// <returns></returns>
|
||||
public (bool hasRollCall, TimeSpan sumOfSpan) GetRollCallWorkingSpan(long employeeId, long workshopId,
|
||||
DateTime contractStart, DateTime contractEnd)
|
||||
{
|
||||
//bool hasRollcall =
|
||||
// _rollCallEmployeeRepository.HasRollCallRecord(employeeId, workshopId, contractStart, contractEnd);
|
||||
//if (!hasRollcall)
|
||||
// return (false, new TimeSpan());
|
||||
List<RollCallViewModel> rollCallResult;
|
||||
List<GroupedRollCalls> groupedRollCall;
|
||||
|
||||
|
||||
rollCallResult = _context.RollCalls.Where(x =>
|
||||
x.EmployeeId == employeeId && x.WorkshopId == workshopId && x.StartDate.Value.Date >= contractStart.Date &&
|
||||
x.StartDate.Value.Date <= contractEnd.Date && x.EndDate != null).Select(x => new RollCallViewModel()
|
||||
{
|
||||
StartDate = x.StartDate,
|
||||
EndDate = x.EndDate,
|
||||
ShiftSpan = (x.EndDate.Value - x.StartDate.Value),
|
||||
CreationDate = x.ShiftDate,
|
||||
BreakTimeSpan = x.BreakTimeSpan
|
||||
}).ToList();
|
||||
|
||||
groupedRollCall = rollCallResult.GroupBy(x => x.CreationDate.Date).Select(x => new GroupedRollCalls()
|
||||
{
|
||||
CreationDate = x.Key,
|
||||
ShiftList = x.Select(s => new ShiftList() { Start = s.StartDate!.Value, End = s.EndDate!.Value }).ToList(),
|
||||
HasFriday = x.Any(s => s.StartDate != null && s.EndDate != null && (s.StartDate.Value.DayOfWeek == DayOfWeek.Friday || s.EndDate.Value!.DayOfWeek == DayOfWeek.Friday)),
|
||||
SumOneDaySpan = new TimeSpan(x.Sum(shift => shift.ShiftSpan.Ticks)) - CalculateBreakTime(x.First().BreakTimeSpan,
|
||||
new TimeSpan(x.Sum(shift => shift.ShiftSpan.Ticks))),
|
||||
|
||||
BreakTime = CalculateBreakTime(x.First().BreakTimeSpan, new TimeSpan(x.Sum(shift => shift.ShiftSpan.Ticks))),
|
||||
|
||||
}).OrderBy(x => x.CreationDate).ToList();
|
||||
/// <summary>
|
||||
/// محاسبه ساعات کارکرد پرسنل در صورت داشتن حضور غیاب
|
||||
/// </summary>
|
||||
/// <param name="employeeId"></param>
|
||||
/// <param name="workshopId"></param>
|
||||
/// <param name="contractStart"></param>
|
||||
/// <param name="contractEnd"></param>
|
||||
/// <returns></returns>
|
||||
public (bool hasRollCall, TimeSpan sumOfSpan) GetRollCallWorkingSpan(long employeeId, long workshopId,
|
||||
DateTime contractStart, DateTime contractEnd)
|
||||
{
|
||||
//bool hasRollcall =
|
||||
// _rollCallEmployeeRepository.HasRollCallRecord(employeeId, workshopId, contractStart, contractEnd);
|
||||
//if (!hasRollcall)
|
||||
// return (false, new TimeSpan());
|
||||
List<RollCallViewModel> rollCallResult;
|
||||
List<GroupedRollCalls> groupedRollCall;
|
||||
|
||||
|
||||
TimeSpan sumSpans = new TimeSpan(groupedRollCall.Sum(x => x.SumOneDaySpan.Ticks));
|
||||
return (true, sumSpans);
|
||||
}
|
||||
rollCallResult = _context.RollCalls.Where(x =>
|
||||
x.EmployeeId == employeeId && x.WorkshopId == workshopId && x.StartDate.Value.Date >= contractStart.Date &&
|
||||
x.StartDate.Value.Date <= contractEnd.Date && x.EndDate != null).Select(x => new RollCallViewModel()
|
||||
{
|
||||
StartDate = x.StartDate,
|
||||
EndDate = x.EndDate,
|
||||
ShiftSpan = (x.EndDate.Value - x.StartDate.Value),
|
||||
CreationDate = x.ShiftDate,
|
||||
BreakTimeSpan = x.BreakTimeSpan
|
||||
}).ToList();
|
||||
|
||||
groupedRollCall = rollCallResult.GroupBy(x => x.CreationDate.Date).Select(x => new GroupedRollCalls()
|
||||
{
|
||||
CreationDate = x.Key,
|
||||
ShiftList = x.Select(s => new ShiftList() { Start = s.StartDate!.Value, End = s.EndDate!.Value }).ToList(),
|
||||
HasFriday = x.Any(s => s.StartDate != null && s.EndDate != null && (s.StartDate.Value.DayOfWeek == DayOfWeek.Friday || s.EndDate.Value!.DayOfWeek == DayOfWeek.Friday)),
|
||||
SumOneDaySpan = new TimeSpan(x.Sum(shift => shift.ShiftSpan.Ticks)) - CalculateBreakTime(x.First().BreakTimeSpan,
|
||||
new TimeSpan(x.Sum(shift => shift.ShiftSpan.Ticks))),
|
||||
|
||||
BreakTime = CalculateBreakTime(x.First().BreakTimeSpan, new TimeSpan(x.Sum(shift => shift.ShiftSpan.Ticks))),
|
||||
|
||||
}).OrderBy(x => x.CreationDate).ToList();
|
||||
|
||||
|
||||
TimeSpan sumSpans = new TimeSpan(groupedRollCall.Sum(x => x.SumOneDaySpan.Ticks));
|
||||
return (true, sumSpans);
|
||||
}
|
||||
|
||||
|
||||
public async Task<ComputingViewModel> RotatingShiftReport(long workshopId, long employeeId, DateTime contractStart, DateTime contractEnd, string shiftwork, bool hasRollCall, CreateWorkingHoursTemp command, bool holidayWorking)
|
||||
@@ -864,20 +941,7 @@ public class RollCallMandatoryRepository : RepositoryBase<long, RollCall>, IRoll
|
||||
// شبکاری
|
||||
TimeSpan over22 = new TimeSpan(rotatingResultList.Sum(x => x.NightWorkSpan.Ticks));
|
||||
var RotatingfaName = new List<string>();
|
||||
//if (shiftwork != "1" && shiftwork != "2" && shiftwork != "4")//اگر چرخشی بود و منظم نبود
|
||||
//{
|
||||
// if (moriningCount > 0)
|
||||
// RotatingfaName.Add("صبح");
|
||||
// if (eveningCount > 0)
|
||||
// RotatingfaName.Add("عصر");
|
||||
// if (nightCount > 0)
|
||||
// RotatingfaName.Add("شب");
|
||||
//}
|
||||
//else// اگر منظم و شیفتی بود
|
||||
//{
|
||||
|
||||
|
||||
//}
|
||||
var totalDays = (int)(contractEnd - contractStart).TotalDays + 1;
|
||||
int validCount = 0;
|
||||
if (totalDays <= 7) // زیر 7 روز باید حد اقل 2 تغییر شیفت داشته باشد
|
||||
@@ -894,37 +958,66 @@ public class RollCallMandatoryRepository : RepositoryBase<long, RollCall>, IRoll
|
||||
validCount = (int)((totalDays * 6) / 28);
|
||||
}
|
||||
|
||||
Console.WriteLine(validCount);
|
||||
if (moriningCount >= validCount)
|
||||
RotatingfaName.Add("صبح");
|
||||
if (eveningCount >= validCount)
|
||||
RotatingfaName.Add("عصر");
|
||||
if (nightCount >= validCount)
|
||||
RotatingfaName.Add("شب");
|
||||
|
||||
|
||||
|
||||
var rotatingFaResult = "";
|
||||
if (RotatingfaName.Count > 1)// اگر تعداد شیفت های محاسبه شده بیش از یک بود
|
||||
{
|
||||
string maxName;
|
||||
int maxValue = moriningCount;
|
||||
|
||||
for (var rotateNumber = 0; rotateNumber < RotatingfaName.Count; rotateNumber++)
|
||||
{
|
||||
if (rotateNumber == 0)
|
||||
rotatingFaResult = $"{RotatingfaName[rotateNumber]}";
|
||||
if (rotateNumber == 1)
|
||||
rotatingFaResult += $" و {RotatingfaName[rotateNumber]}";
|
||||
if (rotateNumber == 2)
|
||||
rotatingFaResult += $" و {RotatingfaName[rotateNumber]}";
|
||||
}
|
||||
}
|
||||
else if (RotatingfaName.Count <= 1)
|
||||
{
|
||||
rotatingFaResult = "نوبت کاری ندارد";
|
||||
maxName = "moriningCount";
|
||||
if (eveningCount > maxValue)
|
||||
{
|
||||
maxValue = eveningCount;
|
||||
maxName = "eveningCount";
|
||||
}
|
||||
if (nightCount > maxValue)
|
||||
{
|
||||
maxValue = nightCount;
|
||||
maxName = "nightCount";
|
||||
}
|
||||
|
||||
int countOutOfRange = 0;
|
||||
|
||||
switch (maxName)
|
||||
{
|
||||
case "moriningCount":
|
||||
countOutOfRange = eveningCount + nightCount;
|
||||
break;
|
||||
case "eveningCount":
|
||||
countOutOfRange = moriningCount + nightCount;
|
||||
break;
|
||||
case "nightCount":
|
||||
countOutOfRange = moriningCount + eveningCount;
|
||||
break;
|
||||
}
|
||||
var rotatingFaResult = "";
|
||||
if (countOutOfRange >= validCount)
|
||||
{
|
||||
|
||||
if (moriningCount >= 1)
|
||||
RotatingfaName.Add("صبح");
|
||||
if (eveningCount >= 1)
|
||||
RotatingfaName.Add("عصر");
|
||||
if (nightCount >= 1)
|
||||
RotatingfaName.Add("شب");
|
||||
for (var rotateNumber = 0; rotateNumber < RotatingfaName.Count; rotateNumber++)
|
||||
{
|
||||
if (rotateNumber == 0)
|
||||
rotatingFaResult = $"{RotatingfaName[rotateNumber]}";
|
||||
if (rotateNumber == 1)
|
||||
rotatingFaResult += $" و {RotatingfaName[rotateNumber]}";
|
||||
if (rotateNumber == 2)
|
||||
rotatingFaResult += $" و {RotatingfaName[rotateNumber]}";
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
rotatingFaResult = "نوبت کاری ندارد";
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return new ComputingViewModel
|
||||
{
|
||||
@@ -939,19 +1032,19 @@ public class RollCallMandatoryRepository : RepositoryBase<long, RollCall>, IRoll
|
||||
|
||||
|
||||
|
||||
//public static TimeSpan CalculateBreakTime(BreakTime breakTime, TimeSpan sumOneDaySpan)
|
||||
//{
|
||||
// if (breakTime.BreakTimeType != BreakTimeType.WithTime)
|
||||
// return new TimeSpan();
|
||||
public static TimeSpan CalculateBreakTime(BreakTime breakTime, TimeSpan sumOneDaySpan)
|
||||
{
|
||||
if (breakTime.BreakTimeType != BreakTimeType.WithTime)
|
||||
return new TimeSpan();
|
||||
|
||||
// var breakTimeSpan = breakTime.BreakTimeValue.ToTimeSpan();
|
||||
var breakTimeSpan = breakTime.BreakTimeValue.ToTimeSpan();
|
||||
|
||||
// if (breakTimeSpan * 2 >= sumOneDaySpan)
|
||||
// return new TimeSpan();
|
||||
if (breakTimeSpan * 2 >= sumOneDaySpan)
|
||||
return new TimeSpan();
|
||||
|
||||
// return breakTimeSpan; ;
|
||||
return breakTimeSpan; ;
|
||||
|
||||
//}
|
||||
}
|
||||
public static TimeSpan CalculateBreakTime(TimeSpan breakTimeSpan, TimeSpan sumOneDaySpan)
|
||||
{
|
||||
if (breakTimeSpan * 2 >= sumOneDaySpan)
|
||||
@@ -2090,7 +2183,7 @@ public class RollCallMandatoryRepository : RepositoryBase<long, RollCall>, IRoll
|
||||
var starTimeSingel1 = Convert.ToDateTime(shift1Start);
|
||||
var endTimeSingel2 = Convert.ToDateTime(shift1End);
|
||||
|
||||
bool hasRestTime = false;
|
||||
bool hasRestTime = false;
|
||||
|
||||
|
||||
shift1StartGr = new DateTime(cuurentDate.Year, cuurentDate.Month, cuurentDate.Day, starTimeSingel1.Hour, starTimeSingel1.Minute, 0);
|
||||
@@ -2099,92 +2192,92 @@ public class RollCallMandatoryRepository : RepositoryBase<long, RollCall>, IRoll
|
||||
if (shift1EndGr.TimeOfDay < shift1StartGr.TimeOfDay)
|
||||
shift1EndGr = shift1EndGr.AddDays(1);
|
||||
|
||||
var shiftEndWithoutRest = shift1EndGr;
|
||||
var shiftEndWithoutRest = shift1EndGr;
|
||||
|
||||
var shiftSpan = (shift1EndGr - shift1StartGr);
|
||||
if (restTime > TimeSpan.Zero && shiftSpan >= restTime)
|
||||
{
|
||||
hasRestTime = true;
|
||||
shift1EndGr = shift1EndGr.Subtract(restTime);
|
||||
shiftSpan = (shift1EndGr - shift1StartGr);
|
||||
|
||||
}
|
||||
var shiftSpan = (shift1EndGr - shift1StartGr);
|
||||
if (restTime > TimeSpan.Zero && shiftSpan >= restTime)
|
||||
{
|
||||
hasRestTime = true;
|
||||
shift1EndGr = shift1EndGr.Subtract(restTime);
|
||||
shiftSpan = (shift1EndGr - shift1StartGr);
|
||||
|
||||
if (!leaveSearchResult.Any(x => x.StartLeaveGr < shift1EndGr && x.EndLeaveGr > shift1StartGr && x.PaidLeaveType =="روزانه"))
|
||||
{
|
||||
var hourseLeaveTypeResult = leaveSearchResult.FirstOrDefault(x =>
|
||||
x.StartLeaveGr < shift1EndGr && x.EndLeaveGr > shift1StartGr && x.PaidLeaveType == "ساعتی");
|
||||
if (hourseLeaveTypeResult == null)
|
||||
{
|
||||
result.Add(new RollCallViewModel()
|
||||
{
|
||||
BreakTimeSpan = hasRestTime ? restTime : TimeSpan.Zero,
|
||||
StartDate = shift1StartGr,
|
||||
EndDate = shift1EndGr,
|
||||
ShiftSpan = shiftSpan,
|
||||
ShiftDate = shift1StartGr,
|
||||
}
|
||||
|
||||
if (!leaveSearchResult.Any(x => x.StartLeaveGr < shift1EndGr && x.EndLeaveGr > shift1StartGr && x.PaidLeaveType == "روزانه"))
|
||||
{
|
||||
var hourseLeaveTypeResult = leaveSearchResult.FirstOrDefault(x =>
|
||||
x.StartLeaveGr < shift1EndGr && x.EndLeaveGr > shift1StartGr && x.PaidLeaveType == "ساعتی");
|
||||
if (hourseLeaveTypeResult == null)
|
||||
{
|
||||
result.Add(new RollCallViewModel()
|
||||
{
|
||||
BreakTimeSpan = hasRestTime ? restTime : TimeSpan.Zero,
|
||||
StartDate = shift1StartGr,
|
||||
EndDate = shift1EndGr,
|
||||
ShiftSpan = shiftSpan,
|
||||
ShiftDate = shift1StartGr,
|
||||
ShiftEndWithoutRest = shiftEndWithoutRest
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
if (hourseLeaveTypeResult.StartLeaveGr <= shift1StartGr && hourseLeaveTypeResult.EndLeaveGr < shift1EndGr)
|
||||
{
|
||||
//leave <-------------------->
|
||||
//shift <---------------------------------->
|
||||
result.Add(new RollCallViewModel()
|
||||
{
|
||||
BreakTimeSpan = hasRestTime ? restTime : TimeSpan.Zero,
|
||||
StartDate = hourseLeaveTypeResult.EndLeaveGr,
|
||||
EndDate = shift1EndGr,
|
||||
ShiftSpan = (shift1EndGr - hourseLeaveTypeResult.EndLeaveGr),
|
||||
ShiftDate = shift1StartGr,
|
||||
ShiftEndWithoutRest = shiftEndWithoutRest
|
||||
if (hourseLeaveTypeResult.StartLeaveGr <= shift1StartGr && hourseLeaveTypeResult.EndLeaveGr < shift1EndGr)
|
||||
{
|
||||
//leave <-------------------->
|
||||
//shift <---------------------------------->
|
||||
result.Add(new RollCallViewModel()
|
||||
{
|
||||
BreakTimeSpan = hasRestTime ? restTime : TimeSpan.Zero,
|
||||
StartDate = hourseLeaveTypeResult.EndLeaveGr,
|
||||
EndDate = shift1EndGr,
|
||||
ShiftSpan = (shift1EndGr - hourseLeaveTypeResult.EndLeaveGr),
|
||||
ShiftDate = shift1StartGr,
|
||||
ShiftEndWithoutRest = shiftEndWithoutRest
|
||||
|
||||
});
|
||||
}
|
||||
else if (hourseLeaveTypeResult.StartLeaveGr > shift1StartGr && hourseLeaveTypeResult.EndLeaveGr < shift1EndGr)
|
||||
{
|
||||
//leave <-------------------->
|
||||
//shift <---------------------------------->
|
||||
result.Add(new RollCallViewModel()
|
||||
{
|
||||
BreakTimeSpan = hasRestTime ? restTime : TimeSpan.Zero,
|
||||
StartDate = shift1StartGr,
|
||||
EndDate = hourseLeaveTypeResult.StartLeaveGr,
|
||||
ShiftSpan = (hourseLeaveTypeResult.StartLeaveGr - shift1StartGr),
|
||||
ShiftDate = shift1StartGr,
|
||||
ShiftEndWithoutRest = hourseLeaveTypeResult.StartLeaveGr
|
||||
});
|
||||
}
|
||||
else if (hourseLeaveTypeResult.StartLeaveGr > shift1StartGr && hourseLeaveTypeResult.EndLeaveGr < shift1EndGr)
|
||||
{
|
||||
//leave <-------------------->
|
||||
//shift <---------------------------------->
|
||||
result.Add(new RollCallViewModel()
|
||||
{
|
||||
BreakTimeSpan = hasRestTime ? restTime : TimeSpan.Zero,
|
||||
StartDate = shift1StartGr,
|
||||
EndDate = hourseLeaveTypeResult.StartLeaveGr,
|
||||
ShiftSpan = (hourseLeaveTypeResult.StartLeaveGr - shift1StartGr),
|
||||
ShiftDate = shift1StartGr,
|
||||
ShiftEndWithoutRest = hourseLeaveTypeResult.StartLeaveGr
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
result.Add(new RollCallViewModel()
|
||||
{
|
||||
BreakTimeSpan = hasRestTime ? restTime : TimeSpan.Zero,
|
||||
StartDate = hourseLeaveTypeResult.EndLeaveGr,
|
||||
EndDate = shift1EndGr,
|
||||
ShiftSpan = (shift1EndGr - hourseLeaveTypeResult.EndLeaveGr),
|
||||
ShiftDate = shift1StartGr,
|
||||
ShiftEndWithoutRest = shiftEndWithoutRest
|
||||
result.Add(new RollCallViewModel()
|
||||
{
|
||||
BreakTimeSpan = hasRestTime ? restTime : TimeSpan.Zero,
|
||||
StartDate = hourseLeaveTypeResult.EndLeaveGr,
|
||||
EndDate = shift1EndGr,
|
||||
ShiftSpan = (shift1EndGr - hourseLeaveTypeResult.EndLeaveGr),
|
||||
ShiftDate = shift1StartGr,
|
||||
ShiftEndWithoutRest = shiftEndWithoutRest
|
||||
|
||||
});
|
||||
}
|
||||
else if (hourseLeaveTypeResult.StartLeaveGr > shift1StartGr && hourseLeaveTypeResult.EndLeaveGr >= shift1EndGr)
|
||||
{
|
||||
//leave <-------------------->
|
||||
//shift <---------------------------------->
|
||||
});
|
||||
}
|
||||
else if (hourseLeaveTypeResult.StartLeaveGr > shift1StartGr && hourseLeaveTypeResult.EndLeaveGr >= shift1EndGr)
|
||||
{
|
||||
//leave <-------------------->
|
||||
//shift <---------------------------------->
|
||||
|
||||
result.Add(new RollCallViewModel()
|
||||
{
|
||||
BreakTimeSpan = hasRestTime ? restTime : TimeSpan.Zero,
|
||||
StartDate = shift1StartGr,
|
||||
EndDate = hourseLeaveTypeResult.StartLeaveGr,
|
||||
ShiftSpan = (hourseLeaveTypeResult.StartLeaveGr - shift1StartGr),
|
||||
ShiftDate = shift1StartGr,
|
||||
ShiftEndWithoutRest = hourseLeaveTypeResult.StartLeaveGr
|
||||
result.Add(new RollCallViewModel()
|
||||
{
|
||||
BreakTimeSpan = hasRestTime ? restTime : TimeSpan.Zero,
|
||||
StartDate = shift1StartGr,
|
||||
EndDate = hourseLeaveTypeResult.StartLeaveGr,
|
||||
ShiftSpan = (hourseLeaveTypeResult.StartLeaveGr - shift1StartGr),
|
||||
ShiftDate = shift1StartGr,
|
||||
ShiftEndWithoutRest = hourseLeaveTypeResult.StartLeaveGr
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
@@ -2241,6 +2334,7 @@ public class RollCallMandatoryRepository : RepositoryBase<long, RollCall>, IRoll
|
||||
EndDate = shift2EndGr,
|
||||
ShiftSpan = (shift2EndGr - shift2StartGr),
|
||||
ShiftDate = shift1?.ShiftDate ?? shift2EndGr,
|
||||
ShiftEndWithoutRest = shift2EndGr,
|
||||
});
|
||||
}
|
||||
else
|
||||
@@ -2256,7 +2350,8 @@ public class RollCallMandatoryRepository : RepositoryBase<long, RollCall>, IRoll
|
||||
EndDate = shift2EndGr,
|
||||
ShiftSpan = (shift2EndGr - hourseLeaveTypeResult.EndLeaveGr),
|
||||
ShiftDate = shift1?.EndDate ?? shift2EndGr,
|
||||
});
|
||||
ShiftEndWithoutRest = shift2EndGr,
|
||||
});
|
||||
}
|
||||
else if (hourseLeaveTypeResult.StartLeaveGr > shift2StartGr && hourseLeaveTypeResult.EndLeaveGr < shift2EndGr)
|
||||
{
|
||||
@@ -2268,7 +2363,8 @@ public class RollCallMandatoryRepository : RepositoryBase<long, RollCall>, IRoll
|
||||
EndDate = hourseLeaveTypeResult.StartLeaveGr,
|
||||
ShiftSpan = (hourseLeaveTypeResult.StartLeaveGr - shift2StartGr),
|
||||
ShiftDate = shift1?.EndDate ?? shift2EndGr,
|
||||
});
|
||||
ShiftEndWithoutRest = hourseLeaveTypeResult.StartLeaveGr,
|
||||
});
|
||||
|
||||
result.Add(new RollCallViewModel()
|
||||
{
|
||||
@@ -2276,7 +2372,8 @@ public class RollCallMandatoryRepository : RepositoryBase<long, RollCall>, IRoll
|
||||
EndDate = shift2EndGr,
|
||||
ShiftSpan = (shift2EndGr - hourseLeaveTypeResult.EndLeaveGr),
|
||||
ShiftDate = shift1?.EndDate ?? shift2EndGr,
|
||||
});
|
||||
ShiftEndWithoutRest = shift2EndGr,
|
||||
});
|
||||
}
|
||||
else if (hourseLeaveTypeResult.StartLeaveGr > shift2StartGr && hourseLeaveTypeResult.EndLeaveGr >= shift2EndGr)
|
||||
{
|
||||
@@ -2289,7 +2386,8 @@ public class RollCallMandatoryRepository : RepositoryBase<long, RollCall>, IRoll
|
||||
EndDate = hourseLeaveTypeResult.StartLeaveGr,
|
||||
ShiftSpan = (hourseLeaveTypeResult.StartLeaveGr - shift2StartGr),
|
||||
ShiftDate = shift1?.EndDate ?? shift2EndGr,
|
||||
});
|
||||
ShiftEndWithoutRest = hourseLeaveTypeResult.StartLeaveGr,
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
@@ -3021,13 +3119,13 @@ public class RollCallMandatoryRepository : RepositoryBase<long, RollCall>, IRoll
|
||||
|
||||
|
||||
var endFarvarding = new DateTime(2025, 4, 20);
|
||||
if (contractStart>endFarvarding)
|
||||
if (contractStart > endFarvarding)
|
||||
{
|
||||
customizeWorkshopEmployeeSettings=_context.CustomizeWorkshopEmployeeSettings
|
||||
customizeWorkshopEmployeeSettings = _context.CustomizeWorkshopEmployeeSettings
|
||||
.AsSplitQuery().AsNoTracking().FirstOrDefault(x =>
|
||||
x.WorkshopId == workshopId && x.EmployeeId == employeeId);
|
||||
|
||||
customizeWorkshopSettings =_context.CustomizeWorkshopSettings.AsNoTracking().FirstOrDefault(x => x.WorkshopId == workshopId);
|
||||
customizeWorkshopSettings = _context.CustomizeWorkshopSettings.AsNoTracking().FirstOrDefault(x => x.WorkshopId == workshopId);
|
||||
}
|
||||
|
||||
else
|
||||
@@ -3982,40 +4080,40 @@ public class RollCallMandatoryRepository : RepositoryBase<long, RollCall>, IRoll
|
||||
}).ToList();
|
||||
}
|
||||
|
||||
public List<LoanInstallmentViewModel> LoanInstallmentForCheckout(long employeeId, long workshopId, DateTime contractStart, DateTime contractEnd)
|
||||
{
|
||||
return _context.Loans
|
||||
.Where(x => x.EmployeeId == employeeId && x.WorkshopId == workshopId)
|
||||
.SelectMany(x => x.LoanInstallments)
|
||||
.Where(i => i.InstallmentDate >= contractStart && i.InstallmentDate <= contractEnd && i.IsActive == IsActive.True)
|
||||
.Select(x => new LoanInstallmentViewModel()
|
||||
{
|
||||
Id = x.Id,
|
||||
Month = x.Month,
|
||||
IsActive = x.IsActive,
|
||||
Amount = x.AmountForMonth.ToMoney(),
|
||||
Year = x.Year,
|
||||
AmountDouble = x.AmountForMonth,
|
||||
RemainingAmount = _context.Loans.SelectMany(l => l.LoanInstallments).Where(i => i.LoanId == x.LoanId && i.IsActive == IsActive.True && i.InstallmentDate > x.InstallmentDate)
|
||||
.Sum(i => i.AmountForMonth).ToMoney(),
|
||||
LoanAmount = _context.Loans.FirstOrDefault(l => l.id == x.LoanId).Amount.ToMoney()
|
||||
}).ToList();
|
||||
}
|
||||
public List<LoanInstallmentViewModel> LoanInstallmentForCheckout(long employeeId, long workshopId, DateTime contractStart, DateTime contractEnd)
|
||||
{
|
||||
return _context.Loans
|
||||
.Where(x => x.EmployeeId == employeeId && x.WorkshopId == workshopId)
|
||||
.SelectMany(x => x.LoanInstallments)
|
||||
.Where(i => i.InstallmentDate >= contractStart && i.InstallmentDate <= contractEnd && i.IsActive == IsActive.True)
|
||||
.Select(x => new LoanInstallmentViewModel()
|
||||
{
|
||||
Id = x.Id,
|
||||
Month = x.Month,
|
||||
IsActive = x.IsActive,
|
||||
Amount = x.AmountForMonth.ToMoney(),
|
||||
Year = x.Year,
|
||||
AmountDouble = x.AmountForMonth,
|
||||
RemainingAmount = _context.Loans.SelectMany(l => l.LoanInstallments).Where(i => i.LoanId == x.LoanId && i.IsActive == IsActive.True && i.InstallmentDate > x.InstallmentDate)
|
||||
.Sum(i => i.AmountForMonth).ToMoney(),
|
||||
LoanAmount = _context.Loans.FirstOrDefault(l => l.id == x.LoanId).Amount.ToMoney()
|
||||
}).ToList();
|
||||
}
|
||||
|
||||
public List<SalaryAidViewModel> SalaryAidsForCheckout(long employeeId, long workshopId, DateTime checkoutStart, DateTime checkoutEnd)
|
||||
{
|
||||
return _context.SalaryAids
|
||||
.Where(x => x.CalculationDate >= checkoutStart && x.CalculationDate <= checkoutEnd && x.EmployeeId == employeeId && x.WorkshopId == workshopId).Select(x => new SalaryAidViewModel()
|
||||
{
|
||||
Amount = x.Amount.ToMoney(),
|
||||
AmountDouble = x.Amount,
|
||||
SalaryAidDateTimeFa = x.SalaryAidDateTime.ToFarsi(),
|
||||
SalaryAidDateTimeGe = x.SalaryAidDateTime,
|
||||
CalculationDateTimeGe = x.CalculationDate,
|
||||
CalculationDateTimeFa = x.CalculationDate.ToFarsi(),
|
||||
Id = x.id
|
||||
}).ToList();
|
||||
}
|
||||
public List<SalaryAidViewModel> SalaryAidsForCheckout(long employeeId, long workshopId, DateTime checkoutStart, DateTime checkoutEnd)
|
||||
{
|
||||
return _context.SalaryAids
|
||||
.Where(x => x.CalculationDate >= checkoutStart && x.CalculationDate <= checkoutEnd && x.EmployeeId == employeeId && x.WorkshopId == workshopId).Select(x => new SalaryAidViewModel()
|
||||
{
|
||||
Amount = x.Amount.ToMoney(),
|
||||
AmountDouble = x.Amount,
|
||||
SalaryAidDateTimeFa = x.SalaryAidDateTime.ToFarsi(),
|
||||
SalaryAidDateTimeGe = x.SalaryAidDateTime,
|
||||
CalculationDateTimeGe = x.CalculationDate,
|
||||
CalculationDateTimeFa = x.CalculationDate.ToFarsi(),
|
||||
Id = x.id
|
||||
}).ToList();
|
||||
}
|
||||
|
||||
private void CreateRewardForBirthDay(long employeeId, long workshopId, double amount, int month, int year,
|
||||
DateTime contractStart)
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user