Compare commits

...

16 Commits

Author SHA1 Message Date
25120ff9c7 add new data for 99 archivecode and rollcall excels 2025-10-02 12:09:12 +03:30
MahanCh
e0129b089b add archive code and add color to true data in export excel 2025-07-13 10:05:33 +03:30
MahanCh
fd2522e507 complete get workshops excel data 2025-07-12 12:57:22 +03:30
ca55ee9aef reafactor: fix error of query getting data for excel data 2025-07-10 22:10:18 +03:30
MahanCh
16c00cbd0e feat: create method for query getting workhsop excel datas 2025-07-10 14:43:13 +03:30
MahanCh
f4ec4f43c6 add institution Contract Excel 2025-07-09 17:19:28 +03:30
MahanCh
e8f7f6b778 fix : update data from edit employee in grouping in cws 2025-07-09 13:01:36 +03:30
MahanCh
b0b8680125 fix: weekly offdays foreign key conflict in CreateEmployeesSettingsAndSetChanges 2025-07-09 12:06:42 +03:30
MahanCh
2714732750 Merge branch 'master' of https://github.com/syntax24/OriginalGozareshgir 2025-07-08 13:51:59 +03:30
MahanCh
2a78a9dc1a change employee upload picture change name style 2025-07-08 13:51:52 +03:30
SamSys
95b09278aa KababMahdi bug fixed merged 2025-07-07 18:08:08 +03:30
SamSys
f2b3a26471 employeeUploadPicture bug fixed merged 2025-07-07 14:12:27 +03:30
SamSys
33e3efeef5 manadatory Compute friday count bug fix 2025-07-07 02:14:38 +03:30
MahanCh
5c5f3eefa6 complete new checkout calcualation for kebab mahdi time differences 2025-06-30 13:30:49 +03:30
MahanCh
3fa027dfd1 change rollcall mandatoory computes 2025-06-26 14:43:11 +03:30
MahanCh
8284ec199f add new rule for rollcall 2025-06-24 12:02:23 +03:30
15 changed files with 6491 additions and 5752 deletions

View File

@@ -0,0 +1,262 @@
using _0_Framework.Application;
using CompanyManagement.Infrastructure.Excel.CWS;
using CompanyManagment.App.Contracts.InstitutionContract;
using OfficeOpenXml;
using OfficeOpenXml.Style;
using System.Drawing;
using System.Text.RegularExpressions;
namespace CompanyManagement.Infrastructure.Excel.InstitutionContract;
public class InstitutionContractExcelGenerator
{
public static byte[] GenerateExcel(List<InstitutionContractViewModel> institutionContractViewModels)
{
ExcelPackage.LicenseContext = LicenseContext.NonCommercial;
using var package = new ExcelPackage();
var allWorksheet = package.Workbook.Worksheets.Add("همه");
var blueWorksheet = package.Workbook.Worksheets.Add("آبی");
blueWorksheet.TabColor = Color.LightBlue;
var grayWorksheet = package.Workbook.Worksheets.Add("خاکستری");
grayWorksheet.TabColor = Color.LightGray;
var redWorksheet = package.Workbook.Worksheets.Add("قرمز");
redWorksheet.TabColor = Color.LightCoral;
var purpleWorksheet = package.Workbook.Worksheets.Add("بنفش");
purpleWorksheet.TabColor = Color.MediumPurple;
var blackWorksheet = package.Workbook.Worksheets.Add("مشکی");
blackWorksheet.TabColor = Color.DimGray;
var yellowWorksheet = package.Workbook.Worksheets.Add("زرد");
yellowWorksheet.TabColor = Color.Yellow;
var whiteWorksheet = package.Workbook.Worksheets.Add("سفید");
whiteWorksheet.TabColor = Color.White;
CreateExcelSheet(institutionContractViewModels, allWorksheet);
var blueContracts = institutionContractViewModels.Where(x=>x.ExpireColor == "blue").ToList();
CreateExcelSheet(blueContracts, blueWorksheet);
institutionContractViewModels = institutionContractViewModels.Except(blueContracts).ToList();
var grayContracts = institutionContractViewModels.Where(x => x.IsContractingPartyBlock == "true").ToList();
CreateExcelSheet(grayContracts, grayWorksheet);
institutionContractViewModels = institutionContractViewModels.Except(grayContracts).ToList();
var redContracts = institutionContractViewModels.Where(x=>x.ExpireColor == "red").ToList();
CreateExcelSheet(redContracts, redWorksheet);
institutionContractViewModels = institutionContractViewModels.Except(redContracts).ToList();
var purpleContracts = institutionContractViewModels.Where(x=>x.ExpireColor == "purple").ToList();
CreateExcelSheet(purpleContracts, purpleWorksheet);
institutionContractViewModels = institutionContractViewModels.Except(purpleContracts).ToList();
var blackContracts = institutionContractViewModels.Where(x=>x.ExpireColor == "black").ToList();
CreateExcelSheet(blackContracts, blackWorksheet);
institutionContractViewModels = institutionContractViewModels.Except(blackContracts).ToList();
var yellowContracts = institutionContractViewModels
.Where(x => string.IsNullOrWhiteSpace(x.ExpireColor) && x.WorkshopCount == "0").ToList();
CreateExcelSheet(yellowContracts, yellowWorksheet);
institutionContractViewModels = institutionContractViewModels.Except(yellowContracts).ToList();
var otherContracts = institutionContractViewModels;
CreateExcelSheet(otherContracts, whiteWorksheet);
return package.GetAsByteArray();
}
private static void CreateExcelSheet(List<InstitutionContractViewModel> institutionContractViewModels, ExcelWorksheet worksheet)
{
// Headers
worksheet.Cells[1, 1].Value = "شماره قرارداد";
worksheet.Cells[1, 2].Value = "طرف حساب";
worksheet.Cells[1, 3].Value = "شماره کارفرما";
worksheet.Cells[1, 4].Value = "کارفرما ها";
worksheet.Cells[1, 5].Value = "کارگاه ها";
worksheet.Cells[1, 6].Value = "مجبوع پرسنل";
worksheet.Cells[1, 7].Value = "شروع قرارداد";
worksheet.Cells[1, 8].Value = "پایان قرارداد";
worksheet.Cells[1, 9].Value = "مبلغ قرارداد (بدون کارگاه)";
worksheet.Cells[1, 10].Value = "مبلغ قرارداد";
worksheet.Cells[1, 11].Value = "وضعیت مالی";
using (var range = worksheet.Cells[1, 1, 1, 11])
{
range.Style.HorizontalAlignment = ExcelHorizontalAlignment.Center;
range.Style.VerticalAlignment = ExcelVerticalAlignment.Center;
range.Style.Font.Bold = true;
range.Style.Fill.PatternType = ExcelFillStyle.Solid;
range.Style.Fill.BackgroundColor.SetColor(Color.LightGray); // رنگ پس زمینه خاکستری
// اعمال بوردر به همه خطوط
range.Style.Border.Top.Style = ExcelBorderStyle.Thin;
range.Style.Border.Bottom.Style = ExcelBorderStyle.Thin;
range.Style.Border.Left.Style = ExcelBorderStyle.Thin;
range.Style.Border.Right.Style = ExcelBorderStyle.Thin;
// اعمال رنگ مشکی برای بوردرها
range.Style.Border.Top.Color.SetColor(Color.Black);
range.Style.Border.Bottom.Color.SetColor(Color.Black);
range.Style.Border.Left.Color.SetColor(Color.Black);
range.Style.Border.Right.Color.SetColor(Color.Black);
}
int row = 2;
for (int i = 0; i < institutionContractViewModels.Count; i++)
{
var contract = institutionContractViewModels[i];
var employers = contract.EmployerViewModels?.ToList() ?? new();
var workshops = contract.WorkshopViewModels?.ToList() ?? new();
int maxRows = Math.Max(employers.Count, workshops.Count);
maxRows = Math.Max(1, maxRows);
int startRow = row;
int endRow = row + maxRows - 1;
// 🎨 دریافت رنگ پس‌زمینه از مقدار رنگ موجود در داده
string colorName = contract.ExpireColor.ToLower();
var fillColor = GetColorByName(colorName, contract.WorkshopCount, contract.IsContractingPartyBlock);
for (int j = 0; j < maxRows; j++)
{
int currentRow = row + j;
worksheet.Cells[currentRow, 4].Value = j < employers.Count ? employers[j].FullName : null;
worksheet.Cells[currentRow, 5].Value = j < workshops.Count ? workshops[j].WorkshopFullName : null;
for (int col = 1; col <= 11; col++)
{
var cell = worksheet.Cells[currentRow, col];
// 📏 بوردرهای داخلی نازک / نقطه‌چین
cell.Style.Border.Top.Style = ExcelBorderStyle.Dotted;
cell.Style.Border.Bottom.Style = ExcelBorderStyle.Dotted;
cell.Style.Border.Left.Style = ExcelBorderStyle.Thin;
cell.Style.Border.Right.Style = ExcelBorderStyle.Thin;
// 🎯 تراز متن
cell.Style.HorizontalAlignment = ExcelHorizontalAlignment.Center;
cell.Style.VerticalAlignment = ExcelVerticalAlignment.Center;
// 🎨 اعمال رنگ پس‌زمینه
cell.Style.Fill.PatternType = ExcelFillStyle.Solid;
cell.Style.Fill.BackgroundColor.SetColor(fillColor);
}
}
// 🧱 مرج و مقداردهی ستون‌های اصلی
worksheet.Cells[startRow, 1, endRow, 1].Merge = true;
worksheet.Cells[startRow, 1].Value = contract.ContractNo;
worksheet.Cells[startRow, 2, endRow, 2].Merge = true;
worksheet.Cells[startRow, 2].Value = contract.ContractingPartyName;
worksheet.Cells[startRow, 3, endRow, 3].Merge = true;
worksheet.Cells[startRow, 3].Value = contract.ArchiveCode;
worksheet.Cells[startRow, 6, endRow, 6].Merge = true;
worksheet.Cells[startRow, 6].Value = contract.EmployeeCount;
worksheet.Cells[startRow, 7, endRow, 7].Merge = true;
worksheet.Cells[startRow, 7].Value = contract.ContractStartFa;
worksheet.Cells[startRow, 8, endRow, 8].Merge = true;
worksheet.Cells[startRow, 8].Value = contract.ContractEndFa;
worksheet.Cells[startRow, 9, endRow, 9].Merge = true;
var contractWithoutWorkshopAmountCell = worksheet.Cells[startRow, 9];
contractWithoutWorkshopAmountCell.Value = contract.WorkshopCount == "0" ? MoneyToDouble(contract.ContractAmount) : "";
contractWithoutWorkshopAmountCell.Style.Numberformat.Format = "#,##0";
worksheet.Cells[startRow, 10, endRow, 10].Merge = true;
var contractAmountCell = worksheet.Cells[startRow, 10];
contractAmountCell.Value = contract.WorkshopCount != "0" ? MoneyToDouble(contract.ContractAmount) : "";
contractAmountCell.Style.Numberformat.Format = "#,##0";
worksheet.Cells[startRow, 11, endRow, 11].Merge = true;
var balance = MoneyToDouble(contract.BalanceStr);
var balanceCell = worksheet.Cells[startRow, 11];
balanceCell.Value = balance;
balanceCell.Style.Numberformat.Format = "#,##0";
if (balance > 0)
balanceCell.Style.Font.Color.SetColor(Color.Red);
else if (balance < 0)
balanceCell.Style.Font.Color.SetColor(Color.Green);
// 📦 بوردر ضخیم خارجی برای هر سطر
var boldRange = worksheet.Cells[startRow, 1, endRow, 11];
boldRange.Style.Border.BorderAround(ExcelBorderStyle.Medium);
row += maxRows;
}
worksheet.PrinterSettings.PaperSize = ePaperSize.A4;
worksheet.PrinterSettings.Orientation = eOrientation.Landscape;
worksheet.PrinterSettings.FitToPage = true;
worksheet.PrinterSettings.FitToWidth = 1;
worksheet.PrinterSettings.FitToHeight = 0;
worksheet.PrinterSettings.Scale = 85;
int contractNoCol = 1;
int contractingPartyNameCol = 2;
int archiveNoCol = 3;
int employersCol = 4;
int workshopsCol = 5;
int employeeCountCol = 6;
int startContractCol = 7;
int endContractCol = 8;
int contractWithoutWorkshopAmountCol = 9;
int contractAmountCol = 10;
int balanceCol = 11;
worksheet.Columns[contractNoCol].Width = 17;
worksheet.Columns[contractingPartyNameCol].Width = 40;
worksheet.Columns[archiveNoCol].Width = 10;
worksheet.Columns[employersCol].Width = 40;
worksheet.Columns[workshopsCol].Width = 45;
worksheet.Columns[employeeCountCol].Width = 12;
worksheet.Columns[startContractCol].Width = 12;
worksheet.Columns[endContractCol].Width = 12;
worksheet.Columns[contractWithoutWorkshopAmountCol].Width = 18;
worksheet.Columns[contractAmountCol].Width = 12;
worksheet.Columns[balanceCol].Width = 12;
worksheet.View.RightToLeft = true; // فارسی
//worksheet.Cells[worksheet.Dimension.Address].AutoFitColumns();
}
private static double MoneyToDouble(string value)
{
Console.WriteLine(value);
var min = value.Length > 1 ? value.Substring(0, 2) : "";
var test = min == "\u200e\u2212" ? value.MoneyToDouble() * -1 : value.MoneyToDouble();
Console.WriteLine(test);
return test;
}
private static Color GetColorByName(string name, string workshopCount, string IsContractingPartyBlock)
{
return name switch
{
"blue" => Color.LightBlue,
_ when IsContractingPartyBlock == "true" => Color.LightGray,
"red" => Color.LightCoral,
"purple" => Color.MediumPurple,
"black" => Color.DimGray,
var n when string.IsNullOrWhiteSpace(n) && workshopCount == "0" => Color.Yellow,
_ => Color.White
};
}
}

View File

@@ -0,0 +1,170 @@
using CompanyManagment.App.Contracts.InstitutionContract;
using OfficeOpenXml;
using OfficeOpenXml.Style;
using System.Drawing;
namespace CompanyManagement.Infrastructure.Excel.Temp;
public class GetAllContractingPartyExcelGenerator
{
public static byte[] GenerateExcel(List<DataExcelResult> dataList)
{
ExcelPackage.LicenseContext = LicenseContext.NonCommercial;
using var package = new ExcelPackage();
var archive99Sheet = package.Workbook.Worksheets.Add("کارگاه های 99");
var rollCallSheet = package.Workbook.Worksheets.Add("حضورغیابی");
var archive99Data = dataList.Where(x => x.Workshops.Any(a => a.ArchiveCode == "99")).ToList();
CreateSheet(archive99Data, archive99Sheet);
CreateSheet(dataList.Where(x=>x.Workshops.Any(w=>w.HasRollCall)).ToList(), rollCallSheet);
return package.GetAsByteArray();
}
private static void CreateSheet(List<DataExcelResult> dataList, ExcelWorksheet ws)
{
string[] headers = new[]
{
"ContractingPartyId", "نام طرف حساب", "EmployerId", "نام کارفرما", "WorkshopId", "کد کارگاه", "نام کارگاه",
"خدمات قرارداد", "خدمات قرارداد حضوری", "خدمات بیمه", "خدمات بیمه حضوری",
"خدمات حضورغیاب", "فیش حقوقی غیر رسمی", "تعداد استند", "تعداد ماه های بدهی قبلی برای حضورغیاب"
};
for (int i = 0; i < headers.Length; i++)
{
var cell = ws.Cells[1, i + 1];
cell.Value = headers[i];
cell.Style.Font.Bold = true;
cell.Style.HorizontalAlignment = ExcelHorizontalAlignment.Center;
cell.Style.VerticalAlignment = ExcelVerticalAlignment.Center;
cell.Style.Fill.PatternType = ExcelFillStyle.Solid;
cell.Style.Fill.BackgroundColor.SetColor(Color.LightGray);
cell.Style.Border.BorderAround(ExcelBorderStyle.Thin);
}
int row = 2;
foreach (var data in dataList)
{
int partyStartRow = row;
foreach (var workshop in data.Workshops)
{
int workshopStartRow = row;
var employers = workshop.Employers.Any()
? workshop.Employers
: new List<EmployerExcelResultData> { new() };
foreach (var employer in employers)
{
ws.Cells[row, 1].Value = data.ContractingPartyId;
ws.Cells[row, 2].Value = data.ContractingPartyName;
ws.Cells[row, 3].Value = employer?.Id;
ws.Cells[row, 4].Value = employer?.EmployerName;
ws.Cells[row, 5].Value = workshop.Id;
ws.Cells[row, 6].Value = workshop.ArchiveCode;
ws.Cells[row, 7].Value = workshop.WorkshopName;
ws.Cells[row, 8].Value = Convert.ToInt32(workshop.HasContract);
ws.Cells[row, 9].Value = 0; // فرضی
ws.Cells[row, 10].Value = Convert.ToInt32(workshop.HasInsurance);
ws.Cells[row, 11].Value = 0; // فرضی
ws.Cells[row, 12].Value = Convert.ToInt32(workshop.HasRollCall);
ws.Cells[row, 13].Value = Convert.ToInt32(workshop.HasCustomizeCheckout);
ws.Cells[row, 14].Value = 0;
ws.Cells[row, 15].Value = workshop.DebtRollCallMonth;
// 🌿 رنگ سبز برای سلول‌هایی که مقدارشان 1 است (True)
int[] boolCols = new[] { 8, 10, 12, 13, 14, 15 };
foreach (var col in boolCols)
{
var cell = ws.Cells[row, col];
if (Convert.ToInt32(cell.Value) > 0)
{
cell.Style.Fill.PatternType = ExcelFillStyle.Solid;
cell.Style.Fill.BackgroundColor.SetColor(Color.FromArgb(198, 239, 206)); // سبز اکسل
}
}
// Style: وسط‌چین + بوردر نازک برای همه سلول‌ها
for (int col = 1; col <= 15; col++)
{
var cell = ws.Cells[row, col];
cell.Style.HorizontalAlignment = ExcelHorizontalAlignment.Center;
cell.Style.VerticalAlignment = ExcelVerticalAlignment.Center;
cell.Style.Border.Top.Style = ExcelBorderStyle.Thin;
cell.Style.Border.Bottom.Style = ExcelBorderStyle.Thin;
cell.Style.Border.Left.Style = ExcelBorderStyle.Thin;
cell.Style.Border.Right.Style = ExcelBorderStyle.Thin;
}
row++;
}
// Merge Workshop Columns
if (employers.Count > 1)
{
for (int col = 5; col <= 15; col++)
{
ws.Cells[workshopStartRow, col, row - 1, col].Merge = true;
var merged = ws.Cells[workshopStartRow, col, row - 1, col];
merged.Style.VerticalAlignment = ExcelVerticalAlignment.Center;
merged.Style.HorizontalAlignment = ExcelHorizontalAlignment.Center;
}
}
}
// Merge Contracting Party Columns
if (row - partyStartRow > 1)
{
for (int col = 1; col <= 2; col++)
{
ws.Cells[partyStartRow, col, row - 1, col].Merge = true;
var merged = ws.Cells[partyStartRow, col, row - 1, col];
merged.Style.VerticalAlignment = ExcelVerticalAlignment.Center;
merged.Style.HorizontalAlignment = ExcelHorizontalAlignment.Center;
}
}
// می‌تونی در صورت نیاز خط بالا و پایین ضخیم برای گروه‌ها رو هم فعال کنی اینجا
// for (int col = 1; col <= 15; col++)
// {
// ws.Cells[partyStartRow, col].Style.Border.Top.Style = ExcelBorderStyle.Medium;
// ws.Cells[row - 1, col].Style.Border.Bottom.Style = ExcelBorderStyle.Medium;
// }
}
ws.Cells.AutoFitColumns();
ws.View.RightToLeft = true;
}
}
public class DataExcelResult
{
public long ContractingPartyId { get; set; }
public string ContractingPartyName { get; set; }
public List<WorkshopExcelResultData> Workshops { get; set; }
}
public class EmployerExcelResultData
{
public long Id { get; set; }
public string EmployerName { get; set; }
}
public class WorkshopExcelResultData
{
public long Id { get; set; }
public string WorkshopName { get; set; }
public bool HasContract { get; set; }
public bool HasInsurance { get; set; }
public bool HasRollCall { get; set; }
public bool HasCustomizeCheckout { get; set; }
public List<EmployerExcelResultData> Employers { get; set; }
public int DebtRollCallMonth { get; set; }
public string ArchiveCode { get; set; }
}

View File

@@ -13,6 +13,10 @@ public class GroupedRollCalls
public TimeSpan BreakTime { get; set; }
public DateTime ShiftDate { get; set; }
/// <summary>
/// تاریخ های جمع کاری
/// </summary>
public DateTime? Fridays { get; set; }
/// <summary>
/// تاخیر در ورود (مدت زمانی که کارمند با تأخیر وارد شده است)
/// </summary>

View File

@@ -35,4 +35,6 @@ public class RollCallEmployeeViewModel : EditRollCallEmployee
public string EmployeeFName { get; set; }
public long RollCallEmployeeId { get; set; }
public bool CreatedByClient { get; set; }
public string RollCallEmployeeName { get; set; }
public bool HasChangedName { get; set; }
}

View File

@@ -566,7 +566,7 @@ public class CustomizeWorkshopSettingsApplication(ICustomizeWorkshopSettingsRepo
_customizeWorkshopEmployeeSettingsRepository.Create(entity);
entity.SimpleEdit(shiftCollection, command.IrregularShift, command.WorkshopShiftStatus, command.BreakTime, isChanged, command.HolidayWork, rotatingShift, customizeWorkshopGroupSettings.WeeklyOffDays.ToList());
entity.SimpleEdit(shiftCollection, command.IrregularShift, command.WorkshopShiftStatus, command.BreakTime, isChanged, command.HolidayWork, rotatingShift, weeklyOffDays.ToList());
_customizeWorkshopGroupSettingsRepository.SaveChanges();
return op.Succcedded();

View File

@@ -58,7 +58,7 @@ public class RollCallEmployeeRepository : RepositoryBase<long, RollCallEmployee>
}
else
{
skipRollCallByWorkshopId = workshopId is 368 or 367 or 610;
skipRollCallByWorkshopId = workshopId is 368 or 367 or 610;
}
@@ -209,7 +209,7 @@ public class RollCallEmployeeRepository : RepositoryBase<long, RollCallEmployee>
WorkshopId = command.WorkshopId,
EmployeeId = employee.Id,
Id = joinedRollCall == null ? 0 : joinedRollCall.id,
EmployeeFullName = joinedRollCall == null ? employee.FullName : joinedRollCall.EmployeeFullName,
EmployeeFullName = employee.FullName,
NationalCode = employee.NationalCode,
IsActiveString =
joinedRollCall.EmployeesStatus.Any(y =>
@@ -217,7 +217,9 @@ public class RollCallEmployeeRepository : RepositoryBase<long, RollCallEmployee>
? "true"
: "false",
HasUploadedImage = joinedRollCall == null ? "false" : joinedRollCall.HasUploadedImage,
CreatedByClient = clientTemp != null || (employee.workshopTemp != null && employee.workshopTemp.LeftWorkType == LeftWorkTempType.StartWork)
CreatedByClient = clientTemp != null || (employee.workshopTemp != null && employee.workshopTemp.LeftWorkType == LeftWorkTempType.StartWork),
RollCallEmployeeName = joinedRollCall == null ? null : joinedRollCall.EmployeeFullName,
HasChangedName = joinedRollCall != null && joinedRollCall.HasChangedName
};
@@ -350,8 +352,8 @@ public class RollCallEmployeeRepository : RepositoryBase<long, RollCallEmployee>
var rollCallEmployeesQuery = _context.RollCallEmployees.Include(x => x.EmployeesStatus)
.Where(x => x.WorkshopId == workshopId
&& x.EmployeesStatus.Any(y => y.StartDate.Date <= dateNow && y.EndDate.Date > dateNow)
&& x.HasUploadedImage == "true" &&leftWork.Any(l=>l.EmployeeId == x.EmployeeId && l.WorkshopId == x.WorkshopId));
&& x.EmployeesStatus.Any(y => y.StartDate.Date <= dateNow && y.EndDate.Date > dateNow)
&& x.HasUploadedImage == "true" && leftWork.Any(l => l.EmployeeId == x.EmployeeId && l.WorkshopId == x.WorkshopId));
var personnel =
@@ -476,7 +478,7 @@ public class RollCallEmployeeRepository : RepositoryBase<long, RollCallEmployee>
public RollCallEmployee GetBy(long employeeId, long workshopId)
{
return _context.RollCallEmployees.Include(x=>x.EmployeesStatus).FirstOrDefault(x => x.EmployeeId == employeeId && x.WorkshopId == workshopId);
return _context.RollCallEmployees.Include(x => x.EmployeesStatus).FirstOrDefault(x => x.EmployeeId == employeeId && x.WorkshopId == workshopId);
}
#endregion

View File

@@ -1,3 +1,4 @@
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<s:Boolean x:Key="/Default/CodeEditing/SuppressNullableWarningFix/Enabled/@EntryValue">False</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Govermentlist/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Mcls/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary>

View File

@@ -1,6 +1,7 @@
using System.Diagnostics.CodeAnalysis;
using _0_Framework.Application;
using AccountManagement.Application.Contracts.Account;
using CompanyManagement.Infrastructure.Excel.InstitutionContract;
using CompanyManagment.App.Contracts.Employer;
using CompanyManagment.App.Contracts.InstitutionContract;
using CompanyManagment.App.Contracts.InstitutionContractContactinfo;
@@ -918,6 +919,14 @@ public class IndexModel : PageModel
});
}
public IActionResult OnGetDownloadExcel()
{
var institutionContractViewModels = _institutionContract.NewSearch(new() {IsActiveString = "both", TypeOfContract = "both" });
var bytes = InstitutionContractExcelGenerator.GenerateExcel(institutionContractViewModels);
return File(bytes,
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
$"قرارداد های مالی.xlsx");
}
//public async Task<IActionResult> OnGetPrintiText7()
//{

View File

@@ -1,4 +1,5 @@
@model CompanyManagment.App.Contracts.RollCallEmployee.RollCallEmployeeViewModel
@using Version = _0_Framework.Application.Version
@model CompanyManagment.App.Contracts.RollCallEmployee.RollCallEmployeeViewModel
@{
string clientVersion = _0_Framework.Application.Version.StyleVersion;
@@ -89,4 +90,4 @@
var saveChangeNameAjax = `@Url.Page("./EmployeeUploadPicture", "ChangeName")`;
var employeeId = Number(@Model.EmployeeId);
</script>
<script src="~/assetsclient/pages/RollCall/js/ModalChangeName.js?ver=963"></script>
<script src="~/assetsclient/pages/RollCall/js/ModalChangeName.js?ver=@Version.StyleVersion"></script>

View File

@@ -121,7 +121,7 @@ function loadDataAjax() {
else {
html += `<img id="ImageEmployee_${item.employeeId}" src="/AssetsClient/images/Credits.png" class="img-avatar" alt="">`;
}
html += `<div id="EmployeeFullName_${item.employeeId}">${item.employeeFullName}</div>
html += `<div id="EmployeeFullName_${item.employeeId}">${item.employeeFullName} <span id="changedNameSpan_${item.employeeId}" style="color: red;font-size: x-small;">${item.hasChangedName ? `(${item.rollCallEmployeeName})` :``}<span/></div>
</div>
</div>
<div class="Rtable-cell d-md-block d-none width3">
@@ -163,8 +163,8 @@ function loadDataAjax() {
</div>
<div class="Rtable-cell--content align-items-center d-flex d-md-block text-end me-1 changeNameBtn_${item.employeeId} ${item.isActiveString === "true" ? `` : item.hasUploadedImage === "false" ? `disable` : ``}">
<button class="btn-upload" type="button" onclick='ModalChaneName(${item.employeeId})' style="width: 95px;">
ویرایش نام
<button class="btn-upload" type="button" onclick='ModalChaneName(${item.employeeId})' style="width: 100px;">
ایجاد نام مستعار
</button>
</div>
@@ -198,7 +198,7 @@ function loadDataAjax() {
html += `</span>
</div>
<div class="Rtable-cell--content my-auto">
<div class="title-mobile" style="width: 132px;" id="EmployeeFullNameMobile_${item.employeeId}">${item.employeeFullName}</div>
<div class="title-mobile" style="width: 132px;" id="EmployeeFullNameMobile_${item.employeeId}">${item.employeeFullName} <span id="changedNameSpanMobile_${item.employeeId}" style="color: red;font-size: x-small;">${item.hasChangedName ? `(${item.rollCallEmployeeName})` : ``}<span/></div>
<div class="content-mobile">`;
if (item.hasUploadedImage === "true") {
html += `<p id="TextUploadMobile_${item.employeeId}" class="m-0">عکس پرسنل آپلود شده است</p>`;

View File

@@ -43,8 +43,8 @@ $('#createData').click(function() {
loading.hide();
}, 2000);
$(`#EmployeeFullName_${employeeId}`).html($('#EmployeeFName').val() + ' ' + $('#EmployeeLName').val());
$(`#EmployeeFullNameMobile_${employeeId}`).html($('#EmployeeFName').val() + ' ' + $('#EmployeeLName').val());
$(`#changedNameSpan_${employeeId}`).html('('+$('#EmployeeFName').val() + ' ' + $('#EmployeeLName').val()+')');
$(`#changedNameSpanMobile_${employeeId}`).html('(' + $('#EmployeeFName').val() + ' ' + $('#EmployeeLName').val() + ')');
$('#MainModal').modal('hide');

View File

@@ -766,6 +766,7 @@ async function ajaxEditEmployeeSaveData() {
// save all data
var saveData = {};
function saveDataLocal() {
saveData = {}
var hasBreakTime = "false";
if ($('#BreakTime').prop('checked')) {
hasBreakTime = $("#BreakTime").prop("checked") ? "true" : "false";