Compare commits
29 Commits
Feature/Ch
...
Feature/In
| Author | SHA1 | Date | |
|---|---|---|---|
| 3b2fd137e4 | |||
| 2098e843a5 | |||
| f6b6dfa046 | |||
|
|
c948498307 | ||
| f35aca8e44 | |||
| 16d45c6dc4 | |||
| 45e746b194 | |||
| e3b6d5f1c9 | |||
| 7c1fe65cf2 | |||
| f26fcba165 | |||
|
|
de2a6203df | ||
|
|
2208834a0e | ||
| de52a0be98 | |||
|
|
5bebec3fde | ||
|
|
cad808d73c | ||
| abef053f56 | |||
| 6469bf5a50 | |||
|
|
4fd5ef52ef | ||
|
|
61e2bdaaf5 | ||
| 8ab22d9948 | |||
|
|
17b5f5fee5 | ||
| 9e7e4ca655 | |||
|
|
100c9367ed | ||
| fdb6799c65 | |||
|
|
c81da3e787 | ||
|
|
d8c0471878 | ||
|
|
f04749043e | ||
|
|
e8a9a674a1 | ||
|
|
d8b6b0f5e8 |
@@ -12,65 +12,65 @@ namespace _0_Framework.Application;
|
||||
|
||||
public class AuthHelper : IAuthHelper
|
||||
{
|
||||
private readonly IHttpContextAccessor _contextAccessor;
|
||||
|
||||
public AuthHelper(IHttpContextAccessor contextAccessor)
|
||||
{
|
||||
_contextAccessor = contextAccessor;
|
||||
}
|
||||
private readonly IHttpContextAccessor _contextAccessor;
|
||||
|
||||
public AuthViewModel CurrentAccountInfo()
|
||||
{
|
||||
var result = new AuthViewModel();
|
||||
if (!IsAuthenticated())
|
||||
return result;
|
||||
public AuthHelper(IHttpContextAccessor contextAccessor)
|
||||
{
|
||||
_contextAccessor = contextAccessor;
|
||||
}
|
||||
|
||||
var claims = _contextAccessor.HttpContext.User.Claims.ToList();
|
||||
result.Id = long.Parse(claims.FirstOrDefault(x => x.Type == "AccountId").Value);
|
||||
result.Username = claims.FirstOrDefault(x => x.Type == "Username")?.Value;
|
||||
result.ProfilePhoto = claims.FirstOrDefault(x => x.Type == "ProfilePhoto")?.Value;
|
||||
result.RoleId = long.Parse(claims.FirstOrDefault(x => x.Type == ClaimTypes.Role)?.Value);
|
||||
result.Fullname = claims.FirstOrDefault(x => x.Type == ClaimTypes.Name)?.Value;
|
||||
result.Role = claims.FirstOrDefault(x => x.Type == "RoleName")?.Value;
|
||||
result.ClientAriaPermission =claims.FirstOrDefault(x => x.Type == "ClientAriaPermission").Value;
|
||||
result.AdminAreaPermission = claims.FirstOrDefault(x => x.Type == "AdminAreaPermission").Value;
|
||||
result.PositionValue = !string.IsNullOrWhiteSpace(claims.FirstOrDefault(x => x.Type == "PositionValue")?.Value) ? int.Parse(claims.FirstOrDefault(x => x.Type == "PositionValue")?.Value) : 0;
|
||||
result.WorkshopList = Tools.DeserializeFromBsonList<WorkshopClaim>(claims.FirstOrDefault(x => x is { Type: "workshopList" })?.Value);
|
||||
result.WorkshopSlug = claims.FirstOrDefault(x => x is { Type: "WorkshopSlug" }).Value;
|
||||
result.Mobile = claims.FirstOrDefault(x => x is { Type: "Mobile" }).Value;
|
||||
public AuthViewModel CurrentAccountInfo()
|
||||
{
|
||||
var result = new AuthViewModel();
|
||||
if (!IsAuthenticated())
|
||||
return result;
|
||||
|
||||
var claims = _contextAccessor.HttpContext.User.Claims.ToList();
|
||||
result.Id = long.Parse(claims.FirstOrDefault(x => x.Type == "AccountId").Value);
|
||||
result.Username = claims.FirstOrDefault(x => x.Type == "Username")?.Value;
|
||||
result.ProfilePhoto = claims.FirstOrDefault(x => x.Type == "ProfilePhoto")?.Value;
|
||||
result.RoleId = long.Parse(claims.FirstOrDefault(x => x.Type == ClaimTypes.Role)?.Value);
|
||||
result.Fullname = claims.FirstOrDefault(x => x.Type == ClaimTypes.Name)?.Value;
|
||||
result.Role = claims.FirstOrDefault(x => x.Type == "RoleName")?.Value;
|
||||
result.ClientAriaPermission = claims.FirstOrDefault(x => x.Type == "ClientAriaPermission").Value;
|
||||
result.AdminAreaPermission = claims.FirstOrDefault(x => x.Type == "AdminAreaPermission").Value;
|
||||
result.PositionValue = !string.IsNullOrWhiteSpace(claims.FirstOrDefault(x => x.Type == "PositionValue")?.Value) ? int.Parse(claims.FirstOrDefault(x => x.Type == "PositionValue")?.Value) : 0;
|
||||
result.WorkshopList = Tools.DeserializeFromBsonList<WorkshopClaim>(claims.FirstOrDefault(x => x is { Type: "workshopList" })?.Value);
|
||||
result.WorkshopSlug = claims.FirstOrDefault(x => x is { Type: "WorkshopSlug" }).Value;
|
||||
result.Mobile = claims.FirstOrDefault(x => x is { Type: "Mobile" }).Value;
|
||||
result.SubAccountId = long.Parse(claims.FirstOrDefault(x => x.Type == "SubAccountId").Value);
|
||||
result.WorkshopName = claims.FirstOrDefault(x => x is { Type: "WorkshopName" })?.Value;
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
public List<int> GetPermissions()
|
||||
{
|
||||
if (!IsAuthenticated())
|
||||
return new List<int>();
|
||||
public List<int> GetPermissions()
|
||||
{
|
||||
if (!IsAuthenticated())
|
||||
return new List<int>();
|
||||
|
||||
var permissions = _contextAccessor.HttpContext.User.Claims.FirstOrDefault(x => x.Type == "permissions")
|
||||
?.Value;
|
||||
return Tools.DeserializeFromBsonList<int>(permissions); //Mahan
|
||||
}
|
||||
var permissions = _contextAccessor.HttpContext.User.Claims.FirstOrDefault(x => x.Type == "permissions")
|
||||
?.Value;
|
||||
return Tools.DeserializeFromBsonList<int>(permissions); //Mahan
|
||||
}
|
||||
|
||||
public long CurrentAccountId()
|
||||
{
|
||||
return IsAuthenticated()
|
||||
? long.Parse(_contextAccessor.HttpContext.User.Claims.First(x => x.Type == "AccountId")?.Value)
|
||||
: 0;
|
||||
}
|
||||
public long CurrentSubAccountId()
|
||||
{
|
||||
return IsAuthenticated()
|
||||
? long.Parse(_contextAccessor.HttpContext.User.Claims.First(x => x.Type == "SubAccountId")?.Value)
|
||||
: 0;
|
||||
}
|
||||
public long CurrentAccountId()
|
||||
{
|
||||
return IsAuthenticated()
|
||||
? long.Parse(_contextAccessor.HttpContext.User.Claims.First(x => x.Type == "AccountId")?.Value)
|
||||
: 0;
|
||||
}
|
||||
public long CurrentSubAccountId()
|
||||
{
|
||||
return IsAuthenticated()
|
||||
? long.Parse(_contextAccessor.HttpContext.User.Claims.First(x => x.Type == "SubAccountId")?.Value)
|
||||
: 0;
|
||||
}
|
||||
public string CurrentAccountMobile()
|
||||
{
|
||||
return IsAuthenticated()
|
||||
? _contextAccessor.HttpContext.User.Claims.First(x => x.Type == "Mobile")?.Value
|
||||
: "";
|
||||
}
|
||||
{
|
||||
return IsAuthenticated()
|
||||
? _contextAccessor.HttpContext.User.Claims.First(x => x.Type == "Mobile")?.Value
|
||||
: "";
|
||||
}
|
||||
|
||||
#region Vafa
|
||||
|
||||
@@ -111,160 +111,166 @@ public class AuthHelper : IAuthHelper
|
||||
}
|
||||
|
||||
public string GetWorkshopSlug()
|
||||
{
|
||||
return CurrentAccountInfo().ClientAriaPermission == "true"
|
||||
? _contextAccessor.HttpContext.User.Claims.First(x => x.Type == "WorkshopSlug")?.Value
|
||||
: "";
|
||||
}
|
||||
public string GetWorkshopName()
|
||||
{
|
||||
var workshopName = _contextAccessor.HttpContext.User.Claims.FirstOrDefault(x => x.Type == "ClientAriaPermission")?.Value == "true";
|
||||
if (workshopName)
|
||||
{
|
||||
return _contextAccessor.HttpContext.User.Claims.First(x => x.Type == "WorkshopName")?.Value;
|
||||
}
|
||||
{
|
||||
return CurrentAccountInfo().ClientAriaPermission == "true"
|
||||
? _contextAccessor.HttpContext.User.Claims.First(x => x.Type == "WorkshopSlug")?.Value
|
||||
: "";
|
||||
}
|
||||
public string GetWorkshopName()
|
||||
{
|
||||
var workshopName = _contextAccessor.HttpContext.User.Claims.FirstOrDefault(x => x.Type == "ClientAriaPermission")?.Value == "true";
|
||||
if (workshopName)
|
||||
{
|
||||
return _contextAccessor.HttpContext.User.Claims.First(x => x.Type == "WorkshopName")?.Value;
|
||||
}
|
||||
|
||||
return "";
|
||||
}
|
||||
return "";
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
public string CurrentAccountRole()
|
||||
{
|
||||
if (IsAuthenticated())
|
||||
return _contextAccessor.HttpContext.User.Claims.FirstOrDefault(x => x.Type == ClaimTypes.Role)?.Value;
|
||||
return null;
|
||||
}
|
||||
{
|
||||
if (IsAuthenticated())
|
||||
return _contextAccessor.HttpContext.User.Claims.FirstOrDefault(x => x.Type == ClaimTypes.Role)?.Value;
|
||||
return null;
|
||||
}
|
||||
|
||||
public bool IsAuthenticated()
|
||||
{
|
||||
return _contextAccessor.HttpContext.User.Identity.IsAuthenticated;
|
||||
//var claims = _contextAccessor.HttpContext.User.Claims.ToList();
|
||||
//if (claims.Count > 0)
|
||||
// return true;
|
||||
//return false;
|
||||
//return claims.Count > 0;
|
||||
}
|
||||
public bool IsAuthenticated()
|
||||
{
|
||||
return _contextAccessor.HttpContext.User.Identity.IsAuthenticated;
|
||||
//var claims = _contextAccessor.HttpContext.User.Claims.ToList();
|
||||
//if (claims.Count > 0)
|
||||
// return true;
|
||||
//return false;
|
||||
//return claims.Count > 0;
|
||||
}
|
||||
|
||||
public void Signin(AuthViewModel account)
|
||||
{
|
||||
#region MahanChanges
|
||||
public void Signin(AuthViewModel account)
|
||||
{
|
||||
#region MahanChanges
|
||||
|
||||
var permissions = account.Permissions is { Count: > 0 } ? Tools.SerializeToBson(account.Permissions) : "";
|
||||
var workshopBson = account.WorkshopList is { Count: > 0 } ? Tools.SerializeToBson(account.WorkshopList) : "";
|
||||
var slug = account.WorkshopSlug ?? "";
|
||||
if (account.Id == 322)
|
||||
account.Permissions.AddRange([3060301, 30603, 30604, 30605]);
|
||||
|
||||
#endregion
|
||||
var permissions = account.Permissions is { Count: > 0 } ? Tools.SerializeToBson(account.Permissions) : "";
|
||||
|
||||
var claims = new List<Claim>
|
||||
{
|
||||
new Claim("AccountId", account.Id.ToString()),
|
||||
new Claim(ClaimTypes.Name, account.Fullname),
|
||||
new Claim(ClaimTypes.Role, account.RoleId.ToString()),
|
||||
new Claim("Username", account.Username), // Or Use ClaimTypes.NameIdentifier
|
||||
|
||||
|
||||
var workshopBson = account.WorkshopList is { Count: > 0 } ? Tools.SerializeToBson(account.WorkshopList) : "";
|
||||
var slug = account.WorkshopSlug ?? "";
|
||||
|
||||
#endregion
|
||||
|
||||
var claims = new List<Claim>
|
||||
{
|
||||
new Claim("AccountId", account.Id.ToString()),
|
||||
new Claim(ClaimTypes.Name, account.Fullname),
|
||||
new Claim(ClaimTypes.Role, account.RoleId.ToString()),
|
||||
new Claim("Username", account.Username), // Or Use ClaimTypes.NameIdentifier
|
||||
new Claim("permissions", permissions),
|
||||
new Claim("Mobile", account.Mobile),
|
||||
new Claim("ProfilePhoto", account.ProfilePhoto ),
|
||||
new Claim("RoleName", account.RoleName),
|
||||
new Claim("SubAccountId", account.SubAccountId.ToString()),
|
||||
new Claim("Mobile", account.Mobile),
|
||||
new Claim("ProfilePhoto", account.ProfilePhoto ),
|
||||
new Claim("RoleName", account.RoleName),
|
||||
new Claim("SubAccountId", account.SubAccountId.ToString()),
|
||||
new Claim("AdminAreaPermission", account.AdminAreaPermission.ToString()),
|
||||
new Claim("ClientAriaPermission", account.ClientAriaPermission.ToString()),
|
||||
new Claim("IsCamera", "false"),
|
||||
new Claim("PositionValue",account.PositionValue.ToString()),
|
||||
new Claim("ClientAriaPermission", account.ClientAriaPermission.ToString()),
|
||||
new Claim("IsCamera", "false"),
|
||||
new Claim("PositionValue",account.PositionValue.ToString()),
|
||||
//mahanChanges
|
||||
new("workshopList",workshopBson),
|
||||
new("WorkshopSlug",slug),
|
||||
new("WorkshopName",account.WorkshopName??"")
|
||||
new("WorkshopSlug",slug),
|
||||
new("WorkshopName",account.WorkshopName??"")
|
||||
|
||||
};
|
||||
|
||||
var claimsIdentity = new ClaimsIdentity(claims, CookieAuthenticationDefaults.AuthenticationScheme);
|
||||
var claimsIdentity = new ClaimsIdentity(claims, CookieAuthenticationDefaults.AuthenticationScheme);
|
||||
|
||||
var authProperties = new AuthenticationProperties
|
||||
{
|
||||
ExpiresUtc = DateTimeOffset.UtcNow.AddDays(1)
|
||||
};
|
||||
var authProperties = new AuthenticationProperties
|
||||
{
|
||||
ExpiresUtc = DateTimeOffset.UtcNow.AddDays(1)
|
||||
};
|
||||
|
||||
_contextAccessor.HttpContext.SignInAsync(CookieAuthenticationDefaults.AuthenticationScheme,
|
||||
new ClaimsPrincipal(claimsIdentity),
|
||||
authProperties);
|
||||
}
|
||||
_contextAccessor.HttpContext.SignInAsync(CookieAuthenticationDefaults.AuthenticationScheme,
|
||||
new ClaimsPrincipal(claimsIdentity),
|
||||
authProperties);
|
||||
}
|
||||
|
||||
#region Camera
|
||||
public void CameraSignIn(CameraAuthViewModel account)
|
||||
{
|
||||
var claims = new List<Claim>
|
||||
{
|
||||
new Claim("AccountId", account.Id.ToString()),
|
||||
new Claim("Username", account.Username), // Or Use ClaimTypes.NameIdentifier
|
||||
#region Camera
|
||||
public void CameraSignIn(CameraAuthViewModel account)
|
||||
{
|
||||
var claims = new List<Claim>
|
||||
{
|
||||
new Claim("AccountId", account.Id.ToString()),
|
||||
new Claim("Username", account.Username), // Or Use ClaimTypes.NameIdentifier
|
||||
new Claim("WorkshopId", account.WorkshopId.ToString()),
|
||||
new Claim("WorkshopName", account.WorkshopName),
|
||||
new Claim("Mobile", account.Mobile),
|
||||
new Claim("AccountId", account.AccountId.ToString()),
|
||||
new Claim("IsActiveString", account.IsActiveString),
|
||||
new Claim("IsCamera", "true"),
|
||||
new Claim("WorkshopName", account.WorkshopName),
|
||||
new Claim("Mobile", account.Mobile),
|
||||
new Claim("AccountId", account.AccountId.ToString()),
|
||||
new Claim("IsActiveString", account.IsActiveString),
|
||||
new Claim("IsCamera", "true"),
|
||||
|
||||
};
|
||||
var claimsIdentity = new ClaimsIdentity(claims, CookieAuthenticationDefaults.AuthenticationScheme);
|
||||
};
|
||||
var claimsIdentity = new ClaimsIdentity(claims, CookieAuthenticationDefaults.AuthenticationScheme);
|
||||
|
||||
var authProperties = new AuthenticationProperties
|
||||
{
|
||||
var authProperties = new AuthenticationProperties
|
||||
{
|
||||
|
||||
//ExpiresUtc = DateTimeOffset.UtcNow.AddDays(30)
|
||||
ExpiresUtc = new DateTimeOffset(year: 2100, month: 1, day: 1, hour: 0, minute: 0, second: 0, offset: TimeSpan.Zero)
|
||||
};
|
||||
//ExpiresUtc = DateTimeOffset.UtcNow.AddDays(30)
|
||||
ExpiresUtc = new DateTimeOffset(year: 2100, month: 1, day: 1, hour: 0, minute: 0, second: 0, offset: TimeSpan.Zero)
|
||||
};
|
||||
|
||||
_contextAccessor.HttpContext.SignInAsync(CookieAuthenticationDefaults.AuthenticationScheme,
|
||||
new ClaimsPrincipal(claimsIdentity),
|
||||
authProperties);
|
||||
}
|
||||
_contextAccessor.HttpContext.SignInAsync(CookieAuthenticationDefaults.AuthenticationScheme,
|
||||
new ClaimsPrincipal(claimsIdentity),
|
||||
authProperties);
|
||||
}
|
||||
|
||||
public CameraAuthViewModel CameraAccountInfo()
|
||||
{
|
||||
var result = new CameraAuthViewModel();
|
||||
if (!IsAuthenticated())
|
||||
return result;
|
||||
public CameraAuthViewModel CameraAccountInfo()
|
||||
{
|
||||
var result = new CameraAuthViewModel();
|
||||
if (!IsAuthenticated())
|
||||
return result;
|
||||
|
||||
var claims = _contextAccessor.HttpContext.User.Claims.ToList();
|
||||
result.Id = long.Parse(claims.FirstOrDefault(x => x.Type == "AccountId").Value);
|
||||
result.Username = claims.FirstOrDefault(x => x.Type == "Username")?.Value;
|
||||
result.WorkshopId = long.Parse(claims.FirstOrDefault(x => x.Type == "WorkshopId")?.Value);
|
||||
result.WorkshopName = claims.FirstOrDefault(x => x.Type == "WorkshopName").Value;
|
||||
result.Mobile = claims.FirstOrDefault(x => x.Type == "Mobile").Value;
|
||||
result.AccountId = long.Parse(claims.FirstOrDefault(x => x.Type == "AccountId")?.Value);
|
||||
result.IsActiveString = claims.FirstOrDefault(x => x.Type == "IsActiveString").Value;
|
||||
return result;
|
||||
}
|
||||
#endregion
|
||||
var claims = _contextAccessor.HttpContext.User.Claims.ToList();
|
||||
result.Id = long.Parse(claims.FirstOrDefault(x => x.Type == "AccountId").Value);
|
||||
result.Username = claims.FirstOrDefault(x => x.Type == "Username")?.Value;
|
||||
result.WorkshopId = long.Parse(claims.FirstOrDefault(x => x.Type == "WorkshopId")?.Value);
|
||||
result.WorkshopName = claims.FirstOrDefault(x => x.Type == "WorkshopName").Value;
|
||||
result.Mobile = claims.FirstOrDefault(x => x.Type == "Mobile").Value;
|
||||
result.AccountId = long.Parse(claims.FirstOrDefault(x => x.Type == "AccountId")?.Value);
|
||||
result.IsActiveString = claims.FirstOrDefault(x => x.Type == "IsActiveString").Value;
|
||||
return result;
|
||||
}
|
||||
#endregion
|
||||
|
||||
public void SignOut()
|
||||
{
|
||||
_contextAccessor.HttpContext.SignOutAsync(CookieAuthenticationDefaults.AuthenticationScheme);
|
||||
}
|
||||
public void SignOut()
|
||||
{
|
||||
_contextAccessor.HttpContext.SignOutAsync(CookieAuthenticationDefaults.AuthenticationScheme);
|
||||
}
|
||||
|
||||
|
||||
#region Pooya
|
||||
#region Pooya
|
||||
|
||||
public (long Id, UserType userType, long roleId) GetUserTypeWithId()
|
||||
{
|
||||
if (!IsAuthenticated())
|
||||
return (0, UserType.Anonymous, 0);
|
||||
var claims = _contextAccessor.HttpContext.User.Claims.ToList();
|
||||
public (long Id, UserType userType, long roleId) GetUserTypeWithId()
|
||||
{
|
||||
if (!IsAuthenticated())
|
||||
return (0, UserType.Anonymous, 0);
|
||||
var claims = _contextAccessor.HttpContext.User.Claims.ToList();
|
||||
|
||||
var subAccountId = long.Parse(claims.FirstOrDefault(x => x.Type == "SubAccountId")?.Value ?? "0");
|
||||
if (subAccountId > 0)
|
||||
return (subAccountId, UserType.SubAccount, 0);
|
||||
var subAccountId = long.Parse(claims.FirstOrDefault(x => x.Type == "SubAccountId")?.Value ?? "0");
|
||||
if (subAccountId > 0)
|
||||
return (subAccountId, UserType.SubAccount, 0);
|
||||
|
||||
var id = long.Parse(_contextAccessor.HttpContext.User.Claims.First(x => x.Type == "AccountId")?.Value);
|
||||
if (claims.FirstOrDefault(x => x.Type == "AdminAreaPermission")?.Value == "true")
|
||||
{
|
||||
var roleId = long.Parse(claims.FirstOrDefault(x => x.Type == ClaimTypes.Role)?.Value ?? "0");
|
||||
return (id, UserType.Admin, roleId);
|
||||
}
|
||||
var id = long.Parse(_contextAccessor.HttpContext.User.Claims.First(x => x.Type == "AccountId")?.Value);
|
||||
if (claims.FirstOrDefault(x => x.Type == "AdminAreaPermission")?.Value == "true")
|
||||
{
|
||||
var roleId = long.Parse(claims.FirstOrDefault(x => x.Type == ClaimTypes.Role)?.Value ?? "0");
|
||||
return (id, UserType.Admin, roleId);
|
||||
}
|
||||
|
||||
return (id, UserType.Client, 0);
|
||||
}
|
||||
#endregion
|
||||
return (id, UserType.Client, 0);
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
}
|
||||
@@ -385,11 +385,27 @@
|
||||
/// </summary>
|
||||
public const int SetWorkshopWorkingHoursPermissionCode = 10606;
|
||||
|
||||
#region حساب کاربری دوربین
|
||||
|
||||
/// <summary>
|
||||
/// تنظیمات حساب کاربری دوربین
|
||||
/// </summary>
|
||||
public const int CameraAccountSettingsPermissionCode = 10607;
|
||||
|
||||
/// <summary>
|
||||
/// فعال/غیرفعال اکانت دوربین
|
||||
/// </summary>
|
||||
public const int CameraAccountActivationBtnPermissionCode = 1060701;
|
||||
|
||||
/// <summary>
|
||||
/// ویرایش اکانت دوربین
|
||||
/// </summary>
|
||||
public const int CameraAccountEditPermissionCode = 1060702;
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
#region کارپوشه
|
||||
@@ -744,6 +760,22 @@
|
||||
Code = CameraAccountSettingsPermissionCode,
|
||||
ParentId = RollCallOperationsPermissionCode
|
||||
};
|
||||
|
||||
public static SubAccountPermissionDto CameraAccountActivationBtn { get; } = new()
|
||||
{
|
||||
Id = CameraAccountActivationBtnPermissionCode,
|
||||
Name = "فعال/غیرفعال حساب کاربری دوربین",
|
||||
Code = CameraAccountActivationBtnPermissionCode,
|
||||
ParentId = CameraAccountSettingsPermissionCode
|
||||
};
|
||||
|
||||
public static SubAccountPermissionDto CameraAccountEdit { get; } = new()
|
||||
{
|
||||
Id = CameraAccountEditPermissionCode,
|
||||
Name = "ویراش حساب کاربری دوربین",
|
||||
Code = CameraAccountEditPermissionCode,
|
||||
ParentId = CameraAccountSettingsPermissionCode
|
||||
};
|
||||
#endregion
|
||||
|
||||
#region کارپوشه,ParentId = WorkFlowOperationsPermissionCode
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
@@ -16,7 +16,7 @@ public class TaskSchedule:EntityBase
|
||||
UnitType = unitType;
|
||||
UnitNumber = unitNumber;
|
||||
LastEndTaskDate = lastEndTaskDate;
|
||||
IsActive = IsActive.False;
|
||||
IsActive = IsActive.True;
|
||||
}
|
||||
public string Count { get; private set; }
|
||||
public TaskScheduleType Type { get; private set; }
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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(InsuranceListSearchModel searchModel);
|
||||
|
||||
#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; }
|
||||
|
||||
}
|
||||
@@ -52,5 +52,8 @@ public interface ILeftWorkInsuranceRepository : IRepository<long, LeftWorkInsura
|
||||
/// <returns></returns>
|
||||
List<LeftWorkViewModel> GetEmployeesWithContractExitOnly(long workshopId);
|
||||
|
||||
LeftWorkInsurance GetLastLeftWorkByEmployeeIdAndWorkshopId(long workshopId, long employeeId);
|
||||
|
||||
#endregion
|
||||
|
||||
}
|
||||
@@ -16,7 +16,19 @@ namespace Company.Domain.RollCallAgg;
|
||||
public interface IRollCallMandatoryRepository : IRepository<long, RollCall>
|
||||
{
|
||||
ComputingViewModel MandatoryCompute(long employeeId, long workshopId, DateTime contractStart, DateTime contractEnd, CreateWorkingHoursTemp command, bool holidayWorking, bool isStaticCheckout);
|
||||
TimeSpan AfterSubtract(CreateWorkingHoursTemp command, TimeSpan sumOneDaySpan, DateTime creationDate);
|
||||
|
||||
/// <summary>
|
||||
/// محاسبه ساعات کارکرد پرسنل در صورت داشتن حضور غیاب
|
||||
/// </summary>
|
||||
/// <param name="employeeId"></param>
|
||||
/// <param name="workshopId"></param>
|
||||
/// <param name="contractStart"></param>
|
||||
/// <param name="contractEnd"></param>
|
||||
/// <returns></returns>
|
||||
(bool hasRollCall, TimeSpan sumOfSpan) GetRollCallWorkingSpan(long employeeId, long workshopId,
|
||||
DateTime contractStart, DateTime contractEnd);
|
||||
|
||||
TimeSpan AfterSubtract(CreateWorkingHoursTemp command, TimeSpan sumOneDaySpan, DateTime creationDate);
|
||||
|
||||
List<RotatingShiftViewModel> RotatingShiftCheck(List<GroupedRollCalls> rollCallList);
|
||||
|
||||
|
||||
@@ -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(InsuranceListSearchModel searchModel);
|
||||
|
||||
#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; }
|
||||
}
|
||||
@@ -3,6 +3,7 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using CompanyManagment.App.Contracts.InsuranceList.Enums;
|
||||
|
||||
namespace CompanyManagment.App.Contracts.InsuranceList;
|
||||
|
||||
@@ -27,4 +28,16 @@ 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; }
|
||||
|
||||
/// <summary>
|
||||
/// نوع تاییدیه کارفرما
|
||||
/// </summary>
|
||||
public InsuranceListEmployerApprovalStatus EmployerApprovalStatus { get; set; }
|
||||
}
|
||||
@@ -38,4 +38,5 @@ public interface IRollCallEmployeeApplication
|
||||
(int activeEmployees, int deActiveEmployees) GetActiveAndDeActiveRollCallEmployees(long workshopId);
|
||||
bool HasEmployees(long workshopId);
|
||||
#endregion
|
||||
|
||||
}
|
||||
@@ -17,5 +17,7 @@ namespace CompanyManagment.App.Contracts.RollCallEmployeeStatus
|
||||
List<RollCallEmployeeStatusViewModel> GetActiveByWorkshopIdInDate(long workshopId, DateTime startDateGr, DateTime endDateGr);
|
||||
|
||||
bool IsActiveInPeriod(long employeeId, long workshopId, DateTime startDate, DateTime endDate);
|
||||
}
|
||||
void SyncRollCallEmployeeWithLeftWork(long rollCallEmployeeId);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -30,6 +30,7 @@ using Company.Domain.CustomizeWorkshopGroupSettingsAgg;
|
||||
using Company.Domain.LeftWorkAgg;
|
||||
using CompanyManagment.App.Contracts.Employee.DTO;
|
||||
using Company.Domain.EmployeeAuthorizeTempAgg;
|
||||
using Company.Domain.LeftWorkInsuranceAgg;
|
||||
|
||||
namespace CompanyManagment.Application;
|
||||
|
||||
@@ -59,8 +60,9 @@ public class EmployeeAplication : RepositoryBase<long, Employee>, IEmployeeAppli
|
||||
private readonly IEmployeeClientTempRepository _employeeClientTempRepository;
|
||||
private readonly ICustomizeWorkshopGroupSettingsRepository _customizeWorkshopGroupSettingsRepository;
|
||||
private readonly IEmployeeAuthorizeTempRepository _employeeAuthorizeTempRepository;
|
||||
private readonly ILeftWorkInsuranceRepository _leftWorkInsuranceRepository ;
|
||||
|
||||
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) : base(context)
|
||||
public EmployeeAplication(IEmployeeRepository employeeRepository, CompanyContext context, IWorkshopRepository workShopRepository, IWebHostEnvironment webHostEnvironment, IRollCallEmployeeStatusApplication rollCallEmployeeStatusApplication, IRollCallEmployeeRepository rollCallEmployeeRepository, ICustomizeWorkshopSettingsApplication customizeWorkshopSettingsApplication, IEmployeeDocumentsApplication employeeDocumentsApplication, IEmployeeDocumentsRepository employeeDocumentsRepository, IEmployeeBankInformationApplication employeeBankInformationApplication, ILeftWorkTempRepository leftWorkTempRepository, IUidService uidService, ICustomizeWorkshopEmployeeSettingsRepository customizeWorkshopEmployeeSettingsRepository, IPersonnelCodeRepository personnelCodeRepository, IEmployeeClientTempRepository employeeClientTempRepository, ICustomizeWorkshopGroupSettingsRepository customizeWorkshopGroupSettingsRepository, ILeftWorkRepository leftWorkRepository, IEmployeeAuthorizeTempRepository employeeAuthorizeTempRepository, ILeftWorkInsuranceRepository leftWorkInsuranceRepository) : base(context)
|
||||
{
|
||||
_context = context;
|
||||
_WorkShopRepository = workShopRepository;
|
||||
@@ -77,6 +79,7 @@ public class EmployeeAplication : RepositoryBase<long, Employee>, IEmployeeAppli
|
||||
_employeeClientTempRepository = employeeClientTempRepository;
|
||||
_leftWorkRepository = leftWorkRepository;
|
||||
_employeeAuthorizeTempRepository = employeeAuthorizeTempRepository;
|
||||
_leftWorkInsuranceRepository = leftWorkInsuranceRepository;
|
||||
_EmployeeRepository = employeeRepository;
|
||||
}
|
||||
|
||||
@@ -1009,7 +1012,9 @@ public class EmployeeAplication : RepositoryBase<long, Employee>, IEmployeeAppli
|
||||
var startLeftWork = command.StartLeftWork.ToGeorgianDateTime();
|
||||
|
||||
var leftWorkViewModel = _leftWorkRepository.GetLastLeftWorkByEmployeeIdAndWorkshopId(command.WorkshopId, employee.id);
|
||||
PersonnelCodeDomain personnelCode = null;
|
||||
|
||||
|
||||
PersonnelCodeDomain personnelCode = null;
|
||||
if (leftWorkViewModel != null)
|
||||
{
|
||||
if (leftWorkViewModel.HasLeft == false && leftWorkViewModel.LeftWorkDate > DateTime.Now)
|
||||
@@ -1024,10 +1029,16 @@ public class EmployeeAplication : RepositoryBase<long, Employee>, IEmployeeAppli
|
||||
}
|
||||
else
|
||||
{
|
||||
var lastPersonnelCodeByWorkshop = _personnelCodeRepository.GetLastPersonnelCodeByWorkshop(command.WorkshopId);
|
||||
var insuranceLeftWork =
|
||||
_leftWorkInsuranceRepository.GetLastLeftWorkByEmployeeIdAndWorkshopId(command.WorkshopId, employee.id);
|
||||
if (insuranceLeftWork == null)
|
||||
{
|
||||
var lastPersonnelCodeByWorkshop =
|
||||
_personnelCodeRepository.GetLastPersonnelCodeByWorkshop(command.WorkshopId);
|
||||
|
||||
personnelCode = new PersonnelCodeDomain(command.WorkshopId,
|
||||
employee.id, lastPersonnelCodeByWorkshop + 1);
|
||||
personnelCode = new PersonnelCodeDomain(command.WorkshopId,
|
||||
employee.id, lastPersonnelCodeByWorkshop + 1);
|
||||
}
|
||||
}
|
||||
|
||||
var leftWorkTemp = LeftWorkTemp.CreateStartWork(command.WorkshopId, employee.id, startLeftWork, command.JobId);
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -17,204 +17,206 @@ namespace CompanyManagment.Application;
|
||||
|
||||
public class RollCallEmployeeApplication : IRollCallEmployeeApplication
|
||||
{
|
||||
private readonly IRollCallEmployeeRepository _rollCallEmployeeRepository;
|
||||
private readonly IRollCallEmployeeStatusApplication _rollCallEmployeeStatusApplication;
|
||||
private readonly IEmployeeRepository _employeeRepository;
|
||||
private readonly ILeftWorkRepository _leftWorkRepository;
|
||||
private readonly IRollCallEmployeeStatusRepository _rollCallEmployeeStatusRepository;
|
||||
private readonly IWebHostEnvironment _webHostEnvironment;
|
||||
public RollCallEmployeeApplication(IRollCallEmployeeRepository rollCallEmployeeRepository, IEmployeeRepository employeeRepository, IRollCallEmployeeStatusApplication rollCallEmployeeStatusApplication, ILeftWorkRepository leftWorkRepository, IRollCallEmployeeStatusRepository rollCallEmployeeStatusRepository, IWebHostEnvironment webHostEnvironment)
|
||||
{
|
||||
_rollCallEmployeeRepository = rollCallEmployeeRepository;
|
||||
_employeeRepository = employeeRepository;
|
||||
_rollCallEmployeeStatusApplication = rollCallEmployeeStatusApplication;
|
||||
_leftWorkRepository = leftWorkRepository;
|
||||
_rollCallEmployeeStatusRepository = rollCallEmployeeStatusRepository;
|
||||
_webHostEnvironment = webHostEnvironment;
|
||||
}
|
||||
private readonly IRollCallEmployeeRepository _rollCallEmployeeRepository;
|
||||
private readonly IRollCallEmployeeStatusApplication _rollCallEmployeeStatusApplication;
|
||||
private readonly IEmployeeRepository _employeeRepository;
|
||||
private readonly ILeftWorkRepository _leftWorkRepository;
|
||||
private readonly IRollCallEmployeeStatusRepository _rollCallEmployeeStatusRepository;
|
||||
private readonly IWebHostEnvironment _webHostEnvironment;
|
||||
public RollCallEmployeeApplication(IRollCallEmployeeRepository rollCallEmployeeRepository, IEmployeeRepository employeeRepository, IRollCallEmployeeStatusApplication rollCallEmployeeStatusApplication, ILeftWorkRepository leftWorkRepository, IRollCallEmployeeStatusRepository rollCallEmployeeStatusRepository, IWebHostEnvironment webHostEnvironment)
|
||||
{
|
||||
_rollCallEmployeeRepository = rollCallEmployeeRepository;
|
||||
_employeeRepository = employeeRepository;
|
||||
_rollCallEmployeeStatusApplication = rollCallEmployeeStatusApplication;
|
||||
_leftWorkRepository = leftWorkRepository;
|
||||
_rollCallEmployeeStatusRepository = rollCallEmployeeStatusRepository;
|
||||
_webHostEnvironment = webHostEnvironment;
|
||||
}
|
||||
|
||||
public OperationResult Create(CreateRollCallEmployee command)
|
||||
{
|
||||
var opreation = new OperationResult();
|
||||
public OperationResult Create(CreateRollCallEmployee command)
|
||||
{
|
||||
var opreation = new OperationResult();
|
||||
|
||||
if (_rollCallEmployeeRepository.Exists(x =>
|
||||
x.EmployeeId == command.EmployeeId && x.WorkshopId == command.EmployeeId))
|
||||
return opreation.Succcedded();
|
||||
var fullname = _employeeRepository.GetDetails(command.EmployeeId);
|
||||
if (fullname == null)
|
||||
return opreation.Failed("پرسنل یافت نشد");
|
||||
if (_rollCallEmployeeRepository.Exists(x =>
|
||||
x.EmployeeId == command.EmployeeId && x.WorkshopId == command.EmployeeId))
|
||||
return opreation.Succcedded();
|
||||
var fullname = _employeeRepository.GetDetails(command.EmployeeId);
|
||||
if (fullname == null)
|
||||
return opreation.Failed("پرسنل یافت نشد");
|
||||
var create = new RollCallEmployee(command.WorkshopId, command.EmployeeId, fullname.FName, fullname.LName);
|
||||
_rollCallEmployeeRepository.Create(create);
|
||||
|
||||
if (command.HasUploadedImage == "true")
|
||||
create.HasImage();
|
||||
if (command.HasUploadedImage == "true")
|
||||
create.HasImage();
|
||||
|
||||
_rollCallEmployeeRepository.SaveChanges();
|
||||
return opreation.Succcedded(create.id);
|
||||
_rollCallEmployeeRepository.SaveChanges();
|
||||
return opreation.Succcedded(create.id);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public OperationResult Active(long id)
|
||||
{
|
||||
var opreation = new OperationResult();
|
||||
public OperationResult Active(long id)
|
||||
{
|
||||
var opreation = new OperationResult();
|
||||
|
||||
var emp = _rollCallEmployeeRepository.Get(id);
|
||||
var emp = _rollCallEmployeeRepository.Get(id);
|
||||
|
||||
if (emp == null)
|
||||
return opreation.Failed("پرسنل یافت نشد");
|
||||
if (emp == null)
|
||||
return opreation.Failed("پرسنل یافت نشد");
|
||||
|
||||
if (!_leftWorkRepository.Exists(x => x.EmployeeId == emp.EmployeeId && x.WorkshopId == emp.WorkshopId &&
|
||||
x.StartWorkDate <= DateTime.Now && x.LeftWorkDate > DateTime.Now))
|
||||
return opreation.Failed("کارمند شروع به کار ندارد");
|
||||
if (!_leftWorkRepository.Exists(x => x.EmployeeId == emp.EmployeeId && x.WorkshopId == emp.WorkshopId &&
|
||||
x.StartWorkDate <= DateTime.Now && x.LeftWorkDate > DateTime.Now))
|
||||
return opreation.Failed("کارمند شروع به کار ندارد");
|
||||
|
||||
if (emp.HasUploadedImage == "false")
|
||||
return opreation.Failed("لطفا ابتدا عکس پرسنل را آپلود کنید");
|
||||
if (emp.HasUploadedImage == "false")
|
||||
return opreation.Failed("لطفا ابتدا عکس پرسنل را آپلود کنید");
|
||||
|
||||
using var transaction = new TransactionScope();
|
||||
using var transaction = new TransactionScope();
|
||||
|
||||
emp.Active();
|
||||
|
||||
var operation2 = _rollCallEmployeeStatusApplication.Create(new CreateRollCallEmployeeStatus() { RollCallEmployeeId = id });
|
||||
if (operation2.IsSuccedded == false)
|
||||
return operation2;
|
||||
|
||||
var operation2 = _rollCallEmployeeStatusApplication.Create(new CreateRollCallEmployeeStatus() { RollCallEmployeeId = id });
|
||||
if (operation2.IsSuccedded == false)
|
||||
return operation2;
|
||||
|
||||
_rollCallEmployeeRepository.SaveChanges();
|
||||
transaction.Complete();
|
||||
|
||||
return operation2;
|
||||
}
|
||||
}
|
||||
|
||||
public OperationResult DeActive(long id)
|
||||
{
|
||||
var opreation = new OperationResult();
|
||||
var emp = _rollCallEmployeeRepository.GetWithRollCallStatus(id);
|
||||
if (emp == null)
|
||||
return opreation.Failed("پرسنل یافت نشد");
|
||||
var lastStatus = emp.EmployeesStatus.MaxBy(x => x.StartDate);
|
||||
emp.DeActive();
|
||||
_rollCallEmployeeRepository.SaveChanges();
|
||||
_rollCallEmployeeStatusApplication.Deactivate(lastStatus.id);
|
||||
return opreation.Succcedded();
|
||||
}
|
||||
public OperationResult DeActive(long id)
|
||||
{
|
||||
var opreation = new OperationResult();
|
||||
var emp = _rollCallEmployeeRepository.GetWithRollCallStatus(id);
|
||||
if (emp == null)
|
||||
return opreation.Failed("پرسنل یافت نشد");
|
||||
var lastStatus = emp.EmployeesStatus.MaxBy(x => x.StartDate);
|
||||
emp.DeActive();
|
||||
_rollCallEmployeeRepository.SaveChanges();
|
||||
_rollCallEmployeeStatusApplication.Deactivate(lastStatus.id);
|
||||
return opreation.Succcedded();
|
||||
}
|
||||
|
||||
public OperationResult UploadedImage(long Employeeid, long WorkshopId)
|
||||
{
|
||||
var opreation = new OperationResult();
|
||||
var emp = _rollCallEmployeeRepository.GetByEmployeeIdAndWorkshopId(Employeeid, WorkshopId);
|
||||
if (emp == null)
|
||||
return opreation.Failed("پرسنل یافت نشد");
|
||||
public OperationResult UploadedImage(long Employeeid, long WorkshopId)
|
||||
{
|
||||
var opreation = new OperationResult();
|
||||
var emp = _rollCallEmployeeRepository.GetByEmployeeIdAndWorkshopId(Employeeid, WorkshopId);
|
||||
if (emp == null)
|
||||
return opreation.Failed("پرسنل یافت نشد");
|
||||
|
||||
var rollCall = _rollCallEmployeeRepository.Get(emp.Id);
|
||||
rollCall.HasImage();
|
||||
_rollCallEmployeeRepository.SaveChanges();
|
||||
var path = Path.Combine(_webHostEnvironment.ContentRootPath, "Faces", WorkshopId.ToString(), Employeeid.ToString());
|
||||
var thumbnailPath = Path.Combine(path, "Thumbnail.jpg");
|
||||
try
|
||||
{
|
||||
var thumbnail = Tools.ResizeImage(Path.Combine(path, "1.jpg"), 150, 150);
|
||||
System.IO.File.WriteAllBytes(thumbnailPath, Convert.FromBase64String(thumbnail));
|
||||
}
|
||||
catch
|
||||
{
|
||||
// ignored
|
||||
}
|
||||
var rollCall = _rollCallEmployeeRepository.Get(emp.Id);
|
||||
rollCall.HasImage();
|
||||
_rollCallEmployeeRepository.SaveChanges();
|
||||
var path = Path.Combine(_webHostEnvironment.ContentRootPath, "Faces", WorkshopId.ToString(), Employeeid.ToString());
|
||||
var thumbnailPath = Path.Combine(path, "Thumbnail.jpg");
|
||||
try
|
||||
{
|
||||
var thumbnail = Tools.ResizeImage(Path.Combine(path, "1.jpg"), 150, 150);
|
||||
System.IO.File.WriteAllBytes(thumbnailPath, Convert.FromBase64String(thumbnail));
|
||||
}
|
||||
catch
|
||||
{
|
||||
// ignored
|
||||
}
|
||||
|
||||
return opreation.Succcedded();
|
||||
}
|
||||
return opreation.Succcedded();
|
||||
}
|
||||
|
||||
|
||||
public List<RollCallEmployeeViewModel> GetByWorkshopId(long workshopId)
|
||||
{
|
||||
return _rollCallEmployeeRepository.GetByWorkshopId(workshopId);
|
||||
}
|
||||
public List<RollCallEmployeeViewModel> GetByWorkshopId(long workshopId)
|
||||
{
|
||||
return _rollCallEmployeeRepository.GetByWorkshopId(workshopId);
|
||||
}
|
||||
|
||||
public EditRollCallEmployee GetDetails(long id)
|
||||
{
|
||||
return _rollCallEmployeeRepository.GetDetails(id);
|
||||
}
|
||||
public EditRollCallEmployee GetDetails(long id)
|
||||
{
|
||||
return _rollCallEmployeeRepository.GetDetails(id);
|
||||
}
|
||||
|
||||
public RollCallEmployeeViewModel GetByEmployeeIdAndWorkshopId(long employeeId, long workshopId)
|
||||
{
|
||||
return _rollCallEmployeeRepository.GetByEmployeeIdAndWorkshopId(employeeId, workshopId);
|
||||
}
|
||||
public RollCallEmployeeViewModel GetByEmployeeIdAndWorkshopId(long employeeId, long workshopId)
|
||||
{
|
||||
return _rollCallEmployeeRepository.GetByEmployeeIdAndWorkshopId(employeeId, workshopId);
|
||||
}
|
||||
|
||||
public List<RollCallEmployeeViewModel> GetPersonnelRollCallListPaginate(RollCallEmployeeSearchModel command)
|
||||
{
|
||||
public List<RollCallEmployeeViewModel> GetPersonnelRollCallListPaginate(RollCallEmployeeSearchModel command)
|
||||
{
|
||||
return _rollCallEmployeeRepository.GetPersonnelRollCallListPaginate(command);
|
||||
}
|
||||
|
||||
public int activedPerson(long workshopId)
|
||||
{
|
||||
return _rollCallEmployeeRepository.activedPerson(workshopId);
|
||||
}
|
||||
public int activedPerson(long workshopId)
|
||||
{
|
||||
return _rollCallEmployeeRepository.activedPerson(workshopId);
|
||||
}
|
||||
|
||||
#region Pooya
|
||||
public List<RollCallEmployeeViewModel> GetRollCallEmployeesByWorkshopId(long workshopId)
|
||||
{
|
||||
return _rollCallEmployeeRepository.GetRollCallEmployeesByWorkshopId(workshopId);
|
||||
}
|
||||
public List<RollCallEmployeeViewModel> GetActivePersonnelByWorkshopId(long workshopId)
|
||||
{
|
||||
return _rollCallEmployeeRepository.GetActivePersonnelByWorkshopId(workshopId);
|
||||
}
|
||||
#region Pooya
|
||||
public List<RollCallEmployeeViewModel> GetRollCallEmployeesByWorkshopId(long workshopId)
|
||||
{
|
||||
return _rollCallEmployeeRepository.GetRollCallEmployeesByWorkshopId(workshopId);
|
||||
}
|
||||
public List<RollCallEmployeeViewModel> GetActivePersonnelByWorkshopId(long workshopId)
|
||||
{
|
||||
return _rollCallEmployeeRepository.GetActivePersonnelByWorkshopId(workshopId);
|
||||
}
|
||||
|
||||
|
||||
public bool IsEmployeeRollCallActive(long employeeId, long workshopId)
|
||||
{
|
||||
RollCallEmployeeViewModel rollCallEmployee = _rollCallEmployeeRepository.GetByEmployeeIdAndWorkshopId(employeeId, workshopId);
|
||||
if (rollCallEmployee == null || rollCallEmployee.IsActiveString != "true" || rollCallEmployee.HasUploadedImage != "true")
|
||||
return false;
|
||||
var now = DateTime.Now;
|
||||
return _rollCallEmployeeStatusRepository.Exists(x => x.RollCallEmployeeId == rollCallEmployee.Id && x.StartDate < now && x.EndDate > now);
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
public List<RollCallEmployeeViewModel> GetEmployeeRollCalls(long workshopId)
|
||||
{
|
||||
return _rollCallEmployeeRepository.GetEmployeeRollCalls(workshopId);
|
||||
}
|
||||
|
||||
public (int activeEmployees, int deActiveEmployees) GetActiveAndDeActiveRollCallEmployees(long workshopId)
|
||||
{
|
||||
return _rollCallEmployeeRepository.GetActiveAndDeActiveRollCallEmployees(workshopId);
|
||||
}
|
||||
|
||||
public List<RollCallEmployeeViewModel> GetPersonnelRollCallListAll(long workshopId)
|
||||
{
|
||||
return _rollCallEmployeeRepository.GetPersonnelRollCallListAll(workshopId);
|
||||
}
|
||||
|
||||
public bool HasEmployees(long workshopId)
|
||||
{
|
||||
return _rollCallEmployeeRepository.HasEmployees(workshopId);
|
||||
}
|
||||
|
||||
public OperationResult ChangeEmployeeRollCallName(long rollCallEmployeeId, string fName, string lName)
|
||||
{
|
||||
OperationResult result = new();
|
||||
if (string.IsNullOrWhiteSpace(lName) || string.IsNullOrWhiteSpace(fName))
|
||||
return result.Failed("نام و نام خانوادگی نمی توانند خالی باشند");
|
||||
fName = fName.Trim();
|
||||
lName = lName.Trim();
|
||||
var fullName = $"{fName} {lName}";
|
||||
var entity = _rollCallEmployeeRepository.Get(rollCallEmployeeId);
|
||||
public bool IsEmployeeRollCallActive(long employeeId, long workshopId)
|
||||
{
|
||||
RollCallEmployeeViewModel rollCallEmployee = _rollCallEmployeeRepository.GetByEmployeeIdAndWorkshopId(employeeId, workshopId);
|
||||
if (rollCallEmployee == null || rollCallEmployee.IsActiveString != "true" || rollCallEmployee.HasUploadedImage != "true")
|
||||
return false;
|
||||
var now = DateTime.Now;
|
||||
return _rollCallEmployeeStatusRepository.Exists(x => x.RollCallEmployeeId == rollCallEmployee.Id && x.StartDate < now && x.EndDate > now);
|
||||
|
||||
|
||||
if (entity == null)
|
||||
return result.Failed(ApplicationMessages.RecordNotFound);
|
||||
|
||||
if (_rollCallEmployeeRepository.Exists(x => x.WorkshopId == entity.WorkshopId && x.EmployeeFullName == fullName && x.id != rollCallEmployeeId))
|
||||
return result.Failed("نام و نام خانوادگی کارمند نمی تواند با نام و نام خانوادگی کارمند دیگری در آن کارگاه یکسان باشد");
|
||||
}
|
||||
|
||||
if (entity.IsActiveString != "true")
|
||||
return result.Failed("امکان تغییر نام برای کارمند غیر فعال وجود ندارد");
|
||||
public List<RollCallEmployeeViewModel> GetEmployeeRollCalls(long workshopId)
|
||||
{
|
||||
return _rollCallEmployeeRepository.GetEmployeeRollCalls(workshopId);
|
||||
}
|
||||
|
||||
public (int activeEmployees, int deActiveEmployees) GetActiveAndDeActiveRollCallEmployees(long workshopId)
|
||||
{
|
||||
return _rollCallEmployeeRepository.GetActiveAndDeActiveRollCallEmployees(workshopId);
|
||||
}
|
||||
|
||||
public List<RollCallEmployeeViewModel> GetPersonnelRollCallListAll(long workshopId)
|
||||
{
|
||||
return _rollCallEmployeeRepository.GetPersonnelRollCallListAll(workshopId);
|
||||
}
|
||||
|
||||
public bool HasEmployees(long workshopId)
|
||||
{
|
||||
return _rollCallEmployeeRepository.HasEmployees(workshopId);
|
||||
}
|
||||
|
||||
|
||||
|
||||
public OperationResult ChangeEmployeeRollCallName(long rollCallEmployeeId, string fName, string lName)
|
||||
{
|
||||
OperationResult result = new();
|
||||
if (string.IsNullOrWhiteSpace(lName) || string.IsNullOrWhiteSpace(fName))
|
||||
return result.Failed("نام و نام خانوادگی نمی توانند خالی باشند");
|
||||
fName = fName.Trim();
|
||||
lName = lName.Trim();
|
||||
var fullName = $"{fName} {lName}";
|
||||
var entity = _rollCallEmployeeRepository.Get(rollCallEmployeeId);
|
||||
|
||||
|
||||
entity.ChangeName(fName, lName);
|
||||
_rollCallEmployeeRepository.SaveChanges();
|
||||
return result.Succcedded();
|
||||
}
|
||||
if (entity == null)
|
||||
return result.Failed(ApplicationMessages.RecordNotFound);
|
||||
|
||||
if (_rollCallEmployeeRepository.Exists(x => x.WorkshopId == entity.WorkshopId && x.EmployeeFullName == fullName && x.id != rollCallEmployeeId))
|
||||
return result.Failed("نام و نام خانوادگی کارمند نمی تواند با نام و نام خانوادگی کارمند دیگری در آن کارگاه یکسان باشد");
|
||||
|
||||
if (entity.IsActiveString != "true")
|
||||
return result.Failed("امکان تغییر نام برای کارمند غیر فعال وجود ندارد");
|
||||
|
||||
|
||||
entity.ChangeName(fName, lName);
|
||||
_rollCallEmployeeRepository.SaveChanges();
|
||||
return result.Succcedded();
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
@@ -134,5 +134,38 @@ namespace CompanyManagment.Application
|
||||
{
|
||||
return _employeeRollCallStatusRepository.GetAll();
|
||||
}
|
||||
}
|
||||
|
||||
public void SyncRollCallEmployeeWithLeftWork(long rollCallEmployeeId)
|
||||
{
|
||||
var rollCallEmployee = _rollCallEmployeeRepository.GetWithRollCallStatus(rollCallEmployeeId);
|
||||
if (rollCallEmployee == null)
|
||||
return;
|
||||
|
||||
var rollCallStatus = rollCallEmployee.EmployeesStatus.MaxBy(x => x.StartDate);
|
||||
|
||||
if (rollCallStatus == null)
|
||||
return;
|
||||
|
||||
var today = DateTime.Today;
|
||||
|
||||
var firstDayOfMonth = today.FindFirstDayOfMonthGr();
|
||||
|
||||
|
||||
|
||||
var employeeId = rollCallEmployee.EmployeeId;
|
||||
var workshopId = rollCallEmployee.WorkshopId;
|
||||
|
||||
var leftWork = _leftWorkRepository.GetLastLeftWorkByEmployeeIdAndWorkshopId(workshopId, employeeId);
|
||||
|
||||
if (leftWork == null)
|
||||
return;
|
||||
|
||||
var startWork = leftWork.StartWorkDate;
|
||||
|
||||
rollCallStatus.Edit(startWork < firstDayOfMonth ? firstDayOfMonth : startWork, rollCallStatus.EndDate);
|
||||
|
||||
_employeeRollCallStatusRepository.SaveChanges();
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
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;
|
||||
@@ -3350,6 +3351,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);
|
||||
|
||||
@@ -10,329 +10,340 @@ using AccountMangement.Infrastructure.EFCore;
|
||||
using Company.Domain.AdminMonthlyOverviewAgg;
|
||||
using CompanyManagment.App.Contracts.AdminMonthlyOverview;
|
||||
using Microsoft.AspNetCore.Authentication;
|
||||
using Microsoft.AspNetCore.Mvc.ModelBinding.Validation;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Tools = _0_Framework_b.Application.Tools;
|
||||
|
||||
namespace CompanyManagment.EFCore.Repository;
|
||||
|
||||
public class AdminMonthlyOverviewRepository : RepositoryBase<long, AdminMonthlyOverview>, IAdminMonthlyOverviewRepository
|
||||
{
|
||||
private readonly CompanyContext _companyContext;
|
||||
private readonly AccountContext _accountContext;
|
||||
public AdminMonthlyOverviewRepository(CompanyContext companyContext, AccountContext accountContext) : base(companyContext)
|
||||
{
|
||||
_companyContext = companyContext;
|
||||
_accountContext = accountContext;
|
||||
}
|
||||
private readonly CompanyContext _companyContext;
|
||||
private readonly AccountContext _accountContext;
|
||||
public AdminMonthlyOverviewRepository(CompanyContext companyContext, AccountContext accountContext) : base(companyContext)
|
||||
{
|
||||
_companyContext = companyContext;
|
||||
_accountContext = accountContext;
|
||||
}
|
||||
|
||||
public async Task<List<AdminMonthlyOverviewListViewModel>> GetWorkshopStatus(AdminMonthlyOverviewSearchModel searchModel)
|
||||
{
|
||||
public async Task<List<AdminMonthlyOverviewListViewModel>> GetWorkshopStatus(AdminMonthlyOverviewSearchModel searchModel)
|
||||
{
|
||||
|
||||
var year = searchModel.Year;
|
||||
var month = searchModel.Month;
|
||||
var accountId = searchModel.AdminAccountId;
|
||||
// اگر تبدیل تاریخ به میلادی موفق نبود، لیست خالی برگردان
|
||||
if ($"{year:0000}/{month:00}/01".TryToGeorgianDateTime(out var targetDate) == false)
|
||||
return [];
|
||||
|
||||
_ = $"{year:0000}/{month:00}/01".ToGeorgianDateTime().AddMonthsFa(1, out var nextMonth);
|
||||
|
||||
|
||||
// دریافت اطلاعات ادمین
|
||||
var adminAccount = await _accountContext.Accounts.FirstOrDefaultAsync(x => x.id == searchModel.AdminAccountId);
|
||||
|
||||
// اگر ادمین پیدا نشد، لیست خالی برگردان
|
||||
if (adminAccount == null)
|
||||
return [];
|
||||
|
||||
// دریافت طرف حساب های معتبر برای تاریخ مورد نظر
|
||||
var contractingPartyIds = _companyContext.InstitutionContractSet.AsNoTracking()
|
||||
.Where(c => c.ContractStartGr <= targetDate && c.ContractEndGr >= targetDate)
|
||||
.Select(c => c.ContractingPartyId);
|
||||
|
||||
// دریافت کارگاههای مرتبط با اکانت
|
||||
|
||||
var workshopAccounts = _companyContext.WorkshopAccounts
|
||||
.AsNoTracking()
|
||||
.Where(w => w.AccountId == accountId)
|
||||
.Select(w => w.WorkshopId).ToList();
|
||||
var year = searchModel.Year;
|
||||
var month = searchModel.Month;
|
||||
var accountId = searchModel.AdminAccountId;
|
||||
// اگر تبدیل تاریخ به میلادی موفق نبود، لیست خالی برگردان
|
||||
if ($"{year:0000}/{month:00}/01".TryToGeorgianDateTime(out var targetStartDate) == false)
|
||||
return [];
|
||||
var targetEndDate = Tools.FindeEndOfMonth(targetStartDate.ToFarsi()).ToGeorgianDateTime();
|
||||
|
||||
|
||||
|
||||
var workshopsHasLeftWorkEmployees = _companyContext.LeftWorkList.Where(x =>
|
||||
((x.StartWorkDate <= targetDate && x.LeftWorkDate.AddDays(-1) >= targetDate)
|
||||
|| (x.StartWorkDate <= nextMonth && x.LeftWorkDate.AddDays(-1) >= nextMonth)) && workshopAccounts.Contains(x.WorkshopId)).Select(x => x.WorkshopId);
|
||||
_ = $"{year:0000}/{month:00}/01".ToGeorgianDateTime().AddMonthsFa(1, out var nextFirstMonth);
|
||||
var nextEndMonth = Tools.FindeEndOfMonth(nextFirstMonth.ToFarsi()).ToGeorgianDateTime();
|
||||
|
||||
|
||||
// دریافت اطلاعات ادمین
|
||||
var adminAccount = await _accountContext.Accounts.FirstOrDefaultAsync(x => x.id == searchModel.AdminAccountId);
|
||||
|
||||
// اگر ادمین پیدا نشد، لیست خالی برگردان
|
||||
if (adminAccount == null)
|
||||
return [];
|
||||
|
||||
// دریافت طرف حساب های معتبر برای تاریخ مورد نظر
|
||||
var contractingPartyIds = _companyContext.InstitutionContractSet.AsNoTracking()
|
||||
.Where(c => c.ContractStartGr <= targetEndDate && c.ContractEndGr >= targetStartDate)
|
||||
.Select(c => c.ContractingPartyId);
|
||||
|
||||
// دریافت کارگاههای مرتبط با اکانت
|
||||
|
||||
var workshopAccounts = _companyContext.WorkshopAccounts
|
||||
.AsNoTracking()
|
||||
.Where(w => w.AccountId == accountId)
|
||||
.Select(w => w.WorkshopId).ToList();
|
||||
|
||||
|
||||
|
||||
var workshopsHasLeftWorkEmployees = _companyContext.LeftWorkList.Where(x =>
|
||||
((x.StartWorkDate <= targetEndDate && x.LeftWorkDate.AddDays(-1) >= targetStartDate)
|
||||
|| (x.StartWorkDate <= nextEndMonth && x.LeftWorkDate.AddDays(-1) >= nextFirstMonth)) && workshopAccounts.Contains(x.WorkshopId)).Select(x => x.WorkshopId);
|
||||
|
||||
|
||||
|
||||
|
||||
// دریافت کارگاههای مربوط به طرف حساب و اکانت
|
||||
// Replace the selected code with the following to return a list of anonymous objects containing both workshop and contractingParty
|
||||
var workshopsWithContractingParty = await _companyContext.Workshops
|
||||
.AsNoTracking()
|
||||
.Where(w => workshopsHasLeftWorkEmployees.Contains(w.id) && w.IsActive)
|
||||
.Include(w => w.WorkshopEmployers)
|
||||
.ThenInclude(we => we.Employer)
|
||||
.ThenInclude(e => e.ContractingParty).AsSplitQuery().
|
||||
Where(w => w.WorkshopEmployers.Any(we =>
|
||||
we.Employer != null &&
|
||||
contractingPartyIds.Contains(we.Employer.ContractingPartyId)))
|
||||
.Select(w => new
|
||||
{
|
||||
Workshop = w,
|
||||
ContractingParty = w.WorkshopEmployers
|
||||
.Where(we => we.Employer != null && contractingPartyIds.Contains(we.Employer.ContractingPartyId))
|
||||
.Select(we => we.Employer.ContractingParty)
|
||||
.FirstOrDefault()
|
||||
})
|
||||
.ToListAsync();
|
||||
// دریافت کارگاههای مربوط به طرف حساب و اکانت
|
||||
// Replace the selected code with the following to return a list of anonymous objects containing both workshop and contractingParty
|
||||
var workshopsWithContractingParty = await _companyContext.Workshops
|
||||
.AsNoTracking()
|
||||
.Where(w => workshopsHasLeftWorkEmployees.Contains(w.id) && w.IsActive)
|
||||
.Include(w => w.WorkshopEmployers)
|
||||
.ThenInclude(we => we.Employer)
|
||||
.ThenInclude(e => e.ContractingParty).AsSplitQuery().
|
||||
Where(w => w.WorkshopEmployers.Any(we =>
|
||||
we.Employer != null &&
|
||||
contractingPartyIds.Contains(we.Employer.ContractingPartyId)))
|
||||
.Select(w => new
|
||||
{
|
||||
Workshop = w,
|
||||
ContractingParty = w.WorkshopEmployers
|
||||
.Where(we => we.Employer != null && contractingPartyIds.Contains(we.Employer.ContractingPartyId))
|
||||
.Select(we => we.Employer.ContractingParty)
|
||||
.FirstOrDefault()
|
||||
})
|
||||
.ToListAsync();
|
||||
|
||||
|
||||
var workshopIds = workshopsWithContractingParty.Select(x => x.Workshop.id).ToList();
|
||||
var workshopIds = workshopsWithContractingParty.Select(x => x.Workshop.id).ToList();
|
||||
|
||||
|
||||
// پیدا کردن کارگاههایی که قبلاً برای این ماه/سال AdminMonthlyOverview دارند
|
||||
var adminMonthlyOverviewWorkshopIds = await _companyContext.AdminMonthlyOverviews
|
||||
.AsNoTracking()
|
||||
.Where(x => workshopIds.Contains(x.WorkshopId) && x.Month == month && x.Year == year)
|
||||
.Select(x => x.WorkshopId)
|
||||
.ToListAsync();
|
||||
// پیدا کردن کارگاههایی که قبلاً برای این ماه/سال AdminMonthlyOverview دارند
|
||||
var adminMonthlyOverviewWorkshopIds = await _companyContext.AdminMonthlyOverviews
|
||||
.AsNoTracking()
|
||||
.Where(x => workshopIds.Contains(x.WorkshopId) && x.Month == month && x.Year == year)
|
||||
.Select(x => x.WorkshopId)
|
||||
.ToListAsync();
|
||||
|
||||
// پیدا کردن کارگاههایی که نیاز به ایجاد AdminMonthlyOverview جدید دارند
|
||||
var notExistAdminMonthlyReviewsWorkshopIds = workshopIds
|
||||
.Except(adminMonthlyOverviewWorkshopIds)
|
||||
.ToList();
|
||||
// پیدا کردن کارگاههایی که نیاز به ایجاد AdminMonthlyOverview جدید دارند
|
||||
var notExistAdminMonthlyReviewsWorkshopIds = workshopIds
|
||||
.Except(adminMonthlyOverviewWorkshopIds)
|
||||
.ToList();
|
||||
|
||||
|
||||
|
||||
// ایجاد رکوردهای AdminMonthlyOverview که وجود ندارند
|
||||
if (notExistAdminMonthlyReviewsWorkshopIds.Any())
|
||||
await CreateRangeAdminMonthlyOverview(notExistAdminMonthlyReviewsWorkshopIds, month, year);
|
||||
// ایجاد رکوردهای AdminMonthlyOverview که وجود ندارند
|
||||
if (notExistAdminMonthlyReviewsWorkshopIds.Any())
|
||||
await CreateRangeAdminMonthlyOverview(notExistAdminMonthlyReviewsWorkshopIds, month, year);
|
||||
|
||||
// بهروزرسانی وضعیتها
|
||||
await UpdateAdminMonthlyOverviewStatus(year, month, workshopIds, targetDate, nextMonth);
|
||||
// بهروزرسانی وضعیتها
|
||||
await UpdateAdminMonthlyOverviewStatus(year, month, workshopIds, targetStartDate,targetEndDate, nextFirstMonth,nextEndMonth);
|
||||
|
||||
if (searchModel.ActivationStatus != IsActive.None)
|
||||
{
|
||||
var isBlock = searchModel.ActivationStatus == IsActive.True ? "false" : "true";
|
||||
if (searchModel.ActivationStatus != IsActive.None)
|
||||
{
|
||||
var isBlock = searchModel.ActivationStatus == IsActive.True ? "false" : "true";
|
||||
|
||||
workshopsWithContractingParty = workshopsWithContractingParty
|
||||
.Where(x => x.ContractingParty?.IsBlock == isBlock).ToList();
|
||||
workshopsWithContractingParty = workshopsWithContractingParty
|
||||
.Where(x => x.ContractingParty?.IsBlock == isBlock).ToList();
|
||||
|
||||
workshopIds = workshopsWithContractingParty.Select(x => x.Workshop.id).ToList();
|
||||
}
|
||||
workshopIds = workshopsWithContractingParty.Select(x => x.Workshop.id).ToList();
|
||||
}
|
||||
|
||||
// دریافت همه AdminMonthlyOverview برای این کارگاهها/ماه/سال
|
||||
var adminMonthlyOverviewsQuery = _companyContext.AdminMonthlyOverviews
|
||||
.Where(x => workshopIds.Contains(x.WorkshopId) && x.Month == month && x.Year == year);
|
||||
// دریافت همه AdminMonthlyOverview برای این کارگاهها/ماه/سال
|
||||
var adminMonthlyOverviewsQuery = _companyContext.AdminMonthlyOverviews
|
||||
.Where(x => workshopIds.Contains(x.WorkshopId) && x.Month == month && x.Year == year);
|
||||
|
||||
if (searchModel.WorkshopId > 0)
|
||||
{
|
||||
adminMonthlyOverviewsQuery = adminMonthlyOverviewsQuery.Where(x => x.WorkshopId == searchModel.WorkshopId);
|
||||
}
|
||||
if (searchModel.WorkshopId > 0)
|
||||
{
|
||||
adminMonthlyOverviewsQuery = adminMonthlyOverviewsQuery.Where(x => x.WorkshopId == searchModel.WorkshopId);
|
||||
}
|
||||
|
||||
if (searchModel.EmployerId > 0)
|
||||
{
|
||||
var searchWorkshopId = workshopsWithContractingParty.Where(x => x.Workshop.WorkshopEmployers.Any(e => e.EmployerId == searchModel.EmployerId)).Select(x => x.Workshop.id).ToList();
|
||||
adminMonthlyOverviewsQuery = adminMonthlyOverviewsQuery.Where(x => searchWorkshopId.Contains(x.WorkshopId));
|
||||
}
|
||||
if (searchModel.EmployerId > 0)
|
||||
{
|
||||
var searchWorkshopId = workshopsWithContractingParty.Where(x => x.Workshop.WorkshopEmployers.Any(e => e.EmployerId == searchModel.EmployerId)).Select(x => x.Workshop.id).ToList();
|
||||
adminMonthlyOverviewsQuery = adminMonthlyOverviewsQuery.Where(x => searchWorkshopId.Contains(x.WorkshopId));
|
||||
}
|
||||
|
||||
var employeeCheckoutCounts = _companyContext.LeftWorkList.Where(x =>
|
||||
x.StartWorkDate <= targetDate && x.LeftWorkDate.AddDays(-1) >= targetDate && workshopIds.Contains(x.WorkshopId))
|
||||
.GroupBy(x => x.WorkshopId).Select(x => new { EmployeeCounts = x.Count(), WorkshopId = x.Key }).ToList();
|
||||
var employeeCheckoutCounts = _companyContext.LeftWorkList.Where(x =>
|
||||
x.StartWorkDate <= targetStartDate && x.LeftWorkDate.AddDays(-1) >= targetStartDate && workshopIds.Contains(x.WorkshopId))
|
||||
.GroupBy(x => x.WorkshopId).Select(x => new { EmployeeCounts = x.Count(), WorkshopId = x.Key }).ToList();
|
||||
|
||||
var employeeContractCounts = _companyContext.LeftWorkList.Where(x =>
|
||||
x.StartWorkDate <= nextMonth && x.LeftWorkDate.AddDays(-1) >= nextMonth && workshopIds.Contains(x.WorkshopId))
|
||||
.GroupBy(x => x.WorkshopId).Select(x => new { EmployeeCounts = x.Count(), WorkshopId = x.Key }).ToList();
|
||||
var employeeContractCounts = _companyContext.LeftWorkList.Where(x =>
|
||||
x.StartWorkDate <= nextFirstMonth && x.LeftWorkDate.AddDays(-1) >= nextFirstMonth && workshopIds.Contains(x.WorkshopId))
|
||||
.GroupBy(x => x.WorkshopId).Select(x => new { EmployeeCounts = x.Count(), WorkshopId = x.Key }).ToList();
|
||||
|
||||
var adminMonthlyOverviewsList = await adminMonthlyOverviewsQuery.ToListAsync();
|
||||
var adminMonthlyOverviewsList = await adminMonthlyOverviewsQuery.ToListAsync();
|
||||
|
||||
var now = DateTime.Today;
|
||||
//پرسنل ادمین اجرایی
|
||||
var operatorAdminAccounts = _accountContext.AccountLeftWorks
|
||||
.Where(x => workshopIds.Contains(x.WorkshopId) && x.StartWorkGr <= now && x.LeftWorkGr >= now &&
|
||||
x.RoleId == 5).Select(x => new { x.WorkshopId, x.AccountId })
|
||||
.Join(_accountContext.Accounts,
|
||||
x =>x.AccountId,
|
||||
account=>account.id,(x, account) => new
|
||||
{
|
||||
x.WorkshopId,
|
||||
account.Fullname
|
||||
}).ToList();
|
||||
var now = DateTime.Today;
|
||||
//پرسنل ادمین اجرایی
|
||||
var operatorAdminAccounts = _accountContext.AccountLeftWorks
|
||||
.Where(x => workshopIds.Contains(x.WorkshopId) && x.StartWorkGr <= now && x.LeftWorkGr >= now &&
|
||||
x.RoleId == 5).Select(x => new { x.WorkshopId, x.AccountId })
|
||||
.Join(_accountContext.Accounts,
|
||||
x => x.AccountId,
|
||||
account => account.id, (x, account) => new
|
||||
{
|
||||
x.WorkshopId,
|
||||
account.Fullname
|
||||
}).ToList();
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
var adminMonthlyOverviewList = adminMonthlyOverviewsList.Select(x =>
|
||||
{
|
||||
var employeeCheckoutCount = employeeCheckoutCounts.FirstOrDefault(e => e.WorkshopId == x.WorkshopId);
|
||||
var employeeContractCount = employeeContractCounts.FirstOrDefault(e => e.WorkshopId == x.WorkshopId);
|
||||
var workshopWithContractingParty =
|
||||
workshopsWithContractingParty.FirstOrDefault(w => w.Workshop.id == x.WorkshopId);
|
||||
var adminMonthlyOverviewList = adminMonthlyOverviewsList.Select(x =>
|
||||
{
|
||||
var employeeCheckoutCount = employeeCheckoutCounts.FirstOrDefault(e => e.WorkshopId == x.WorkshopId);
|
||||
var employeeContractCount = employeeContractCounts.FirstOrDefault(e => e.WorkshopId == x.WorkshopId);
|
||||
var workshopWithContractingParty =
|
||||
workshopsWithContractingParty.FirstOrDefault(w => w.Workshop.id == x.WorkshopId);
|
||||
|
||||
var operatorAccount = operatorAdminAccounts.FirstOrDefault(o => o.WorkshopId == x.WorkshopId);
|
||||
var operatorAccount = operatorAdminAccounts.FirstOrDefault(o => o.WorkshopId == x.WorkshopId);
|
||||
|
||||
var workshop = workshopWithContractingParty?.Workshop;
|
||||
var contractingParty = workshopWithContractingParty?.ContractingParty;
|
||||
var employer = workshop?.WorkshopEmployers.FirstOrDefault()?.Employer;
|
||||
return new AdminMonthlyOverviewListViewModel
|
||||
{
|
||||
WorkshopId = x.WorkshopId,
|
||||
Status = x.Status,
|
||||
Id = x.id,
|
||||
WorkshopName = workshop?.WorkshopFullName ?? "",
|
||||
WorkshopArchiveCode = workshop?.ArchiveCode ?? "",
|
||||
WorkshopArchiveCodeInt = workshop?.ArchiveCode.ExtractIntNumbers() ?? 0,
|
||||
Address = workshop?.Address ?? "",
|
||||
City = workshop?.City ?? "",
|
||||
Province = workshop?.State ?? "",
|
||||
EmployerName = employer?.FullName ?? "",
|
||||
EmployerPhoneNumber = employer?.Phone ?? "",
|
||||
AdminFullName = operatorAccount?.Fullname??"",
|
||||
CheckoutEmployeeCount = employeeCheckoutCount?.EmployeeCounts ?? 0,
|
||||
ContractEmployeeCount = employeeContractCount?.EmployeeCounts ?? 0,
|
||||
AgentPhoneNumber = "",
|
||||
IsBlock = contractingParty?.IsBlock == "true"
|
||||
};
|
||||
}).OrderBy(x => x.IsBlock).ThenBy(x => x.WorkshopArchiveCodeInt).ToList();
|
||||
var workshop = workshopWithContractingParty?.Workshop;
|
||||
var contractingParty = workshopWithContractingParty?.ContractingParty;
|
||||
var employer = workshop?.WorkshopEmployers.FirstOrDefault()?.Employer;
|
||||
return new AdminMonthlyOverviewListViewModel
|
||||
{
|
||||
WorkshopId = x.WorkshopId,
|
||||
Status = x.Status,
|
||||
Id = x.id,
|
||||
WorkshopName = workshop?.WorkshopFullName ?? "",
|
||||
WorkshopArchiveCode = workshop?.ArchiveCode ?? "",
|
||||
WorkshopArchiveCodeInt = workshop?.ArchiveCode.ExtractIntNumbers() ?? 0,
|
||||
Address = workshop?.Address ?? "",
|
||||
City = workshop?.City ?? "",
|
||||
Province = workshop?.State ?? "",
|
||||
EmployerName = employer?.FullName ?? "",
|
||||
EmployerPhoneNumber = employer?.Phone ?? "",
|
||||
AdminFullName = operatorAccount?.Fullname ?? "",
|
||||
CheckoutEmployeeCount = employeeCheckoutCount?.EmployeeCounts ?? 0,
|
||||
ContractEmployeeCount = employeeContractCount?.EmployeeCounts ?? 0,
|
||||
AgentPhoneNumber = "",
|
||||
IsBlock = contractingParty?.IsBlock == "true"
|
||||
};
|
||||
}).OrderBy(x => x.IsBlock).ThenBy(x => x.WorkshopArchiveCodeInt).ToList();
|
||||
|
||||
|
||||
return adminMonthlyOverviewList;
|
||||
}
|
||||
return adminMonthlyOverviewList;
|
||||
}
|
||||
|
||||
public async Task<AdminMonthlyOverViewCounterVm> GetCounter(int year, int month, long accountId)
|
||||
{
|
||||
var searchModel = new AdminMonthlyOverviewSearchModel()
|
||||
{
|
||||
AdminAccountId = accountId,
|
||||
Month = month,
|
||||
Year = year
|
||||
};
|
||||
var list = await GetWorkshopStatus(searchModel);
|
||||
public async Task<AdminMonthlyOverViewCounterVm> GetCounter(int year, int month, long accountId)
|
||||
{
|
||||
var searchModel = new AdminMonthlyOverviewSearchModel()
|
||||
{
|
||||
AdminAccountId = accountId,
|
||||
Month = month,
|
||||
Year = year
|
||||
};
|
||||
var list = await GetWorkshopStatus(searchModel);
|
||||
|
||||
var allCount = list.Count;
|
||||
var archivedCount = list.Count(x => x.Status == AdminMonthlyOverviewStatus.Archived);
|
||||
var createDocCount = list.Count(x => x.Status == AdminMonthlyOverviewStatus.CreateDocuments);
|
||||
var visitCompleteCount = list.Count(x => x.Status == AdminMonthlyOverviewStatus.VisitCompleted);
|
||||
var visitInProgressCount = list.Count(x => x.Status == AdminMonthlyOverviewStatus.VisitInProgress);
|
||||
var visitPendingCount = list.Count(x => x.Status == AdminMonthlyOverviewStatus.VisitPending);
|
||||
var allCount = list.Count;
|
||||
var archivedCount = list.Count(x => x.Status == AdminMonthlyOverviewStatus.Archived);
|
||||
var createDocCount = list.Count(x => x.Status == AdminMonthlyOverviewStatus.CreateDocuments);
|
||||
var visitCompleteCount = list.Count(x => x.Status == AdminMonthlyOverviewStatus.VisitCompleted);
|
||||
var visitInProgressCount = list.Count(x => x.Status == AdminMonthlyOverviewStatus.VisitInProgress);
|
||||
var visitPendingCount = list.Count(x => x.Status == AdminMonthlyOverviewStatus.VisitPending);
|
||||
|
||||
return new AdminMonthlyOverViewCounterVm
|
||||
{
|
||||
All = allCount,
|
||||
Archived = archivedCount,
|
||||
VisitPending = visitPendingCount,
|
||||
VisitInProgress = visitInProgressCount,
|
||||
VisitCompleted = visitCompleteCount,
|
||||
CreateDocument = createDocCount
|
||||
return new AdminMonthlyOverViewCounterVm
|
||||
{
|
||||
All = allCount,
|
||||
Archived = archivedCount,
|
||||
VisitPending = visitPendingCount,
|
||||
VisitInProgress = visitInProgressCount,
|
||||
VisitCompleted = visitCompleteCount,
|
||||
CreateDocument = createDocCount
|
||||
|
||||
};
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
private async Task UpdateAdminMonthlyOverviewStatus(int year, int month, List<long> workshopIds, DateTime targetDate, DateTime nextMonth)
|
||||
{
|
||||
var vipGroup = _companyContext.CustomizeWorkshopEmployeeSettings.Where(x => x.CustomizeWorkshopGroupSettingId == 117)
|
||||
.Select(x => x.EmployeeId)
|
||||
.Except([5976]).ToList();
|
||||
private async Task UpdateAdminMonthlyOverviewStatus(int year, int month, List<long> workshopIds, DateTime targetStartDate,DateTime targetEndDate, DateTime nextStartMonth,DateTime nextEndMonth)
|
||||
{
|
||||
var vipGroup = _companyContext.CustomizeWorkshopEmployeeSettings.Where(x => x.CustomizeWorkshopGroupSettingId == 117)
|
||||
.Select(x => x.EmployeeId)
|
||||
.Except([5976]).ToList();
|
||||
|
||||
|
||||
var workingCheckoutEmployeeIds = _companyContext.LeftWorkList.AsNoTracking()
|
||||
.Join(
|
||||
_companyContext.Contracts.AsNoTracking(),
|
||||
leftWork => new { leftWork.EmployeeId, WorkshopId = leftWork.WorkshopId },
|
||||
contract => new { contract.EmployeeId, WorkshopId = contract.WorkshopIds },
|
||||
(leftWork, contract) => new { leftWork, contract }
|
||||
)
|
||||
.Where(x =>
|
||||
workshopIds.Contains(x.leftWork.WorkshopId) &&
|
||||
x.leftWork.StartWorkDate <= targetDate &&
|
||||
x.leftWork.LeftWorkDate.AddDays(-1) >= targetDate &&
|
||||
x.contract.ContarctStart <= targetDate &&
|
||||
x.contract.ContractEnd >= targetDate
|
||||
&& !vipGroup.Contains(x.leftWork.EmployeeId)
|
||||
)
|
||||
.Select(x => new { x.leftWork.WorkshopId, x.leftWork.EmployeeId });
|
||||
var workingCheckoutEmployeeIds = _companyContext.LeftWorkList.AsNoTracking()
|
||||
.Join(
|
||||
_companyContext.Contracts.AsNoTracking(),
|
||||
leftWork => new { leftWork.EmployeeId, WorkshopId = leftWork.WorkshopId },
|
||||
contract => new { contract.EmployeeId, WorkshopId = contract.WorkshopIds },
|
||||
(leftWork, contract) => new { leftWork, contract }
|
||||
)
|
||||
.Where(x =>
|
||||
workshopIds.Contains(x.leftWork.WorkshopId) &&
|
||||
x.leftWork.StartWorkDate <= targetEndDate &&
|
||||
x.leftWork.LeftWorkDate.AddDays(-1) >= targetStartDate &&
|
||||
x.contract.ContarctStart <= targetEndDate &&
|
||||
x.contract.ContractEnd >= targetStartDate &&
|
||||
!vipGroup.Contains(x.leftWork.EmployeeId) &&
|
||||
!_companyContext.EmployeeClientTemps
|
||||
.Any(temp => temp.EmployeeId == x.leftWork.EmployeeId && temp.WorkshopId == x.leftWork.WorkshopId)
|
||||
)
|
||||
.Select(x => new { x.leftWork.WorkshopId, x.leftWork.EmployeeId });
|
||||
|
||||
var workingContractEmployeeIds = _companyContext.LeftWorkList.AsNoTracking()
|
||||
.Where(x => workshopIds.Contains(x.WorkshopId) && x.StartWorkDate <= nextMonth && x.LeftWorkDate.AddDays(-1) >= nextMonth
|
||||
&& !vipGroup.Contains(x.EmployeeId))
|
||||
.Select(x => new { x.WorkshopId, x.EmployeeId });
|
||||
.Where(x => workshopIds.Contains(x.WorkshopId) && x.StartWorkDate <= nextEndMonth && x.LeftWorkDate.AddDays(-1) >= nextStartMonth &&
|
||||
!vipGroup.Contains(x.EmployeeId) &&
|
||||
!_companyContext.EmployeeClientTemps
|
||||
.Any(temp => temp.EmployeeId == x.EmployeeId && temp.WorkshopId == x.WorkshopId)
|
||||
).Select(x => new { x.WorkshopId, x.EmployeeId });
|
||||
|
||||
var contractSet = (await _companyContext.Contracts.AsNoTracking()
|
||||
.Where(x => x.ContarctStart <= nextMonth && x.ContractEnd >= nextMonth && workshopIds.Contains(x.WorkshopIds))
|
||||
.Select(x => new { x.WorkshopIds, x.EmployeeId })
|
||||
.ToListAsync())
|
||||
.Select(x => (x.WorkshopIds, x.EmployeeId))
|
||||
.ToHashSet();
|
||||
var contractSet = (await _companyContext.Contracts.AsNoTracking()
|
||||
.Where(x => x.ContarctStart <= nextEndMonth && x.ContractEnd >= nextStartMonth && workshopIds.Contains(x.WorkshopIds))
|
||||
.Select(x => new { x.WorkshopIds, x.EmployeeId })
|
||||
.ToListAsync())
|
||||
.Select(x => (x.WorkshopIds, x.EmployeeId))
|
||||
.ToHashSet();
|
||||
|
||||
var checkoutSet = (await _companyContext.CheckoutSet.AsNoTracking()
|
||||
.Where(x => x.ContractStart <= targetDate && x.ContractEnd >= targetDate && workshopIds.Contains(x.WorkshopId))
|
||||
.Select(x => new { x.WorkshopId, x.EmployeeId })
|
||||
.ToListAsync())
|
||||
.Select(x => (x.WorkshopId, x.EmployeeId))
|
||||
.ToHashSet();
|
||||
var checkoutSet = (await _companyContext.CheckoutSet.AsNoTracking()
|
||||
.Where(x => x.ContractStart <= targetEndDate && x.ContractEnd >= targetStartDate && workshopIds.Contains(x.WorkshopId))
|
||||
.Select(x => new { x.WorkshopId, x.EmployeeId })
|
||||
.ToListAsync())
|
||||
.Select(x => (x.WorkshopId, x.EmployeeId))
|
||||
.ToHashSet();
|
||||
|
||||
var workingCheckoutGrouping = workingCheckoutEmployeeIds.GroupBy(x => x.WorkshopId).ToList();
|
||||
var workingCheckoutGrouping = workingCheckoutEmployeeIds.GroupBy(x => x.WorkshopId).ToList();
|
||||
|
||||
var workingContractGrouping = workingContractEmployeeIds.GroupBy(x => x.WorkshopId).Select(x => new
|
||||
{
|
||||
WorkshopId = x.Key,
|
||||
Data = x.ToList()
|
||||
}).ToList();
|
||||
var workingContractGrouping = workingContractEmployeeIds.GroupBy(x => x.WorkshopId).Select(x => new
|
||||
{
|
||||
WorkshopId = x.Key,
|
||||
Data = x.ToList()
|
||||
}).ToList();
|
||||
|
||||
var workshopsWithFullContracts = workingContractGrouping
|
||||
.Where(g => g.Data.All(emp => contractSet.Contains((emp.WorkshopId, emp.EmployeeId))))
|
||||
.Select(g => g.WorkshopId)
|
||||
.ToList();
|
||||
var workshopsWithFullContracts = workingContractGrouping
|
||||
.Where(g => g.Data.All(emp => contractSet.Contains((emp.WorkshopId, emp.EmployeeId))))
|
||||
.Select(g => g.WorkshopId)
|
||||
.ToList();
|
||||
|
||||
var workshopsWithFullCheckout = workingCheckoutGrouping
|
||||
.Where(g => g.All(emp => checkoutSet.Contains((emp.WorkshopId, emp.EmployeeId))))
|
||||
.Select(g => g.Key)
|
||||
.ToList();
|
||||
var list = workingContractEmployeeIds.ToList().Where(x=>!contractSet.Any(a=>a.EmployeeId== x.EmployeeId&&a.WorkshopIds == x.WorkshopId)).ToList();
|
||||
|
||||
var workshopsWithFullCheckout = workingCheckoutGrouping
|
||||
.Where(g => g.All(emp => checkoutSet.Contains((emp.WorkshopId, emp.EmployeeId))))
|
||||
.Select(g => g.Key)
|
||||
.ToList();
|
||||
|
||||
|
||||
var fullyCoveredWorkshops = workshopsWithFullContracts.Intersect(workshopsWithFullCheckout).ToList();
|
||||
var fullyCoveredWorkshops = workshopsWithFullContracts.Intersect(workshopsWithFullCheckout).ToList();
|
||||
|
||||
//var notFullyCoveredWorkshops = groupedCheckout
|
||||
// .Where(g => g.Any(emp =>
|
||||
// !contractSet.Contains((emp.WorkshopId, emp.EmployeeId)) ||
|
||||
// !checkoutSet.Contains((emp.WorkshopId, emp.EmployeeId))))
|
||||
// .Select(g => g.Key)
|
||||
// .ToList();
|
||||
//var notFullyCoveredWorkshops = groupedCheckout
|
||||
// .Where(g => g.Any(emp =>
|
||||
// !contractSet.Contains((emp.WorkshopId, emp.EmployeeId)) ||
|
||||
// !checkoutSet.Contains((emp.WorkshopId, emp.EmployeeId))))
|
||||
// .Select(g => g.Key)
|
||||
// .ToList();
|
||||
|
||||
var notFullyCoveredWorkshops = workshopIds.Except(fullyCoveredWorkshops);
|
||||
var notFullyCoveredWorkshops = workshopIds.Except(fullyCoveredWorkshops);
|
||||
|
||||
var adminMonthlyOverviews = _companyContext.AdminMonthlyOverviews
|
||||
.Where(x => x.Month == month && x.Year == year);
|
||||
var adminMonthlyOverviews = _companyContext.AdminMonthlyOverviews
|
||||
.Where(x => x.Month == month && x.Year == year);
|
||||
|
||||
var adminMonthlyOverviewsWithFullContracts = await adminMonthlyOverviews
|
||||
.Where(x => fullyCoveredWorkshops.Contains(x.WorkshopId) && x.Status == AdminMonthlyOverviewStatus.CreateDocuments)
|
||||
.ToListAsync();
|
||||
var adminMonthlyOverviewsWithFullContracts = await adminMonthlyOverviews
|
||||
.Where(x => fullyCoveredWorkshops.Contains(x.WorkshopId) && x.Status == AdminMonthlyOverviewStatus.CreateDocuments)
|
||||
.ToListAsync();
|
||||
|
||||
var adminMonthlyOverviewsWithNotFullContracts = await adminMonthlyOverviews
|
||||
.Where(x => notFullyCoveredWorkshops.Contains(x.WorkshopId) && x.Status != AdminMonthlyOverviewStatus.CreateDocuments)
|
||||
.ToListAsync();
|
||||
var adminMonthlyOverviewsWithNotFullContracts = await adminMonthlyOverviews
|
||||
.Where(x => notFullyCoveredWorkshops.Contains(x.WorkshopId) && x.Status != AdminMonthlyOverviewStatus.CreateDocuments)
|
||||
.ToListAsync();
|
||||
|
||||
foreach (var adminMonthlyOverview in adminMonthlyOverviewsWithFullContracts)
|
||||
adminMonthlyOverview.SetStatus(AdminMonthlyOverviewStatus.VisitPending);
|
||||
foreach (var adminMonthlyOverview in adminMonthlyOverviewsWithFullContracts)
|
||||
adminMonthlyOverview.SetStatus(AdminMonthlyOverviewStatus.VisitPending);
|
||||
|
||||
foreach (var adminMonthlyOverview in adminMonthlyOverviewsWithNotFullContracts)
|
||||
adminMonthlyOverview.SetStatus(AdminMonthlyOverviewStatus.CreateDocuments);
|
||||
foreach (var adminMonthlyOverview in adminMonthlyOverviewsWithNotFullContracts)
|
||||
adminMonthlyOverview.SetStatus(AdminMonthlyOverviewStatus.CreateDocuments);
|
||||
|
||||
await _companyContext.SaveChangesAsync();
|
||||
}
|
||||
await _companyContext.SaveChangesAsync();
|
||||
}
|
||||
|
||||
private async Task CreateRangeAdminMonthlyOverview(List<long> workshopIds, int month, int year)
|
||||
{
|
||||
foreach (var workshopId in workshopIds)
|
||||
{
|
||||
var adminMonthlyOverview =
|
||||
new AdminMonthlyOverview(workshopId, month, year, AdminMonthlyOverviewStatus.CreateDocuments);
|
||||
await _companyContext.AddAsync(adminMonthlyOverview);
|
||||
}
|
||||
private async Task CreateRangeAdminMonthlyOverview(List<long> workshopIds, int month, int year)
|
||||
{
|
||||
foreach (var workshopId in workshopIds)
|
||||
{
|
||||
var adminMonthlyOverview =
|
||||
new AdminMonthlyOverview(workshopId, month, year, AdminMonthlyOverviewStatus.CreateDocuments);
|
||||
await _companyContext.AddAsync(adminMonthlyOverview);
|
||||
}
|
||||
|
||||
await _companyContext.SaveChangesAsync();
|
||||
}
|
||||
await _companyContext.SaveChangesAsync();
|
||||
}
|
||||
}
|
||||
@@ -1173,7 +1173,17 @@ public class EmployeeDocumentsRepository : RepositoryBase<long, EmployeeDocument
|
||||
//RequiredDocuments = requiredDocs
|
||||
};
|
||||
}).ToList();
|
||||
|
||||
result.ForEach(x =>
|
||||
{
|
||||
x.EmployeePicture.PicturePath = GetThumbnailPathFromFilePath(x.EmployeePicture.PicturePath);
|
||||
x.IdCardPage1.PicturePath = GetThumbnailPathFromFilePath(x.IdCardPage1.PicturePath);
|
||||
x.IdCardPage2.PicturePath = GetThumbnailPathFromFilePath(x.IdCardPage2.PicturePath);
|
||||
x.IdCardPage3.PicturePath = GetThumbnailPathFromFilePath(x.IdCardPage3.PicturePath);
|
||||
x.IdCardPage4.PicturePath = GetThumbnailPathFromFilePath(x.IdCardPage4.PicturePath);
|
||||
x.NationalCardFront.PicturePath = GetThumbnailPathFromFilePath(x.NationalCardFront.PicturePath);
|
||||
x.NationalCardRear.PicturePath = GetThumbnailPathFromFilePath(x.NationalCardRear.PicturePath);
|
||||
x.MilitaryServiceCard.PicturePath = GetThumbnailPathFromFilePath(x.MilitaryServiceCard.PicturePath);
|
||||
});
|
||||
return result;
|
||||
|
||||
}
|
||||
@@ -1194,7 +1204,7 @@ public class EmployeeDocumentsRepository : RepositoryBase<long, EmployeeDocument
|
||||
.GroupBy(x => x.WorkshopId).Select(x => new WorkshopWithEmployeeDocumentsViewModel()
|
||||
{
|
||||
WorkshopId = x.Key,
|
||||
WorkshopFullName = x.FirstOrDefault().Workshop.WorkshopName,
|
||||
WorkshopFullName = x.FirstOrDefault().Workshop.WorkshopFullName,
|
||||
EmployeesWithoutDocumentCount = x.Count()
|
||||
});
|
||||
|
||||
@@ -1301,7 +1311,19 @@ public class EmployeeDocumentsRepository : RepositoryBase<long, EmployeeDocument
|
||||
};
|
||||
}).ToList();
|
||||
|
||||
return result;
|
||||
result.ForEach(x =>
|
||||
{
|
||||
x.EmployeePicture.PicturePath = GetThumbnailPathFromFilePath(x.EmployeePicture.PicturePath);
|
||||
x.IdCardPage1.PicturePath = GetThumbnailPathFromFilePath(x.IdCardPage1.PicturePath);
|
||||
x.IdCardPage2.PicturePath = GetThumbnailPathFromFilePath(x.IdCardPage2.PicturePath);
|
||||
x.IdCardPage3.PicturePath = GetThumbnailPathFromFilePath(x.IdCardPage3.PicturePath);
|
||||
x.IdCardPage4.PicturePath = GetThumbnailPathFromFilePath(x.IdCardPage4.PicturePath);
|
||||
x.NationalCardFront.PicturePath = GetThumbnailPathFromFilePath(x.NationalCardFront.PicturePath);
|
||||
x.NationalCardRear.PicturePath = GetThumbnailPathFromFilePath(x.NationalCardRear.PicturePath);
|
||||
x.MilitaryServiceCard.PicturePath = GetThumbnailPathFromFilePath(x.MilitaryServiceCard.PicturePath);
|
||||
});
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
public async Task<List<WorkshopWithEmployeeDocumentsViewModel>> GetClientRejectedDocumentWorkshopsForAdmin(List<long> workshops, long roleId)
|
||||
@@ -1463,9 +1485,19 @@ public class EmployeeDocumentsRepository : RepositoryBase<long, EmployeeDocument
|
||||
//RequiredDocuments = requiredDocs
|
||||
};
|
||||
}).ToList();
|
||||
result.ForEach(x =>
|
||||
{
|
||||
x.EmployeePicture.PicturePath = GetThumbnailPathFromFilePath(x.EmployeePicture.PicturePath);
|
||||
x.IdCardPage1.PicturePath = GetThumbnailPathFromFilePath(x.IdCardPage1.PicturePath);
|
||||
x.IdCardPage2.PicturePath = GetThumbnailPathFromFilePath(x.IdCardPage2.PicturePath);
|
||||
x.IdCardPage3.PicturePath = GetThumbnailPathFromFilePath(x.IdCardPage3.PicturePath);
|
||||
x.IdCardPage4.PicturePath = GetThumbnailPathFromFilePath(x.IdCardPage4.PicturePath);
|
||||
x.NationalCardFront.PicturePath = GetThumbnailPathFromFilePath(x.NationalCardFront.PicturePath);
|
||||
x.NationalCardRear.PicturePath = GetThumbnailPathFromFilePath(x.NationalCardRear.PicturePath);
|
||||
x.MilitaryServiceCard.PicturePath = GetThumbnailPathFromFilePath(x.MilitaryServiceCard.PicturePath);
|
||||
});
|
||||
|
||||
|
||||
return result;
|
||||
return result;
|
||||
}
|
||||
|
||||
public async Task<List<EmployeeDocumentsViewModel>> GetClientRejectedDocumentForClient(long workshopId, long accountId)
|
||||
@@ -1568,8 +1600,18 @@ public class EmployeeDocumentsRepository : RepositoryBase<long, EmployeeDocument
|
||||
//RequiredDocuments = requiredDocs
|
||||
};
|
||||
}).ToList();
|
||||
|
||||
return result;
|
||||
result.ForEach(x =>
|
||||
{
|
||||
x.EmployeePicture.PicturePath = GetThumbnailPathFromFilePath(x.EmployeePicture.PicturePath);
|
||||
x.IdCardPage1.PicturePath = GetThumbnailPathFromFilePath(x.IdCardPage1.PicturePath);
|
||||
x.IdCardPage2.PicturePath = GetThumbnailPathFromFilePath(x.IdCardPage2.PicturePath);
|
||||
x.IdCardPage3.PicturePath = GetThumbnailPathFromFilePath(x.IdCardPage3.PicturePath);
|
||||
x.IdCardPage4.PicturePath = GetThumbnailPathFromFilePath(x.IdCardPage4.PicturePath);
|
||||
x.NationalCardFront.PicturePath = GetThumbnailPathFromFilePath(x.NationalCardFront.PicturePath);
|
||||
x.NationalCardRear.PicturePath = GetThumbnailPathFromFilePath(x.NationalCardRear.PicturePath);
|
||||
x.MilitaryServiceCard.PicturePath = GetThumbnailPathFromFilePath(x.MilitaryServiceCard.PicturePath);
|
||||
});
|
||||
return result;
|
||||
}
|
||||
|
||||
//ToDo آپلود مدارک و افزودن پرسنل
|
||||
@@ -1646,8 +1688,12 @@ public class EmployeeDocumentsRepository : RepositoryBase<long, EmployeeDocument
|
||||
};
|
||||
}
|
||||
|
||||
private static string GetThumbnailPathFromFilePath(string filePath)
|
||||
{
|
||||
return string.IsNullOrWhiteSpace(filePath) ? string.Empty : Path.Combine(Path.GetDirectoryName(filePath)!, Path.GetFileNameWithoutExtension(filePath) + $"-thumbnail{Path.GetExtension(filePath)}");
|
||||
}
|
||||
|
||||
private static EmployeeDocumentItemViewModel GetByLabelAndLoadMedia(List<EmployeeDocumentItemViewModel> items,
|
||||
private static EmployeeDocumentItemViewModel GetByLabelAndLoadMedia(List<EmployeeDocumentItemViewModel> items,
|
||||
List<MediaViewModel> medias, DocumentItemLabel label)
|
||||
{
|
||||
if (items == null || items.Count == 0)
|
||||
|
||||
@@ -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
|
||||
});
|
||||
}
|
||||
|
||||
@@ -76,11 +86,11 @@ public class InsuranceListRepository : RepositoryBase<long, InsuranceList>, IIns
|
||||
public OperationResult CreateInsuranceListworkshopInfo(CreateInsuranceWorkshopInfo command)
|
||||
{
|
||||
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
|
||||
@@ -91,7 +101,7 @@ public class InsuranceListRepository : RepositoryBase<long, InsuranceList>, IIns
|
||||
_context.SaveChanges();
|
||||
|
||||
}
|
||||
|
||||
|
||||
return operation;
|
||||
}
|
||||
|
||||
@@ -103,9 +113,9 @@ 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();
|
||||
@@ -210,7 +220,7 @@ public class InsuranceListRepository : RepositoryBase<long, InsuranceList>, IIns
|
||||
// نام کارفرما
|
||||
EmployerName = x.EmployerName,
|
||||
//آدرس کارگاه
|
||||
Address = x.Address,
|
||||
Address = x.Address,
|
||||
ListNumber = x.ListNumber,
|
||||
}).FirstOrDefault();
|
||||
#endregion
|
||||
@@ -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;
|
||||
//مزایای مشمول غیر مستمر
|
||||
@@ -252,8 +262,8 @@ public class InsuranceListRepository : RepositoryBase<long, InsuranceList>, IIns
|
||||
employeeInsurancListData.JobName = job != null ? job.JobName : string.Empty; ;
|
||||
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;
|
||||
@@ -329,7 +339,7 @@ public class InsuranceListRepository : RepositoryBase<long, InsuranceList>, IIns
|
||||
|
||||
public List<InsuranceListViewModel> OptimizedSearch(InsuranceListSearchModel searchModel)
|
||||
{
|
||||
|
||||
|
||||
var acountId = _authHelper.CurrentAccountId();
|
||||
var workshopIds = _context.WorkshopAccounts.Where(x => x.AccountId == acountId).Select(x => x.WorkshopId);
|
||||
|
||||
@@ -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,28 @@ 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,
|
||||
EmployerApprovalStatus = result.insurance.EmployerApproval.Status
|
||||
});
|
||||
|
||||
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 +485,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 +494,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)
|
||||
{
|
||||
@@ -475,7 +504,7 @@ public class InsuranceListRepository : RepositoryBase<long, InsuranceList>, IIns
|
||||
var workshop = workshopList.FirstOrDefault(u => u.id == item.WorkshopId);
|
||||
var employerId = _context.WorkshopEmployers.Where(x => x.WorkshopId == item.WorkshopId)
|
||||
.Select(x => x.EmployerId).FirstOrDefault();
|
||||
|
||||
|
||||
string typeOfInsuranceSend = "";
|
||||
if (workshop.TypeOfInsuranceSend == "NormalList")
|
||||
{
|
||||
@@ -489,20 +518,20 @@ 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 +559,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 +582,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")
|
||||
@@ -574,7 +603,7 @@ public class InsuranceListRepository : RepositoryBase<long, InsuranceList>, IIns
|
||||
OperationResult result = new OperationResult();
|
||||
using (var transaction = _context.Database.BeginTransaction())
|
||||
{
|
||||
|
||||
|
||||
try
|
||||
{
|
||||
//var employeeInsurancList= _context.EmployeeInsurancListDataSet.Where(x => x.InsuranceListId == id).ToList();
|
||||
@@ -584,10 +613,10 @@ public class InsuranceListRepository : RepositoryBase<long, InsuranceList>, IIns
|
||||
//var insuranceListWorkshopList = _context.InsuranceListWorkshopSet.Where(x => x.InsurancListId == id).ToList();
|
||||
//if (insuranceListWorkshopList != null && insuranceListWorkshopList.Count > 0)
|
||||
_insuranceListWorkshopRepository.RemoveRange(id);
|
||||
|
||||
|
||||
|
||||
var insuranceListObj = _context.InsuranceListSet.Where(x => x.id == id).FirstOrDefault();
|
||||
if(insuranceListObj!=null)
|
||||
if (insuranceListObj != null)
|
||||
Remove(insuranceListObj);
|
||||
|
||||
SaveChanges();
|
||||
@@ -606,11 +635,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 +654,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 +670,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)
|
||||
@@ -831,10 +861,10 @@ public class InsuranceListRepository : RepositoryBase<long, InsuranceList>, IIns
|
||||
editInsuranceList.WorkshopIds = workshopIds;
|
||||
|
||||
return editInsuranceList;
|
||||
|
||||
|
||||
}
|
||||
|
||||
public MainEmployeeDetailsViewModel SearchEmployeeListForEditByInsuranceListId(EmployeeForEditInsuranceListSearchModel searchModel )
|
||||
public MainEmployeeDetailsViewModel SearchEmployeeListForEditByInsuranceListId(EmployeeForEditInsuranceListSearchModel searchModel)
|
||||
{
|
||||
var employeeDetailsViewModel = new MainEmployeeDetailsViewModel();
|
||||
|
||||
@@ -845,7 +875,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 +896,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 +905,7 @@ public class InsuranceListRepository : RepositoryBase<long, InsuranceList>, IIns
|
||||
//سهم بیمه حق کارگر
|
||||
employeeInsurancListData.InsuranceShare = item.InsuranceShare;
|
||||
// تاریخ شروع به کار
|
||||
employeeInsurancListData.StartWorkDate =item.StartWorkDate;
|
||||
employeeInsurancListData.StartWorkDate = item.StartWorkDate;
|
||||
//تاریخ ترک کار
|
||||
employeeInsurancListData.LeftWorkDate = item.LeftWorkDate;
|
||||
// آی دی شغل
|
||||
@@ -883,7 +913,7 @@ public class InsuranceListRepository : RepositoryBase<long, InsuranceList>, IIns
|
||||
employeeInsurancListData.JobName = job != null ? job.JobName : string.Empty;
|
||||
employeeInsurancListData.JobCode = job != null ? job.JobCode : string.Empty;
|
||||
employeeInsurancListData.StrStartWorkDate = item.StartWorkDate.ToFarsi();
|
||||
|
||||
|
||||
if (item.LeftWorkDate != null)
|
||||
employeeInsurancListData.StrLeftWorkDate = item.LeftWorkDate.ToFarsi();
|
||||
|
||||
@@ -893,7 +923,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 +954,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;
|
||||
@@ -993,13 +1023,13 @@ public class InsuranceListRepository : RepositoryBase<long, InsuranceList>, IIns
|
||||
public OperationResult ConfirmInsuranceList(long id)
|
||||
{
|
||||
OperationResult result = new OperationResult();
|
||||
|
||||
|
||||
|
||||
try
|
||||
{
|
||||
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();
|
||||
|
||||
@@ -1009,9 +1039,9 @@ public class InsuranceListRepository : RepositoryBase<long, InsuranceList>, IIns
|
||||
{
|
||||
|
||||
result.Message = "تایید ارسال لیست بیمه با موفقیت انجام شد";
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
return result;
|
||||
}
|
||||
@@ -1020,7 +1050,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 +1061,7 @@ public class InsuranceListRepository : RepositoryBase<long, InsuranceList>, IIns
|
||||
insuranceListViewModel.WorkShopId = insuranceList.WorkshopId;
|
||||
insuranceListViewModel.ConfirmSentlist = insuranceList.ConfirmSentlist;
|
||||
}
|
||||
return insuranceListViewModel;
|
||||
return insuranceListViewModel;
|
||||
}
|
||||
|
||||
#region client
|
||||
@@ -1113,11 +1143,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 +1259,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 +1277,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 count = (int)(end - start).TotalDays +1;
|
||||
var endBeforStartList = new DateTime(listStartDate.Year, listStartDate.Month, listStartDate.Day);
|
||||
end = endBeforStartList.AddDays(-1).ToPersianDateTime();
|
||||
}
|
||||
|
||||
|
||||
var count = (int)(end - start).TotalDays + 1;
|
||||
countDay += count;
|
||||
}
|
||||
|
||||
@@ -1226,12 +1291,12 @@ public class InsuranceListRepository : RepositoryBase<long, InsuranceList>, IIns
|
||||
|
||||
//تعداد سال های سابقه بیمه
|
||||
int yearsCount = countDay / 365;
|
||||
|
||||
|
||||
//بدست آوردن مزد سنوات بر اساس سابقه به سال
|
||||
var baseYear = _insuranceYearlySalaryRepository.GetBaseYearByDate(listStartDate, yearsCount);
|
||||
if(baseYear == 0)
|
||||
if (baseYear == 0)
|
||||
return (0, 0);
|
||||
|
||||
|
||||
|
||||
//اگر ترک کار کرده بود
|
||||
//یا
|
||||
@@ -1250,7 +1315,7 @@ public class InsuranceListRepository : RepositoryBase<long, InsuranceList>, IIns
|
||||
//}
|
||||
|
||||
|
||||
|
||||
|
||||
return (yearsCount, baseYear);
|
||||
}
|
||||
|
||||
@@ -1278,109 +1343,109 @@ 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,
|
||||
|
||||
|
||||
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),
|
||||
|
||||
//اطاعات محاسباتی
|
||||
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,
|
||||
|
||||
//حق تاهل
|
||||
MarriedAllowance = result.x.result.employeeData.MarriedAllowance,
|
||||
|
||||
//دستمزد ماهانه
|
||||
MonthlySalary = result.x.result.employeeData.MonthlySalary,
|
||||
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,
|
||||
|
||||
|
||||
//مزایای ماهانه
|
||||
MonthlyBenefits = result.x.result.employeeData.MonthlyBenefits,
|
||||
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,
|
||||
|
||||
//مزایای مشمول
|
||||
BenefitsIncludedContinuous = result.x.result.employeeData.MonthlyBenefitsIncluded,
|
||||
//اطلاعات هویتی
|
||||
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),
|
||||
|
||||
//مزایای غیر مشمول
|
||||
BenefitsIncludedNonContinuous = result.x.result.employeeData.BenefitsIncludedNonContinuous,
|
||||
//اطاعات محاسباتی
|
||||
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,
|
||||
|
||||
// جمع کل دستمزد و مزایای ماهانه مشمول و غیر مشمول
|
||||
IncludedAndNotIncluded = result.x.result.employeeData.BenefitsIncludedContinuous,
|
||||
//مجموع مزد روزانه و پایه سنوات
|
||||
DailyWagePlusBaseYears = result.x.result.employeeData.DailyWagePlusBaseYears,
|
||||
|
||||
//حق بیمه سهم بیمه شده
|
||||
InsuranceShare = result.x.result.employeeData.InsuranceShare,
|
||||
//حق تاهل
|
||||
MarriedAllowance = result.x.result.employeeData.MarriedAllowance,
|
||||
|
||||
//اضافه کار فیش حقوقی
|
||||
OverTimePay = result.x.result.employeeData.OverTimePay,
|
||||
//دستمزد ماهانه
|
||||
MonthlySalary = result.x.result.employeeData.MonthlySalary,
|
||||
|
||||
//حق اولا فیش حقوقی
|
||||
FamilyAllowance = result.x.result.employeeData.FamilyAllowance,
|
||||
});
|
||||
|
||||
//مزایای ماهانه
|
||||
MonthlyBenefits = result.x.result.employeeData.MonthlyBenefits,
|
||||
|
||||
//مزایای مشمول
|
||||
BenefitsIncludedContinuous = result.x.result.employeeData.MonthlyBenefitsIncluded,
|
||||
|
||||
//مزایای غیر مشمول
|
||||
BenefitsIncludedNonContinuous = result.x.result.employeeData.BenefitsIncludedNonContinuous,
|
||||
|
||||
// جمع کل دستمزد و مزایای ماهانه مشمول و غیر مشمول
|
||||
IncludedAndNotIncluded = result.x.result.employeeData.BenefitsIncludedContinuous,
|
||||
|
||||
//حق بیمه سهم بیمه شده
|
||||
InsuranceShare = result.x.result.employeeData.InsuranceShare,
|
||||
|
||||
//اضافه کار فیش حقوقی
|
||||
OverTimePay = result.x.result.employeeData.OverTimePay,
|
||||
|
||||
//حق اولا فیش حقوقی
|
||||
FamilyAllowance = result.x.result.employeeData.FamilyAllowance,
|
||||
});
|
||||
|
||||
|
||||
//.Select(x => new EmployeeDetailsForInsuranceListViewModel
|
||||
@@ -1427,4 +1492,120 @@ public class InsuranceListRepository : RepositoryBase<long, InsuranceList>, IIns
|
||||
|
||||
return res.ToList();
|
||||
}
|
||||
|
||||
public async Task<InsuranceListTabsCountViewModel> GetTabCounts(InsuranceListSearchModel searchModel)
|
||||
{
|
||||
var acountId = _authHelper.CurrentAccountId();
|
||||
|
||||
var workshopIds = _context.WorkshopAccounts
|
||||
.Where(a => a.AccountId == acountId)
|
||||
.Select(a => a.WorkshopId);
|
||||
var query = _context.InsuranceListSet
|
||||
.Where(x => workshopIds.Contains(x.WorkshopId))
|
||||
.Join(_context.Workshops.Include(x => x.InsuranceWorkshopInfo),
|
||||
insurance => insurance.WorkshopId,
|
||||
workshop => workshop.id,
|
||||
(insurance, workshop) => new { insurance, workshop })
|
||||
.GroupJoin(_context.WorkshopEmployers,
|
||||
result => result.workshop.id,
|
||||
employer => employer.WorkshopId,
|
||||
(result, employer) => new { result.insurance, result.workshop, employer })
|
||||
.Select(result => new InsuranceListViewModel
|
||||
{
|
||||
Id = result.insurance.id,
|
||||
Year = result.insurance.Year,
|
||||
Month = result.insurance.Month,
|
||||
WorkShopId = result.insurance.WorkshopId,
|
||||
WorkShopCode = result.workshop.InsuranceWorkshopInfo != null ? result.workshop.InsuranceWorkshopInfo.InsuranceCode : result.workshop.InsuranceCode,
|
||||
WorkShopName = result.workshop.InsuranceWorkshopInfo != null ? result.workshop.InsuranceWorkshopInfo.WorkshopName : result.workshop.WorkshopFullName,
|
||||
TypeOfInsuranceSend = result.workshop.TypeOfInsuranceSend == "NormalList" ? "عادی" :
|
||||
result.workshop.TypeOfInsuranceSend == "Govermentlist" ? "کمک دولت" :
|
||||
result.workshop.TypeOfInsuranceSend == "Familylist" ? "خانوادگی" : "",
|
||||
FixedSalary = result.workshop.FixedSalary,
|
||||
EmployerName = result.workshop.InsuranceWorkshopInfo != null ? result.workshop.InsuranceWorkshopInfo.EmployerName : result.workshop.WorkshopFullName,
|
||||
ConfirmSentlist = result.insurance.ConfirmSentlist,
|
||||
EmployerId = result.employer.First().EmployerId,
|
||||
DebtDone = result.insurance.Debt.IsDone,
|
||||
EmployerApproved = result.insurance.EmployerApproval.IsDone,
|
||||
InspectionDone = result.insurance.Inspection.IsDone
|
||||
});
|
||||
|
||||
if (!string.IsNullOrEmpty(searchModel.Year) && searchModel.Year != "0" && !string.IsNullOrEmpty(searchModel.Month) && searchModel.Month != "0")
|
||||
query = query.Where(x => x.Year == searchModel.Year && x.Month == searchModel.Month);
|
||||
else
|
||||
{
|
||||
if (!string.IsNullOrEmpty(searchModel.Month) && searchModel.Month != "0")
|
||||
query = query.Where(x => x.Month == searchModel.Month);
|
||||
|
||||
if (!string.IsNullOrEmpty(searchModel.Year) && searchModel.Year != "0")
|
||||
query = query.Where(x => x.Year == searchModel.Year);
|
||||
|
||||
}
|
||||
if (!string.IsNullOrEmpty(searchModel.WorkShopCode))
|
||||
query = query.Where(x => x.WorkShopCode == searchModel.WorkShopCode);
|
||||
|
||||
if (!string.IsNullOrEmpty(searchModel.WorkShopName))
|
||||
query = query.Where(x => x.WorkShopName.Contains(searchModel.WorkShopName));
|
||||
|
||||
|
||||
if (searchModel.WorkshopId > 0)
|
||||
{
|
||||
var workshopName = query.FirstOrDefault(u => u.WorkShopId == searchModel.WorkshopId)?.WorkShopName;
|
||||
|
||||
query = query.Where(x => x.WorkShopName.Contains(workshopName));
|
||||
}
|
||||
|
||||
if (searchModel.EmployerId > 0)
|
||||
{
|
||||
var employerName = query.FirstOrDefault(u => u.EmployerId == searchModel.EmployerId)?.EmployerName;
|
||||
query = query.Where(x => x.EmployerName.Contains(employerName));
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(searchModel.EmployerName))
|
||||
query = query.Where(x => x.EmployerName.Contains(searchModel.EmployerName));
|
||||
|
||||
|
||||
if (searchModel.FixedSalary != null)
|
||||
query = query.Where(x => x.FixedSalary == searchModel.FixedSalary);
|
||||
|
||||
if (!string.IsNullOrEmpty(searchModel.TypeOfInsuranceSend) && searchModel.TypeOfInsuranceSend != "0")
|
||||
query = query.Where(x => x.TypeOfInsuranceSend == searchModel.TypeOfInsuranceSend);
|
||||
|
||||
if (!string.IsNullOrEmpty(searchModel.City) && searchModel.City != "0")
|
||||
query = query.Where(x => x.City == searchModel.City);
|
||||
|
||||
if (!string.IsNullOrEmpty(searchModel.Branch))
|
||||
query = query.Where(x => x.Branch.Contains(searchModel.Branch));
|
||||
|
||||
|
||||
|
||||
var res = await query.GroupBy(x => 1)
|
||||
.Select(g => new InsuranceListTabsCountViewModel
|
||||
{
|
||||
NotStarted = g.Count(x =>
|
||||
!x.DebtDone && !x.EmployerApproved && !x.InspectionDone && !x.ConfirmSentlist),
|
||||
InProgress = g.Count(x =>
|
||||
(x.DebtDone || x.EmployerApproved || x.InspectionDone) && !(x.DebtDone && x.EmployerApproved && x.InspectionDone) && !x.ConfirmSentlist),
|
||||
ReadyToSendList = g.Count(x =>
|
||||
x.DebtDone && x.EmployerApproved && x.InspectionDone && !x.ConfirmSentlist),
|
||||
Done = g.Count(x => x.ConfirmSentlist)
|
||||
})
|
||||
.FirstOrDefaultAsync() ?? new InsuranceListTabsCountViewModel();
|
||||
|
||||
return res;
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </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 ?? "";
|
||||
}
|
||||
}
|
||||
@@ -796,5 +796,11 @@ public class LeftWorkInsuranceRepository : RepositoryBase<long, LeftWorkInsuranc
|
||||
return insuranceLeftWorkWithContractExitOnly.ToList();
|
||||
}
|
||||
|
||||
public LeftWorkInsurance GetLastLeftWorkByEmployeeIdAndWorkshopId(long workshopId, long employeeId)
|
||||
{
|
||||
return _context.LeftWorkInsuranceList.Where(x => x.WorkshopId == workshopId && x.EmployeeId == employeeId)
|
||||
.OrderByDescending(x => x.StartWorkDate).FirstOrDefault();
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
@@ -654,7 +654,10 @@ public class LeftWorkRepository : RepositoryBase<long, LeftWork>, ILeftWorkRepos
|
||||
var vipGroup = _context.CustomizeWorkshopEmployeeSettings.Where(x => x.CustomizeWorkshopGroupSettingId == 117)
|
||||
.Select(x => x.EmployeeId)
|
||||
.Except([5976]).ToList();
|
||||
var query = _context.LeftWorkList.Select(x => new LeftWorkViewModel()
|
||||
var clientTemps = _context.EmployeeClientTemps.Where(x => x.WorkshopId == searchModel.WorkshopId)
|
||||
.Select(x => x.EmployeeId);
|
||||
|
||||
var query = _context.LeftWorkList.Select(x => new LeftWorkViewModel()
|
||||
{
|
||||
Id = x.id,
|
||||
LeftWorkDate = x.LeftWorkDate.ToFarsi(),
|
||||
@@ -672,7 +675,7 @@ public class LeftWorkRepository : RepositoryBase<long, LeftWork>, ILeftWorkRepos
|
||||
JobName = _context.Jobs.FirstOrDefault(j => j.id == x.JobId).JobName
|
||||
|
||||
|
||||
}).Where(x=> !vipGroup.Contains(x.EmployeeId));
|
||||
}).Where(x=> !vipGroup.Contains(x.EmployeeId) && !clientTemps.Contains(x.EmployeeId));
|
||||
if (searchModel.WorkshopId != 0 && searchModel.EmployeeId != 0)
|
||||
query = query.Where(x => x.WorkshopId == searchModel.WorkshopId && x.EmployeeId == searchModel.EmployeeId);
|
||||
if (searchModel.EmployeeId != 0 && searchModel.WorkshopId == 0)
|
||||
|
||||
@@ -33,6 +33,7 @@ using CompanyManagment.App.Contracts.Reward.Enums;
|
||||
using static System.Runtime.InteropServices.JavaScript.JSType;
|
||||
using static Microsoft.EntityFrameworkCore.DbLoggerCategory.Database;
|
||||
using Company.Domain.HolidayItemAgg;
|
||||
using Company.Domain.RollCallEmployeeAgg;
|
||||
using PersianTools.Core;
|
||||
|
||||
|
||||
@@ -49,6 +50,7 @@ public class RollCallMandatoryRepository : RepositoryBase<long, RollCall>, IRoll
|
||||
private readonly TestDbContext _testDbContext;
|
||||
|
||||
|
||||
|
||||
public RollCallMandatoryRepository(CompanyContext context, IYearlySalaryRepository yearlySalaryRepository,
|
||||
ILeftWorkRepository leftWorkRepository, ILeaveRepository leaveRepository, IHolidayItemRepository holidayItemRepository, TestDbContext testDbContext) : base(context)
|
||||
{
|
||||
@@ -58,7 +60,8 @@ public class RollCallMandatoryRepository : RepositoryBase<long, RollCall>, IRoll
|
||||
_leaveRepository = leaveRepository;
|
||||
_holidayItemRepository = holidayItemRepository;
|
||||
_testDbContext = testDbContext;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#region OfficialChckout
|
||||
public ComputingViewModel MandatoryCompute(long employeeId, long workshopId, DateTime contractStart,
|
||||
@@ -724,6 +727,55 @@ public class RollCallMandatoryRepository : RepositoryBase<long, RollCall>, IRoll
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// محاسبه ساعات کارکرد پرسنل در صورت داشتن حضور غیاب
|
||||
/// </summary>
|
||||
/// <param name="employeeId"></param>
|
||||
/// <param name="workshopId"></param>
|
||||
/// <param name="contractStart"></param>
|
||||
/// <param name="contractEnd"></param>
|
||||
/// <returns></returns>
|
||||
public (bool hasRollCall, TimeSpan sumOfSpan) GetRollCallWorkingSpan(long employeeId, long workshopId,
|
||||
DateTime contractStart, DateTime contractEnd)
|
||||
{
|
||||
//bool hasRollcall =
|
||||
// _rollCallEmployeeRepository.HasRollCallRecord(employeeId, workshopId, contractStart, contractEnd);
|
||||
//if (!hasRollcall)
|
||||
// return (false, new TimeSpan());
|
||||
List<RollCallViewModel> rollCallResult;
|
||||
List<GroupedRollCalls> groupedRollCall;
|
||||
|
||||
|
||||
rollCallResult = _context.RollCalls.Where(x =>
|
||||
x.EmployeeId == employeeId && x.WorkshopId == workshopId && x.StartDate.Value.Date >= contractStart.Date &&
|
||||
x.StartDate.Value.Date <= contractEnd.Date && x.EndDate != null).Select(x => new RollCallViewModel()
|
||||
{
|
||||
StartDate = x.StartDate,
|
||||
EndDate = x.EndDate,
|
||||
ShiftSpan = (x.EndDate.Value - x.StartDate.Value),
|
||||
CreationDate = x.ShiftDate,
|
||||
BreakTimeSpan = x.BreakTimeSpan
|
||||
}).ToList();
|
||||
|
||||
groupedRollCall = rollCallResult.GroupBy(x => x.CreationDate.Date).Select(x => new GroupedRollCalls()
|
||||
{
|
||||
CreationDate = x.Key,
|
||||
ShiftList = x.Select(s => new ShiftList() { Start = s.StartDate!.Value, End = s.EndDate!.Value }).ToList(),
|
||||
HasFriday = x.Any(s => s.StartDate != null && s.EndDate != null && (s.StartDate.Value.DayOfWeek == DayOfWeek.Friday || s.EndDate.Value!.DayOfWeek == DayOfWeek.Friday)),
|
||||
SumOneDaySpan = new TimeSpan(x.Sum(shift => shift.ShiftSpan.Ticks)) - CalculateBreakTime(x.First().BreakTimeSpan,
|
||||
new TimeSpan(x.Sum(shift => shift.ShiftSpan.Ticks))),
|
||||
|
||||
BreakTime = CalculateBreakTime(x.First().BreakTimeSpan, new TimeSpan(x.Sum(shift => shift.ShiftSpan.Ticks))),
|
||||
|
||||
}).OrderBy(x => x.CreationDate).ToList();
|
||||
|
||||
|
||||
TimeSpan sumSpans = new TimeSpan(groupedRollCall.Sum(x => x.SumOneDaySpan.Ticks));
|
||||
return (true, sumSpans);
|
||||
}
|
||||
|
||||
|
||||
public async Task<ComputingViewModel> RotatingShiftReport(long workshopId, long employeeId, DateTime contractStart, DateTime contractEnd, string shiftwork, bool hasRollCall, CreateWorkingHoursTemp command, bool holidayWorking)
|
||||
{
|
||||
List<RollCallViewModel> rollCallResult = new List<RollCallViewModel>();
|
||||
@@ -2263,6 +2315,7 @@ public class RollCallMandatoryRepository : RepositoryBase<long, RollCall>, IRoll
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
#region CustomizeCheckout
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -8,10 +8,13 @@ using _0_Framework.Application;
|
||||
using _0_Framework.InfraStructure;
|
||||
using Company.Domain.LeftWorkAgg;
|
||||
using Company.Domain.MandatoryHoursAgg;
|
||||
using Company.Domain.RollCallAgg;
|
||||
using Company.Domain.RollCallEmployeeAgg;
|
||||
using Company.Domain.YearlySalaryAgg;
|
||||
using CompanyManagment.App.Contracts.Checkout;
|
||||
using CompanyManagment.App.Contracts.Holiday;
|
||||
using CompanyManagment.App.Contracts.LeftWork;
|
||||
using CompanyManagment.App.Contracts.RollCall;
|
||||
using CompanyManagment.App.Contracts.YearlySalary;
|
||||
using CompanyManagment.EFCore.Migrations;
|
||||
using Microsoft.AspNetCore.Mvc.RazorPages;
|
||||
@@ -27,13 +30,16 @@ public class YearlySalaryRepository : RepositoryBase<long, YearlySalary>, IYearl
|
||||
private readonly CompanyContext _context;
|
||||
private readonly ILeftWorkRepository _leftWorkRepository;
|
||||
private readonly IMandatoryHoursRepository _mandatoryHoursRepository;
|
||||
private readonly IRollCallEmployeeRepository _rollCallEmployeeRepository;
|
||||
|
||||
|
||||
public YearlySalaryRepository(CompanyContext context, ILeftWorkRepository leftWorkRepository, IMandatoryHoursRepository mandatoryHoursRepository) : base(context)
|
||||
|
||||
public YearlySalaryRepository(CompanyContext context, ILeftWorkRepository leftWorkRepository, IMandatoryHoursRepository mandatoryHoursRepository, IRollCallEmployeeRepository rollCallEmployeeRepository) : base(context)
|
||||
{
|
||||
_context = context;
|
||||
_leftWorkRepository = leftWorkRepository;
|
||||
_mandatoryHoursRepository = mandatoryHoursRepository;
|
||||
_rollCallEmployeeRepository = rollCallEmployeeRepository;
|
||||
}
|
||||
// لیست سال های برای دراپ دان
|
||||
#region GetYearsToDropDown
|
||||
@@ -2229,7 +2235,56 @@ public class YearlySalaryRepository : RepositoryBase<long, YearlySalary>, IYearl
|
||||
|
||||
return result;
|
||||
}
|
||||
private static TimeSpan CalculateBreakTime(TimeSpan breakTimeSpan, TimeSpan sumOneDaySpan)
|
||||
{
|
||||
if (breakTimeSpan * 2 >= sumOneDaySpan)
|
||||
return new TimeSpan();
|
||||
return breakTimeSpan; ;
|
||||
}
|
||||
|
||||
private (bool hasRollCall, double WorkingTotalHours) GetTotalWorkingHoursIfHasRollCall(long employeeId,long workshopId, DateTime contractStart, DateTime contractEnd)
|
||||
{
|
||||
bool hasRollCall = _rollCallEmployeeRepository.HasRollCallRecord(employeeId, workshopId,
|
||||
contractStart, contractEnd);
|
||||
double totalWorkingHours = 0;
|
||||
if (!hasRollCall)
|
||||
return (false, 0);
|
||||
|
||||
List<RollCallViewModel> rollCallResult;
|
||||
List<GroupedRollCalls> groupedRollCall;
|
||||
|
||||
|
||||
rollCallResult = _context.RollCalls.Where(x =>
|
||||
x.EmployeeId == employeeId && x.WorkshopId == workshopId && x.StartDate.Value.Date >= contractStart &&
|
||||
x.StartDate.Value.Date <= contractEnd && x.EndDate != null).Select(x => new RollCallViewModel()
|
||||
{
|
||||
StartDate = x.StartDate,
|
||||
EndDate = x.EndDate,
|
||||
ShiftSpan = (x.EndDate.Value - x.StartDate.Value),
|
||||
CreationDate = x.ShiftDate,
|
||||
BreakTimeSpan = x.BreakTimeSpan
|
||||
}).ToList();
|
||||
|
||||
groupedRollCall = rollCallResult.GroupBy(x => x.CreationDate.Date).Select(x => new GroupedRollCalls()
|
||||
{
|
||||
CreationDate = x.Key,
|
||||
ShiftList = x.Select(s => new ShiftList() { Start = s.StartDate!.Value, End = s.EndDate!.Value }).ToList(),
|
||||
HasFriday = x.Any(s => s.StartDate != null && s.EndDate != null && (s.StartDate.Value.DayOfWeek == DayOfWeek.Friday || s.EndDate.Value!.DayOfWeek == DayOfWeek.Friday)),
|
||||
SumOneDaySpan = new TimeSpan(x.Sum(shift => shift.ShiftSpan.Ticks)) - CalculateBreakTime(x.First().BreakTimeSpan,
|
||||
new TimeSpan(x.Sum(shift => shift.ShiftSpan.Ticks))),
|
||||
|
||||
|
||||
|
||||
}).OrderBy(x => x.CreationDate).ToList();
|
||||
|
||||
|
||||
TimeSpan sumSpans = new TimeSpan(groupedRollCall.Sum(x => x.SumOneDaySpan.Ticks));
|
||||
totalWorkingHours = sumSpans.TotalMinutes / 60;
|
||||
|
||||
return (true, totalWorkingHours);
|
||||
|
||||
|
||||
}
|
||||
public List<ContractsCanToLeave> LeftWorkCantoleaveList(DateTime startDate, DateTime endDate, long workshopId, long employeeId, bool hasleft, DateTime leftWorkDate, int fridayStartToEnd, int officialHoliday, string totalHoursH, string totalHorsM, DateTime separationStartDate)
|
||||
{
|
||||
// {مقدار ساعت مجاز مرخصی در برای یک روز{کامل
|
||||
@@ -2238,6 +2293,7 @@ public class YearlySalaryRepository : RepositoryBase<long, YearlySalary>, IYearl
|
||||
var allContractsBetween = _context.Contracts.AsSplitQuery().Include(x => x.WorkingHoursList)
|
||||
.Where(x => x.WorkshopIds == workshopId && x.EmployeeId == employeeId &&
|
||||
x.ContractEnd >= startDate && x.ContarctStart <= endDate).ToList();
|
||||
|
||||
int mandatoryDays = 0;
|
||||
double allCanToLeave = 0;
|
||||
double canToLeave = 0;
|
||||
@@ -2247,11 +2303,14 @@ public class YearlySalaryRepository : RepositoryBase<long, YearlySalary>, IYearl
|
||||
contractCounter += 1;
|
||||
var m = _mandatoryHoursRepository.GetMondatoryDays(contract.ContarctStart,
|
||||
contract.ContractEnd);
|
||||
|
||||
var workinghoursH = contract.WorkingHoursList.Select(x => x.TotalHoursesH).FirstOrDefault();
|
||||
var workinghoursM = contract.WorkingHoursList.Select(x => x.TotalHoursesM).FirstOrDefault();
|
||||
workinghoursM = string.IsNullOrWhiteSpace(workinghoursM) ? "0" : workinghoursM;
|
||||
var workingHoursHDouble = Convert.ToDouble(workinghoursH);
|
||||
var workingHoursMDouble = Convert.ToDouble(workinghoursM);
|
||||
|
||||
|
||||
if (workingHoursMDouble > 0)
|
||||
{
|
||||
//تبیدل دقیه به اعشار
|
||||
@@ -2259,6 +2318,22 @@ public class YearlySalaryRepository : RepositoryBase<long, YearlySalary>, IYearl
|
||||
}
|
||||
//کل ساعت کار پرسنل در این ماه
|
||||
var totalWorkingHours = workingHoursHDouble + workingHoursMDouble;
|
||||
|
||||
#region RollCallSpan
|
||||
|
||||
var contractTotallDays = Convert.ToInt32((contract.ContractEnd - contract.ContarctStart).TotalDays + 1);
|
||||
if (contractTotallDays <= 31)
|
||||
{
|
||||
|
||||
var rollCallTotalHoures = GetTotalWorkingHoursIfHasRollCall(employeeId, workshopId,
|
||||
contract.ContarctStart.Date, contract.ContractEnd.Date);
|
||||
if (rollCallTotalHoures.hasRollCall)
|
||||
{
|
||||
totalWorkingHours = rollCallTotalHoures.WorkingTotalHours;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
// میانگین ساعت کارکرد پرسنل در روز
|
||||
var workingHoursePerDay = totalWorkingHours / m.MoandatoryDays;
|
||||
|
||||
@@ -2753,6 +2828,22 @@ public class YearlySalaryRepository : RepositoryBase<long, YearlySalary>, IYearl
|
||||
}
|
||||
//کل ساعت کار پرسنل در این قرارداد
|
||||
var totalWorkingHours = workingHoursHDouble + workingHoursMDouble;
|
||||
|
||||
#region RollCallSpan
|
||||
|
||||
var contractTotallDays = Convert.ToInt32((contract.ContractEnd - contract.ContarctStart).TotalDays + 1);
|
||||
if (contractTotallDays <= 31)
|
||||
{
|
||||
|
||||
var rollCallTotalHoures = GetTotalWorkingHoursIfHasRollCall(employeeId, workshopId,
|
||||
contract.ContarctStart.Date, contract.ContractEnd.Date);
|
||||
if (rollCallTotalHoures.hasRollCall)
|
||||
{
|
||||
totalWorkingHours = rollCallTotalHoures.WorkingTotalHours;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
// میانگین ساعت کارکرد پرسنل در روز
|
||||
var workingHoursePerDay = totalWorkingHours / m.MoandatoryDays;
|
||||
|
||||
|
||||
@@ -18,6 +18,10 @@
|
||||
margin-right: 80px;
|
||||
}
|
||||
|
||||
.level4 {
|
||||
margin-right: 120px;
|
||||
}
|
||||
|
||||
.parent {
|
||||
border-radius: 10px 0px 0px 10px;
|
||||
min-width: 220px;
|
||||
@@ -42,6 +46,16 @@
|
||||
border: 1px solid #666666 !important;
|
||||
margin-right: -4px;
|
||||
}
|
||||
|
||||
.parentLevel3 {
|
||||
border-radius: 10px 0px 0px 10px;
|
||||
min-width: 220px !important;
|
||||
text-align: start;
|
||||
background-color: #666666 !important;
|
||||
border: 1px solid #666666 !important;
|
||||
margin-right: -4px;
|
||||
}
|
||||
|
||||
.ion-plus {
|
||||
position: relative !important;
|
||||
top: 4px !important;
|
||||
@@ -536,15 +550,45 @@
|
||||
<label class="btn btn-icon waves-effect btn-default m-b-5 open-close">
|
||||
<i class="ion-plus"></i> <i class="ion-minus" style="display: none;"></i><input type="checkbox" style="display: none" class="open-btn"/>
|
||||
</label>
|
||||
<label class="btn btn-inverse waves-effect waves-light m-b-5 parentLevel2"> <input type="checkbox" disabled="disabled" value="306" class="check-btn"> <span style="bottom: 2px;position: relative"> مدیریت کاربران </span> </label>
|
||||
</div>
|
||||
@* تشخیص چهره *@
|
||||
<div class="child-check level2">
|
||||
<label class="btn btn-icon waves-effect btn-default m-b-5 open-close">
|
||||
<i class="ion-plus"></i> <i class="ion-minus" style="display: none;"></i><input type="checkbox" style="display: none" class="open-btn"/>
|
||||
</label>
|
||||
<label class="btn btn-inverse waves-effect waves-light m-b-5 parentLevel2"> <input type="checkbox" disabled="disabled" value="308" class="check-btn"> <span style="bottom: 2px;position: relative"> تشخیص چهره </span> </label>
|
||||
<label class="btn btn-inverse waves-effect waves-light m-b-5 parentLevel2"> <input type="checkbox" disabled="disabled" value="306" class="check-btn"> <span style="bottom: 2px;position: relative"> مدیریت کاربران </span> </label>
|
||||
@*لیست کاربران کلاینت*@
|
||||
<div class="child-check level3">
|
||||
<label class="btn btn-icon waves-effect btn-default m-b-5 open-close">
|
||||
<i class="ion-plus"></i> <i class="ion-minus" style="display: none;"></i><input type="checkbox" style="display: none" class="open-btn"/>
|
||||
</label>
|
||||
<label class="btn btn-inverse waves-effect waves-light m-b-5 parentLevel3"><input type="checkbox" disabled="disabled" value="30603" class="check-btn"> <span style="bottom: 2px;position: relative"> لیست کاربران کلاینت </span> </label>
|
||||
|
||||
<div class="child-check level4">
|
||||
<label class="btn btn-inverse waves-effect waves-light m-b-5 children "><input type="checkbox" disabled="disabled" value="3060301" class="check-btn"> <span style="bottom: 2px;position: relative"> ورود به کلاینت </span> </label>
|
||||
</div>
|
||||
<div class="child-check level4">
|
||||
<label class="btn btn-inverse waves-effect waves-light m-b-5 children "><input type="checkbox" disabled="disabled" value="3060302" class="check-btn"> <span style="bottom: 2px;position: relative"> تغییر رمز </span> </label>
|
||||
</div>
|
||||
<div class="child-check level4">
|
||||
<label class="btn btn-inverse waves-effect waves-light m-b-5 children "><input type="checkbox" disabled="disabled" value="3060303" class="check-btn"> <span style="bottom: 2px;position: relative"> ویرایش </span> </label>
|
||||
</div>
|
||||
<div class="child-check level4">
|
||||
<label class="btn btn-inverse waves-effect waves-light m-b-5 children "><input type="checkbox" disabled="disabled" value="3060304" class="check-btn"> <span style="bottom: 2px;position: relative"> حذف </span> </label>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div class="child-check level3">
|
||||
<label class="btn btn-inverse waves-effect waves-light m-b-5 children "><input type="checkbox" disabled="disabled" value="30601" class="check-btn"> <span style="bottom: 2px;position: relative"> ایجادکاربر جدید </span> </label>
|
||||
</div>
|
||||
<div class="child-check level3">
|
||||
<label class="btn btn-inverse waves-effect waves-light m-b-5 children "><input type="checkbox" disabled="disabled" value="30602" class="check-btn"> <span style="bottom: 2px;position: relative"> ایجاد نقش جدید </span> </label>
|
||||
</div>
|
||||
|
||||
<div class="child-check level3">
|
||||
<label class="btn btn-inverse waves-effect waves-light m-b-5 children "><input type="checkbox" disabled="disabled" value="30604" class="check-btn"> <span style="bottom: 2px;position: relative"> لیست کاربران ادمین </span> </label>
|
||||
</div>
|
||||
<div class="child-check level3">
|
||||
<label class="btn btn-inverse waves-effect waves-light m-b-5 children "><input type="checkbox" disabled="disabled" value="30605" class="check-btn"> <span style="bottom: 2px;position: relative"> نقش ها </span> </label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@* گزارشات *@
|
||||
<div class="child-check level2">
|
||||
<label class="btn btn-icon waves-effect btn-default m-b-5 open-close">
|
||||
|
||||
@@ -18,6 +18,11 @@
|
||||
margin-right: 80px;
|
||||
}
|
||||
|
||||
.level4 {
|
||||
margin-right: 120px;
|
||||
}
|
||||
|
||||
|
||||
.parent {
|
||||
border-radius: 10px 0px 0px 10px;
|
||||
min-width: 220px;
|
||||
@@ -42,6 +47,15 @@
|
||||
margin-right: -4px;
|
||||
}
|
||||
|
||||
.parentLevel3 {
|
||||
border-radius: 10px 0px 0px 10px;
|
||||
min-width: 220px !important;
|
||||
text-align: start;
|
||||
background-color: #666666 !important;
|
||||
border: 1px solid #666666 !important;
|
||||
margin-right: -4px;
|
||||
}
|
||||
|
||||
.ion-plus {
|
||||
position: relative !important;
|
||||
top: 4px !important;
|
||||
@@ -478,7 +492,15 @@
|
||||
</div>
|
||||
|
||||
</div>
|
||||
@*ایجاد عناوین مقادیر سالانه*@
|
||||
@*حضورغیاب*@
|
||||
<div class="child-check level2">
|
||||
<label class="btn btn-icon waves-effect btn-default m-b-5 open-close">
|
||||
<i class="ion-plus"></i> <i class="ion-minus" style="display: none;"></i><input type="checkbox" style="display: none" class="open-btn"/>
|
||||
</label>
|
||||
<label class="btn btn-inverse waves-effect waves-light m-b-5 parentLevel2"> <input type="checkbox" disabled="disabled" value="308" class="check-btn"> <span style="bottom: 2px;position: relative"> حضورغیاب </span> </label>
|
||||
|
||||
</div>
|
||||
@*ایجاد عناوین مقادیر سالانه*@
|
||||
<div class="child-check level2">
|
||||
<label class="btn btn-icon waves-effect btn-default m-b-5 open-close">
|
||||
<i class="ion-plus"></i> <i class="ion-minus" style="display: none;"></i><input type="checkbox" style="display: none" class="open-btn"/>
|
||||
@@ -539,15 +561,45 @@
|
||||
<label class="btn btn-icon waves-effect btn-default m-b-5 open-close">
|
||||
<i class="ion-plus"></i> <i class="ion-minus" style="display: none;"></i><input type="checkbox" style="display: none" class="open-btn"/>
|
||||
</label>
|
||||
<label class="btn btn-inverse waves-effect waves-light m-b-5 parentLevel2"> <input type="checkbox" disabled="disabled" value="306" class="check-btn"> <span style="bottom: 2px;position: relative"> مدیریت کاربران </span> </label>
|
||||
</div>
|
||||
@* تشخیص چهره *@
|
||||
<div class="child-check level2">
|
||||
<label class="btn btn-icon waves-effect btn-default m-b-5 open-close">
|
||||
<i class="ion-plus"></i> <i class="ion-minus" style="display: none;"></i><input type="checkbox" style="display: none" class="open-btn"/>
|
||||
</label>
|
||||
<label class="btn btn-inverse waves-effect waves-light m-b-5 parentLevel2"> <input type="checkbox" disabled="disabled" value="308" class="check-btn"> <span style="bottom: 2px;position: relative"> تشخیص چهره </span> </label>
|
||||
<label class="btn btn-inverse waves-effect waves-light m-b-5 parentLevel2"> <input type="checkbox" disabled="disabled" value="306" class="check-btn"> <span style="bottom: 2px;position: relative"> مدیریت کاربران </span> </label>
|
||||
@*لیست کاربران کلاینت*@
|
||||
<div class="child-check level3">
|
||||
<label class="btn btn-icon waves-effect btn-default m-b-5 open-close">
|
||||
<i class="ion-plus"></i> <i class="ion-minus" style="display: none;"></i><input type="checkbox" style="display: none" class="open-btn"/>
|
||||
</label>
|
||||
<label class="btn btn-inverse waves-effect waves-light m-b-5 parentLevel3"><input type="checkbox" disabled="disabled" value="30603" class="check-btn"> <span style="bottom: 2px;position: relative"> لیست کاربران کلاینت </span> </label>
|
||||
|
||||
<div class="child-check level4">
|
||||
<label class="btn btn-inverse waves-effect waves-light m-b-5 children "><input type="checkbox" disabled="disabled" value="3060301" class="check-btn"> <span style="bottom: 2px;position: relative"> ورود به کلاینت </span> </label>
|
||||
</div>
|
||||
<div class="child-check level4">
|
||||
<label class="btn btn-inverse waves-effect waves-light m-b-5 children "><input type="checkbox" disabled="disabled" value="3060302" class="check-btn"> <span style="bottom: 2px;position: relative"> تغییر رمز </span> </label>
|
||||
</div>
|
||||
<div class="child-check level4">
|
||||
<label class="btn btn-inverse waves-effect waves-light m-b-5 children "><input type="checkbox" disabled="disabled" value="3060303" class="check-btn"> <span style="bottom: 2px;position: relative"> ویرایش </span> </label>
|
||||
</div>
|
||||
<div class="child-check level4">
|
||||
<label class="btn btn-inverse waves-effect waves-light m-b-5 children "><input type="checkbox" disabled="disabled" value="3060304" class="check-btn"> <span style="bottom: 2px;position: relative"> حذف </span> </label>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div class="child-check level3">
|
||||
<label class="btn btn-inverse waves-effect waves-light m-b-5 children "><input type="checkbox" disabled="disabled" value="30601" class="check-btn"> <span style="bottom: 2px;position: relative"> ایجادکاربر جدید </span> </label>
|
||||
</div>
|
||||
<div class="child-check level3">
|
||||
<label class="btn btn-inverse waves-effect waves-light m-b-5 children "><input type="checkbox" disabled="disabled" value="30602" class="check-btn"> <span style="bottom: 2px;position: relative"> ایجاد نقش جدید </span> </label>
|
||||
</div>
|
||||
|
||||
<div class="child-check level3">
|
||||
<label class="btn btn-inverse waves-effect waves-light m-b-5 children "><input type="checkbox" disabled="disabled" value="30604" class="check-btn"> <span style="bottom: 2px;position: relative"> لیست کاربران ادمین </span> </label>
|
||||
</div>
|
||||
<div class="child-check level3">
|
||||
<label class="btn btn-inverse waves-effect waves-light m-b-5 children "><input type="checkbox" disabled="disabled" value="30605" class="check-btn"> <span style="bottom: 2px;position: relative"> نقش ها </span> </label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@* گزارشات *@
|
||||
<div class="child-check level2">
|
||||
<label class="btn btn-icon waves-effect btn-default m-b-5 open-close">
|
||||
|
||||
@@ -3,12 +3,14 @@
|
||||
@using Microsoft.EntityFrameworkCore
|
||||
@using _0_Framework.Application
|
||||
@model ServiceHost.Areas.Admin.Pages.Accounts.Account.IndexModel
|
||||
@inject IAuthHelper _AuthHelper;
|
||||
|
||||
@{
|
||||
|
||||
var i = 1;
|
||||
var j = 1;
|
||||
var r = 1;
|
||||
var permissionList = _AuthHelper.GetPermissions();
|
||||
//string colaps = "in";
|
||||
//string act = "active";
|
||||
}
|
||||
@@ -64,11 +66,11 @@
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
|
||||
<p class="pull-right">
|
||||
<p class="pull-right" permission="30601">
|
||||
<a href="#showmodal=@Url.Page("./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; border-top-left-radius: 0px; border-bottom-left-radius: 0px "> <i class="fa fa-user-plus" style="padding-left: 3px; font-size: 14px; color: #0f9500 !important "></i> ایجاد کاربر جدید</a>
|
||||
|
||||
</p>
|
||||
<p class="pull-right">
|
||||
<p class="pull-right" permission="30602">
|
||||
<a href="#showmodal=@Url.Page("./Index", "CreateRole")" class="btn btn-success btn-rounded waves-effect waves-light m-b-5" style=" background-color: #f5f5f5; border-color: #605f5f; font-family: 'Web_Yekan' !important; color: #605f5f !important; border-top-right-radius: 0px; border-bottom-right-radius: 0px "> <i class="fa fa-group" style="padding-left: 3px; font-size: 14px; color: #605f5f !important "></i> ایجاد نقش جدید</a>
|
||||
|
||||
</p>
|
||||
@@ -99,17 +101,17 @@
|
||||
|
||||
<ul class="nav nav-tabs tabs" id="myTab">
|
||||
@* ============================================RolesTab=================*@
|
||||
<li class="tab">
|
||||
<li class="tab @(permissionList.All(x => x != 30604) && permissionList.All(x => x != 30603)? "active" : "") " permission="30605">
|
||||
<a href="#profile-21" data-toggle="tab" aria-expanded="false" class=" ac">
|
||||
<span class="visible-xs">
|
||||
<i class="fa fa-group" style="display: block;padding: 20px 0 0 0;"></i>
|
||||
<span class="visible-xs">
|
||||
<i class="fa fa-group" style="display: block;padding: 20px 0 0 0;"></i>
|
||||
<span class="textMenu">نقش ها</span>
|
||||
</span>
|
||||
</span>
|
||||
<h3 class="hideInMobile" style="font-family: 'Web_Yekan' !important; font-size: 18px !important"><i class="fa fa-group fa-2x" style="padding-left: 3px;"></i> نقش ها</h3>
|
||||
</a>
|
||||
</li>
|
||||
</li>
|
||||
@* ===============================================AdminTab=================*@
|
||||
<li class="tab active">
|
||||
<li class="tab active" permission="30604">
|
||||
<a href="#home-21" data-toggle="tab" aria-expanded="false" class="active ac">
|
||||
<span class="visible-xs">
|
||||
<i class="fa fa-user" style="display: block;padding: 20px 0 0 0;"></i>
|
||||
@@ -119,20 +121,21 @@
|
||||
</a>
|
||||
</li>
|
||||
@* ===============================================ClientTab=================*@
|
||||
<li class="tab">
|
||||
<li class="tab @(permissionList.All(x => x != 30604) ? "active" : "")" permission="30603">
|
||||
<a href="#Client-21" data-toggle="tab" aria-expanded="false" class=" ac">
|
||||
<span class="visible-xs" >
|
||||
<i class="fa fa-group" style="display: block;padding: 20px 0 0 0;"></i>
|
||||
<span class="textMenu">لیست موازی</span>
|
||||
</span>
|
||||
<h3 class="hideInMobile" style="font-family: 'Web_Yekan' !important; font-size: 18px !important"><i class="fa fa-group fa-2x" style="padding-left: 3px;"></i> لیست کاربران ( موازی) (@Model.ClientAccounts.Count) </h3>
|
||||
<span class="visible-xs" >
|
||||
<i class="fa fa-group" style="display: block;padding: 20px 0 0 0;"></i>
|
||||
<span class="textMenu">لیست کلاینت</span>
|
||||
</span>
|
||||
<h3 class="hideInMobile" style="font-family: 'Web_Yekan' !important; font-size: 18px !important"><i class="fa fa-group fa-2x" style="padding-left: 3px;"></i> لیست کاربران ( کلاینت) (@Model.ClientAccounts.Count) </h3>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
<div class="tab-content">
|
||||
@*==================================================================Adminusers=====*@
|
||||
<div class="tab-pane active" id="home-21">
|
||||
<div class="tab-pane active" id="home-21" permission="30604">
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
@@ -298,7 +301,7 @@
|
||||
</div>
|
||||
|
||||
@*==================================================================roles=====*@
|
||||
<div class="tab-pane" id="profile-21">
|
||||
<div class="tab-pane @(permissionList.All(x => x != 30604) && permissionList.All(x => x != 30603)? "active" : "") " id="profile-21" permission="30605">
|
||||
|
||||
|
||||
|
||||
@@ -367,7 +370,7 @@
|
||||
</div>
|
||||
|
||||
@*==================================================================Clientusers=====*@
|
||||
<div class="tab-pane" id="Client-21">
|
||||
<div class="tab-pane @(permissionList.All(x => x != 30604) ? "active" : "")" id="Client-21" permission="30603">
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
@@ -485,27 +488,27 @@
|
||||
j++;
|
||||
}
|
||||
<td>
|
||||
<a class="btn btn-success pull-right m-rl-5 red" onclick="directLogin(@item.Id)">
|
||||
<a permission="3060301" class="btn btn-success pull-right m-rl-5 red" onclick="directLogin(@item.Id)">
|
||||
<i class="fa fa-sign-in faSize"></i><span style="position: relative;bottom: 3px;">ورود به کلاینت</span>
|
||||
</a>
|
||||
<a class="btn btn-info pull-right m-rl-5 red"
|
||||
<a permission="3060302" class="btn btn-info pull-right m-rl-5 red"
|
||||
href="#showmodal=@Url.Page("./Index", "ChangePassword", new { item.Id })">
|
||||
<i class="fa fa-key faSize"></i>
|
||||
</a>
|
||||
<a class="btn btn-warning pull-right m-rl-5 red"
|
||||
<a permission="3060303" class="btn btn-warning pull-right m-rl-5 red"
|
||||
href="#showmodal=@Url.Page("./Index", "Edit", new { item.Id })">
|
||||
<i class="fa fa-edit faSize"></i>
|
||||
</a>
|
||||
|
||||
@if (item.IsActiveString == "true" && item.Role != "مدیر سیستم")
|
||||
{
|
||||
<a onclick="deActive(@item.Id, '@item.Fullname')" class="btn btn-danger pull-right m-rl-5 red">
|
||||
<a permission="3060304" onclick="deActive(@item.Id, '@item.Fullname')" class="btn btn-danger pull-right m-rl-5 red">
|
||||
<i class="fa faSize fa-trash"></i>
|
||||
</a>
|
||||
}
|
||||
else if (item.IsActiveString == "false")
|
||||
{
|
||||
<a onclick="Active(@item.Id, '@item.Fullname')" class=" btn btn-success pull-right m-rl-5 red">
|
||||
<a permission="3060304" onclick="Active(@item.Id, '@item.Fullname')" class=" btn btn-success pull-right m-rl-5 red">
|
||||
<i class="fa faSize fa-rotate-left"></i>
|
||||
</a>
|
||||
}
|
||||
|
||||
@@ -1483,8 +1483,8 @@ public class IndexModel : PageModel
|
||||
return Partial("../Error/_ErrorModal", resultError);
|
||||
}
|
||||
|
||||
var clientTemps = _employeeClientTempApplication.GetByEmployeeId(employeeId).GetAwaiter().GetResult();
|
||||
if (leftWorks.Any(x => x.LeftWorkType == LeftWorkTempType.StartWork) || clientTemps.Any())
|
||||
//var clientTemps = _employeeClientTempApplication.GetByEmployeeId(employeeId).GetAwaiter().GetResult();
|
||||
if (leftWorks.Any(x => x.LeftWorkType == LeftWorkTempType.StartWork) /*|| clientTemps.Any()*/)
|
||||
{
|
||||
var resultError = new ErrorViewModel()
|
||||
{
|
||||
|
||||
@@ -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(InsuranceListSearchModel searchModel)
|
||||
{
|
||||
|
||||
var resultData = await _insuranceListApplication.GetTabCounts(searchModel);
|
||||
|
||||
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>
|
||||
@@ -60,6 +60,14 @@
|
||||
.sweet-alert {
|
||||
font-family: 'IranSans' !important
|
||||
}
|
||||
|
||||
table.dataTable tbody tr {
|
||||
transition: all .1s ease-in
|
||||
}
|
||||
|
||||
table.dataTable tbody tr:hover {
|
||||
background-color: #d5e5e5 !important;
|
||||
}
|
||||
</style>
|
||||
<link href="~/AdminTheme/assets/sweet-alert/sweet-alert.min.css" rel="stylesheet">
|
||||
<link href="~/AdminTheme/assets/css/alert.css" rel="stylesheet">
|
||||
@@ -127,8 +135,8 @@
|
||||
}
|
||||
|
||||
<div>
|
||||
<p class="text-right fw-bold text-nowrap" style="font-size: 14px;color: #7b7b7b;font-weight: 600;">@currentAccount.Fullname</p>
|
||||
<p class="text-right fw-bold text-nowrap">@currentAccount.Role</p>
|
||||
<p class="fw-bold text-nowrap text-right" style="font-size: 14px;color: #7b7b7b;font-weight: 600;">@currentAccount.Fullname</p>
|
||||
<p class="fw-bold text-nowrap text-right">@currentAccount.Role</p>
|
||||
</div>
|
||||
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="12" height="10" viewBox="0 0 12 10" fill="none">
|
||||
@@ -162,7 +170,7 @@
|
||||
<i class="md md-notifications"></i> <span class="badge badge-xs badge-danger">3</span>
|
||||
</a>
|
||||
<ul class="dropdown-menu dropdown-menu-lg">
|
||||
<li class="text-center notifi-title">Notification</li>
|
||||
<li class="notifi-title text-center">Notification</li>
|
||||
<li class="list-group">-->
|
||||
<!-- list item-->
|
||||
<!--<a href="javascript:void(0);" class="list-group-item">
|
||||
@@ -272,8 +280,8 @@
|
||||
</div>
|
||||
<!-- END wrapper -->
|
||||
<script>
|
||||
var resizefunc = [];
|
||||
</script>
|
||||
var resizefunc = [];
|
||||
</script>
|
||||
|
||||
|
||||
<div id="MainModal" class="modal fade" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" style="display: none;">
|
||||
@@ -301,7 +309,10 @@
|
||||
<script src="~/AdminTheme/assets/fastclick/fastclick.js"></script>
|
||||
<script src="~/AdminTheme/assets/jquery-slimscroll/jquery.slimscroll.js"></script>
|
||||
<script src="~/AdminTheme/assets/jquery-blockui/jquery.blockUI.js"></script>
|
||||
|
||||
|
||||
<script src="~/assetsclient/js/services/ajax-service.js?ver=@Version.AdminVersion"></script>
|
||||
<script src="~/assetsclient/js/services/url-params-builder.js?ver=@Version.AdminVersion"></script>
|
||||
<script src="~/assetsclient/js/services/jalali-date-validator.js?ver=@Version.AdminVersion"></script>
|
||||
|
||||
<!-- sweet alerts -->
|
||||
<script src="~/AdminTheme/assets/sweet-alert/sweet-alert.min.js"></script>
|
||||
@@ -366,261 +377,281 @@
|
||||
</script>*@
|
||||
|
||||
<script>
|
||||
$.fn.modal.Constructor.prototype.enforceFocus = function () { };
|
||||
$(document).ready(function () {
|
||||
$(".select-city").select2({
|
||||
language: "fa",
|
||||
dir: "rtl"
|
||||
});
|
||||
$.fn.modal.Constructor.prototype.enforceFocus = function () { };
|
||||
$(document).ready(function () {
|
||||
$(".select-city").select2({
|
||||
language: "fa",
|
||||
dir: "rtl"
|
||||
});
|
||||
|
||||
$('.has_sub.active').find(".md-add").removeClass("md-add").addClass("md-remove");
|
||||
$('.has_sub.active').find('.MainMenuItem').addClass('active');
|
||||
})
|
||||
$('.has_sub.active').find(".md-add").removeClass("md-add").addClass("md-remove");
|
||||
$('.has_sub.active').find('.MainMenuItem').addClass('active');
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
<script>
|
||||
var antiForgeryTokenLayout = $('@Html.AntiForgeryToken()').val();
|
||||
//vafa After Modal fix
|
||||
// $('#MainModal').on('hidden.bs.modal', function () {
|
||||
// $("#ModalContent").html("");
|
||||
// $("#printSection").html("");
|
||||
// });
|
||||
var url = window.location.href.split('?')[0];
|
||||
var url2 = window.location.href.split('#')[0];
|
||||
function convertPersianNumbersToEnglish(input) {
|
||||
var persianNumbers = [/۰/g, /۱/g, /۲/g, /۳/g, /۴/g, /۵/g, /۶/g, /۷/g, /۸/g, /۹/g];
|
||||
var arabicNumbers = [/٠/g, /١/g, /٢/g, /٣/g, /٤/g, /٥/g, /٦/g, /٧/g, /٨/g, /٩/g];
|
||||
|
||||
var str = input;
|
||||
for (var i = 0; i < 10; i++) {
|
||||
str = str.replace(persianNumbers[i], i).replace(arabicNumbers[i], i);
|
||||
}
|
||||
return str;
|
||||
}
|
||||
|
||||
var antiForgeryTokenLayout = $('@Html.AntiForgeryToken()').val();
|
||||
//vafa After Modal fix
|
||||
// $('#MainModal').on('hidden.bs.modal', function () {
|
||||
// $("#ModalContent").html("");
|
||||
// $("#printSection").html("");
|
||||
// });
|
||||
var url = window.location.href.split('?')[0];
|
||||
var url2 = window.location.href.split('#')[0];
|
||||
|
||||
$('.btnDashboard').filter(function() {
|
||||
if (this.href == url || this.href == url2) {
|
||||
$(this).addClass('active');
|
||||
};
|
||||
});
|
||||
$('.btnDashboard').filter(function() {
|
||||
if (this.href == url || this.href == url2) {
|
||||
$(this).addClass('active');
|
||||
};
|
||||
});
|
||||
|
||||
$('.clik').filter(function() {
|
||||
if (this.href == url || this.href == url2) {
|
||||
$(".sdf1").slideDown(1);
|
||||
/*$(".wav").addClass("subdrop");*/
|
||||
$(this).parentsUntil("#sidebar-menu > ul > li > a").addClass('active');
|
||||
};
|
||||
});
|
||||
$('.clik2').filter(function() {
|
||||
if (this.href == url || this.href == url2) {
|
||||
$(".sdf2").slideDown(350);
|
||||
/* $(".wav").addClass("subdrop");*/
|
||||
$(this).parentsUntil("#sidebar-menu > ul > li > a").addClass('active');
|
||||
};
|
||||
});
|
||||
$('.clik3').filter(function () {
|
||||
if (this.href == url || this.href == url2) {
|
||||
$(".sdf3").slideDown(350);
|
||||
/* $(".wav").addClass("subdrop");*/
|
||||
$(this).parentsUntil("#sidebar-menu > ul > li > a").addClass('active');
|
||||
};
|
||||
});
|
||||
$('.clik4').filter(function () {
|
||||
if (this.href == url || this.href == url2) {
|
||||
$(".sdf4").slideDown(350);
|
||||
/* $(".wav").addClass("subdrop");*/
|
||||
$(this).closest("li").addClass('active');
|
||||
};
|
||||
});
|
||||
$('.clik5').filter(function () {
|
||||
if (this.href == url || this.href == url2) {
|
||||
$(".sdf5").slideDown(350);
|
||||
/*$(".wav").addClass("subdrop");*/
|
||||
$(this).closest("li").addClass('active');
|
||||
};
|
||||
});
|
||||
$('.clik6').filter(function () {
|
||||
if (this.href == url || this.href == url2) {
|
||||
$(".sdf6").slideDown(350);
|
||||
/*$(".wav").addClass("subdrop");*/
|
||||
$(this).closest("li").addClass('active');
|
||||
};
|
||||
});
|
||||
$('.clik7').filter(function () {
|
||||
if (this.href == url || this.href == url2) {
|
||||
$(".sdf7").slideDown(350);
|
||||
/*$(".wav").addClass("subdrop");*/
|
||||
$(this).closest("li").addClass('active');
|
||||
};
|
||||
});
|
||||
$('.clik8').filter(function () {
|
||||
if (this.href == url || this.href == url2) {
|
||||
$(".sdf8").slideDown(350);
|
||||
/*$(".wav").addClass("subdrop");*/
|
||||
$(this).parentsUntil("#sidebar-menu > ul > li > a").addClass('active');
|
||||
};
|
||||
});
|
||||
$('.btnWorkFlow').filter(function () {
|
||||
if (this.href === url || this.href === url2) {
|
||||
$(this).addClass('active');
|
||||
};
|
||||
});
|
||||
$('.clik').filter(function() {
|
||||
if (this.href == url || this.href == url2) {
|
||||
$(".sdf1").slideDown(1);
|
||||
/*$(".wav").addClass("subdrop");*/
|
||||
$(this).parentsUntil("#sidebar-menu > ul > li > a").addClass('active');
|
||||
};
|
||||
});
|
||||
$('.clik2').filter(function() {
|
||||
if (this.href == url || this.href == url2) {
|
||||
$(".sdf2").slideDown(350);
|
||||
/* $(".wav").addClass("subdrop");*/
|
||||
$(this).parentsUntil("#sidebar-menu > ul > li > a").addClass('active');
|
||||
};
|
||||
});
|
||||
$('.clik3').filter(function () {
|
||||
if (this.href == url || this.href == url2) {
|
||||
$(".sdf3").slideDown(350);
|
||||
/* $(".wav").addClass("subdrop");*/
|
||||
$(this).parentsUntil("#sidebar-menu > ul > li > a").addClass('active');
|
||||
};
|
||||
});
|
||||
$('.clik4').filter(function () {
|
||||
if (this.href == url || this.href == url2) {
|
||||
$(".sdf4").slideDown(350);
|
||||
/* $(".wav").addClass("subdrop");*/
|
||||
$(this).closest("li").addClass('active');
|
||||
};
|
||||
});
|
||||
$('.clik5').filter(function () {
|
||||
if (this.href == url || this.href == url2) {
|
||||
$(".sdf5").slideDown(350);
|
||||
/*$(".wav").addClass("subdrop");*/
|
||||
$(this).closest("li").addClass('active');
|
||||
};
|
||||
});
|
||||
$('.clik6').filter(function () {
|
||||
if (this.href == url || this.href == url2) {
|
||||
$(".sdf6").slideDown(350);
|
||||
/*$(".wav").addClass("subdrop");*/
|
||||
$(this).closest("li").addClass('active');
|
||||
};
|
||||
});
|
||||
$('.clik7').filter(function () {
|
||||
if (this.href == url || this.href == url2) {
|
||||
$(".sdf7").slideDown(350);
|
||||
/*$(".wav").addClass("subdrop");*/
|
||||
$(this).closest("li").addClass('active');
|
||||
};
|
||||
});
|
||||
$('.clik8').filter(function () {
|
||||
if (this.href == url || this.href == url2) {
|
||||
$(".sdf8").slideDown(350);
|
||||
/*$(".wav").addClass("subdrop");*/
|
||||
$(this).parentsUntil("#sidebar-menu > ul > li > a").addClass('active');
|
||||
};
|
||||
});
|
||||
$('.clik9').filter(function () {
|
||||
if (this.href == url || this.href == url2) {
|
||||
$(".sdf9").slideDown(350);
|
||||
/*$(".wav").addClass("subdrop");*/
|
||||
$(this).parentsUntil("#sidebar-menu > ul > li > a").addClass('active');
|
||||
};
|
||||
});
|
||||
$(document).ready(function () {
|
||||
$(document).on('click', function (e) {
|
||||
var $target = $(e.target);
|
||||
if (!$target.closest('.dropdown').length &&
|
||||
$('.dropdown-menu').is(':visible')) {
|
||||
$('.dropdown-menu').removeClass('show');
|
||||
}
|
||||
});
|
||||
|
||||
$(document).ready(function () {
|
||||
$(document).on('click', function (e) {
|
||||
var $target = $(e.target);
|
||||
if (!$target.closest('.dropdown').length &&
|
||||
$('.dropdown-menu').is(':visible')) {
|
||||
$('.dropdown-menu').removeClass('show');
|
||||
}
|
||||
});
|
||||
$('.profile-box').on('click', function (e) {
|
||||
e.stopPropagation();
|
||||
var $dropdownMenu = $(this).siblings('.dropdown-menu');
|
||||
if ($dropdownMenu.hasClass('show')) {
|
||||
$dropdownMenu.removeClass('show');
|
||||
} else {
|
||||
$('.dropdown-menu').removeClass('show');
|
||||
$dropdownMenu.addClass('show');
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$('.profile-box').on('click', function (e) {
|
||||
e.stopPropagation();
|
||||
var $dropdownMenu = $(this).siblings('.dropdown-menu');
|
||||
if ($dropdownMenu.hasClass('show')) {
|
||||
$dropdownMenu.removeClass('show');
|
||||
} else {
|
||||
$('.dropdown-menu').removeClass('show');
|
||||
$dropdownMenu.addClass('show');
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
//$('ul.sdf3 a').filter(function() {
|
||||
// if (this.href == url || this.href == url2) {
|
||||
//$('ul.sdf3 a').filter(function() {
|
||||
// if (this.href == url || this.href == url2) {
|
||||
|
||||
// $(".sdf1").slideDown(350);
|
||||
// $(".wav").addClass("subdrop");
|
||||
// $(this).parentsUntil("#sidebar-menu > ul > li > a").addClass('active');
|
||||
// };
|
||||
//});
|
||||
// $(".sdf1").slideDown(350);
|
||||
// $(".wav").addClass("subdrop");
|
||||
// $(this).parentsUntil("#sidebar-menu > ul > li > a").addClass('active');
|
||||
// };
|
||||
//});
|
||||
|
||||
|
||||
//$(".waves-effect").click(function () {
|
||||
// if ($("div, ul, li").hasClass("active")) {
|
||||
//$(".waves-effect").click(function () {
|
||||
// if ($("div, ul, li").hasClass("active")) {
|
||||
|
||||
// $("div, ul, li").removeClass("active");
|
||||
// $("div, ul, li").removeClass("active");
|
||||
|
||||
|
||||
|
||||
// }
|
||||
//});
|
||||
// }
|
||||
//});
|
||||
|
||||
_RefreshTaskCountMenu();
|
||||
function _RefreshTaskCountMenu() {
|
||||
$.ajax({
|
||||
async: true,
|
||||
dataType: 'json',
|
||||
url: '/AdminNew?handler=LayoutCountTask',
|
||||
headers: { "RequestVerificationToken": antiForgeryTokenLayout },
|
||||
type: 'GET',
|
||||
success: function (response) {
|
||||
if (response.success) {
|
||||
if (response.data === 0) {
|
||||
$('#_taskCountSection').hide();
|
||||
$('#_taskCount').hide();
|
||||
$('#spinnerTask').hide();
|
||||
} else {
|
||||
$('#_taskCountSection').show();
|
||||
$('#spinnerTask').hide();
|
||||
$('#_taskCount').show();
|
||||
$('#_taskCount').text(response.data);
|
||||
}
|
||||
}
|
||||
},
|
||||
error: function (xhr, status, error) {
|
||||
console.error(xhr.responseText);
|
||||
}
|
||||
});
|
||||
}
|
||||
_RefreshTaskCountMenu();
|
||||
function _RefreshTaskCountMenu() {
|
||||
$.ajax({
|
||||
async: true,
|
||||
dataType: 'json',
|
||||
url: '/AdminNew?handler=LayoutCountTask',
|
||||
headers: { "RequestVerificationToken": antiForgeryTokenLayout },
|
||||
type: 'GET',
|
||||
success: function (response) {
|
||||
if (response.success) {
|
||||
if (response.data === 0) {
|
||||
$('#_taskCountSection').hide();
|
||||
$('#_taskCount').hide();
|
||||
$('#spinnerTask').hide();
|
||||
} else {
|
||||
$('#_taskCountSection').show();
|
||||
$('#spinnerTask').hide();
|
||||
$('#_taskCount').show();
|
||||
$('#_taskCount').text(response.data);
|
||||
}
|
||||
}
|
||||
},
|
||||
error: function (xhr, status, error) {
|
||||
console.error(xhr.responseText);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
_RefreshTicketCountMenu();
|
||||
function _RefreshTicketCountMenu() {
|
||||
$.ajax({
|
||||
async: true,
|
||||
dataType: 'json',
|
||||
url: '/AdminNew?handler=LayoutCountTicket',
|
||||
headers: { "RequestVerificationToken": antiForgeryTokenLayout },
|
||||
type: 'GET',
|
||||
success: function (response) {
|
||||
if (response.success) {
|
||||
if (response.data === 0) {
|
||||
$('#_ticketCountSection').hide();
|
||||
$('#spinnerTicket').hide();
|
||||
$('#_ticketCount').hide();
|
||||
} else {
|
||||
$('#_ticketCountSection').show();
|
||||
$('#spinnerTicket').hide();
|
||||
$('#_ticketCount').show();
|
||||
$('#_ticketCount').text(response.data);
|
||||
}
|
||||
}
|
||||
},
|
||||
error: function (xhr, status, error) {
|
||||
console.error(xhr.responseText);
|
||||
}
|
||||
});
|
||||
}
|
||||
_RefreshTicketCountMenu();
|
||||
function _RefreshTicketCountMenu() {
|
||||
$.ajax({
|
||||
async: true,
|
||||
dataType: 'json',
|
||||
url: '/AdminNew?handler=LayoutCountTicket',
|
||||
headers: { "RequestVerificationToken": antiForgeryTokenLayout },
|
||||
type: 'GET',
|
||||
success: function (response) {
|
||||
if (response.success) {
|
||||
if (response.data === 0) {
|
||||
$('#_ticketCountSection').hide();
|
||||
$('#spinnerTicket').hide();
|
||||
$('#_ticketCount').hide();
|
||||
} else {
|
||||
$('#_ticketCountSection').show();
|
||||
$('#spinnerTicket').hide();
|
||||
$('#_ticketCount').show();
|
||||
$('#_ticketCount').text(response.data);
|
||||
}
|
||||
}
|
||||
},
|
||||
error: function (xhr, status, error) {
|
||||
console.error(xhr.responseText);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
_RefreshWorkFlowCountMenu();
|
||||
function _RefreshWorkFlowCountMenu() {
|
||||
$.ajax({
|
||||
async: true,
|
||||
dataType: 'json',
|
||||
url: '/AdminNew?handler=LayoutCountWorkFlow',
|
||||
headers: { "RequestVerificationToken": antiForgeryTokenLayout },
|
||||
type: 'GET',
|
||||
success: function (response) {
|
||||
if (response.success) {
|
||||
if (response.data === 0) {
|
||||
$('#_workFlowCountSection').hide();
|
||||
$('#spinnerWorkFlow').hide();
|
||||
$('#_workFlowCount').hide();
|
||||
} else {
|
||||
$('#_workFlowCountSection').show();
|
||||
$('#spinnerWorkFlow').hide();
|
||||
$('#_workFlowCount').show();
|
||||
$('#_workFlowCount').text(response.data);
|
||||
}
|
||||
}
|
||||
},
|
||||
error: function (xhr, status, error) {
|
||||
console.error(xhr.responseText);
|
||||
}
|
||||
});
|
||||
}
|
||||
_RefreshWorkFlowCountMenu();
|
||||
function _RefreshWorkFlowCountMenu() {
|
||||
$.ajax({
|
||||
async: true,
|
||||
dataType: 'json',
|
||||
url: '/AdminNew?handler=LayoutCountWorkFlow',
|
||||
headers: { "RequestVerificationToken": antiForgeryTokenLayout },
|
||||
type: 'GET',
|
||||
success: function (response) {
|
||||
if (response.success) {
|
||||
if (response.data === 0) {
|
||||
$('#_workFlowCountSection').hide();
|
||||
$('#spinnerWorkFlow').hide();
|
||||
$('#_workFlowCount').hide();
|
||||
} else {
|
||||
$('#_workFlowCountSection').show();
|
||||
$('#spinnerWorkFlow').hide();
|
||||
$('#_workFlowCount').show();
|
||||
$('#_workFlowCount').text(response.data);
|
||||
}
|
||||
}
|
||||
},
|
||||
error: function (xhr, status, error) {
|
||||
console.error(xhr.responseText);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
_RefreshCheckerCountMenu();
|
||||
function _RefreshCheckerCountMenu() {
|
||||
$.ajax({
|
||||
//async: true,
|
||||
dataType: 'json',
|
||||
url: '/AdminNew?handler=LayoutCountChecker',
|
||||
headers: { "RequestVerificationToken": antiForgeryTokenLayout },
|
||||
type: 'GET',
|
||||
success: function (response) {
|
||||
console.log(response);
|
||||
_RefreshCheckerCountMenu();
|
||||
function _RefreshCheckerCountMenu() {
|
||||
$.ajax({
|
||||
//async: true,
|
||||
dataType: 'json',
|
||||
url: '/AdminNew?handler=LayoutCountChecker',
|
||||
headers: { "RequestVerificationToken": antiForgeryTokenLayout },
|
||||
type: 'GET',
|
||||
success: function (response) {
|
||||
if (response.success) {
|
||||
if (response.data === 0) {
|
||||
$('#_checkerCountSection').hide();
|
||||
$('#_checkerCount').hide();
|
||||
$('#spinnerChecker').hide();
|
||||
} else {
|
||||
$('#_checkerCountSection').show();
|
||||
$('#spinnerChecker').hide();
|
||||
$('#_checkerCount').show();
|
||||
$('#_checkerCount').text(response.data);
|
||||
}
|
||||
}
|
||||
},
|
||||
error: function (xhr, status, error) {
|
||||
console.error(xhr.responseText);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
if (response.success) {
|
||||
if (response.data === 0) {
|
||||
$('#_checkerCountSection').hide();
|
||||
$('#_checkerCount').hide();
|
||||
$('#spinnerChecker').hide();
|
||||
} else {
|
||||
$('#_checkerCountSection').show();
|
||||
$('#spinnerChecker').hide();
|
||||
$('#_checkerCount').show();
|
||||
$('#_checkerCount').text(response.data);
|
||||
}
|
||||
}
|
||||
},
|
||||
error: function (xhr, status, error) {
|
||||
console.error(xhr.responseText);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// Override the global fetch function to handle errors
|
||||
$.ajaxSetup({
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
if (jqXHR.status === 500) {
|
||||
try {
|
||||
const errorData = jqXHR.responseJSON;
|
||||
$.Notification.autoHideNotify('error', 'top center', 'پیام سیستم ', errorData.message || "خطای سمت سرور");
|
||||
} catch (e) {
|
||||
$.Notification.autoHideNotify('error', 'top center', 'پیام سیستم ', "خطای سمت سرور");
|
||||
console.error("Error parsing response:", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
// Override the global fetch function to handle errors
|
||||
$.ajaxSetup({
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
if (jqXHR.status === 500) {
|
||||
try {
|
||||
const errorData = jqXHR.responseJSON;
|
||||
$.Notification.autoHideNotify('error', 'top center', 'پیام سیستم ', errorData.message || "خطای سمت سرور");
|
||||
} catch (e) {
|
||||
$.Notification.autoHideNotify('error', 'top center', 'پیام سیستم ', "خطای سمت سرور");
|
||||
console.error("Error parsing response:", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
</body>
|
||||
|
||||
@@ -23,6 +23,8 @@
|
||||
}
|
||||
</style>
|
||||
|
||||
var accountId = AuthHelper.CurrentAccountId();
|
||||
|
||||
}
|
||||
<div class="left side-menu">
|
||||
<div class="sidebar-inner slimscrollleft">
|
||||
@@ -177,19 +179,24 @@
|
||||
</svg>
|
||||
حضورغیاب </a>
|
||||
</li>
|
||||
<li permission="306">
|
||||
<a class="clik3" href="/AdminNew/Company/Bank">
|
||||
<svg width="13" height="13" viewBox="0 0 13 13" fill="none" xmlns="http://www.w3.org/2000/svg" style="width: 7px;margin: 0 6px;">
|
||||
<circle cx="6.5" cy="6.5" r="6.5" fill="white"/>
|
||||
</svg>
|
||||
بانک ها </a>
|
||||
</li>
|
||||
<li permission="306"><a class="clik3" asp-page="/Company/SmsResult/Index">
|
||||
<svg width="13" height="13" viewBox="0 0 13 13" fill="none" xmlns="http://www.w3.org/2000/svg" style="width: 7px;margin: 0 6px;">
|
||||
<circle cx="6.5" cy="6.5" r="6.5" fill="white"/>
|
||||
</svg>
|
||||
گزارش پیامک خودکار</a>
|
||||
</li>
|
||||
@if (accountId is 2 or 3)
|
||||
{
|
||||
<li permission="307">
|
||||
<a class="clik3" href="/AdminNew/Company/Bank">
|
||||
<svg width="13" height="13" viewBox="0 0 13 13" fill="none" xmlns="http://www.w3.org/2000/svg" style="width: 7px;margin: 0 6px;">
|
||||
<circle cx="6.5" cy="6.5" r="6.5" fill="white"/>
|
||||
</svg>
|
||||
بانک ها </a>
|
||||
</li>
|
||||
<li permission="307">
|
||||
<a class="clik3" asp-page="/Company/SmsResult/Index">
|
||||
<svg width="13" height="13" viewBox="0 0 13 13" fill="none" xmlns="http://www.w3.org/2000/svg" style="width: 7px;margin: 0 6px;">
|
||||
<circle cx="6.5" cy="6.5" r="6.5" fill="white"/>
|
||||
</svg>
|
||||
گزارش پیامک خودکار</a>
|
||||
</li>
|
||||
}
|
||||
|
||||
<li permission="301"><a class="clik3" asp-page="/Company/YearlySalaryTitles/Index">
|
||||
<svg width="13" height="13" viewBox="0 0 13 13" fill="none" xmlns="http://www.w3.org/2000/svg" style="width: 7px;margin: 0 6px;">
|
||||
<circle cx="6.5" cy="6.5" r="6.5" fill="white"/>
|
||||
|
||||
@@ -21,7 +21,6 @@
|
||||
<link href="~/AssetsClient/libs/font-awesome/css/font-awesome.min.css?ver=@Version.AdminVersion" rel="stylesheet" />
|
||||
<link href="~/AdminTheme/assets/ionicon/css/ionicons.min.css" rel="stylesheet" />
|
||||
<link href="~/AssetsClient/css/material-design-iconic-font.min.css?ver=@Version.AdminVersion" rel="stylesheet" />
|
||||
|
||||
<link href="~/AssetsClient/libs/select2/css/select2.min.css" rel="stylesheet" />
|
||||
|
||||
<script src="~/assetsadminnew/assets/js/jquery-3.7.1.min.js"></script>
|
||||
@@ -35,7 +34,7 @@
|
||||
<partial name="_Menu" />
|
||||
<partial name="_header" />
|
||||
|
||||
<div class="p-2 content-container">
|
||||
<div class="content-container p-2">
|
||||
<div class="container-fluid">
|
||||
@RenderBody()
|
||||
</div>
|
||||
@@ -46,7 +45,7 @@
|
||||
<script src="~/assetsadminnew/assets/js/bootstrap.bundle.min.js"></script>
|
||||
<script src="~/AssetsClient/libs/select2/js/select2.js"></script>
|
||||
<script src="~/AssetsClient/libs/select2/js/i18n/fa.js"></script>
|
||||
<script src="~/admintheme/js/jquery.mask_1.14.16.min.js"></script>
|
||||
<script src="~/assetsadminnew/assets/js/jquery.mask_1.14.16.min.js"></script>
|
||||
<script src="~/assetsadminnew/assets/js/datevalidation.js"></script>
|
||||
|
||||
|
||||
@@ -59,11 +58,10 @@
|
||||
<script src="~/AdminTheme/assets/notifications/notify.min.js"></script>
|
||||
<script src="~/AdminTheme/assets/notifications/notify-metro.js"></script>
|
||||
<script src="~/AdminTheme/assets/notifications/notifications.js"></script>
|
||||
|
||||
<script src="~/assetsadminnew/sidbar_adminnew/sidebar_admin.js"></script>
|
||||
|
||||
<script src="~/assetsadminnew/sidbar_adminnew/sidebar_admin.js"></script>
|
||||
<script src="~/assetsclient/js/services/ajax-service.js?ver=@Version.AdminVersion"></script>
|
||||
|
||||
|
||||
@* <script src="~/assetsclient/js/smooth-scrollbar.js"></script> *@
|
||||
|
||||
<script>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
@inject ITicketAccessAccountRepository TicketAccessAccount;
|
||||
@inject _0_Framework.Application.IAuthHelper AuthHelper;
|
||||
@{
|
||||
|
||||
var accountId = AuthHelper.CurrentAccountId();
|
||||
<style>
|
||||
.showCount span {
|
||||
background-color: #dd2a2a;
|
||||
@@ -241,21 +241,25 @@
|
||||
</svg>
|
||||
حضورغیاب </a>
|
||||
</li>
|
||||
<li permission="306">
|
||||
<a class="clik3" href="/AdminNew/Company/Bank">
|
||||
<svg width="13" height="13" viewBox="0 0 13 13" fill="none" xmlns="http://www.w3.org/2000/svg" style="width: 7px;margin: 0 6px;">
|
||||
<circle cx="6.5" cy="6.5" r="6.5" fill="white"/>
|
||||
</svg>
|
||||
بانک ها </a>
|
||||
</li>
|
||||
<li permission="306">
|
||||
<a class="clik3" asp-area="Admin" asp-page="/Company/SmsResult/Index">
|
||||
<svg width="13" height="13" viewBox="0 0 13 13" fill="none" xmlns="http://www.w3.org/2000/svg" style="width: 7px;margin: 0 6px;">
|
||||
<circle cx="6.5" cy="6.5" r="6.5" fill="white" />
|
||||
</svg>
|
||||
گزارش پیامک خودکار
|
||||
</a>
|
||||
</li>
|
||||
@if (accountId is 2 or 3)
|
||||
{
|
||||
<li permission="307">
|
||||
<a class="clik3" href="/AdminNew/Company/Bank">
|
||||
<svg width="13" height="13" viewBox="0 0 13 13" fill="none" xmlns="http://www.w3.org/2000/svg" style="width: 7px;margin: 0 6px;">
|
||||
<circle cx="6.5" cy="6.5" r="6.5" fill="white"/>
|
||||
</svg>
|
||||
بانک ها </a>
|
||||
</li>
|
||||
<li permission="307">
|
||||
<a class="clik3" asp-area="Admin" asp-page="/Company/SmsResult/Index">
|
||||
<svg width="13" height="13" viewBox="0 0 13 13" fill="none" xmlns="http://www.w3.org/2000/svg" style="width: 7px;margin: 0 6px;">
|
||||
<circle cx="6.5" cy="6.5" r="6.5" fill="white" />
|
||||
</svg>
|
||||
گزارش پیامک خودکار
|
||||
</a>
|
||||
</li>
|
||||
}
|
||||
|
||||
<li permission="301">
|
||||
<a class="clik3" asp-area="Admin" asp-page="/Company/YearlySalaryTitles/Index">
|
||||
<svg width="13" height="13" viewBox="0 0 13 13" fill="none" xmlns="http://www.w3.org/2000/svg" style="width: 7px;margin: 0 6px;">
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
@page
|
||||
@using _0_Framework.Application
|
||||
@using Microsoft.AspNetCore.Mvc.TagHelpers
|
||||
@model ServiceHost.Areas.Client.Pages.Company.RollCall.CameraAccounts.IndexModel
|
||||
|
||||
@inject _0_Framework.Application.IAuthHelper authHelper
|
||||
@{
|
||||
string clientVersion = _0_Framework.Application.Version.StyleVersion;
|
||||
ViewData["Title"] = " - " + "تنظیمات حساب کاربری دوربین";
|
||||
@@ -207,6 +209,9 @@
|
||||
// check and show modal Camera Account And Workshop Setting
|
||||
var statusCameraAccountAndWorkshopSettingUrl = `@Url.Page("./../Index", "StatusCameraAccountAndWorkshopSetting")`;
|
||||
var modalCreateCameraAccountUrl = `@Url.Page("./Index", "CreateCameraAccount")`;
|
||||
|
||||
var hasActiveDeActvePersmission = @(authHelper.GetPermissions().Contains(SubAccountPermissionHelper.CameraAccountActivationBtnPermissionCode) ? "true" : "false");
|
||||
var hasEditCameraAccountPermission = @(authHelper.GetPermissions().Contains(SubAccountPermissionHelper.CameraAccountEditPermissionCode) ? "true" : "false");
|
||||
</script>
|
||||
<script src="~/assetsclient/pages/RollCall/js/CameraAccounts.js?ver=@clientVersion"></script>
|
||||
}
|
||||
@@ -360,8 +360,10 @@ namespace ServiceHost.Areas.Client.Pages.Company.RollCall
|
||||
message = createRollCallEmployeeStatus.Message,
|
||||
});
|
||||
}
|
||||
}
|
||||
else
|
||||
_rollCallEmployeeStatusApplication.SyncRollCallEmployeeWithLeftWork(result.SendId);
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( rollCallEmployee.Statuses == null || rollCallEmployee.Statuses?.Any(x => x.StartDateGr <= DateTime.Now.Date && x.EndDateGr >= DateTime.Now.Date)== false)
|
||||
{
|
||||
|
||||
484
ServiceHost/wwwroot/AssetsAdmin/page/InsuranceList/css/Index.css
Normal file
484
ServiceHost/wwwroot/AssetsAdmin/page/InsuranceList/css/Index.css
Normal file
@@ -0,0 +1,484 @@
|
||||
.btn-search {
|
||||
background: #84CC16;
|
||||
}
|
||||
|
||||
.btn-search {
|
||||
border-radius: 7px;
|
||||
padding: 4px 10px;
|
||||
font-size: 13px;
|
||||
color: #ffffff;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.btn-search span {
|
||||
color: #FFF;
|
||||
text-align: center;
|
||||
font-size: 11px;
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
}
|
||||
|
||||
.sweet-alert h2 {
|
||||
font-size: 18px;
|
||||
font-weight: 500;
|
||||
line-height: 30px;
|
||||
}
|
||||
|
||||
.custom-scrollbar-x::-webkit-scrollbar {
|
||||
height: 6px;
|
||||
}
|
||||
|
||||
.custom-scrollbar-x::-webkit-scrollbar-track {
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
.custom-scrollbar-x::-webkit-scrollbar-thumb {
|
||||
background-color: rgba(0, 0, 0, 0.3);
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
.tab-bar {
|
||||
padding: 0 20px;
|
||||
}
|
||||
|
||||
.tab-bar__tab {
|
||||
width: 128px;
|
||||
height: 33px;
|
||||
background-color: #24c4c4;
|
||||
color: white;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 0 6px;
|
||||
border-radius: 7px 7px 0 0;
|
||||
}
|
||||
|
||||
|
||||
.tab-bar__tab--active {
|
||||
background-color: #FFFFFF;
|
||||
color: #1A3E7B;
|
||||
border-top: 1px solid #24c4c4
|
||||
}
|
||||
|
||||
.tab-bar__tab-label {
|
||||
font-weight: 400;
|
||||
font-size: 11px;
|
||||
}
|
||||
|
||||
.tab-bar__tab-badge {
|
||||
background-color: #FF6363;
|
||||
color: white;
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
border-radius: 30px;
|
||||
font-size: 9px;
|
||||
font-weight: 400;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.card-container {
|
||||
border-radius: 10px;
|
||||
padding: 10px 10px 20px;
|
||||
width: 100%;
|
||||
margin: 0 auto;
|
||||
background-color: white;
|
||||
}
|
||||
|
||||
|
||||
.insurance-card-mobile {
|
||||
background-color: #fff;
|
||||
border-radius: 10px;
|
||||
background-color: white;
|
||||
padding: 10px 10px;
|
||||
width: 100%;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
.insurance-table__head {
|
||||
position: sticky;
|
||||
top: 2px;
|
||||
z-index: 10;
|
||||
}
|
||||
|
||||
.u-tactile {
|
||||
cursor: pointer;
|
||||
transition: opacity 300ms ease-in-out;
|
||||
}
|
||||
|
||||
.u-tactile:hover {
|
||||
opacity: 0.8;
|
||||
}
|
||||
|
||||
.insurance-table__cell-card {
|
||||
display: inline-block;
|
||||
border-radius: 5px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.insurance-table__cell-card--small {
|
||||
background-color: rgb(187, 240, 240);
|
||||
color: #0B5959;
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
line-height: 24px;
|
||||
}
|
||||
|
||||
|
||||
.insurance-table__cell-card--medium {
|
||||
background-color: #8DDD8D;
|
||||
color: #FFFFFF;
|
||||
width: 57px;
|
||||
height: 20px;
|
||||
line-height: 20px;
|
||||
font-weight: 600;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.insurance-table__cell-card--large {
|
||||
background-color: #8DDD8D;
|
||||
color: #FFFFFF;
|
||||
width: 33.3%;
|
||||
height: 22px;
|
||||
line-height: 22px;
|
||||
font-weight: 600;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.tooltip-container {
|
||||
position: relative;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.tooltip-container__text {
|
||||
position: absolute;
|
||||
visibility: hidden;
|
||||
opacity: 0;
|
||||
width: max-content;
|
||||
max-width: 300px;
|
||||
background-color: #333;
|
||||
color: #fff;
|
||||
text-align: center;
|
||||
border-radius: 4px;
|
||||
padding: 5px 8px;
|
||||
z-index: 100000;
|
||||
bottom: 35px;
|
||||
left: 50%;
|
||||
transform: translateX(-50%);
|
||||
transition: opacity 0.3s;
|
||||
white-space: normal
|
||||
}
|
||||
|
||||
.tooltip-container:hover .tooltip-container__text {
|
||||
visibility: visible;
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
|
||||
.insurance-table__toggle {
|
||||
background-color: #F1F5F9 !important;
|
||||
border: 0.5px solid #E9E9E9;
|
||||
border-bottom-left-radius: 10px;
|
||||
border-bottom-right-radius: 10px;
|
||||
opacity: 0;
|
||||
max-height: 0;
|
||||
font-size: 12px;
|
||||
font-weight: 400;
|
||||
margin-top: 0 !important;
|
||||
margin-bottom: 0 !important;
|
||||
overflow: hidden;
|
||||
transition: opacity 0.4s ease, max-height 0.4s ease, padding 0.4s ease, margin 0.4s ease;
|
||||
will-change: max-height, opacity, padding, margin;
|
||||
}
|
||||
|
||||
.insurance-table__toggle.show {
|
||||
opacity: 1;
|
||||
max-height: 350px;
|
||||
padding-top: 0.5rem;
|
||||
padding-bottom: 0.5rem;
|
||||
margin-top: 0.5rem;
|
||||
margin-bottom: 0.5rem !important;
|
||||
}
|
||||
|
||||
|
||||
.insurance-table__operation-button {
|
||||
width: 71px;
|
||||
height: 27px;
|
||||
border-radius: 5px;
|
||||
background-color: #275197;
|
||||
color: white
|
||||
}
|
||||
|
||||
|
||||
|
||||
.insurance-table__toggle-label {
|
||||
font-weight: 400;
|
||||
font-size: 12px;
|
||||
color: #202020
|
||||
}
|
||||
|
||||
.insurance-table__toggle-value {
|
||||
font-weight: 400;
|
||||
font-size: 12px;
|
||||
color: #818181
|
||||
}
|
||||
/*Awaiting reference Table*/
|
||||
.insurance-table__stage-button {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
height: 23px;
|
||||
border-radius: 5px;
|
||||
background-color: #84CC16;
|
||||
color: white;
|
||||
font-size: 10px;
|
||||
padding: 0 4px;
|
||||
white-space: nowrap
|
||||
}
|
||||
|
||||
/* The whole workshop */
|
||||
.insurance-table__status-button {
|
||||
width: 88px;
|
||||
height: 32px;
|
||||
font-weight: 600;
|
||||
font-size: 12px;
|
||||
border-radius: 0
|
||||
}
|
||||
|
||||
.insurance-table__status-button--documents-setup {
|
||||
background-color: #C8C8C8 !important;
|
||||
}
|
||||
|
||||
.insurance-table__status-button--step1 {
|
||||
background-color: #87DFFF !important;
|
||||
}
|
||||
|
||||
.insurance-table__status-button--step2 {
|
||||
background-color: #FEA99A !important;
|
||||
}
|
||||
|
||||
.insurance-table__status-button--step3 {
|
||||
background-color: #FEDE76 !important;
|
||||
}
|
||||
|
||||
.insurance-table__status-button--step4 {
|
||||
background-color: #A3FF87 !important;
|
||||
}
|
||||
|
||||
.card-button__create-new {
|
||||
background-color: #84CC16 !important;
|
||||
color: #ffffff;
|
||||
border-radius: 8px;
|
||||
width: 141px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 5px;
|
||||
justify-content: center;
|
||||
padding: 5px;
|
||||
margin: auto 0 5px;
|
||||
transition: .2s all ease-in;
|
||||
}
|
||||
|
||||
.card-button__create-new:hover {
|
||||
background-color: #76B713 !important;
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------------------- offcanvas
|
||||
/* Overlay */
|
||||
.offcanvas-overlay {
|
||||
position: fixed;
|
||||
inset: 0;
|
||||
background: rgba(0, 0, 0, 0.4);
|
||||
opacity: 0;
|
||||
visibility: hidden;
|
||||
transition: 0.3s ease;
|
||||
z-index: 999;
|
||||
}
|
||||
|
||||
.offcanvas-overlay.active {
|
||||
opacity: 1;
|
||||
visibility: visible;
|
||||
}
|
||||
|
||||
/* پنل offcanvas */
|
||||
.offcanvas {
|
||||
position: fixed;
|
||||
bottom: -100%;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
background: white;
|
||||
border-radius: 20px 20px 0 0;
|
||||
box-shadow: 0 -2px 20px rgba(0,0,0,0.2);
|
||||
padding: 10px 20px;
|
||||
transition: bottom 0.4s ease;
|
||||
z-index: 1000;
|
||||
}
|
||||
|
||||
.offcanvas.active {
|
||||
bottom: 0;
|
||||
}
|
||||
|
||||
.offcanvas-header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
font-weight: bold;
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
|
||||
.offcanvas-close {
|
||||
background: none;
|
||||
border: none;
|
||||
font-size: 20px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.form-group {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.form-group input,
|
||||
.form-group textarea {
|
||||
width: 100%;
|
||||
padding: 10px;
|
||||
font-size: 14px;
|
||||
border: 1px solid #ccc;
|
||||
border-radius: 8px;
|
||||
}
|
||||
|
||||
.form-actions {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
margin-top: 5px;
|
||||
gap: 6px;
|
||||
}
|
||||
|
||||
.btn {
|
||||
flex: 1;
|
||||
margin: 5px 0px;
|
||||
padding: 8px 0;
|
||||
border: none;
|
||||
border-radius: 8px;
|
||||
font-weight: 500;
|
||||
font-size: 14px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.btn-cancel {
|
||||
background-color: #101827;
|
||||
color: white;
|
||||
}
|
||||
|
||||
.btn-submit {
|
||||
background-color: #9CDD4F;
|
||||
color: white;
|
||||
}
|
||||
|
||||
.btn-clear-filter {
|
||||
background-color: #FF8798;
|
||||
border-radius: 7px;
|
||||
padding: 6px 10px;
|
||||
font-size: 13px;
|
||||
text-align: center;
|
||||
cursor: pointer;
|
||||
transition: all ease-in-out .3s;
|
||||
}
|
||||
|
||||
.btn-clear-filter:hover {
|
||||
background-color: #cb6977;
|
||||
}
|
||||
|
||||
.btn-clear-filter span {
|
||||
font-size: 11px;
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
.tooltip-container {
|
||||
position: relative;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.tooltip__trigger {
|
||||
text-overflow: ellipsis;
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.tooltip-container__text {
|
||||
position: absolute;
|
||||
visibility: hidden;
|
||||
opacity: 0;
|
||||
width: max-content;
|
||||
/*max-width: 400px;*/
|
||||
background-color: #333;
|
||||
color: #fff;
|
||||
text-align: start;
|
||||
border-radius: 4px;
|
||||
padding: 5px 8px;
|
||||
z-index: 100000;
|
||||
bottom: 35px;
|
||||
left: 50%;
|
||||
transform: translateX(-50%);
|
||||
transition: opacity 0.3s;
|
||||
white-space: normal
|
||||
}
|
||||
|
||||
.tooltip-container:hover .tooltip-container__text {
|
||||
visibility: visible;
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
@media(min-width:768px) {
|
||||
.tab-bar__tab-label {
|
||||
font-weight: 400;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.insurance-table__status-button {
|
||||
width: 166px;
|
||||
height: 35px;
|
||||
}
|
||||
|
||||
.insurance-table__status-button--documents-setup {
|
||||
background-color: #C8C8C8 !important;
|
||||
}
|
||||
}
|
||||
|
||||
@media(max-width:768px) {
|
||||
.btn-clear-filter {
|
||||
margin: 15px 0 0 0;
|
||||
}
|
||||
|
||||
.waves-effect {
|
||||
overflow: unset;
|
||||
}
|
||||
|
||||
#_workFlowCountSection, #_checkerCountSection, #_ticketCountSection, #_taskCountSection {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
#_workFlowCount, #_checkerCount, #_ticketCount, #_taskCount {
|
||||
position: absolute;
|
||||
top: -20px;
|
||||
width: 18px;
|
||||
height: 18px;
|
||||
right: -29px;
|
||||
display: flex !important;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
#wrapper.enlarged .left.side-menu #sidebar-menu ul > li > a span {
|
||||
padding-left: 0;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 576px) {
|
||||
.btn-search span {
|
||||
font-size: 10px;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,353 @@
|
||||
.error-input {
|
||||
border: 1px solid #FD5757 !important;
|
||||
background-color: #ffefef;
|
||||
}
|
||||
|
||||
.modal-dialog {
|
||||
position: fixed;
|
||||
top: 50%;
|
||||
right: 50%;
|
||||
transform: translate(50%, -52%) !important;
|
||||
width: 750px !important;
|
||||
}
|
||||
|
||||
.modal-content {
|
||||
/*height: 370px;*/
|
||||
background-color: #FFFFFF !important;
|
||||
padding: 0px !important;
|
||||
}
|
||||
|
||||
.d-none {
|
||||
display: none
|
||||
}
|
||||
|
||||
.modal-custom {
|
||||
position: relative;
|
||||
/*display: flex;*/
|
||||
/*justify-content: center;*/
|
||||
/*align-items: center;*/
|
||||
}
|
||||
|
||||
.modal__dialog {
|
||||
background: white;
|
||||
border-radius: 8px;
|
||||
width: 500px;
|
||||
max-width: 100%;
|
||||
box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.modal__header,
|
||||
.modal__footer {
|
||||
padding: 5px 0;
|
||||
}
|
||||
|
||||
.modal__footer {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
gap: 0.5rem;
|
||||
}
|
||||
|
||||
.modal__title {
|
||||
margin: 0;
|
||||
font-size: 1.25rem;
|
||||
font-weight: bold;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.modal__close {
|
||||
background: transparent;
|
||||
border: none;
|
||||
font-size: 1.5rem;
|
||||
cursor: pointer;
|
||||
position: absolute;
|
||||
top: 3px;
|
||||
right: -12px;
|
||||
}
|
||||
|
||||
.modal__content {
|
||||
padding: 1rem;
|
||||
}
|
||||
|
||||
.modal__button {
|
||||
padding: 0.5rem 1rem;
|
||||
border: none;
|
||||
background-color: #ddd;
|
||||
cursor: pointer;
|
||||
border-radius: 4px;
|
||||
width: 200px;
|
||||
}
|
||||
|
||||
.modal__button--success {
|
||||
background-color: #84CC16;
|
||||
color: white;
|
||||
}
|
||||
|
||||
.modal__button--cancel {
|
||||
background-color: #454D5C;
|
||||
color: white;
|
||||
}
|
||||
|
||||
/* --------------------------------------------------- Card Action */
|
||||
.disable {
|
||||
filter: grayscale(100%);
|
||||
pointer-events: none;
|
||||
opacity: 0.6;
|
||||
}
|
||||
|
||||
.disable-blur {
|
||||
filter: blur(2px) grayscale(100%);
|
||||
pointer-events: none;
|
||||
opacity: 0.6;
|
||||
}
|
||||
|
||||
.card-action {
|
||||
position: relative;
|
||||
border: 1px solid #E4E4E7;
|
||||
border-radius: 12px;
|
||||
padding: 12px;
|
||||
background-color: #FFFFFF;
|
||||
display: flex;
|
||||
width: 100%;
|
||||
margin: 0 0 18px 0;
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
.card-action__success {
|
||||
border: 1px solid #55d187;
|
||||
background-color: #e9fdf2;
|
||||
}
|
||||
|
||||
.card-action__title {
|
||||
font-weight: bold;
|
||||
position: absolute;
|
||||
top: -12px;
|
||||
right: 15px;
|
||||
}
|
||||
|
||||
.card-action__container {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: 16px;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.card-action__container-right {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 15px;
|
||||
}
|
||||
|
||||
.card-action__container-left {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 15px;
|
||||
}
|
||||
|
||||
.card-action__upload {
|
||||
border: 1px dashed #ccc;
|
||||
background: #ffffff;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
gap: 4px;
|
||||
padding: 6px;
|
||||
border-radius: 10px;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.card-action__upload-btn {
|
||||
background-color: #C7FFE9;
|
||||
border: none;
|
||||
padding: 6px 12px;
|
||||
border-radius: 50px;
|
||||
cursor: pointer;
|
||||
font-size: 12px;
|
||||
width: 89px;
|
||||
}
|
||||
|
||||
.remove-file-btn {
|
||||
background-color: #e74c3c;
|
||||
color: white;
|
||||
}
|
||||
|
||||
.remove-file-btn:hover {
|
||||
background-color: #c0392b;
|
||||
}
|
||||
|
||||
.card-action__upload-icon {
|
||||
font-size: 24px;
|
||||
color: #00c07e;
|
||||
}
|
||||
|
||||
.card-action__date {
|
||||
position: relative;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: flex-start;
|
||||
}
|
||||
|
||||
.card-action__price {
|
||||
position: relative;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: flex-start;
|
||||
}
|
||||
|
||||
.card-action__price-rial {
|
||||
position: absolute;
|
||||
top: 8px;
|
||||
left: 7px;
|
||||
font-size: 12px;
|
||||
color: #5e5e5e;
|
||||
}
|
||||
|
||||
.card-action__label {
|
||||
position: absolute;
|
||||
top: -10px;
|
||||
right: 6px;
|
||||
font-size: 12px;
|
||||
color: #666;
|
||||
}
|
||||
|
||||
.card-action__input {
|
||||
border: 1px solid #DADADA;
|
||||
border-radius: 9px;
|
||||
padding: 6px 10px;
|
||||
text-align: center;
|
||||
min-width: 90px;
|
||||
width: 180px;
|
||||
direction: ltr;
|
||||
}
|
||||
|
||||
.card-action__textarea {
|
||||
border: 1px solid #DADADA;
|
||||
border-radius: 9px;
|
||||
padding: 6px 10px;
|
||||
min-width: 90px;
|
||||
width: 380px;
|
||||
height: 80px;
|
||||
resize: none;
|
||||
}
|
||||
|
||||
.card-action__inspection-type {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 12px;
|
||||
}
|
||||
|
||||
.card-action__checkbox {
|
||||
font-size: 14px;
|
||||
cursor: pointer;
|
||||
color: #333;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.card-action__checkbox input {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.card-action__status {
|
||||
margin-right: auto;
|
||||
background-color: #EEE;
|
||||
padding: 8px;
|
||||
border-radius: 10px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 80px;
|
||||
height: 80px;
|
||||
}
|
||||
|
||||
.card-action__status-success {
|
||||
background-color: #C6FFB4;
|
||||
}
|
||||
|
||||
.card-action__status-icon {
|
||||
color: white;
|
||||
font-size: 20px;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.file-info {
|
||||
font-size: 0.9rem;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.card-action__date--group {
|
||||
display: flex;
|
||||
gap: 10px;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
@media(max-width:768px) {
|
||||
.modal-dialog {
|
||||
width: 500px !important;
|
||||
}
|
||||
|
||||
.modal__content {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.card-action {
|
||||
margin: 0 0 10px 0;
|
||||
}
|
||||
|
||||
.card-action__status {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.card-action__container-right .card-action__inspection-type {
|
||||
flex-direction: row;
|
||||
}
|
||||
|
||||
.card-action__inspection-type {
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.card-action__container {
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.card-action__container-left {
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.card-action__input {
|
||||
width: 270px;
|
||||
}
|
||||
|
||||
.card-action__upload {
|
||||
flex-direction: row-reverse;
|
||||
width: 100%;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.card-action__date--group {
|
||||
flex-direction: row;
|
||||
}
|
||||
|
||||
.card-action__date--group .card-action__input {
|
||||
width: 130px;
|
||||
}
|
||||
|
||||
.card-action__container {
|
||||
gap: 7px;
|
||||
}
|
||||
|
||||
.card-action__textarea {
|
||||
width: 272px;
|
||||
height: 50px;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 576px) {
|
||||
.modal-dialog {
|
||||
width: 350px !important;
|
||||
}
|
||||
}
|
||||
1042
ServiceHost/wwwroot/AssetsAdmin/page/InsuranceList/js/Index.js
Normal file
1042
ServiceHost/wwwroot/AssetsAdmin/page/InsuranceList/js/Index.js
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,369 @@
|
||||
$(document).ready(function () {
|
||||
if (!hasPermission_80212) {
|
||||
$('#sendListSection').hide();
|
||||
}
|
||||
|
||||
var $inputDebtAmount = $('#Debt_Amount');
|
||||
var formatted = formatNumber($inputDebtAmount.val());
|
||||
$inputDebtAmount.val(formatted);
|
||||
|
||||
$(".date").each(function () {
|
||||
const input = this;
|
||||
|
||||
input.addEventListener("input", function () {
|
||||
this.value = convertPersianNumbersToEnglish(this.value);
|
||||
});
|
||||
|
||||
new JalaliDateInput(input);
|
||||
});
|
||||
|
||||
$('#Debt_Amount').on('input', function () {
|
||||
const formatted = formatNumber($(this).val());
|
||||
$(this).val(formatted);
|
||||
});
|
||||
|
||||
function checkCardCompletion($card) {
|
||||
const $status = $card.find('.card-action__status');
|
||||
const $icon = $card.find('.card-action__status-icon-svg');
|
||||
|
||||
const isWrittenVerbal = $card.find('.WrittenVerbal').length > 0;
|
||||
|
||||
if (isWrittenVerbal) {
|
||||
const isWritten = $card.find('#Written').is(':checked');
|
||||
const isVerbal = $card.find('#Verbal').is(':checked');
|
||||
const description = $card.find('#description').val()?.trim() || '';
|
||||
const verbalValid = isVerbal && description.length >= 15;
|
||||
const writtenValid = isWritten;
|
||||
|
||||
if (writtenValid || verbalValid) {
|
||||
$status.addClass('card-action__status-success');
|
||||
$icon.show();
|
||||
} else {
|
||||
$status.removeClass('card-action__status-success');
|
||||
$icon.hide();
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
const isChecked = $card.find('.card-action__inspection-type input[type="checkbox"]:checked').length > 0;
|
||||
|
||||
const $dateInput = $card.find('.card-action__input.date');
|
||||
const dateFilled = $dateInput.length > 0 ? $dateInput.val().trim().length === 10 : true;
|
||||
|
||||
const $priceInput = $card.find('.card-action__price input');
|
||||
const priceFilled = $priceInput.length > 0 ? $priceInput.val().trim() !== '' : true;
|
||||
|
||||
const $fileInput = $card.find('.card-action__upload input[type="file"]');
|
||||
const $mediaId = $card.find('.card-action__upload input.mediaIds');
|
||||
|
||||
let fileSelected = true;
|
||||
if ($fileInput.length > 0 && $mediaId.length > 0) {
|
||||
const mediaIdVal = parseInt($mediaId.val() || "0");
|
||||
if (mediaIdVal === 0) {
|
||||
fileSelected = $fileInput[0].files.length > 0;
|
||||
}
|
||||
}
|
||||
|
||||
if (isChecked && dateFilled && priceFilled && fileSelected) {
|
||||
$status.addClass('card-action__status-success');
|
||||
$icon.show();
|
||||
} else {
|
||||
$status.removeClass('card-action__status-success');
|
||||
$icon.hide();
|
||||
}
|
||||
}
|
||||
|
||||
$('.card-action__inspection-type input[type="checkbox"]').on('change', function () {
|
||||
const $group = $(this).closest('.card-action__inspection-type');
|
||||
const $checkboxes = $group.find('input[type="checkbox"]');
|
||||
const $card = $(this).closest('.card-action');
|
||||
|
||||
if ($(this).is(':checked')) {
|
||||
$checkboxes.not(this).prop('checked', false);
|
||||
}
|
||||
|
||||
checkCardCompletion($card);
|
||||
});
|
||||
|
||||
$('.card-action__input').on('input', function () {
|
||||
const $card = $(this).closest('.card-action');
|
||||
checkCardCompletion($card);
|
||||
});
|
||||
|
||||
$('#description').on('input', function () {
|
||||
const $card = $(this).closest('.card-action');
|
||||
checkCardCompletion($card);
|
||||
});
|
||||
|
||||
$(".card-action").each(function () {
|
||||
const $card = $(this).closest('.card-action');
|
||||
checkCardCompletion($card);
|
||||
});
|
||||
|
||||
$(document).on('click', '.remove-file-btn', function () {
|
||||
const container = $(this).closest('.card-action__upload');
|
||||
const type = $(this).data('type');
|
||||
|
||||
$(this).hide();
|
||||
|
||||
const chooseBtn = container.find('.choose-file-btn[data-type="' + type + '"]');
|
||||
if (chooseBtn.length === 0) {
|
||||
container.append('<button type="button" class="card-action__upload-btn choose-file-btn" data-type="' + type + '">انتخاب فایل</button>');
|
||||
} else {
|
||||
chooseBtn.show();
|
||||
}
|
||||
|
||||
container.find('input[type="file"][data-type="' + type + '"]').val('');
|
||||
|
||||
const $card = $(this).closest('.card-action');
|
||||
checkCardCompletion($card);
|
||||
});
|
||||
|
||||
$(document).on('click', '.choose-file-btn', function () {
|
||||
const type = $(this).data('type');
|
||||
$(this).siblings('input[type="file"][data-type="' + type + '"]').click();
|
||||
});
|
||||
|
||||
$(document).on('change', 'input[type="file"]', function () {
|
||||
const container = $(this).closest('.card-action__upload');
|
||||
const file = this.files[0];
|
||||
const type = $(this).data('type');
|
||||
|
||||
if (file) {
|
||||
container.find('.choose-file-btn[data-type="' + type + '"]').hide();
|
||||
|
||||
const removeBtn = container.find('.remove-file-btn[data-type="' + type + '"]');
|
||||
if (removeBtn.length === 0) {
|
||||
container.append('<button type="button" class="card-action__upload-btn remove-file-btn" data-type="' + type + '">حذف فایل</button>');
|
||||
} else {
|
||||
removeBtn.show();
|
||||
}
|
||||
}
|
||||
|
||||
const $card = $(this).closest('.card-action');
|
||||
checkCardCompletion($card);
|
||||
});
|
||||
|
||||
$('.WrittenVerbal').on('change', function () {
|
||||
const $card = $(this).closest('.card-action');
|
||||
const $descriptionSection = $card.find('#descriptionSection');
|
||||
const $description = $card.find('#description');
|
||||
|
||||
const isWritten = $card.find('#Written').is(':checked');
|
||||
const isVerbal = $card.find('#Verbal').is(':checked');
|
||||
|
||||
if (isVerbal) {
|
||||
$descriptionSection.removeClass('disable');
|
||||
} else {
|
||||
$descriptionSection.addClass('disable');
|
||||
|
||||
$description.val('');
|
||||
}
|
||||
|
||||
checkCardCompletion($card);
|
||||
});
|
||||
$('.WrittenVerbal').each(function () {
|
||||
$(this).trigger('change');
|
||||
});
|
||||
});
|
||||
|
||||
function formatNumber(input) {
|
||||
let raw = convertPersianNumbersToEnglish(input).replace(/[^0-9]/g, '');
|
||||
if (raw === '' || parseInt(raw) === 0) return '';
|
||||
return raw.replace(/\B(?=(\d{3})+(?!\d))/g, ',');
|
||||
}
|
||||
|
||||
async function SaveData() {
|
||||
const form = document.querySelector("#create-form");
|
||||
const formData = new FormData(form);
|
||||
|
||||
//var checkboxesInspection = form.querySelectorAll('input[name="Inspection.Type"]:checked');
|
||||
//var lastInspectionDate = $('#last-inspection-date');
|
||||
//var inspectionFileMediaId = $('#Inspection_InspectionFileMediaId');
|
||||
//var inspectionFile = $('input[name="Inspection.InspectionFile"]');
|
||||
|
||||
//if (checkboxesInspection.length === 0) {
|
||||
// if (lastInspectionDate.val() !== "") {
|
||||
// $.Notification.autoHideNotify('error', 'top right', "خطا", "لطفا نوع بازرسی را انتخاب کنید.");
|
||||
// return false;
|
||||
// }
|
||||
|
||||
// if (inspectionFile.get(0).files.length !== 0) {
|
||||
// $.Notification.autoHideNotify('error', 'top right', "خطا", "لطفا نوع بازرسی را انتخاب کنید.");
|
||||
// return false;
|
||||
// }
|
||||
|
||||
// formData.append("Inspection.Type", "0");
|
||||
//} else {
|
||||
// if (lastInspectionDate.val() === "") {
|
||||
// errorInput(lastInspectionDate);
|
||||
// $.Notification.autoHideNotify('error', 'top right', "لطفا تاریخ آخرین بازرسی را وارد کنید.");
|
||||
// return false;
|
||||
// }
|
||||
|
||||
// if (inspectionFileMediaId.val() === 0) {
|
||||
// if (inspectionFile.get(0).files.length === 0) {
|
||||
// errorInput($('#card-inspection'));
|
||||
// $.Notification.autoHideNotify('error', 'top right', "لطفا فایل بازرسی را انتخاب کنید.");
|
||||
// return false;
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
|
||||
//var checkboxesDebt = form.querySelectorAll('input[name="Debt.Type"]:checked');
|
||||
//var debtAmount = $('#Debt_Amount');
|
||||
//var debtDate = $('#Debt_DebtDate');
|
||||
//var debtFileMediaId = $('#Debt_DebtFileMediaId');
|
||||
//var debtFile = $('input[name="Debt.DebtFile"]');
|
||||
|
||||
//if (checkboxesDebt.length === 0) {
|
||||
// if (debtDate.val() !== "") {
|
||||
// $.Notification.autoHideNotify('error', 'top right', "خطا", "لطفا نوع بدهی را انتخاب کنید.");
|
||||
// return false;
|
||||
// }
|
||||
|
||||
// if (debtAmount.val() !== "") {
|
||||
// $.Notification.autoHideNotify('error', 'top right', "خطا", "لطفا نوع بدهی را انتخاب کنید.");
|
||||
// return false;
|
||||
// }
|
||||
|
||||
// if (debtFile.get(0).files.length !== 0) {
|
||||
// $.Notification.autoHideNotify('error', 'top right', "خطا", "لطفا نوع بدهی را انتخاب کنید.");
|
||||
// return false;
|
||||
// }
|
||||
|
||||
// formData.append("Debt.Type", "0");
|
||||
//} else {
|
||||
// if (debtDate.val() === "") {
|
||||
// errorInput(debtDate);
|
||||
// $.Notification.autoHideNotify('error', 'top right', "خطا", "لطفا تاریخ بدهی را وارد کنید.");
|
||||
// return false;
|
||||
// }
|
||||
|
||||
// if (debtAmount.val() === "") {
|
||||
// errorInput(debtAmount);
|
||||
// $.Notification.autoHideNotify('error', 'top right', "خطا", "لطفا مبلغ بدهی را وارد کنید.");
|
||||
// return false;
|
||||
// }
|
||||
|
||||
// if (debtFileMediaId.val() === 0) {
|
||||
// if (debtFile.get(0).files.length === 0) {
|
||||
// errorInput($('#card-debt'));
|
||||
// $.Notification.autoHideNotify('error', 'top right', "خطا", "لطفا فایل بدهی را انتخاب کنید.");
|
||||
// return false;
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
|
||||
function validateSection({ typeCheckboxes, dateInput, amountInput, fileInput, fileMediaIdInput, sectionName, typeFieldName, defaultTypeValue = "0", sectionCard }) {
|
||||
const isTypeChecked = typeCheckboxes.length > 0;
|
||||
const hasDate = dateInput.val() !== "";
|
||||
const hasAmount = amountInput ? amountInput.val() !== "" : false;
|
||||
const hasFile = fileInput.get(0).files.length !== 0;
|
||||
const hasMediaId = fileMediaIdInput.val() !== "0";
|
||||
|
||||
if (!isTypeChecked) {
|
||||
if (hasDate || hasAmount || hasFile) {
|
||||
$.Notification.autoHideNotify('error', 'top right', "خطا", `لطفا نوع ${sectionName} را انتخاب کنید.`);
|
||||
return false;
|
||||
}
|
||||
formData.append(typeFieldName, defaultTypeValue);
|
||||
} else {
|
||||
if (!hasDate) {
|
||||
errorInput(dateInput);
|
||||
$.Notification.autoHideNotify('error', 'top right', `لطفا تاریخ ${sectionName} را وارد کنید.`);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (amountInput && !hasAmount) {
|
||||
errorInput(amountInput);
|
||||
$.Notification.autoHideNotify('error', 'top right', `لطفا مبلغ ${sectionName} را وارد کنید.`);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!hasMediaId && !hasFile) {
|
||||
errorInput(sectionCard);
|
||||
$.Notification.autoHideNotify('error', 'top right', `لطفا فایل ${sectionName} را انتخاب کنید.`);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
var isInspectionValid = validateSection({
|
||||
typeCheckboxes: form.querySelectorAll('input[name="Inspection.Type"]:checked'),
|
||||
dateInput: $('#last-inspection-date'),
|
||||
amountInput: null,
|
||||
fileInput: $('input[name="Inspection.InspectionFile"]'),
|
||||
fileMediaIdInput: $('#Inspection_InspectionFileMediaId'),
|
||||
sectionName: 'بازرسی',
|
||||
typeFieldName: 'Inspection.Type',
|
||||
sectionCard: $('#card-inspection')
|
||||
});
|
||||
|
||||
// بدهی
|
||||
var isDebtValid = validateSection({
|
||||
typeCheckboxes: form.querySelectorAll('input[name="Debt.Type"]:checked'),
|
||||
dateInput: $('#Debt_DebtDate'),
|
||||
amountInput: $('#Debt_Amount'),
|
||||
fileInput: $('input[name="Debt.DebtFile"]'),
|
||||
fileMediaIdInput: $('#Debt_DebtFileMediaId'),
|
||||
sectionName: 'بدهی',
|
||||
typeFieldName: 'Debt.Type',
|
||||
sectionCard: $('#card-debt')
|
||||
});
|
||||
|
||||
if (!isInspectionValid || !isDebtValid) return false;
|
||||
|
||||
var checkboxesApproval = form.querySelectorAll('input[name="Approval.ApprovalStatus"]:checked');
|
||||
if (checkboxesApproval.length === 0) {
|
||||
formData.append("Approval.ApprovalStatus", "0");
|
||||
} else {
|
||||
if ($('input[name="Approval.ApprovalStatus"]').val() === "1") {
|
||||
const description = $('#description').val()?.trim() || '';
|
||||
if (description.length < 15) {
|
||||
$.Notification.autoHideNotify('error', 'top right', "خطا", "توضیحات باید حداقل ۱۵ کاراکتر باشد.");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const confirmSentList = form.querySelector('input[name="ConfirmSentList"]');
|
||||
formData.append("ConfirmSentList", confirmSentList.checked ? "true" : "false");
|
||||
|
||||
//const formData = new FormData();
|
||||
//formData.append("file", $('#fileInput')[0].files[0]);
|
||||
//formData.append("title", "test");
|
||||
|
||||
try {
|
||||
var response = await ajaxService.post(saveOperationsModal, formData, true);
|
||||
if (response.success) {
|
||||
$.Notification.autoHideNotify('success', 'top right', "موفق", response.message);
|
||||
|
||||
// Reload Function
|
||||
pageIndexJs = 0;
|
||||
hasMoreData = true;
|
||||
var $activeTab = $('.tab-bar__tab--active');
|
||||
var activeValue = $activeTab.val();
|
||||
$('#load-data-html').html('');
|
||||
loadGetTabCounts();
|
||||
loadSearchNew(activeValue);
|
||||
$("#MainModal").modal('hide');
|
||||
} else {
|
||||
$.Notification.autoHideNotify('error', 'top right', "خطا", response.message);
|
||||
}
|
||||
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
}
|
||||
}
|
||||
|
||||
function errorInput($el) {
|
||||
$el.addClass('error-input');
|
||||
|
||||
setTimeout(() => {
|
||||
$el.removeClass('error-input');
|
||||
}, 2000);
|
||||
}
|
||||
BIN
ServiceHost/wwwroot/AssetsClient/images/icons/InsuranceList.png
Normal file
BIN
ServiceHost/wwwroot/AssetsClient/images/icons/InsuranceList.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 24 KiB |
BIN
ServiceHost/wwwroot/AssetsClient/images/icons/upload.png
Normal file
BIN
ServiceHost/wwwroot/AssetsClient/images/icons/upload.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 13 KiB |
@@ -8,12 +8,16 @@
|
||||
|
||||
sendRequest({ url, method = "GET", data = {}, async = true }) {
|
||||
return new Promise((resolve, reject) => {
|
||||
const isFormData = data instanceof FormData;
|
||||
|
||||
$.ajax({
|
||||
url: url,
|
||||
type: method,
|
||||
data: data,
|
||||
dataType: "json",
|
||||
async: async,
|
||||
processData: !isFormData ? true : false,
|
||||
contentType: !isFormData ? "application/x-www-form-urlencoded; charset=UTF-8" : false,
|
||||
headers: {
|
||||
//...this.defaultHeaders,
|
||||
"RequestVerificationToken": this.antiForgeryToken
|
||||
|
||||
@@ -0,0 +1,117 @@
|
||||
class JalaliDateInput {
|
||||
constructor(inputElement) {
|
||||
this.input = inputElement;
|
||||
this.input.maxLength = 10;
|
||||
this.input.placeholder = "____/__/__";
|
||||
this.input.addEventListener("input", this.onInput.bind(this));
|
||||
}
|
||||
|
||||
onInput(e) {
|
||||
let value = e.target.value.replace(/\D/g, "");
|
||||
|
||||
let year = value.slice(0, 4);
|
||||
let rawMonth = value.slice(4, 6);
|
||||
let rawDay = value.slice(6, 8);
|
||||
|
||||
//let month = "";
|
||||
//if (rawMonth.length === 1) {
|
||||
// const m = parseInt(rawMonth);
|
||||
// if (m >= 2 && m <= 9) {
|
||||
// month = "0" + m;
|
||||
// } else if (m === 1) {
|
||||
// month = "1";
|
||||
// }
|
||||
//} else if (rawMonth.length === 2) {
|
||||
// let m = parseInt(rawMonth);
|
||||
// if (isNaN(m)) {
|
||||
// month = "";
|
||||
// } else {
|
||||
// if (m > 12) m = 12;
|
||||
// month = m.toString().padStart(2, "0");
|
||||
// }
|
||||
//}
|
||||
let month = "";
|
||||
if (rawMonth.length === 1) {
|
||||
month = rawMonth;
|
||||
} else if (rawMonth.length === 2) {
|
||||
let m = parseInt(rawMonth);
|
||||
if (!isNaN(m)) {
|
||||
if (m < 1) m = 1;
|
||||
if (m > 12) m = 12;
|
||||
month = m.toString().padStart(2, "0");
|
||||
}
|
||||
}
|
||||
|
||||
let day = "";
|
||||
if (rawDay.length === 1) {
|
||||
day = rawDay;
|
||||
} else if (rawDay.length === 2 && year.length === 4 && month.length === 2) {
|
||||
let d = parseInt(rawDay);
|
||||
if (!isNaN(d)) {
|
||||
let maxDay = JalaliDateUtils.maxDayInMonth(parseInt(year), parseInt(month));
|
||||
if (d > maxDay) d = maxDay;
|
||||
day = d.toString().padStart(2, "0");
|
||||
}
|
||||
}
|
||||
|
||||
let formatted = year;
|
||||
if (month) {
|
||||
formatted += "/" + month;
|
||||
} else if (value.length > 4) {
|
||||
formatted += "/";
|
||||
}
|
||||
|
||||
if (day) {
|
||||
formatted += "/" + day;
|
||||
} else if (value.length > 6) {
|
||||
formatted += "/";
|
||||
}
|
||||
|
||||
//let formatted = year;
|
||||
//if (month) {
|
||||
// formatted += "/" + month;
|
||||
//} else if (value.length >= 4) {
|
||||
// formatted += "/";
|
||||
//}
|
||||
|
||||
//if (day) {
|
||||
// formatted += "/" + day;
|
||||
//} else if (value.length >= 6) {
|
||||
// formatted += "/";
|
||||
//}
|
||||
|
||||
this.input.value = formatted;
|
||||
}
|
||||
|
||||
formatMonth(rawMonth) {
|
||||
if (!rawMonth) return "";
|
||||
let month = parseInt(rawMonth, 10);
|
||||
if (isNaN(month)) return "";
|
||||
if (month > 12) month = 12;
|
||||
return month.toString().padStart(2, "0");
|
||||
}
|
||||
|
||||
formatDay(year, month, rawDay) {
|
||||
if (!rawDay || !month) return "";
|
||||
let day = parseInt(rawDay, 10);
|
||||
if (isNaN(day)) return "";
|
||||
|
||||
let maxDay = JalaliDateUtils.maxDayInMonth(parseInt(year), parseInt(month));
|
||||
if (day > maxDay) day = maxDay;
|
||||
return day.toString().padStart(2, "0");
|
||||
}
|
||||
}
|
||||
|
||||
class JalaliDateUtils {
|
||||
static isLeapYear(year) {
|
||||
const leapYears = [1, 5, 9, 13, 17, 22, 26, 30];
|
||||
return leapYears.includes(year % 33);
|
||||
}
|
||||
|
||||
static maxDayInMonth(year, month) {
|
||||
if (month < 1) return 1;
|
||||
if (month <= 6) return 31;
|
||||
if (month <= 11) return 30;
|
||||
return this.isLeapYear(year) ? 30 : 29;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
class UrlParamsBuilder {
|
||||
constructor(basePath) {
|
||||
this.basePath = basePath;
|
||||
this.params = new URLSearchParams();
|
||||
this.hasAnyFilter = false;
|
||||
}
|
||||
|
||||
addParam(key, value) {
|
||||
if (value !== undefined && value !== null && value !== "" && value !== "0") {
|
||||
this.params.set(key, value);
|
||||
this.hasAnyFilter = true;
|
||||
} else {
|
||||
this.params.delete(key);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
// اضافهکردن پارامتر از DOM (با val یا data-value-normal)
|
||||
addParamFromDOM(key, selector, { dataAttr = "data-value-normal", fallbackToVal = true } = {}) {
|
||||
const $el = $(selector);
|
||||
let value = $el.attr(dataAttr);
|
||||
if (!value && fallbackToVal) value = $el.val();
|
||||
|
||||
return this.addParam(key, value);
|
||||
}
|
||||
|
||||
buildUrl() {
|
||||
return this.hasAnyFilter
|
||||
? `${window.location.origin}${this.basePath}?${this.params.toString()}`
|
||||
: `${window.location.origin}${this.basePath}`;
|
||||
}
|
||||
|
||||
pushState() {
|
||||
const url = this.buildUrl();
|
||||
window.history.pushState({}, '', url);
|
||||
return url;
|
||||
}
|
||||
|
||||
static readParams(keys = []) {
|
||||
const urlParams = new URLSearchParams(window.location.search);
|
||||
const result = {};
|
||||
keys.forEach(key => {
|
||||
result[key] = urlParams.get(key) || "";
|
||||
});
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
window.UrlParamsBuilder = UrlParamsBuilder;
|
||||
@@ -61,7 +61,7 @@ function loadDataCameraAccountAjax() {
|
||||
|
||||
<div class="Rtable-cell d-md-flex d-none justify-content-center width5">
|
||||
<div class="Rtable-cell--content align-items-center d-flex d-md-flex text-end me-3">
|
||||
<div class="d-flex align-items-center justify-content-center">
|
||||
<div class="d-flex align-items-center justify-content-center ${hasActiveDeActvePersmission ? `` : `disable`}">
|
||||
<span class="mx-1 df">فعال</span>
|
||||
<label class="switch">
|
||||
<input type="checkbox"
|
||||
@@ -77,14 +77,26 @@ function loadDataCameraAccountAjax() {
|
||||
|
||||
<div class="Rtable-cell d-md-flex justify-content-end width6">
|
||||
<div class="Rtable-cell--content align-items-center d-flex d-md-flex justify-content-end">
|
||||
<button class="btn-pass ChangePassword d-none d-md-block" onclick="showModalCameraAccountChangePassword(${item.id})" id="CameraAccountChangePassword_${item.id}" type="button">
|
||||
|
||||
${hasEditCameraAccountPermission ?
|
||||
`<button class="btn-pass ChangePassword d-none d-md-block" onclick="showModalCameraAccountChangePassword(${item.id})" id="CameraAccountChangePassword_${item.id}" type="button">
|
||||
<span class="spanTxt d-none">تغییر گذرواژه</span>
|
||||
<span class="spanSvg">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="size-6">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" d="M15.75 5.25a3 3 0 0 1 3 3m3 0a6 6 0 0 1-7.029 5.912c-.563-.097-1.159.026-1.563.43L10.5 17.25H8.25v2.25H6v2.25H2.25v-2.818c0-.597.237-1.17.659-1.591l6.499-6.499c.404-.404.527-1 .43-1.563A6 6 0 1 1 21.75 8.25Z" />
|
||||
</svg>
|
||||
</span>
|
||||
</button>
|
||||
</button>`
|
||||
:
|
||||
`<button class="btn-pass ChangePassword d-none d-md-block disable" type="button">
|
||||
<span class="spanTxt d-none">تغییر گذرواژه</span>
|
||||
<span class="spanSvg">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="size-6">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" d="M15.75 5.25a3 3 0 0 1 3 3m3 0a6 6 0 0 1-7.029 5.912c-.563-.097-1.159.026-1.563.43L10.5 17.25H8.25v2.25H6v2.25H2.25v-2.818c0-.597.237-1.17.659-1.591l6.499-6.499c.404-.404.527-1 .43-1.563A6 6 0 1 1 21.75 8.25Z" />
|
||||
</svg>
|
||||
</span>
|
||||
</button>`
|
||||
}
|
||||
|
||||
<button type="button" class="btn-more position-relative d-md-none d-flex" style="width: 36px;padding: 0;height: 36px;align-items: center;justify-content: center;position: relative !important;">
|
||||
<span class="mx-1 align-items-center d-flex justify-content-center"></span>
|
||||
@@ -109,7 +121,7 @@ function loadDataCameraAccountAjax() {
|
||||
</div>
|
||||
<div class="d-flex align-items-center justify-content-between my-1">
|
||||
<span class="span1">وضعیت:</span>
|
||||
<div class="d-flex align-items-center justify-content-center">
|
||||
<div class="d-flex align-items-center justify-content-center ${hasActiveDeActvePersmission ? `` : `disable`}">
|
||||
<span class="span1 mx-1 df">فعال</span>
|
||||
<label class="switch">
|
||||
<input type="checkbox"
|
||||
@@ -133,14 +145,25 @@ function loadDataCameraAccountAjax() {
|
||||
</span>
|
||||
</button>
|
||||
|
||||
<button class="btn-pass ChangePassword w-100" onclick="showModalCameraAccountChangePassword(${item.id})" id="ChangePassword_${item.id}" type="button">
|
||||
<span class="spanTxt">تغییر گذرواژه</span>
|
||||
<span class="spanSvg">
|
||||
<svg width="24" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" d="M15.75 5.25a3 3 0 0 1 3 3m3 0a6 6 0 0 1-7.029 5.912c-.563-.097-1.159.026-1.563.43L10.5 17.25H8.25v2.25H6v2.25H2.25v-2.818c0-.597.237-1.17.659-1.591l6.499-6.499c.404-.404.527-1 .43-1.563A6 6 0 1 1 21.75 8.25Z" />
|
||||
</svg>
|
||||
</span>
|
||||
</button>
|
||||
${hasEditCameraAccountPermission ?
|
||||
`<button class="btn-pass ChangePassword w-100" onclick="showModalCameraAccountChangePassword(${item.id})" id="ChangePassword_${item.id}" type="button">
|
||||
<span class="spanTxt">تغییر گذرواژه</span>
|
||||
<span class="spanSvg">
|
||||
<svg width="24" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" d="M15.75 5.25a3 3 0 0 1 3 3m3 0a6 6 0 0 1-7.029 5.912c-.563-.097-1.159.026-1.563.43L10.5 17.25H8.25v2.25H6v2.25H2.25v-2.818c0-.597.237-1.17.659-1.591l6.499-6.499c.404-.404.527-1 .43-1.563A6 6 0 1 1 21.75 8.25Z" />
|
||||
</svg>
|
||||
</span>
|
||||
</button>`
|
||||
:
|
||||
`<button class="btn-pass ChangePassword w-100 disable" type="button">
|
||||
<span class="spanTxt">تغییر گذرواژه</span>
|
||||
<span class="spanSvg">
|
||||
<svg width="24" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" d="M15.75 5.25a3 3 0 0 1 3 3m3 0a6 6 0 0 1-7.029 5.912c-.563-.097-1.159.026-1.563.43L10.5 17.25H8.25v2.25H6v2.25H2.25v-2.818c0-.597.237-1.17.659-1.591l6.499-6.499c.404-.404.527-1 .43-1.563A6 6 0 1 1 21.75 8.25Z" />
|
||||
</svg>
|
||||
</span>
|
||||
</button>`
|
||||
}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
879
ServiceHost/wwwroot/AssetsTailwind/app.output.css
Normal file
879
ServiceHost/wwwroot/AssetsTailwind/app.output.css
Normal file
@@ -0,0 +1,879 @@
|
||||
*, ::before, ::after {
|
||||
--tw-border-spacing-x: 0;
|
||||
--tw-border-spacing-y: 0;
|
||||
--tw-translate-x: 0;
|
||||
--tw-translate-y: 0;
|
||||
--tw-rotate: 0;
|
||||
--tw-skew-x: 0;
|
||||
--tw-skew-y: 0;
|
||||
--tw-scale-x: 1;
|
||||
--tw-scale-y: 1;
|
||||
--tw-pan-x: ;
|
||||
--tw-pan-y: ;
|
||||
--tw-pinch-zoom: ;
|
||||
--tw-scroll-snap-strictness: proximity;
|
||||
--tw-gradient-from-position: ;
|
||||
--tw-gradient-via-position: ;
|
||||
--tw-gradient-to-position: ;
|
||||
--tw-ordinal: ;
|
||||
--tw-slashed-zero: ;
|
||||
--tw-numeric-figure: ;
|
||||
--tw-numeric-spacing: ;
|
||||
--tw-numeric-fraction: ;
|
||||
--tw-ring-inset: ;
|
||||
--tw-ring-offset-width: 0px;
|
||||
--tw-ring-offset-color: #fff;
|
||||
--tw-ring-color: rgb(59 130 246 / 0.5);
|
||||
--tw-ring-offset-shadow: 0 0 #0000;
|
||||
--tw-ring-shadow: 0 0 #0000;
|
||||
--tw-shadow: 0 0 #0000;
|
||||
--tw-shadow-colored: 0 0 #0000;
|
||||
--tw-blur: ;
|
||||
--tw-brightness: ;
|
||||
--tw-contrast: ;
|
||||
--tw-grayscale: ;
|
||||
--tw-hue-rotate: ;
|
||||
--tw-invert: ;
|
||||
--tw-saturate: ;
|
||||
--tw-sepia: ;
|
||||
--tw-drop-shadow: ;
|
||||
--tw-backdrop-blur: ;
|
||||
--tw-backdrop-brightness: ;
|
||||
--tw-backdrop-contrast: ;
|
||||
--tw-backdrop-grayscale: ;
|
||||
--tw-backdrop-hue-rotate: ;
|
||||
--tw-backdrop-invert: ;
|
||||
--tw-backdrop-opacity: ;
|
||||
--tw-backdrop-saturate: ;
|
||||
--tw-backdrop-sepia: ;
|
||||
--tw-contain-size: ;
|
||||
--tw-contain-layout: ;
|
||||
--tw-contain-paint: ;
|
||||
--tw-contain-style: ;
|
||||
}
|
||||
|
||||
::backdrop {
|
||||
--tw-border-spacing-x: 0;
|
||||
--tw-border-spacing-y: 0;
|
||||
--tw-translate-x: 0;
|
||||
--tw-translate-y: 0;
|
||||
--tw-rotate: 0;
|
||||
--tw-skew-x: 0;
|
||||
--tw-skew-y: 0;
|
||||
--tw-scale-x: 1;
|
||||
--tw-scale-y: 1;
|
||||
--tw-pan-x: ;
|
||||
--tw-pan-y: ;
|
||||
--tw-pinch-zoom: ;
|
||||
--tw-scroll-snap-strictness: proximity;
|
||||
--tw-gradient-from-position: ;
|
||||
--tw-gradient-via-position: ;
|
||||
--tw-gradient-to-position: ;
|
||||
--tw-ordinal: ;
|
||||
--tw-slashed-zero: ;
|
||||
--tw-numeric-figure: ;
|
||||
--tw-numeric-spacing: ;
|
||||
--tw-numeric-fraction: ;
|
||||
--tw-ring-inset: ;
|
||||
--tw-ring-offset-width: 0px;
|
||||
--tw-ring-offset-color: #fff;
|
||||
--tw-ring-color: rgb(59 130 246 / 0.5);
|
||||
--tw-ring-offset-shadow: 0 0 #0000;
|
||||
--tw-ring-shadow: 0 0 #0000;
|
||||
--tw-shadow: 0 0 #0000;
|
||||
--tw-shadow-colored: 0 0 #0000;
|
||||
--tw-blur: ;
|
||||
--tw-brightness: ;
|
||||
--tw-contrast: ;
|
||||
--tw-grayscale: ;
|
||||
--tw-hue-rotate: ;
|
||||
--tw-invert: ;
|
||||
--tw-saturate: ;
|
||||
--tw-sepia: ;
|
||||
--tw-drop-shadow: ;
|
||||
--tw-backdrop-blur: ;
|
||||
--tw-backdrop-brightness: ;
|
||||
--tw-backdrop-contrast: ;
|
||||
--tw-backdrop-grayscale: ;
|
||||
--tw-backdrop-hue-rotate: ;
|
||||
--tw-backdrop-invert: ;
|
||||
--tw-backdrop-opacity: ;
|
||||
--tw-backdrop-saturate: ;
|
||||
--tw-backdrop-sepia: ;
|
||||
--tw-contain-size: ;
|
||||
--tw-contain-layout: ;
|
||||
--tw-contain-paint: ;
|
||||
--tw-contain-style: ;
|
||||
}
|
||||
|
||||
/*
|
||||
! tailwindcss v3.4.17 | MIT License | https://tailwindcss.com
|
||||
*/
|
||||
|
||||
/*
|
||||
1. Prevent padding and border from affecting element width. (https://github.com/mozdevs/cssremedy/issues/4)
|
||||
2. Allow adding a border to an element by just adding a border-width. (https://github.com/tailwindcss/tailwindcss/pull/116)
|
||||
*/
|
||||
|
||||
*,
|
||||
::before,
|
||||
::after {
|
||||
box-sizing: border-box;
|
||||
/* 1 */
|
||||
border-width: 0;
|
||||
/* 2 */
|
||||
border-style: solid;
|
||||
/* 2 */
|
||||
border-color: #e5e7eb;
|
||||
/* 2 */
|
||||
}
|
||||
|
||||
::before,
|
||||
::after {
|
||||
--tw-content: '';
|
||||
}
|
||||
|
||||
/*
|
||||
1. Use a consistent sensible line-height in all browsers.
|
||||
2. Prevent adjustments of font size after orientation changes in iOS.
|
||||
3. Use a more readable tab size.
|
||||
4. Use the user's configured `sans` font-family by default.
|
||||
5. Use the user's configured `sans` font-feature-settings by default.
|
||||
6. Use the user's configured `sans` font-variation-settings by default.
|
||||
7. Disable tap highlights on iOS
|
||||
*/
|
||||
|
||||
html,
|
||||
:host {
|
||||
line-height: 1.5;
|
||||
/* 1 */
|
||||
-webkit-text-size-adjust: 100%;
|
||||
/* 2 */
|
||||
-moz-tab-size: 4;
|
||||
/* 3 */
|
||||
-o-tab-size: 4;
|
||||
tab-size: 4;
|
||||
/* 3 */
|
||||
font-family: ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
|
||||
/* 4 */
|
||||
font-feature-settings: normal;
|
||||
/* 5 */
|
||||
font-variation-settings: normal;
|
||||
/* 6 */
|
||||
-webkit-tap-highlight-color: transparent;
|
||||
/* 7 */
|
||||
}
|
||||
|
||||
/*
|
||||
1. Remove the margin in all browsers.
|
||||
2. Inherit line-height from `html` so users can set them as a class directly on the `html` element.
|
||||
*/
|
||||
|
||||
body {
|
||||
margin: 0;
|
||||
/* 1 */
|
||||
line-height: inherit;
|
||||
/* 2 */
|
||||
}
|
||||
|
||||
/*
|
||||
1. Add the correct height in Firefox.
|
||||
2. Correct the inheritance of border color in Firefox. (https://bugzilla.mozilla.org/show_bug.cgi?id=190655)
|
||||
3. Ensure horizontal rules are visible by default.
|
||||
*/
|
||||
|
||||
hr {
|
||||
height: 0;
|
||||
/* 1 */
|
||||
color: inherit;
|
||||
/* 2 */
|
||||
border-top-width: 1px;
|
||||
/* 3 */
|
||||
}
|
||||
|
||||
/*
|
||||
Add the correct text decoration in Chrome, Edge, and Safari.
|
||||
*/
|
||||
|
||||
abbr:where([title]) {
|
||||
-webkit-text-decoration: underline dotted;
|
||||
text-decoration: underline dotted;
|
||||
}
|
||||
|
||||
/*
|
||||
Remove the default font size and weight for headings.
|
||||
*/
|
||||
|
||||
h1,
|
||||
h2,
|
||||
h3,
|
||||
h4,
|
||||
h5,
|
||||
h6 {
|
||||
font-size: inherit;
|
||||
font-weight: inherit;
|
||||
}
|
||||
|
||||
/*
|
||||
Reset links to optimize for opt-in styling instead of opt-out.
|
||||
*/
|
||||
|
||||
a {
|
||||
color: inherit;
|
||||
text-decoration: inherit;
|
||||
}
|
||||
|
||||
/*
|
||||
Add the correct font weight in Edge and Safari.
|
||||
*/
|
||||
|
||||
b,
|
||||
strong {
|
||||
font-weight: bolder;
|
||||
}
|
||||
|
||||
/*
|
||||
1. Use the user's configured `mono` font-family by default.
|
||||
2. Use the user's configured `mono` font-feature-settings by default.
|
||||
3. Use the user's configured `mono` font-variation-settings by default.
|
||||
4. Correct the odd `em` font sizing in all browsers.
|
||||
*/
|
||||
|
||||
code,
|
||||
kbd,
|
||||
samp,
|
||||
pre {
|
||||
font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
|
||||
/* 1 */
|
||||
font-feature-settings: normal;
|
||||
/* 2 */
|
||||
font-variation-settings: normal;
|
||||
/* 3 */
|
||||
font-size: 1em;
|
||||
/* 4 */
|
||||
}
|
||||
|
||||
/*
|
||||
Add the correct font size in all browsers.
|
||||
*/
|
||||
|
||||
small {
|
||||
font-size: 80%;
|
||||
}
|
||||
|
||||
/*
|
||||
Prevent `sub` and `sup` elements from affecting the line height in all browsers.
|
||||
*/
|
||||
|
||||
sub,
|
||||
sup {
|
||||
font-size: 75%;
|
||||
line-height: 0;
|
||||
position: relative;
|
||||
vertical-align: baseline;
|
||||
}
|
||||
|
||||
sub {
|
||||
bottom: -0.25em;
|
||||
}
|
||||
|
||||
sup {
|
||||
top: -0.5em;
|
||||
}
|
||||
|
||||
/*
|
||||
1. Remove text indentation from table contents in Chrome and Safari. (https://bugs.chromium.org/p/chromium/issues/detail?id=999088, https://bugs.webkit.org/show_bug.cgi?id=201297)
|
||||
2. Correct table border color inheritance in all Chrome and Safari. (https://bugs.chromium.org/p/chromium/issues/detail?id=935729, https://bugs.webkit.org/show_bug.cgi?id=195016)
|
||||
3. Remove gaps between table borders by default.
|
||||
*/
|
||||
|
||||
table {
|
||||
text-indent: 0;
|
||||
/* 1 */
|
||||
border-color: inherit;
|
||||
/* 2 */
|
||||
border-collapse: collapse;
|
||||
/* 3 */
|
||||
}
|
||||
|
||||
/*
|
||||
1. Change the font styles in all browsers.
|
||||
2. Remove the margin in Firefox and Safari.
|
||||
3. Remove default padding in all browsers.
|
||||
*/
|
||||
|
||||
button,
|
||||
input,
|
||||
optgroup,
|
||||
select,
|
||||
textarea {
|
||||
font-family: inherit;
|
||||
/* 1 */
|
||||
font-feature-settings: inherit;
|
||||
/* 1 */
|
||||
font-variation-settings: inherit;
|
||||
/* 1 */
|
||||
font-size: 100%;
|
||||
/* 1 */
|
||||
font-weight: inherit;
|
||||
/* 1 */
|
||||
line-height: inherit;
|
||||
/* 1 */
|
||||
letter-spacing: inherit;
|
||||
/* 1 */
|
||||
color: inherit;
|
||||
/* 1 */
|
||||
margin: 0;
|
||||
/* 2 */
|
||||
padding: 0;
|
||||
/* 3 */
|
||||
}
|
||||
|
||||
/*
|
||||
Remove the inheritance of text transform in Edge and Firefox.
|
||||
*/
|
||||
|
||||
button,
|
||||
select {
|
||||
text-transform: none;
|
||||
}
|
||||
|
||||
/*
|
||||
1. Correct the inability to style clickable types in iOS and Safari.
|
||||
2. Remove default button styles.
|
||||
*/
|
||||
|
||||
button,
|
||||
input:where([type='button']),
|
||||
input:where([type='reset']),
|
||||
input:where([type='submit']) {
|
||||
-webkit-appearance: button;
|
||||
/* 1 */
|
||||
background-color: transparent;
|
||||
/* 2 */
|
||||
background-image: none;
|
||||
/* 2 */
|
||||
}
|
||||
|
||||
/*
|
||||
Use the modern Firefox focus style for all focusable elements.
|
||||
*/
|
||||
|
||||
:-moz-focusring {
|
||||
outline: auto;
|
||||
}
|
||||
|
||||
/*
|
||||
Remove the additional `:invalid` styles in Firefox. (https://github.com/mozilla/gecko-dev/blob/2f9eacd9d3d995c937b4251a5557d95d494c9be1/layout/style/res/forms.css#L728-L737)
|
||||
*/
|
||||
|
||||
:-moz-ui-invalid {
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
/*
|
||||
Add the correct vertical alignment in Chrome and Firefox.
|
||||
*/
|
||||
|
||||
progress {
|
||||
vertical-align: baseline;
|
||||
}
|
||||
|
||||
/*
|
||||
Correct the cursor style of increment and decrement buttons in Safari.
|
||||
*/
|
||||
|
||||
::-webkit-inner-spin-button,
|
||||
::-webkit-outer-spin-button {
|
||||
height: auto;
|
||||
}
|
||||
|
||||
/*
|
||||
1. Correct the odd appearance in Chrome and Safari.
|
||||
2. Correct the outline style in Safari.
|
||||
*/
|
||||
|
||||
[type='search'] {
|
||||
-webkit-appearance: textfield;
|
||||
/* 1 */
|
||||
outline-offset: -2px;
|
||||
/* 2 */
|
||||
}
|
||||
|
||||
/*
|
||||
Remove the inner padding in Chrome and Safari on macOS.
|
||||
*/
|
||||
|
||||
::-webkit-search-decoration {
|
||||
-webkit-appearance: none;
|
||||
}
|
||||
|
||||
/*
|
||||
1. Correct the inability to style clickable types in iOS and Safari.
|
||||
2. Change font properties to `inherit` in Safari.
|
||||
*/
|
||||
|
||||
::-webkit-file-upload-button {
|
||||
-webkit-appearance: button;
|
||||
/* 1 */
|
||||
font: inherit;
|
||||
/* 2 */
|
||||
}
|
||||
|
||||
/*
|
||||
Add the correct display in Chrome and Safari.
|
||||
*/
|
||||
|
||||
summary {
|
||||
display: list-item;
|
||||
}
|
||||
|
||||
/*
|
||||
Removes the default spacing and border for appropriate elements.
|
||||
*/
|
||||
|
||||
blockquote,
|
||||
dl,
|
||||
dd,
|
||||
h1,
|
||||
h2,
|
||||
h3,
|
||||
h4,
|
||||
h5,
|
||||
h6,
|
||||
hr,
|
||||
figure,
|
||||
p,
|
||||
pre {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
fieldset {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
legend {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
ol,
|
||||
ul,
|
||||
menu {
|
||||
list-style: none;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
/*
|
||||
Reset default styling for dialogs.
|
||||
*/
|
||||
|
||||
dialog {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
/*
|
||||
Prevent resizing textareas horizontally by default.
|
||||
*/
|
||||
|
||||
textarea {
|
||||
resize: vertical;
|
||||
}
|
||||
|
||||
/*
|
||||
1. Reset the default placeholder opacity in Firefox. (https://github.com/tailwindlabs/tailwindcss/issues/3300)
|
||||
2. Set the default placeholder color to the user's configured gray 400 color.
|
||||
*/
|
||||
|
||||
input::-moz-placeholder, textarea::-moz-placeholder {
|
||||
opacity: 1;
|
||||
/* 1 */
|
||||
color: #9ca3af;
|
||||
/* 2 */
|
||||
}
|
||||
|
||||
input::placeholder,
|
||||
textarea::placeholder {
|
||||
opacity: 1;
|
||||
/* 1 */
|
||||
color: #9ca3af;
|
||||
/* 2 */
|
||||
}
|
||||
|
||||
/*
|
||||
Set the default cursor for buttons.
|
||||
*/
|
||||
|
||||
button,
|
||||
[role="button"] {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
/*
|
||||
Make sure disabled buttons don't get the pointer cursor.
|
||||
*/
|
||||
|
||||
:disabled {
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
/*
|
||||
1. Make replaced elements `display: block` by default. (https://github.com/mozdevs/cssremedy/issues/14)
|
||||
2. Add `vertical-align: middle` to align replaced elements more sensibly by default. (https://github.com/jensimmons/cssremedy/issues/14#issuecomment-634934210)
|
||||
This can trigger a poorly considered lint error in some tools but is included by design.
|
||||
*/
|
||||
|
||||
img,
|
||||
svg,
|
||||
video,
|
||||
canvas,
|
||||
audio,
|
||||
iframe,
|
||||
embed,
|
||||
object {
|
||||
display: block;
|
||||
/* 1 */
|
||||
vertical-align: middle;
|
||||
/* 2 */
|
||||
}
|
||||
|
||||
/*
|
||||
Constrain images and videos to the parent width and preserve their intrinsic aspect ratio. (https://github.com/mozdevs/cssremedy/issues/14)
|
||||
*/
|
||||
|
||||
img,
|
||||
video {
|
||||
max-width: 100%;
|
||||
height: auto;
|
||||
}
|
||||
|
||||
/* Make elements with the HTML hidden attribute stay hidden by default */
|
||||
|
||||
[hidden]:where(:not([hidden="until-found"])) {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.tw-col-span-2 {
|
||||
grid-column: span 2 / span 2;
|
||||
}
|
||||
|
||||
.tw-mx-auto {
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
}
|
||||
|
||||
.tw-mb-1 {
|
||||
margin-bottom: 0.25rem;
|
||||
}
|
||||
|
||||
.tw-mb-2 {
|
||||
margin-bottom: 0.5rem;
|
||||
}
|
||||
|
||||
.tw-mb-4 {
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
|
||||
.tw-mt-0 {
|
||||
margin-top: 0px;
|
||||
}
|
||||
|
||||
.tw-block {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.tw-flex {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.tw-grid {
|
||||
display: grid;
|
||||
}
|
||||
|
||||
.tw-hidden {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.tw-h-\[25px\] {
|
||||
height: 25px;
|
||||
}
|
||||
|
||||
.tw-h-\[35px\] {
|
||||
height: 35px;
|
||||
}
|
||||
|
||||
.tw-w-\[10\%\] {
|
||||
width: 10%;
|
||||
}
|
||||
|
||||
.tw-w-\[13\%\] {
|
||||
width: 13%;
|
||||
}
|
||||
|
||||
.tw-w-\[15\%\] {
|
||||
width: 15%;
|
||||
}
|
||||
|
||||
.tw-w-\[25px\] {
|
||||
width: 25px;
|
||||
}
|
||||
|
||||
.tw-w-\[3\%\] {
|
||||
width: 3%;
|
||||
}
|
||||
|
||||
.tw-w-\[35\%\] {
|
||||
width: 35%;
|
||||
}
|
||||
|
||||
.tw-w-\[4\%\] {
|
||||
width: 4%;
|
||||
}
|
||||
|
||||
.tw-w-\[5\%\] {
|
||||
width: 5%;
|
||||
}
|
||||
|
||||
.tw-w-\[50\%\] {
|
||||
width: 50%;
|
||||
}
|
||||
|
||||
.tw-w-\[7\%\] {
|
||||
width: 7%;
|
||||
}
|
||||
|
||||
.tw-w-\[97\%\] {
|
||||
width: 97%;
|
||||
}
|
||||
|
||||
.tw-w-full {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.tw-w-max {
|
||||
width: -moz-max-content;
|
||||
width: max-content;
|
||||
}
|
||||
|
||||
.tw-grid-cols-12 {
|
||||
grid-template-columns: repeat(12, minmax(0, 1fr));
|
||||
}
|
||||
|
||||
.tw-grid-cols-2 {
|
||||
grid-template-columns: repeat(2, minmax(0, 1fr));
|
||||
}
|
||||
|
||||
.tw-grid-cols-3 {
|
||||
grid-template-columns: repeat(3, minmax(0, 1fr));
|
||||
}
|
||||
|
||||
.tw-flex-col {
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.tw-items-center {
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.tw-justify-end {
|
||||
justify-content: flex-end;
|
||||
}
|
||||
|
||||
.tw-justify-center {
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.tw-gap-2 {
|
||||
gap: 0.5rem;
|
||||
}
|
||||
|
||||
.tw-gap-3 {
|
||||
gap: 0.75rem;
|
||||
}
|
||||
|
||||
.tw-gap-4 {
|
||||
gap: 1rem;
|
||||
}
|
||||
|
||||
.tw-gap-40 {
|
||||
gap: 10rem;
|
||||
}
|
||||
|
||||
.tw-overflow-x-auto {
|
||||
overflow-x: auto;
|
||||
}
|
||||
|
||||
.tw-truncate {
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.tw-whitespace-nowrap {
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.tw-rounded-\[10px\] {
|
||||
border-radius: 10px;
|
||||
}
|
||||
|
||||
.tw-rounded-\[5px\] {
|
||||
border-radius: 5px;
|
||||
}
|
||||
|
||||
.tw-rounded-full {
|
||||
border-radius: 9999px;
|
||||
}
|
||||
|
||||
.tw-bg-\[\#2090C2\] {
|
||||
--tw-bg-opacity: 1;
|
||||
background-color: rgb(32 144 194 / var(--tw-bg-opacity, 1));
|
||||
}
|
||||
|
||||
.tw-bg-\[\#37d1d1\] {
|
||||
--tw-bg-opacity: 1;
|
||||
background-color: rgb(55 209 209 / var(--tw-bg-opacity, 1));
|
||||
}
|
||||
|
||||
.tw-bg-\[\#454D5C\] {
|
||||
--tw-bg-opacity: 1;
|
||||
background-color: rgb(69 77 92 / var(--tw-bg-opacity, 1));
|
||||
}
|
||||
|
||||
.tw-bg-\[\#84CC16\] {
|
||||
--tw-bg-opacity: 1;
|
||||
background-color: rgb(132 204 22 / var(--tw-bg-opacity, 1));
|
||||
}
|
||||
|
||||
.tw-bg-\[\#84D500\] {
|
||||
--tw-bg-opacity: 1;
|
||||
background-color: rgb(132 213 0 / var(--tw-bg-opacity, 1));
|
||||
}
|
||||
|
||||
.tw-bg-\[\#ADE7F2\] {
|
||||
--tw-bg-opacity: 1;
|
||||
background-color: rgb(173 231 242 / var(--tw-bg-opacity, 1));
|
||||
}
|
||||
|
||||
.tw-bg-\[\#DDD3E0\] {
|
||||
--tw-bg-opacity: 1;
|
||||
background-color: rgb(221 211 224 / var(--tw-bg-opacity, 1));
|
||||
}
|
||||
|
||||
.tw-bg-\[\#FF8798\] {
|
||||
--tw-bg-opacity: 1;
|
||||
background-color: rgb(255 135 152 / var(--tw-bg-opacity, 1));
|
||||
}
|
||||
|
||||
.tw-bg-\[\#b1c3c3\] {
|
||||
--tw-bg-opacity: 1;
|
||||
background-color: rgb(177 195 195 / var(--tw-bg-opacity, 1));
|
||||
}
|
||||
|
||||
.tw-bg-\[\#ddf4f4\] {
|
||||
--tw-bg-opacity: 1;
|
||||
background-color: rgb(221 244 244 / var(--tw-bg-opacity, 1));
|
||||
}
|
||||
|
||||
.tw-bg-\[\#ecffff\] {
|
||||
--tw-bg-opacity: 1;
|
||||
background-color: rgb(236 255 255 / var(--tw-bg-opacity, 1));
|
||||
}
|
||||
|
||||
.tw-bg-white {
|
||||
--tw-bg-opacity: 1;
|
||||
background-color: rgb(255 255 255 / var(--tw-bg-opacity, 1));
|
||||
}
|
||||
|
||||
.tw-p-4 {
|
||||
padding: 1rem;
|
||||
}
|
||||
|
||||
.tw-p-\[4px\] {
|
||||
padding: 4px;
|
||||
}
|
||||
|
||||
.tw-px-2 {
|
||||
padding-left: 0.5rem;
|
||||
padding-right: 0.5rem;
|
||||
}
|
||||
|
||||
.tw-px-6 {
|
||||
padding-left: 1.5rem;
|
||||
padding-right: 1.5rem;
|
||||
}
|
||||
|
||||
.tw-py-1 {
|
||||
padding-top: 0.25rem;
|
||||
padding-bottom: 0.25rem;
|
||||
}
|
||||
|
||||
.tw-text-center {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.tw-text-right {
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.tw-text-end {
|
||||
text-align: end;
|
||||
}
|
||||
|
||||
.tw-text-\[12px\] {
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.tw-text-\[16px\] {
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
.tw-text-\[18px\] {
|
||||
font-size: 18px;
|
||||
}
|
||||
|
||||
.tw-font-\[400\] {
|
||||
font-weight: 400;
|
||||
}
|
||||
|
||||
.tw-font-\[500\] {
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.tw-ordinal {
|
||||
--tw-ordinal: ordinal;
|
||||
font-variant-numeric: var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction);
|
||||
}
|
||||
|
||||
.tw-text-green-500 {
|
||||
--tw-text-opacity: 1;
|
||||
color: rgb(34 197 94 / var(--tw-text-opacity, 1));
|
||||
}
|
||||
|
||||
.tw-text-white {
|
||||
--tw-text-opacity: 1;
|
||||
color: rgb(255 255 255 / var(--tw-text-opacity, 1));
|
||||
}
|
||||
|
||||
.tw-transition-all {
|
||||
transition-property: all;
|
||||
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
|
||||
transition-duration: 150ms;
|
||||
}
|
||||
|
||||
.hover\:tw-bg-\[\#C9F0F0\]:hover {
|
||||
--tw-bg-opacity: 1;
|
||||
background-color: rgb(201 240 240 / var(--tw-bg-opacity, 1));
|
||||
}
|
||||
|
||||
.hover\:tw-bg-\[\#bbc6c6\]:hover {
|
||||
--tw-bg-opacity: 1;
|
||||
background-color: rgb(187 198 198 / var(--tw-bg-opacity, 1));
|
||||
}
|
||||
|
||||
@media (min-width: 768px) {
|
||||
.md\:tw-block {
|
||||
display: block;
|
||||
}
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user