Compare commits
62 Commits
Feature/CW
...
83b045c2b1
| Author | SHA1 | Date | |
|---|---|---|---|
| 83b045c2b1 | |||
|
|
9ca041ac18 | ||
|
|
031fb05f8c | ||
|
|
4aed0ddd68 | ||
|
|
9b455d4a2e | ||
|
|
0c0e955800 | ||
|
|
c948498307 | ||
|
|
5f7f63689c | ||
|
|
7db754af56 | ||
|
|
87afbbe44c | ||
| f35aca8e44 | |||
| 16d45c6dc4 | |||
| 45e746b194 | |||
| 5fa49a4988 | |||
|
|
5576ee5c24 | ||
|
|
42ea521e0b | ||
|
|
c608e22062 | ||
|
|
bb80da6e3b | ||
|
|
4c734e0513 | ||
|
|
f04749043e | ||
|
|
e8a9a674a1 | ||
|
|
d8b6b0f5e8 | ||
|
|
cc3812ebee | ||
|
|
99e807fa23 | ||
|
|
17e390d840 | ||
|
|
f4a16b8c69 | ||
|
|
2ce17dcac9 | ||
|
|
233c1a3aa9 | ||
|
|
c2fa992369 | ||
|
|
922ab6f32b | ||
|
|
0eee2a53c3 | ||
|
|
37cd07c2b8 | ||
|
|
6201492879 | ||
|
|
b0f5ec6bbd | ||
|
|
9ef48b982d | ||
|
|
2a306dedac | ||
|
|
489528d076 | ||
|
|
400790a53b | ||
|
|
6a2ff178d3 | ||
|
|
5f64b945d1 | ||
|
|
280a475455 | ||
|
|
a7b91fac18 | ||
|
|
fcea7eed21 | ||
|
|
0a293dfa8c | ||
|
|
5825c7b8e2 | ||
| ebdf26d93c | |||
|
|
67ec735778 | ||
|
|
3a6f87eaca | ||
|
|
1ebbd2d7a9 | ||
|
|
a40a9643f4 | ||
|
|
55c139578d | ||
|
|
e9588125c0 | ||
|
|
ec277629fb | ||
|
|
bf9c317565 | ||
|
|
22bd435627 | ||
|
|
423d6ada9b | ||
|
|
faeb297f5c | ||
|
|
8bdfd44bba | ||
|
|
104534ed96 | ||
|
|
c00a9c0864 | ||
|
|
cdb29a80e1 | ||
|
|
c3457881b0 |
8
0_Framework/Application/Enums/ActivationStatus.cs
Normal file
8
0_Framework/Application/Enums/ActivationStatus.cs
Normal file
@@ -0,0 +1,8 @@
|
||||
namespace _0_Framework.Application.Enums;
|
||||
|
||||
public enum ActivationStatus
|
||||
{
|
||||
None = 0,
|
||||
Active = 1,
|
||||
DeActive = 2
|
||||
}
|
||||
8
0_Framework/Application/Enums/LegalType.cs
Normal file
8
0_Framework/Application/Enums/LegalType.cs
Normal file
@@ -0,0 +1,8 @@
|
||||
namespace _0_Framework.Application.Enums;
|
||||
|
||||
public enum LegalType
|
||||
{
|
||||
None = 0,
|
||||
Real = 1,
|
||||
Legal = 2
|
||||
}
|
||||
7
0_Framework/Application/SelectListViewModel.cs
Normal file
7
0_Framework/Application/SelectListViewModel.cs
Normal file
@@ -0,0 +1,7 @@
|
||||
namespace _0_Framework.Application;
|
||||
|
||||
public class SelectListViewModel
|
||||
{
|
||||
public long Id { get; set; }
|
||||
public string Text { get; set; }
|
||||
}
|
||||
@@ -41,6 +41,23 @@ 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>
|
||||
/// دریافت روزهای کارکرد پرسنل در لیست بیمه ماه مشخص شده
|
||||
|
||||
@@ -4,12 +4,13 @@ using System.Collections.Generic;
|
||||
|
||||
namespace AccountManagement.Application.Contracts.Media
|
||||
{
|
||||
public interface IMediaApplication
|
||||
{
|
||||
MediaViewModel Get(long id);
|
||||
OperationResult UploadFile(IFormFile file, string fileLabel, string relativePath, int maximumFileLength, List<string> allowedExtensions);
|
||||
OperationResult MoveFile(long mediaId, string newRelativePath);
|
||||
OperationResult DeleteFile(long mediaId);
|
||||
List<MediaViewModel> GetRange(IEnumerable<long> select);
|
||||
}
|
||||
public interface IMediaApplication
|
||||
{
|
||||
MediaViewModel Get(long id);
|
||||
OperationResult UploadFile(IFormFile file, string fileLabel, string relativePath, int maximumFileLength,
|
||||
List<string> allowedExtensions, string category);
|
||||
OperationResult MoveFile(long mediaId, string newRelativePath);
|
||||
OperationResult DeleteFile(long mediaId);
|
||||
List<MediaViewModel> GetRange(IEnumerable<long> select);
|
||||
}
|
||||
}
|
||||
@@ -9,147 +9,113 @@ using Microsoft.AspNetCore.Http;
|
||||
|
||||
namespace AccountManagement.Application
|
||||
{
|
||||
public class MediaApplication:IMediaApplication
|
||||
{
|
||||
public class MediaApplication : IMediaApplication
|
||||
{
|
||||
|
||||
|
||||
private const string _basePath = "Medias";
|
||||
private readonly IMediaRepository _mediaRepository;
|
||||
private const string _basePath = "Medias";
|
||||
private readonly IMediaRepository _mediaRepository;
|
||||
|
||||
public MediaApplication(IMediaRepository mediaRepository)
|
||||
{
|
||||
_mediaRepository = mediaRepository;
|
||||
}
|
||||
public MediaApplication(IMediaRepository mediaRepository)
|
||||
{
|
||||
_mediaRepository = mediaRepository;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// دریافت فایل و نوشتن آن در مسیر داده شده، و ثبت مدیا
|
||||
/// </summary>
|
||||
/// <param name="file">فایل</param>
|
||||
/// <param name="fileLabel">برچسب فایل که در نام فایل ظاهر می شود</param>
|
||||
/// <param name="relativePath">مسیر فایل</param>
|
||||
/// <param name="allowedExtensions">[.png,.jpg,.jpeg] پسوند های مجاز مثلا </param>
|
||||
/// <param name="maximumFileLength">حداکثر حجم فایل به مگابایت</param>
|
||||
/// <returns></returns>
|
||||
public OperationResult UploadFile(IFormFile file, string fileLabel, string relativePath,int maximumFileLength,List<string> allowedExtensions)
|
||||
{
|
||||
OperationResult op = new();
|
||||
var path = Path.Combine(_basePath, relativePath);
|
||||
var fileExtension = Path.GetExtension(file.FileName);
|
||||
|
||||
if (file == null || file.Length == 0)
|
||||
return op.Failed("خطای سیستمی");
|
||||
|
||||
if (file.Length > (maximumFileLength * 1024 * 1024))
|
||||
return op.Failed($"حجم فایل نمی تواند بیشتر از " +
|
||||
$"{maximumFileLength}" +
|
||||
$"مگابایت باشد");
|
||||
|
||||
if (!allowedExtensions.Contains(fileExtension.ToLower()))
|
||||
{
|
||||
var operationMessage = ":فرمت فایل باید یکی از موارد زیر باشد";
|
||||
operationMessage += "\n";
|
||||
operationMessage += string.Join(" ", allowedExtensions);
|
||||
return op.Failed(operationMessage);
|
||||
}
|
||||
/// <summary>
|
||||
/// دریافت فایل و نوشتن آن در مسیر داده شده، و ثبت مدیا
|
||||
/// </summary>
|
||||
/// <param name="file">فایل</param>
|
||||
/// <param name="fileLabel">برچسب فایل که در نام فایل ظاهر می شود</param>
|
||||
/// <param name="relativePath">مسیر فایل</param>
|
||||
/// <param name="maximumFileLength">حداکثر حجم فایل به مگابایت</param>
|
||||
/// <param name="allowedExtensions">[.png,.jpg,.jpeg] پسوند های مجاز مثلا </param>
|
||||
/// <param name="category"></param>
|
||||
/// <returns></returns>
|
||||
public OperationResult UploadFile(IFormFile file, string fileLabel, string relativePath, int maximumFileLength,
|
||||
List<string> allowedExtensions, string category)
|
||||
{
|
||||
return _mediaRepository.UploadFile(file, fileLabel, relativePath, maximumFileLength, allowedExtensions, category);
|
||||
}
|
||||
|
||||
|
||||
Directory.CreateDirectory(path);
|
||||
/// <summary>
|
||||
/// حذف فایل
|
||||
/// </summary>
|
||||
public OperationResult DeleteFile(long mediaId)
|
||||
{
|
||||
OperationResult op = new();
|
||||
var media = _mediaRepository.Get(mediaId);
|
||||
if (media == null)
|
||||
return op.Failed("رکورد مورد نظر یافت نشد");
|
||||
try
|
||||
{
|
||||
if (File.Exists(media.Path))
|
||||
File.Delete(media.Path);
|
||||
else
|
||||
return op.Failed("فایل یافت نشد");
|
||||
}
|
||||
catch
|
||||
{
|
||||
return op.Failed("خطایی در حذف فایل رخ داده است");
|
||||
}
|
||||
|
||||
var extension = Path.GetExtension(file.FileName);
|
||||
_mediaRepository.Remove(media.id);
|
||||
_mediaRepository.SaveChanges();
|
||||
return op.Succcedded();
|
||||
}
|
||||
|
||||
var uniqueFileName = $"{fileLabel}-{DateTime.Now.Ticks}{extension}";
|
||||
var filePath = Path.Combine(path, uniqueFileName);
|
||||
using (var fileStream = new FileStream(filePath, FileMode.CreateNew))
|
||||
{
|
||||
file.CopyTo(fileStream);
|
||||
}
|
||||
var mediaEntity = new Media(filePath, extension, "فایل", "EmployeeDocuments");
|
||||
_mediaRepository.Create(mediaEntity);
|
||||
_mediaRepository.SaveChanges();
|
||||
/// <summary>
|
||||
/// جابجا کردن فایل
|
||||
/// </summary>
|
||||
public OperationResult MoveFile(long mediaId, string newRelativePath)
|
||||
{
|
||||
OperationResult op = new();
|
||||
var media = _mediaRepository.Get(mediaId);
|
||||
var oldPath = media.Path;
|
||||
var path = Path.Combine(_basePath, newRelativePath);
|
||||
Directory.CreateDirectory(path);
|
||||
|
||||
return op.Succcedded(mediaEntity.id);
|
||||
string filepath = Path.Combine(path, Path.GetFileName(oldPath));
|
||||
try
|
||||
{
|
||||
File.Move(oldPath, filepath);
|
||||
}
|
||||
catch
|
||||
{
|
||||
return op.Failed("در جابجایی فایل خطایی رخ داده است");
|
||||
}
|
||||
|
||||
}
|
||||
media.Edit(filepath, media.Type, media.Category);
|
||||
_mediaRepository.SaveChanges();
|
||||
return op.Succcedded();
|
||||
}
|
||||
|
||||
public MediaViewModel Get(long id)
|
||||
{
|
||||
var media = _mediaRepository.Get(id);
|
||||
if (media == null)
|
||||
return new();
|
||||
return new MediaViewModel()
|
||||
{
|
||||
Category = media.Category,
|
||||
Path = media.Path,
|
||||
Id = media.id,
|
||||
Type = media.Type
|
||||
};
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// حذف فایل
|
||||
/// </summary>
|
||||
public OperationResult DeleteFile(long mediaId)
|
||||
{
|
||||
OperationResult op = new();
|
||||
var media = _mediaRepository.Get(mediaId);
|
||||
if (media == null)
|
||||
return op.Failed("رکورد مورد نظر یافت نشد");
|
||||
try
|
||||
{
|
||||
if (File.Exists(media.Path))
|
||||
File.Delete(media.Path);
|
||||
else
|
||||
return op.Failed("فایل یافت نشد");
|
||||
}
|
||||
catch
|
||||
{
|
||||
return op.Failed("خطایی در حذف فایل رخ داده است");
|
||||
}
|
||||
public List<MediaViewModel> GetRange(IEnumerable<long> ids)
|
||||
{
|
||||
var medias = _mediaRepository.GetRange(ids);
|
||||
return medias.Select(x => new MediaViewModel()
|
||||
{
|
||||
Category = x.Category,
|
||||
Path = x.Path,
|
||||
Id = x.id,
|
||||
Type = x.Type,
|
||||
}).ToList();
|
||||
}
|
||||
|
||||
_mediaRepository.Remove(media.id);
|
||||
_mediaRepository.SaveChanges();
|
||||
return op.Succcedded();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// جابجا کردن فایل
|
||||
/// </summary>
|
||||
public OperationResult MoveFile(long mediaId, string newRelativePath)
|
||||
{
|
||||
OperationResult op = new();
|
||||
var media = _mediaRepository.Get(mediaId);
|
||||
var oldPath = media.Path;
|
||||
var path = Path.Combine(_basePath, newRelativePath);
|
||||
Directory.CreateDirectory(path);
|
||||
|
||||
string filepath = Path.Combine(path, Path.GetFileName(oldPath));
|
||||
try
|
||||
{
|
||||
File.Move(oldPath, filepath);
|
||||
}
|
||||
catch
|
||||
{
|
||||
return op.Failed("در جابجایی فایل خطایی رخ داده است");
|
||||
}
|
||||
|
||||
media.Edit(filepath, media.Type, media.Category);
|
||||
_mediaRepository.SaveChanges();
|
||||
return op.Succcedded();
|
||||
}
|
||||
|
||||
public MediaViewModel Get(long id)
|
||||
{
|
||||
var media = _mediaRepository.Get(id);
|
||||
if (media == null)
|
||||
return new();
|
||||
return new MediaViewModel()
|
||||
{
|
||||
Category = media.Category,
|
||||
Path = media.Path,
|
||||
Id = media.id,
|
||||
Type = media.Type
|
||||
};
|
||||
}
|
||||
|
||||
public List<MediaViewModel> GetRange(IEnumerable<long> ids)
|
||||
{
|
||||
var medias = _mediaRepository.GetRange(ids);
|
||||
return medias.Select(x=>new MediaViewModel()
|
||||
{
|
||||
Category = x.Category,
|
||||
Path = x.Path,
|
||||
Id = x.id,
|
||||
Type = x.Type,
|
||||
}).ToList();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,12 +1,15 @@
|
||||
using System.Collections.Generic;
|
||||
using _0_Framework.Application;
|
||||
using _0_Framework.Domain;
|
||||
using AccountManagement.Application.Contracts.Media;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
|
||||
|
||||
namespace AccountManagement.Domain.MediaAgg;
|
||||
|
||||
public interface IMediaRepository:IRepository<long,Media>
|
||||
public interface IMediaRepository : IRepository<long, Media>
|
||||
{
|
||||
public string BasePath { get; protected set; }
|
||||
void CreateMediaWithTaskMedia(long taskId, long mediaId);
|
||||
List<MediaViewModel> GetMediaByTaskId(long taskId);
|
||||
void Remove(long id);
|
||||
@@ -23,4 +26,6 @@ public interface IMediaRepository:IRepository<long,Media>
|
||||
|
||||
#endregion
|
||||
|
||||
OperationResult UploadFile(IFormFile file, string fileLabel, string relativePath, int maximumFileLength,
|
||||
List<string> allowedExtensions, string category);
|
||||
}
|
||||
@@ -1,5 +1,8 @@
|
||||
using System.Collections.Generic;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using _0_Framework.Application;
|
||||
using _0_Framework.InfraStructure;
|
||||
using AccountManagement.Application.Contracts.Media;
|
||||
using AccountManagement.Domain.AdminResponseMediaAgg;
|
||||
@@ -7,27 +10,35 @@ using AccountManagement.Domain.ClientResponseMediaAgg;
|
||||
using AccountManagement.Domain.MediaAgg;
|
||||
using AccountManagement.Domain.TaskMediaAgg;
|
||||
using AccountManagement.Domain.TicketMediasAgg;
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace AccountMangement.Infrastructure.EFCore.Repository;
|
||||
|
||||
public class MediaRepository:RepositoryBase<long,Media>,IMediaRepository
|
||||
public class MediaRepository : RepositoryBase<long, Media>, IMediaRepository
|
||||
{
|
||||
private const string _basePath = "Storage/Medias";
|
||||
public string BasePath { get; set; }
|
||||
|
||||
|
||||
private readonly AccountContext _accountContext;
|
||||
public MediaRepository( AccountContext taskManagerContext) : base(taskManagerContext)
|
||||
public MediaRepository(AccountContext taskManagerContext, IWebHostEnvironment webHostEnvironment) : base(taskManagerContext)
|
||||
{
|
||||
_accountContext = taskManagerContext;
|
||||
BasePath = webHostEnvironment.ContentRootPath + "/Storage";
|
||||
}
|
||||
//ساخت جدول واسط بین مدیا و نسک
|
||||
//نکته: این متد ذخیره انجام نمیدهد
|
||||
|
||||
public void CreateMediaWithTaskMedia(long taskId, long mediaId)
|
||||
{
|
||||
var Taskmedias = new TaskMedia(taskId,mediaId);
|
||||
var Taskmedias = new TaskMedia(taskId, mediaId);
|
||||
_accountContext.Add(Taskmedias);
|
||||
}
|
||||
public void Remove(long id)
|
||||
{
|
||||
var media = Get(id);
|
||||
var media = Get(id);
|
||||
Remove(media);
|
||||
}
|
||||
|
||||
@@ -77,6 +88,48 @@ public class MediaRepository:RepositoryBase<long,Media>,IMediaRepository
|
||||
{
|
||||
return _accountContext.Medias.Where(x => mediaIds.Contains(x.id)).ToList();
|
||||
}
|
||||
|
||||
public OperationResult UploadFile(IFormFile file, string fileLabel, string relativePath, int maximumFileLength,
|
||||
List<string> allowedExtensions, string category)
|
||||
{
|
||||
OperationResult op = new();
|
||||
var path = Path.Combine(_basePath, relativePath);
|
||||
var fileExtension = Path.GetExtension(file.FileName);
|
||||
|
||||
if (file == null || file.Length == 0)
|
||||
return op.Failed("خطای سیستمی");
|
||||
|
||||
if (file.Length > (maximumFileLength * 1024 * 1024))
|
||||
return op.Failed($"حجم فایل نمی تواند بیشتر از " +
|
||||
$"{maximumFileLength}" +
|
||||
$"مگابایت باشد");
|
||||
|
||||
if (!allowedExtensions.Contains(fileExtension.ToLower()))
|
||||
{
|
||||
var operationMessage = ":فرمت فایل باید یکی از موارد زیر باشد";
|
||||
operationMessage += "\n";
|
||||
operationMessage += string.Join(" ", allowedExtensions);
|
||||
return op.Failed(operationMessage);
|
||||
}
|
||||
|
||||
|
||||
Directory.CreateDirectory(path);
|
||||
|
||||
var extension = Path.GetExtension(file.FileName);
|
||||
|
||||
var uniqueFileName = $"{fileLabel}-{DateTime.Now.Ticks}{extension}";
|
||||
var filePath = Path.Combine(path, uniqueFileName);
|
||||
using (var fileStream = new FileStream(filePath, FileMode.CreateNew))
|
||||
{
|
||||
file.CopyTo(fileStream);
|
||||
}
|
||||
var mediaEntity = new Media(filePath, extension, "فایل", category);
|
||||
Create(mediaEntity);
|
||||
SaveChanges();
|
||||
|
||||
return op.Succcedded(mediaEntity.id);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
26
Company.Domain/ContactUsAgg/ContactUs.cs
Normal file
26
Company.Domain/ContactUsAgg/ContactUs.cs
Normal file
@@ -0,0 +1,26 @@
|
||||
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; }
|
||||
|
||||
}
|
||||
8
Company.Domain/ContactUsAgg/IContactUsRepository.cs
Normal file
8
Company.Domain/ContactUsAgg/IContactUsRepository.cs
Normal file
@@ -0,0 +1,8 @@
|
||||
using _0_Framework.Domain;
|
||||
|
||||
namespace Company.Domain.ContactUsAgg;
|
||||
|
||||
public interface IContactUsRepository : IRepository<long, ContactUs>
|
||||
{
|
||||
|
||||
}
|
||||
@@ -3,6 +3,7 @@ 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;
|
||||
|
||||
@@ -42,6 +43,34 @@ 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,6 +213,7 @@ public class CustomizeWorkshopEmployeeSettings : BaseCustomizeEntity
|
||||
earlyExit.EarlyExitTimeFines.Select(x => new EarlyExitTimeFine(x.Minute, x.FineMoney))
|
||||
.ToList(), earlyExit.Value);
|
||||
}
|
||||
|
||||
public void UpdateIsShiftChange()
|
||||
{
|
||||
var groupSetting = CustomizeWorkshopGroupSettings;
|
||||
@@ -269,4 +270,10 @@ public class CustomizeWorkshopEmployeeSettings : BaseCustomizeEntity
|
||||
|
||||
IsShiftChanged = isShiftChange;
|
||||
}
|
||||
|
||||
|
||||
public void SetSalary(double salary)
|
||||
{
|
||||
Salary = salary;
|
||||
}
|
||||
}
|
||||
@@ -60,4 +60,13 @@ public interface IInsuranceListRepository:IRepository<long, InsuranceList>
|
||||
#region client
|
||||
List<InsuranceListViewModel> SearchForClient(InsuranceListSearchModel searchModel);
|
||||
#endregion
|
||||
|
||||
#region Mahan
|
||||
Task<InsuranceListConfirmOperation> GetInsuranceOperationDetails(long id);
|
||||
|
||||
Task<InsuranceListTabsCountViewModel> GetTabCounts(long accountId,int month,int year);
|
||||
|
||||
#endregion
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -4,7 +4,9 @@ using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using _0_Framework.Domain;
|
||||
using Company.Domain.InsuranceListAgg.ValueObjects;
|
||||
using Company.Domain.InsuranceWorkshopAgg;
|
||||
using CompanyManagment.App.Contracts.InsuranceList.Enums;
|
||||
|
||||
namespace Company.Domain.InsuranceListAgg;
|
||||
|
||||
@@ -151,6 +153,21 @@ public class InsuranceList : EntityBase
|
||||
/// </summary>
|
||||
public double SumOfMarriedAllowance { get; private set; }
|
||||
|
||||
#region Mahan
|
||||
/// <summary>
|
||||
/// بازرسی
|
||||
/// </summary>
|
||||
public InsuranceListInspection Inspection { get; set; } =new (InsuranceListInspectionType.None,DateTime.MinValue, 0);
|
||||
/// <summary>
|
||||
/// بدهی
|
||||
/// </summary>
|
||||
public InsuranceListDebt Debt { get; set; } = new(InsuranceListDebtType.None, DateTime.MinValue, 0, 0);
|
||||
/// <summary>
|
||||
/// تاییدیه کارفرما
|
||||
/// </summary>
|
||||
public InsuranceListEmployerApproval EmployerApproval { get; set; } = new(InsuranceListEmployerApprovalStatus.None, string.Empty);
|
||||
#endregion
|
||||
|
||||
public List<InsuranceListWorkshop> InsuranceListWorkshops { get; set; }
|
||||
|
||||
public void Edit(int sumOfEmployees, int sumOfWorkingDays, double sumOfSalaries, double sumOfBenefitsIncluded, double included,
|
||||
@@ -174,4 +191,22 @@ public class InsuranceList : EntityBase
|
||||
SumOfDailyWagePlusBaseYears = sumOfDailyWage + sumOfBaseYears;
|
||||
}
|
||||
|
||||
|
||||
public void SetDebt(InsuranceListDebt debt)
|
||||
{
|
||||
Debt = debt;
|
||||
}
|
||||
public void SetInspection(InsuranceListInspection inspection)
|
||||
{
|
||||
Inspection = inspection;
|
||||
}
|
||||
public void SetEmployerApproval(InsuranceListEmployerApproval employerApproval)
|
||||
{
|
||||
EmployerApproval = employerApproval;
|
||||
}
|
||||
public void SetConfirmSentlist(bool confirmSentlist)
|
||||
{
|
||||
ConfirmSentlist = confirmSentlist;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
using System;
|
||||
using CompanyManagment.App.Contracts.InsuranceList.Enums;
|
||||
|
||||
namespace Company.Domain.InsuranceListAgg.ValueObjects;
|
||||
|
||||
public class InsuranceListDebt
|
||||
{
|
||||
public InsuranceListDebt(InsuranceListDebtType type, DateTime debtDate, double amount, long mediaId)
|
||||
{
|
||||
Type = type;
|
||||
if (type == InsuranceListDebtType.None)
|
||||
{
|
||||
DebtDate = DateTime.MinValue;
|
||||
Amount = 0;
|
||||
MediaId = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
DebtDate = debtDate;
|
||||
Amount = amount;
|
||||
MediaId = mediaId;
|
||||
IsDone = true;
|
||||
}
|
||||
}
|
||||
|
||||
public InsuranceListDebtType Type { get; set; }
|
||||
public DateTime DebtDate { get; set; }
|
||||
public double Amount { get; set; }
|
||||
public long MediaId { get; set; }
|
||||
public bool IsDone { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
using System.Security.Cryptography;
|
||||
using CompanyManagment.App.Contracts.InsuranceList.Enums;
|
||||
|
||||
namespace Company.Domain.InsuranceListAgg.ValueObjects;
|
||||
|
||||
public class InsuranceListEmployerApproval
|
||||
{
|
||||
public InsuranceListEmployerApproval(InsuranceListEmployerApprovalStatus status, string description)
|
||||
{
|
||||
Status = status;
|
||||
if (status == InsuranceListEmployerApprovalStatus.None)
|
||||
{
|
||||
Description = string.Empty;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Description = description;
|
||||
IsDone = true;
|
||||
}
|
||||
}
|
||||
|
||||
public InsuranceListEmployerApprovalStatus Status { get; set; }
|
||||
public string Description { get; set; }
|
||||
public bool IsDone { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
using System;
|
||||
using CompanyManagment.App.Contracts.InsuranceList.Enums;
|
||||
|
||||
namespace Company.Domain.InsuranceListAgg.ValueObjects;
|
||||
|
||||
public class InsuranceListInspection
|
||||
{
|
||||
public InsuranceListInspection(InsuranceListInspectionType type, DateTime lastInspectionDateTime, long mediaId)
|
||||
{
|
||||
Type = type;
|
||||
if (type == InsuranceListInspectionType.None)
|
||||
{
|
||||
LastInspectionDateTime = DateTime.MinValue;
|
||||
MediaId = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
LastInspectionDateTime = lastInspectionDateTime;
|
||||
MediaId = mediaId;
|
||||
IsDone = true;
|
||||
}
|
||||
}
|
||||
|
||||
public InsuranceListInspectionType Type { get; set; }
|
||||
public DateTime LastInspectionDateTime { get; set; }
|
||||
public long MediaId { get; set; }
|
||||
public bool IsDone { get; set; }
|
||||
|
||||
}
|
||||
@@ -38,6 +38,12 @@ 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>
|
||||
@@ -47,12 +53,6 @@ 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,7 +23,6 @@ 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,5 +14,7 @@ public interface IWorkshopTempRepository : IRepository<long, WorkshopTemp>
|
||||
/// <returns></returns>
|
||||
Task<List<WorkshopTempViewModel>> GetWorkshopTemp(long contractingPartyTemp);
|
||||
|
||||
System.Threading.Tasks.Task RemoveWorkshopTemps(List<long> workshopTempIds);
|
||||
|
||||
|
||||
}
|
||||
@@ -34,12 +34,14 @@ public class InstitutionContractTemp : EntityBase
|
||||
/// بصورت یکجا
|
||||
/// -
|
||||
/// بصئورت ماهیانه
|
||||
/// OneTime
|
||||
/// </summary>
|
||||
public string PaymentModel { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// مدت قرارداد
|
||||
/// چند ماهه؟
|
||||
/// "12"
|
||||
/// </summary>
|
||||
public string PeriodModel { get; private set; }
|
||||
|
||||
|
||||
@@ -56,6 +56,16 @@ 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
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
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; }
|
||||
}
|
||||
@@ -8,6 +8,7 @@ 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; }
|
||||
@@ -18,4 +19,5 @@ public class CustomizeWorkshopGroupSettingsViewModel
|
||||
public BreakTime BreakTime { get; set; }
|
||||
public FridayWork FridayWork { get; set; }
|
||||
public HolidayWork HolidayWork { get; set; }
|
||||
public int LeavePermitted { get; set; }
|
||||
}
|
||||
@@ -28,6 +28,10 @@ public class CreateEmployeeByClient
|
||||
public List<AddEmployeeDocumentItem> EmployeeDocumentItems { get; set; }
|
||||
public bool HasEmployeeDocument { get; set; }
|
||||
public bool HasRollCallService { get; set; }
|
||||
public bool HasCustomizeCheckoutService { get; set; }
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,84 @@
|
||||
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; }
|
||||
}
|
||||
@@ -0,0 +1,80 @@
|
||||
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; }
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
namespace CompanyManagment.App.Contracts.Employer;
|
||||
|
||||
public class EditLegalEmployer: CreateLegalEmployer
|
||||
{
|
||||
/// <summary>
|
||||
/// آیدی کارفرما
|
||||
/// </summary>
|
||||
public long Id { get; set; }
|
||||
}
|
||||
12
CompanyManagment.App.Contracts/Employer/EditRealEmployer.cs
Normal file
12
CompanyManagment.App.Contracts/Employer/EditRealEmployer.cs
Normal file
@@ -0,0 +1,12 @@
|
||||
namespace CompanyManagment.App.Contracts.Employer;
|
||||
|
||||
/// <summary>
|
||||
/// ویرایش کارفرما حقیقی
|
||||
/// </summary>
|
||||
public class EditRealEmployer:CreateRealEmployer
|
||||
{
|
||||
/// <summary>
|
||||
/// آیدی کارفرما
|
||||
/// </summary>
|
||||
public long Id { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
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; }
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
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; }
|
||||
}
|
||||
@@ -0,0 +1,120 @@
|
||||
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; }
|
||||
|
||||
}
|
||||
@@ -0,0 +1,107 @@
|
||||
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; }
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
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,4 +55,71 @@ 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
|
||||
}
|
||||
|
||||
|
||||
@@ -14,9 +14,6 @@ public class EditInsuranceList:CreateInsuranceList
|
||||
public bool FixedSalary { get; set; }
|
||||
public string Population { get; set; }
|
||||
public long? InsuranceJobId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// پرسنل هایی که قرارداد ترک کار کرده اند ولی ترک کار بیمه ندارند
|
||||
/// </summary>
|
||||
public List<LeftWorkViewModel> LeftWorkEmployees { get; set; }
|
||||
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
namespace CompanyManagment.App.Contracts.InsuranceList.Enums;
|
||||
|
||||
public enum InsuranceListDebtType
|
||||
{
|
||||
None,
|
||||
Old,
|
||||
New
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
namespace CompanyManagment.App.Contracts.InsuranceList.Enums;
|
||||
|
||||
public enum InsuranceListEmployerApprovalStatus
|
||||
{
|
||||
None,
|
||||
/// <summary>
|
||||
/// تاییدیه شفاهی (اذنی)
|
||||
/// </summary>
|
||||
VerbalApproval,
|
||||
/// <summary>
|
||||
/// تاییدیه کاغذی
|
||||
/// </summary>
|
||||
WrittenApproval
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
namespace CompanyManagment.App.Contracts.InsuranceList.Enums;
|
||||
|
||||
public enum InsuranceListInspectionType
|
||||
{
|
||||
None,
|
||||
Old,
|
||||
New
|
||||
}
|
||||
@@ -5,6 +5,7 @@ using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using _0_Framework.Application;
|
||||
using CompanyManagment.App.Contracts.InsuranceList;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
|
||||
namespace CompanyManagment.App.Contracts.InsuranceList;
|
||||
|
||||
@@ -17,9 +18,9 @@ public interface IInsuranceListApplication
|
||||
MainEmployeeDetailsViewModel SearchEmployeeForCreateInsuranceList(EmployeeForCreateInsuranceListSearchModel searchModel);
|
||||
|
||||
double MarriedAllowance(string maritalStatus, long jobId, bool includedStatus,
|
||||
int countWorkingDays, double marriedAlowance, int endMonthCurrentDay);
|
||||
int countWorkingDays, double marriedAlowance, int endMonthCurrentDay);
|
||||
|
||||
OperationResult CreateEmployeeDetailsInfo(EmployeeDetailsForInsuranceListViewModel command);
|
||||
OperationResult CreateEmployeeDetailsInfo(EmployeeDetailsForInsuranceListViewModel command);
|
||||
OperationResult EditEmployeeDetailsInfo(EmployeeDetailsForInsuranceListViewModel command);
|
||||
OperationResult Remove(long id);
|
||||
EditInsuranceList GetDetailsForEdit(long id);
|
||||
@@ -34,4 +35,16 @@ public interface IInsuranceListApplication
|
||||
//farokhiChanges
|
||||
(double basic, int totalYear) BasicYear(long employeeId, long worshopId, DateTime startDate);
|
||||
double GetMonthlyBaseYear(double dayliBase, int countWorkingDays);
|
||||
|
||||
#region Mahan
|
||||
/// <summary>
|
||||
/// مراحل اجرایی برای تکمیل و ارسال لیست بیمه
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
Task<OperationResult> ConfirmInsuranceOperation(InsuranceListConfirmOperation command);
|
||||
Task<InsuranceListConfirmOperation> GetInsuranceOperationDetails(long id);
|
||||
|
||||
Task<InsuranceListTabsCountViewModel> GetTabCounts(long accountId, int month, int year);
|
||||
|
||||
#endregion
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
using CompanyManagment.App.Contracts.InsuranceList.Enums;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
|
||||
namespace CompanyManagment.App.Contracts.InsuranceList;
|
||||
|
||||
public class InsuranceListConfirmOperation
|
||||
{
|
||||
public long InsuranceListId { get; set; }
|
||||
/// <summary>
|
||||
/// بازرسی
|
||||
/// </summary>
|
||||
public CreateInsuranceListInspection Inspection { get; set; }
|
||||
/// <summary>
|
||||
/// بدهی
|
||||
/// </summary>
|
||||
public CreateInsuranceListDebt Debt { get; set; }
|
||||
/// <summary>
|
||||
/// تاییدیه کارفرما
|
||||
/// </summary>
|
||||
public CreateInsuranceListApproval Approval { get; set; }
|
||||
public bool ConfirmSentList { get; set; }
|
||||
}
|
||||
public class CreateInsuranceListApproval
|
||||
{
|
||||
public InsuranceListEmployerApprovalStatus ApprovalStatus { get; set; }
|
||||
public string Description { get; set; }
|
||||
}
|
||||
|
||||
public class CreateInsuranceListDebt
|
||||
{
|
||||
public InsuranceListDebtType Type { get; set; }
|
||||
public string DebtDate { get; set; }
|
||||
public string Amount { get; set; }
|
||||
public IFormFile DebtFile { get; set; }
|
||||
public long DebtFileMediaId { get; set; }
|
||||
public string FilePath { get; set; }
|
||||
}
|
||||
|
||||
public class CreateInsuranceListInspection
|
||||
{
|
||||
public InsuranceListInspectionType Type { get; set; }
|
||||
public string LastInspectionDate { get; set; }
|
||||
public IFormFile InspectionFile { get; set; }
|
||||
public long InspectionFileMediaId { get; set; }
|
||||
public string FilePath { get; set; }
|
||||
|
||||
|
||||
}
|
||||
@@ -25,4 +25,29 @@ public class InsuranceListSearchModel
|
||||
public int PageIndex { get; set; }
|
||||
|
||||
public bool SearchAll { get; set; }
|
||||
|
||||
public InsuranceListSearchStatus Status { get; set; }
|
||||
}
|
||||
|
||||
public enum InsuranceListSearchStatus
|
||||
{
|
||||
/// <summary>
|
||||
/// انجام نشده
|
||||
/// </summary>
|
||||
NotStarted = 0,
|
||||
|
||||
/// <summary>
|
||||
/// در حال انجام امور
|
||||
/// </summary>
|
||||
InProgress = 1,
|
||||
|
||||
/// <summary>
|
||||
/// آماده ارسال لیست
|
||||
/// </summary>
|
||||
ReadyToSendList = 2,
|
||||
|
||||
/// <summary>
|
||||
/// انجام بیمه
|
||||
/// </summary>
|
||||
Done = 3
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
namespace CompanyManagment.App.Contracts.InsuranceList;
|
||||
|
||||
public class InsuranceListTabsCountViewModel
|
||||
{
|
||||
/// <summary>
|
||||
/// انجام نشده
|
||||
/// </summary>
|
||||
public int NotStarted { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// در حال انجام امور
|
||||
/// </summary>
|
||||
public int InProgress { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// آماده ارسال لیست
|
||||
/// </summary>
|
||||
public int ReadyToSendList { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// انجام بیمه
|
||||
/// </summary>
|
||||
public int Done { get; set; }
|
||||
}
|
||||
@@ -27,4 +27,11 @@ public class InsuranceListViewModel
|
||||
public long WorkShopId { get; set; }
|
||||
public string IsBlockCantracingParty { get; set; }
|
||||
public long EmployerId { get; set; }
|
||||
|
||||
/// <summary>وضعیت بازرسی</summary>
|
||||
public bool InspectionDone { get; set; }
|
||||
/// <summary>وضعیت بدهی</summary>
|
||||
public bool DebtDone { get; set; }
|
||||
/// <summary>وضعیت تاییدیه کارفرما</summary>
|
||||
public bool EmployerApproved { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
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; }
|
||||
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
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; }
|
||||
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
using _0_Framework.Application;
|
||||
|
||||
namespace CompanyManagment.App.Contracts.PersonalContractingParty;
|
||||
|
||||
public class ContractingPartySelectListViewModel: SelectListViewModel
|
||||
{
|
||||
|
||||
}
|
||||
@@ -0,0 +1,74 @@
|
||||
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; }
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,77 @@
|
||||
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; }
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
namespace CompanyManagment.App.Contracts.PersonalContractingParty;
|
||||
|
||||
/// <summary>
|
||||
/// ویرایش طرف حساب حقوقی
|
||||
/// </summary>
|
||||
public class EditLegalContractingParty:CreateLegalContractingParty
|
||||
{
|
||||
/// <summary>
|
||||
/// آیدی طرف حساب
|
||||
/// </summary>
|
||||
public long Id { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
namespace CompanyManagment.App.Contracts.PersonalContractingParty;
|
||||
|
||||
/// <summary>
|
||||
/// ویرایش طرف حساب حقیقی
|
||||
/// </summary>
|
||||
public class EditRealContractingParty:CreateRealContractingParty
|
||||
{
|
||||
/// <summary>
|
||||
/// آیدی طرف حساب
|
||||
/// </summary>
|
||||
public long Id { get; set; }
|
||||
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
namespace CompanyManagment.App.Contracts.PersonalContractingParty;
|
||||
|
||||
/// <summary>
|
||||
/// شماره ملی یا شناسه ملی بر اساس حقیقی یا حقوقی بودن
|
||||
/// </summary>
|
||||
public class GetContractingPartyNationalCodeOrNationalIdViewModel
|
||||
{
|
||||
/// <summary>
|
||||
/// شماره ملی یا شناسه ملی
|
||||
/// </summary>
|
||||
public string NationalCodeOrNationalId { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,83 @@
|
||||
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; }
|
||||
|
||||
}
|
||||
@@ -0,0 +1,94 @@
|
||||
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,5 +1,6 @@
|
||||
using _0_Framework.Application;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
|
||||
namespace CompanyManagment.App.Contracts.PersonalContractingParty;
|
||||
@@ -54,4 +55,79 @@ 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,4 +47,6 @@ public class PersonalContractingPartyViewModel
|
||||
public bool IsAuthenticated { get; set; }
|
||||
public List<EmployerViewModel> EmployerList { get; set; }
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
using System.Collections.Generic;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using _0_Framework.Application;
|
||||
using CompanyManagment.App.Contracts.InstitutionPlan;
|
||||
@@ -38,7 +39,7 @@ public interface ITemporaryClientRegistrationApplication
|
||||
/// </summary>
|
||||
/// <param name="command"></param>
|
||||
/// <returns></returns>
|
||||
Task<OperationResult> CreateOrUpdateWorkshopTemp(List<WorkshopTempViewModel> command);
|
||||
Task<OperationResult> CreateOrUpdateWorkshopTemp(List<WorkshopTempViewModel> command, long contractingPartyTempId);
|
||||
|
||||
/// <summary>
|
||||
/// دریافت جمع کل خدمات برای یک کارگاه
|
||||
@@ -55,14 +56,14 @@ public interface ITemporaryClientRegistrationApplication
|
||||
/// <param name="paymentModel"></param>
|
||||
/// <returns></returns>
|
||||
Task<ReviewAndPaymentViewModel> GetTotalPaymentAndWorkshopList(long contractingPartyTempId,
|
||||
string periodModel = "12", string paymentModel = "OneTime");
|
||||
string periodModel = "12", string paymentModel = "OneTime", string contractStartType = "currentMonth");
|
||||
|
||||
/// <summary>
|
||||
/// ایجاد یا ویرایش قرارداد موقت
|
||||
/// </summary>
|
||||
/// <param name="contractingPartyTempId"></param>
|
||||
/// <returns></returns>
|
||||
Task<OperationResult> CreateOrUpdateInstitutionContractTemp(long contractingPartyTempId, string periodModel, string paymentModel, double totalPayment, double valueAddedTax);
|
||||
Task<OperationResult> CreateOrUpdateInstitutionContractTemp(long contractingPartyTempId, string periodModel, string paymentModel, double totalPayment, double valueAddedTax, DateTime contractStart);
|
||||
|
||||
/// <summary>
|
||||
/// دریافت کد برای کلاینت
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
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,4 +1,5 @@
|
||||
using System.Collections.Generic;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace CompanyManagment.App.Contracts.TemporaryClientRegistration;
|
||||
|
||||
@@ -23,28 +24,54 @@ public class ReviewAndPaymentViewModel
|
||||
/// مبلغ پرداخت بدون مالیات
|
||||
/// Double
|
||||
/// </summary>
|
||||
public double WithoutTaxPaymentDouble { get; set; }
|
||||
public double OneTimeWithoutTaxPaymentDouble { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// مبلغ پرداخت بدون مالیات
|
||||
/// string
|
||||
/// </summary>
|
||||
public string WithoutTaxPaymentStr { get; set; }
|
||||
public string OneTimeWithoutTaxPaymentStr { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// مبلغ پرداخت کامل
|
||||
/// Double
|
||||
/// </summary>
|
||||
public double TotalPaymentDouble { get; set; }
|
||||
public double OneTimeTotalPaymentDouble { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// مبلغ پرداخت کامل
|
||||
/// string
|
||||
/// </summary>
|
||||
public string TotalPaymentStr { get; set; }
|
||||
public string OneTimeTotalPaymentStr { 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
|
||||
@@ -83,4 +110,52 @@ 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; }
|
||||
}
|
||||
@@ -55,7 +55,7 @@ namespace CompanyManagment.Application
|
||||
if(command.BankLogoPictureFile != null && command.BankLogoPictureFile.Length >0 )
|
||||
{
|
||||
var uploadResult = _mediaApplication.UploadFile(command.BankLogoPictureFile, command.BankName,
|
||||
_basePath, 10, [".jpg", ".jpeg", ".png",".svg"]);
|
||||
_basePath, 10, [".jpg", ".jpeg", ".png",".svg"], "Bank");
|
||||
if (uploadResult.IsSuccedded == false)
|
||||
return uploadResult;
|
||||
mediaId = uploadResult.SendId;
|
||||
@@ -81,7 +81,7 @@ namespace CompanyManagment.Application
|
||||
if (command.BankLogoPictureFile != null && command.BankLogoPictureFile.Length > 0)
|
||||
{
|
||||
var uploadResult = _mediaApplication.UploadFile(command.BankLogoPictureFile, command.BankName,
|
||||
_basePath, 10, [".jpg", ".jpeg", ".png",".svg"]);
|
||||
_basePath, 10, [".jpg", ".jpeg", ".png",".svg"], "Bank");
|
||||
if (uploadResult.IsSuccedded == false)
|
||||
return uploadResult;
|
||||
_mediaApplication.DeleteFile(entity.BankLogoMediaId);
|
||||
|
||||
70
CompanyManagment.Application/ContactUsApplication.cs
Normal file
70
CompanyManagment.Application/ContactUsApplication.cs
Normal file
@@ -0,0 +1,70 @@
|
||||
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,12 +19,13 @@ 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.EFCore.Repository;
|
||||
using CompanyManagment.App.Contracts.RollCall;
|
||||
using Hangfire.States;
|
||||
using Microsoft.AspNetCore.Mvc.ModelBinding.Validation;
|
||||
using Microsoft.EntityFrameworkCore.Query;
|
||||
|
||||
|
||||
namespace CompanyManagment.Application;
|
||||
@@ -372,10 +373,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>();
|
||||
@@ -557,7 +558,13 @@ public class CustomizeWorkshopSettingsApplication(ICustomizeWorkshopSettingsRepo
|
||||
|
||||
_customizeWorkshopEmployeeSettingsRepository.Create(entity);
|
||||
|
||||
entity.SimpleEdit(shiftCollection, command.IrregularShift, command.WorkshopShiftStatus, command.BreakTime, isChanged, command.FridayWork, command.HolidayWork, rotatingShift);
|
||||
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);
|
||||
}
|
||||
|
||||
_customizeWorkshopGroupSettingsRepository.SaveChanges();
|
||||
return op.Succcedded();
|
||||
@@ -681,7 +688,7 @@ public class CustomizeWorkshopSettingsApplication(ICustomizeWorkshopSettingsRepo
|
||||
return op.Succcedded();
|
||||
}
|
||||
public OperationResult EditSimpleRollCallGroupSetting(EditCustomizeWorkshopGroupSettings command,
|
||||
List<ReCalculateRollCallValues> reCalculateCommand)
|
||||
List<ReCalculateRollCallValues> reCalculateCommand)
|
||||
{
|
||||
OperationResult op = new();
|
||||
|
||||
@@ -712,15 +719,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 &&
|
||||
@@ -1589,10 +1596,6 @@ 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)
|
||||
{
|
||||
@@ -1627,6 +1630,12 @@ public class CustomizeWorkshopSettingsApplication(ICustomizeWorkshopSettingsRepo
|
||||
:
|
||||
operationResult.Failed("پرسنل هایی دارای فیش هستند لطفا نسبت به تعیین تکلیف این ها اقدام نمایید", employeeIdsHasCheckout);
|
||||
}
|
||||
|
||||
public bool HasAnyEmployeeWithoutGroup(long workshopId)
|
||||
{
|
||||
return _customizeWorkshopGroupSettingsRepository.HasAnyEmployeeWithoutGroup(workshopId);
|
||||
}
|
||||
|
||||
public bool CheckEmployeeShiftHasChanged(EditCustomizeEmployeeSettings command)
|
||||
{
|
||||
return _customizeWorkshopEmployeeSettingsRepository.CheckEmployeeShiftHasChanged(command);
|
||||
|
||||
@@ -1,35 +1,38 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Collections.Generic;
|
||||
using _0_Framework.Application;
|
||||
using _0_Framework.InfraStructure;
|
||||
using Company.Domain.EmployeeAgg;
|
||||
using CompanyManagment.App.Contracts.Employee;
|
||||
using CompanyManagment.EFCore;
|
||||
using _0_Framework.Application;
|
||||
using CompanyManagment.App.Contracts.EmployeeInsuranceRecord;
|
||||
using Company.Domain.EmployeeInsuranceRecordAgg;
|
||||
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 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 Microsoft.AspNetCore.Hosting;
|
||||
using System.IO;
|
||||
using System.Transactions;
|
||||
using Company.Domain.EmployeeClientTempAgg;
|
||||
using Company.Domain.LeftWorkTempAgg;
|
||||
using CompanyManagment.App.Contracts.LeftWorkTemp;
|
||||
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 RollCallEmployee = Company.Domain.RollCallEmployeeAgg.RollCallEmployee;
|
||||
using CompanyManagment.App.Contracts.Employee.DTO;
|
||||
using CompanyManagment.App.Contracts.LeftWorkTemp;
|
||||
using System.Reflection;
|
||||
using Company.Domain.EmployeeAuthorizeTempAgg;
|
||||
using Company.Domain.RollCallServiceAgg;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Company.Domain.LeftWorkInsuranceAgg;
|
||||
|
||||
namespace CompanyManagment.Application;
|
||||
@@ -38,6 +41,9 @@ 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;
|
||||
@@ -55,17 +61,32 @@ 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, 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)
|
||||
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)
|
||||
{
|
||||
_context = context;
|
||||
_WorkShopRepository = workShopRepository;
|
||||
_EmployeeRepository = employeeRepository;
|
||||
this._leftWorkRepository = leftWorkRepository;
|
||||
_personnelCodeRepository = personnelCodeRepository;
|
||||
_employeeClientTempRepository = employeeClientTempRepository;
|
||||
_webHostEnvironment = webHostEnvironment;
|
||||
_rollCallEmployeeStatusApplication = rollCallEmployeeStatusApplication;
|
||||
_rollCallEmployeeRepository = rollCallEmployeeRepository;
|
||||
@@ -75,19 +96,17 @@ 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.IsActiveString == "true"))
|
||||
x.LName == command.LName && x.NationalCode == command.NationalCode && !string.IsNullOrWhiteSpace(command.NationalCode) && x.NationalCode != null))
|
||||
return opration.Failed("امکان ثبت رکورد تکراری وجود ندارد");
|
||||
|
||||
//if (_EmployeeRepository.Exists(x => x.IdNumber == command.IdNumber && x.IdNumber !=null))
|
||||
@@ -144,8 +163,8 @@ public class EmployeeAplication : RepositoryBase<long, Employee>, IEmployeeAppli
|
||||
{
|
||||
case "0000000000":
|
||||
case "1111111111":
|
||||
case "22222222222":
|
||||
case "33333333333":
|
||||
case "2222222222":
|
||||
case "3333333333":
|
||||
case "4444444444":
|
||||
case "5555555555":
|
||||
case "6666666666":
|
||||
@@ -227,6 +246,7 @@ public class EmployeeAplication : RepositoryBase<long, Employee>, IEmployeeAppli
|
||||
|
||||
}
|
||||
|
||||
|
||||
public OperationResult Edit(EditEmployee command)
|
||||
{
|
||||
var opration = new OperationResult();
|
||||
@@ -235,7 +255,7 @@ 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.IsActiveString == "true"))
|
||||
x.LName == command.LName && x.NationalCode == command.NationalCode && !string.IsNullOrWhiteSpace(command.NationalCode) && x.id != command.Id))
|
||||
return opration.Failed("امکان ثبت رکورد تکراری وجود ندارد");
|
||||
//if (_EmployeeRepository.Exists(x => x.IdNumber == command.IdNumber && x.IdNumber != null && x.id != command.Id))
|
||||
// return opration.Failed("شماره شناسنامه وارد شده تکراری است");
|
||||
@@ -277,8 +297,8 @@ public class EmployeeAplication : RepositoryBase<long, Employee>, IEmployeeAppli
|
||||
{
|
||||
case "0000000000":
|
||||
case "1111111111":
|
||||
case "22222222222":
|
||||
case "33333333333":
|
||||
case "2222222222":
|
||||
case "3333333333":
|
||||
case "4444444444":
|
||||
case "5555555555":
|
||||
case "6666666666":
|
||||
@@ -339,7 +359,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
|
||||
@@ -360,6 +380,11 @@ 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();
|
||||
@@ -398,7 +423,7 @@ 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)
|
||||
{
|
||||
@@ -690,8 +715,8 @@ public class EmployeeAplication : RepositoryBase<long, Employee>, IEmployeeAppli
|
||||
{
|
||||
case "0000000000":
|
||||
case "1111111111":
|
||||
case "22222222222":
|
||||
case "33333333333":
|
||||
case "2222222222":
|
||||
case "3333333333":
|
||||
case "4444444444":
|
||||
case "5555555555":
|
||||
case "6666666666":
|
||||
@@ -820,8 +845,8 @@ public class EmployeeAplication : RepositoryBase<long, Employee>, IEmployeeAppli
|
||||
{
|
||||
case "0000000000":
|
||||
case "1111111111":
|
||||
case "22222222222":
|
||||
case "33333333333":
|
||||
case "2222222222":
|
||||
case "3333333333":
|
||||
case "4444444444":
|
||||
case "5555555555":
|
||||
case "6666666666":
|
||||
@@ -901,11 +926,17 @@ 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")
|
||||
@@ -913,7 +944,6 @@ 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")
|
||||
@@ -921,11 +951,8 @@ 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)
|
||||
{
|
||||
@@ -961,6 +988,7 @@ public class EmployeeAplication : RepositoryBase<long, Employee>, IEmployeeAppli
|
||||
}).ToList();
|
||||
}
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
#region Mahan
|
||||
@@ -1052,6 +1080,7 @@ 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)
|
||||
@@ -1062,12 +1091,12 @@ public class EmployeeAplication : RepositoryBase<long, Employee>, IEmployeeAppli
|
||||
|
||||
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);
|
||||
|
||||
|
||||
|
||||
@@ -1101,6 +1130,16 @@ 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))
|
||||
{
|
||||
@@ -1128,6 +1167,16 @@ 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))
|
||||
{
|
||||
@@ -1221,6 +1270,7 @@ 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)
|
||||
{
|
||||
@@ -1626,6 +1676,5 @@ public class EmployeeAplication : RepositoryBase<long, Employee>, IEmployeeAppli
|
||||
|
||||
}
|
||||
|
||||
|
||||
#endregion
|
||||
}
|
||||
@@ -3,6 +3,7 @@ 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;
|
||||
@@ -957,4 +958,256 @@ 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
@@ -1,17 +1,19 @@
|
||||
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 _personalContractingPartyRepository2;
|
||||
private readonly IPersonalContractingPartyRepository _personalContractingPartyRepository;
|
||||
private readonly IRepresentativeApplication _representativeApplication;
|
||||
private readonly IEmployerRepository _employerRepository;
|
||||
private readonly IInstitutionContractRepository _institutionContractRepository;
|
||||
@@ -26,7 +28,7 @@ public class PersonalContractingPartyApplication : IPersonalContractingPartyApp
|
||||
public PersonalContractingPartyApplication(
|
||||
IPersonalContractingPartyRepository personalContractingPartyRepository, IRepresentativeApplication representativeApplication, IEmployerRepository employerRepository, IInstitutionContractRepository institutionContractRepository)
|
||||
{
|
||||
_personalContractingPartyRepository2 = personalContractingPartyRepository;
|
||||
_personalContractingPartyRepository = personalContractingPartyRepository;
|
||||
_representativeApplication = representativeApplication;
|
||||
_employerRepository = employerRepository;
|
||||
_institutionContractRepository = institutionContractRepository;
|
||||
@@ -36,7 +38,7 @@ public class PersonalContractingPartyApplication : IPersonalContractingPartyApp
|
||||
public OperationResult Create(CreatePersonalContractingParty command)
|
||||
{
|
||||
var opration = new OperationResult();
|
||||
if (_personalContractingPartyRepository2.Exists(x =>
|
||||
if (_personalContractingPartyRepository.Exists(x =>
|
||||
x.LName == command.LName && x.Nationalcode == command.Nationalcode && x.SureName == command.SureName ))
|
||||
return opration.Failed("امکان ثبت رکورد تکراری وجود ندارد");
|
||||
if (command.RepresentativeId < 1)
|
||||
@@ -54,14 +56,14 @@ public class PersonalContractingPartyApplication : IPersonalContractingPartyApp
|
||||
// return opration.Failed("نام خانوادگی وارد شده تکراری است");
|
||||
|
||||
//}
|
||||
if (_personalContractingPartyRepository2.Exists(x => x.Nationalcode == command.Nationalcode && x.LName != command.LName))
|
||||
if (_personalContractingPartyRepository.Exists(x => x.Nationalcode == command.Nationalcode && x.LName != command.LName))
|
||||
{
|
||||
nationalcodeIsOk = false;
|
||||
|
||||
return opration.Failed("کد ملی وارد شده تکراری است");
|
||||
}
|
||||
|
||||
if (_personalContractingPartyRepository2.Exists(x => x.ArchiveCode == command.ArchiveCode))
|
||||
if (_personalContractingPartyRepository.Exists(x => x.ArchiveCode == command.ArchiveCode))
|
||||
return opration.Failed("کد طرف حساب تکراری است");
|
||||
|
||||
try
|
||||
@@ -132,8 +134,8 @@ public class PersonalContractingPartyApplication : IPersonalContractingPartyApp
|
||||
command.State,command.City,command.Zone,command.SureName);
|
||||
|
||||
|
||||
_personalContractingPartyRepository2.Create(personalContractingParty);
|
||||
_personalContractingPartyRepository2.SaveChanges();
|
||||
_personalContractingPartyRepository.Create(personalContractingParty);
|
||||
_personalContractingPartyRepository.SaveChanges();
|
||||
|
||||
return opration.Succcedded();
|
||||
|
||||
@@ -152,13 +154,13 @@ public class PersonalContractingPartyApplication : IPersonalContractingPartyApp
|
||||
public OperationResult Edit2(EditPersonalContractingParty command)
|
||||
{
|
||||
var opration = new OperationResult();
|
||||
var personalContractingParty = _personalContractingPartyRepository2.Get(command.Id);
|
||||
var personalContractingParty = _personalContractingPartyRepository.Get(command.Id);
|
||||
if (personalContractingParty == null)
|
||||
return opration.Failed("رکورد مورد نظر یافت نشد");
|
||||
|
||||
personalContractingParty.Edit2(command.Address);
|
||||
|
||||
_personalContractingPartyRepository2.SaveChanges();
|
||||
_personalContractingPartyRepository.SaveChanges();
|
||||
return opration.Succcedded();
|
||||
}
|
||||
|
||||
@@ -166,7 +168,7 @@ public class PersonalContractingPartyApplication : IPersonalContractingPartyApp
|
||||
{
|
||||
|
||||
var opration = new OperationResult();
|
||||
if (_personalContractingPartyRepository2.Exists(x =>
|
||||
if (_personalContractingPartyRepository.Exists(x =>
|
||||
x.LName == command.LName && x.RegisterId == command.RegisterId && x.SureName == command.SureName))
|
||||
return opration.Failed("امکان ثبت رکورد تکراری وجود ندارد");
|
||||
if (command.RepresentativeId < 1)
|
||||
@@ -174,23 +176,23 @@ public class PersonalContractingPartyApplication : IPersonalContractingPartyApp
|
||||
|
||||
|
||||
|
||||
if (_personalContractingPartyRepository2.Exists(x => x.LName == command.LName && x.SureName == command.SureName))
|
||||
if (_personalContractingPartyRepository.Exists(x => x.LName == command.LName && x.SureName == command.SureName))
|
||||
{
|
||||
legalNameIsOk = false;
|
||||
return opration.Failed("نام شرکت وارد شده تکراری است");
|
||||
}
|
||||
if (_personalContractingPartyRepository2.Exists(x => x.RegisterId == command.RegisterId && x.LName != command.LName))
|
||||
if (_personalContractingPartyRepository.Exists(x => x.RegisterId == command.RegisterId && x.LName != command.LName))
|
||||
{
|
||||
registerIdIsOk = false;
|
||||
return opration.Failed("شماره ثبت وارد شده تکراری است");
|
||||
|
||||
}
|
||||
if (_personalContractingPartyRepository2.Exists(x => x.NationalId == command.NationalId && x.LName != command.LName))
|
||||
if (_personalContractingPartyRepository.Exists(x => x.NationalId == command.NationalId && x.LName != command.LName))
|
||||
{
|
||||
nationalIdIsOk = false;
|
||||
return opration.Failed("شناسه ملی وارد شده تکراری است");
|
||||
}
|
||||
if (_personalContractingPartyRepository2.Exists(x => x.ArchiveCode == command.ArchiveCode))
|
||||
if (_personalContractingPartyRepository.Exists(x => x.ArchiveCode == command.ArchiveCode))
|
||||
return opration.Failed("کد طرف حساب تکراری است");
|
||||
|
||||
|
||||
@@ -204,8 +206,8 @@ public class PersonalContractingPartyApplication : IPersonalContractingPartyApp
|
||||
command.State, command.City, command.Zone,command.SureName);
|
||||
|
||||
|
||||
_personalContractingPartyRepository2.Create(legalContractingParty);
|
||||
_personalContractingPartyRepository2.SaveChanges();
|
||||
_personalContractingPartyRepository.Create(legalContractingParty);
|
||||
_personalContractingPartyRepository.SaveChanges();
|
||||
|
||||
return opration.Succcedded();
|
||||
|
||||
@@ -223,15 +225,15 @@ public class PersonalContractingPartyApplication : IPersonalContractingPartyApp
|
||||
{
|
||||
|
||||
var opration = new OperationResult();
|
||||
var personalContractingParty = _personalContractingPartyRepository2.Get(command.Id);
|
||||
var personalContractingParty = _personalContractingPartyRepository.Get(command.Id);
|
||||
if (personalContractingParty == null)
|
||||
return opration.Failed("رکورد مورد نظر یافت نشد");
|
||||
if (command.RepresentativeId < 1)
|
||||
return opration.Failed("لطفا معرف را انتخاب کنید");
|
||||
if (_personalContractingPartyRepository2.Exists(x =>
|
||||
if (_personalContractingPartyRepository.Exists(x =>
|
||||
x.LName == command.LName && x.Nationalcode == command.Nationalcode && x.SureName == command.SureName && x.id != command.Id))
|
||||
return opration.Failed("امکان ثبت رکورد تکراری وجود ندارد");
|
||||
if (_personalContractingPartyRepository2.Exists(x => x.ArchiveCode == command.ArchiveCode && x.id != command.Id))
|
||||
if (_personalContractingPartyRepository.Exists(x => x.ArchiveCode == command.ArchiveCode && x.id != command.Id))
|
||||
return opration.Failed("کد طرف حساب تکراری است");
|
||||
try
|
||||
{
|
||||
@@ -300,7 +302,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);
|
||||
|
||||
_personalContractingPartyRepository2.SaveChanges();
|
||||
_personalContractingPartyRepository.SaveChanges();
|
||||
return opration.Succcedded();
|
||||
}
|
||||
else
|
||||
@@ -314,16 +316,16 @@ public class PersonalContractingPartyApplication : IPersonalContractingPartyApp
|
||||
{
|
||||
|
||||
var opration = new OperationResult();
|
||||
var legalContractingParty = _personalContractingPartyRepository2.Get(command.Id);
|
||||
var legalContractingParty = _personalContractingPartyRepository.Get(command.Id);
|
||||
if (legalContractingParty == null)
|
||||
return opration.Failed("رکورد مورد نظر یافت نشد");
|
||||
|
||||
if (_personalContractingPartyRepository2.Exists(x =>
|
||||
if (_personalContractingPartyRepository.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 (_personalContractingPartyRepository2.Exists(x => x.ArchiveCode == command.ArchiveCode && x.id != command.Id))
|
||||
if (_personalContractingPartyRepository.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,
|
||||
@@ -331,54 +333,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);
|
||||
|
||||
_personalContractingPartyRepository2.SaveChanges();
|
||||
_personalContractingPartyRepository.SaveChanges();
|
||||
return opration.Succcedded();
|
||||
}
|
||||
|
||||
public EditPersonalContractingParty GetDetails(long id)
|
||||
{
|
||||
return _personalContractingPartyRepository2.GetDetails(id);
|
||||
return _personalContractingPartyRepository.GetDetails(id);
|
||||
}
|
||||
|
||||
public string IsBlockByEmployerId(long employerId)
|
||||
{
|
||||
return _personalContractingPartyRepository2.IsBlockByEmployerId(employerId);
|
||||
return _personalContractingPartyRepository.IsBlockByEmployerId(employerId);
|
||||
}
|
||||
|
||||
public EditPersonalContractingParty GetDetailsToEdit(long id)
|
||||
{
|
||||
return _personalContractingPartyRepository2.GetDetailsToEdit(id);
|
||||
return _personalContractingPartyRepository.GetDetailsToEdit(id);
|
||||
|
||||
}
|
||||
|
||||
public string GetFullName(long id)
|
||||
{
|
||||
return _personalContractingPartyRepository2.GetFullName(id);
|
||||
return _personalContractingPartyRepository.GetFullName(id);
|
||||
}
|
||||
|
||||
public List<PersonalContractingPartyViewModel> GetPersonalContractingParties()
|
||||
{
|
||||
return _personalContractingPartyRepository2.GetPersonalContractingParties();
|
||||
return _personalContractingPartyRepository.GetPersonalContractingParties();
|
||||
}
|
||||
|
||||
public List<PersonalContractingPartyViewModel> Search(PersonalContractingPartySearchModel searchModel2)
|
||||
{
|
||||
return _personalContractingPartyRepository2.Search(searchModel2);
|
||||
return _personalContractingPartyRepository.Search(searchModel2);
|
||||
}
|
||||
|
||||
public int GetLastArchiveCode()
|
||||
{
|
||||
return _personalContractingPartyRepository2.GetLastArchiveCode();
|
||||
return _personalContractingPartyRepository.GetLastArchiveCode();
|
||||
}
|
||||
#region Mahan
|
||||
public List<string> SearchByName(string name)
|
||||
{
|
||||
return _personalContractingPartyRepository2.SearchByName(name);
|
||||
return _personalContractingPartyRepository.SearchByName(name);
|
||||
}
|
||||
#endregion
|
||||
public ContractingPartyAndStatmentIdViewModel GetContractingpartyIdByAccountId(long accountId)
|
||||
{
|
||||
return _personalContractingPartyRepository2.GetContractingpartyIdByAccountId(accountId);
|
||||
return _personalContractingPartyRepository.GetContractingpartyIdByAccountId(accountId);
|
||||
}
|
||||
|
||||
|
||||
@@ -386,15 +388,15 @@ public class PersonalContractingPartyApplication : IPersonalContractingPartyApp
|
||||
|
||||
public List<PersonalContractingPartyViewModel> GetPersonalContractingPartiesForNationalcode(string searchText)
|
||||
{
|
||||
return _personalContractingPartyRepository2.GetPersonalContractingPartiesForNationalcode(searchText);
|
||||
return _personalContractingPartyRepository.GetPersonalContractingPartiesForNationalcode(searchText);
|
||||
|
||||
}
|
||||
public List<PersonalContractingPartyViewModel> SearchForMain(PersonalContractingPartySearchModel searchModel2)
|
||||
{
|
||||
var result= _personalContractingPartyRepository2.SearchForMain(searchModel2);
|
||||
var result= _personalContractingPartyRepository.SearchForMain(searchModel2);
|
||||
foreach (var item in result)
|
||||
{
|
||||
item.HasInstitutionContract = _personalContractingPartyRepository2.GetHasContract(item.id);
|
||||
item.HasInstitutionContract = _personalContractingPartyRepository.GetHasContract(item.id);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -411,12 +413,12 @@ public class PersonalContractingPartyApplication : IPersonalContractingPartyApp
|
||||
//اونهایی که کارفرما یا قرارداد غیر فعال دارند غیر فعال می شوند
|
||||
if (_employerRepository.Exists(x => x.ContractingPartyId == id)|| _institutionContractRepository.Exists(x => x.ContractingPartyId == id))
|
||||
{
|
||||
opration= _personalContractingPartyRepository2.DeActiveAll(id);
|
||||
opration= _personalContractingPartyRepository.DeActiveAll(id);
|
||||
return opration;
|
||||
}
|
||||
else
|
||||
{
|
||||
opration = _personalContractingPartyRepository2.DeletePersonalContractingParties(id);
|
||||
opration = _personalContractingPartyRepository.DeletePersonalContractingParties(id);
|
||||
}
|
||||
|
||||
return opration;
|
||||
@@ -428,10 +430,10 @@ public class PersonalContractingPartyApplication : IPersonalContractingPartyApp
|
||||
{
|
||||
|
||||
var opration = new OperationResult();
|
||||
var contract = _personalContractingPartyRepository2.Get(id);
|
||||
var contract = _personalContractingPartyRepository.Get(id);
|
||||
if (contract == null)
|
||||
return opration.Failed("رکورد مورد نظر یافت نشد");
|
||||
return _personalContractingPartyRepository2.ActiveAll(id);
|
||||
return _personalContractingPartyRepository.ActiveAll(id);
|
||||
|
||||
|
||||
//var opration = new OperationResult();
|
||||
@@ -446,44 +448,44 @@ public class PersonalContractingPartyApplication : IPersonalContractingPartyApp
|
||||
public OperationResult DeActive(long id)
|
||||
{
|
||||
var opration = new OperationResult();
|
||||
var personalContracting = _personalContractingPartyRepository2.Get(id);
|
||||
var personalContracting = _personalContractingPartyRepository.Get(id);
|
||||
if (personalContracting == null)
|
||||
return opration.Failed("رکورد مورد نظر یافت نشد");
|
||||
|
||||
personalContracting.DeActive();
|
||||
|
||||
|
||||
_personalContractingPartyRepository2.SaveChanges();
|
||||
_personalContractingPartyRepository.SaveChanges();
|
||||
return opration.Succcedded();
|
||||
}
|
||||
public bool GetHasContract(long id)
|
||||
{
|
||||
|
||||
return _personalContractingPartyRepository2.GetHasContract(id);
|
||||
return _personalContractingPartyRepository.GetHasContract(id);
|
||||
|
||||
}
|
||||
|
||||
public OperationResult Block(long id)
|
||||
{
|
||||
var opration = new OperationResult();
|
||||
var contract = _personalContractingPartyRepository2.Get(id);
|
||||
var contract = _personalContractingPartyRepository.Get(id);
|
||||
if (contract == null)
|
||||
return opration.Failed("رکورد مورد نظر یافت نشد");
|
||||
contract.Block();
|
||||
|
||||
_personalContractingPartyRepository2.SaveChanges();
|
||||
_personalContractingPartyRepository.SaveChanges();
|
||||
return opration.Succcedded();
|
||||
}
|
||||
public OperationResult DisableBlock(long id)
|
||||
{
|
||||
var opration = new OperationResult();
|
||||
var personalContracting = _personalContractingPartyRepository2.Get(id);
|
||||
var personalContracting = _personalContractingPartyRepository.Get(id);
|
||||
if (personalContracting == null)
|
||||
return opration.Failed("رکورد مورد نظر یافت نشد");
|
||||
|
||||
int blockTimes = personalContracting.BlockTimes + 1;
|
||||
personalContracting.DisableBlock(blockTimes);
|
||||
_personalContractingPartyRepository2.SaveChanges();
|
||||
_personalContractingPartyRepository.SaveChanges();
|
||||
|
||||
|
||||
|
||||
@@ -499,7 +501,225 @@ public class PersonalContractingPartyApplication : IPersonalContractingPartyApp
|
||||
|
||||
public bool IsBlockCheckByWorkshopId(long workshopId)
|
||||
{
|
||||
return _personalContractingPartyRepository2.IsBlockCheckByWorkshopId(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);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -141,6 +141,8 @@ 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);
|
||||
@@ -188,7 +190,7 @@ public class TemporaryClientRegistrationApplication : ITemporaryClientRegistrati
|
||||
/// </summary>
|
||||
/// <param name="command"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<OperationResult> CreateOrUpdateWorkshopTemp(List<WorkshopTempViewModel> command)
|
||||
public async Task<OperationResult> CreateOrUpdateWorkshopTemp(List<WorkshopTempViewModel> command, long contractingPartyTempId)
|
||||
{
|
||||
var op = new OperationResult();
|
||||
var updateWorkshopList = command.Where(x => x.Id > 0).ToList();
|
||||
@@ -196,10 +198,17 @@ 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)
|
||||
{
|
||||
@@ -212,6 +221,7 @@ 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)
|
||||
@@ -256,6 +266,8 @@ public class TemporaryClientRegistrationApplication : ITemporaryClientRegistrati
|
||||
if (workshop.CustomizeCheckout)
|
||||
await _workshopServicesTempRepository.CreateAsync(
|
||||
new WorkshopServicesTemp("CustomizeCheckout", workshop.CountPerson, workshop.Id));
|
||||
|
||||
await _workshopServicesTempRepository.SaveChangesAsync();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -324,6 +336,8 @@ public class TemporaryClientRegistrationApplication : ITemporaryClientRegistrati
|
||||
if (workshop.CustomizeCheckout)
|
||||
await _workshopServicesTempRepository.CreateAsync(
|
||||
new WorkshopServicesTemp("CustomizeCheckout", workshop.CountPerson, createNewWorkshopTemp.id));
|
||||
|
||||
await _workshopServicesTempRepository.SaveChangesAsync();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -352,8 +366,9 @@ public class TemporaryClientRegistrationApplication : ITemporaryClientRegistrati
|
||||
/// </summary>
|
||||
/// <param name="contractingPartyTempId"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<ReviewAndPaymentViewModel> GetTotalPaymentAndWorkshopList(long contractingPartyTempId, string periodModel = "12", string paymentModel = "OneTime")
|
||||
public async Task<ReviewAndPaymentViewModel> GetTotalPaymentAndWorkshopList(long contractingPartyTempId, string periodModel = "12", string paymentModel = "OneTime", string contractStartType = "currentMonth")
|
||||
{
|
||||
|
||||
//دریافت کارگاه ها
|
||||
var workshops = await _workshopTempRepository.GetWorkshopTemp(contractingPartyTempId);
|
||||
|
||||
@@ -380,9 +395,10 @@ public class TemporaryClientRegistrationApplication : ITemporaryClientRegistrati
|
||||
_ => 12,
|
||||
};
|
||||
//رند کردن مبالغ کارگاه ها
|
||||
var roundAmount = (int)(totalPayment1MonthDouble / 1000000) * 1000000;
|
||||
var roundAmount = (((Convert.ToInt64(totalPayment1MonthDouble))) / 1000000) * 1000000;
|
||||
double roundAmount2 = roundAmount;
|
||||
//بدست آوردن جمع کل مبالغ کارگاه بر اساس مدت قراداد
|
||||
result.SumOfWorkshopsPaymentDouble = roundAmount * months;
|
||||
result.SumOfWorkshopsPaymentDouble = months * roundAmount2;
|
||||
result.SumOfWorkshopsPaymentPaymentStr = result.SumOfWorkshopsPaymentDouble.ToMoney();
|
||||
|
||||
|
||||
@@ -394,31 +410,112 @@ public class TemporaryClientRegistrationApplication : ITemporaryClientRegistrati
|
||||
//مالیات
|
||||
result.ValueAddedTaxDouble = tenPercent;
|
||||
result.ValueAddedTaxSt = tenPercent.ToMoney();
|
||||
if (paymentModel == "OneTime")//تخفیف 10 درصدی درصورت پرداخت یکجا
|
||||
//پرداخت یکجا
|
||||
#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")
|
||||
{
|
||||
|
||||
double discountOneTimePeyment = result.SumOfWorkshopsPaymentDouble - tenPercent;
|
||||
installmentList.Add(new MonthlyInstallment()
|
||||
{
|
||||
InstallmentAmountStr = result.MonthlyTotalPaymentStr,
|
||||
InstallmentCounter = "سررسید پرداخت اول",
|
||||
InstalmentDate = (DateTime.Now).ToFarsi()
|
||||
|
||||
|
||||
//مبلغ بدون مالیات و با تخفیف
|
||||
result.WithoutTaxPaymentDouble = discountOneTimePeyment;
|
||||
result.WithoutTaxPaymentStr = discountOneTimePeyment.ToMoney();
|
||||
|
||||
//مبلغ با مالیات
|
||||
result.TotalPaymentDouble = discountOneTimePeyment + tenPercent;
|
||||
result.TotalPaymentStr = result.TotalPaymentDouble.ToMoney();
|
||||
});
|
||||
result.MonthlyInstallments = installmentList;
|
||||
}
|
||||
else
|
||||
{
|
||||
//مبلغ بدون مالیات
|
||||
result.WithoutTaxPaymentDouble = result.SumOfWorkshopsPaymentDouble;
|
||||
result.WithoutTaxPaymentStr = result.SumOfWorkshopsPaymentDouble.ToMoney();
|
||||
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.TotalPaymentDouble = result.SumOfWorkshopsPaymentDouble + tenPercent;
|
||||
result.TotalPaymentStr = result.TotalPaymentDouble.ToMoney();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
result.MonthlyInstallments = installmentList;
|
||||
result.ContractingPartTempId = contractingPartyTempId;
|
||||
|
||||
return result;
|
||||
@@ -430,19 +527,21 @@ 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)
|
||||
public async Task<OperationResult> CreateOrUpdateInstitutionContractTemp(long contractingPartyTempId, string periodModel, string paymentModel, double totalPayment, double valueAddedTax, DateTime contractStart)
|
||||
{
|
||||
|
||||
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 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);
|
||||
|
||||
var create = new InstitutionContractTemp(contractingPartyTempId, paymentModel, periodModel, totalPayment, contractStartDate, contractEndDate, "official", valueAddedTax, "", "BeforeSendVerifyCode", 0, null, null);
|
||||
_institutionContractTempRepository.Create(create);
|
||||
_institutionContractTempRepository.SaveChanges();
|
||||
return op.Succcedded();
|
||||
@@ -451,7 +550,7 @@ public class TemporaryClientRegistrationApplication : ITemporaryClientRegistrati
|
||||
{
|
||||
if (institutionContractTemp.VerifyCodeEndTime != null)
|
||||
{
|
||||
var spaning = (institutionContractTemp.VerifyCodeEndTime.Value - DateTime.Now);
|
||||
var spaning = (DateTime.Now - institutionContractTemp.VerifyCodeEndTime.Value);
|
||||
if (institutionContractTemp.RegistrationStatus == "VerifyCodeSent" && spaning > new TimeSpan(0, 0, 0) && spaning < new TimeSpan(0, 1, 0))
|
||||
return op.Failed("شما به تازگی پیامک دریافت نموده اید دو دقیقه صبر کنید و دوباره تلاش کنید");
|
||||
}
|
||||
@@ -464,7 +563,7 @@ public class TemporaryClientRegistrationApplication : ITemporaryClientRegistrati
|
||||
var contractstart = DateTime.Now;
|
||||
var contractEnd = DateTime.Now.AddMonths(periodModelInt);
|
||||
var update = _institutionContractTempRepository.Get(institutionContractTemp.Id);
|
||||
update.Edit(contractingPartyTempId, paymentModel, periodModel, totalPayment, contractstart, contractEnd, "official", valueAddedTax, "", "BeforeSendVerifyCode", 0, null, null);
|
||||
update.Edit(contractingPartyTempId, paymentModel, periodModel, totalPayment, contractStartDate, contractEndDate, "official", valueAddedTax, "", "BeforeSendVerifyCode", 0, null, null);
|
||||
_institutionContractTempRepository.SaveChanges();
|
||||
return op.Succcedded();
|
||||
}
|
||||
@@ -486,7 +585,7 @@ public class TemporaryClientRegistrationApplication : ITemporaryClientRegistrati
|
||||
var institutionContractTemp = await
|
||||
_institutionContractTempRepository.GetInstitutionContractTemp(0, contractingPartyTempId);
|
||||
if (institutionContractTemp == null)
|
||||
return op.Failed("خظا");
|
||||
return op.Failed("خطا");
|
||||
|
||||
var update = _institutionContractTempRepository.Get(institutionContractTemp.Id);
|
||||
|
||||
@@ -522,20 +621,23 @@ public class TemporaryClientRegistrationApplication : ITemporaryClientRegistrati
|
||||
if (institutionContractTemp.RegistrationStatus == "VerifyCodeSent")
|
||||
|
||||
{
|
||||
var spaning = (institutionContractTemp.VerifyCodeEndTime.Value - DateTime.Now);
|
||||
if ((spaning > new TimeSpan(0, 0, 0) && spaning < new TimeSpan(0, 1, 0)))
|
||||
|
||||
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)))
|
||||
return op.Failed("شما به تازگی پیامک دریافت نموده اید دو دقیقه صبر کنید و دوباره تلاش کنید");
|
||||
|
||||
if ((spaning > new TimeSpan(0, 0, 0) && spaning > new TimeSpan(0, 1, 0)))
|
||||
if ((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}");
|
||||
|
||||
|
||||
@@ -547,7 +649,7 @@ 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, "کد برای شما پیامک شد");
|
||||
}
|
||||
@@ -580,13 +682,13 @@ 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)
|
||||
{
|
||||
|
||||
@@ -9,6 +9,7 @@ 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;
|
||||
@@ -175,6 +176,8 @@ 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; }
|
||||
|
||||
20
CompanyManagment.EFCore/Mapping/ContactUsMapping.cs
Normal file
20
CompanyManagment.EFCore/Mapping/ContactUsMapping.cs
Normal file
@@ -0,0 +1,20 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
@@ -13,5 +13,32 @@ public class InsuranceListMapping : IEntityTypeConfiguration<InsuranceList>
|
||||
|
||||
builder.Property(x => x.Year).HasMaxLength(4);
|
||||
builder.Property(x => x.Month).HasMaxLength(2);
|
||||
|
||||
builder.ComplexProperty(x => x.Inspection, inspection =>
|
||||
{
|
||||
inspection.IsRequired();
|
||||
inspection.Property(x => x.Type).HasConversion<string>().HasMaxLength(50);
|
||||
inspection.Property(x => x.LastInspectionDateTime);
|
||||
inspection.Property(x => x.MediaId);
|
||||
});
|
||||
|
||||
builder.ComplexProperty(x => x.Debt, debt =>
|
||||
{
|
||||
debt.IsRequired();
|
||||
debt.Property(x => x.Type).HasConversion<string>().HasMaxLength(50);
|
||||
debt.Property(x => x.DebtDate);
|
||||
debt.Property(x => x.Amount);
|
||||
debt.Property(x => x.MediaId);
|
||||
});
|
||||
|
||||
builder.ComplexProperty(x => x.EmployerApproval, approval =>
|
||||
{
|
||||
approval.IsRequired();
|
||||
approval.Property(x => x.Status).HasConversion<string>().HasMaxLength(50);
|
||||
approval.Property(x => x.Description).HasMaxLength(500);
|
||||
});
|
||||
|
||||
//builder.HasMany(x => x.EmployerSignatures)
|
||||
// .WithOne(x => x.InsuranceList).HasForeignKey(x => x.InsuranceListId);
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
|
||||
|
||||
9450
CompanyManagment.EFCore/Migrations/20250423184716_add contact us .Designer.cs
generated
Normal file
9450
CompanyManagment.EFCore/Migrations/20250423184716_add contact us .Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,42 @@
|
||||
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");
|
||||
}
|
||||
}
|
||||
}
|
||||
9410
CompanyManagment.EFCore/Migrations/20250427155240_add salaryAid calculation date.Designer.cs
generated
Normal file
9410
CompanyManagment.EFCore/Migrations/20250427155240_add salaryAid calculation date.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,23 @@
|
||||
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)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,23 @@
|
||||
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)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
9589
CompanyManagment.EFCore/Migrations/20250521125646_add inspection-debt-approval to insurance list.Designer.cs
generated
Normal file
9589
CompanyManagment.EFCore/Migrations/20250521125646_add inspection-debt-approval to insurance list.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,121 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace CompanyManagment.EFCore.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class addinspectiondebtapprovaltoinsurancelist : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<double>(
|
||||
name: "Debt_Amount",
|
||||
table: "InsuranceLists",
|
||||
type: "float",
|
||||
nullable: false,
|
||||
defaultValue: 0.0);
|
||||
|
||||
migrationBuilder.AddColumn<DateTime>(
|
||||
name: "Debt_DebtDate",
|
||||
table: "InsuranceLists",
|
||||
type: "datetime2",
|
||||
nullable: false,
|
||||
defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified));
|
||||
|
||||
migrationBuilder.AddColumn<long>(
|
||||
name: "Debt_MediaId",
|
||||
table: "InsuranceLists",
|
||||
type: "bigint",
|
||||
nullable: false,
|
||||
defaultValue: 0L);
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "Debt_Type",
|
||||
table: "InsuranceLists",
|
||||
type: "nvarchar(50)",
|
||||
maxLength: 50,
|
||||
nullable: false,
|
||||
defaultValue: "None");
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "EmployerApproval_Description",
|
||||
table: "InsuranceLists",
|
||||
type: "nvarchar(500)",
|
||||
maxLength: 500,
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "EmployerApproval_Status",
|
||||
table: "InsuranceLists",
|
||||
type: "nvarchar(50)",
|
||||
maxLength: 50,
|
||||
nullable: false,
|
||||
defaultValue: "None");
|
||||
|
||||
migrationBuilder.AddColumn<DateTime>(
|
||||
name: "Inspection_LastInspectionDateTime",
|
||||
table: "InsuranceLists",
|
||||
type: "datetime2",
|
||||
nullable: false,
|
||||
defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified));
|
||||
|
||||
migrationBuilder.AddColumn<long>(
|
||||
name: "Inspection_MediaId",
|
||||
table: "InsuranceLists",
|
||||
type: "bigint",
|
||||
nullable: false,
|
||||
defaultValue: 0L);
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "Inspection_Type",
|
||||
table: "InsuranceLists",
|
||||
type: "nvarchar(50)",
|
||||
maxLength: 50,
|
||||
nullable: false,
|
||||
defaultValue: "None");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "Debt_Amount",
|
||||
table: "InsuranceLists");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "Debt_DebtDate",
|
||||
table: "InsuranceLists");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "Debt_MediaId",
|
||||
table: "InsuranceLists");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "Debt_Type",
|
||||
table: "InsuranceLists");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "EmployerApproval_Description",
|
||||
table: "InsuranceLists");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "EmployerApproval_Status",
|
||||
table: "InsuranceLists");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "Inspection_LastInspectionDateTime",
|
||||
table: "InsuranceLists");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "Inspection_MediaId",
|
||||
table: "InsuranceLists");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "Inspection_Type",
|
||||
table: "InsuranceLists");
|
||||
}
|
||||
}
|
||||
}
|
||||
9719
CompanyManagment.EFCore/Migrations/20250602185437_insurance operation list.Designer.cs
generated
Normal file
9719
CompanyManagment.EFCore/Migrations/20250602185437_insurance operation list.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,51 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace CompanyManagment.EFCore.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class insuranceoperationlist : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "Debt_IsDone",
|
||||
table: "InsuranceLists",
|
||||
type: "bit",
|
||||
nullable: false,
|
||||
defaultValue: false);
|
||||
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "EmployerApproval_IsDone",
|
||||
table: "InsuranceLists",
|
||||
type: "bit",
|
||||
nullable: false,
|
||||
defaultValue: false);
|
||||
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "Inspection_IsDone",
|
||||
table: "InsuranceLists",
|
||||
type: "bit",
|
||||
nullable: false,
|
||||
defaultValue: false);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "Debt_IsDone",
|
||||
table: "InsuranceLists");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "EmployerApproval_IsDone",
|
||||
table: "InsuranceLists");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "Inspection_IsDone",
|
||||
table: "InsuranceLists");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
// <auto-generated />
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using CompanyManagment.EFCore;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
@@ -559,6 +560,50 @@ 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")
|
||||
@@ -3350,6 +3395,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);
|
||||
|
||||
14
CompanyManagment.EFCore/Repository/ContactUsRepository.cs
Normal file
14
CompanyManagment.EFCore/Repository/ContactUsRepository.cs
Normal file
@@ -0,0 +1,14 @@
|
||||
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,364 +8,351 @@ using CompanyManagment.App.Contracts.CustomizeWorkshopSettings.ValueObjectsViewM
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
|
||||
namespace CompanyManagment.EFCore.Repository;
|
||||
|
||||
public class CustomizeWorkshopSettingsRepository(CompanyContext companyContext, IAuthHelper authHelper, IEmployeeRepository employeeRepository)
|
||||
: RepositoryBase<long, CustomizeWorkshopSettings>(companyContext), ICustomizeWorkshopSettingsRepository
|
||||
namespace CompanyManagment.EFCore.Repository
|
||||
{
|
||||
private readonly CompanyContext _companyContext = companyContext;
|
||||
private readonly IAuthHelper _authHelper = authHelper;
|
||||
private readonly IEmployeeRepository _employeeRepository = employeeRepository;
|
||||
|
||||
public CustomizeWorkshopSettingsViewModel GetWorkshopSettingsByWorkshopId(long workshopId, AuthViewModel auth)
|
||||
public class CustomizeWorkshopSettingsRepository(CompanyContext companyContext, IAuthHelper authHelper, IEmployeeRepository employeeRepository)
|
||||
: RepositoryBase<long, CustomizeWorkshopSettings>(companyContext), ICustomizeWorkshopSettingsRepository
|
||||
{
|
||||
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();
|
||||
private readonly CompanyContext _companyContext = companyContext;
|
||||
private readonly IAuthHelper _authHelper = authHelper;
|
||||
private readonly IEmployeeRepository _employeeRepository = employeeRepository;
|
||||
|
||||
var employeeIds = entity.CustomizeWorkshopGroupSettingsCollection
|
||||
.SelectMany(x => x.CustomizeWorkshopEmployeeSettingsCollection)
|
||||
.Select(y => y.EmployeeId)
|
||||
.ToList();
|
||||
var employees = _employeeRepository.GetBy(employeeIds);
|
||||
return new CustomizeWorkshopSettingsViewModel()
|
||||
public CustomizeWorkshopSettingsViewModel GetWorkshopSettingsByWorkshopId(long workshopId, AuthViewModel auth)
|
||||
{
|
||||
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,
|
||||
RollCallWorkshopEmployeesSettings = x.CustomizeWorkshopEmployeeSettingsCollection.Select(y =>
|
||||
{
|
||||
var employee = employees.First(e => e.Id == y.EmployeeId);
|
||||
return new CustomizeWorkshopEmployeeSettingsViewModel()
|
||||
{
|
||||
Id = y.id,
|
||||
EmployeeId = y.EmployeeId,
|
||||
IsSettingChanged = y.IsSettingChanged,
|
||||
IsShiftChanged = y.IsShiftChanged,
|
||||
Name = $"{employee}",
|
||||
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,
|
||||
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();
|
||||
|
||||
};
|
||||
}).ToList(),
|
||||
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()
|
||||
var employeeIds = entity.CustomizeWorkshopGroupSettingsCollection
|
||||
.SelectMany(x => x.CustomizeWorkshopEmployeeSettingsCollection)
|
||||
.Select(y => y.EmployeeId)
|
||||
.ToList();
|
||||
var employees = _employeeRepository.GetBy(employeeIds);
|
||||
return new CustomizeWorkshopSettingsViewModel()
|
||||
{
|
||||
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();
|
||||
}
|
||||
|
||||
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 = x.id,
|
||||
WorkshopShiftStatus = x.WorkshopShiftStatus,
|
||||
GroupSettings = x.CustomizeWorkshopGroupSettingsCollection.Select(g =>
|
||||
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 = g.id,
|
||||
IrregularShift = g.IrregularShift,
|
||||
WorkshopShiftStatus = g.WorkshopShiftStatus,
|
||||
GroupName = g.GroupName,
|
||||
MainGroup = g.MainGroup,
|
||||
RollCallWorkshopShifts = g.CustomizeWorkshopGroupSettingsShifts.Select(s =>
|
||||
Id = x.id,
|
||||
GroupName = x.GroupName,
|
||||
WorkshopShiftStatus = x.WorkshopShiftStatus,
|
||||
IrregularShift = x.IrregularShift,
|
||||
Salary = x.Salary,
|
||||
RollCallWorkshopShifts = x.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()
|
||||
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(),
|
||||
|
||||
|
||||
}).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()
|
||||
};
|
||||
}
|
||||
public CustomizeWorkshopSettingsViewModel GetWorkshopSettingsByWorkshopIdForAdmin(long workshopId)
|
||||
{
|
||||
Id = employee.id,
|
||||
EmployeeId = employee.EmployeeId,
|
||||
IsSettingChanged = employee.IsSettingChanged,
|
||||
IsShiftChanged = employee.IsShiftChanged,
|
||||
Name = employeeName?.FullName,
|
||||
RollCallWorkshopShifts = employee.CustomizeWorkshopEmployeeSettingsShifts.Select(x =>
|
||||
new CustomizeWorkshopShiftViewModel()
|
||||
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"),
|
||||
Placement = x.Placement,
|
||||
StartTime = x.StartTime.ToString("HH:mm")
|
||||
StartTime = x.StartTime.ToString("HH:mm"),
|
||||
Placement = x.Placement
|
||||
}).ToList(),
|
||||
Salary = employee.Salary
|
||||
};
|
||||
}
|
||||
Id = entity.id,
|
||||
WorkshopId = entity.WorkshopId,
|
||||
WorkshopShiftStatus = entity.WorkshopShiftStatus,
|
||||
FridayWork = entity.FridayWork,
|
||||
HolidayWork = entity.HolidayWork
|
||||
|
||||
#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 =>
|
||||
};
|
||||
}
|
||||
|
||||
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,
|
||||
Salary = g.Salary,
|
||||
SalaryStr = g.Salary.ToMoney(),
|
||||
LeavePermitted = g.LeavePermittedDays,
|
||||
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,
|
||||
@@ -374,31 +361,26 @@ public class CustomizeWorkshopSettingsRepository(CompanyContext companyContext,
|
||||
EmployeeId = x.EmployeeId,
|
||||
BreakTime = x.BreakTime
|
||||
});
|
||||
return query.ToList();
|
||||
}
|
||||
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
|
||||
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();
|
||||
}
|
||||
.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
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,10 +1,14 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Threading.Tasks;
|
||||
using _0_Framework.Application;
|
||||
using _0_Framework.InfraStructure;
|
||||
using AccountMangement.Infrastructure.EFCore;
|
||||
using Company.Domain.EmployeeAgg;
|
||||
using Company.Domain.EmployeeChildrenAgg;
|
||||
using Company.Domain.EmployeeInsurancListDataAgg;
|
||||
@@ -16,6 +20,7 @@ using CompanyManagment.App.Contracts.EmployeeInsurancListData;
|
||||
using CompanyManagment.App.Contracts.InsuranceList;
|
||||
using CompanyManagment.App.Contracts.InsuranceWorkshopInfo;
|
||||
using CompanyManagment.App.Contracts.PersonalContractingParty;
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.Identity.Client;
|
||||
using PersianTools.Core;
|
||||
@@ -32,7 +37,10 @@ public class InsuranceListRepository : RepositoryBase<long, InsuranceList>, IIns
|
||||
private readonly IAuthHelper _authHelper;
|
||||
private readonly IPersonalContractingPartyApp _contractingPartyApp;
|
||||
private readonly IInsuranceYearlySalaryRepository _insuranceYearlySalaryRepository;
|
||||
public InsuranceListRepository(CompanyContext context, IEmployeeInsurancListDataRepository employeeInsurancListDataRepository, IInsuranceListWorkshopRepository insuranceListWorkshopRepository , IInsuranceWorkshopInfoRepository insuranceWorkshopInfoRepository, IAuthHelper authHelper, IPersonalContractingPartyApp contractingPartyApp, IInsuranceYearlySalaryRepository insuranceYearlySalaryRepository) : base(context)
|
||||
private readonly IWebHostEnvironment _webHostEnvironment;
|
||||
private readonly AccountContext _accountContext;
|
||||
|
||||
public InsuranceListRepository(CompanyContext context, IEmployeeInsurancListDataRepository employeeInsurancListDataRepository, IInsuranceListWorkshopRepository insuranceListWorkshopRepository, IInsuranceWorkshopInfoRepository insuranceWorkshopInfoRepository, IAuthHelper authHelper, IPersonalContractingPartyApp contractingPartyApp, IInsuranceYearlySalaryRepository insuranceYearlySalaryRepository, IWebHostEnvironment webHostEnvironment, AccountContext accountContext) : base(context)
|
||||
{
|
||||
_context = context;
|
||||
_employeeInsurancListDataRepository = employeeInsurancListDataRepository;
|
||||
@@ -41,20 +49,22 @@ public class InsuranceListRepository : RepositoryBase<long, InsuranceList>, IIns
|
||||
_authHelper = authHelper;
|
||||
_contractingPartyApp = contractingPartyApp;
|
||||
_insuranceYearlySalaryRepository = insuranceYearlySalaryRepository;
|
||||
_webHostEnvironment = webHostEnvironment;
|
||||
_accountContext = accountContext;
|
||||
}
|
||||
public OperationResult CreateInsuranceListworkshop(long id, List<long> workshopIds)
|
||||
{
|
||||
var operation = new OperationResult();
|
||||
//try
|
||||
//{
|
||||
var list= new List<InsuranceListWorkshop>();
|
||||
var list = new List<InsuranceListWorkshop>();
|
||||
foreach (var item in workshopIds)
|
||||
{
|
||||
|
||||
list.Add(new InsuranceListWorkshop()
|
||||
{
|
||||
WorkshopId =item,
|
||||
InsurancListId= id
|
||||
WorkshopId = item,
|
||||
InsurancListId = id
|
||||
});
|
||||
}
|
||||
|
||||
@@ -77,10 +87,10 @@ public class InsuranceListRepository : RepositoryBase<long, InsuranceList>, IIns
|
||||
{
|
||||
var operation = new OperationResult();
|
||||
|
||||
var obj = _context.InsuranceWorkshopInformationSet.Where(x=>x.WorkshopId== command.WorkshopId).FirstOrDefault();
|
||||
var obj = _context.InsuranceWorkshopInformationSet.Where(x => x.WorkshopId == command.WorkshopId).FirstOrDefault();
|
||||
if (obj != null)
|
||||
{
|
||||
obj.Edit(command.WorkshopName, command.InsuranceCode, command.AgreementNumber, command.EmployerName, command.Address,command.ListNumber);
|
||||
obj.Edit(command.WorkshopName, command.InsuranceCode, command.AgreementNumber, command.EmployerName, command.Address, command.ListNumber);
|
||||
_context.SaveChanges();
|
||||
}
|
||||
else
|
||||
@@ -103,8 +113,8 @@ public class InsuranceListRepository : RepositoryBase<long, InsuranceList>, IIns
|
||||
try
|
||||
{
|
||||
var insuranceListObj = Get(command.Id);
|
||||
insuranceListObj.Edit(command.SumOfEmployees,command.SumOfWorkingDays,command.SumOfSalaries,command.SumOfBenefitsIncluded,command.Included,command.IncludedAndNotIncluded,command.InsuredShare,
|
||||
command.EmployerShare,command.UnEmploymentInsurance,command.DifficultJobsInsuranc,command.StartDate,command.SumOfDailyWage,command.SumOfBaseYears,command.SumOfMarriedAllowance, command.ConfirmSentlist);
|
||||
insuranceListObj.Edit(command.SumOfEmployees, command.SumOfWorkingDays, command.SumOfSalaries, command.SumOfBenefitsIncluded, command.Included, command.IncludedAndNotIncluded, command.InsuredShare,
|
||||
command.EmployerShare, command.UnEmploymentInsurance, command.DifficultJobsInsuranc, command.StartDate, command.SumOfDailyWage, command.SumOfBaseYears, command.SumOfMarriedAllowance, command.ConfirmSentlist);
|
||||
|
||||
var id = insuranceListObj.id;
|
||||
if (command.EmployeeInsurancListDataList != null && command.EmployeeInsurancListDataList.Count > 0)
|
||||
@@ -121,14 +131,14 @@ public class InsuranceListRepository : RepositoryBase<long, InsuranceList>, IIns
|
||||
item.BenefitsIncludedContinuous,
|
||||
item.BenefitsIncludedNonContinuous,
|
||||
item.InsuranceShare, item.StartWorkDate,
|
||||
item.LeftWorkDate, item.JobId,item.IncludeStatus,item.BaseYears,item.MarriedAllowance,item.OverTimePay,item.FamilyAllowance);
|
||||
item.LeftWorkDate, item.JobId, item.IncludeStatus, item.BaseYears, item.MarriedAllowance, item.OverTimePay, item.FamilyAllowance);
|
||||
_employeeInsurancListDataRepository.Create(employeeInsurancListData);
|
||||
}
|
||||
else
|
||||
{
|
||||
var employeeInsurancListDataObj = _employeeInsurancListDataRepository.Get(item.EmployeeInsurancListDataId);
|
||||
employeeInsurancListDataObj.Edit(item.WorkingDays,item.DailyWage,item.MonthlySalary,item.MonthlyBenefits,item .MonthlyBenefitsIncluded,item.BenefitsIncludedContinuous,
|
||||
item.BenefitsIncludedNonContinuous,item.InsuranceShare,item.StartWorkDate,item.LeftWorkDate,item.JobId,item.IncludeStatus,item.BaseYears,item.MarriedAllowance,item.OverTimePay,item.FamilyAllowance);
|
||||
employeeInsurancListDataObj.Edit(item.WorkingDays, item.DailyWage, item.MonthlySalary, item.MonthlyBenefits, item.MonthlyBenefitsIncluded, item.BenefitsIncludedContinuous,
|
||||
item.BenefitsIncludedNonContinuous, item.InsuranceShare, item.StartWorkDate, item.LeftWorkDate, item.JobId, item.IncludeStatus, item.BaseYears, item.MarriedAllowance, item.OverTimePay, item.FamilyAllowance);
|
||||
}
|
||||
}
|
||||
_employeeInsurancListDataRepository.SaveChanges();
|
||||
@@ -234,7 +244,7 @@ public class InsuranceListRepository : RepositoryBase<long, InsuranceList>, IIns
|
||||
//مزایای ماهانه
|
||||
employeeInsurancListData.MonthlyBenefits = item.MonthlyBenefits;
|
||||
//دستمزد و مزایای ماهانه مشمول
|
||||
employeeInsurancListData.MonthlyBenefitsIncluded =item.MonthlyBenefitsIncluded;
|
||||
employeeInsurancListData.MonthlyBenefitsIncluded = item.MonthlyBenefitsIncluded;
|
||||
// مزایای مشمول و غیر مشمول
|
||||
employeeInsurancListData.BenefitsIncludedContinuous = item.BenefitsIncludedContinuous;
|
||||
//مزایای مشمول غیر مستمر
|
||||
@@ -253,7 +263,7 @@ public class InsuranceListRepository : RepositoryBase<long, InsuranceList>, IIns
|
||||
employeeInsurancListData.JobCode = job != null ? job.JobCode : string.Empty; ;
|
||||
employeeInsurancListData.StrStartWorkDate = item.StartWorkDate.ToFarsi();
|
||||
|
||||
if(item.LeftWorkDate!=null)
|
||||
if (item.LeftWorkDate != null)
|
||||
employeeInsurancListData.StrLeftWorkDate = item.LeftWorkDate.ToFarsi();
|
||||
|
||||
|
||||
@@ -266,7 +276,7 @@ public class InsuranceListRepository : RepositoryBase<long, InsuranceList>, IIns
|
||||
#endregion
|
||||
|
||||
#region WorkshopIds
|
||||
var workshopIds = _context.InsuranceListWorkshopSet.Where(x=>x.InsurancListId==id).Select(x => x.WorkshopId).ToList();
|
||||
var workshopIds = _context.InsuranceListWorkshopSet.Where(x => x.InsurancListId == id).Select(x => x.WorkshopId).ToList();
|
||||
#endregion
|
||||
|
||||
#region InsuranceEmployeeInformation
|
||||
@@ -286,7 +296,7 @@ public class InsuranceListRepository : RepositoryBase<long, InsuranceList>, IIns
|
||||
employeeDetails.DateOfBirthGr = item.DateOfBirth;
|
||||
employeeDetails.DateOfIssueGr = item.DateOfIssue;
|
||||
employeeDetails.DateOfBirth = item.DateOfBirth.ToFarsi();
|
||||
employeeDetails.DateOfIssue = ((item.DateOfIssue.ToFarsi())=="1300/10/11")?"": item.DateOfIssue.ToFarsi();
|
||||
employeeDetails.DateOfIssue = ((item.DateOfIssue.ToFarsi()) == "1300/10/11") ? "" : item.DateOfIssue.ToFarsi();
|
||||
employeeDetails.PlaceOfIssue = item.PlaceOfIssue;
|
||||
employeeDetails.NationalCode = item.NationalCode;
|
||||
//employeeDetails.Nationality = item.Nationality;
|
||||
@@ -380,7 +390,7 @@ public class InsuranceListRepository : RepositoryBase<long, InsuranceList>, IIns
|
||||
result => result.workshop.id,
|
||||
employer => employer.WorkshopId,
|
||||
(result, employer) => new { result.insurance, result.workshop, employer })
|
||||
.Select(result => new InsuranceListViewModel
|
||||
.Select(result => new InsuranceListViewModel
|
||||
{
|
||||
Id = result.insurance.id,
|
||||
Year = result.insurance.Year,
|
||||
@@ -402,9 +412,27 @@ public class InsuranceListRepository : RepositoryBase<long, InsuranceList>, IIns
|
||||
.Where(p => p.Employers.Any(e => e.id == result.employer.First().EmployerId))
|
||||
.Select(p => p.IsBlock)
|
||||
.FirstOrDefault(),
|
||||
EmployerId = result.employer.First().EmployerId
|
||||
EmployerId = result.employer.First().EmployerId,
|
||||
DebtDone = result.insurance.Debt.IsDone,
|
||||
EmployerApproved = result.insurance.EmployerApproval.IsDone,
|
||||
InspectionDone = result.insurance.Inspection.IsDone
|
||||
});
|
||||
|
||||
query = searchModel.Status switch
|
||||
{
|
||||
InsuranceListSearchStatus.NotStarted => query.Where(x =>
|
||||
!x.DebtDone && !x.EmployerApproved && !x.InspectionDone && !x.ConfirmSentlist),
|
||||
|
||||
InsuranceListSearchStatus.InProgress => query.Where(x =>
|
||||
(x.DebtDone || x.EmployerApproved || x.InspectionDone)&& !(x.DebtDone && x.EmployerApproved && x.InspectionDone) && !x.ConfirmSentlist),
|
||||
|
||||
InsuranceListSearchStatus.ReadyToSendList => query.Where(x =>
|
||||
x.DebtDone && x.EmployerApproved && x.InspectionDone && !x.ConfirmSentlist),
|
||||
|
||||
InsuranceListSearchStatus.Done => query.Where(x => x.ConfirmSentlist),
|
||||
|
||||
_ => query
|
||||
};
|
||||
|
||||
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).OrderByDescending(x => x.Id);
|
||||
@@ -456,7 +484,7 @@ public class InsuranceListRepository : RepositoryBase<long, InsuranceList>, IIns
|
||||
|
||||
//var testquery = query.Where(x => x.Year == searchModel.Year).AsEnumerable();
|
||||
|
||||
return query.ToList();
|
||||
return query.Skip(searchModel.PageIndex).Take(30).ToList();
|
||||
}
|
||||
public List<InsuranceListViewModel> Search(InsuranceListSearchModel searchModel)
|
||||
{
|
||||
@@ -465,9 +493,9 @@ public class InsuranceListRepository : RepositoryBase<long, InsuranceList>, IIns
|
||||
var acountID = _authHelper.CurrentAccountId();
|
||||
var workshopIds = _context.WorkshopAccounts.Where(x => x.AccountId == acountID).Select(x => x.WorkshopId).ToList();
|
||||
List<InsuranceListViewModel> list = new List<InsuranceListViewModel>();
|
||||
var query = _context.InsuranceListSet.Where(x=> workshopIds.Contains(x.WorkshopId)).ToList();
|
||||
var query = _context.InsuranceListSet.Where(x => workshopIds.Contains(x.WorkshopId)).ToList();
|
||||
var insuranceWorkshopInformationList = _context.InsuranceWorkshopInformationSet.Where(u => workshopIds.Contains(u.WorkshopId));
|
||||
var workshopList = _context.Workshops.Where(u => workshopIds.Contains(u.id));
|
||||
var workshopList = _context.Workshops.Where(u => workshopIds.Contains(u.id));
|
||||
|
||||
foreach (var item in query)
|
||||
{
|
||||
@@ -490,19 +518,19 @@ public class InsuranceListRepository : RepositoryBase<long, InsuranceList>, IIns
|
||||
typeOfInsuranceSend = "خانوادگی";
|
||||
}
|
||||
|
||||
var insuranceListViewModel =new InsuranceListViewModel()
|
||||
var insuranceListViewModel = new InsuranceListViewModel()
|
||||
{
|
||||
Id = item.id,
|
||||
Year = item.Year,
|
||||
Month = item.Month,
|
||||
MonthNumber = item.Month,
|
||||
WorkShopCode = insuranceWorkshopInformation==null? workshop.InsuranceCode: insuranceWorkshopInformation.InsuranceCode,
|
||||
WorkShopCode = insuranceWorkshopInformation == null ? workshop.InsuranceCode : insuranceWorkshopInformation.InsuranceCode,
|
||||
WorkShopName = insuranceWorkshopInformation == null ? workshop.WorkshopName : insuranceWorkshopInformation.WorkshopName,
|
||||
WorkShopId = workshop.id ,
|
||||
WorkShopId = workshop.id,
|
||||
TypeOfInsuranceSend = typeOfInsuranceSend,
|
||||
FixedSalary = workshop.FixedSalary,
|
||||
StrFixedSalary = workshop.FixedSalary?"دارد":"ندارد",
|
||||
EmployerName = insuranceWorkshopInformation == null? workshop.WorkshopFullName: insuranceWorkshopInformation.EmployerName,
|
||||
StrFixedSalary = workshop.FixedSalary ? "دارد" : "ندارد",
|
||||
EmployerName = insuranceWorkshopInformation == null ? workshop.WorkshopFullName : insuranceWorkshopInformation.EmployerName,
|
||||
Branch = "",
|
||||
City = "",
|
||||
ConfirmSentlist = item.ConfirmSentlist,
|
||||
@@ -530,7 +558,7 @@ public class InsuranceListRepository : RepositoryBase<long, InsuranceList>, IIns
|
||||
list = list.Where(x => x.WorkShopCode == searchModel.WorkShopCode).OrderByDescending(x => x.Year).OrderByDescending(x => x.Month).ThenByDescending(x => x.EmployerName).ToList();
|
||||
|
||||
if (!string.IsNullOrEmpty(searchModel.WorkShopName))
|
||||
list = list.Where(x => x.WorkShopName.Contains(searchModel.WorkShopName) ).OrderByDescending(x => x.EmployerName).ThenByDescending(x => x.Year).OrderByDescending(x => x.Month).ToList();
|
||||
list = list.Where(x => x.WorkShopName.Contains(searchModel.WorkShopName)).OrderByDescending(x => x.EmployerName).ThenByDescending(x => x.Year).OrderByDescending(x => x.Month).ToList();
|
||||
|
||||
|
||||
if (searchModel.WorkshopId > 0)
|
||||
@@ -553,7 +581,7 @@ public class InsuranceListRepository : RepositoryBase<long, InsuranceList>, IIns
|
||||
list = list.Where(x => x.EmployerName.Contains(searchModel.EmployerName)).OrderByDescending(x => x.EmployerName).ThenByDescending(x => x.Year).OrderByDescending(x => x.Month).ToList();
|
||||
|
||||
|
||||
if (searchModel.FixedSalary!=null)
|
||||
if (searchModel.FixedSalary != null)
|
||||
list = list.Where(x => x.FixedSalary == searchModel.FixedSalary).ToList();
|
||||
|
||||
if (!string.IsNullOrEmpty(searchModel.TypeOfInsuranceSend) && searchModel.TypeOfInsuranceSend != "0")
|
||||
@@ -587,7 +615,7 @@ public class InsuranceListRepository : RepositoryBase<long, InsuranceList>, IIns
|
||||
|
||||
|
||||
var insuranceListObj = _context.InsuranceListSet.Where(x => x.id == id).FirstOrDefault();
|
||||
if(insuranceListObj!=null)
|
||||
if (insuranceListObj != null)
|
||||
Remove(insuranceListObj);
|
||||
|
||||
SaveChanges();
|
||||
@@ -606,11 +634,11 @@ public class InsuranceListRepository : RepositoryBase<long, InsuranceList>, IIns
|
||||
|
||||
return result;
|
||||
}
|
||||
/// <summary>
|
||||
/// ایجاد لیست بیمه
|
||||
/// </summary>
|
||||
/// <param name="command"></param>
|
||||
/// <returns></returns>
|
||||
/// <summary>
|
||||
/// ایجاد لیست بیمه
|
||||
/// </summary>
|
||||
/// <param name="command"></param>
|
||||
/// <returns></returns>
|
||||
public OperationResult CreateInsuranceList(CreateInsuranceList command)
|
||||
{
|
||||
OperationResult result = new OperationResult();
|
||||
@@ -625,7 +653,7 @@ public class InsuranceListRepository : RepositoryBase<long, InsuranceList>, IIns
|
||||
command.InsuredShare,
|
||||
command.EmployerShare, command.UnEmploymentInsurance, command.DifficultJobsInsuranc,
|
||||
command.StartDate,
|
||||
command.EndDate, command.SumOfDailyWage,command.SumOfBaseYears,command.SumOfMarriedAllowance);
|
||||
command.EndDate, command.SumOfDailyWage, command.SumOfBaseYears, command.SumOfMarriedAllowance);
|
||||
Create(insuranceListObj);
|
||||
SaveChanges();
|
||||
var id = insuranceListObj.id;
|
||||
@@ -641,10 +669,11 @@ public class InsuranceListRepository : RepositoryBase<long, InsuranceList>, IIns
|
||||
item.BenefitsIncludedContinuous,
|
||||
item.BenefitsIncludedNonContinuous,
|
||||
item.InsuranceShare, item.StartWorkDate,
|
||||
item.LeftWorkDate, item.JobId,item.IncludeStatus,item.BaseYears,item.MarriedAllowance,item.OverTimePay,item.FamilyAllowance);
|
||||
item.LeftWorkDate, item.JobId, item.IncludeStatus, item.BaseYears, item.MarriedAllowance, item.OverTimePay, item.FamilyAllowance);
|
||||
_employeeInsurancListDataRepository.Create(employeeInsurancListData);
|
||||
|
||||
}_employeeInsurancListDataRepository.SaveChanges();
|
||||
}
|
||||
_employeeInsurancListDataRepository.SaveChanges();
|
||||
}
|
||||
|
||||
if (command.WorkshopIds != null && command.WorkshopIds.Count > 0)
|
||||
@@ -834,7 +863,7 @@ public class InsuranceListRepository : RepositoryBase<long, InsuranceList>, IIns
|
||||
|
||||
}
|
||||
|
||||
public MainEmployeeDetailsViewModel SearchEmployeeListForEditByInsuranceListId(EmployeeForEditInsuranceListSearchModel searchModel )
|
||||
public MainEmployeeDetailsViewModel SearchEmployeeListForEditByInsuranceListId(EmployeeForEditInsuranceListSearchModel searchModel)
|
||||
{
|
||||
var employeeDetailsViewModel = new MainEmployeeDetailsViewModel();
|
||||
|
||||
@@ -845,7 +874,7 @@ public class InsuranceListRepository : RepositoryBase<long, InsuranceList>, IIns
|
||||
{
|
||||
var leftWorkInsurance = _context.LeftWorkInsuranceList
|
||||
.Where(i => i.EmployeeId == item.EmployeeId && i.WorkshopId == searchModel.WorkshopId)
|
||||
.AsNoTracking().OrderByDescending(x=>x.id).FirstOrDefault();
|
||||
.AsNoTracking().OrderByDescending(x => x.id).FirstOrDefault();
|
||||
var job = _context.Jobs.Where(i => i.id == item.JobId).AsNoTracking().FirstOrDefault();
|
||||
var employeeInsurancListData = new EmployeeInsurancListDataViewModel();
|
||||
employeeInsurancListData.EmployeeInsurancListDataId = item.id;
|
||||
@@ -866,7 +895,7 @@ public class InsuranceListRepository : RepositoryBase<long, InsuranceList>, IIns
|
||||
//// مزایای ماهیانه مشمول
|
||||
employeeInsurancListData.BenefitsIncludedNonContinuous = item.BenefitsIncludedNonContinuous;
|
||||
//// حقوق و مزایای ماهیانه مشمول و غیر مشمول **
|
||||
employeeInsurancListData.IncludedAndNotIncluded = item.BenefitsIncludedContinuous;
|
||||
employeeInsurancListData.IncludedAndNotIncluded = item.BenefitsIncludedContinuous;
|
||||
|
||||
employeeInsurancListData.BaseYears = item.BaseYears;
|
||||
employeeInsurancListData.MarriedAllowance = item.MarriedAllowance;
|
||||
@@ -875,7 +904,7 @@ public class InsuranceListRepository : RepositoryBase<long, InsuranceList>, IIns
|
||||
//سهم بیمه حق کارگر
|
||||
employeeInsurancListData.InsuranceShare = item.InsuranceShare;
|
||||
// تاریخ شروع به کار
|
||||
employeeInsurancListData.StartWorkDate =item.StartWorkDate;
|
||||
employeeInsurancListData.StartWorkDate = item.StartWorkDate;
|
||||
//تاریخ ترک کار
|
||||
employeeInsurancListData.LeftWorkDate = item.LeftWorkDate;
|
||||
// آی دی شغل
|
||||
@@ -893,7 +922,7 @@ public class InsuranceListRepository : RepositoryBase<long, InsuranceList>, IIns
|
||||
//ممکن است کسی شامل مزایا باشد و در آن ماه برایش یا مزد روزانه رد نشده باشد
|
||||
// باید با یک فیلد چک شود
|
||||
//
|
||||
if (leftWorkInsurance != null && ((leftWorkInsurance.IncludeStatus!=leftWorkInsurance.IncludeStatus ) || ((leftWorkInsurance.LeftWorkDate!=item.LeftWorkDate)||(leftWorkInsurance.StartWorkDate != item.StartWorkDate ) ||(leftWorkInsurance.JobId != item.JobId))))
|
||||
if (leftWorkInsurance != null && ((leftWorkInsurance.IncludeStatus != leftWorkInsurance.IncludeStatus) || ((leftWorkInsurance.LeftWorkDate != item.LeftWorkDate) || (leftWorkInsurance.StartWorkDate != item.StartWorkDate) || (leftWorkInsurance.JobId != item.JobId))))
|
||||
{
|
||||
employeeInsurancListData.HasConfilictLeftWork = true;
|
||||
if (leftWorkInsurance.LeftWorkDate != null)
|
||||
@@ -924,7 +953,7 @@ public class InsuranceListRepository : RepositoryBase<long, InsuranceList>, IIns
|
||||
var employeeDetailsForInsuranceList = new List<EmployeeDetailsForInsuranceListViewModel>();
|
||||
foreach (var item in insuranceEmployeeInformationList)
|
||||
{
|
||||
var employeeObject = _context.Employees.Where(x=>x.id==item.EmployeeId)?.FirstOrDefault();
|
||||
var employeeObject = _context.Employees.Where(x => x.id == item.EmployeeId)?.FirstOrDefault();
|
||||
var employeeInsurancListData = employeeInsurancListDataViewModelList.Where(x => x.EmployeeId == item.EmployeeId)?.FirstOrDefault();
|
||||
var employeeDetails = new EmployeeDetailsForInsuranceListViewModel();
|
||||
employeeDetails.EmployeeId = item.EmployeeId;
|
||||
@@ -999,7 +1028,7 @@ public class InsuranceListRepository : RepositoryBase<long, InsuranceList>, IIns
|
||||
{
|
||||
var insuranceListObj = Get(id);
|
||||
insuranceListObj.Edit(insuranceListObj.SumOfEmployees, insuranceListObj.SumOfWorkingDays, insuranceListObj.SumOfSalaries, insuranceListObj.SumOfBenefitsIncluded, insuranceListObj.Included, insuranceListObj.IncludedAndNotIncluded, insuranceListObj.InsuredShare,
|
||||
insuranceListObj.EmployerShare, insuranceListObj.UnEmploymentInsurance, insuranceListObj.DifficultJobsInsuranc, insuranceListObj.StartDate, insuranceListObj.SumOfDailyWage,insuranceListObj.SumOfBaseYears,insuranceListObj.SumOfMarriedAllowance,true);
|
||||
insuranceListObj.EmployerShare, insuranceListObj.UnEmploymentInsurance, insuranceListObj.DifficultJobsInsuranc, insuranceListObj.StartDate, insuranceListObj.SumOfDailyWage, insuranceListObj.SumOfBaseYears, insuranceListObj.SumOfMarriedAllowance, true);
|
||||
|
||||
SaveChanges();
|
||||
|
||||
@@ -1020,7 +1049,7 @@ public class InsuranceListRepository : RepositoryBase<long, InsuranceList>, IIns
|
||||
{
|
||||
var insuranceListViewModel = new InsuranceListViewModel();
|
||||
|
||||
var insuranceList = _context.InsuranceListSet.Where(x => x.WorkshopId == workshopId && x.Year == year).OrderByDescending(x=>x.id)?.FirstOrDefault();
|
||||
var insuranceList = _context.InsuranceListSet.Where(x => x.WorkshopId == workshopId && x.Year == year).OrderByDescending(x => x.id)?.FirstOrDefault();
|
||||
|
||||
if (insuranceList != null)
|
||||
{
|
||||
@@ -1031,7 +1060,7 @@ public class InsuranceListRepository : RepositoryBase<long, InsuranceList>, IIns
|
||||
insuranceListViewModel.WorkShopId = insuranceList.WorkshopId;
|
||||
insuranceListViewModel.ConfirmSentlist = insuranceList.ConfirmSentlist;
|
||||
}
|
||||
return insuranceListViewModel;
|
||||
return insuranceListViewModel;
|
||||
}
|
||||
|
||||
#region client
|
||||
@@ -1113,11 +1142,46 @@ public class InsuranceListRepository : RepositoryBase<long, InsuranceList>, IIns
|
||||
default: return query.OrderByDescending(x => x.Id).Skip(searchModel.PageIndex).ToList();
|
||||
}
|
||||
}
|
||||
|
||||
public async Task<InsuranceListConfirmOperation> GetInsuranceOperationDetails(long id)
|
||||
{
|
||||
var res = await _context.InsuranceListSet.Select(x => new InsuranceListConfirmOperation()
|
||||
{
|
||||
InsuranceListId = x.id,
|
||||
Approval = new CreateInsuranceListApproval()
|
||||
{
|
||||
ApprovalStatus = x.EmployerApproval.Status,
|
||||
Description = x.EmployerApproval.Description,
|
||||
},
|
||||
Debt = new CreateInsuranceListDebt()
|
||||
{
|
||||
Amount = x.Debt.Amount.ToMoney(),
|
||||
DebtDate = x.Debt.DebtDate.ToFarsi(),
|
||||
DebtFileMediaId = x.Debt.MediaId,
|
||||
Type = x.Debt.Type
|
||||
},
|
||||
Inspection = new CreateInsuranceListInspection()
|
||||
{
|
||||
Type = x.Inspection.Type,
|
||||
InspectionFileMediaId = x.Inspection.MediaId,
|
||||
LastInspectionDate = x.Inspection.LastInspectionDateTime.ToFarsi()
|
||||
},
|
||||
ConfirmSentList = x.ConfirmSentlist,
|
||||
}).FirstOrDefaultAsync(x => x.InsuranceListId == id);
|
||||
|
||||
res.Inspection.FilePath = GetInsuranceListFilePath(res.Inspection.InspectionFileMediaId);
|
||||
res.Debt.FilePath = GetInsuranceListFilePath(res.Debt.DebtFileMediaId);
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public List<InsuranceListViewModel> SearchForClientOld(InsuranceListSearchModel searchModel)
|
||||
{
|
||||
|
||||
List<InsuranceListViewModel> list = new List<InsuranceListViewModel>();
|
||||
var query = _context.InsuranceListSet.Where(x=>x.WorkshopId== searchModel.WorkshopId).ToList();
|
||||
var query = _context.InsuranceListSet.Where(x => x.WorkshopId == searchModel.WorkshopId).ToList();
|
||||
foreach (var item in query)
|
||||
{
|
||||
var insuranceWorkshopInformation = _context.InsuranceWorkshopInformationSet.FirstOrDefault(u => u.WorkshopId == item.WorkshopId);
|
||||
@@ -1194,16 +1258,16 @@ public class InsuranceListRepository : RepositoryBase<long, InsuranceList>, IIns
|
||||
|
||||
#endregion
|
||||
|
||||
public (int insuranceHistoryYearsCount, double baseYear) GetEmployeeInsuranceBaseYear(long employeeId, long workshopId, int countWorkingDay,DateTime listStartDate, DateTime listEndDate, DateTime startWorkDate, DateTime leftDate, bool hasLeft)
|
||||
public (int insuranceHistoryYearsCount, double baseYear) GetEmployeeInsuranceBaseYear(long employeeId, long workshopId, int countWorkingDay, DateTime listStartDate, DateTime listEndDate, DateTime startWorkDate, DateTime leftDate, bool hasLeft)
|
||||
{
|
||||
|
||||
|
||||
var lefts = _context.LeftWorkInsuranceList
|
||||
.Where(x => x.EmployeeId == employeeId && x.WorkshopId == workshopId).Select(x=> new
|
||||
.Where(x => x.EmployeeId == employeeId && x.WorkshopId == workshopId).Select(x => new
|
||||
{
|
||||
startWork = x.StartWorkDate,
|
||||
leftWork = x.LeftWorkDate == null ? listStartDate : x.LeftWorkDate.Value,
|
||||
}).OrderBy(x=>x.startWork).ToList();
|
||||
startWork = x.StartWorkDate,
|
||||
leftWork = x.LeftWorkDate == null ? listStartDate : x.LeftWorkDate.Value,
|
||||
}).OrderBy(x => x.startWork).ToList();
|
||||
int countDay = 0;
|
||||
foreach (var left in lefts)
|
||||
{
|
||||
@@ -1212,12 +1276,12 @@ public class InsuranceListRepository : RepositoryBase<long, InsuranceList>, IIns
|
||||
//شمارش فقط تا روز قبل از شروع لیست انجام شود
|
||||
if (left.leftWork >= listStartDate)
|
||||
{
|
||||
var endBeforStartList = new DateTime(listStartDate.Year, listStartDate.Month, listStartDate.Day);
|
||||
end = endBeforStartList.AddDays(-1).ToPersianDateTime();
|
||||
}
|
||||
var endBeforStartList = new DateTime(listStartDate.Year, listStartDate.Month, listStartDate.Day);
|
||||
end = endBeforStartList.AddDays(-1).ToPersianDateTime();
|
||||
}
|
||||
|
||||
|
||||
var count = (int)(end - start).TotalDays +1;
|
||||
var count = (int)(end - start).TotalDays + 1;
|
||||
countDay += count;
|
||||
}
|
||||
|
||||
@@ -1229,7 +1293,7 @@ public class InsuranceListRepository : RepositoryBase<long, InsuranceList>, IIns
|
||||
|
||||
//بدست آوردن مزد سنوات بر اساس سابقه به سال
|
||||
var baseYear = _insuranceYearlySalaryRepository.GetBaseYearByDate(listStartDate, yearsCount);
|
||||
if(baseYear == 0)
|
||||
if (baseYear == 0)
|
||||
return (0, 0);
|
||||
|
||||
|
||||
@@ -1279,108 +1343,108 @@ public class InsuranceListRepository : RepositoryBase<long, InsuranceList>, IIns
|
||||
public List<EmployeeDetailsForInsuranceListViewModel> GetEmployeeInsuranceDataForEdit(long insuranceListId, DateTime startDate, DateTime endDate)
|
||||
{
|
||||
|
||||
var res = _context.EmployeeInsurancListDataSet
|
||||
.Where(x => x.InsuranceListId == insuranceListId)
|
||||
.Join(_context.LeftWorkInsuranceList
|
||||
.Where(x =>
|
||||
((x.LeftWorkDate != null && x.LeftWorkDate != DateTime.MinValue) &&
|
||||
((DateTime)x.LeftWorkDate >= startDate &&
|
||||
(DateTime)x.LeftWorkDate <= endDate)) ||
|
||||
((x.LeftWorkDate != null && x.LeftWorkDate != DateTime.MinValue) &&
|
||||
(DateTime)x.LeftWorkDate >= endDate) ||
|
||||
(x.LeftWorkDate == null || x.LeftWorkDate == DateTime.MinValue))
|
||||
.Where(x => x.StartWorkDate <= endDate)
|
||||
.Include(x => x.Employee),
|
||||
employeeData => employeeData.EmployeeId,
|
||||
leftwork => leftwork.EmployeeId,
|
||||
(employeeData, leftwork) => new { employeeData, leftwork })
|
||||
.Join(_context.Jobs,
|
||||
result => result.leftwork.JobId,
|
||||
job => job.id,
|
||||
(result, job) => new { result, job })
|
||||
.GroupJoin(_context.InsuranceEmployeeInformationSet.AsSplitQuery(),
|
||||
allResult => allResult.result.employeeData.EmployeeId,
|
||||
employeeInfo => employeeInfo.EmployeeId,
|
||||
(allResult, employeeInfo) => new
|
||||
{
|
||||
allResult.result,
|
||||
allResult.job,
|
||||
employeeInfo
|
||||
})
|
||||
.SelectMany(x => x.employeeInfo.DefaultIfEmpty(), (x, employeeInfo) => new { x, employeeInfo })
|
||||
.Select(result => new EmployeeDetailsForInsuranceListViewModel
|
||||
{
|
||||
StartWorkDateNew = result.x.result.leftwork.StartWorkDate,
|
||||
LeftWorkDateNew = result.x.result.leftwork.LeftWorkDate,
|
||||
JobIdNew = result.x.result.leftwork.JobId,
|
||||
var res = _context.EmployeeInsurancListDataSet
|
||||
.Where(x => x.InsuranceListId == insuranceListId)
|
||||
.Join(_context.LeftWorkInsuranceList
|
||||
.Where(x =>
|
||||
((x.LeftWorkDate != null && x.LeftWorkDate != DateTime.MinValue) &&
|
||||
((DateTime)x.LeftWorkDate >= startDate &&
|
||||
(DateTime)x.LeftWorkDate <= endDate)) ||
|
||||
((x.LeftWorkDate != null && x.LeftWorkDate != DateTime.MinValue) &&
|
||||
(DateTime)x.LeftWorkDate >= endDate) ||
|
||||
(x.LeftWorkDate == null || x.LeftWorkDate == DateTime.MinValue))
|
||||
.Where(x => x.StartWorkDate <= endDate)
|
||||
.Include(x => x.Employee),
|
||||
employeeData => employeeData.EmployeeId,
|
||||
leftwork => leftwork.EmployeeId,
|
||||
(employeeData, leftwork) => new { employeeData, leftwork })
|
||||
.Join(_context.Jobs,
|
||||
result => result.leftwork.JobId,
|
||||
job => job.id,
|
||||
(result, job) => new { result, job })
|
||||
.GroupJoin(_context.InsuranceEmployeeInformationSet.AsSplitQuery(),
|
||||
allResult => allResult.result.employeeData.EmployeeId,
|
||||
employeeInfo => employeeInfo.EmployeeId,
|
||||
(allResult, employeeInfo) => new
|
||||
{
|
||||
allResult.result,
|
||||
allResult.job,
|
||||
employeeInfo
|
||||
})
|
||||
.SelectMany(x => x.employeeInfo.DefaultIfEmpty(), (x, employeeInfo) => new { x, employeeInfo })
|
||||
.Select(result => new EmployeeDetailsForInsuranceListViewModel
|
||||
{
|
||||
StartWorkDateNew = result.x.result.leftwork.StartWorkDate,
|
||||
LeftWorkDateNew = result.x.result.leftwork.LeftWorkDate,
|
||||
JobIdNew = result.x.result.leftwork.JobId,
|
||||
|
||||
|
||||
StartWorkDateGr = result.x.result.leftwork.StartWorkDate,
|
||||
LeftWorkDateGr = result.x.result.leftwork.LeftWorkDate,
|
||||
IncludeStatus = result.x.result.employeeData.IncludeStatus,
|
||||
JobId = result.x.result.employeeData.JobId,
|
||||
JobName = result.x.job != null ? result.x.job.JobName : string.Empty,
|
||||
JobCode = result.x.job != null ? result.x.job.JobCode : string.Empty,
|
||||
InsuranceEmployeeInformationId = result.employeeInfo != null ? result.employeeInfo.id : 0,
|
||||
EmployeeId = result.x.result.employeeData.EmployeeId,
|
||||
StartWorkDateGr = result.x.result.leftwork.StartWorkDate,
|
||||
LeftWorkDateGr = result.x.result.leftwork.LeftWorkDate,
|
||||
IncludeStatus = result.x.result.employeeData.IncludeStatus,
|
||||
JobId = result.x.result.employeeData.JobId,
|
||||
JobName = result.x.job != null ? result.x.job.JobName : string.Empty,
|
||||
JobCode = result.x.job != null ? result.x.job.JobCode : string.Empty,
|
||||
InsuranceEmployeeInformationId = result.employeeInfo != null ? result.employeeInfo.id : 0,
|
||||
EmployeeId = result.x.result.employeeData.EmployeeId,
|
||||
|
||||
//اطلاعات هویتی
|
||||
FName = result.employeeInfo != null ? result.employeeInfo.FName : result.x.result.leftwork.Employee.FName,
|
||||
LName = result.employeeInfo != null ? result.employeeInfo.LName : result.x.result.leftwork.Employee.LName,
|
||||
FatherName = result.employeeInfo != null ? result.employeeInfo.FatherName : result.x.result.leftwork.Employee.FatherName,
|
||||
DateOfBirthGr = result.employeeInfo != null ? result.employeeInfo.DateOfBirth : result.x.result.leftwork.Employee.DateOfBirth,
|
||||
DateOfIssueGr = result.employeeInfo != null ? result.employeeInfo.DateOfIssue : result.x.result.leftwork.Employee.DateOfIssue,
|
||||
PlaceOfIssue = result.employeeInfo != null ? result.employeeInfo.PlaceOfIssue : result.x.result.leftwork.Employee.PlaceOfIssue,
|
||||
IdNumber = result.employeeInfo != null ? result.employeeInfo.IdNumber : result.x.result.leftwork.Employee.IdNumber,
|
||||
Gender = result.employeeInfo != null ? result.employeeInfo.Gender : result.x.result.leftwork.Employee.Gender,
|
||||
NationalCode = result.x.result.leftwork.Employee.NationalCode,
|
||||
Nationality = result.x.result.leftwork.Employee.Nationality,
|
||||
InsuranceCode = result.x.result.leftwork.Employee.InsuranceCode,
|
||||
MaritalStatus = result.x.result.leftwork.Employee.MaritalStatus,
|
||||
IsMaritalStatusSet = !string.IsNullOrWhiteSpace(result.x.result.leftwork.Employee.MaritalStatus),
|
||||
//اطلاعات هویتی
|
||||
FName = result.employeeInfo != null ? result.employeeInfo.FName : result.x.result.leftwork.Employee.FName,
|
||||
LName = result.employeeInfo != null ? result.employeeInfo.LName : result.x.result.leftwork.Employee.LName,
|
||||
FatherName = result.employeeInfo != null ? result.employeeInfo.FatherName : result.x.result.leftwork.Employee.FatherName,
|
||||
DateOfBirthGr = result.employeeInfo != null ? result.employeeInfo.DateOfBirth : result.x.result.leftwork.Employee.DateOfBirth,
|
||||
DateOfIssueGr = result.employeeInfo != null ? result.employeeInfo.DateOfIssue : result.x.result.leftwork.Employee.DateOfIssue,
|
||||
PlaceOfIssue = result.employeeInfo != null ? result.employeeInfo.PlaceOfIssue : result.x.result.leftwork.Employee.PlaceOfIssue,
|
||||
IdNumber = result.employeeInfo != null ? result.employeeInfo.IdNumber : result.x.result.leftwork.Employee.IdNumber,
|
||||
Gender = result.employeeInfo != null ? result.employeeInfo.Gender : result.x.result.leftwork.Employee.Gender,
|
||||
NationalCode = result.x.result.leftwork.Employee.NationalCode,
|
||||
Nationality = result.x.result.leftwork.Employee.Nationality,
|
||||
InsuranceCode = result.x.result.leftwork.Employee.InsuranceCode,
|
||||
MaritalStatus = result.x.result.leftwork.Employee.MaritalStatus,
|
||||
IsMaritalStatusSet = !string.IsNullOrWhiteSpace(result.x.result.leftwork.Employee.MaritalStatus),
|
||||
|
||||
//اطاعات محاسباتی
|
||||
EmployeeInsurancListDataId = result.x.result.employeeData.id,
|
||||
DailyWage = result.x.result.employeeData.DailyWage,
|
||||
// LeftWorkDateGr = x.LeftWorkDate,
|
||||
// StartWorkDateGr = x.StartWorkDate,
|
||||
MonthlyBenefitsIncluded = result.x.result.employeeData.MonthlyBenefitsIncluded,
|
||||
// JobId = x.JobId,
|
||||
WorkingDays = result.x.result.employeeData.WorkingDays,
|
||||
//پایه سنوات
|
||||
BaseYears = result.x.result.employeeData.BaseYears,
|
||||
//اطاعات محاسباتی
|
||||
EmployeeInsurancListDataId = result.x.result.employeeData.id,
|
||||
DailyWage = result.x.result.employeeData.DailyWage,
|
||||
// LeftWorkDateGr = x.LeftWorkDate,
|
||||
// StartWorkDateGr = x.StartWorkDate,
|
||||
MonthlyBenefitsIncluded = result.x.result.employeeData.MonthlyBenefitsIncluded,
|
||||
// JobId = x.JobId,
|
||||
WorkingDays = result.x.result.employeeData.WorkingDays,
|
||||
//پایه سنوات
|
||||
BaseYears = result.x.result.employeeData.BaseYears,
|
||||
|
||||
//مجموع مزد روزانه و پایه سنوات
|
||||
DailyWagePlusBaseYears = result.x.result.employeeData.DailyWagePlusBaseYears,
|
||||
//مجموع مزد روزانه و پایه سنوات
|
||||
DailyWagePlusBaseYears = result.x.result.employeeData.DailyWagePlusBaseYears,
|
||||
|
||||
//حق تاهل
|
||||
MarriedAllowance = result.x.result.employeeData.MarriedAllowance,
|
||||
//حق تاهل
|
||||
MarriedAllowance = result.x.result.employeeData.MarriedAllowance,
|
||||
|
||||
//دستمزد ماهانه
|
||||
MonthlySalary = result.x.result.employeeData.MonthlySalary,
|
||||
//دستمزد ماهانه
|
||||
MonthlySalary = result.x.result.employeeData.MonthlySalary,
|
||||
|
||||
|
||||
//مزایای ماهانه
|
||||
MonthlyBenefits = result.x.result.employeeData.MonthlyBenefits,
|
||||
//مزایای ماهانه
|
||||
MonthlyBenefits = result.x.result.employeeData.MonthlyBenefits,
|
||||
|
||||
//مزایای مشمول
|
||||
BenefitsIncludedContinuous = result.x.result.employeeData.MonthlyBenefitsIncluded,
|
||||
//مزایای مشمول
|
||||
BenefitsIncludedContinuous = result.x.result.employeeData.MonthlyBenefitsIncluded,
|
||||
|
||||
//مزایای غیر مشمول
|
||||
BenefitsIncludedNonContinuous = result.x.result.employeeData.BenefitsIncludedNonContinuous,
|
||||
//مزایای غیر مشمول
|
||||
BenefitsIncludedNonContinuous = result.x.result.employeeData.BenefitsIncludedNonContinuous,
|
||||
|
||||
// جمع کل دستمزد و مزایای ماهانه مشمول و غیر مشمول
|
||||
IncludedAndNotIncluded = result.x.result.employeeData.BenefitsIncludedContinuous,
|
||||
// جمع کل دستمزد و مزایای ماهانه مشمول و غیر مشمول
|
||||
IncludedAndNotIncluded = result.x.result.employeeData.BenefitsIncludedContinuous,
|
||||
|
||||
//حق بیمه سهم بیمه شده
|
||||
InsuranceShare = result.x.result.employeeData.InsuranceShare,
|
||||
//حق بیمه سهم بیمه شده
|
||||
InsuranceShare = result.x.result.employeeData.InsuranceShare,
|
||||
|
||||
//اضافه کار فیش حقوقی
|
||||
OverTimePay = result.x.result.employeeData.OverTimePay,
|
||||
//اضافه کار فیش حقوقی
|
||||
OverTimePay = result.x.result.employeeData.OverTimePay,
|
||||
|
||||
//حق اولا فیش حقوقی
|
||||
FamilyAllowance = result.x.result.employeeData.FamilyAllowance,
|
||||
});
|
||||
//حق اولا فیش حقوقی
|
||||
FamilyAllowance = result.x.result.employeeData.FamilyAllowance,
|
||||
});
|
||||
|
||||
|
||||
//.Select(x => new EmployeeDetailsForInsuranceListViewModel
|
||||
@@ -1427,4 +1491,45 @@ 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();
|
||||
|
||||
return res;
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="year"></param>
|
||||
/// <param name="month"></param>
|
||||
/// <param name="insuranceListId"></param>
|
||||
/// <param name="type">debt / inspection</param>
|
||||
/// <returns></returns>
|
||||
private string GetInsuranceListFilePath(long mediaId)
|
||||
{
|
||||
return _accountContext.Medias.FirstOrDefault(x => x.id == mediaId)?.Path ?? "";
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,10 @@
|
||||
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;
|
||||
@@ -478,6 +481,248 @@ 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,7 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Numerics;
|
||||
using _0_Framework.Application;
|
||||
using _0_Framework.InfraStructure;
|
||||
using Company.Domain.InstitutionPlanAgg;
|
||||
@@ -170,7 +169,6 @@ public class PlanPercentageRepository : RepositoryBase<long, PlanPercentage>, IP
|
||||
|
||||
}
|
||||
|
||||
|
||||
public InstitutionPlanViewModel GetInstitutionPlanForWorkshop(WorkshopTempViewModel command)
|
||||
{
|
||||
var planPercentage = _context.PlanPercentages.FirstOrDefault();
|
||||
@@ -184,7 +182,10 @@ 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)
|
||||
{
|
||||
@@ -203,10 +204,10 @@ public class PlanPercentageRepository : RepositoryBase<long, PlanPercentage>, IP
|
||||
RollCallDouble = command.RollCall ? (((dailyWage * planPercentage.RollCallPercent) / 100) * plan.CountPerson *
|
||||
plan.IncreasePercentage) : 0,
|
||||
|
||||
CustomizeCheckoutDouble = (((dailyWage * planPercentage.CustomizeCheckoutPercent) / 100) * plan.CountPerson *
|
||||
plan.IncreasePercentage),
|
||||
CustomizeCheckoutDouble =command.CustomizeCheckout ? (((dailyWage * planPercentage.CustomizeCheckoutPercent) / 100) * plan.CountPerson *
|
||||
plan.IncreasePercentage) : 0,
|
||||
|
||||
ContractAndCheckoutInPersonDouble = command.ContractAndCheckoutInPerson ? (((dailyWage * planPercentage.ContractAndCheckoutInPersonPercent) / 100) * plan.CountPerson *
|
||||
ContractAndCheckoutInPersonDouble = command.ContractAndCheckoutInPerson ? (((dailyWage * planPercentage.ContractAndCheckoutInPersonPercent) / 100) * plan.CountPerson *
|
||||
plan.IncreasePercentage) : 0,
|
||||
|
||||
InsuranceInPersonDouble = command.InsuranceInPerson ? (((dailyWage * planPercentage.InsuranceInPersonPercent) / 100) * plan.CountPerson *
|
||||
@@ -214,7 +215,7 @@ public class PlanPercentageRepository : RepositoryBase<long, PlanPercentage>, IP
|
||||
|
||||
}).FirstOrDefault();
|
||||
|
||||
if(planByCountPerson == null)
|
||||
if (planByCountPerson == null)
|
||||
return new InstitutionPlanViewModel();
|
||||
//مبلغ کل خدمات حضوری
|
||||
var inPersonSumAmount = planByCountPerson.ContractAndCheckoutDouble + planByCountPerson.InsuranceDouble +
|
||||
@@ -236,7 +237,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",
|
||||
|
||||
|
||||
@@ -40,5 +40,11 @@ public class WorkshopTempRepository : RepositoryBase<long, WorkshopTemp>, IWorks
|
||||
return result;
|
||||
}
|
||||
|
||||
public async Task RemoveWorkshopTemps(List<long> workshopTempIds)
|
||||
{
|
||||
var result = _context.WorkshopTemps.Where(x => workshopTempIds.Contains(x.id));
|
||||
|
||||
_context.RemoveRange(result);
|
||||
await _context.SaveChangesAsync();
|
||||
}
|
||||
}
|
||||
@@ -205,6 +205,8 @@ using CompanyManagment.App.Contracts.EmployeeClientTemp;
|
||||
using CompanyManagment.App.Contracts.InstitutionPlan;
|
||||
using CompanyManagment.App.Contracts.LeftWorkTemp;
|
||||
using CompanyManagment.App.Contracts.TemporaryClientRegistration;
|
||||
using Company.Domain.ContactUsAgg;
|
||||
using CompanyManagment.App.Contracts.ContactUs;
|
||||
using Company.Domain.EmployeeAuthorizeTempAgg;
|
||||
using Company.Domain.AdminMonthlyOverviewAgg;
|
||||
using CompanyManagment.App.Contracts.AdminMonthlyOverview;
|
||||
@@ -427,8 +429,14 @@ public class PersonalBootstrapper
|
||||
services.AddTransient<ILeftWorkTempRepository, LeftWorkTempRepository>();
|
||||
services.AddTransient<ILeftWorkTempApplication, LeftWorkTempApplication>();
|
||||
|
||||
services.AddTransient<IContactUsRepository, ContactUsRepository>();
|
||||
services.AddTransient<IContactUsApplication, ContactUsApplication>();
|
||||
|
||||
services.AddTransient<IEmployeeAuthorizeTempRepository, EmployeeAuthorizeTempRepository>();
|
||||
|
||||
|
||||
services.AddTransient<IContactUsRepository, ContactUsRepository>();
|
||||
services.AddTransient<IContactUsApplication, ContactUsApplication>();
|
||||
services.AddTransient<IAdminMonthlyOverviewRepository, AdminMonthlyOverviewRepository>();
|
||||
services.AddTransient<IAdminMonthlyOverviewApplication, AdminMonthlyOverviewApplication>();
|
||||
#endregion
|
||||
|
||||
@@ -0,0 +1,173 @@
|
||||
using System.Diagnostics;
|
||||
using _0_Framework.Application;
|
||||
using CompanyManagment.App.Contracts.PersonalContractingParty;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using ServiceHost.BaseControllers;
|
||||
|
||||
namespace ServiceHost.Areas.Admin.Controllers;
|
||||
|
||||
public class ContractingPartyController : AdminController
|
||||
{
|
||||
private readonly IPersonalContractingPartyApp _contractingPartyApplication;
|
||||
|
||||
public ContractingPartyController(IPersonalContractingPartyApp contractingPartyApplication)
|
||||
{
|
||||
_contractingPartyApplication = contractingPartyApplication;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// لیست طرف حساب
|
||||
/// </summary>
|
||||
/// <param name="searchModel"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet]
|
||||
public async Task<ActionResult<ICollection<ContractingPartyGetListViewModel>>> Get([FromQuery] ContractingPartyGetListSearchModel searchModel)
|
||||
{
|
||||
var watch = new Stopwatch();
|
||||
watch.Start();
|
||||
var result = await _contractingPartyApplication.GetList(searchModel);
|
||||
Console.WriteLine(watch.Elapsed);
|
||||
return result.ToList();
|
||||
}
|
||||
[HttpGet("t/{name}")]
|
||||
public async Task<List<string>> TestApi(string name)
|
||||
{
|
||||
var res = _contractingPartyApplication.SearchByName(name).Where(x=>x.Contains(name)).ToList();
|
||||
return res;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// جزئیات طرف حساب حقیقی
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("real/{id}")]
|
||||
public async Task<ActionResult<GetRealContractingPartyDetailsViewModel>> GetDetailsReal(long id)
|
||||
{
|
||||
var result = await _contractingPartyApplication.GetRealDetails(id);
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// جزئیات طرف حساب حقوقی
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("legal/{id}")]
|
||||
public async Task<ActionResult<GetLegalContractingPartyDetailsViewModel>> GetDetailsLegal(long id)
|
||||
{
|
||||
var result = await _contractingPartyApplication.GetLegalDetails(id);
|
||||
return result;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// ایجاد طرف حساب حقیقی
|
||||
/// </summary>
|
||||
/// <param name="command"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost("real")]
|
||||
public async Task<ActionResult<OperationResult>> CreateReal([FromBody] CreateRealContractingParty command)
|
||||
{
|
||||
var result = await _contractingPartyApplication.CreateReal(command);
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// ایجاد طرف حساب حقوقی
|
||||
/// </summary>
|
||||
/// <param name="command"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost("legal")]
|
||||
public async Task<ActionResult<OperationResult>> CreateLegal([FromBody] CreateLegalContractingParty command)
|
||||
{
|
||||
var result = await _contractingPartyApplication.CreateLegal(command);
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// ویرایش طرف حساب حقیقی
|
||||
/// </summary>
|
||||
/// <param name="command"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPut("real")]
|
||||
public ActionResult<OperationResult> EditReal([FromBody] EditRealContractingParty command)
|
||||
{
|
||||
var result = _contractingPartyApplication.EditRealApi(command);
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// ویرایش طرف حساب حقوقی
|
||||
/// </summary>
|
||||
/// <param name="command"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPut("legal")]
|
||||
public ActionResult<OperationResult> EditLegal([FromBody] EditLegalContractingParty command)
|
||||
{
|
||||
var result = _contractingPartyApplication.EditLegal(command);
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// چک کردن بلاک بودن طرف حساب با آیدی کارفرما
|
||||
/// </summary>
|
||||
/// <param name="employerId">آیدی کارفرما</param>
|
||||
/// <returns>true - false - NotFound</returns>
|
||||
[HttpGet("is_block/{employerId}")]
|
||||
public ActionResult<string> IsBlockByEmployerId(long employerId)
|
||||
{
|
||||
var result = _contractingPartyApplication.IsBlockByEmployerId(employerId);
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// گرفتن آخرین کد بایگانی کارگاه
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpGet("last_archive_code")]
|
||||
public ActionResult<int> GetLastArchiveCodeByContractingPartyId()
|
||||
{
|
||||
var data = _contractingPartyApplication.GetLastArchiveCode();
|
||||
return data;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// سلکت لیست طرف حساب برای جستجو
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpGet("selectList")]
|
||||
public async Task<ActionResult<List<ContractingPartySelectListViewModel>>> GetSelectList()
|
||||
{
|
||||
return await _contractingPartyApplication.GetSelectList();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// لیست شناسه ملی یا شماره ملی برای جستجوی
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpGet("national_Code_Select_list")]
|
||||
public async Task<ActionResult<List<GetContractingPartyNationalCodeOrNationalIdViewModel>>> GetNationalCodeOrNationalId()
|
||||
{
|
||||
return await _contractingPartyApplication.GetNationalCodeOrNationalId();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// حذف طرف حساب. درصورت داشتن قرارداد مالی یا داشتن کارفرما، طرف حساب غیرفعال میشود
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
[HttpDelete]
|
||||
public async Task<OperationResult<string>> DeleteContractingParty(long id)
|
||||
{
|
||||
var operationResult = await _contractingPartyApplication.Delete(id);
|
||||
|
||||
return operationResult;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
123
ServiceHost/Areas/Admin/Controllers/EmployerController.cs
Normal file
123
ServiceHost/Areas/Admin/Controllers/EmployerController.cs
Normal file
@@ -0,0 +1,123 @@
|
||||
using _0_Framework.Application;
|
||||
using CompanyManagment.App.Contracts.Employer;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using ServiceHost.BaseControllers;
|
||||
|
||||
namespace ServiceHost.Areas.Admin.Controllers;
|
||||
|
||||
public class EmployerController : AdminController
|
||||
{
|
||||
private readonly IEmployerApplication _employerApplication;
|
||||
|
||||
public EmployerController(IEmployerApplication employerApplication)
|
||||
{
|
||||
_employerApplication = employerApplication;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// لیست کارفرما
|
||||
/// </summary>
|
||||
/// <param name="searchModel"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet]
|
||||
public async Task<ActionResult<List<GetEmployerListViewModel>>> GetList(GetEmployerSearchModel searchModel)
|
||||
{
|
||||
return await _employerApplication.GetEmployerList(searchModel);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// جزئیات کارفرمای حقوقی
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("legal/{id}")]
|
||||
public async Task<ActionResult<GetLegalEmployerDetailViewModel>> GetLegalEmployer(long id)
|
||||
{
|
||||
var employerDetail = await _employerApplication.GetLegalEmployerDetail(id);
|
||||
return employerDetail;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// جزئیات کارفرمای حقیقی
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("real/{id}")]
|
||||
public async Task<ActionResult<GetRealEmployerDetailViewModel>> GetRealEmployer(long id)
|
||||
{
|
||||
var employerDetail = await _employerApplication.GetRealEmployerDetail(id);
|
||||
return employerDetail;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// ایجاد کارفرمای حقیقی
|
||||
/// </summary>
|
||||
/// <param name="command"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost("real")]
|
||||
public async Task<ActionResult<OperationResult>> CreateRealEmployer([FromBody] CreateRealEmployer command)
|
||||
{
|
||||
var result = await _employerApplication.CreateReal(command);
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// ایجاد کارفرما حقوقی
|
||||
/// </summary>
|
||||
/// <param name="command"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost("legal")]
|
||||
public async Task<ActionResult<OperationResult>> CreateLegalEmployer([FromBody] CreateLegalEmployer command)
|
||||
{
|
||||
var result = await _employerApplication.CreateLegal(command);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// ویرایش کارفرما حقیقی
|
||||
/// </summary>
|
||||
/// <param name="command"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPut("real")]
|
||||
public async Task<ActionResult<OperationResult>> EditRealEmployer([FromBody] EditRealEmployer command)
|
||||
{
|
||||
var result = await _employerApplication.EditReal(command);
|
||||
return result;
|
||||
}
|
||||
/// <summary>
|
||||
/// ویرایش کارفرما حقوقی
|
||||
/// </summary>
|
||||
/// <param name="command"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPut("legal")]
|
||||
public async Task<ActionResult<OperationResult>> EditLegalEmployer([FromBody] EditLegalEmployer command)
|
||||
{
|
||||
var result = await _employerApplication.EditLegal(command);
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// حذف کارفرما - درصورت داشتن کارگاه، کارفرما غیرفعال میشود
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
[HttpDelete("{id}")]
|
||||
public async Task<ActionResult<OperationResult<string>>> Remove(long id)
|
||||
{
|
||||
var result = await _employerApplication.RemoveApi(id);
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// سلکت لیست کارفرما برای جستجو
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpGet("select_list")]
|
||||
public async Task<List<EmployerSelectListViewModel>> GetSelectList(string search)
|
||||
{
|
||||
return await _employerApplication.GetSelectList(search);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,606 +0,0 @@
|
||||
@using _0_Framework.Application
|
||||
@model CompanyManagment.App.Contracts.Checkout.CheckoutViewModel
|
||||
|
||||
|
||||
|
||||
<div class="container container2" id="printThis">
|
||||
<div class="row">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<fieldset style="border: 1px solid black;
|
||||
padding: revert;
|
||||
border-radius: 10px;
|
||||
height: 28cm;
|
||||
margin: 3mm 5mm 0 5mm; ">
|
||||
<div class="row" dir="rtl">
|
||||
<div class="col-xs-3 d-inline-block"><fieldset style="border: 1px solid black; border-radius: 15px; padding: 1px 15px 1px 15px; margin-top: 5px; width: 60%; font-size: 12px; text-align: center;"> @Model.ContractNo</fieldset></div>
|
||||
<div class="col-xs-6 d-inline-block text-center">
|
||||
<p style="margin-top:10px !important;font-size: 18px; font-family: 'IranNastaliq' !important; ">بسمه تعالی</p>
|
||||
<p style="font-size: 15px; font-weight: bold">فیش حقوقی و رسید پرداخت حقوق</p>
|
||||
</div>
|
||||
<div class="col-xs-3 d-inline-block"></div>
|
||||
</div>
|
||||
<div class="row" style="padding: 0px 12px;font-size: 14px; margin-bottom: 10px; ">
|
||||
<div class="row">
|
||||
<span style="width: 280px;padding: 0px 10px 0px 0px !important; float:right"><span>اینجانب <span> </span> <span style="font-weight: bold; background-color: #ebe6e6 !important; -webkit-print-color-adjust: exact;print-color-adjust: exact;">@Model.EmployeeFullName</span> </span></span>
|
||||
<span style="margin-right: 5px; float:right">
|
||||
<span> نام پدر: </span>
|
||||
@if (string.IsNullOrWhiteSpace(@Model.FathersName))
|
||||
{
|
||||
<span style="visibility: hidden">"1111111111"</span>
|
||||
}
|
||||
else
|
||||
{
|
||||
<span style="font-weight: bold; background-color: #ebe6e6 !important; -webkit-print-color-adjust: exact;print-color-adjust: exact;">@Model.FathersName</span>
|
||||
|
||||
}
|
||||
</span>
|
||||
<span style="padding: 0px !important; float: left">
|
||||
|
||||
<span>به کد ملی:</span> <span> </span>
|
||||
@if (string.IsNullOrWhiteSpace(@Model.NationalCode))
|
||||
{
|
||||
<span style="margin-left: 15px; visibility: hidden">222333111</span>
|
||||
}
|
||||
else
|
||||
{
|
||||
<span style="margin-left: 15px; font-weight: bold; background-color: #ebe6e6 !important; -webkit-print-color-adjust: exact;print-color-adjust: exact;">@Model.NationalCode</span>
|
||||
}
|
||||
|
||||
<span>متولد:</span> <span> </span>
|
||||
@if (string.IsNullOrWhiteSpace(@Model.DateOfBirth))
|
||||
{
|
||||
<span style="margin-left: 10px; visibility: hidden">1401/01/01</span>
|
||||
}
|
||||
else
|
||||
{
|
||||
<span style="margin-left: 10px; font-weight: bold; background-color: #ebe6e6 !important; -webkit-print-color-adjust: exact;print-color-adjust: exact;">@Model.DateOfBirth</span>
|
||||
}
|
||||
</span>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-xs-12" style="font-size: 14px; text-align: justify">
|
||||
|
||||
@{
|
||||
if (@Model.EmployerList.FirstOrDefault().IsLegal == "حقیقی")
|
||||
{
|
||||
<span> پـرسنل کارگاه<span> </span><span> </span><span style="font-weight: bold; background-color: #ebe6e6 !important; -webkit-print-color-adjust: exact;print-color-adjust: exact;">@Model.WorkshopName</span> </span>
|
||||
<span> </span>
|
||||
<span>به کارفرمایی <span> </span> آقای/خانم</span>
|
||||
<span> </span>
|
||||
<span> </span>
|
||||
if (@Model.EmployerList.Count > 1)
|
||||
{
|
||||
<span style="font-weight: bold; background-color: #ebe6e6 !important; -webkit-print-color-adjust: exact;print-color-adjust: exact;">
|
||||
@Model.EmployerList[0].EmployerFullName <span>،</span>
|
||||
<span> </span>@Model.EmployerList[1].EmployerFullName
|
||||
@if (@Model.EmployerList.Count > 2)
|
||||
{
|
||||
<span>و غیره</span>
|
||||
}
|
||||
</span>
|
||||
<br />
|
||||
}
|
||||
else
|
||||
{
|
||||
<span style="font-weight: bold; background-color: #ebe6e6 !important; -webkit-print-color-adjust: exact;print-color-adjust: exact;">
|
||||
@Model.EmployerList.FirstOrDefault().EmployerFullName
|
||||
</span>
|
||||
<br />
|
||||
}
|
||||
|
||||
}
|
||||
else if (@Model.EmployerList.FirstOrDefault().IsLegal == "حقوقی")
|
||||
{
|
||||
<span> پـرسنل شرکت/موسسه<span> </span><span> </span><span style="font-weight: bold; background-color: #ebe6e6 !important; -webkit-print-color-adjust: exact;print-color-adjust: exact;">@Model.WorkshopName</span> </span>
|
||||
<br />
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
<span>کلیه حق السعی خود اعم از حقوق، کمک هزینه اقلام مصرفی خانوار، کمک هزینه مسکن </span>
|
||||
|
||||
<span>و همچنین عیدی و پاداش، سنوات و...</span>
|
||||
<span style="background-color: #ebe6e6 !important; -webkit-print-color-adjust: exact;print-color-adjust: exact;"> <span style="font-weight: bold">@Model.Month</span> ماه </span>
|
||||
<span style="background-color: #ebe6e6 !important; -webkit-print-color-adjust: exact;print-color-adjust: exact;"> سال <span style="font-weight: bold">@Model.Year</span> </span>
|
||||
<span> برابر با قرارداد به شماره فوق را از کارفرما بصورت وجه نقد و واریز به حساب دریافت نموده ام. </span>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="row m-t-20">
|
||||
<fieldset style="border: 1px solid black !important;-webkit-print-color-adjust: exact;print-color-adjust: exact; border-radius: 10px 10px 10px 10px; margin: 0px 10px;overflow:hidden">
|
||||
<table style="/* table-layout: fixed; */ width: 100%">
|
||||
|
||||
|
||||
<tr style="border-bottom: 1px solid; height: 25px; border-collapse: separate; background-color: #cdcdcd !important; -webkit-print-color-adjust: exact;print-color-adjust: exact; ">
|
||||
<th style="text-align: center; width: 8mm; font-size: 12px; padding: 2px; border-collapse: separate; border-radius: 0px 10px 0px 0px;"> </th>
|
||||
<th style="text-align: center; position: absolute ; right: 55mm; font-size: 13px;padding-top:4px"> مطالبات </th>
|
||||
<th style="text-align: center;"> </th>
|
||||
<th style="text-align: center; border-left: 2px solid #000; font-size: 12px"> </th>
|
||||
<th style="text-align: center; font-size: 13px; position: absolute; left: 50mm; padding-top: 4px;"> کسورات </th>
|
||||
<th style="text-align: center; font-size: 12px; border-collapse: separate; border-radius: 0px 0px 0px 0px;"> </th>
|
||||
<th style="text-align: center; font-size: 12px; border-collapse: separate; border-radius: 10px 0px 0px 0px;"> </th>
|
||||
</tr>
|
||||
|
||||
<tr style="border-bottom: 1px solid; background-color: #e1e1e1 !important ;-webkit-print-color-adjust: exact;print-color-adjust: exact; ">
|
||||
<th style="width: 5%; text-align: center; border-left: 1px solid #000; font-size: 12px;padding: 2px"> ردیف </th>
|
||||
<th style="width: 23%; text-align: center; border-left: 1px solid #000; font-size: 12px"> شرح </th>
|
||||
<th style="width: 10%; text-align: center; border-left: 1px solid #000; font-size: 9px"> ساعت/روز/تعداد </th>
|
||||
<th style="width: 12%; text-align: center; border-left: 2px solid #000; font-size: 12px"> مبلغ(ریال) </th>
|
||||
<th style="width: 28%; text-align: center; border-left: 1px solid #000; font-size: 12px"> شرح </th>
|
||||
<th style="width: 10%; text-align: center; border-left: 1px solid #000; font-size: 9px"> ساعت/روز/تعداد </th>
|
||||
<th style="width: 12%; text-align: center; font-size: 12px"> مبلغ(ریال) </th>
|
||||
</tr>
|
||||
|
||||
|
||||
<tr style="font-size: 12px; ">
|
||||
<td style="text-align: center; border-left: 1px solid #000; padding: 2px ">1</td>
|
||||
<td style="padding-right: 8px; border-left: 1px solid #000;"> حقوق و مزد </td>
|
||||
<td style="text-align: center; border-left: 1px solid #000;"> @Model.SumOfWorkingDays </td>
|
||||
<td style="text-align: center; border-left: 2px solid #000;"> @(Model.MonthlySalary == "0" ? "-" : Model.MonthlySalary) </td>
|
||||
<td style="padding-right: 8px; border-left: 1px solid #000;"> حق بیمه سهم کارگر </td>
|
||||
<td style="text-align: center; border-left: 1px solid #000;"> - </td>
|
||||
<td style="text-align: center;"> @(Model.InsuranceDeduction == "0" ? "-" : Model.InsuranceDeduction) </td>
|
||||
</tr>
|
||||
|
||||
<tr style="font-size: 12px; background-color: #f1f1f1 !important; -webkit-print-color-adjust: exact;print-color-adjust: exact; ">
|
||||
<td style="text-align: center; border-left: 1px solid #000; padding: 2px ">2</td>
|
||||
<td style="padding-right: 8px; border-left: 1px solid #000;"> پایه سنوات </td>
|
||||
<td style="text-align: center; border-left: 1px solid #000;"> @(Model.BaseYearsPay == "0" ? "-" : Model.SumOfWorkingDays) </td>
|
||||
<td style="text-align: center; border-left: 2px solid #000;"> @(Model.BaseYearsPay == "0" ? "-" : Model.BaseYearsPay) </td>
|
||||
<td style="padding-right: 8px; border-left: 1px solid #000;"> مالیات بر حقوق </td>
|
||||
<td style="text-align: center; border-left: 1px solid #000;"> - </td>
|
||||
<td style="text-align: center;"> @(Model.TaxDeducation == "0" ? "-" : Model.TaxDeducation) </td>
|
||||
</tr>
|
||||
|
||||
<tr style="font-size: 12px;">
|
||||
<td style="text-align: center; border-left: 1px solid #000; padding: 2px ">3</td>
|
||||
<td style="padding-right: 8px; border-left: 1px solid #000;"> کمک هزینه اقلام مصرفی خانوار </td>
|
||||
<td style="text-align: center; border-left: 1px solid #000;"> @(Model.ConsumableItems == "0" ? "-" : Model.SumOfWorkingDays) </td>
|
||||
<td style="text-align: center; border-left: 2px solid #000;"> @(Model.ConsumableItems == "0" ? "-" : Model.ConsumableItems) </td>
|
||||
<td style="padding-right: 8px; border-left: 1px solid #000;"> قسط تسهیلات </td>
|
||||
<td style="text-align: center; border-left: 1px solid #000;"> - </td>
|
||||
<td style="text-align: center;"> @(Model.InstallmentDeduction == "0" ? "-" : Model.InstallmentDeduction) </td>
|
||||
</tr>
|
||||
|
||||
<tr style="font-size: 12px; background-color: #f1f1f1 !important; -webkit-print-color-adjust: exact;print-color-adjust: exact; ">
|
||||
<td style="text-align: center; border-left: 1px solid #000; padding: 2px ">4</td>
|
||||
<td style="padding-right: 8px; border-left: 1px solid #000;"> کمک هزینه مسکن </td>
|
||||
<td style="text-align: center; border-left: 1px solid #000;"> @(Model.HousingAllowance == "0" ? "-" : Model.SumOfWorkingDays) </td>
|
||||
<td style="text-align: center; border-left: 2px solid #000;"> @(Model.HousingAllowance == "0" ? "-" : Model.HousingAllowance) </td>
|
||||
<td style="padding-right: 8px; border-left: 1px solid #000;"> مساعده </td>
|
||||
<td style="text-align: center; border-left: 1px solid #000;"> - </td>
|
||||
<td style="text-align: center;"> @(Model.SalaryAidDeduction == "0" ? "-" : Model.SalaryAidDeduction) </td>
|
||||
</tr>
|
||||
<tr style="font-size: 12px;">
|
||||
<td style="text-align: center; border-left: 1px solid #000; padding: 2px ">5</td>
|
||||
<td style="padding-right: 8px; border-left: 1px solid #000;"> فوق العاده اضافه کاری </td>
|
||||
<td style="text-align: center; border-left: 1px solid #000;"> @((Model.OverTimeWorkValue == "00:00" || string.IsNullOrWhiteSpace(Model.OverTimeWorkValue)) ? "-" : Model.OverTimeWorkValue) </td>
|
||||
<td style="text-align: center; border-left: 2px solid #000;"> @((Model.OvertimePay == "0" || string.IsNullOrWhiteSpace(Model.OvertimePay)) ? "-" : Model.OvertimePay) </td>
|
||||
<td style="padding-right: 8px; border-left: 1px solid #000;"> غیبت </td>
|
||||
<td style="text-align: center; border-left: 1px solid #000;"> - </td>
|
||||
<td style="text-align: center;"> @(Model.AbsenceDeduction == "0" ? "-" : Model.AbsenceDeduction) </td>
|
||||
</tr>
|
||||
<tr style="font-size: 12px; background-color: #f1f1f1 !important; -webkit-print-color-adjust: exact;print-color-adjust: exact; ">
|
||||
<td style="text-align: center; border-left: 1px solid #000; padding: 2px ">6</td>
|
||||
<td style="padding-right: 8px; border-left: 1px solid #000;"> فوق العاده شب کاری </td>
|
||||
<td style="text-align: center; border-left: 1px solid #000;"> @((Model.OverNightWorkValue == "00:00" || string.IsNullOrWhiteSpace(Model.OverNightWorkValue)) ? "-" : Model.OverNightWorkValue) </td>
|
||||
<td style="text-align: center; border-left: 2px solid #000;"> @((Model.NightworkPay == "0" || string.IsNullOrWhiteSpace(Model.NightworkPay)) ? "-" : Model.NightworkPay) </td>
|
||||
<td style="padding-right: 8px; border-left: 1px solid #000;"> </td>
|
||||
<td style="text-align: center; border-left: 1px solid #000;"> </td>
|
||||
<td style="text-align: center;"> </td>
|
||||
</tr>
|
||||
<tr style="font-size: 12px;">
|
||||
<td style="text-align: center; border-left: 1px solid #000; padding: 2px ">7</td>
|
||||
<td style="padding-right: 8px; border-left: 1px solid #000;"> فوق العاده جمعه کاری </td>
|
||||
<td style="text-align: center; border-left: 1px solid #000;"> @((Model.FridayWorkValue == "0" || string.IsNullOrWhiteSpace(Model.FridayWorkValue)) ? "-" : Model.FridayWorkValue) </td>
|
||||
<td style="text-align: center; border-left: 2px solid #000;"> @((Model.FridayPay == "0" || string.IsNullOrWhiteSpace(Model.FridayPay)) ? "-" : Model.FridayPay) </td>
|
||||
<td style="padding-right: 8px; border-left: 1px solid #000;"> </td>
|
||||
<td style="text-align: center; border-left: 1px solid #000;"> </td>
|
||||
<td style="text-align: center;"> </td>
|
||||
</tr>
|
||||
<tr style="font-size: 12px; background-color: #f1f1f1 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact;">
|
||||
<td style="text-align: center; border-left: 1px solid #000; padding: 2px ">8</td>
|
||||
<td style="padding-right: 8px; border-left: 1px solid #000;"> فوق العاده ماموریت </td>
|
||||
<td style="text-align: center; border-left: 1px solid #000;"> - </td>
|
||||
<td style="text-align: center; border-left: 2px solid #000;"> @(Model.MissionPay == "0" ? "-" : Model.MissionPay) </td>
|
||||
<td style="padding-right: 8px; border-left: 1px solid #000;"> </td>
|
||||
<td style="text-align: center; border-left: 1px solid #000;"> </td>
|
||||
<td style="text-align: center;"> </td>
|
||||
</tr>
|
||||
<tr style="font-size: 12px;">
|
||||
<td style="text-align: center; border-left: 1px solid #000; padding: 2px ">9</td>
|
||||
<td style="padding-right: 8px; border-left: 1px solid #000;"> فوق العاده نوبت کاری </td>
|
||||
<td style="text-align: center; border-left: 1px solid #000;"> @((Model.RotatingShiftValue == "0" || string.IsNullOrWhiteSpace(Model.RotatingShiftValue)) ? "-" : "%" + Model.RotatingShiftValue) </td>
|
||||
<td style="text-align: center; border-left: 2px solid #000;"> @(Model.ShiftPay == "0" ? "-" : Model.ShiftPay) </td>
|
||||
<td style="padding-right: 8px; border-left: 1px solid #000;"> </td>
|
||||
<td style="text-align: center; border-left: 1px solid #000;"> </td>
|
||||
<td style="text-align: center;"> </td>
|
||||
</tr>
|
||||
<tr style="font-size: 12px; background-color: #f1f1f1 !important; -webkit-print-color-adjust: exact;print-color-adjust: exact; ">
|
||||
<td style="text-align: center; border-left: 1px solid #000; padding: 2px ">10</td>
|
||||
<td style="padding-right: 8px; border-left: 1px solid #000;"> کمک هزینه عائله مندی </td>
|
||||
<td style="text-align: center; border-left: 1px solid #000;"> - </td>
|
||||
<td style="text-align: center; border-left: 2px solid #000;"> @(Model.FamilyAllowance == "0" ? "-" : Model.FamilyAllowance) </td>
|
||||
<td style="padding-right: 8px; border-left: 1px solid #000;"> </td>
|
||||
<td style="text-align: center; border-left: 1px solid #000;"> </td>
|
||||
<td style="text-align: center;"> </td>
|
||||
</tr>
|
||||
<tr style="font-size: 12px;">
|
||||
<td style="text-align: center; border-left: 1px solid #000; padding: 2px ">11</td>
|
||||
<td style="padding-right: 8px; border-left: 1px solid #000;"> حق تاهل </td>
|
||||
<td style="text-align: center; border-left: 1px solid #000;"> @Model.MaritalStatus </td>
|
||||
<td style="text-align: center; border-left: 2px solid #000;"> @(Model.MarriedAllowance == "0" ? "-" : Model.MarriedAllowance) </td>
|
||||
<td style="padding-right: 8px; border-left: 1px solid #000;"> </td>
|
||||
<td style="text-align: center; border-left: 1px solid #000;"> </td>
|
||||
<td style="text-align: center;"> </td>
|
||||
</tr>
|
||||
<tr style="font-size: 12px; background-color: #f1f1f1 !important; -webkit-print-color-adjust: exact;print-color-adjust: exact; ">
|
||||
<td style="text-align: center; border-left: 1px solid #000; padding: 2px ">12</td>
|
||||
<td style="padding-right: 8px; border-left: 1px solid #000;"> پاداش </td>
|
||||
<td style="text-align: center; border-left: 1px solid #000;"> - </td>
|
||||
<td style="text-align: center; border-left: 2px solid #000;"> @(Model.RewardPay == "0" ? "-" : Model.RewardPay) </td>
|
||||
<td style="padding-right: 8px; border-left: 1px solid #000;"> </td>
|
||||
<td style="text-align: center; border-left: 1px solid #000;"> </td>
|
||||
<td style="text-align: center;"> </td>
|
||||
</tr>
|
||||
<tr style="font-size: 12px;">
|
||||
<td style="text-align: center; border-left: 1px solid #000; padding: 2px ">13</td>
|
||||
<td style="padding-right: 8px; border-left: 1px solid #000;"> عیدی و پاداش </td>
|
||||
<td style="text-align: center; border-left: 1px solid #000;"> @(Model.BonusesPay == "0" ? "-" : Model.SumOfWorkingDays) </td>
|
||||
<td style="text-align: center; border-left: 2px solid #000;"> @(Model.BonusesPay == "0" ? "-" : Model.BonusesPay) </td>
|
||||
<td style="padding-right: 8px; border-left: 1px solid #000;"> </td>
|
||||
<td style="text-align: center; border-left: 1px solid #000;"> </td>
|
||||
<td style="text-align: center;"> </td>
|
||||
</tr>
|
||||
<tr style="font-size: 12px; background-color: #f1f1f1 !important; -webkit-print-color-adjust: exact;print-color-adjust: exact; ">
|
||||
<td style="text-align: center; border-left: 1px solid #000; padding: 2px ">14</td>
|
||||
<td style="padding-right: 8px; border-left: 1px solid #000;"> سنوات </td>
|
||||
<td style="text-align: center; border-left: 1px solid #000;"> @(Model.YearsPay == "0" ? "-" : Model.SumOfWorkingDays) </td>
|
||||
<td style="text-align: center; border-left: 2px solid #000;"> @(Model.YearsPay == "0" ? "-" : Model.YearsPay) </td>
|
||||
<td style="padding-right: 8px; border-left: 1px solid #000;"> </td>
|
||||
<td style="text-align: center; border-left: 1px solid #000;"> </td>
|
||||
<td style="text-align: center;"> </td>
|
||||
</tr>
|
||||
<tr style="font-size: 12px;">
|
||||
<td style="text-align: center; border-left: 1px solid #000; padding: 2px ">15</td>
|
||||
<td style="padding-right: 8px; border-left: 1px solid #000;"> مزد مرخصی </td>
|
||||
<td style="text-align: center; border-left: 1px solid #000;"> @(Model.LeavePay == "0" ? "-" : Model.SumOfWorkingDays) </td>
|
||||
<td style="text-align: center; border-left: 2px solid #000;"> @(Model.LeavePay == "0" ? "-" : Model.LeavePay) </td>
|
||||
<td style="padding-right: 8px; border-left: 1px solid #000;"> </td>
|
||||
<td style="text-align: center; border-left: 1px solid #000;"> </td>
|
||||
<td style="text-align: center;"> </td>
|
||||
</tr>
|
||||
<tr style="font-size: 12px; height: 20px; background-color: #dddcdc !important; -webkit-print-color-adjust: exact;print-color-adjust: exact; border-bottom: 1px solid #000; border-top: 1px solid #000; ">
|
||||
<td style="text-align: center; padding: 2px "></td>
|
||||
<td style="padding-right: 8px; border-left: 1px solid #000;"> جمع مطالبات </td>
|
||||
<td style="text-align: center; border-left: 1px solid #000;"> - </td>
|
||||
<td style="text-align: center; border-left: 2px solid #000;"> @(Model.TotalClaims == "0" ? "-" : Model.TotalClaims) </td>
|
||||
<td style="padding-right: 8px; border-left: 1px solid #000;"> جمع کسورات </td>
|
||||
<td style="text-align: center; border-left: 1px solid #000;"> - </td>
|
||||
<td style="text-align: center;"> @(Model.TotalDeductions == "0" ? "-" : Model.TotalDeductions) </td>
|
||||
</tr>
|
||||
<tr style="font-size: 12px; border-radius: 0px 0px 10px 10px !important; height: 20px; background-color: #efefef !important; -webkit-print-color-adjust: exact;print-color-adjust: exact; ">
|
||||
<td style="text-align: center; padding: 2px; border-radius: 0px 0px 10px 0px "></td>
|
||||
<td style="padding-right: 8px; border-left: 1px solid #000; "> مبلغ قابل پرداخت </td>
|
||||
<td style="padding-right: 8px; border-left: 1px solid #000;"> </td>
|
||||
<td style="text-align: center; border-left: 2px solid #000;"> @(Model.TotalPayment == "0" ? "-" : Model.TotalPayment) </td>
|
||||
<td style="padding-right: 8px;"> </td>
|
||||
<td style="text-align: center; border-left: 1px solid #000;"> </td>
|
||||
<td style="text-align: center; border-radius:0px 0px 0px 10px"> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</fieldset>
|
||||
</div>
|
||||
|
||||
<div style="">
|
||||
<div class="" style="margin-top: 8px;background-color: #F6F6F6 !important;border: 1px solid #000;border-radius: 10px;display: grid;gap: 8px;padding: 8px 0;-webkit-print-color-adjust: exact;print-color-adjust: exact;padding: 6px;grid-template-columns: repeat(2, minmax(0, 1fr));width: 100%;">
|
||||
<div class="" style="background-color: #DDDCDC !important; border: 1px solid #CCCCCC;border-radius: 7px;padding: 7px; -webkit-print-color-adjust: exact;print-color-adjust: exact; ">
|
||||
<table style="width: 100%">
|
||||
<thead style="background-color: #AFAFAF;-webkit-print-color-adjust: exact;print-color-adjust: exact; ">
|
||||
<tr style="font-size: 8px;border-collapse: separate;background-color: #AFAFAF !important;-webkit-print-color-adjust: exact;print-color-adjust: exact;">
|
||||
<th style="font-size: 8px !important;width: 28%;padding: 2px 10px !important;border-left: 0;border-radius: 0 5px 5px 0 !important;-webkit-print-color-adjust: exact;print-color-adjust: exact;">تاریخ</th>
|
||||
<th style="font-size: 8px;text-align: center;width: 9%;-webkit-print-color-adjust: exact;print-color-adjust: exact;">ورود</th>
|
||||
<th style="font-size: 8px;text-align: center;width: 9%;-webkit-print-color-adjust: exact;print-color-adjust: exact;">خروج</th>
|
||||
<th style="font-size: 8px;text-align: center;width: 9%;-webkit-print-color-adjust: exact;print-color-adjust: exact;">ورود</th>
|
||||
<th style="font-size: 8px;text-align: center;width: 9%;-webkit-print-color-adjust: exact;print-color-adjust: exact;">خروج</th>
|
||||
<th style="font-size: 8px;text-align: center;width: 11%;-webkit-print-color-adjust: exact;print-color-adjust: exact;">استراحت</th>
|
||||
<th style="font-size: 8px;text-align: center;width: 10%;-webkit-print-color-adjust: exact;print-color-adjust: exact;">منقطع</th>
|
||||
<th style="font-size: 8px;text-align: center;width: 15%;padding: 0 0 0 0px !important;border-radius: 5px 0 0 5px !important; -webkit-print-color-adjust: exact;print-color-adjust: exact;">ساعت کارکرد</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@for (int i = 0; i < 15; i++)
|
||||
{
|
||||
<tr style="@((@Model.MonthlyRollCall[i].IsHoliday || @Model.MonthlyRollCall[i].IsFriday) ? "background-color: #BBBBBB !important;" : "background-color: #FFFFFF !important;") font-size: 8px;border-collapse: separate;-webkit-print-color-adjust: exact;print-color-adjust: exact;">
|
||||
<td style="font-size: 8px; padding: 1px 3px;border-width: 2px 0 2px 2px;border-color: #DDDCDC;border-style: solid; border-radius: 0 5px 5px 0; -webkit-print-color-adjust: exact;print-color-adjust: exact; ">@Model.MonthlyRollCall[i].DateTimeGr.ToFarsi() - @Model.MonthlyRollCall[i].DateTimeGr.DayOfWeek.DayOfWeeKToPersian()</td>
|
||||
|
||||
|
||||
@if (@Model.MonthlyRollCall[i].IsAbsent)
|
||||
{
|
||||
<td colspan="2" style="font-size: 8px; text-align: center; border-width: 2px 0 2px 2px; border-color: #DDDCDC; border-style: solid; -webkit-print-color-adjust: exact; print-color-adjust: exact;">
|
||||
<div style="display: flex;justify-content: center;">
|
||||
<span style="width: 40px;display: block;border-radius: 50px;background-color: #737373;color: #fff;">غیبت</span>
|
||||
</div>
|
||||
</td>
|
||||
<td colspan="2" style="font-size: 8px; text-align: center; border-width: 2px 0 2px 2px; border-color: #DDDCDC; border-style: solid; -webkit-print-color-adjust: exact; print-color-adjust: exact;">
|
||||
<div style="display: flex;justify-content: center;">
|
||||
@* <span style="width: 40px;display: block;border-radius: 50px;background-color: #737373;color: #fff;">غیبت</span> *@
|
||||
</div>
|
||||
</td>
|
||||
}
|
||||
else
|
||||
{
|
||||
@if (string.IsNullOrWhiteSpace(Model.MonthlyRollCall[i].LeaveType))
|
||||
{
|
||||
<td style="font-size: 8px; text-align: center;border-width: 2px 0 2px 0;border-color: #DDDCDC;border-style: solid;-webkit-print-color-adjust: exact;print-color-adjust: exact; ">@Model.MonthlyRollCall[i].StartDate1</td>
|
||||
<td style="font-size: 8px; text-align: center;border-width: 2px 0 2px 2px;border-color: #DDDCDC;border-style: solid;-webkit-print-color-adjust: exact;print-color-adjust: exact; ">@Model.MonthlyRollCall[i].EndDate1</td>
|
||||
<td style="font-size: 8px; text-align: center;border-width: 2px 0 2px 0;border-color: #DDDCDC;border-style: solid;-webkit-print-color-adjust: exact;print-color-adjust: exact; ">@Model.MonthlyRollCall[i].StartDate2</td>
|
||||
<td style="font-size: 8px; text-align: center;border-width: 2px 0 2px 2px;border-color: #DDDCDC;border-style: solid;-webkit-print-color-adjust: exact;print-color-adjust: exact; ">@Model.MonthlyRollCall[i].EndDate2</td>
|
||||
}
|
||||
else
|
||||
{
|
||||
<td colspan="2" style="font-size: 8px; text-align: center; border-width: 2px 0 2px 2px; border-color: #DDDCDC; border-style: solid; -webkit-print-color-adjust: exact; print-color-adjust: exact;">
|
||||
<div style="display: flex;justify-content: center;">
|
||||
<span style="width: 41px; display: block; border-radius: 50px; background-color: #fff; color: #737373;border: 1px solid #737373;">
|
||||
@Model.MonthlyRollCall[i].LeaveType
|
||||
</span>
|
||||
</div>
|
||||
</td>
|
||||
<td colspan="2" style="font-size: 8px; text-align: center; border-width: 2px 0 2px 2px; border-color: #DDDCDC; border-style: solid; -webkit-print-color-adjust: exact; print-color-adjust: exact;">
|
||||
<div style="display: flex;justify-content: center;">
|
||||
@* <span style="width: 40px; display: block; border-radius: 50px; background-color: #fff; color: #737373;border: 1px solid #737373;">
|
||||
@Model.MonthlyRollCall[i].LeaveType
|
||||
</span> *@
|
||||
</div>
|
||||
</td>
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
<td style="font-size: 8px; text-align: center;border-width: 2px 0 2px 2px;border-color: #DDDCDC;border-style: solid;-webkit-print-color-adjust: exact;print-color-adjust: exact; ">@Model.MonthlyRollCall[i].BreakTimeString</td>
|
||||
<td style="font-size: 8px; text-align: center; border-width: 2px 0 2px 2px; border-color: #DDDCDC; border-style: solid;vertical-align: center;-webkit-print-color-adjust: exact;print-color-adjust: exact; ">
|
||||
@if (@Model.MonthlyRollCall[i].IsSliced)
|
||||
{
|
||||
<svg width="12" height="12" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" style="display: block; margin: auto;">
|
||||
<circle stroke-width="2" cx="12" cy="12" r="9" stroke="#222222" />
|
||||
<path stroke-width="2" d="M8 12L11 15L16 9" stroke="#222222" stroke-linecap="round" />
|
||||
</svg>
|
||||
}
|
||||
else
|
||||
{
|
||||
<span>-</span>
|
||||
}
|
||||
</td>
|
||||
<td style="font-size: 8px;text-align: center;border-width: 2px 0 2px 0;border-color: #DDDCDC;border-style: solid;-webkit-print-color-adjust: exact;print-color-adjust: exact;border-radius: 5px 0 0 5px;">@Model.MonthlyRollCall[i].TotalWorkingHours</td>
|
||||
</tr>
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="" style="background-color: #DDDCDC !important; border: 1px solid #CCCCCC;border-radius: 7px;padding: 7px; -webkit-print-color-adjust: exact;print-color-adjust: exact; ">
|
||||
<table style="width: 100%">
|
||||
<thead style="background-color: #AFAFAF;-webkit-print-color-adjust: exact;print-color-adjust: exact; ">
|
||||
<tr style="font-size: 8px;border-collapse: separate;background-color: #AFAFAF !important;-webkit-print-color-adjust: exact;print-color-adjust: exact;">
|
||||
<th style="font-size: 8px !important;width: 28%;padding: 2px 10px !important;border-left: 0;border-radius: 0 5px 5px 0 !important;-webkit-print-color-adjust: exact;print-color-adjust: exact;">تاریخ</th>
|
||||
<th style="font-size: 8px;text-align: center;width: 9%;-webkit-print-color-adjust: exact;print-color-adjust: exact;">ورود</th>
|
||||
<th style="font-size: 8px;text-align: center;width: 9%;-webkit-print-color-adjust: exact;print-color-adjust: exact;">خروج</th>
|
||||
<th style="font-size: 8px;text-align: center;width: 9%;-webkit-print-color-adjust: exact;print-color-adjust: exact;">ورود</th>
|
||||
<th style="font-size: 8px;text-align: center;width: 9%;-webkit-print-color-adjust: exact;print-color-adjust: exact;">خروج</th>
|
||||
<th style="font-size: 8px;text-align: center;width: 11%;-webkit-print-color-adjust: exact;print-color-adjust: exact;">استراحت</th>
|
||||
<th style="font-size: 8px;text-align: center;width: 10%;-webkit-print-color-adjust: exact;print-color-adjust: exact;">منقطع</th>
|
||||
<th style="font-size: 8px;text-align: center;width: 15%;padding: 0 0 0 0px !important;border-radius: 5px 0 0 5px !important; -webkit-print-color-adjust: exact;print-color-adjust: exact;">ساعت کارکرد</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@{
|
||||
Model.MonthlyRollCall = Model.MonthlyRollCall.Skip(15).ToList();
|
||||
}
|
||||
@foreach (var day in Model.MonthlyRollCall)
|
||||
{
|
||||
<tr style="@((day.IsHoliday || day.IsFriday) ? "background-color: #BBBBBB !important;" : "background-color: #FFFFFF !important;") font-size: 8px;border-collapse: separate;-webkit-print-color-adjust: exact;print-color-adjust: exact;">
|
||||
<td style="font-size: 8px; padding: 1px 3px;border-width: 2px 0 2px 2px;border-color: #DDDCDC;border-style: solid; border-radius: 0 5px 5px 0; -webkit-print-color-adjust: exact;print-color-adjust: exact; ">@day.DateTimeGr.ToFarsi() - @day.DateTimeGr.DayOfWeek.DayOfWeeKToPersian()</td>
|
||||
|
||||
|
||||
@if (day.IsAbsent)
|
||||
{
|
||||
<td colspan="2" style="font-size: 8px; text-align: center; border-width: 2px 0 2px 2px; border-color: #DDDCDC; border-style: solid; -webkit-print-color-adjust: exact; print-color-adjust: exact;">
|
||||
<div style="display: flex;justify-content: center;">
|
||||
<span style="width: 38px;display: block;border-radius: 50px;background-color: #737373;color: #fff;">غیبت</span>
|
||||
</div>
|
||||
</td>
|
||||
<td colspan="2" style="font-size: 8px; text-align: center; border-width: 2px 0 2px 2px; border-color: #DDDCDC; border-style: solid; -webkit-print-color-adjust: exact; print-color-adjust: exact;">
|
||||
<div style="display: flex;justify-content: center;">
|
||||
@* <span style="width: 40px;display: block;border-radius: 50px;background-color: #737373;color: #fff;">غیبت</span> *@
|
||||
</div>
|
||||
</td>
|
||||
}
|
||||
else
|
||||
{
|
||||
@if (string.IsNullOrWhiteSpace(day.LeaveType))
|
||||
{
|
||||
<td style="font-size: 8px !important; text-align: center;border-width: 2px 0 2px 0;border-color: #DDDCDC;border-style: solid;-webkit-print-color-adjust: exact;print-color-adjust: exact; ">@day.StartDate1</td>
|
||||
<td style="font-size: 8px !important; text-align: center;border-width: 2px 0 2px 2px;border-color: #DDDCDC;border-style: solid;-webkit-print-color-adjust: exact;print-color-adjust: exact; ">@day.EndDate1</td>
|
||||
<td style="font-size: 8px !important; text-align: center;border-width: 2px 0 2px 0;border-color: #DDDCDC;border-style: solid;-webkit-print-color-adjust: exact;print-color-adjust: exact; ">@day.StartDate2</td>
|
||||
<td style="font-size: 8px !important; text-align: center;border-width: 2px 0 2px 2px;border-color: #DDDCDC;border-style: solid;-webkit-print-color-adjust: exact;print-color-adjust: exact; ">@day.EndDate2</td>
|
||||
}
|
||||
else
|
||||
{
|
||||
<td colspan="2" style="font-size: 8px; text-align: center; border-width: 2px 0 2px 2px; border-color: #DDDCDC; border-style: solid; -webkit-print-color-adjust: exact; print-color-adjust: exact;">
|
||||
<div style="display: flex;justify-content: center;">
|
||||
<span style="width: 41px; display: block; border-radius: 50px; background-color: #fff; color: #737373;border: 1px solid #737373;">
|
||||
@day.LeaveType
|
||||
</span>
|
||||
</div>
|
||||
</td>
|
||||
<td colspan="2" style="font-size: 8px; text-align: center; border-width: 2px 0 2px 2px; border-color: #DDDCDC; border-style: solid; -webkit-print-color-adjust: exact; print-color-adjust: exact;">
|
||||
<div style="display: flex;justify-content: center;">
|
||||
@* <span style="width: 80px; display: block; border-radius: 50px; background-color: #fff; color: #737373;border: 1px solid #737373;">
|
||||
مرخصی @day.LeaveType
|
||||
</span> *@
|
||||
</div>
|
||||
</td>
|
||||
}
|
||||
}
|
||||
|
||||
<td style="font-size: 8px !important; text-align: center;border-width: 2px 0 2px 2px;border-color: #DDDCDC;border-style: solid;-webkit-print-color-adjust: exact;print-color-adjust: exact; ">@day.BreakTimeString</td>
|
||||
<td style="font-size: 8px !important; text-align: center; border-width: 2px 0 2px 2px; border-color: #DDDCDC; border-style: solid;vertical-align: center;-webkit-print-color-adjust: exact;print-color-adjust: exact; ">
|
||||
@if (day.IsSliced)
|
||||
{
|
||||
<svg width="12" height="12" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" style="display: block; margin: auto;">
|
||||
<circle stroke-width="2" cx="12" cy="12" r="9" stroke="#222222" />
|
||||
<path stroke-width="2" d="M8 12L11 15L16 9" stroke="#222222" stroke-linecap="round" />
|
||||
</svg>
|
||||
}
|
||||
else
|
||||
{
|
||||
<span>-</span>
|
||||
}
|
||||
</td>
|
||||
<td style="font-size: 8px;text-align: center;border-width: 2px 0 2px 0;border-color: #DDDCDC;border-style: solid;-webkit-print-color-adjust: exact;print-color-adjust: exact;border-radius: 5px 0 0 5px;">@day.TotalWorkingHours</td>
|
||||
</tr>
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div style="grid-column: span 2 / span 2;padding: 0;">
|
||||
<div style="background-color: #FFFFFF !important; border: 1px solid #CCCCCC;border-radius: 7px; -webkit-print-color-adjust: exact;print-color-adjust: exact; ">
|
||||
<table style="width: 100%;">
|
||||
<tbody>
|
||||
|
||||
<tr style="font-size: 12px; border-collapse: separate; -webkit-print-color-adjust: exact; print-color-adjust: exact;">
|
||||
<td style="font-size: 8px; padding: 5px 3px;border-width: 0 0 0 1px;border-color: #D9D9D9;border-style: solid; border-radius: 0 6px 6px 0; -webkit-print-color-adjust: exact;print-color-adjust: exact; text-align: center;width: 25%;background: #FFFFFF;">موظفی @Model.Month @Model.Year : @Model.TotalMandatoryTimeStr</td>
|
||||
<td style="font-size: 8px; padding: 5px 3px;border-width: 0 0 0 1px;border-color: #D9D9D9;border-style: solid; border-radius: 0 0px 0px 0; -webkit-print-color-adjust: exact;print-color-adjust: exact; text-align: center;width: 25%;background: #FFFFFF;">ساعات حضور : @Model.TotalPresentTimeStr</td>
|
||||
<td style="font-size: 8px; padding: 5px 3px;border-width: 0 0 0 1px;border-color: #D9D9D9;border-style: solid; border-radius: 0 0px 0px 0; -webkit-print-color-adjust: exact;print-color-adjust: exact; text-align: center;width: 25%;background: #FFFFFF;">ساعات استراحت : @Model.TotalBreakTimeStr</td>
|
||||
<td style="font-size: 8px; padding: 5px 3px;border-width: 0 0 0 0px;border-color: #D9D9D9;border-style: solid; border-radius: 6px 0 0 6px; -webkit-print-color-adjust: exact;print-color-adjust: exact; text-align: center;width: 25%;background: #FFFFFF;">ساعات کارکرد : @Model.TotalWorkingTimeStr</td>
|
||||
</tr>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row" style="padding: 0 12px;">
|
||||
<table style="width: 100%;margin: 12px 0 0 0;">
|
||||
<tbody>
|
||||
|
||||
<tr>
|
||||
<td style="width: 60%;">
|
||||
@{
|
||||
if (Model.IsLeft)
|
||||
{
|
||||
<span style="float: right; margin-right: 15px; font-size: 11.2px;height: 36px;">
|
||||
<span>طبق تصفیه حساب نهایی تنظیمی فوق، آخرین روز اشتغال بکار اینجانب</span><span> </span>
|
||||
<span>@Model.LastDayOfWork</span><span> </span>
|
||||
<span>بوده و قطع همکاری با کارفرما و کارگاه از تاریخ</span><span> </span>
|
||||
<span>@Model.LeftWorkDate</span><span> </span>
|
||||
<span>می باشد</span>
|
||||
</span>
|
||||
}
|
||||
}
|
||||
</td>
|
||||
<td style="width: 40%;">
|
||||
<div style="display: flex; justify-content: end;" class="signSection">
|
||||
<div style="margin-left: 15px; position: relative; width: 80px; border: 1px solid #000; height: 78px; border-radius: 10px;">
|
||||
<span style="border-collapse: separate;background-color: #FFFFFF !important;-webkit-print-color-adjust: exact;print-color-adjust: exact;font-size: 12px;margin: -10px 8px 0 0;display: table-caption;padding: 0 4px;white-space: nowrap;">اثر انگشت</span>
|
||||
</div>
|
||||
<div style="position: relative; width: 160px; border: 1px solid #000; height: 78px; border-radius: 10px;">
|
||||
<span style="border-collapse: separate;background-color: #FFFFFF !important;-webkit-print-color-adjust: exact;print-color-adjust: exact;font-size: 12px;margin: -10px 54px 0 0;display: table-caption;padding: 0 4px;">امضاء</span>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
|
||||
@* <div class="row">
|
||||
<fieldset style="border-radius: 10px 10px 10px 10px; margin: 0px 10px;">
|
||||
<div class="row" style="padding: 10px 0 0px 0;">
|
||||
@{
|
||||
if (Model.IsLeft)
|
||||
{
|
||||
<span style="float: right; margin-right: 15px; font-size: 11.2px;height: 36px;">
|
||||
<span>طبق تصفیه حساب نهایی تنظیمی فوق، آخرین روز اشتغال بکار اینجانب</span><span> </span>
|
||||
<span>@Model.LastDayOfWork</span><span> </span>
|
||||
<span>بوده و قطع همکاری با کارفرما و کارگاه از تاریخ</span><span> </span>
|
||||
<span>@Model.LeftWorkDate</span><span> </span>
|
||||
<span>می باشد</span>
|
||||
</span>
|
||||
}
|
||||
}
|
||||
|
||||
</div> *@
|
||||
|
||||
@* <div class="row" style="padding: 0px 14px; font-size: 14px;">
|
||||
<div class="row"> *@
|
||||
@*<div class="col-xs-3"><span>اینجانب <span> </span> <span> </span><span> </span><span style="font-weight: bold">@Model.EmployeeFullName</span> </span></div>
|
||||
<div class="col-xs-3"><span> نام پدر: <span> </span><span> </span> <span> </span><span style="font-weight: bold">@Model.FathersName</span></span></div>
|
||||
<div class="col-xs-3"><span>به کد ملی:<span> </span><span> </span><span style="font-weight: bold">@Model.NationalCode</span> </span></div>
|
||||
<div class="col-xs-3" style="direction: ltr"> متولد: <span> </span><span> </span><span> </span><span> </span><span style="font-weight: bold">@Model.DateOfBirth</span></div>*@
|
||||
@* </div>
|
||||
<div class="row">
|
||||
<div class="col-xs-12" style="font-size: 14px; text-align: justify"> *@
|
||||
@*<span> پـرسنل شـرکت<span> </span><span> </span><span style="font-weight: bold">@Model.WorkshopName</span> </span>
|
||||
<span> </span>
|
||||
<span>به کارفرمایی <span> </span> آقای/خانم/شرکت</span> <span> </span><span> </span>
|
||||
@{
|
||||
foreach (var item in @Model.EmployerList)
|
||||
{
|
||||
<span style="font-weight: bold">@item.EmployerFullName </span> <span>،</span>
|
||||
}
|
||||
}
|
||||
<span> </span><span> </span>
|
||||
<span>مبلغ ............. ریال را بصورت نقدی از کارفرما دریافت نمودم. </span>*@
|
||||
|
||||
|
||||
|
||||
@* </div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
|
||||
<div classs="col-xs-12">
|
||||
<div style="float: left;display: flex;position: absolute;left: 26px;bottom: 12px;">
|
||||
<div style="margin-left: 15px; position: relative; width: 80px; border: 1px solid #000; height: 98px; border-radius: 10px;">
|
||||
<span style="position: absolute; top: -9px; right: 50%; transform: translate(50%, 0px); border-collapse: separate;background-color: #FFFFFF !important;-webkit-print-color-adjust: exact;print-color-adjust: exact; font-size: 12px;width: 55px;">اثر انگشت</span>
|
||||
</div>
|
||||
<div style="margin-left: 15px; position: relative; width: 160px; border: 1px solid #000; height: 98px; border-radius: 10px;">
|
||||
<span style="position: absolute; top: -9px; right: 50%; transform: translate(50%, 0px); border-collapse: separate;background-color: #FFFFFF !important;-webkit-print-color-adjust: exact;print-color-adjust: exact; font-size: 12px;">امضاء</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</fieldset>
|
||||
</div> *@
|
||||
|
||||
</fieldset>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<input type="hidden" asp-for="Id" value="@Model.Id" />
|
||||
|
||||
<input type="hidden" id="shiftWorkval" name="shiftWorkval" value="@Model.CreateWorkingHoursTemp.ShiftWork">
|
||||
|
||||
|
||||
@@ -2,23 +2,34 @@
|
||||
@Html.AntiForgeryToken()
|
||||
|
||||
@{
|
||||
<style>
|
||||
<style>
|
||||
.modal-content {
|
||||
height: 847px !important;
|
||||
}
|
||||
|
||||
.select2.select2-container .select2-selection {
|
||||
border: 1px solid #aeaeae;
|
||||
height: 35px;
|
||||
}
|
||||
|
||||
.select2-container--default .select2-selection--multiple {
|
||||
min-height: 50px !important;
|
||||
padding: 6px 8px;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
@@media (max-width: 1550px) {
|
||||
.modal-content {
|
||||
height: 847px !important;
|
||||
height: 655px !important;
|
||||
}
|
||||
}
|
||||
|
||||
@@media (max-width: 1550px) {
|
||||
.modal-content {
|
||||
height: 655px !important;
|
||||
}
|
||||
@@media (max-width: 1370px) {
|
||||
.modal-content {
|
||||
height: 582px !important;
|
||||
}
|
||||
|
||||
@@media (max-width: 1370px) {
|
||||
.modal-content {
|
||||
height: 582px !important;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
}
|
||||
</style>
|
||||
}
|
||||
|
||||
<div class="container">
|
||||
@@ -36,7 +47,7 @@
|
||||
<div class="row form" style="width: 100%;">
|
||||
|
||||
<input type="hidden" class="input td-ellipsis" id="isLegal" />
|
||||
<input type="hidden" class="input " id="hfTypeOfInsuranceSendWorkshop" />
|
||||
<input type="hidden" class="input" id="hfTypeOfInsuranceSendWorkshop" />
|
||||
<input type="hidden" class="input" id="hfFixedSalary">
|
||||
<input type="hidden" class="input" id="hfPopulation">
|
||||
<input type="hidden" class="input" id="hfInsuranceJobId">
|
||||
@@ -44,7 +55,7 @@
|
||||
<div class="col-md-3 col-3 col-sm-3 inputs" id="karfarma-container" disabled>
|
||||
<input type="text" class="input td-ellipsis" id="karfarma" />
|
||||
</div>
|
||||
<div id="divWorkshopId" class="col-md-3 col-3 col-sm-3 inputs ">
|
||||
<div id="divWorkshopId" class="col-md-3 col-3 col-sm-3 inputs">
|
||||
<select class="input select-city" asp-for="@Model.WorkshopId" onchange="getEmployerAndWorkshopInfo(this.value);" asp-items="@Model.WorkShopSelectList">
|
||||
<option value="0" selected hidden> کارگاه </option>
|
||||
</select>
|
||||
@@ -77,7 +88,7 @@
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-12 col-12 col-sm-12 inputs">
|
||||
<div class="col-md-12 col-12 col-sm-12 inputs" style="padding: 0 18px;height: 45px">
|
||||
@* <select name="dropdown5" id="workshops" asp-for="@Model.WorkshopIds" asp-items='@Model.WorkShopSelectList' class="input multi-drop text-right select-city2" multiple>
|
||||
<option value="0" disabled hidden> کارگاه ها </option>
|
||||
</select>*@
|
||||
@@ -127,7 +138,7 @@
|
||||
|
||||
</div>
|
||||
<div class="col-md-12 col-12 col-sm-12 sml-pad">
|
||||
<ul class="nav nav-tabs" style="margin-right: -36px;">
|
||||
<ul class="nav nav-tabs" style="margin-right: 4px;">
|
||||
<li class="active pull-right DSSKAR">
|
||||
<a href="#DSSKAR" data-toggle="tab">DSSKAR</a>
|
||||
</li>
|
||||
@@ -199,7 +210,7 @@
|
||||
|
||||
<div class="col-md-6 col-6 col-sm-6 inputs-group">
|
||||
<label class="col-md-10 col-10 col-sm-10 text-small"> جمع مزایای ماهیانه مشمول </label>
|
||||
<input type="text" placeholder="" id="txtSumOfBenefitsIncluded" asp-for="SumOfBenefitsIncluded" class="input green col-md-2 col-2 col-sm-2 notEmpty">
|
||||
<input type="text" placeholder="" id="txtSumOfBenefitsIncluded" asp-for="SumOfBenefitsIncluded" class="input green col-md-2 col-2 col-sm-2 notEmpty">
|
||||
</div>
|
||||
|
||||
<div class="col-md-6 col-6 col-sm-6 inputs-group">
|
||||
@@ -346,9 +357,9 @@
|
||||
<div class="s9s">
|
||||
<div class="col-md-4 col-4 col-sm-4" style="padding:10px">
|
||||
<label for="WorkingDays"> روزهای کارکرد</label>
|
||||
@* <input type="number" min="0" max="31" class="input s7 " id="WorkingDays" autocomplete="off" onkeyup="getMonthlySalaryByWorkingDays()" name="WorkingDays" maxlength="2"> *@
|
||||
<input type="number" min="0" max="31" class="input s7 " id="WorkingDays" autocomplete="off" onkeyup="changeWorkingDays()" name="WorkingDays" maxlength="2">
|
||||
<input type="hidden" class="input s7 " id="OldWorkingDays" maxlength="2">
|
||||
@* <input type="number" min="0" max="31" class="input s7" id="WorkingDays" autocomplete="off" onkeyup="getMonthlySalaryByWorkingDays()" name="WorkingDays" maxlength="2"> *@
|
||||
<input type="number" min="0" max="31" class="input s7" id="WorkingDays" autocomplete="off" onkeyup="changeWorkingDays()" name="WorkingDays" maxlength="2">
|
||||
<input type="hidden" class="input s7" id="OldWorkingDays" maxlength="2">
|
||||
<input type="hidden" class="input s7" id="HousingAllowance" name="HousingAllowance">
|
||||
<input type="hidden" class="input s7" id="ConsumableItems" name="ConsumableItems">
|
||||
<input type="hidden" class="input s7" id="EndMonthCurrentDay" name="EndMonthCurrentDay">
|
||||
@@ -360,8 +371,8 @@
|
||||
</div>
|
||||
<div class="col-md-4 col-4 col-sm-4" style="padding:10px">
|
||||
<label for="DailyWage">دستمزد روزانه</label>
|
||||
<input type="text" class="input s7 " id="DailyWage" name="DailyWage" autocomplete="off" onkeyup="changeDailyWage();getMoneyValue(this);">
|
||||
<input type="hidden" class="input s7 " id="yearlySalaryItem">
|
||||
<input type="text" class="input s7" id="DailyWage" name="DailyWage" autocomplete="off" onkeyup="changeDailyWage();getMoneyValue(this);">
|
||||
<input type="hidden" class="input s7" id="yearlySalaryItem">
|
||||
|
||||
</div>
|
||||
<div class="col-md-4 col-4 col-sm-4" style="padding:10px">
|
||||
@@ -402,7 +413,7 @@
|
||||
<input type="hidden" class="input" id="LeftWorkDateGr" name="LeftWorkDateGr" autocomplete="off" style="background-color: #f7aeae;">
|
||||
</div>
|
||||
</div>
|
||||
<div id="divComputing" class="col-md-12 col-12 text-center ">
|
||||
<div id="divComputing" class="col-md-12 col-12 text-center">
|
||||
<button type="button" id="btnComputing" onclick="computing()" disabled="disabled" class="btn modal2-btn insurance-disabled btn-primary">محاسبه </button>
|
||||
</div>
|
||||
</div>
|
||||
@@ -419,9 +430,9 @@
|
||||
</div>
|
||||
<div class="btns">
|
||||
<div class="col-md-5">
|
||||
<a href="#" class=" btn btn-modal" id="save">ذخیره</a>
|
||||
<a href="#" class=" btn btn-modal btn-text-disable" style="display: none" id="fakeSave">ذخیره</a>
|
||||
@*<button type="submit" class=" btn btn-modal" id="saveData" style="display: none">ذخیره</button>*@
|
||||
<a href="#" class="btn btn-modal" id="save">ذخیره</a>
|
||||
<a href="#" class="btn btn-modal btn-text-disable" style="display: none" id="fakeSave">ذخیره</a>
|
||||
@*<button type="submit" class="btn btn-modal" id="saveData" style="display: none">ذخیره</button>*@
|
||||
<button class="btn btn-modal" id="close" data-dismiss="modal">بستن</button>
|
||||
|
||||
</div>
|
||||
@@ -1369,7 +1380,17 @@
|
||||
if (response.isSuccedded == true) {
|
||||
$.Notification.autoHideNotify('success', 'top right', response.message);
|
||||
$("#MainModal").modal('hide');
|
||||
$('.btn-search1').click();
|
||||
// $('.btn-search1').click();
|
||||
|
||||
// Reload Function
|
||||
pageIndexJs = 0;
|
||||
hasMoreData = true;
|
||||
var $activeTab = $('.tab-bar__tab--active');
|
||||
var activeValue = $activeTab.val();
|
||||
$('#load-data-html').html('');
|
||||
loadGetTabCounts();
|
||||
loadSearchNew(activeValue);
|
||||
|
||||
} else {
|
||||
$.Notification.autoHideNotify('error', 'top right', response.message);
|
||||
}
|
||||
|
||||
@@ -7,6 +7,17 @@
|
||||
height: 847px !important;
|
||||
}
|
||||
|
||||
.select2.select2-container .select2-selection {
|
||||
border: 1px solid #aeaeae;
|
||||
height: 35px;
|
||||
}
|
||||
|
||||
.select2-container--default .select2-selection--multiple {
|
||||
min-height: 50px !important;
|
||||
padding: 6px 8px;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
@@media (max-width: 1550px) {
|
||||
.modal-content {
|
||||
height: 655px !important;
|
||||
@@ -18,7 +29,6 @@
|
||||
height: 582px !important;
|
||||
}
|
||||
}
|
||||
|
||||
</style>
|
||||
}
|
||||
|
||||
@@ -37,7 +47,7 @@
|
||||
data-ajax="true">
|
||||
<div id="divEmployeeInsurancListData"></div>
|
||||
<input type="hidden" class="input td-ellipsis" id="isLegal"/>
|
||||
<input type="hidden" class="input " id="hfTypeOfInsuranceSendWorkshop" value="@Model.TypeOfInsuranceSend"/>
|
||||
<input type="hidden" class="input" id="hfTypeOfInsuranceSendWorkshop" value="@Model.TypeOfInsuranceSend"/>
|
||||
<input type="hidden" class="input" id="hfFixedSalary" value="@Model.FixedSalary" >
|
||||
<input type="hidden" class="input" id="hfPopulation" value="@Model.Population" >
|
||||
<input type="hidden" class="input" id="hfInsuranceJobId" >*@
|
||||
@@ -47,9 +57,9 @@
|
||||
<div class="col-md-3 col-3 col-sm-3 inputs" id="karfarma-container" disabled>
|
||||
<input type="text" class="input td-ellipsis" id="karfarma"/>
|
||||
</div>
|
||||
<div id="divWorkshopId" class="col-md-3 col-3 col-sm-3 inputs ">
|
||||
<div id="divWorkshopId" class="col-md-3 col-3 col-sm-3 inputs">
|
||||
<input type="text" class="input" asp-for="@Model.WorkshopName" disabled/>
|
||||
<input type="hidden" class="input " asp-for="@Model.WorkshopId"/>
|
||||
<input type="hidden" class="input" asp-for="@Model.WorkshopId"/>
|
||||
@* <select class="input select-city" disabled="disabled" asp-for="@Model.WorkshopId" asp-items='@Model.WorkShopSelectList'>
|
||||
<option value="0" selected hidden> کارگاه </option>
|
||||
</select>
|
||||
@@ -79,7 +89,7 @@
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-12 col-12 col-sm-12 inputs">
|
||||
<div class="col-md-12 col-12 col-sm-12 inputs" style="padding: 0 18px;height: 45px">
|
||||
@* <select name="dropdown5" id="workshops" asp-for="@Model.WorkshopIds" asp-items='@Model.WorkShopSelectList' class="input multi-drop text-right select-city2" multiple>
|
||||
<option value="0" disabled hidden> کارگاه ها </option>
|
||||
</select>*@
|
||||
@@ -95,7 +105,7 @@
|
||||
</div> *@
|
||||
|
||||
<div class="col-md-3 col-3 col-sm-3 inputs">
|
||||
<input type="hidden" class="input green input-field" asp-for="@Model.InsuranceWorkshopInfo.InsuranceWorkshopInfoId">
|
||||
<input type="hidden" class="input green input-field" asp-for="@Model.InsuranceWorkshopInfo.InsuranceWorkshopInfoId">
|
||||
<input type="text" class="input green notEmpty input-field" asp-for="@Model.InsuranceWorkshopInfo.WorkshopName" placeholder="نام کارگاه">
|
||||
</div>
|
||||
<div class="col-md-6 col-6 col-sm-6 inputs">
|
||||
@@ -128,7 +138,7 @@
|
||||
<input type="hidden" class="input green" value="" id="InsuranceWorkshopInfo_ListNumber" name="InsuranceWorkshopInfo.ListNumber">
|
||||
</div>
|
||||
<div class="col-md-12 col-12 col-sm-12 sml-pad">
|
||||
<ul class="nav nav-tabs" style="margin-right: -36px;">
|
||||
<ul class="nav nav-tabs" style="margin-right: 4px;">
|
||||
<li class="active pull-right DSSKAR">
|
||||
<a href="#DSSKAR" data-toggle="tab">DSSKAR</a>
|
||||
</li>
|
||||
@@ -200,7 +210,7 @@
|
||||
|
||||
<div class="col-md-6 col-6 col-sm-6 inputs-group">
|
||||
<label class="col-md-10 col-10 col-sm-10 text-small"> جمع مزایای ماهیانه مشمول </label>
|
||||
<input type="text" placeholder="" id="txtSumOfBenefitsIncluded" asp-for="SumOfBenefitsIncluded" class="input green col-md-2 col-2 col-sm-2 notEmpty">
|
||||
<input type="text" placeholder="" id="txtSumOfBenefitsIncluded" asp-for="SumOfBenefitsIncluded" class="input green col-md-2 col-2 col-sm-2 notEmpty">
|
||||
</div>
|
||||
|
||||
<div class="col-md-6 col-6 col-sm-6 inputs-group">
|
||||
@@ -262,7 +272,7 @@
|
||||
<label for="LName"> نام خانوادگی</label>
|
||||
<input type="text" class="input f9" id="LName" name="LName" autocomplete="off">
|
||||
</div>
|
||||
<div class="col-md-4 col-4 col-sm-4 " style="padding:10px">
|
||||
<div class="col-md-4 col-4 col-sm-4" style="padding:10px">
|
||||
|
||||
<label for="Gender"> جنسیت </label>
|
||||
<input type="text" class="input f9" id="Gender" name="Gender" autocomplete="off">
|
||||
@@ -292,8 +302,8 @@
|
||||
<div class="s9s">
|
||||
<div class="col-md-4 col-4 col-sm-4" style="padding:10px">
|
||||
<label for="WorkingDays"> روزهای کارکرد</label>
|
||||
<input type="number" min="0" max="31" class="input s7 " id="WorkingDays" autocomplete="off" onkeyup="changeDailyWage();" name="WorkingDays">
|
||||
<input type="hidden" class="input s7 " id="OldWorkingDays" maxlength="2">
|
||||
<input type="number" min="0" max="31" class="input s7" id="WorkingDays" autocomplete="off" onkeyup="changeDailyWage();" name="WorkingDays">
|
||||
<input type="hidden" class="input s7" id="OldWorkingDays" maxlength="2">
|
||||
<input type="hidden" class="input s7" id="HousingAllowance" name="HousingAllowance">
|
||||
<input type="hidden" class="input s7" id="ConsumableItems" name="ConsumableItems">
|
||||
<input type="hidden" class="input s7" id="EndMonthCurrentDay" name="EndMonthCurrentDay">
|
||||
@@ -305,8 +315,8 @@
|
||||
</div>
|
||||
<div class="col-md-4 col-4 col-sm-4" style="padding:10px">
|
||||
<label for="DailyWage">دستمزد روزانه</label>
|
||||
<input type="text" class="input s7 " id="DailyWage" name="DailyWage" autocomplete="off" onkeyup="changeDailyWage();getMoneyValue(this);">
|
||||
<input type="hidden" class="input s7 " id="yearlySalaryItem">
|
||||
<input type="text" class="input s7" id="DailyWage" name="DailyWage" autocomplete="off" onkeyup="changeDailyWage();getMoneyValue(this);">
|
||||
<input type="hidden" class="input s7" id="yearlySalaryItem">
|
||||
</div>
|
||||
<div class="col-md-4 col-4 col-sm-4" style="padding:10px">
|
||||
<label for="MonthlySalary"> حقوق ماهیانه + پایه سنوات </label>
|
||||
@@ -342,7 +352,7 @@
|
||||
<input type="hidden" class="input" id="LeftWorkDateGr" name="LeftWorkDateGr" autocomplete="off" style="background-color: #f7aeae;">
|
||||
</div>
|
||||
</div>
|
||||
<div id="divComputing" class="col-md-12 col-12 text-center ">
|
||||
<div id="divComputing" class="col-md-12 col-12 text-center">
|
||||
<button type="button" id="btnComputing" onclick="computing()" disabled="disabled" class="btn insurance-disabled modal2-btn btn-primary">محاسبه </button>
|
||||
</div>
|
||||
</div>
|
||||
@@ -358,9 +368,9 @@
|
||||
</div>
|
||||
<div class="btns">
|
||||
<div class="col-md-5">
|
||||
<a href="#" class=" btn btn-modal" id="save">ویرایش</a>
|
||||
<a href="#" class=" btn btn-modal btn-text-disable" style="display: none" id="fakeSave">ذخیره</a>
|
||||
@*<button type="submit" class=" btn btn-modal" id="saveData" style="display: none">ذخیره</button>*@
|
||||
<a href="#" class="btn btn-modal" id="save">ویرایش</a>
|
||||
<a href="#" class="btn btn-modal btn-text-disable" style="display: none" id="fakeSave">ذخیره</a>
|
||||
@*<button type="submit" class="btn btn-modal" id="saveData" style="display: none">ذخیره</button>*@
|
||||
<button class="btn btn-modal" id="close" data-dismiss="modal">بستن</button>
|
||||
|
||||
</div>
|
||||
@@ -1244,7 +1254,17 @@
|
||||
if (response.isSuccedded == true) {
|
||||
$.Notification.autoHideNotify('success', 'top right', response.message);
|
||||
$("#MainModal").modal('hide');
|
||||
$('.btn-search1').click();
|
||||
// $('.btn-search1').click();
|
||||
|
||||
// Reload Function
|
||||
pageIndexJs = 0;
|
||||
hasMoreData = true;
|
||||
var $activeTab = $('.tab-bar__tab--active');
|
||||
var activeValue = $activeTab.val();
|
||||
$('#load-data-html').html('');
|
||||
loadGetTabCounts();
|
||||
loadSearchNew(activeValue);
|
||||
|
||||
} else {
|
||||
$.Notification.autoHideNotify('error', 'top right', response.message);
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -26,6 +26,8 @@ public class IndexModel : PageModel
|
||||
private readonly IInsuranceListApplication _insuranceListApplication;
|
||||
private readonly IInsuranceWorkshopInfoApplication _insuranceWorkshopInfoApplication;
|
||||
|
||||
private readonly IAuthHelper _authHelper;
|
||||
|
||||
private readonly IJobApplication _jobApplication;
|
||||
|
||||
//private readonly IInsuranceEmployeeInfoApplication _insuranceEmployeeInfoApplication;
|
||||
@@ -45,7 +47,7 @@ public class IndexModel : PageModel
|
||||
IYearlySalaryApplication yearlySalaryApplication, IEmployerApplication employerApplication,
|
||||
IInsuranceWorkshopInfoApplication insuranceWorkshopInfoApplication, IEmployeeApplication employeeApplication,
|
||||
IJobApplication jobApplication,
|
||||
IWebHostEnvironment webHostEnvironment) // , IInsuranceEmployeeInfoApplication insuranceEmployeeInfoApplication )
|
||||
IWebHostEnvironment webHostEnvironment, IAuthHelper authHelper) // , IInsuranceEmployeeInfoApplication insuranceEmployeeInfoApplication )
|
||||
{
|
||||
_jobApplication = jobApplication;
|
||||
_insuranceListApplication = insuranceListApplication;
|
||||
@@ -56,6 +58,7 @@ public class IndexModel : PageModel
|
||||
_employeeApplication = employeeApplication;
|
||||
//_insuranceEmployeeInfoApplication = insuranceEmployeeInfoApplication;
|
||||
_webHostEnvironment = webHostEnvironment;
|
||||
_authHelper = authHelper;
|
||||
}
|
||||
|
||||
|
||||
@@ -1070,7 +1073,7 @@ public class IndexModel : PageModel
|
||||
{
|
||||
var result = _employerApplication.GetEmployerWithFNameOrLName(searchText);
|
||||
result = result.OrderBy(x => x.LName.Length).ToList();
|
||||
return new JsonResult(new
|
||||
return new JsonResult(new
|
||||
{
|
||||
IsSuccedded = true,
|
||||
mylist = result
|
||||
@@ -1078,4 +1081,51 @@ public class IndexModel : PageModel
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Insurance Operations
|
||||
|
||||
public IActionResult OnGetSearchNew(InsuranceListSearchModel searchModel)
|
||||
{
|
||||
var resultData = _insuranceListApplication.Search(searchModel);
|
||||
|
||||
return new JsonResult(new
|
||||
{
|
||||
success = true,
|
||||
data = resultData,
|
||||
pageIndex = resultData.Count
|
||||
});
|
||||
}
|
||||
|
||||
public async Task<IActionResult> OnGetTabCounts(int month, int year)
|
||||
{
|
||||
var accountId = _authHelper.CurrentAccountId();
|
||||
var resultData = await _insuranceListApplication.GetTabCounts(accountId, month, year);
|
||||
|
||||
return new JsonResult(new
|
||||
{
|
||||
notStarted = resultData.NotStarted,
|
||||
inProgress = resultData.InProgress,
|
||||
readyToSendList = resultData.ReadyToSendList,
|
||||
done = resultData.Done,
|
||||
});
|
||||
}
|
||||
|
||||
public async Task<IActionResult> OnGetOperationsModal(long id)
|
||||
{
|
||||
var command = await _insuranceListApplication.GetInsuranceOperationDetails(id);
|
||||
return Partial("_Partials/OperationsModal", command);
|
||||
}
|
||||
|
||||
public async Task<IActionResult> OnPostSaveOperationsModal(InsuranceListConfirmOperation command)
|
||||
{
|
||||
var result = await _insuranceListApplication.ConfirmInsuranceOperation(command);
|
||||
|
||||
return new JsonResult(new
|
||||
{
|
||||
success = result.IsSuccedded,
|
||||
message = result.Message,
|
||||
});
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
@@ -0,0 +1,662 @@
|
||||
@page
|
||||
@model ServiceHost.Areas.Admin.Pages.Company.InsuranceList.IndexOldModel
|
||||
|
||||
@{
|
||||
string adminVersion = _0_Framework.Application.Version.AdminVersion;
|
||||
Layout = "Shared/_AdminLayout";
|
||||
ViewData["title"] = "بیمه";
|
||||
var selctedOption = "selectedOption";
|
||||
}
|
||||
|
||||
@*select2 css start*@
|
||||
<style>
|
||||
|
||||
::-webkit-scrollbar {
|
||||
width: 8px;
|
||||
}
|
||||
|
||||
::-webkit-scrollbar-track {
|
||||
background: #dfdfdf;
|
||||
border-radius: 5px;
|
||||
}
|
||||
|
||||
::-webkit-scrollbar-thumb {
|
||||
background: #bed3ca;
|
||||
border-radius: 5px;
|
||||
}
|
||||
|
||||
.opt {
|
||||
background-color: #d3e7ff;
|
||||
border-radius: 10px;
|
||||
text-align: right;
|
||||
padding: 2px 5px;
|
||||
text-overflow: ellipsis;
|
||||
overflow-x: hidden;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.noResult {
|
||||
background-color: #c0dcfd;
|
||||
border-radius: 10px;
|
||||
text-align: right;
|
||||
padding: 2px 5px;
|
||||
}
|
||||
|
||||
.opt:hover, .noResult:hover {
|
||||
background-color: #afd0f7 !important;
|
||||
color: #343434 !important;
|
||||
}
|
||||
|
||||
.selectDiv {
|
||||
position: relative;
|
||||
z-index: 2;
|
||||
border-radius: 10px;
|
||||
min-height: 20px;
|
||||
max-height: 190px;
|
||||
overflow: hidden scroll;
|
||||
width: 100%;
|
||||
background-color: rgb(255 255 255);
|
||||
display: block;
|
||||
box-shadow: 0px -1px 12px 0px rgba(0,0,0,.16), 2px 1px 10px 0 rgba(0,0,0,.12);
|
||||
}
|
||||
|
||||
.selectedOption {
|
||||
color: #424242 !important;
|
||||
background-color: #cee4fb !important;
|
||||
}
|
||||
|
||||
.keyboardSelected {
|
||||
color: #424242 !important;
|
||||
background-color: #b1d5ff !important;
|
||||
}
|
||||
|
||||
.bgGray, .bgGray:hover {
|
||||
background-color: #b5b5b5 !important;
|
||||
color: #646464;
|
||||
}
|
||||
|
||||
a.disabled {
|
||||
pointer-events: none;
|
||||
cursor: default;
|
||||
background-color: grey !important;
|
||||
border-color: grey !important;
|
||||
}
|
||||
</style>
|
||||
<link href="~/admintheme/css/insurance-list.css?ver=@adminVersion" rel="stylesheet" />
|
||||
<div class="row">
|
||||
<div class="col-sm-12 m-r-10">
|
||||
<div class="printBtns" style="display: none;">
|
||||
<button id="closeModal" type="button" class="btn btn-warning btn-rounded waves-effect waves-light m-b-10" data-dismiss="modal" style="float: left">بستن</button>
|
||||
<button id="btnPrint2" type="button" class="btn btn-success btn-rounded waves-effect waves-light" style="float: left">پرینت </button>
|
||||
</div>
|
||||
<p class="">
|
||||
@* pull-right *@
|
||||
<a href="#showmodal=@Url.Page("/Company/InsuranceList/Index", "OperationsModal")" class="btn btn-success btn-rounded waves-effect waves-light m-b-5" style=" background-color: #f5f5f5; border-color: #0f9500; font-family: 'Web_Yekan' !important; color: #0f9500 !important; margin-right: 10px "> <i class="fa fa-user-plus" style="padding-left: 3px; font-size: 14px; color: #0f9500 !important "></i> مودال ویرایش </a>
|
||||
<a permission="80210" id="btnPopModal" href="#showmodal=@Url.Page("/Company/InsuranceList/Index", "Create")" class="btn btn-success btn-rounded waves-effect waves-light m-b-5" style=" background-color: #f5f5f5; border-color: #0f9500; font-family: 'Web_Yekan' !important; color: #0f9500 !important; margin-right: 10px "> <i class="fa fa-user-plus" style="padding-left: 3px; font-size: 14px; color: #0f9500 !important "></i> ایجاد لیست بیمه </a>
|
||||
</p>
|
||||
</div>
|
||||
<div class="col-sm-12">
|
||||
<div class="panel-group panel-group-joined" id="accordion-test">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<h4 class="panel-title">
|
||||
<a data-toggle="collapse" data-parent="#accordion-test" href="#collapseOne" class="collapsed">
|
||||
جستجوی لیست بیمه ی کارگاه ها
|
||||
</a>
|
||||
</h4>
|
||||
</div>
|
||||
<div id="collapseOne" class="panel-collapse in collapse">
|
||||
<div class="panel-body">
|
||||
@*===================================================================================================================*@
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<form class="form-inline" role="form" name="search-theme-form" id="search-theme-form" autocomplete="off"
|
||||
method="get"
|
||||
data-ajax="true"
|
||||
data-ajax-method="get"
|
||||
data-ajax-update="#mainPanelSearch"
|
||||
data-ajax-mode="replace"
|
||||
data-ajax-url="@Url.Page("./Index","Search")">
|
||||
<div class="form-group col-sm-12">
|
||||
<div class="row">
|
||||
<div class="col-lg-3 col-md-3 col-sm-6 col-xs-12" style="display: flex;">
|
||||
<div class="date-title">انتخاب تاریخ</div>
|
||||
<div class="year-box">
|
||||
<label class="sr-only"></label>
|
||||
<select class="form-control" asp-for="searchModel.Year" style="width: 100%">
|
||||
<option value="0" >سال</option>
|
||||
@foreach (string itemi in @Model.YearlyList)
|
||||
{
|
||||
if (Model.CurrentYear_ == itemi)
|
||||
{
|
||||
<option selected value="@itemi"> @itemi </option>
|
||||
}
|
||||
else
|
||||
{
|
||||
<option value="@itemi"> @itemi </option>
|
||||
}
|
||||
}
|
||||
</select>
|
||||
</div>
|
||||
<div class="month-box">
|
||||
<label class="sr-only"></label>
|
||||
<select class="form-control" asp-for="searchModel.Month" style="width: 100%">
|
||||
<option value="0" > ماه</option>
|
||||
<option value="01"> فروردین</option>
|
||||
<option value="02"> اردیبهشت</option>
|
||||
<option value="03"> خرداد</option>
|
||||
<option value="04"> تیر</option>
|
||||
<option value="05"> مرداد</option>
|
||||
<option value="06"> شهریور</option>
|
||||
<option value="07"> مهر</option>
|
||||
<option value="08"> آبان</option>
|
||||
<option value="09"> آذر</option>
|
||||
<option value="10"> دی</option>
|
||||
<option value="11"> بهمن</option>
|
||||
<option value="12"> اسفند</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-3 col-md-3 col-sm-6 col-xs-12">
|
||||
<label class="sr-only"></label>
|
||||
<input class="form-control" placeholder="کد کارگاهی" asp-for="searchModel.WorkShopCode" style="width: 100%">
|
||||
</div>
|
||||
<div style="height:40px" class="col-lg-3 col-md-3 col-sm-6 col-xs-12">
|
||||
<label class="sr-only"></label>
|
||||
<input type="hidden" class="sendEmployerId" asp-for="searchModel.EmployerId" />
|
||||
<input type="hidden" asp-for="searchModel.EmployerName" />
|
||||
<input type="search" id="empSearchEmployer" value="@Model.EmployerFullName" class="form-control inpt @{ if(!string.IsNullOrWhiteSpace(@Model.EmployerFullName)){ @selctedOption } }" autocomplete="off" placeholder=" نام کارفرما " style="width: 100%;position: relative">
|
||||
<div id="empEmployer" class="selectDiv" style="display: none;">
|
||||
<ul class="searchResultEmployer m-t-10" style="list-style-type: none; padding: 5px">
|
||||
</ul>
|
||||
</div>
|
||||
@* <input class="form-control" placeholder="نام کارفرما" asp-for="searchModel.EmployerName" style="width: 100%"> *@
|
||||
</div>
|
||||
<div style="height:40px" class="col-lg-3 col-md-3 col-sm-6 col-xs-12">
|
||||
<label class="sr-only"></label>
|
||||
<input type="hidden" class="sendWorkshopId" asp-for="searchModel.WorkshopId" />
|
||||
<input type="hidden" asp-for="searchModel.WorkShopName" />
|
||||
<input type="search" id="empSearchWorkshop" value="@Model.WorkshopFullName" class="form-control @{ if(!string.IsNullOrWhiteSpace(@Model.WorkshopFullName)){ @selctedOption } }" autocomplete="off" placeholder=" نام کارگاه /شماره بایگانی " style="width: 100%; position: relative">
|
||||
<div id="empWorkshop" class="selectDiv" style="display: none;">
|
||||
<ul class="searchResultWorkshop m-t-10" style="list-style-type: none; padding: 5px">
|
||||
</ul>
|
||||
</div>
|
||||
@* <input class="form-control" placeholder="نام کارگاه" asp-for="searchModel.WorkShopName" style="width: 100%"> *@
|
||||
</div>
|
||||
</div>
|
||||
<hr style=" margin-top: 12px;margin-bottom: 12px;">
|
||||
<div class="row">
|
||||
<div class="col-lg-3 col-md-3 col-sm-6 col-xs-12 belowRow">
|
||||
<label class="sr-only"></label>
|
||||
<select class="form-control" asp-for="searchModel.TypeOfInsuranceSend" style="width: 100%">
|
||||
<option value="0" selected >نوع ارسال لیست</option>
|
||||
<option value="عادی"> عادی </option>
|
||||
<option value="کمک دولت">کمک دولت</option>
|
||||
<option value="خانوادگی">خانوادگی</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-lg-3 col-md-3 col-sm-6 col-xs-12 belowRow">
|
||||
<label class="sr-only"></label>
|
||||
<input class="form-control" asp-for="searchModel.Branch" placeholder="شعبه تامین اجتماعی " style="width: 100%">
|
||||
</div>
|
||||
<div class="col-lg-3 col-md-3 col-sm-6 col-xs-12 belowRow">
|
||||
<select class="form-control" style="width: 100%" asp-for="searchModel.City">
|
||||
<option value="0" selected >شهرستان</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-lg-3 col-md-3 col-sm-6 col-xs-12 belowRow">
|
||||
<select class="form-control" style="width: 100%" asp-for="searchModel.FixedSalary">
|
||||
<option selected >لیست مقطوع</option>
|
||||
<option value="true"> دارد</option>
|
||||
<option value="false">ندارد</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row" style="margin-top: 15px">
|
||||
<div class="col-lg-9">
|
||||
</div>
|
||||
<div class="col-lg-3">
|
||||
<button type="button" class="btn btn-success btn-rounded waves-effect waves-light m-b-5 btn-search1">
|
||||
<i class="fa fa-search" style="padding-left: 3px; font-size: 14px;"></i> جستجو
|
||||
</button>
|
||||
<a onclick="removeSearch()" class="btn btn-info btn-rounded waves-effect waves-light m-b-5 btn-observe">حذف جستجو</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-12">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<h3 class="panel-title"><i class="fa fa-list faSize"></i> لیست بیمه ی کارگاه ها </h3>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<div class="row">
|
||||
<div class="col-sm-12 col-sm-12 col-xs-12" id="mainPanelSearch">
|
||||
<div id="waiting" style="display: none;padding-right: 10px">
|
||||
<i class="ion-loading-a" style="font-size: 16px"> </i> در حال بارگذاری...
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
@section Script
|
||||
{
|
||||
<script src="~/AdminTheme/assets/js/site.js"></script>
|
||||
<script src="~/admintheme/js/admin.js" ></script>
|
||||
<script src="~/admintheme/js/jquery.mask_1.14.16.min.js"></script>
|
||||
<script src="~/adminTheme/assets/datatables/jquery.dataTables.min.js"></script>
|
||||
<script src="~/adminTheme/assets/datatables/dataTables.bootstrap.js"></script>
|
||||
<script src="~/lib/jquery-ajax-unobtrusive/jquery.unobtrusive-ajax.min.js"></script>
|
||||
<script language="javascript" src="~/AdminTheme/js/city.js"></script>
|
||||
}
|
||||
|
||||
<script>
|
||||
$(document).ready(function () {
|
||||
$("#searchModel_Month").val('@Model.BeforCurrentMonth_');
|
||||
$('.btn-search1').click();
|
||||
|
||||
$('#datatable').dataTable({
|
||||
"lengthMenu": [[25, 10, 50, 100, -1], [25, 10, 50, 100, "All"]]
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
|
||||
$('.btn-search1').on('click', function () {
|
||||
$("#waiting").show();
|
||||
var myTable = $("#datatable");
|
||||
myTable.remove();
|
||||
|
||||
if ($("#searchModel_EmployerId").val() == "0" || $("#searchModel_EmployerId").val() == "")
|
||||
$("#searchModel_EmployerName").val($("#empSearchEmployer").val());
|
||||
|
||||
if ($("#searchModel_WorkshopId").val() == "0" || $("#searchModel_WorkshopId").val() == "")
|
||||
$("#searchModel_WorkShopName").val($("#empSearchWorkshop").val());
|
||||
|
||||
$("#search-theme-form").submit();
|
||||
|
||||
});
|
||||
|
||||
function removeSearch()
|
||||
{
|
||||
var month = '@Model.BeforCurrentMonth_';
|
||||
console.log(month);
|
||||
$("#waiting").show();
|
||||
var myTable = $("#datatable");
|
||||
myTable.remove();
|
||||
$("#searchModel_WorkshopId").val("0");
|
||||
$("#searchModel_EmployerId").val("0");
|
||||
$("#searchModel_WorkShopName").val('');
|
||||
$("#searchModel_EmployerName").val('');
|
||||
$(".form-control").val('');
|
||||
$("#searchModel_Year").val(@Model.CurrentYear_);
|
||||
$("#searchModel_Month").val(month);
|
||||
$("#searchModel_TypeOfInsuranceSend").val(0);
|
||||
$("#searchModel_City").val(0);
|
||||
$("#searchModel_FixedSalary").val('لیست مقطوع');
|
||||
$("#search-theme-form").submit();
|
||||
}
|
||||
|
||||
|
||||
$('#search-theme-form').submit(function(e){
|
||||
e.preventDefault();
|
||||
e.stopImmediatePropagation();
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: $(this).attr( 'action' ),
|
||||
data: $(this).serialize(),
|
||||
success: function (response) {
|
||||
console.log(response);
|
||||
if (response.isSuccedded == true) {
|
||||
// $.Notification.autoHideNotify('success', 'top right', response.message);
|
||||
}
|
||||
else{
|
||||
$.Notification.autoHideNotify('error', 'top right', response.message);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
return false;
|
||||
});
|
||||
</script>
|
||||
|
||||
<script>
|
||||
//------workshop-----
|
||||
var containerWorkshop = $('#empWorkshop');
|
||||
var searchBoxWorkshop = $('#empSearchWorkshop');
|
||||
var hiddenInputValWorkshop = $('.sendWorkshopId');
|
||||
var searchResulWorkshop = $('.searchResultWorkshop');
|
||||
var mixContainerAndSerchResultWorkshop = $('#empWorkshop , .searchResultWorkshop');
|
||||
|
||||
containerWorkshop.hide();
|
||||
var liListWorkshop;
|
||||
var liPointerWorkshop;
|
||||
let countWorkshop = 0;
|
||||
|
||||
//close search Employee when click on body
|
||||
$(document).on('click', function (event) {
|
||||
if (!$(event.target).closest(containerWorkshop).length) {
|
||||
containerWorkshop.hide();
|
||||
}
|
||||
});
|
||||
//select option by mouse
|
||||
function selectItemWorkshop(id, employeeFullName) {
|
||||
searchBoxWorkshop.val(employeeFullName);
|
||||
hiddenInputValWorkshop.val(id);
|
||||
containerWorkshop.hide();
|
||||
searchBoxWorkshop.addClass("selectedOption");
|
||||
};
|
||||
//search by Ajax
|
||||
searchBoxWorkshop.on('keyup keypress',
|
||||
function (e) {
|
||||
$(".form-control").removeClass("selectedOption");
|
||||
//----clean Employer------
|
||||
$("#searchModel_EmployerName").val('');
|
||||
$("#searchModel_EmployerId").val('0');
|
||||
|
||||
//----clean Employee------
|
||||
// $("#SearchModel_EmployeeName").val('');
|
||||
// $("#SearchModel_Id").val('0');
|
||||
|
||||
|
||||
if ($(this).val() == '') {
|
||||
|
||||
}
|
||||
//stop submit form with enter
|
||||
var keyCode = e.keyCode || e.which;
|
||||
if (keyCode === 13) {
|
||||
e.preventDefault();
|
||||
if (countWorkshop > 0 && countWorkshop <= liListWorkshop.length) {
|
||||
liPointerWorkshop.click();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
searchBoxWorkshop.removeClass("selectedOption");
|
||||
let searchText = $(this).val();
|
||||
hiddenInputValWorkshop.val(0);
|
||||
|
||||
if (searchText.length > 1) {
|
||||
|
||||
$.ajax({
|
||||
async: false,
|
||||
contentType: 'charset=utf-8',
|
||||
dataType: 'json',
|
||||
type: 'GET',
|
||||
url: '@Url.Page("./Index", "WorkshopName")',
|
||||
data: { "searchText": searchText },
|
||||
headers: { "RequestVerificationToken": $('@Html.AntiForgeryToken()').val() },
|
||||
|
||||
success: function (response) {
|
||||
$(".opt").remove();
|
||||
if (response.mylist.length > 0) {//result Founded
|
||||
|
||||
// console.log(response.mylist);
|
||||
|
||||
$(".noResult").remove();
|
||||
containerWorkshop.show();
|
||||
$.each(response.mylist,
|
||||
function (i, item) {
|
||||
let li = `<li data-workshopId="${item.id}" class="btn btn-block opt" onclick="selectItemWorkshop(${item.id}, '${item.workshopFullName}');" >`;
|
||||
li = li + '<span class="name-right" > ' + item.workshopFullName + ' </span><span class="line">|</span> <span class="code-left" > ' + item.archiveCode + ' </span></li> ';
|
||||
searchResulWorkshop.append(li);
|
||||
});
|
||||
} else {//result NotFounded
|
||||
$(".noResult").remove();
|
||||
containerWorkshop.show();
|
||||
let noResult = `<li class="btn btn-block noResult">نتیجه ای یافت نشد</li>`;
|
||||
searchResulWorkshop.append(noResult);
|
||||
}
|
||||
}// endOfSuccess
|
||||
|
||||
}); //endOfAjax
|
||||
|
||||
} else {
|
||||
containerWorkshop.hide();
|
||||
countWorkshop = 0;
|
||||
}
|
||||
//keyboard Arrow Key Select And Enter
|
||||
liListWorkshop = $('#empWorkshop ul li');
|
||||
mixContainerAndSerchResultWorkshop.animate({
|
||||
scrollTop: $(liListWorkshop.eq(0)).offset().top - containerWorkshop.offset().top + containerWorkshop.scrollTop()
|
||||
},
|
||||
50);
|
||||
if (e.which === 40) {// if ArrowUp
|
||||
if (countWorkshop > 0 && countWorkshop <= liListWorkshop.length) {
|
||||
|
||||
liPointerWorkshop.removeClass('keyboardSelected');
|
||||
console.log(countWorkshop + "plusOne");
|
||||
liListWorkshop.eq(countWorkshop).addClass('keyboardSelected');
|
||||
liPointerWorkshop = liListWorkshop.eq(countWorkshop);
|
||||
if (countWorkshop > 4) {
|
||||
//ScrollDown
|
||||
mixContainerAndSerchResultWorkshop.animate({
|
||||
scrollTop: $(liPointerWorkshop).offset().top - containerWorkshop.offset().top + containerWorkshop.scrollTop()
|
||||
},
|
||||
50);
|
||||
}
|
||||
countWorkshop += 1;
|
||||
|
||||
} else {
|
||||
|
||||
liListWorkshop.eq(0).addClass("keyboardSelected");
|
||||
liPointerWorkshop = liListWorkshop.eq(0);
|
||||
countWorkshop = 1;
|
||||
}
|
||||
} else if (e.which === 38) {//if ArrowDown
|
||||
if (countWorkshop > 0 && countWorkshop <= liListWorkshop.length) {
|
||||
liPointerWorkshop.removeClass('keyboardSelected');
|
||||
countWorkshop -= 1;
|
||||
liListWorkshop.eq(countWorkshop).addClass('keyboardSelected');
|
||||
liPointerWorkshop = liListWorkshop.eq(countWorkshop);
|
||||
//ScrollUp
|
||||
mixContainerAndSerchResultWorkshop.animate({
|
||||
scrollTop: $(liPointerWorkshop).offset().top - containerWorkshop.offset().top + containerWorkshop.scrollTop()
|
||||
},
|
||||
50);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
$("#empSearchWorkshop").keypress(function (event) {
|
||||
$(".form-control").removeClass("selectedOption");
|
||||
|
||||
$("#empSearchEmployer").val('');
|
||||
$("#empSearch").val('');
|
||||
|
||||
$("#searchModel_EmployerName").val('');
|
||||
$("#searchModel_EmployerId").val('');
|
||||
|
||||
// $("#SearchModel_Id").val("0");
|
||||
// $("#SearchModel_EmployeeName").val('');
|
||||
|
||||
if (event.keyCode === 13) {
|
||||
if ($("#searchModel_WorkshopId").val() == "0")
|
||||
$("#searchModel_WorkShopName").val($("#empSearchWorkshop").val())
|
||||
$('.btn-search1').click();
|
||||
}
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
<script>
|
||||
//------Employer-----
|
||||
var containerEmployer = $('#empEmployer');
|
||||
var searchBoxEmployer = $('#empSearchEmployer');
|
||||
var hiddenInputValEmployer = $('.sendEmployerId');
|
||||
var searchResulEmployer = $('.searchResultEmployer');
|
||||
var mixContainerAndSerchResultEmployer = $('#empEmployer , .searchResultEmployer');
|
||||
|
||||
containerEmployer.hide();
|
||||
var liListEmployer;
|
||||
var liPointerEmployer;
|
||||
let countEmployer = 0;
|
||||
|
||||
//close search Employee when click on body
|
||||
$(document).on('click', function (event) {
|
||||
if (!$(event.target).closest(containerEmployer).length) {
|
||||
containerEmployer.hide();
|
||||
}
|
||||
});
|
||||
//select option by mouse
|
||||
function selectItemEmployer(id, employeeFullName) {
|
||||
searchBoxEmployer.val(employeeFullName);
|
||||
hiddenInputValEmployer.val(id);
|
||||
containerEmployer.hide();
|
||||
searchBoxEmployer.addClass("selectedOption");
|
||||
};
|
||||
//search by Ajax
|
||||
searchBoxEmployer.on('keyup keypress',
|
||||
function (e) {
|
||||
$(".form-control").removeClass("selectedOption");
|
||||
|
||||
//----clean Workshop------
|
||||
$("#empSearchWorkshop").val('');
|
||||
$("#searchModel_WorkShopName").val('');
|
||||
|
||||
//----clean Employee------
|
||||
// $("#SearchModel_EmployeeName").val('');
|
||||
// $("#SearchModel_Id").val('0');
|
||||
|
||||
|
||||
if ($(this).val() == '') {
|
||||
$("#searchModel_EmployerId").val("0");
|
||||
$("#searchModel_EmployerName").val('');
|
||||
}
|
||||
//stop submit form with enter
|
||||
var keyCode = e.keyCode || e.which;
|
||||
if (keyCode === 13) {
|
||||
e.preventDefault();
|
||||
if (countEmployer > 0 && countEmployer <= liListEmployer.length) {
|
||||
liPointerEmployer.click();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
searchBoxEmployer.removeClass("selectedOption");
|
||||
let searchText = $(this).val();
|
||||
hiddenInputValEmployer.val(0);
|
||||
|
||||
if (searchText.length > 1) {
|
||||
|
||||
$.ajax({
|
||||
async: false,
|
||||
contentType: 'charset=utf-8',
|
||||
dataType: 'json',
|
||||
type: 'GET',
|
||||
url: '@Url.Page("./Index", "EmployerName")',
|
||||
data: { "searchText": searchText },
|
||||
headers: { "RequestVerificationToken": $('@Html.AntiForgeryToken()').val() },
|
||||
|
||||
success: function (response) {
|
||||
$(".opt").remove();
|
||||
if (response.mylist.length > 0) {//result Founded
|
||||
|
||||
console.log(response.mylist);
|
||||
|
||||
$(".noResult").remove();
|
||||
containerEmployer.show();
|
||||
$.each(response.mylist,
|
||||
function (i, item) {
|
||||
let li = `<li data-employeeId="${item.id}" class="btn btn-block opt" onclick="selectItemEmployer(${item.id}, '${item.lName}');" >${item.lName}</li>`;
|
||||
searchResulEmployer.append(li);
|
||||
|
||||
});
|
||||
} else {//result NotFounded
|
||||
|
||||
$(".noResult").remove();
|
||||
containerEmployer.show();
|
||||
let noResult = `<li class="btn btn-block noResult">نتیجه ای یافت نشد</li>`;
|
||||
searchResulEmployer.append(noResult);
|
||||
}
|
||||
}// endOfSuccess
|
||||
|
||||
}); //endOfAjax
|
||||
|
||||
} else {
|
||||
containerEmployer.hide();
|
||||
countEmployer = 0;
|
||||
}
|
||||
//keyboard Arrow Key Select And Enter
|
||||
liListEmployer = $('#empEmployer ul li');
|
||||
mixContainerAndSerchResultEmployer.animate({
|
||||
scrollTop: $(liListEmployer.eq(0)).offset().top - containerEmployer.offset().top + containerEmployer.scrollTop()
|
||||
},
|
||||
50);
|
||||
if (e.which === 40) {// if ArrowUp
|
||||
if (countEmployer > 0 && countEmployer <= liListEmployer.length) {
|
||||
|
||||
liPointerEmployer.removeClass('keyboardSelected');
|
||||
console.log(countEmployer + "plusOne");
|
||||
liListEmployer.eq(countEmployer).addClass('keyboardSelected');
|
||||
liPointerEmployer = liListEmployer.eq(countEmployer);
|
||||
if (countEmployer > 4) {
|
||||
//ScrollDown
|
||||
mixContainerAndSerchResultEmployer.animate({
|
||||
scrollTop: $(liPointerEmployer).offset().top - containerEmployer.offset().top + containerEmployer.scrollTop()
|
||||
},
|
||||
50);
|
||||
}
|
||||
countEmployer += 1;
|
||||
|
||||
} else {
|
||||
|
||||
liListEmployer.eq(0).addClass("keyboardSelected");
|
||||
liPointerEmployer = liListEmployer.eq(0);
|
||||
countEmployer = 1;
|
||||
}
|
||||
} else if (e.which === 38) {//if ArrowDown
|
||||
if (countEmployer > 0 && countEmployer <= liListEmployer.length) {
|
||||
liPointerEmployer.removeClass('keyboardSelected');
|
||||
countEmployer -= 1;
|
||||
liListEmployer.eq(countEmployer).addClass('keyboardSelected');
|
||||
liPointerEmployer = liListEmployer.eq(countEmployer);
|
||||
//ScrollUp
|
||||
mixContainerAndSerchResultEmployer.animate({
|
||||
scrollTop: $(liPointerEmployer).offset().top - containerEmployer.offset().top + containerEmployer.scrollTop()
|
||||
},
|
||||
50);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
$("#empSearchEmployer").keypress(function (event) {
|
||||
$(".form-control").removeClass("selectedOption");
|
||||
|
||||
$("#empSearch").val('');
|
||||
$("#empSearchWorkshop").val('');
|
||||
|
||||
$("#searchModel_WorkshopId").val("0");
|
||||
$("#searchModel_WorkShopName").val('');
|
||||
|
||||
// $("#SearchModel_Id").val("0");
|
||||
// $("#SearchModel_EmployeeName").val('');
|
||||
|
||||
if (event.keyCode === 13) {
|
||||
if ($("#searchModel_EmployerId").val() == "0")
|
||||
$("#searchModel_EmployerName").val($("#empSearchEmployer").val())
|
||||
$('.btn-search1').click();
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
</script>
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,215 @@
|
||||
@using CompanyManagment.App.Contracts.InsuranceList.Enums
|
||||
@using Microsoft.AspNetCore.Mvc.TagHelpers
|
||||
@model CompanyManagment.App.Contracts.InsuranceList.InsuranceListConfirmOperation
|
||||
|
||||
@{
|
||||
string adminVersion = _0_Framework.Application.Version.AdminVersion;
|
||||
<link href="~/assetsadmin/page/insurancelist/css/operationsmodal.css?ver=@adminVersion" rel="stylesheet" />
|
||||
}
|
||||
|
||||
<form role="form" method="post" name="create-form" id="create-form" autocomplete="off">
|
||||
<div class="container">
|
||||
<div class="modal-custom">
|
||||
<div class="modal__header">
|
||||
<h2 class="modal__title">تکمیل اطلاعات بیمه</h2>
|
||||
<button type="button" class="modal__close" data-dismiss="modal" aria-hidden="true">
|
||||
<svg width="35" height="35" viewBox="0 0 44 44" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M22 38.5C19.8332 38.5 17.6876 38.0732 15.6857 37.244C13.6839 36.4148 11.8649 35.1994 10.3327 33.6673C8.80057 32.1351 7.58519 30.3161 6.75599 28.3143C5.92678 26.3124 5.5 24.1668 5.5 22C5.5 19.8332 5.92679 17.6876 6.75599 15.6857C7.58519 13.6838 8.80057 11.8649 10.3327 10.3327C11.8649 8.80057 13.6839 7.58519 15.6857 6.75599C17.6876 5.92678 19.8332 5.5 22 5.5C24.1668 5.5 26.3124 5.92679 28.3143 6.75599C30.3162 7.58519 32.1351 8.80057 33.6673 10.3327C35.1994 11.8649 36.4148 13.6839 37.244 15.6857C38.0732 17.6876 38.5 19.8332 38.5 22C38.5 24.1668 38.0732 26.3124 37.244 28.3143C36.4148 30.3162 35.1994 32.1351 33.6673 33.6673C32.1351 35.1994 30.3161 36.4148 28.3143 37.244C26.3124 38.0732 24.1668 38.5 22 38.5L22 38.5Z" stroke="#33363F" stroke-width="2" stroke-linecap="round"/>
|
||||
<path d="M16.5 16.5L27.5 27.5" stroke="#33363F" stroke-width="2" stroke-linecap="round"/>
|
||||
<path d="M27.5 16.5L16.5 27.5" stroke="#33363F" stroke-width="2" stroke-linecap="round"/>
|
||||
</svg>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="modal__content">
|
||||
<input type="hidden" asp-for="@Model.InsuranceListId" />
|
||||
|
||||
<div class="card-action @(Model.Inspection.Type == InsuranceListInspectionType.None ? "" : "card-action__success")" style="pointer-events: @(Model.ConfirmSentList ? "none" : "auto")">
|
||||
<div class="card-action__title">بازرسی</div>
|
||||
|
||||
<div class="card-action__container">
|
||||
<div class="card-action__container-right">
|
||||
<div class="card-action__status @(Model.Inspection.Type == InsuranceListInspectionType.None ? "" : "card-action__status-success")">
|
||||
<div class="card-action__status-icon">
|
||||
<svg class="card-action__status-icon-svg" width="64" height="64" viewBox="0 0 64 64" fill="none" xmlns="http://www.w3.org/2000/svg" style="display: @(Model.Inspection.Type == InsuranceListInspectionType.None ? "none" : "block")">
|
||||
<circle cx="31.9998" cy="31.9974" r="21.3333" fill="#35EA08"/>
|
||||
<path d="M25.3335 31.9974L30.5608 37.2247C30.6193 37.2832 30.7143 37.2832 30.7729 37.2247L41.3335 26.6641" stroke="white" stroke-width="3" stroke-linecap="round"/>
|
||||
</svg>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card-action__inspection-type">
|
||||
<label class="card-action__checkbox">
|
||||
<input name="Inspection.Type" type="checkbox" @(Model.Inspection.Type == InsuranceListInspectionType.Old ? "checked" : "") value="1" />
|
||||
بازرسی قدیمی
|
||||
</label>
|
||||
|
||||
<label class="card-action__checkbox">
|
||||
<input name="Inspection.Type" type="checkbox" @(Model.Inspection.Type == InsuranceListInspectionType.New ? "checked" : "") value="2" />
|
||||
بازرسی جدید
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card-action__container-left">
|
||||
<div class="card-action__date">
|
||||
<label class="card-action__label" for="last-inspection-date">تاریخ آخرین بازرسی</label>
|
||||
<input type="text" id="last-inspection-date" class="card-action__input date" placeholder="____/__/__" asp-for="@Model.Inspection.LastInspectionDate">
|
||||
</div>
|
||||
|
||||
<div class="card-action__upload" id="card-inspection">
|
||||
<div class="card-action__upload-icon">
|
||||
<img src="~/assetsclient/images/icons/upload.png" style="width: 35px;" />
|
||||
</div>
|
||||
@if (Model.Inspection.InspectionFileMediaId != 0)
|
||||
{
|
||||
<button type="button" class="card-action__upload-btn remove-file-btn" data-type="inspection">حذف فایل</button>
|
||||
}
|
||||
else
|
||||
{
|
||||
<button type="button" class="card-action__upload-btn choose-file-btn" data-type="inspection">انتخاب فایل</button>
|
||||
}
|
||||
<input type="file" name="Inspection.InspectionFile" style="display: none;" data-type="inspection">
|
||||
<input type="hidden" class="mediaIds" asp-for="@Model.Inspection.InspectionFileMediaId" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card-action @(Model.Debt.Type == InsuranceListDebtType.None ? "" : "card-action__success")" style="pointer-events: @(Model.ConfirmSentList ? "none" : "auto")">
|
||||
<div class="card-action__title">بدهی</div>
|
||||
|
||||
<div class="card-action__container">
|
||||
<div class="card-action__container-right">
|
||||
<div class="card-action__status @(Model.Debt.Type == InsuranceListDebtType.None ? "" : "card-action__status-success")">
|
||||
<div class="card-action__status-icon">
|
||||
<svg class="card-action__status-icon-svg" width="64" height="64" viewBox="0 0 64 64" fill="none" xmlns="http://www.w3.org/2000/svg" style="display: @(Model.Debt.Type == InsuranceListDebtType.None ? "none" : "block")">
|
||||
<circle cx="31.9998" cy="31.9974" r="21.3333" fill="#35EA08"/>
|
||||
<path d="M25.3335 31.9974L30.5608 37.2247C30.6193 37.2832 30.7143 37.2832 30.7729 37.2247L41.3335 26.6641" stroke="white" stroke-width="3" stroke-linecap="round"/>
|
||||
</svg>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card-action__inspection-type">
|
||||
<label class="card-action__checkbox">
|
||||
<input name="Debt.Type" type="checkbox" @(Model.Debt.Type == InsuranceListDebtType.Old ? "checked" : "") value="1" />
|
||||
بدهی قدیمی
|
||||
</label>
|
||||
|
||||
<label class="card-action__checkbox">
|
||||
<input name="Debt.Type" type="checkbox" @(Model.Debt.Type == InsuranceListDebtType.New ? "checked" : "") value="2" />
|
||||
بدهی جدید
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card-action__container-left">
|
||||
<div class="card-action__inspection-type">
|
||||
<div class="card-action__date--group">
|
||||
<div class="card-action__date">
|
||||
<label class="card-action__label" for="last-inspection-date">تاریخ</label>
|
||||
<input type="text" asp-for="@Model.Debt.DebtDate" class="card-action__input date" placeholder="____/__/__">
|
||||
</div>
|
||||
<div class="card-action__price">
|
||||
<label class="card-action__label" for="last-inspection-date">مبلغ</label>
|
||||
<input type="text" asp-for="@Model.Debt.Amount" class="card-action__input" placeholder="">
|
||||
<span class="card-action__price-rial">ریال</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card-action__upload" id="card-debt">
|
||||
<div class="card-action__upload-icon">
|
||||
<img src="~/assetsclient/images/icons/upload.png" style="width: 35px;" />
|
||||
</div>
|
||||
@if (Model.Debt.DebtFileMediaId != 0)
|
||||
{
|
||||
<button type="button" class="card-action__upload-btn remove-file-btn" data-type="debt">حذف فایل</button>
|
||||
}
|
||||
else
|
||||
{
|
||||
<button type="button" class="card-action__upload-btn choose-file-btn" data-type="debt">انتخاب فایل</button>
|
||||
}
|
||||
<input type="file" name="Debt.DebtFile" style="display: none;" data-type="debt">
|
||||
<input type="hidden" class="mediaIds" asp-for="@Model.Debt.DebtFileMediaId" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card-action @(Model.Approval.ApprovalStatus == InsuranceListEmployerApprovalStatus.WrittenApproval ? "card-action__success" : "")" style="pointer-events: @(Model.ConfirmSentList ? "none" : "auto")">
|
||||
<div class="card-action__title">تاییده کارفرما</div>
|
||||
|
||||
<div class="card-action__container">
|
||||
<div class="card-action__container-right">
|
||||
<div class="card-action__status @(Model.Approval.ApprovalStatus == InsuranceListEmployerApprovalStatus.WrittenApproval ? "" : "card-action__status-success")">
|
||||
<div class="card-action__status-icon">
|
||||
<svg class="card-action__status-icon-svg d-none" width="64" height="64" viewBox="0 0 64 64" fill="none" xmlns="http://www.w3.org/2000/svg" style="display: @(Model.Approval.ApprovalStatus == InsuranceListEmployerApprovalStatus.WrittenApproval ? "none" : "block")">
|
||||
<circle cx="31.9998" cy="31.9974" r="21.3333" fill="#35EA08"/>
|
||||
<path d="M25.3335 31.9974L30.5608 37.2247C30.6193 37.2832 30.7143 37.2832 30.7729 37.2247L41.3335 26.6641" stroke="white" stroke-width="3" stroke-linecap="round"/>
|
||||
</svg>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card-action__inspection-type">
|
||||
<label class="card-action__checkbox">
|
||||
<input type="checkbox" name="Approval.ApprovalStatus" class="WrittenVerbal" id="Written" @(Model.Approval.ApprovalStatus == InsuranceListEmployerApprovalStatus.WrittenApproval ? "checked" : "") value="2" />
|
||||
کاغذی
|
||||
</label>
|
||||
|
||||
<label class="card-action__checkbox">
|
||||
<input type="checkbox" name="Approval.ApprovalStatus" class="WrittenVerbal" id="Verbal" @(Model.Approval.ApprovalStatus == InsuranceListEmployerApprovalStatus.VerbalApproval ? "checked" : "") value="1" />
|
||||
اذنی
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card-action__container-left">
|
||||
<div id="descriptionSection" class="card-action__date disable">
|
||||
<label class="card-action__label" for="description">توضیحات</label>
|
||||
<textarea class="card-action__textarea" asp-for="@Model.Approval.Description" id="description"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="sendListSection" class="card-action @(Model.Inspection.Type == InsuranceListInspectionType.None || Model.Debt.Type == InsuranceListDebtType.None || Model.Approval.ApprovalStatus == InsuranceListEmployerApprovalStatus.None ? "disable-blur" : "")">
|
||||
<div class="card-action__title">ارسال لیست</div>
|
||||
|
||||
<div class="card-action__container">
|
||||
<div class="card-action__container-right">
|
||||
<div class="card-action__status @(Model.ConfirmSentList ? "card-action__status-success" : "")">
|
||||
<div class="card-action__status-icon">
|
||||
<svg class="card-action__status-icon-svg d-none" width="64" height="64" viewBox="0 0 64 64" fill="none" xmlns="http://www.w3.org/2000/svg" style="display: @(Model.ConfirmSentList ? "block" : "none")">
|
||||
<circle cx="31.9998" cy="31.9974" r="21.3333" fill="#35EA08"/>
|
||||
<path d="M25.3335 31.9974L30.5608 37.2247C30.6193 37.2832 30.7143 37.2832 30.7729 37.2247L41.3335 26.6641" stroke="white" stroke-width="3" stroke-linecap="round"/>
|
||||
</svg>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card-action__inspection-type">
|
||||
<label class="card-action__checkbox">
|
||||
<input name="ConfirmSentList" type="checkbox" @(Model.ConfirmSentList ? "checked" : "") value="true"/>
|
||||
ارسال لیست به سازمان تامین اجتماعی انجام شد
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="modal__footer">
|
||||
<button type="button" class="modal__button modal__button--cancel" data-dismiss="modal" aria-hidden="true">انصراف</button>
|
||||
<button type="button" class="modal__button modal__button--success" onclick="SaveData()">ثبت</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<script>
|
||||
var antiForgeryToken = $(`@Html.AntiForgeryToken()`).val();
|
||||
var saveOperationsModal = "@Url.Page("./Index", "SaveOperationsModal")";
|
||||
</script>
|
||||
<script src="~/assetsadmin/page/insurancelist/js/operationsmodal.js?ver=@adminVersion"></script>
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user