area cleanUp

This commit is contained in:
samsys
2024-07-19 17:09:45 +03:30
parent 4519be75b8
commit c0a87834a5
428 changed files with 191790 additions and 190526 deletions

View File

@@ -1,58 +1,49 @@
@using Microsoft.EntityFrameworkCore
@using Microsoft.AspNetCore.Components.Forms
@using Microsoft.AspNetCore.Mvc.ModelBinding
@using System.Net.Mime
@model AccountManagement.Application.Contracts.Account.ChangePassword
@model AccountManagement.Application.Contracts.Account.ChangePassword
@{
}
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h4 class="modal-title"> تغییر گذرواژه</h4>
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h4 class="modal-title"> تغییر گذرواژه</h4>
</div>
<form asp-page="./Index" asp-page-handler="ChangePassword"
method="post"
data-ajax="true"
data-callback=""
data-action="Refresh"
>
<div class="modal-body">
<div class="row">
data-action="Refresh">
<div class="modal-body">
<div class="row">
<div class="row">
<div class="col-md-12">
<div class="form-group">
<label asp-for="Password" class="control-label">گذرواژه جدید</label>
<input type="password" class="form-control" asp-for="Password">
<span asp-validation-for="Password" class="error"></span>
@*@if (TempData["name"] != null)
<div class="row">
<div class="col-md-12">
<div class="form-group">
<label asp-for="Password" class="control-label">گذرواژه جدید</label>
<input type="password" class="form-control" asp-for="Password">
<span asp-validation-for="Password" class="error"></span>
@*@if (TempData["name"] != null)
{<br /><span class="error">@TempData["name"]</span>}*@
</div>
</div>
<div class="col-md-12">
<div class="form-group">
<label asp-for="RePassword" class="control-label">تکرار گذرواژه جدید </label>
<input type="password" class="form-control" asp-for="RePassword">
<span asp-validation-for="RePassword" class="error"></span>
@*@if (TempData["family"] != null)
</div>
</div>
<div class="col-md-12">
<div class="form-group">
<label asp-for="RePassword" class="control-label">تکرار گذرواژه جدید </label>
<input type="password" class="form-control" asp-for="RePassword">
<span asp-validation-for="RePassword" class="error"></span>
@*@if (TempData["family"] != null)
{<br /><span class="error">@TempData["family"]</span>}*@
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<input type="hidden" asp-for="Id" value="@Model.Id"/>
</div>
</div>
<input type="hidden" asp-for="Id" value="@Model.Id" />
<div class="modal-footer">
<button type="submit" class="btn btn-success btn-rounded waves-effect waves-light m-b-5"> ثبت گذرواژه جدید </button>
<button type="button" class="btn btn-default btn-rounded waves-effect waves-light m-b-5" data-dismiss="modal">بستن فرم</button>
</div>
</form>
<div class="modal-footer">
<button type="submit" class="btn btn-success btn-rounded waves-effect waves-light m-b-5"> ثبت گذرواژه جدید </button>
<button type="button" class="btn btn-default btn-rounded waves-effect waves-light m-b-5" data-dismiss="modal">بستن فرم</button>
</div>
</form>

View File

@@ -1,97 +1,90 @@
@using Microsoft.EntityFrameworkCore
@using Microsoft.AspNetCore.Components.Forms
@using Microsoft.AspNetCore.Mvc.ModelBinding
@using System.Net.Mime
@model AccountManagement.Application.Contracts.Account.CreateAccount
@model AccountManagement.Application.Contracts.Account.CreateAccount
@{
}
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h4 class="modal-title"> ایجاد کاربر جدید</h4>
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h4 class="modal-title"> ایجاد کاربر جدید</h4>
</div>
<form asp-page="./Index" asp-page-handler="Create"
method="post"
data-ajax="true"
data-callback=""
data-action="Refresh"
enctype="multipart/form-data"
>
<div class="modal-body">
<div class="row">
<div class="row">
<div class="col-md-6">
<div class="form-group">
<label asp-for="Fullname" class="control-label">نام</label>
<input type="text" class="form-control" asp-for="Fullname">
<span asp-validation-for="Fullname" class="error"></span>
@*@if (TempData["name"] != null)
enctype="multipart/form-data">
<div class="modal-body">
<div class="row">
<div class="row">
<div class="col-md-6">
<div class="form-group">
<label asp-for="Fullname" class="control-label">نام</label>
<input type="text" class="form-control" asp-for="Fullname">
<span asp-validation-for="Fullname" class="error"></span>
@*@if (TempData["name"] != null)
{<br /><span class="error">@TempData["name"]</span>}*@
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label asp-for="Username" class="control-label">نام کاربری</label>
<input type="text" class="form-control" asp-for="Username">
<span asp-validation-for="Username" class="error"></span>
@*@if (TempData["family"] != null)
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label asp-for="Username" class="control-label">نام کاربری</label>
<input type="text" class="form-control" asp-for="Username">
<span asp-validation-for="Username" class="error"></span>
@*@if (TempData["family"] != null)
{<br /><span class="error">@TempData["family"]</span>}*@
</div>
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-6">
<div class="form-group">
<label asp-for="RoleId" class="control-label">نقش </label>
<select class="form-control" asp-for="RoleId" asp-items='new SelectList(Model.Roles, "Id","Name")'>
<option value="0"></option>
</select>
<span asp-validation-for="RoleId" class="error"></span>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label asp-for="Mobile" class="control-label">شماره تماس</label>
<input type="text" class="form-control" asp-for="Mobile">
<span asp-validation-for="Mobile" class="error"></span>
<div class="row">
<div class="col-md-6">
<div class="form-group">
<label asp-for="RoleId" class="control-label">نقش </label>
<select class="form-control" asp-for="RoleId" asp-items='new SelectList(Model.Roles, "Id", "Name")'>
<option value="0"></option>
</select>
<span asp-validation-for="RoleId" class="error"></span>
</div>
</div>
</div>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label asp-for="Mobile" class="control-label">شماره تماس</label>
<input type="text" class="form-control" asp-for="Mobile">
<span asp-validation-for="Mobile" class="error"></span>
<div class="row">
<div class="col-md-6">
<div class="form-group">
<label asp-for="ProfilePhoto" class="control-label"> عکس پروفایل</label>
<input type="file" class="form-control" asp-for="ProfilePhoto" accept="image/*">
<span asp-validation-for="ProfilePhoto" class="error"></span>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label asp-for="Password" class="control-label"> گذرواژه</label>
<input type="text" class="form-control" asp-for="Password">
<span asp-validation-for="Password" class="error"></span>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
@*<input type="hidden" asp-for="id" value="id"/>*@
<div class="row">
<div class="col-md-6">
<div class="form-group">
<label asp-for="ProfilePhoto" class="control-label"> عکس پروفایل</label>
<input type="file" class="form-control" asp-for="ProfilePhoto" accept="image/*">
<span asp-validation-for="ProfilePhoto" class="error"></span>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label asp-for="Password" class="control-label"> گذرواژه</label>
<input type="text" class="form-control" asp-for="Password">
<span asp-validation-for="Password" class="error"></span>
</div>
</div>
</div>
<div class="modal-footer">
<button type="submit" class="btn btn-success btn-rounded waves-effect waves-light m-b-5"> ثبت کاربر جدید </button>
<button type="button" class="btn btn-default btn-rounded waves-effect waves-light m-b-5" data-dismiss="modal">بستن فرم</button>
</div>
</form>
</div>
</div>
@*<input type="hidden" asp-for="id" value="id"/>*@
<div class="modal-footer">
<button type="submit" class="btn btn-success btn-rounded waves-effect waves-light m-b-5"> ثبت کاربر جدید </button>
<button type="button" class="btn btn-default btn-rounded waves-effect waves-light m-b-5" data-dismiss="modal">بستن فرم</button>
</div>
</form>

View File

@@ -3,8 +3,8 @@
}
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h4 class="modal-title">ویرایش کاربر </h4>
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h4 class="modal-title">ویرایش کاربر </h4>
</div>
<form asp-page="./Index" asp-page-handler="Edit"
method="post"
@@ -12,75 +12,74 @@
data-callback=""
data-action="Refresh"
enctype="multipart/form-data">
<div class="modal-body">
<div class="row">
<div class="modal-body">
<div class="row">
<div class="row">
<div class="col-md-6">
<div class="form-group">
<label asp-for="Fullname" class="control-label">نام</label>
<input type="text" class="form-control" asp-for="Fullname">
<span asp-validation-for="Fullname" class="error"></span>
@*@if (TempData["name"] != null)
<div class="row">
<div class="col-md-6">
<div class="form-group">
<label asp-for="Fullname" class="control-label">نام</label>
<input type="text" class="form-control" asp-for="Fullname">
<span asp-validation-for="Fullname" class="error"></span>
@*@if (TempData["name"] != null)
{<br /><span class="error">@TempData["name"]</span>}*@
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label asp-for="Username" class="control-label">نام کاربری</label>
<input type="text" class="form-control" asp-for="Username">
<span asp-validation-for="Username" class="error"></span>
@*@if (TempData["family"] != null)
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label asp-for="Username" class="control-label">نام کاربری</label>
<input type="text" class="form-control" asp-for="Username">
<span asp-validation-for="Username" class="error"></span>
@*@if (TempData["family"] != null)
{<br /><span class="error">@TempData["family"]</span>}*@
</div>
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-6">
<div class="form-group">
<label asp-for="RoleId" class="control-label">نقش </label>
<select class="form-control" asp-for="RoleId" asp-items='new SelectList(Model.Roles, "Id","Name")'>
<option value="0"></option>
</select>
<span asp-validation-for="RoleId" class="error"></span>
<div class="row">
<div class="col-md-6">
<div class="form-group">
<label asp-for="RoleId" class="control-label">نقش </label>
<select class="form-control" asp-for="RoleId" asp-items='new SelectList(Model.Roles, "Id", "Name")'>
<option value="0"></option>
</select>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label asp-for="Mobile" class="control-label">شماره تماس</label>
<input type="text" class="form-control" asp-for="Mobile">
<span asp-validation-for="Mobile" class="error"></span>
<span asp-validation-for="RoleId" class="error"></span>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label asp-for="Mobile" class="control-label">شماره تماس</label>
<input type="text" class="form-control" asp-for="Mobile">
<span asp-validation-for="Mobile" class="error"></span>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<div class="form-group">
<label asp-for="ProfilePhoto" class="control-label"> عکس پروفایل</label>
<input type="file" class="form-control" asp-for="ProfilePhoto" accept="image/*">
<span asp-validation-for="ProfilePhoto" class="error"></span>
</div>
</div>
<div class="row">
<div class="col-md-12">
<div class="form-group">
<label asp-for="ProfilePhoto" class="control-label"> عکس پروفایل</label>
<input type="file" class="form-control" asp-for="ProfilePhoto" accept="image/*">
<span asp-validation-for="ProfilePhoto" class="error"></span>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<input type="hidden" asp-for="Id" value="@Model.Id" />
</div>
<input type="hidden" asp-for="Id" value="@Model.Id"/>
<div class="modal-footer">
<div class="modal-footer">
<button type="submit" class="btn btn-success btn-rounded waves-effect waves-light m-b-5"> ثبت تغییرات </button>
<button type="button" class="btn btn-default btn-rounded waves-effect waves-light m-b-5" data-dismiss="modal">بستن فرم</button>
</div>
</form>
<button type="submit" class="btn btn-success btn-rounded waves-effect waves-light m-b-5"> ثبت تغییرات </button>
<button type="button" class="btn btn-default btn-rounded waves-effect waves-light m-b-5" data-dismiss="modal">بستن فرم</button>
</div>
</form>

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -1,10 +1,7 @@
using System.Collections.Generic;
using System.Security.Claims;
using _0_Framework.Application;
using _0_Framework.Application;
using _0_Framework.Application.Sms;
using AccountManagement.Application.Contracts.Account;
using AccountManagement.Application.Contracts.Role;
using AccountManagement.Domain.RoleAgg;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
@@ -12,247 +9,203 @@ using Microsoft.AspNetCore.Mvc.Rendering;
using Microsoft.AspNetCore.SignalR;
using ServiceHost.Hubs;
namespace ServiceHost.Areas.Admin.Pages.Accounts.Account
namespace ServiceHost.Areas.Admin.Pages.Accounts.Account;
[Authorize]
public class IndexModel : PageModel
{
[Authorize]
public class IndexModel : PageModel
{
public AccountSearchModel SearchModel;
public List<AccountViewModel> AdminAccounts;
public List<AccountViewModel> ClientAccounts;
public SelectList Roles;
public List<RoleViewModel> Roless;
private readonly IRoleApplication _roleApplication;
private readonly IAccountApplication _accountApplication;
private readonly IHubContext<SendAccountMessage> _hubContext;
private readonly IAuthHelper _authHelper;
private readonly ISmsService _smsService;
public long CurrntAccountId;
private readonly IAccountApplication _accountApplication;
private readonly IAuthHelper _authHelper;
private readonly IHubContext<SendAccountMessage> _hubContext;
private readonly IRoleApplication _roleApplication;
private readonly ISmsService _smsService;
public List<AccountViewModel> AdminAccounts;
public List<AccountViewModel> ClientAccounts;
public long CurrntAccountId;
public SelectList Roles;
public List<RoleViewModel> Roless;
public IndexModel(IAccountApplication accountApplication, IRoleApplication roleApplication, IAuthHelper authHelper, ISmsService smsService, IHubContext<SendAccountMessage> hubContext)
{
_accountApplication = accountApplication;
_roleApplication = roleApplication;
public AccountSearchModel SearchModel;
_authHelper = authHelper;
_smsService = smsService;
_hubContext = hubContext;
}
public IndexModel(IAccountApplication accountApplication, IRoleApplication roleApplication, IAuthHelper authHelper,
ISmsService smsService, IHubContext<SendAccountMessage> hubContext)
{
_accountApplication = accountApplication;
_roleApplication = roleApplication;
_authHelper = authHelper;
_smsService = smsService;
_hubContext = hubContext;
}
public void OnGet(AccountSearchModel searchModel)
{
Roles = new SelectList(_roleApplication.List(), "Id", "Name");
AdminAccounts = _accountApplication.Search(searchModel).Where(x=>x.RoleId != 15).ToList();
ClientAccounts = _accountApplication.Search(searchModel).Where(x => x.RoleId == 15).ToList();
Roless = _roleApplication.List();
public void OnGet(AccountSearchModel searchModel)
{
Roles = new SelectList(_roleApplication.List(), "Id", "Name");
AdminAccounts = _accountApplication.Search(searchModel).Where(x => x.RoleId != 15).ToList();
ClientAccounts = _accountApplication.Search(searchModel).Where(x => x.RoleId == 15).ToList();
Roless = _roleApplication.List();
CurrntAccountId = _authHelper.CurrentAccountId();
}
public IActionResult OnGetCreate()
{
var command = new CreateAccount
{
Roles = _roleApplication.List()
};
return Partial("./Create", command);
}
public IActionResult OnPostCreate(CreateAccount command)
{
var result = _accountApplication.Create(command);
return new JsonResult(result);
}
public IActionResult OnGetCreateRole()
{
var command = new CreateRole();
return Partial("./CreateRole", command);
}
public IActionResult OnPostCreateRole(CreateRole command)
{
var result = _roleApplication.Create(command);
return new JsonResult(result);
}
public IActionResult OnGetEdit(long id)
{
var account = _accountApplication.GetDetails(id);
account.Roles = _roleApplication.List();
return Partial("Edit", account);
}
CurrntAccountId = _authHelper.CurrentAccountId();
}
public JsonResult OnPostEdit(EditAccount command)
{
var result = _accountApplication.Edit(command);
return new JsonResult(result);
}
public IActionResult OnGetEditRole(long id)
{
var role = _roleApplication.GetDetails(id);
var rol = new List<int>();
foreach (var item in role.MappedPermissions)
{
rol.Add(item.Code);
}
role.Permissions = rol;
return Partial("EditRole", role);
}
public JsonResult OnPostEditRole(EditRole command)
{
var result = _roleApplication.Edit(command);
return new JsonResult(result);
}
public IActionResult OnGetChangePassword(long id)
{
var command = new ChangePassword {Id = id};
return Partial("ChangePassword", command);
}
public IActionResult OnGetSendAccountSms()
{
var currntAcc = _authHelper.CurrentAccountId();
public IActionResult OnGetCreate()
{
var command = new CreateAccount
{
Roles = _roleApplication.List()
};
return Partial("./Create", command);
}
var fix = _accountApplication.GetClientsAccount();
List<long> falseIds = new List<long>(){182, 191, 192, 219, 229, 254, 268, 276, 289};
var accountsList = fix.Where(x => falseIds.Contains(x.Id)).ToList();
double maxNumber = (double)accountsList.Count;
int n = 1;
foreach (var account in accountsList)
{
public IActionResult OnPostCreate(CreateAccount command)
{
var result = _accountApplication.Create(command);
return new JsonResult(result);
}
var sendResult = _smsService.SendAccountsInfo(account.Mobile, account.Fullname, account.Username);
if (sendResult)
{
Console.WriteLine(sendResult + " - id : " + account.Id + " - " + account.Username);
}
else
{
Console.WriteLine(sendResult + " - id : " + account.Id + " - " + account.Username);
}
public IActionResult OnGetCreateRole()
{
var command = new CreateRole();
var percent = ((n / maxNumber) * 100);
_hubContext.Clients.Group(SendAccountMessage.GetGroupName(currntAcc))
.SendAsync("showStatus", (int)percent);
return Partial("./CreateRole", command);
}
n += 1;
Thread.Sleep(3000);
}
if (n >= accountsList.Count)
{
return new JsonResult(new
{
isSuccess = true,
contractCount = n,
});
}
else
{
var failds = accountsList.Count - n;
return new JsonResult(new
{
isSuccess = false,
contractCount = failds,
});
}
}
public JsonResult OnPostChangePassword(ChangePassword command)
{
var result = _accountApplication.ChangePassword(command);
return new JsonResult(result);
}
public IActionResult OnGetDeActive(long id)
{
var result = _accountApplication.DeActive(id);
if (result.IsSuccedded)
{
return new JsonResult(new
{
isSuccedded = true,
});
}
else
{
return new JsonResult(new
{
isSuccedded = false,
});
}
}
public IActionResult OnGetActive(long id)
{
var result = _accountApplication.Active(id);
if (result.IsSuccedded)
{
return new JsonResult(new
{
isSuccedded = true,
});
}
else
{
return new JsonResult(new
{
isSuccedded = false,
});
}
}
public IActionResult OnPostCreateRole(CreateRole command)
{
var result = _roleApplication.Create(command);
return new JsonResult(result);
}
public IActionResult OnPostLoginToClient(long id)
{
var result = _accountApplication.DirectLogin(id);
if (result.IsSuccedded)
{
return new JsonResult(new
{
isSuccess = true,
});
public IActionResult OnGetEdit(long id)
{
var account = _accountApplication.GetDetails(id);
account.Roles = _roleApplication.List();
return Partial("Edit", account);
}
}
return new JsonResult(new
{
isSuccess = false,
});
}
}
}
public JsonResult OnPostEdit(EditAccount command)
{
var result = _accountApplication.Edit(command);
return new JsonResult(result);
}
public IActionResult OnGetEditRole(long id)
{
var role = _roleApplication.GetDetails(id);
var rol = new List<int>();
foreach (var item in role.MappedPermissions) rol.Add(item.Code);
role.Permissions = rol;
return Partial("EditRole", role);
}
public JsonResult OnPostEditRole(EditRole command)
{
var result = _roleApplication.Edit(command);
return new JsonResult(result);
}
public IActionResult OnGetChangePassword(long id)
{
var command = new ChangePassword { Id = id };
return Partial("ChangePassword", command);
}
public IActionResult OnGetSendAccountSms()
{
var currntAcc = _authHelper.CurrentAccountId();
var fix = _accountApplication.GetClientsAccount();
var falseIds = new List<long> { 182, 191, 192, 219, 229, 254, 268, 276, 289 };
var accountsList = fix.Where(x => falseIds.Contains(x.Id)).ToList();
double maxNumber = accountsList.Count;
var n = 1;
foreach (var account in accountsList)
{
var sendResult = _smsService.SendAccountsInfo(account.Mobile, account.Fullname, account.Username);
if (sendResult)
Console.WriteLine(sendResult + " - id : " + account.Id + " - " + account.Username);
else
Console.WriteLine(sendResult + " - id : " + account.Id + " - " + account.Username);
var percent = n / maxNumber * 100;
_hubContext.Clients.Group(SendAccountMessage.GetGroupName(currntAcc))
.SendAsync("showStatus", (int)percent);
n += 1;
Thread.Sleep(3000);
}
if (n >= accountsList.Count)
return new JsonResult(new
{
isSuccess = true,
contractCount = n
});
var failds = accountsList.Count - n;
return new JsonResult(new
{
isSuccess = false,
contractCount = failds
});
}
public JsonResult OnPostChangePassword(ChangePassword command)
{
var result = _accountApplication.ChangePassword(command);
return new JsonResult(result);
}
public IActionResult OnGetDeActive(long id)
{
var result = _accountApplication.DeActive(id);
if (result.IsSuccedded)
return new JsonResult(new
{
isSuccedded = true
});
return new JsonResult(new
{
isSuccedded = false
});
}
public IActionResult OnGetActive(long id)
{
var result = _accountApplication.Active(id);
if (result.IsSuccedded)
return new JsonResult(new
{
isSuccedded = true
});
return new JsonResult(new
{
isSuccedded = false
});
}
public IActionResult OnPostLoginToClient(long id)
{
var result = _accountApplication.DirectLogin(id);
if (result.IsSuccedded)
return new JsonResult(new
{
isSuccess = true
});
return new JsonResult(new
{
isSuccess = false
});
}
}

View File

@@ -2,8 +2,7 @@
@{
}
@{
<style>
<style>
.ui-autocomplete-input {
border: none;
@@ -49,110 +48,109 @@
*border-bottom-width: 2px;
}
</style>
}
}
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<form asp-page="./Index" asp-page-handler="Create" autocomplete="off"
method="post"
data-ajax="true"
data-callback=""
data-action="Refresh"
enctype="multipart/form-data">
<button type="submit" class="btn btn-success btn-rounded waves-effect waves-light">ذخیره</button>
<button type="button" class="btn btn-default btn-rounded waves-effect waves-light m-b-5" data-dismiss="modal">بستن</button>
<div class="modal-body">
<form asp-page="./Index" asp-page-handler="Create" autocomplete="off"
method="post"
data-ajax="true"
data-callback=""
data-action="Refresh"
enctype="multipart/form-data">
<button type="submit" class="btn btn-success btn-rounded waves-effect waves-light">ذخیره</button>
<button type="button" class="btn btn-default btn-rounded waves-effect waves-light m-b-5" data-dismiss="modal">بستن</button>
<div class="modal-body">
<div class="row">
<fieldset style="border: 1px solid #999797; border-radius: 10px; padding: revert">
<div class="row">
<fieldset style="border: 1px solid #999797; border-radius: 10px; padding: revert">
<div class="row">
<div class="col-md-6">
<div class="form-group">
<label class="control-label">انتخاب موکل: </label>
@*<select class="form-control select-city" asp-for="Appointed" asp-items='new SelectList(Model.drpAppointed,"Value","Text")' id="Appointed_Id">
<div class="row">
<div class="col-md-6">
<div class="form-group">
<label class="control-label">انتخاب موکل: </label>
@*<select class="form-control select-city" asp-for="Appointed" asp-items='new SelectList(Model.drpAppointed,"Value","Text")' id="Appointed_Id">
</select>*@
<span asp-validation-for="Appointed" class="error"></span>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label class="control-label"> مرحله رسیدگی :</label>
<span asp-validation-for="Appointed" class="error"></span>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label class="control-label"> مرحله رسیدگی :</label>
<!--<select class="form-control select-city" asp-for="ProcessingStage" asp-items='new SelectList(Model.drProcessingStage,"Value","Text")' id="ProcessingStage_Id">-->
@*<option value="0"> انتخاب موکل:</option>*@
<!--</select>-->
<!--<select class="form-control select-city" asp-for="ProcessingStage" asp-items='new SelectList(Model.drProcessingStage, "Value", "Text")' id="ProcessingStage_Id">-->
@*<option value="0"> انتخاب موکل:</option>*@
<!--</select>-->
<span asp-validation-for="ProcessingStage" class="error"></span>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label class="control-label"> انتخاب مخاطب :</label>
@*<select class="form-control select-city" asp-for="Contact" asp-items='new SelectList(Model.drContact,"Value","Text")' id="Contact_Id">
<span asp-validation-for="ProcessingStage" class="error"></span>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label class="control-label"> انتخاب مخاطب :</label>
@*<select class="form-control select-city" asp-for="Contact" asp-items='new SelectList(Model.drContact,"Value","Text")' id="Contact_Id">
</select>*@
<span asp-validation-for="Contact" class="error"></span>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label class="control-label"> موضوع : </label>
<input type="text" class="form-control" asp-for="SubjectBill">
<span asp-validation-for="SubjectBill" class="error"></span>
<span asp-validation-for="Contact" class="error"></span>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label class="control-label"> موضوع : </label>
<input type="text" class="form-control" asp-for="SubjectBill">
<span asp-validation-for="SubjectBill" class="error"></span>
</div>
</div>
<style>
</div>
</div>
<style>
</style>
<div class="col-md-12">
<div class="col-md-12">
<div class="form-group">
<div class="form-group">
<script src="~/js/PTextManager/ckeditor/ckeditor.js"></script>
<label asp-for="Description" class="control-label"></label>
<div>
<button class="btn btn-info" style="float: inline-end;position: absolute;left: 17px;margin-top: 9px;">جستجوی درج متن<i class="fa fa-search"></i></button>
<textarea id="Description" name="Description" asp-for="Description" class="form-control textarea1"></textarea>
<span asp-validation-for="Description" class="text-danger"></span>
</div>
<script src="~/js/PTextManager/ckeditor/ckeditor.js"></script>
<label asp-for="Description" class="control-label"></label>
<div>
<button class="btn btn-info" style="float: inline-end;position: absolute;left: 17px;margin-top: 9px;">جستجوی درج متن<i class="fa fa-search"></i></button>
<textarea id="Description" name="Description" asp-for="Description" class="form-control textarea1"></textarea>
<span asp-validation-for="Description" class="text-danger"></span>
</div>
<script>
<script>
const config = {
filebrowserImageBrowseUrl: "/imagebrowser",
filebrowserImageWindowWidth: 780,
filebrowserImageWindowHeight: 720,
filebrowserBrowseUrl: "/linkbrowser",
filebrowserWindowWidth: 350,
filebrowserWindowHeight: 500
};
const config = {
filebrowserImageBrowseUrl: "/imagebrowser",
filebrowserImageWindowWidth: 780,
filebrowserImageWindowHeight: 720,
filebrowserBrowseUrl: "/linkbrowser",
filebrowserWindowWidth: 350,
filebrowserWindowHeight: 500
};
config.removeButtons = 'Format,Styles,Source,Templates,Cut,Scayt,SelectAll,Find,Form,Replace,Copy,Paste,PasteText,PasteFromWord,HiddenField,Button,Select,Textarea,TextField,Radio,Checkbox,CopyFormatting,Blockquote,Link,Image,RemoveFormat,Strike,Subscript,Superscript,CreateDiv,BidiRtl,Unlink,Flash,Anchor,Language,HorizontalRule,Smiley,SpecialChar,PageBreak,Iframe,About,ShowBlocks,BGColor,BidiLtr,ImageButton,Print,NewPage,Save,Preview,BulletedList,NumberedList,Indent,Outdent,Undo,Redo';
const editor = document.getElementById("Description");
CKEDITOR.replace(editor, config);
/* CKEDITOR.instances["Description"].setData("<h1> data to render</h1>")*/
</script>
<style>
config.removeButtons = 'Format,Styles,Source,Templates,Cut,Scayt,SelectAll,Find,Form,Replace,Copy,Paste,PasteText,PasteFromWord,HiddenField,Button,Select,Textarea,TextField,Radio,Checkbox,CopyFormatting,Blockquote,Link,Image,RemoveFormat,Strike,Subscript,Superscript,CreateDiv,BidiRtl,Unlink,Flash,Anchor,Language,HorizontalRule,Smiley,SpecialChar,PageBreak,Iframe,About,ShowBlocks,BGColor,BidiLtr,ImageButton,Print,NewPage,Save,Preview,BulletedList,NumberedList,Indent,Outdent,Undo,Redo';
const editor = document.getElementById("Description");
CKEDITOR.replace(editor, config);
/* CKEDITOR.instances["Description"].setData("<h1> data to render</h1>")*/
</script>
<style>
#cke_376_bottom {
display: none !important
}
</style>
</div>
</div>
</div>
</fieldset>
</div>
</div>
</div>
</div>
</div>
</fieldset>
</div>
</div>
<div class="modal-footer">
@*<button type="submit" class="btn btn-success btn-rounded waves-effect waves-light">ذخیره</button>
<div class="modal-footer">
@*<button type="submit" class="btn btn-success btn-rounded waves-effect waves-light">ذخیره</button>
<button type="button" class="btn btn-default btn-rounded waves-effect waves-light m-b-5" data-dismiss="modal">بستن</button>*@
</div>
</form>
</div>
</div>
</form>
</div>

View File

@@ -1,75 +1,75 @@
@page
@model ServiceHost.Areas.Admin.Pages.Company.Bill.CreateBillModel
<div class="container" style="width:90%">
<div style="text-align:center">
<h3> لایحه جدید</h3>
</div>
<br />
<form asp-page="./CreateBill" asp-page-handler="Create"
method="post">
<div class="row">
<div class="row">
<fieldset style="border: 1px solid #999797; border-radius: 10px; padding: revert">
<div class="row" style="margin: 10px 10px 10px 10px ">
<br>
<div class="col-md-4">
<div class="form-group">
<label asp-for="CreateBill.Appointed" class="control-label"> انتخاب موکل: </label>
<div style="text-align:center">
<h3> لایحه جدید</h3>
</div>
<br/>
<form asp-page="./CreateBill" asp-page-handler="Create"
method="post">
<div class="row">
<div class="row">
<fieldset style="border: 1px solid #999797; border-radius: 10px; padding: revert">
<div class="row" style="margin: 10px 10px 10px 10px ">
<br>
<div class="col-md-4">
<div class="form-group">
<label asp-for="CreateBill.Appointed" class="control-label"> انتخاب موکل: </label>
<input id="Appointed_Id" asp-for="CreateBill.Appointed" class="form-control" placeholder="انتخاب موکل..." style="z-index: 0;" />
<span class="alert-danger" asp-validation-for="CreateBill.Appointed"></span>
</div>
</div>
<div class="col-md-4">
<div class="form-group">
<label asp-for="CreateBill.ProcessingStage" class="control-label"> مرحله رسیدگی: </label>
<input id="ProcessingStage_Id" asp-for="CreateBill.ProcessingStage" class="form-control" placeholder="مرحله رسیدگی..." style="z-index: 0;" />
<span class="alert-danger" asp-validation-for="CreateBill.ProcessingStage"></span>
</div>
</div>
<div class="col-md-4">
<div class="form-group">
<label asp-for="CreateBill.Contact" class="control-label"> انتخاب مخاطب: </label>
<input id="Contact_Id" asp-for="CreateBill.Contact" class="form-control" placeholder="انتخاب مخاطب..." style="z-index: 0;" />
<span class="alert-danger" asp-validation-for="CreateBill.Contact"></span>
</div>
</div>
<div class="col-md-4">
<div class="form-group">
<label asp-for="CreateBill.SubjectBill" class="control-label"> موضوع: </label>
<input asp-for="CreateBill.SubjectBill" class="form-control" placeholder="موضوع..." />
<span class="alert-danger" asp-validation-for="CreateBill.SubjectBill"></span>
</div>
</div>
<input id="Appointed_Id" asp-for="CreateBill.Appointed" class="form-control" placeholder="انتخاب موکل..." style="z-index: 0;"/>
<span class="alert-danger" asp-validation-for="CreateBill.Appointed"></span>
</div>
</div>
<div class="col-md-4">
<div class="form-group">
<label asp-for="CreateBill.ProcessingStage" class="control-label"> مرحله رسیدگی: </label>
<input id="ProcessingStage_Id" asp-for="CreateBill.ProcessingStage" class="form-control" placeholder="مرحله رسیدگی..." style="z-index: 0;"/>
<span class="alert-danger" asp-validation-for="CreateBill.ProcessingStage"></span>
</div>
</div>
<div class="col-md-4">
<div class="form-group">
<label asp-for="CreateBill.Contact" class="control-label"> انتخاب مخاطب: </label>
<input id="Contact_Id" asp-for="CreateBill.Contact" class="form-control" placeholder="انتخاب مخاطب..." style="z-index: 0;"/>
<span class="alert-danger" asp-validation-for="CreateBill.Contact"></span>
</div>
</div>
<div class="col-md-4">
<div class="form-group">
<label asp-for="CreateBill.SubjectBill" class="control-label"> موضوع: </label>
<input asp-for="CreateBill.SubjectBill" class="form-control" placeholder="موضوع..."/>
<span class="alert-danger" asp-validation-for="CreateBill.SubjectBill"></span>
</div>
</div>
</div>
<button type="submit" class="btn btn-success btn-rounded waves-effect waves-light" style="margin-right:20px">ذخیره</button>
<a type="button" href="/Admin/Company/Bill" class="btn btn-default btn-rounded waves-effect waves-light m-b-5" data-dismiss="modal">برگشت به لیست</a>
<div class="col-md-12">
<div class="form-group">
<label asp-for="CreateBill.Description" class="control-label">متن لایحه</label>
<div>
<a id="btnPopModal" href="#showmodal=/Admin/Company/Bill/Edit?handler=Search" class="btn btn-success btn-rounded waves-effect waves-light m-b-5" style="display:none"> جستجوی درج متن &nbsp;<i class="fa fa-search" style="padding-left: 3px; font-size: 14px; color: white !important "></i> </a>
<textarea id="Description" name="CreateBill.Description" asp-for="CreateBill.Description" class="form-control textarea1"></textarea>
<span asp-validation-for="CreateBill.Description" class="text-danger"></span>
</div>
<style>
</div>
<button type="submit" class="btn btn-success btn-rounded waves-effect waves-light" style="margin-right:20px">ذخیره</button>
<a type="button" href="/Admin/Company/Bill" class="btn btn-default btn-rounded waves-effect waves-light m-b-5" data-dismiss="modal">برگشت به لیست</a>
<div class="col-md-12">
<div class="form-group">
<label asp-for="CreateBill.Description" class="control-label">متن لایحه</label>
<div>
<a id="btnPopModal" href="#showmodal=/Admin/Company/Bill/Edit?handler=Search" class="btn btn-success btn-rounded waves-effect waves-light m-b-5" style="display:none"> جستجوی درج متن &nbsp;<i class="fa fa-search" style="padding-left: 3px; font-size: 14px; color: white !important "></i> </a>
<textarea id="Description" name="CreateBill.Description" asp-for="CreateBill.Description" class="form-control textarea1"></textarea>
<span asp-validation-for="CreateBill.Description" class="text-danger"></span>
</div>
<style>
#cke_376_bottom {
display: none !important
}
</style>
</div>
</div>
</fieldset>
</div>
</div>
<br />
@*<input type="hidden" asp-for="CreateBill.Id" value="@Model.CreateBill.Id" />*@
<button type="submit" class="btn btn-success btn-rounded waves-effect waves-light">ذخیره</button>
<a type="button" href="/Admin/TextManagerViews/Bill" class="btn btn-default btn-rounded waves-effect waves-light m-b-5" data-dismiss="modal">برگشت به لیست</a>
</form>
</div>
</div>
</fieldset>
</div>
</div>
<br/>
@*<input type="hidden" asp-for="CreateBill.Id" value="@Model.CreateBill.Id" />*@
<button type="submit" class="btn btn-success btn-rounded waves-effect waves-light">ذخیره</button>
<a type="button" href="/Admin/TextManagerViews/Bill" class="btn btn-default btn-rounded waves-effect waves-light m-b-5" data-dismiss="modal">برگشت به لیست</a>
</form>
</div>
<link href="~/js/PTextManager/jquery-ui/jquery-ui.css" rel="stylesheet" />
<link href="~/js/PTextManager/jquery-ui/jquery-ui.css" rel="stylesheet"/>
<style>
.cke_button__placeholder_icon {
@@ -102,26 +102,25 @@
</style>
@section PanelScripts{
<script src="~/js/PTextManager/jquery-ui/jquery-ui.min.js"></script>
<script>
$(document).ready(function () {
$('#Appointed_Id').autocomplete({
source: '@Url.Page("Edit", "Appointed")'
});
$('#ProcessingStage_Id').autocomplete({
source: '@Url.Page("Edit", "ProcessingStage")'
});
$('#Contact_Id').autocomplete({
source: '@Url.Page("Edit", "Contact")'
});
});
</script>
<script src="~/AdminTheme/assets/js/site.js"></script>
<script src="~/js/PTextManager/ckeditor/ckeditor.js"></script>
<script src="~/js/PTextManager/ckeditor/textv01.js"></script>
<script src="~/js/PTextManager/jquery-ui/jquery-ui.min.js"></script>
<script>
$(document).ready(function() {
$('#Appointed_Id').autocomplete({
source: '@Url.Page("Edit", "Appointed")'
});
$('#ProcessingStage_Id').autocomplete({
source: '@Url.Page("Edit", "ProcessingStage")'
});
$('#Contact_Id').autocomplete({
source: '@Url.Page("Edit", "Contact")'
});
});
</script>
<script src="~/AdminTheme/assets/js/site.js"></script>
<script src="~/js/PTextManager/ckeditor/ckeditor.js"></script>
<script src="~/js/PTextManager/ckeditor/textv01.js"></script>
}
<style>
@@ -184,4 +183,4 @@
}
</style>
</style>

View File

@@ -1,160 +1,159 @@
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
using Microsoft.AspNetCore.Mvc.Rendering;
using System.Collections.Generic;
using System.Linq;
using CompanyManagment.App.Contracts.Bill;
using CompanyManagment.App.Contracts.Bill;
using CompanyManagment.App.Contracts.Contact2;
using CompanyManagment.App.Contracts.OriginalTitle;
using CompanyManagment.App.Contracts.Subtitle;
using CompanyManagment.App.Contracts.TextManager;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
using Microsoft.AspNetCore.Mvc.Rendering;
namespace ServiceHost.Areas.Admin.Pages.Company.Bill;
namespace ServiceHost.Areas.Admin.Pages.Company.Bill
public class CreateBillModel : PageModel
{
public class CreateBillModel : PageModel
{
private readonly IBillApplication _billApplication;
private readonly IContactApplication2 _contactApplication;
private readonly IOriginalTitleApplication _originalTitleApplication;
private readonly ISubtitleApplication _subtitleApplication;
private ITextManagerApplication _textManagerApplication;
public List<BillViewModel> Bills;
private readonly IBillApplication _billApplication;
private readonly IContactApplication2 _contactApplication;
private readonly ISubtitleApplication _subtitleApplication;
private readonly IOriginalTitleApplication _originalTitleApplication;
private ITextManagerApplication _textManagerApplication;
public List<BillViewModel> Bills;
public CreateBillModel(IBillApplication billApplication, ITextManagerApplication textManagerApplication, ISubtitleApplication subtitleApplication, IOriginalTitleApplication originalTitleApplication, IContactApplication2 contactApplication)
{
_subtitleApplication = subtitleApplication;
_originalTitleApplication = originalTitleApplication;
_textManagerApplication = textManagerApplication;
_billApplication = billApplication;
_contactApplication = contactApplication;
}
public CreateBillModel(IBillApplication billApplication, ITextManagerApplication textManagerApplication,
ISubtitleApplication subtitleApplication, IOriginalTitleApplication originalTitleApplication,
IContactApplication2 contactApplication)
{
_subtitleApplication = subtitleApplication;
_originalTitleApplication = originalTitleApplication;
_textManagerApplication = textManagerApplication;
_billApplication = billApplication;
_contactApplication = contactApplication;
}
[BindProperty] public CreateBill CreateBill { get; set; }
[BindProperty]
public CreateBill CreateBill { get; set; }
public void OnGet()
{
var ObjList = ListAppointed();
var ObjProcessingStage = ListProcessingStage();
public void OnGet()
{
List<Appointed> ObjList = ListAppointed();
List<ProcessingStage> ObjProcessingStage = ListProcessingStage();
var createBill = new CreateBill
{
SelectListOriginalTitle = _originalTitleApplication.GetAllOriginalTitle().ToList().Select(x => new SelectListItem { Text = x.Title, Value = x.Id.ToString() }).ToList(),
SubtitleViewModels = _subtitleApplication.GetAllSubtitle(),
};
CreateBill=createBill;
}
var createBill = new CreateBill
{
SelectListOriginalTitle = _originalTitleApplication.GetAllOriginalTitle().ToList()
.Select(x => new SelectListItem { Text = x.Title, Value = x.Id.ToString() }).ToList(),
SubtitleViewModels = _subtitleApplication.GetAllSubtitle()
};
CreateBill = createBill;
}
public IActionResult OnGetSearch()
{
var viewSearchTextManager = new ViewSearchTextManager
{
SelectListOriginalTitle = _originalTitleApplication.GetAllOriginalTitle().ToList().Select(x => new SelectListItem { Text = x.Title, Value = x.Id.ToString() }).ToList(),
SelectListSubtitle = _subtitleApplication.GetAllSubtitle().ToList().Select(x => new SelectListItem { Text = x.Subtitle, Value = x.Id.ToString() }).ToList(),
};
return Partial("./Search", viewSearchTextManager);
}
public IActionResult OnGetSearch()
{
var viewSearchTextManager = new ViewSearchTextManager
{
SelectListOriginalTitle = _originalTitleApplication.GetAllOriginalTitle().ToList()
.Select(x => new SelectListItem { Text = x.Title, Value = x.Id.ToString() }).ToList(),
SelectListSubtitle = _subtitleApplication.GetAllSubtitle().ToList()
.Select(x => new SelectListItem { Text = x.Subtitle, Value = x.Id.ToString() }).ToList()
};
public IActionResult OnPostCreate(CreateBill command)
{
var result = _billApplication.Create(command=CreateBill);
var ggg= new JsonResult(result);
return RedirectToPage("Index");
}
public IActionResult OnGetOriginalTitleViewModels(string q)
{
var query = _originalTitleApplication.GetAllOriginalTitle().Where(x=>x.Title.Contains(q)).Select(x => new SelectListItem { Text = x.Title, Value = x.Id.ToString() }).ToList();
return new JsonResult(new { items = query });
}
public IActionResult OnGetDescriptionTextManager(string term, string cid)
{
var a = HttpContext.Request.Query["originalTitle"].ToString();
// var names = _textManagerApplication.GetAllTextManager().Where(p => p.Description.Contains(term)&& p.OriginalTitle_Id== int.Parse(term1)).Select(p => p.Description).ToList();
var names = _textManagerApplication.GetAllTextManager().Where(p => p.Description.Contains(term) ).Select(p => p.Description).ToList();
return new JsonResult(names);
}
public IActionResult OnGetDescriptionTextManager1(string term, int parentId)
{
//var a = HttpContext.Request.Query["originalTitle"].ToString();
var names = _textManagerApplication.GetAllTextManager().Where(p => p.Description.Contains(term) ).Select(p => p.Description).ToList();
//var names = _textManagerApplication.GetAllTextManager().Select(p => p.Description).ToList();
return new JsonResult(names);
}
public IActionResult OnGetContact(string term)
{
var names = _contactApplication.GetAllContact().Where(p => p.NameContact.Contains(term)).Select(p => p.NameContact).ToList();
return new JsonResult(names);
}
public IActionResult OnGetAppointed(string term)
{
var names = ListAppointed().Where(p => p.Name.Contains(term)).Select(p => p.Name).ToList();
return new JsonResult(names);
}
public IActionResult OnGetProcessingStage(string term)
{
var names = ListProcessingStage().Where(p => p.Name.Contains(term)).Select(p => p.Name).ToList();
return new JsonResult(names);
}
private static List<Appointed> ListAppointed()
{
return new List<Appointed>()
{
new Appointed {Id=1,Name="موکل1" },
new Appointed {Id=2,Name="موکل2" },
new Appointed {Id=3,Name="موکل3" },
new Appointed {Id=4,Name="موکل4" },
new Appointed {Id=5,Name="موکل4" },
new Appointed {Id=6,Name="موکل5" },
new Appointed {Id=7,Name="موکل6" }
};
}
private static List<ProcessingStage> ListProcessingStage()
{
return new List<ProcessingStage>()
{
new ProcessingStage {Id=1,Name="رسیدگی1" },
new ProcessingStage {Id=2,Name="رسیدگی2" },
new ProcessingStage {Id=3,Name="رسیدگی3" },
new ProcessingStage {Id=4,Name="رسیدگی4" },
new ProcessingStage {Id=5,Name="رسیدگی4" },
new ProcessingStage {Id=6,Name="رسیدگی5" },
new ProcessingStage {Id=7,Name="رسیدگی6" }
};
}
private class Appointed
{
public int Id { get; set; }
public string Name { get; set; }
}
private class ProcessingStage
{
public int Id { get; set; }
public string Name { get; set; }
}
return Partial("./Search", viewSearchTextManager);
}
}
public IActionResult OnPostCreate(CreateBill command)
{
var result = _billApplication.Create(command = CreateBill);
var ggg = new JsonResult(result);
return RedirectToPage("Index");
}
public IActionResult OnGetOriginalTitleViewModels(string q)
{
var query = _originalTitleApplication.GetAllOriginalTitle().Where(x => x.Title.Contains(q))
.Select(x => new SelectListItem { Text = x.Title, Value = x.Id.ToString() }).ToList();
return new JsonResult(new { items = query });
}
public IActionResult OnGetDescriptionTextManager(string term, string cid)
{
var a = HttpContext.Request.Query["originalTitle"].ToString();
// var names = _textManagerApplication.GetAllTextManager().Where(p => p.Description.Contains(term)&& p.OriginalTitle_Id== int.Parse(term1)).Select(p => p.Description).ToList();
var names = _textManagerApplication.GetAllTextManager().Where(p => p.Description.Contains(term))
.Select(p => p.Description).ToList();
return new JsonResult(names);
}
public IActionResult OnGetDescriptionTextManager1(string term, int parentId)
{
//var a = HttpContext.Request.Query["originalTitle"].ToString();
var names = _textManagerApplication.GetAllTextManager().Where(p => p.Description.Contains(term))
.Select(p => p.Description).ToList();
//var names = _textManagerApplication.GetAllTextManager().Select(p => p.Description).ToList();
return new JsonResult(names);
}
public IActionResult OnGetContact(string term)
{
var names = _contactApplication.GetAllContact().Where(p => p.NameContact.Contains(term))
.Select(p => p.NameContact).ToList();
return new JsonResult(names);
}
public IActionResult OnGetAppointed(string term)
{
var names = ListAppointed().Where(p => p.Name.Contains(term)).Select(p => p.Name).ToList();
return new JsonResult(names);
}
public IActionResult OnGetProcessingStage(string term)
{
var names = ListProcessingStage().Where(p => p.Name.Contains(term)).Select(p => p.Name).ToList();
return new JsonResult(names);
}
private static List<Appointed> ListAppointed()
{
return new List<Appointed>
{
new() { Id = 1, Name = "موکل1" },
new() { Id = 2, Name = "موکل2" },
new() { Id = 3, Name = "موکل3" },
new() { Id = 4, Name = "موکل4" },
new() { Id = 5, Name = "موکل4" },
new() { Id = 6, Name = "موکل5" },
new() { Id = 7, Name = "موکل6" }
};
}
private static List<ProcessingStage> ListProcessingStage()
{
return new List<ProcessingStage>
{
new() { Id = 1, Name = "رسیدگی1" },
new() { Id = 2, Name = "رسیدگی2" },
new() { Id = 3, Name = "رسیدگی3" },
new() { Id = 4, Name = "رسیدگی4" },
new() { Id = 5, Name = "رسیدگی4" },
new() { Id = 6, Name = "رسیدگی5" },
new() { Id = 7, Name = "رسیدگی6" }
};
}
private class Appointed
{
public int Id { get; set; }
public string Name { get; set; }
}
private class ProcessingStage
{
public int Id { get; set; }
public string Name { get; set; }
}
}

View File

@@ -4,59 +4,59 @@
}
<div class="container" style="width:90%">
<div style="text-align:center">
<h3> ویرایش لایحه </h3>
</div>
<br />
<form asp-page="./Edit" asp-page-handler="Edit"
method="post">
@*<form method="post">*@
<div class="row">
<div class="row">
<fieldset style="border: 1px solid #999797; border-radius: 10px; padding: revert">
<div class="row" style="margin: 10px 10px 10px 10px ">
<br>
<div class="col-md-4">
<div class="form-group">
<label asp-for="EditBill.Appointed" class="control-label"> انتخاب موکل: </label>
<div style="text-align:center">
<h3> ویرایش لایحه </h3>
</div>
<br/>
<form asp-page="./Edit" asp-page-handler="Edit"
method="post">
@*<form method="post">*@
<div class="row">
<div class="row">
<fieldset style="border: 1px solid #999797; border-radius: 10px; padding: revert">
<div class="row" style="margin: 10px 10px 10px 10px ">
<br>
<div class="col-md-4">
<div class="form-group">
<label asp-for="EditBill.Appointed" class="control-label"> انتخاب موکل: </label>
<input id="Appointed_Id" asp-for="EditBill.Appointed" class="form-control" placeholder="انتخاب موکل..." style="z-index: 0;" />
<span class="alert-danger" asp-validation-for="EditBill.Appointed"></span>
</div>
</div>
<div class="col-md-4">
<div class="form-group">
<label asp-for="EditBill.ProcessingStage" class="control-label"> مرحله رسیدگی: </label>
<input id="ProcessingStage_Id" asp-for="EditBill.ProcessingStage" class="form-control" placeholder="مرحله رسیدگی..." style="z-index: 0;" />
<span class="alert-danger" asp-validation-for="EditBill.ProcessingStage"></span>
</div>
</div>
<div class="col-md-4">
<div class="form-group">
<label asp-for="EditBill.Contact" class="control-label"> انتخاب مخاطب: </label>
<input id="Contact_Id" asp-for="EditBill.Contact" class="form-control" placeholder="انتخاب مخاطب..." style="z-index: 0;" />
<span class="alert-danger" asp-validation-for="EditBill.Contact"></span>
</div>
</div>
<div class="col-md-4">
<div class="form-group">
<label asp-for="EditBill.SubjectBill" class="control-label"> موضوع: </label>
<input asp-for="EditBill.SubjectBill" class="form-control" placeholder="موضوع..." />
<span class="alert-danger" asp-validation-for="EditBill.SubjectBill"></span>
</div>
</div>
<input id="Appointed_Id" asp-for="EditBill.Appointed" class="form-control" placeholder="انتخاب موکل..." style="z-index: 0;"/>
<span class="alert-danger" asp-validation-for="EditBill.Appointed"></span>
</div>
</div>
<div class="col-md-4">
<div class="form-group">
<label asp-for="EditBill.ProcessingStage" class="control-label"> مرحله رسیدگی: </label>
<input id="ProcessingStage_Id" asp-for="EditBill.ProcessingStage" class="form-control" placeholder="مرحله رسیدگی..." style="z-index: 0;"/>
<span class="alert-danger" asp-validation-for="EditBill.ProcessingStage"></span>
</div>
</div>
<div class="col-md-4">
<div class="form-group">
<label asp-for="EditBill.Contact" class="control-label"> انتخاب مخاطب: </label>
<input id="Contact_Id" asp-for="EditBill.Contact" class="form-control" placeholder="انتخاب مخاطب..." style="z-index: 0;"/>
<span class="alert-danger" asp-validation-for="EditBill.Contact"></span>
</div>
</div>
<div class="col-md-4">
<div class="form-group">
<label asp-for="EditBill.SubjectBill" class="control-label"> موضوع: </label>
<input asp-for="EditBill.SubjectBill" class="form-control" placeholder="موضوع..."/>
<span class="alert-danger" asp-validation-for="EditBill.SubjectBill"></span>
</div>
</div>
</div>
<button type="submit" class="btn btn-success btn-rounded waves-effect waves-light" style="margin-right:20px">ذخیره</button>
<a type="button" href="/Admin/Company/Bill" class="btn btn-default btn-rounded waves-effect waves-light m-b-5" data-dismiss="modal">برگشت به لیست</a>
<div class="col-md-12">
<div class="form-group">
<div>
<a id="btnPopModal" href="#showmodal=/Admin/Company/Bill/Edit?handler=Search" class="btn btn-success btn-rounded waves-effect waves-light m-b-5" style="display:none"> جستجوی درج متن &nbsp;<i class="fa fa-search" style="padding-left: 3px; font-size: 14px; color: white !important "></i> </a>
<textarea id="Description" name="EditBill.Description" asp-for="EditBill.Description" class="form-control textarea1"></textarea>
<span asp-validation-for="EditBill.Description" class="text-danger"></span>
</div>
<style>
</div>
<button type="submit" class="btn btn-success btn-rounded waves-effect waves-light" style="margin-right:20px">ذخیره</button>
<a type="button" href="/Admin/Company/Bill" class="btn btn-default btn-rounded waves-effect waves-light m-b-5" data-dismiss="modal">برگشت به لیست</a>
<div class="col-md-12">
<div class="form-group">
<div>
<a id="btnPopModal" href="#showmodal=/Admin/Company/Bill/Edit?handler=Search" class="btn btn-success btn-rounded waves-effect waves-light m-b-5" style="display:none"> جستجوی درج متن &nbsp;<i class="fa fa-search" style="padding-left: 3px; font-size: 14px; color: white !important "></i> </a>
<textarea id="Description" name="EditBill.Description" asp-for="EditBill.Description" class="form-control textarea1"></textarea>
<span asp-validation-for="EditBill.Description" class="text-danger"></span>
</div>
<style>
#cke_376_bottom {
display: none !important
}
@@ -65,18 +65,18 @@
}
</style>
</div>
</div>
</fieldset>
</div>
</div>
<br />
<input type="hidden" asp-for="EditBill.Id" value="@Model.EditBill.Id" />
<button type="submit" class="btn btn-success btn-rounded waves-effect waves-light">ذخیره</button>
<a type="button" href="/Admin/Company/Bill" class="btn btn-default btn-rounded waves-effect waves-light m-b-5" data-dismiss="modal">برگشت به لیست</a>
</form>
</div>
</div>
</fieldset>
</div>
</div>
<br/>
<input type="hidden" asp-for="EditBill.Id" value="@Model.EditBill.Id"/>
<button type="submit" class="btn btn-success btn-rounded waves-effect waves-light">ذخیره</button>
<a type="button" href="/Admin/Company/Bill" class="btn btn-default btn-rounded waves-effect waves-light m-b-5" data-dismiss="modal">برگشت به لیست</a>
</form>
</div>
<link href="~/js/PTextManager/jquery-ui/jquery-ui.css" rel="stylesheet" />
<link href="~/js/PTextManager/jquery-ui/jquery-ui.css" rel="stylesheet"/>
<style>
.cke_button__placeholder_icon {
background-position: 0 0px;
@@ -107,32 +107,24 @@
</style>
@section PanelScripts{
<script src="~/js/PTextManager/jquery-ui/jquery-ui.min.js"></script>
<script>
$(document).ready(function () {
$('#Appointed_Id').autocomplete({
source: '@Url.Page("Edit", "Appointed")'
});
$('#ProcessingStage_Id').autocomplete({
source: '@Url.Page("Edit", "ProcessingStage")'
});
$('#Contact_Id').autocomplete({
source: '@Url.Page("Edit", "Contact")'
});
});
</script>
<script src="~/AdminTheme/assets/js/site.js"></script>
<script src="~/js/PTextManager/ckeditor/ckeditor.js"></script>
<script src="~/js/PTextManager/ckeditor/textv01.js"></script>
<script src="~/js/PTextManager/jquery-ui/jquery-ui.min.js"></script>
<script>
$(document).ready(function() {
$('#Appointed_Id').autocomplete({
source: '@Url.Page("Edit", "Appointed")'
});
$('#ProcessingStage_Id').autocomplete({
source: '@Url.Page("Edit", "ProcessingStage")'
});
$('#Contact_Id').autocomplete({
source: '@Url.Page("Edit", "Contact")'
});
});
</script>
<script src="~/AdminTheme/assets/js/site.js"></script>
<script src="~/js/PTextManager/ckeditor/ckeditor.js"></script>
<script src="~/js/PTextManager/ckeditor/textv01.js"></script>
}
@@ -194,4 +186,4 @@
overflow-y: scroll;
background: #cbdacf;
}
</style>
</style>

View File

@@ -1,7 +1,4 @@
using System.Collections.Generic;
using System.Linq;
using CompanyManagment.App.Contracts.Bill;
using CompanyManagment.App.Contracts.Bill;
using CompanyManagment.App.Contracts.Contact2;
using CompanyManagment.App.Contracts.OriginalTitle;
using CompanyManagment.App.Contracts.Subtitle;
@@ -10,136 +7,151 @@ using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
using Microsoft.AspNetCore.Mvc.Rendering;
namespace ServiceHost.Areas.Admin.Pages.Company.Bill;
namespace ServiceHost.Areas.Admin.Pages.Company.Bill
public class EditModel : PageModel
{
public class EditModel : PageModel
{
public List<BillViewModel> Bills;
private readonly IBillApplication _billApplication;
private readonly IContactApplication2 _contactApplication;
private readonly ISubtitleApplication _subtitleApplication;
private readonly IOriginalTitleApplication _originalTitleApplication;
private ITextManagerApplication _textManagerApplication;
private readonly IBillApplication _billApplication;
private readonly IContactApplication2 _contactApplication;
private readonly IOriginalTitleApplication _originalTitleApplication;
private readonly ISubtitleApplication _subtitleApplication;
private ITextManagerApplication _textManagerApplication;
public List<BillViewModel> Bills;
public EditModel(IBillApplication billApplication, ITextManagerApplication textManagerApplication, ISubtitleApplication subtitleApplication, IOriginalTitleApplication originalTitleApplication, IContactApplication2 contactApplication)
{
_subtitleApplication = subtitleApplication;
_originalTitleApplication = originalTitleApplication;
_textManagerApplication = textManagerApplication;
_billApplication = billApplication;
_contactApplication = contactApplication;
}
[BindProperty]
public EditBill EditBill { get; set; }
public EditModel(IBillApplication billApplication, ITextManagerApplication textManagerApplication,
ISubtitleApplication subtitleApplication, IOriginalTitleApplication originalTitleApplication,
IContactApplication2 contactApplication)
{
_subtitleApplication = subtitleApplication;
_originalTitleApplication = originalTitleApplication;
_textManagerApplication = textManagerApplication;
_billApplication = billApplication;
_contactApplication = contactApplication;
}
public void OnGet(long id)
{
List<Appointed> ObjList = ListAppointed();
List<ProcessingStage> ObjProcessingStage = ListProcessingStage();
var bill = _billApplication.GetDetails(id);
var billEdit = new EditBill
{
Id = id,
SubjectBill = bill.SubjectBill,
Description = bill.Description,
Status = bill.Status,
Appointed = bill.Appointed,
Contact = bill.Contact,
ProcessingStage = bill.ProcessingStage,
};
EditBill = billEdit;
}
//public JsonResult OnPostEdit(EditBill command)
//{
// var result = _billApplication.Edit(command);
// return new JsonResult(result);
//}
public IActionResult OnGetSearch()
{
var viewSearchTextManager = new ViewSearchTextManager
{
SelectListOriginalTitle = _originalTitleApplication.GetAllOriginalTitle().ToList().Select(x => new SelectListItem { Text = x.Title, Value = x.Id.ToString() }).ToList(),
SelectListSubtitle = _subtitleApplication.GetAllSubtitle().ToList().Select(x => new SelectListItem { Text = x.Subtitle, Value = x.Id.ToString() }).ToList(),
};
return Partial("./Search", viewSearchTextManager);
}
public IActionResult OnPostEdit(EditBill command)
{
var result = _billApplication.Edit(command = EditBill);
var ggg = new JsonResult(result);
return RedirectToPage("Index");
}
public IActionResult OnGetOriginalTitleViewModels(string q)
{
var query = _originalTitleApplication.GetAllOriginalTitle().Where(x => x.Title.Contains(q)).Select(x => new SelectListItem { Text = x.Title, Value = x.Id.ToString() }).ToList();
[BindProperty] public EditBill EditBill { get; set; }
return new JsonResult(new { items = query });
}
public IActionResult OnGetDescriptionTextManager(string term, string cid)
{
var a = HttpContext.Request.Query["originalTitle"].ToString();
var names = _textManagerApplication.GetAllTextManager().Where(p => p.Description.Contains(term)).Select(p => p.Description).ToList();
return new JsonResult(names);
}
public IActionResult OnGetDescriptionTextManager1(string term, int parentId)
{
var names = _textManagerApplication.GetAllTextManager().Where(p => p.Description.Contains(term)).Select(p => p.Description).ToList();
return new JsonResult(names);
}
public IActionResult OnGetContact(string term)
{
var names = _contactApplication.GetAllContact().Where(p => p.NameContact.Contains(term)).Select(p => p.NameContact).ToList();
return new JsonResult(names);
}
public IActionResult OnGetAppointed(string term)
{
var names = ListAppointed().Where(p => p.Name.Contains(term)).Select(p => p.Name).ToList();
return new JsonResult(names);
}
public IActionResult OnGetProcessingStage(string term)
{
var names = ListProcessingStage().Where(p => p.Name.Contains(term)).Select(p => p.Name).ToList();
return new JsonResult(names);
}
private static List<Appointed> ListAppointed()
{
return new List<Appointed>()
{
new Appointed {Id=1,Name="موکل1" },
new Appointed {Id=2,Name="موکل2" },
new Appointed {Id=3,Name="موکل3" },
new Appointed {Id=4,Name="موکل4" },
new Appointed {Id=5,Name="موکل4" },
new Appointed {Id=6,Name="موکل5" },
new Appointed {Id=7,Name="موکل6" }
};
}
private static List<ProcessingStage> ListProcessingStage()
{
return new List<ProcessingStage>()
{
new ProcessingStage {Id=1,Name="رسیدگی1" },
new ProcessingStage {Id=2,Name="رسیدگی2" },
new ProcessingStage {Id=3,Name="رسیدگی3" },
new ProcessingStage {Id=4,Name="رسیدگی4" },
new ProcessingStage {Id=5,Name="رسیدگی4" },
new ProcessingStage {Id=6,Name="رسیدگی5" },
new ProcessingStage {Id=7,Name="رسیدگی6" }
};
}
private class Appointed
{
public int Id { get; set; }
public string Name { get; set; }
public void OnGet(long id)
{
var ObjList = ListAppointed();
var ObjProcessingStage = ListProcessingStage();
var bill = _billApplication.GetDetails(id);
var billEdit = new EditBill
{
Id = id,
SubjectBill = bill.SubjectBill,
Description = bill.Description,
Status = bill.Status,
Appointed = bill.Appointed,
Contact = bill.Contact,
ProcessingStage = bill.ProcessingStage
};
EditBill = billEdit;
}
}
private class ProcessingStage
{
public int Id { get; set; }
public string Name { get; set; }
}
//public JsonResult OnPostEdit(EditBill command)
//{
// var result = _billApplication.Edit(command);
// return new JsonResult(result);
//}
public IActionResult OnGetSearch()
{
var viewSearchTextManager = new ViewSearchTextManager
{
SelectListOriginalTitle = _originalTitleApplication.GetAllOriginalTitle().ToList()
.Select(x => new SelectListItem { Text = x.Title, Value = x.Id.ToString() }).ToList(),
SelectListSubtitle = _subtitleApplication.GetAllSubtitle().ToList()
.Select(x => new SelectListItem { Text = x.Subtitle, Value = x.Id.ToString() }).ToList()
};
return Partial("./Search", viewSearchTextManager);
}
}
}
public IActionResult OnPostEdit(EditBill command)
{
var result = _billApplication.Edit(command = EditBill);
var ggg = new JsonResult(result);
return RedirectToPage("Index");
}
public IActionResult OnGetOriginalTitleViewModels(string q)
{
var query = _originalTitleApplication.GetAllOriginalTitle().Where(x => x.Title.Contains(q))
.Select(x => new SelectListItem { Text = x.Title, Value = x.Id.ToString() }).ToList();
return new JsonResult(new { items = query });
}
public IActionResult OnGetDescriptionTextManager(string term, string cid)
{
var a = HttpContext.Request.Query["originalTitle"].ToString();
var names = _textManagerApplication.GetAllTextManager().Where(p => p.Description.Contains(term))
.Select(p => p.Description).ToList();
return new JsonResult(names);
}
public IActionResult OnGetDescriptionTextManager1(string term, int parentId)
{
var names = _textManagerApplication.GetAllTextManager().Where(p => p.Description.Contains(term))
.Select(p => p.Description).ToList();
return new JsonResult(names);
}
public IActionResult OnGetContact(string term)
{
var names = _contactApplication.GetAllContact().Where(p => p.NameContact.Contains(term))
.Select(p => p.NameContact).ToList();
return new JsonResult(names);
}
public IActionResult OnGetAppointed(string term)
{
var names = ListAppointed().Where(p => p.Name.Contains(term)).Select(p => p.Name).ToList();
return new JsonResult(names);
}
public IActionResult OnGetProcessingStage(string term)
{
var names = ListProcessingStage().Where(p => p.Name.Contains(term)).Select(p => p.Name).ToList();
return new JsonResult(names);
}
private static List<Appointed> ListAppointed()
{
return new List<Appointed>
{
new() { Id = 1, Name = "موکل1" },
new() { Id = 2, Name = "موکل2" },
new() { Id = 3, Name = "موکل3" },
new() { Id = 4, Name = "موکل4" },
new() { Id = 5, Name = "موکل4" },
new() { Id = 6, Name = "موکل5" },
new() { Id = 7, Name = "موکل6" }
};
}
private static List<ProcessingStage> ListProcessingStage()
{
return new List<ProcessingStage>
{
new() { Id = 1, Name = "رسیدگی1" },
new() { Id = 2, Name = "رسیدگی2" },
new() { Id = 3, Name = "رسیدگی3" },
new() { Id = 4, Name = "رسیدگی4" },
new() { Id = 5, Name = "رسیدگی4" },
new() { Id = 6, Name = "رسیدگی5" },
new() { Id = 7, Name = "رسیدگی6" }
};
}
private class Appointed
{
public int Id { get; set; }
public string Name { get; set; }
}
private class ProcessingStage
{
public int Id { get; set; }
public string Name { get; set; }
}
}

View File

@@ -1,15 +1,15 @@
@page
@using Microsoft.AspNetCore.Http.Extensions
@model ServiceHost.Areas.Admin.Pages.Company.Bill.IndexModel
@using Microsoft.AspNetCore.Http.Extensions;
@{
string url = HttpContext.Request.GetEncodedUrl();
int i = 1;
var url = HttpContext.Request.GetEncodedUrl();
var i = 1;
}
@{
//Layout = "~/Pages/Shared/_Layout.cshtml";
Layout = "Shared/_AdminLayout";
ViewData["title"] = "مدیریت لایحه";
<style>
//Layout = "~/Pages/Shared/_Layout.cshtml";
Layout = "Shared/_AdminLayout";
ViewData["title"] = "مدیریت لایحه";
<style>
.sizeSet {
padding: 2px !important;
text-align: center !important;
@@ -197,296 +197,301 @@
}
<div class="row">
<div class="row">
<div class="col-sm-12 m-r-10">
<p class="pull-right">
<a id="btnPopModal" asp-page="/Company/Bill/CreateBill" 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: 9px; color: #0f9500 !important "></i> ایجاد لایحه جدید </a>
</p>
<input type="hidden" id="sercheCheck" value="@Model.BillSearch" />
</div>
</div>
<div class="row">
<div class="col-sm-12 m-r-10">
<p class="pull-right">
<a id="btnPopModal" asp-page="/Company/Bill/CreateBill" 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: 9px; color: #0f9500 !important "></i> ایجاد لایحه جدید </a>
</p>
<input type="hidden" id="sercheCheck" value="@Model.BillSearch"/>
</div>
</div>
<div class="col-sm-12">
<div class="panel-group panel-group-joined" id="accordion-test">
<div class="panel panel-default" style="border-radius: 15px !important; background-color: #fdc0c0; ">
<div class="panel-heading" style="background-color: #950000 !important">
<h4 class="panel-title" style="color: #edebeb !important; display: inline;">
<a data-toggle="collapse" data-parent="#accordion-test" href="#collapseOne" class="collapsed" style="display: inline;">
جستجوی لایحه
</a>
</h4>
</div>
<div id="collapseOne" class="panel-collapse collapse in ">
<div class="panel-body" style="padding-top: 15px; padding-bottom: 15px;">
<div class="row">
<div class="col-sm-12">
<form class="form-inline" role="form" method="get" name="search-theme-form" id="search-theme-form" autocomplete="off">
<div class="col-sm-12">
<div class="panel-group panel-group-joined" id="accordion-test">
<div class="panel panel-default" style="border-radius: 15px !important; background-color: #fdc0c0; ">
<div class="panel-heading" style="background-color: #950000 !important">
<h4 class="panel-title" style="color: #edebeb !important; display: inline;">
<a data-toggle="collapse" data-parent="#accordion-test" href="#collapseOne" class="collapsed" style="display: inline;">
جستجوی لایحه
</a>
</h4>
</div>
<div id="collapseOne" class="panel-collapse collapse in ">
<div class="panel-body" style="padding-top: 15px; padding-bottom: 15px;">
<div class="row">
<div class="col-sm-12">
<form class="form-inline" role="form" method="get" name="search-theme-form" id="search-theme-form" autocomplete="off">
<div class="form-group col-sm-12">
<div class="row">
<div class="col-sm-3 pull-right">
<input id="Appointed_Id" asp-for="searchModel.Appointed" class=" form-control inpt" placeholder="انتخاب موکل" style="width: 100%">
</div>
<div class="col-sm-3 pull-right">
<input id="ProcessingStage_Id" asp-for="searchModel.ProcessingStage" placeholder="مرحله رسیدگی" class=" form-control inpt" style="width: 100%">
</div>
<div class="col-sm-3 pull-right">
<input id="Contact_Id" asp-for="searchModel.Contact" placeholder="انتخاب مخاطب" class=" form-control inpt" style="width: 100%">
</div>
<div class="col-sm-3 pull-right">
<input asp-for="searchModel.SubjectBill" placeholder="موضوع" class=" form-control inpt" style="width: 100%">
</div>
</div>
<hr style=" margin-top: 12px;margin-bottom: 12px;" />
<div class="row" style="margin-top: 15px">
<div class="col-lg-9">
<label class="sr-only" asp-for="searchModel.IsActiveString"></label>
<select id="activing" class="form-control activer" asp-for="searchModel.IsActiveString" style="background-color: #dddddd; border-radius: 25px; border: 1px solid #bfbfbf;">
<option value="true"> فعال </option>
<option value="false"> غیرفعال</option>
<option value="both"> هردو</option>
</select>
</div>
<div class="col-lg-3">
<button type="submit" class="btn btn-success btn-rounded waves-effect waves-light m-b-5 search" style="border-bottom-left-radius: 0px; border-top-left-radius: 0px; background-color: #950000; border-color: #950000; font-family: 'Web_Yekan' !important; margin-left: -3px "> <i class="fa fa-search" style="padding-left: 3px; font-size: 10px;"></i> جستجو</button>
<a class="btn btn-info btn-rounded waves-effect waves-light m-b-5" style="border-bottom-right-radius: 0px; border-top-right-radius: 0px; background-color: #545353; border-color: #545353; font-family: 'Web_Yekan' !important;" asp-page="./Index">مشاهده همه</a>
</div>
<div class="form-group col-sm-12">
<div class="row">
<div class="col-sm-3 pull-right">
<input id="Appointed_Id" asp-for="searchModel.Appointed" class=" form-control inpt" placeholder="انتخاب موکل" style="width: 100%">
</div>
<div class="col-sm-3 pull-right">
<input id="ProcessingStage_Id" asp-for="searchModel.ProcessingStage" placeholder="مرحله رسیدگی" class=" form-control inpt" style="width: 100%">
</div>
<div class="col-sm-3 pull-right">
<input id="Contact_Id" asp-for="searchModel.Contact" placeholder="انتخاب مخاطب" class=" form-control inpt" style="width: 100%">
</div>
<div class="col-sm-3 pull-right">
<input asp-for="searchModel.SubjectBill" placeholder="موضوع" class=" form-control inpt" style="width: 100%">
</div>
</div>
<hr style=" margin-top: 12px;margin-bottom: 12px;"/>
<div class="row" style="margin-top: 15px">
<div class="col-lg-9">
<label class="sr-only" asp-for="searchModel.IsActiveString"></label>
<select id="activing" class="form-control activer" asp-for="searchModel.IsActiveString" style="background-color: #dddddd; border-radius: 25px; border: 1px solid #bfbfbf;">
<option value="true"> فعال </option>
<option value="false"> غیرفعال</option>
<option value="both"> هردو</option>
</select>
</div>
<div class="col-lg-3">
<button type="submit" class="btn btn-success btn-rounded waves-effect waves-light m-b-5 search" style="border-bottom-left-radius: 0px; border-top-left-radius: 0px; background-color: #950000; border-color: #950000; font-family: 'Web_Yekan' !important; margin-left: -3px "> <i class="fa fa-search" style="padding-left: 3px; font-size: 10px;"></i> جستجو</button>
<a class="btn btn-info btn-rounded waves-effect waves-light m-b-5" style="border-bottom-right-radius: 0px; border-top-right-radius: 0px; background-color: #545353; border-color: #545353; font-family: 'Web_Yekan' !important;" asp-page="./Index">مشاهده همه</a>
</div>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
</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" style="padding-left: 3px; font-size: 9px"></i> لیست لایحه</h3>
</div>
<div class="panel-body">
<table id="datatable" class="table table-striped table-bordered" width="100%">
<thead>
<tr>
<th style="font-size: 10px !important; display: none" class="sizeSet">
<span class="tooltip-container">
<input class="checkboxtitle" type="checkbox" id="checkSelect" onclick="selectori(this)" checked="checked" />
</span>
</th>
<th style="font-size: 10px !important; ">#</th>
<th style="font-size: 10px !important; width: 15% !important ; text-align:center">انتخاب موکل</th>
<th style="font-size: 10px !important; width: 15% !important ; text-align:center"> مرحله رسیدگی </th>
<th style="font-size: 10px !important; width: 15% !important; text-align:center">انتخاب مخاطب </th>
<th style="font-size: 10px !important; width: 45% !important; text-align:center">موضوع </th>
<th style="font-size: 10px !important; width: 10%">
<span style="float: right;">
<span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span>
</span>
<span class="act">
</span>
<a class="btn btn-danger pull-right m-rl-5 rad deact" onclick="deactiveAll()">
<i class="fa faSize fa-trash"></i>
</a>
</th>
</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" style="padding-left: 3px; font-size: 9px"></i> لیست لایحه</h3>
</div>
<div class="panel-body">
<table id="datatable" class="table table-striped table-bordered" width="100%">
<thead>
<tr>
<th style="font-size: 10px !important; display: none" class="sizeSet">
<span class="tooltip-container">
<input class="checkboxtitle" type="checkbox" id="checkSelect" onclick="selectori(this)" checked="checked"/>
</span>
</th>
<th style="font-size: 10px !important; ">#</th>
<th style="font-size: 10px !important; width: 15% !important ; text-align:center">انتخاب موکل</th>
<th style="font-size: 10px !important; width: 15% !important ; text-align:center"> مرحله رسیدگی </th>
<th style="font-size: 10px !important; width: 15% !important; text-align:center">انتخاب مخاطب </th>
<th style="font-size: 10px !important; width: 45% !important; text-align:center">موضوع </th>
<th style="font-size: 10px !important; width: 10%">
<span style="float: right;">
<span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span>
</span>
<span class="act">
</span>
<a class="btn btn-danger pull-right m-rl-5 rad deact" onclick="deactiveAll()">
<i class="fa faSize fa-trash"></i>
</a>
</th>
</tr>
</thead>
<tbody>
@foreach (var item in Model.Bills)
{
<tr>
<td style="font-size: 12px !important; text-align: center;display:none">
<input type="checkbox" name="foo" value="@item.Id" checked="checked" />
</td>
<td style="font-size: 12px !important; text-align: right">@i </td>
<td style="font-size: 12px !important; text-align: right">@item.Appointed&nbsp; </td>
<td style="font-size: 12px !important; text-align: right">@item.ProcessingStage </td>
<td style="font-size: 12px !important; text-align: right">@item.Contact </td>
<td style="font-size: 12px !important; text-align: right">@item.SubjectBill</td>
@{
i++;
}
</tr>
</thead>
<tbody>
@foreach (var item in Model.Bills)
{
<tr>
<td style="font-size: 12px !important; text-align: center;display:none">
<input type="checkbox" name="foo" value="@item.Id" checked="checked"/>
</td>
<td style="font-size: 12px !important; text-align: right">@i </td>
<td style="font-size: 12px !important; text-align: right">@item.Appointed&nbsp; </td>
<td style="font-size: 12px !important; text-align: right">@item.ProcessingStage </td>
<td style="font-size: 12px !important; text-align: right">@item.Contact </td>
<td style="font-size: 12px !important; text-align: right">@item.SubjectBill</td>
@{
i++;
}
<td>
<a permission="20114" class="btn btn-warning pull-right m-rl-5 rad"
asp-page="./Edit" asp-route-id="@item.Id">
<i class="fa faSize fa-edit"></i>
</a>
<td>
<a permission="20114" class="btn btn-warning pull-right m-rl-5 rad"
asp-page="./Edit" asp-route-id="@item.Id">
<i class="fa faSize fa-edit"></i>
</a>
@if (item.IsActiveString == "true")
{
<a permission="20116" id="googleLink" class="btn btn-danger pull-right m-rl-5 fff rad" onclick="DeActive('/Admin/Company/Bill?id=@item.Id&amp;url=@url&amp;handler=DeActive')"><i class="fa faSize fa-trash"></i></a>
}
else
{
<a permission="20116" onclick="IsActive('/Admin/Company/Bill?id=@item.Id&amp;url=@url&amp;handler=IsActive')" class="btn btn-success pull-right m-rl-5 rad"><i class="fa faSize fa-rotate-left"></i> </a>
}
@if (item.IsActiveString == "true")
{
<a permission="20116" id="googleLink" class="btn btn-danger pull-right m-rl-5 fff rad" onclick="DeActive('/Admin/Company/Bill?id=@item.Id&amp;url=@url&amp;handler=DeActive')">
<i class="fa faSize fa-trash"></i>
</a>
}
else
{
<a permission="20116" onclick="IsActive('/Admin/Company/Bill?id=@item.Id&amp;url=@url&amp;handler=IsActive')" class="btn btn-success pull-right m-rl-5 rad">
<i class="fa faSize fa-rotate-left"></i>
</a>
}
</td>
</td>
</tr>
}
</tbody>
</table>
</div>
</div>
</div>
</tr>
}
</tbody>
</table>
</div>
</div>
</div>
</div>
<link href="~/js/PTextManager/jquery-ui/jquery-ui.css" rel="stylesheet" />
<link href="~/js/PTextManager/jquery-ui/jquery-ui.css" rel="stylesheet"/>
@section PanelScripts{
<script src="~/AdminTheme/assets/js/site.js"></script>
<script src="~/adminTheme/assets/datatables/jquery.dataTables.min.js"></script>
<script src="~/adminTheme/assets/datatables/dataTables.bootstrap.js"></script>
<script src="~/js/PTextManager/jquery-ui/jquery-ui.min.js"></script>
<script>
$(document).ready(function () {
$('#Appointed_Id').autocomplete({
source: '@Url.Page("CreateBill", "Appointed")'
});
$('#ProcessingStage_Id').autocomplete({
source: '@Url.Page("CreateBill", "ProcessingStage")'
});
$('#Contact_Id').autocomplete({
source: '@Url.Page("CreateBill", "Contact")'
});
<script src="~/AdminTheme/assets/js/site.js"></script>
<script src="~/adminTheme/assets/datatables/jquery.dataTables.min.js"></script>
<script src="~/adminTheme/assets/datatables/dataTables.bootstrap.js"></script>
<script src="~/js/PTextManager/jquery-ui/jquery-ui.min.js"></script>
<script>
$(document).ready(function() {
$('#Appointed_Id').autocomplete({
source: '@Url.Page("CreateBill", "Appointed")'
});
$('#ProcessingStage_Id').autocomplete({
source: '@Url.Page("CreateBill", "ProcessingStage")'
});
$('#Contact_Id').autocomplete({
source: '@Url.Page("CreateBill", "Contact")'
});
});
</script>
<script>
$(document).ready(function () {
$(function () {
$('#search').on('keyup', function () {
var pattern = $(this).val();
$('.searchable-container .items').hide();
$('.searchable-container .items').filter(function () {
});
</script>
<script>
$(document).ready(function() {
$(function() {
$('#search').on('keyup',
function() {
var pattern = $(this).val();
$('.searchable-container .items').hide();
$('.searchable-container .items').filter(function() {
/* $('#hhh').val() = $(this).text().match(new RegExp(pattern, 'i'));*/
return $(this).text().match(new RegExp(pattern, 'i'));
}).show();
});
});
$('#datatable').dataTable(
{
//"scrollY": 400,
/* "scrollX": true,*/
"lengthMenu": [[10, 25, 50, 100, -1], [10, 25, 50, 100, "All"]]
});
$('#datatable2').dataTable(
{
"lengthMenu": [[10, 25, 50, 100, -1], [10, 25, 50, 100, "All"]]
});
/* $('#hhh').val() = $(this).text().match(new RegExp(pattern, 'i'));*/
return $(this).text().match(new RegExp(pattern, 'i'));
}).show();
});
});
$('#datatable').dataTable(
{
//"scrollY": 400,
/* "scrollX": true,*/
"lengthMenu": [[10, 25, 50, 100, -1], [10, 25, 50, 100, "All"]]
});
$('#datatable2').dataTable(
{
"lengthMenu": [[10, 25, 50, 100, -1], [10, 25, 50, 100, "All"]]
});
});
</script>
<script>
$('.activer').on('change',
function (e) {
e.preventDefault();
$('.search').click();
});
</script>
<script>
});
</script>
<script>
$('.activer').on('change',
function(e) {
e.preventDefault();
$('.search').click();
});
</script>
<script>
if (document.getElementById("activing").selectedIndex == 1) {
$('.deact').remove();
$('.act').append(
' <a class="btn btn-success pull-right m-rl-5 rad react" onclick="reActiveAll()">' + '<i class="fa faSize fa-rotate-left"></i>' + ' </a>'
);
}
if (document.getElementById("activing").selectedIndex == 2) {
$('.deact').remove();
}
if (document.getElementById("activing").selectedIndex == 1) {
$('.deact').remove();
$('.act').append(
' <a class="btn btn-success pull-right m-rl-5 rad react" onclick="reActiveAll()">' + '<i class="fa faSize fa-rotate-left"></i>' + ' </a>'
);
}
if (document.getElementById("activing").selectedIndex == 2) {
$('.deact').remove();
}
</script>
<script>
function reActiveAll() {
</script>
<script>
function reActiveAll() {
if (document.getElementById("checkSelect").checked == false) {
$.Notification.autoHideNotify('error', 'top center', 'پیام سیستم ', " هیچ لایحهی انتخاب نشده است ");
} else {
if (document.getElementById("sercheCheck").value == "false") {
$.Notification.autoHideNotify('error', 'top center', 'پیام سیستم ', " لطفا در قسمت جستجوی لوایح موکل را انتخاب نموده و سپس جستجو را کلیک کنید ");
} else if (document.getElementById("sercheCheck").value == "true") {
swal({
title: "آیا فعال نمودن این لایحه ها اطمینان دارید؟",
text: "",
type: "warning",
showCancelButton: true,
confirmButtonColor: "#DD6B55",
confirmButtonText: "بله",
cancelButtonText: "خیر",
closeOnConfirm: false
}, function (isConfirm) {
if (isConfirm) {
checkboxes2 = document.getElementsByName('foo');
var url3b = '';
for (var i2 = 0, n2 = checkboxes2.length; i2 < n2; i2++) {
if (checkboxes2[i2].checked == true) {
var u2 = '&ids=' + checkboxes2[i2].value;
console.log(u2);
url3b = url3b + u2;
console.log(url3b);
}
}
var url2b = '@Url.Page("/Company/Bill/Index", "GroupReActive")';
console.log(url2b);
window.location.href = url2b + url3b;
}
});
}
}
}
</script>
<script>
function deactiveAll() {
if (document.getElementById("checkSelect").checked == false) {
$.Notification.autoHideNotify('error', 'top center', 'پیام سیستم ', " هیچ لایحهی انتخاب نشده است ");
} else {
if (document.getElementById("sercheCheck").value == "false") {
$.Notification.autoHideNotify('error', 'top center', 'پیام سیستم ', " لطفا در قسمت جستجوی لوایح موکل را انتخاب نموده و سپس جستجو را کلیک کنید ");
} else if (document.getElementById("sercheCheck").value == "true") {
swal({
title: "آیا فعال نمودن این لایحه ها اطمینان دارید؟",
text: "",
type: "warning",
showCancelButton: true,
confirmButtonColor: "#DD6B55",
confirmButtonText: "بله",
cancelButtonText: "خیر",
closeOnConfirm: false
},
function(isConfirm) {
if (isConfirm) {
checkboxes2 = document.getElementsByName('foo');
let url3b = '';
for (var i2 = 0, n2 = checkboxes2.length; i2 < n2; i2++) {
if (checkboxes2[i2].checked == true) {
const u2 = `&ids=${checkboxes2[i2].value}`;
console.log(u2);
url3b = url3b + u2;
console.log(url3b);
}
}
const url2b = '@Url.Page("/Company/Bill/Index", "GroupReActive")';
console.log(url2b);
window.location.href = url2b + url3b;
}
});
}
}
}
</script>
<script>
function deactiveAll() {
if (document.getElementById("checkSelect").checked == false) {
$.Notification.autoHideNotify('error', 'top center', 'پیام سیستم ', " هیچ لایحهی انتخاب نشده است ");
} else {
if (document.getElementById("sercheCheck").value == "true") {
swal({
title: "آیا حذف این لایحه ها اطمینان دارید؟",
text: "",
type: "warning",
showCancelButton: true,
confirmButtonColor: "#DD6B55",
confirmButtonText: "بله",
cancelButtonText: "خیر",
closeOnConfirm: false
}, function (isConfirm) {
if (isConfirm) {
checkboxes2 = document.getElementsByName('foo');
var url3b = '';
for (var i2 = 0, n2 = checkboxes2.length; i2 < n2; i2++) {
if (checkboxes2[i2].checked == true) {
var u2 = '&ids=' + checkboxes2[i2].value;
console.log(u2);
url3b = url3b + u2;
console.log(url3b);
}
}
var url2b = '@Url.Page("/Company/Bill/Index", "GroupDeActive")';
window.location.href = url2b + url3b;
console.log(url2b);
}
});
if (document.getElementById("checkSelect").checked == false) {
$.Notification.autoHideNotify('error', 'top center', 'پیام سیستم ', " هیچ لایحهی انتخاب نشده است ");
} else {
if (document.getElementById("sercheCheck").value == "true") {
swal({
title: "آیا حذف این لایحه ها اطمینان دارید؟",
text: "",
type: "warning",
showCancelButton: true,
confirmButtonColor: "#DD6B55",
confirmButtonText: "بله",
cancelButtonText: "خیر",
closeOnConfirm: false
},
function(isConfirm) {
if (isConfirm) {
checkboxes2 = document.getElementsByName('foo');
let url3b = '';
for (var i2 = 0, n2 = checkboxes2.length; i2 < n2; i2++) {
if (checkboxes2[i2].checked == true) {
const u2 = `&ids=${checkboxes2[i2].value}`;
console.log(u2);
url3b = url3b + u2;
console.log(url3b);
}
}
const url2b = '@Url.Page("/Company/Bill/Index", "GroupDeActive")';
window.location.href = url2b + url3b;
console.log(url2b);
}
});
} else if (document.getElementById("sercheCheck").value == "false") {
console.log(document.getElementById("sercheCheck").value);
$.Notification.autoHideNotify('error', 'top center', 'پیام سیستم ', "لطفا در قسمت جستجوی لوایح موکل را انتخاب نموده و سپس جستجو را کلیک کنید");
}
}
}
</script>
} else if (document.getElementById("sercheCheck").value == "false") {
console.log(document.getElementById("sercheCheck").value);
$.Notification.autoHideNotify('error', 'top center', 'پیام سیستم ', "لطفا در قسمت جستجوی لوایح موکل را انتخاب نموده و سپس جستجو را کلیک کنید");
}
}
}
</script>
}

View File

@@ -1,188 +1,184 @@
using System.Collections.Generic;
using CompanyManagment.App.Contracts.Bill;
using CompanyManagment.App.Contracts.Bill;
using CompanyManagment.App.Contracts.Contact2;
using CompanyManagment.App.Contracts.TextManager;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
using Microsoft.AspNetCore.Mvc.Rendering;
namespace ServiceHost.Areas.Admin.Pages.Company.Bill
namespace ServiceHost.Areas.Admin.Pages.Company.Bill;
public class IndexModel : PageModel
{
public class IndexModel : PageModel
{
public string BillSearch = "false";
public BillSearchModel searchModel;
public List<BillViewModel> Bills;
private readonly IBillApplication _billApplication;
private readonly IContactApplication2 _contactApplication;
public string Message { get; set; }
public IndexModel(IBillApplication billApplication, IContactApplication2 contactApplication)
{
_billApplication = billApplication;
_contactApplication = contactApplication;
}
public void OnGet(BillSearchModel searchModel)
{
Bills = _billApplication.Search(searchModel);
private readonly IBillApplication _billApplication;
private readonly IContactApplication2 _contactApplication;
public List<BillViewModel> Bills;
public string BillSearch = "false";
public BillSearchModel searchModel;
if (Bills != null)
{
if (!string.IsNullOrWhiteSpace(searchModel.Appointed))
{
BillSearch = "true";
}
}
}
public IActionResult OnGetCreate()
{
return Partial("./Create");
}
public IActionResult OnPostCreate(CreateBill command)
{
var result = _billApplication.Create(command);
return new JsonResult(result);
}
public IActionResult OnGetEdit(long id)
{
List<Appointed> ObjList = ListAppointed();
List<ProcessingStage> ObjProcessingStage = ListProcessingStage();
public IndexModel(IBillApplication billApplication, IContactApplication2 contactApplication)
{
_billApplication = billApplication;
_contactApplication = contactApplication;
}
var bill = _billApplication.GetDetails(id);
public string Message { get; set; }
public void OnGet(BillSearchModel searchModel)
{
Bills = _billApplication.Search(searchModel);
if (Bills != null)
if (!string.IsNullOrWhiteSpace(searchModel.Appointed))
BillSearch = "true";
}
public IActionResult OnGetCreate()
{
return Partial("./Create");
}
public IActionResult OnPostCreate(CreateBill command)
{
var result = _billApplication.Create(command);
return new JsonResult(result);
}
public IActionResult OnGetEdit(long id)
{
var ObjList = ListAppointed();
var ObjProcessingStage = ListProcessingStage();
var bill = _billApplication.GetDetails(id);
var billEdit = new EditBill
{
Id = id,
SubjectBill = bill.SubjectBill,
Description = bill.Description,
Status = bill.Status,
Appointed = bill.Appointed,
Contact = bill.Contact,
ProcessingStage = bill.ProcessingStage,
};
return Partial("Edit", billEdit);
}
public IActionResult OnGetEditBill1(long id)
{
List<Appointed> ObjList = ListAppointed();
List<ProcessingStage> ObjProcessingStage = ListProcessingStage();
var bill = _billApplication.GetDetails(id);
var billEdit = new EditBill
{
Id = id,
SubjectBill = bill.SubjectBill,
Description = bill.Description,
Status = bill.Status,
Appointed = bill.Appointed,
Contact = bill.Contact,
ProcessingStage = bill.ProcessingStage,
};
return Partial("Edit", billEdit);
}
public JsonResult OnPostEdit(EditBill command)
{
var result = _billApplication.Edit(command);
return new JsonResult(result);
}
public IActionResult OnGetDeActive(long id, string url)
{
var billEdit = new EditBill
{
Id = id,
SubjectBill = bill.SubjectBill,
Description = bill.Description,
Status = bill.Status,
Appointed = bill.Appointed,
Contact = bill.Contact,
ProcessingStage = bill.ProcessingStage
};
return Partial("Edit", billEdit);
}
public IActionResult OnGetEditBill1(long id)
{
var ObjList = ListAppointed();
var ObjProcessingStage = ListProcessingStage();
var bill = _billApplication.GetDetails(id);
var billEdit = new EditBill
{
Id = id,
SubjectBill = bill.SubjectBill,
Description = bill.Description,
Status = bill.Status,
Appointed = bill.Appointed,
Contact = bill.Contact,
ProcessingStage = bill.ProcessingStage
};
return Partial("Edit", billEdit);
}
public JsonResult OnPostEdit(EditBill command)
{
var result = _billApplication.Edit(command);
return new JsonResult(result);
}
public IActionResult OnGetDeActive(long id, string url)
{
var result = _billApplication.DeActive(id);
if (result.IsSuccedded)
return new JsonResult(url);
Message = result.Message;
return RedirectToPage(url);
}
public IActionResult OnGetIsActive(long id, string url)
{
var result = _billApplication.Active(id);
if (result.IsSuccedded)
return new JsonResult(url);
Message = result.Message;
return RedirectToPage(url);
}
public IActionResult OnGetGroupDeActive(List<long> ids)
{
foreach (var item in ids)
{
var result = _billApplication.DeActive(item);
}
var result = _billApplication.DeActive(id);
return RedirectToPage("./Index");
}
if (result.IsSuccedded)
return new JsonResult(url);
Message = result.Message;
return RedirectToPage(url);
public IActionResult OnGetGroupReActive(List<long> ids)
{
foreach (var item in ids)
{
var result = _billApplication.Active(item);
}
}
//if (result.IsSuccedded)
// return RedirectToPage("./Index");
return RedirectToPage("./Index");
}
public IActionResult OnGetIsActive(long id, string url)
{
//public IActionResult OnGetGroupSelectModule(List<long> ids, string module, int AD)
//{
// long moduleId = _billApplication.GetAllModule().Where(x => x.NameSubModule == module).Select(x => x.Id).FirstOrDefault();
// foreach (var item in ids)
// {
// var result = _billApplication.SelectModule(item, moduleId, AD);
// }
// return RedirectToPage("./Index");
//}
var result = _billApplication.Active(id);
if (result.IsSuccedded)
return new JsonResult(url);
Message = result.Message;
return RedirectToPage(url);
}
private static List<Appointed> ListAppointed()
{
return new List<Appointed>
{
new() { Id = 1, Name = "موکل1" },
new() { Id = 2, Name = "موکل2" },
new() { Id = 3, Name = "موکل3" },
new() { Id = 4, Name = "موکل4" },
new() { Id = 5, Name = "موکل4" },
new() { Id = 6, Name = "موکل5" },
new() { Id = 7, Name = "موکل6" }
};
}
private static List<ProcessingStage> ListProcessingStage()
{
return new List<ProcessingStage>
{
new() { Id = 1, Name = "رسیدگی1" },
new() { Id = 2, Name = "رسیدگی2" },
new() { Id = 3, Name = "رسیدگی3" },
new() { Id = 4, Name = "رسیدگی4" },
new() { Id = 5, Name = "رسیدگی4" },
new() { Id = 6, Name = "رسیدگی5" },
new() { Id = 7, Name = "رسیدگی6" }
};
}
private class Appointed
{
public int Id { get; set; }
public string Name { get; set; }
}
public IActionResult OnGetGroupDeActive(List<long> ids)
{
foreach (var item in ids)
{
var result = _billApplication.DeActive(item);
}
return RedirectToPage("./Index");
}
public IActionResult OnGetGroupReActive(List<long> ids)
{
foreach (var item in ids)
{
var result = _billApplication.Active(item);
}
//if (result.IsSuccedded)
// return RedirectToPage("./Index");
return RedirectToPage("./Index");
}
//public IActionResult OnGetGroupSelectModule(List<long> ids, string module, int AD)
//{
// long moduleId = _billApplication.GetAllModule().Where(x => x.NameSubModule == module).Select(x => x.Id).FirstOrDefault();
// foreach (var item in ids)
// {
// var result = _billApplication.SelectModule(item, moduleId, AD);
// }
// return RedirectToPage("./Index");
//}
private static List<Appointed> ListAppointed()
{
return new List<Appointed>()
{
new Appointed {Id=1,Name="موکل1" },
new Appointed {Id=2,Name="موکل2" },
new Appointed {Id=3,Name="موکل3" },
new Appointed {Id=4,Name="موکل4" },
new Appointed {Id=5,Name="موکل4" },
new Appointed {Id=6,Name="موکل5" },
new Appointed {Id=7,Name="موکل6" }
};
}
private static List<ProcessingStage> ListProcessingStage()
{
return new List<ProcessingStage>()
{
new ProcessingStage {Id=1,Name="رسیدگی1" },
new ProcessingStage {Id=2,Name="رسیدگی2" },
new ProcessingStage {Id=3,Name="رسیدگی3" },
new ProcessingStage {Id=4,Name="رسیدگی4" },
new ProcessingStage {Id=5,Name="رسیدگی4" },
new ProcessingStage {Id=6,Name="رسیدگی5" },
new ProcessingStage {Id=7,Name="رسیدگی6" }
};
}
private class Appointed
{
public int Id { get; set; }
public string Name { get; set; }
}
private class ProcessingStage
{
public int Id { get; set; }
public string Name { get; set; }
}
}
}
private class ProcessingStage
{
public int Id { get; set; }
public string Name { get; set; }
}
}

View File

@@ -2,7 +2,7 @@
@{
}
@{
<style>
<style>
.ui-autocomplete-input {
border: none;
@@ -55,172 +55,163 @@
}
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<div class="modal-body">
<div class="row">
<fieldset style="border: 1px solid #999797; border-radius: 10px; padding: revert">
<legend style="margin-bottom: 5px; font-size: large; border-bottom: 0px; color: #505458; width: 140px; text-align: center;"> جستجو </legend>
<div class="row">
<div class="col-md-4">
<div class="form-group">
<select class="form-control select-city" asp-items='@Model.SelectListOriginalTitle' id="originalTitle1">
<option value="-1"> عنوان را انتخاب کنید ... </option>
</select>
</div>
</div>
<div class="col-md-4">
<div class="form-group">
<select class="form-control select-city" id="subtitle1">
<option value="0"> بخش</option>
</select>
</div>
</div>
<div class="col-md-4">
<div class="form-group">
<select class="form-control select-city" id="chapter1">
<option value="0"> فصل</option>
</select>
<input type="hidden" id="resultsubtitle" />
</div>
</div>
</div>
<div class="row">
<div class="col-md-12" dir="ltr" style="text-align:right;margin-bottom:10px">
<span class="alert-danger" id="alertcheckfilter"></span>
<label class="control-label"> : جستجو متن لایحه</label>
<div class="input-group">
<span class="input-group-btn">
<button class="btn btn-success btn-rounded " onclick="showMsg()">انتخاب</button>
</span>
<textarea id="DescriptionModal_Id" type="text" name="DescriptionModal_Id" style="text-align: right; font-size: 14px; font-family: 'Web_Yekan'; resize: none; height: 34px;" placeholder="... عبارت مورد نظر را تایپ کنید " class="form-control" ></textarea>
</div>
</div>
<div class="col-md-12">
<div class="form-group ">
<textarea type="text" class="form-control" placeholder=" نتایج جستجو از بانک اطلاعاتی لایحه" style=" height: 400px;" id="des"></textarea>
</div>
</div>
</div>
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<div class="modal-body">
<div class="row">
<fieldset style="border: 1px solid #999797; border-radius: 10px; padding: revert">
<legend style="margin-bottom: 5px; font-size: large; border-bottom: 0px; color: #505458; width: 140px; text-align: center;"> جستجو </legend>
<div class="row">
<div class="col-md-4">
<div class="form-group">
<select class="form-control select-city" asp-items="@Model.SelectListOriginalTitle" id="originalTitle1">
<option value="-1"> عنوان را انتخاب کنید ... </option>
</select>
</div>
</div>
<div class="col-md-4">
<div class="form-group">
<select class="form-control select-city" id="subtitle1">
<option value="0"> بخش</option>
</select>
</div>
</div>
<div class="col-md-4">
<div class="form-group">
<select class="form-control select-city" id="chapter1">
<option value="0"> فصل</option>
</select>
<input type="hidden" id="resultsubtitle"/>
</div>
</div>
</div>
<div class="row">
</fieldset>
</div>
</div>
<div class="modal-footer ">
<button type="button" id="btnmodal" class="btn btn-success btn-rounded waves-effect waves-light">ذخیره</button>
</div>
<div class="col-md-12" dir="ltr" style="text-align:right;margin-bottom:10px">
<span class="alert-danger" id="alertcheckfilter"></span>
<label class="control-label"> : جستجو متن لایحه</label>
<div class="input-group">
<span class="input-group-btn">
<button class="btn btn-success btn-rounded " onclick="showMsg()">انتخاب</button>
</span>
<textarea id="DescriptionModal_Id" type="text" name="DescriptionModal_Id" style="text-align: right; font-size: 14px; font-family: 'Web_Yekan'; resize: none; height: 34px;" placeholder="... عبارت مورد نظر را تایپ کنید " class="form-control" ></textarea>
</div>
</div>
<div class="col-md-12">
<div class="form-group ">
<textarea type="text" class="form-control" placeholder=" نتایج جستجو از بانک اطلاعاتی لایحه" style=" height: 400px;" id="des"></textarea>
</div>
</div>
</div>
</fieldset>
</div>
</div>
<div class="modal-footer ">
<button type="button" id="btnmodal" class="btn btn-success btn-rounded waves-effect waves-light">ذخیره</button>
</div>
</div>
<script>
$(document).ready(function () {
$('#btnmodal').click(function () {
var result = $('#des').val().replaceAll('\n', '<br/>');
//CKEDITOR.instances["Description"].setData(result);
var oEditor = CKEDITOR.instances.Description;
var html = "<a >" + result + "</a>";
var newElement = CKEDITOR.dom.element.createFromHtml(html, oEditor.document);
oEditor.insertElement(newElement);
$(document).ready(function() {
$('#btnmodal').click(function() {
const result = $('#des').val().replaceAll('\n', '<br/>');
//CKEDITOR.instances["Description"].setData(result);
const oEditor = CKEDITOR.instances.Description;
const html = `<a >${result}</a>`;
const newElement = CKEDITOR.dom.element.createFromHtml(html, oEditor.document);
oEditor.insertElement(newElement);
$("#des").val("");
$('#MainModal').modal('hide');
});
});
$(document).ready(function () {
$('#DescriptionModal_Id').autocomplete({
source: function (request, response) {
var chaptervalue = document.getElementById("chapter1").value;
$.ajax({
url: '/Admin/Company/TextManager?handler=DescriptionAll',
data: {
term: request.term,
Id: chaptervalue,
},
success: function (data) {
response(data);
}
});
},
minLength: 3
});
});
$("#des").val("");
$('#MainModal').modal('hide');
});
});
$(document).ready(function() {
$('#DescriptionModal_Id').autocomplete({
source: function(request, response) {
const chaptervalue = document.getElementById("chapter1").value;
$.ajax({
url: '/Admin/Company/TextManager?handler=DescriptionAll',
data: {
term: request.term,
Id: chaptervalue,
},
success: function(data) {
response(data);
}
});
},
minLength: 3
});
});
</script>
<script>
function showMsg() {
$("#des").empty();
var descriptionModalInput = document.getElementById('DescriptionModal_Id').value;
document.getElementById('des').value = descriptionModalInput;
}
var url = null;
jQuery(document).ready(function ($) {
$.ui.autocomplete.prototype._renderItem = function (ul, item) {
var t = String(item.value).replace(
new RegExp(this.term, "gi"),
"<strong style='font-size:12px;color:red'>$&</strong>");
return $("<li></li>")
.data("item.autocomplete", item)
.append("<div>" + t + "</div>")
.appendTo(ul);
};
function showMsg() {
$("#des").empty();
const descriptionModalInput = document.getElementById('DescriptionModal_Id').value;
document.getElementById('des').value = descriptionModalInput;
}
});
var url = null;
jQuery(document).ready(function($) {
$.ui.autocomplete.prototype._renderItem = function(ul, item) {
const t = String(item.value).replace(
new RegExp(this.term, "gi"),
"<strong style='font-size:12px;color:red'>$&</strong>");
return $("<li></li>")
.data("item.autocomplete", item)
.append(`<div>${t}</div>`)
.appendTo(ul);
};
});
</script>
<script>
$(document).ready(function () {
$("#originalTitle1").change(function () {
$("#subtitle1").empty();
$("#chapter1").empty();
$.ajax({
type: 'GET',
url: '/Admin/Company/TextManager?handler=SubtitleList',
dataType: 'json',
data: { OriginalTitle_Id: $("#originalTitle1").val() },
success: function (result) {
$("#subtitle1").append(' <option value="' + -1 + '">' +
"نام بخش را انتخاب کنید" + '</option>');
$("#chapter1").append(' <option value="' + -1 + '">' +
"فصل را انتخاب کنید" + '</option>');
$.each(result, function (i, result) {
$("#subtitle1").append(' <option value="' + result.id + '">' +
result.subtitle + '</option>');
});
},
error: function (ex) {
alert('Error');
}
});
return false;
});
$("#subtitle1").change(function () {
$("#chapter1").empty();
$.ajax({
type: 'GET',
url: '/Admin/Company/TextManager?handler=ChptereList',
dataType: 'json',
data: { Subtitle_Id: $("#subtitle1").val() },
success: function (results) {
$("#chapter1").append(' <option value="' + -1 + '">' +
"فصل را انتخاب کنید" + '</option>');
$.each(results, function (i, result) {
$("#chapter1").append(' <option value="' + result.value + '">' +
result.text + '</option>');
});
},
error: function (ex) {
alert('ffff');
}
});
return false;
});
});
</script>
$(document).ready(function() {
$("#originalTitle1").change(function() {
$("#subtitle1").empty();
$("#chapter1").empty();
$.ajax({
type: 'GET',
url: '/Admin/Company/TextManager?handler=SubtitleList',
dataType: 'json',
data: { OriginalTitle_Id: $("#originalTitle1").val() },
success: function(result) {
$("#subtitle1").append(` <option value="${-1}">نام بخش را انتخاب کنید</option>`);
$("#chapter1").append(` <option value="${-1}">فصل را انتخاب کنید</option>`);
$.each(result,
function(i, result) {
$("#subtitle1").append(` <option value="${result.id}">${result.subtitle}</option>`);
});
},
error: function(ex) {
alert('Error');
}
});
return false;
});
$("#subtitle1").change(function() {
$("#chapter1").empty();
$.ajax({
type: 'GET',
url: '/Admin/Company/TextManager?handler=ChptereList',
dataType: 'json',
data: { Subtitle_Id: $("#subtitle1").val() },
success: function(results) {
$("#chapter1").append(` <option value="${-1}">فصل را انتخاب کنید</option>`);
$.each(results,
function(i, result) {
$("#chapter1").append(` <option value="${result.value}">${result.text}</option>`);
});
},
error: function(ex) {
alert('ffff');
}
});
return false;
});
});
</script>

View File

@@ -1,9 +1,8 @@
@model CompanyManagment.App.Contracts.Chapter.CreateChapter
@model CompanyManagment.App.Contracts.Chapter.CreateChapter
@{
}
@{
<style>
<style>
.select2-container {
width: 100% !important;
}
@@ -32,77 +31,76 @@
}
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<form asp-page="./Index" asp-page-handler="Create" id="workshops" autocomplete="off"
method="post"
data-ajax="true"
data-callback=""
data-action="Refresh"
enctype="multipart/form-data">
<div class="modal-body">
<div class="row">
<fieldset style="border: 1px solid #999797; border-radius: 10px; padding: revert">
<legend style="margin-bottom: 5px; font-size: large; border-bottom: 0px; color: #505458; width: 140px; text-align: center;"> تعریف فصل </legend>
<div class="row">
<div class="col-md-6">
<div class="form-group">
<select class="form-control select-city" asp-for="OriginalTitle_Id" asp-items='@Model.OriginalTitleViewModels' id="originalTitle1">
<option value="-1"> عنوان را انتخاب کنید ... </option>
</select>
<span asp-validation-for="OriginalTitle_Id" class="error"></span>
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<form asp-page="./Index" asp-page-handler="Create" id="workshops" autocomplete="off"
method="post"
data-ajax="true"
data-callback=""
data-action="Refresh"
enctype="multipart/form-data">
<div class="modal-body">
<div class="row">
<fieldset style="border: 1px solid #999797; border-radius: 10px; padding: revert">
<legend style="margin-bottom: 5px; font-size: large; border-bottom: 0px; color: #505458; width: 140px; text-align: center;"> تعریف فصل </legend>
<div class="row">
<div class="col-md-6">
<div class="form-group">
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<select class="form-control select-city" asp-for="Subtitle_Id" asp-items='@Model.SubtitleViewModels' id="subtitle1">
<option value="0"> نام بخش را انتخاب کنید...</option>
</select>
<span asp-validation-for="Subtitle_Id" class="error"></span>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<input type="text" class="form-control" asp-for="Chapter" placeholder="فصل">
<span asp-validation-for="Chapter" class="error"></span>
</div>
</div>
</div>
</fieldset>
</div>
</div>
<div class="modal-footer">
<button type="submit" class="btn btn-success btn-rounded waves-effect waves-light">ذخیره</button>
<button type="button" class="btn btn-default btn-rounded waves-effect waves-light m-b-5" data-dismiss="modal">بستن</button>
</div>
</form>
<select class="form-control select-city" asp-for="OriginalTitle_Id" asp-items="@Model.OriginalTitleViewModels" id="originalTitle1">
<option value="-1"> عنوان را انتخاب کنید ... </option>
</select>
<span asp-validation-for="OriginalTitle_Id" class="error"></span>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<select class="form-control select-city" asp-for="Subtitle_Id" asp-items="@Model.SubtitleViewModels" id="subtitle1">
<option value="0"> نام بخش را انتخاب کنید...</option>
</select>
<span asp-validation-for="Subtitle_Id" class="error"></span>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<input type="text" class="form-control" asp-for="Chapter" placeholder="فصل">
<span asp-validation-for="Chapter" class="error"></span>
</div>
</div>
</div>
</fieldset>
</div>
</div>
<div class="modal-footer">
<button type="submit" class="btn btn-success btn-rounded waves-effect waves-light">ذخیره</button>
<button type="button" class="btn btn-default btn-rounded waves-effect waves-light m-b-5" data-dismiss="modal">بستن</button>
</div>
</form>
</div>
<script>
$(document).ready(function () {
$("#originalTitle1").change(function () {
$("#subtitle1").empty();
$.ajax({
type: 'GET',
url: '/Admin/Company/TextManager?handler=SubtitleList',
dataType: 'json',
data: { OriginalTitle_Id: $("#originalTitle1").val() },
success: function (result) {
$("#subtitle1").append(' <option value="' + -1 + '">' +
"نام بخش را انتخاب کنید" + '</option>');
$.each(result, function (i, result) {
$("#subtitle1").append(' <option value="' + result.id + '">' +
result.subtitle + '</option>');
});
},
error: function (ex) {
alert('Error');
}
});
return false;
});
});
</script>
$(document).ready(function() {
$("#originalTitle1").change(function() {
$("#subtitle1").empty();
$.ajax({
type: 'GET',
url: '/Admin/Company/TextManager?handler=SubtitleList',
dataType: 'json',
data: { OriginalTitle_Id: $("#originalTitle1").val() },
success: function(result) {
$("#subtitle1").append(` <option value="${-1}">نام بخش را انتخاب کنید</option>`);
$.each(result,
function(i, result) {
$("#subtitle1").append(` <option value="${result.id}">${result.subtitle}</option>`);
});
},
error: function(ex) {
alert('Error');
}
});
return false;
});
});
</script>

View File

@@ -2,7 +2,7 @@
@{
}
@{
<style>
<style>
.select2-container {
width: 100% !important;
}
@@ -25,97 +25,96 @@
</style>
}
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<form asp-page="./Index" asp-page-handler="Edit" autocomplete="off"
method="post"
data-ajax="true"
data-callback=""
data-action="Refresh"
enctype="multipart/form-data">
<div class="modal-body">
<div class="row">
<fieldset style="border: 1px solid #999797; border-radius: 10px; padding: revert">
<legend style="margin-bottom: 5px; font-size: large; border-bottom: 0px; color: #505458; width: 140px; text-align: center;"> ویرایش فصل </legend>
<div class="row">
<div class="col-md-6">
<div class="form-group">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<form asp-page="./Index" asp-page-handler="Edit" autocomplete="off"
method="post"
data-ajax="true"
data-callback=""
data-action="Refresh"
enctype="multipart/form-data">
<div class="modal-body">
<div class="row">
<fieldset style="border: 1px solid #999797; border-radius: 10px; padding: revert">
<legend style="margin-bottom: 5px; font-size: large; border-bottom: 0px; color: #505458; width: 140px; text-align: center;"> ویرایش فصل </legend>
<div class="row">
<div class="col-md-6">
<div class="form-group">
<select class="form-control select-city" asp-for="OriginalTitle_Id" asp-items='@Model.OriginalTitleViewModels' id="originalTitle1">
<option value="-1"> عنوان را انتخاب کنید ... </option>
</select>
<span asp-validation-for="OriginalTitle_Id" class="error"></span>
<select class="form-control select-city" asp-for="OriginalTitle_Id" asp-items="@Model.OriginalTitleViewModels" id="originalTitle1">
<option value="-1"> عنوان را انتخاب کنید ... </option>
</select>
<span asp-validation-for="OriginalTitle_Id" class="error"></span>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<select class="form-control select-city" asp-for="Subtitle_Id" asp-items='@Model.SubtitleViewModels' id="subtitle1">
<option value="0"> نام بخش را انتخاب کنید...</option>
</select>
<span asp-validation-for="Subtitle_Id" class="error"></span>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<input type="text" class="form-control" asp-for="Chapter">
<span asp-validation-for="Chapter" class="error"></span>
</div>
</div>
</div>
</fieldset>
</div>
</div>
<input type="hidden" asp-for="Id" value="@Model.Id" />
<div class="modal-footer">
<button type="submit" class="btn btn-success btn-rounded waves-effect waves-light">ذخیره</button>
<button type="button" class="btn btn-default btn-rounded waves-effect waves-light m-b-5" data-dismiss="modal">بستن</button>
</div>
</form>
<select class="form-control select-city" asp-for="Subtitle_Id" asp-items="@Model.SubtitleViewModels" id="subtitle1">
<option value="0"> نام بخش را انتخاب کنید...</option>
</select>
<span asp-validation-for="Subtitle_Id" class="error"></span>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<input type="text" class="form-control" asp-for="Chapter">
<span asp-validation-for="Chapter" class="error"></span>
</div>
</div>
</div>
</fieldset>
</div>
</div>
<input type="hidden" asp-for="Id" value="@Model.Id"/>
<div class="modal-footer">
<button type="submit" class="btn btn-success btn-rounded waves-effect waves-light">ذخیره</button>
<button type="button" class="btn btn-default btn-rounded waves-effect waves-light m-b-5" data-dismiss="modal">بستن</button>
</div>
</form>
</div>
<script>
$(document).ready(function () {
$("#originalTitle1").change(function () {
$("#subtitle1").empty();
$.ajax({
type: 'GET',
url: '/Admin/Company/TextManager?handler=SubtitleList',
dataType: 'json',
data: { OriginalTitle_Id: $("#originalTitle1").val() },
success: function (result) {
$("#subtitle1").append(' <option value="' + -1 + '">' +
"نام بخش را انتخاب کنید" + '</option>');
$.each(result, function (i, result) {
$("#subtitle1").append(' <option value="' + result.id + '">' +
result.subtitle + '</option>');
});
},
error: function (ex) {
alert('Error');
}
});
return false;
});
//$("#StateList").change(function () {
// $("#CityList").empty();
// $.ajax({
// type: 'GET',
// url: '/AdminPanel/Cascade/LoadCity/',
// dataType: 'json',
// data: { StateId: $("#StateList").val() },
// success: function (states) {
// $("#CityList").append(' <option value="' + -1 + '">' +
// "شهر را انتخاب کنید" + '</option>');
// $.each(states, function (i, state) {
// $("#CityList").append(' <option value="' + state.value + '">' +
// state.text + '</option>');
// });
// },
// error: function (ex) {
// alert('ffff');
// }
// });
// return false;
//});
});
$(document).ready(function() {
$("#originalTitle1").change(function() {
$("#subtitle1").empty();
$.ajax({
type: 'GET',
url: '/Admin/Company/TextManager?handler=SubtitleList',
dataType: 'json',
data: { OriginalTitle_Id: $("#originalTitle1").val() },
success: function(result) {
$("#subtitle1").append(` <option value="${-1}">نام بخش را انتخاب کنید</option>`);
$.each(result,
function(i, result) {
$("#subtitle1").append(` <option value="${result.id}">${result.subtitle}</option>`);
});
},
error: function(ex) {
alert('Error');
}
});
return false;
});
//$("#StateList").change(function () {
// $("#CityList").empty();
// $.ajax({
// type: 'GET',
// url: '/AdminPanel/Cascade/LoadCity/',
// dataType: 'json',
// data: { StateId: $("#StateList").val() },
// success: function (states) {
// $("#CityList").append(' <option value="' + -1 + '">' +
// "شهر را انتخاب کنید" + '</option>');
// $.each(states, function (i, state) {
// $("#CityList").append(' <option value="' + state.value + '">' +
// state.text + '</option>');
// });
// },
// error: function (ex) {
// alert('ffff');
// }
// });
// return false;
//});
});
</script>

View File

@@ -1,18 +1,17 @@
@page
@using Microsoft.AspNetCore.Http.Extensions
@model ServiceHost.Areas.Admin.Pages.Company.Chapter.IndexModel
@using Microsoft.AspNetCore.Http.Extensions;
@{
}
@{
string url = HttpContext.Request.GetEncodedUrl();
//string colaps = "in";
//string act = "active";
int i = 1;
var url = HttpContext.Request.GetEncodedUrl();
//string colaps = "in";
//string act = "active";
var i = 1;
}
@{
Layout = "Shared/_AdminLayout";
ViewData["title"] = "فصل";
Layout = "Shared/_AdminLayout";
ViewData["title"] = "فصل";
}
<style>
@@ -199,312 +198,319 @@
}
</style>
<div class="row">
<div class="col-sm-12 m-r-10">
<input type="hidden" id="sercheCheck" value="@Model.ChapterSearch" />
</div>
<div class="col-sm-12 m-r-10">
<input type="hidden" id="sercheCheck" value="@Model.ChapterSearch"/>
</div>
</div>
<div class="row">
<div class="col-sm-12 m-r-10">
<p class="pull-right">
<a id="btnPopModal" href="#showmodal=@Url.Page("/Company/Chapter/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 m-r-10">
<p class="pull-right">
<a id="btnPopModal" href="#showmodal=@Url.Page("/Company/Chapter/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>
<div class="col-sm-12">
<div class="panel-group panel-group-joined" id="accordion-test">
<div class="panel panel-default" style="border-radius: 15px !important; background-color: #fdc0c0; ">
<div class="panel-heading" style="background-color: #950000 !important">
<h4 class="panel-title" style="color: #edebeb !important; display: inline;">
<a data-toggle="collapse" data-parent="#accordion-test" href="#collapseOne" class="collapsed" style="display: inline;">
جستجوی فصل
</a>
</h4>
</div>
<div id="collapseOne" class="panel-collapse collapse in ">
<div class="panel-body" style="padding-top: 15px; padding-bottom: 15px;">
<div class="row">
<div class="col-sm-12">
<form class="form-inline" role="form" method="get" name="search-theme-form" id="search-theme-form" autocomplete="off">
<div class="form-group col-sm-12">
<div class="row">
<div class="col-sm-3 pull-right">
<select class="form-control select-city" asp-for="searchModel.OriginalTitle_Id" asp-items="Model.SelectListOriginalTitle" placeholder="عنوان" id="OriginalTitle_Id" style="width: 100%">
<option value="0" selected="selected">
عنوان راانتخاب کنید
</option>
</select>
</div>
<div class="col-md-3">
<select class="form-control select-city" asp-for="searchModel.Subtitle_Id" asp-items="Model.SelectListSubtitles" id="Subtitle_Id" style="width: 100%">
<option value="0"> فصل را انتخاب کنید</option>
</select>
<div class="panel-group panel-group-joined" id="accordion-test">
<div class="panel panel-default" style="border-radius: 15px !important; background-color: #fdc0c0; ">
<div class="panel-heading" style="background-color: #950000 !important">
<h4 class="panel-title" style="color: #edebeb !important; display: inline;">
<a data-toggle="collapse" data-parent="#accordion-test" href="#collapseOne" class="collapsed" style="display: inline;">
جستجوی فصل
</a>
</h4>
</div>
<div id="collapseOne" class="panel-collapse collapse in ">
<div class="panel-body" style="padding-top: 15px; padding-bottom: 15px;">
<div class="row">
<div class="col-sm-12">
<form class="form-inline" role="form" method="get" name="search-theme-form" id="search-theme-form" autocomplete="off">
<div class="form-group col-sm-12">
<div class="row">
<div class="col-sm-3 pull-right">
<select class="form-control select-city" asp-for="searchModel.OriginalTitle_Id" asp-items="Model.SelectListOriginalTitle" placeholder="عنوان" id="OriginalTitle_Id" style="width: 100%">
<option value="0" selected="selected">
عنوان راانتخاب کنید
</option>
</select>
</div>
<div class="col-md-3">
<select class="form-control select-city" asp-for="searchModel.Subtitle_Id" asp-items="Model.SelectListSubtitles" id="Subtitle_Id" style="width: 100%">
<option value="0"> فصل را انتخاب کنید</option>
</select>
</div>
<div class="col-sm-3 pull-right">
<label class="sr-only" asp-for="searchModel.Chapter"></label>
<input class="form-control inpt" asp-for="searchModel.Chapter" placeholder="فصل" style="width: 100%">
</div>
</div>
<div class="col-sm-3 pull-right">
<label class="sr-only" asp-for="searchModel.Chapter"></label>
<input class="form-control inpt" asp-for="searchModel.Chapter" placeholder="فصل" style="width: 100%">
</div>
</div>
<hr style=" margin-top: 12px;margin-bottom: 12px;" />
<div class="row" style="margin-top: 15px">
<div class="col-lg-9">
<label class="sr-only" asp-for="searchModel.IsActiveString"></label>
<select id="activing" class="form-control activer" asp-for="searchModel.IsActiveString" style="background-color: #dddddd; border-radius: 25px; border: 1px solid #bfbfbf;">
<option value="true"> فعال </option>
<option value="false"> غیرفعال</option>
<option value="both"> هردو</option>
</select>
</div>
<div class="col-lg-3">
<button type="submit" class="btn btn-success btn-rounded waves-effect waves-light m-b-5 search" style="border-bottom-left-radius: 0px; border-top-left-radius: 0px; background-color: #950000; border-color: #950000; font-family: 'Web_Yekan' !important; margin-left: -3px "> <i class="fa fa-search" style="padding-left: 3px; font-size: 14px;"></i> جستجو</button>
<a class="btn btn-info btn-rounded waves-effect waves-light m-b-5" style="border-bottom-right-radius: 0px; border-top-right-radius: 0px; background-color: #545353; border-color: #545353; font-family: 'Web_Yekan' !important;" asp-page="./Index">مشاهده همه</a>
</div>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<hr style=" margin-top: 12px;margin-bottom: 12px;"/>
<div class="row" style="margin-top: 15px">
<div class="col-lg-9">
<label class="sr-only" asp-for="searchModel.IsActiveString"></label>
<select id="activing" class="form-control activer" asp-for="searchModel.IsActiveString" style="background-color: #dddddd; border-radius: 25px; border: 1px solid #bfbfbf;">
<option value="true"> فعال </option>
<option value="false"> غیرفعال</option>
<option value="both"> هردو</option>
</select>
</div>
<div class="col-lg-3">
<button type="submit" class="btn btn-success btn-rounded waves-effect waves-light m-b-5 search" style="border-bottom-left-radius: 0px; border-top-left-radius: 0px; background-color: #950000; border-color: #950000; font-family: 'Web_Yekan' !important; margin-left: -3px "> <i class="fa fa-search" style="padding-left: 3px; font-size: 14px;"></i> جستجو</button>
<a class="btn btn-info btn-rounded waves-effect waves-light m-b-5" style="border-bottom-right-radius: 0px; border-top-right-radius: 0px; background-color: #545353; border-color: #545353; font-family: 'Web_Yekan' !important;" asp-page="./Index">مشاهده همه</a>
</div>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="col-sm-12">
<div permission="20113" class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title"><i class="fa fa-list" style="padding-left: 3px; font-size: 14px"></i> لیست فصل</h3>
</div>
<div class="panel-body">
<div class="row">
<div class="col-sm-12 col-sm-12 col-xs-12">
<table id="datatable" class="table table-striped table-bordered">
<thead style="background-color: #ecefee">
<tr>
<th style="font-size: 10px !important; display: none" class="sizeSet">
<span class="tooltip-container">
<input class="checkboxtitle" type="checkbox" id="checkSelect" onclick="selectori(this)" checked="checked" />
</span>
</th>
<th style="font-size: 16px !important; width: 5% !important">#</th>
<th style="font-size: 16px !important; text-align: center; width: 25% !important">عنوان</th>
<th style="font-size: 16px !important; text-align: center;width: 25% !important"> بخش </th>
<th style="font-size: 16px !important; text-align: center; width: 25% !important"> فصل </th>
<div permission="20113" class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title"><i class="fa fa-list" style="padding-left: 3px; font-size: 14px"></i> لیست فصل</h3>
</div>
<div class="panel-body">
<div class="row">
<div class="col-sm-12 col-sm-12 col-xs-12">
<table id="datatable" class="table table-striped table-bordered">
<thead style="background-color: #ecefee">
<tr>
<th style="font-size: 10px !important; display: none" class="sizeSet">
<span class="tooltip-container">
<input class="checkboxtitle" type="checkbox" id="checkSelect" onclick="selectori(this)" checked="checked"/>
</span>
</th>
<th style="font-size: 16px !important; width: 5% !important">#</th>
<th style="font-size: 16px !important; text-align: center; width: 25% !important">عنوان</th>
<th style="font-size: 16px !important; text-align: center;width: 25% !important"> بخش </th>
<th style="font-size: 16px !important; text-align: center; width: 25% !important"> فصل </th>
<th style="font-size: 10px !important;width: 10% !important ">
<span style="float: right;">
<span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span>
</span>
<span class="act">
</span>
<a class="btn btn-danger pull-right m-rl-5 rad deact" onclick="deactiveAll()">
<i class="fa faSize fa-trash"></i>
</a>
<th style="font-size: 10px !important;width: 10% !important ">
<span style="float: right;">
<span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span>
</span>
<span class="act">
</span>
<a class="btn btn-danger pull-right m-rl-5 rad deact" onclick="deactiveAll()">
<i class="fa faSize fa-trash"></i>
</a>
</th>
</th>
</tr>
</thead>
<tbody>
@foreach (var item in Model.Chapters)
{
<tr>
<td style="font-size: 16px !important; text-align: center;display:none">
<input type="checkbox" name="foo" value="@item.Id" checked="checked" />
</td>
<td style="font-size: 14px !important; text-align: center">@i </td>
<td style="font-size: 14px !important; text-align: center">@item.OriginalTitle </td>
<td style="font-size: 14px !important; text-align: center">@item.Subtitle </td>
<td style="font-size: 14px !important; text-align: center">@item.Chapter </td>
@{
i++;
}
</tr>
</thead>
<tbody>
@foreach (var item in Model.Chapters)
{
<tr>
<td style="font-size: 16px !important; text-align: center;display:none">
<input type="checkbox" name="foo" value="@item.Id" checked="checked"/>
</td>
<td style="font-size: 14px !important; text-align: center">@i </td>
<td style="font-size: 14px !important; text-align: center">@item.OriginalTitle </td>
<td style="font-size: 14px !important; text-align: center">@item.Subtitle </td>
<td style="font-size: 14px !important; text-align: center">@item.Chapter </td>
@{
i++;
}
<td>
<td>
<a permission="20114" class="btn btn-warning pull-right m-rl-5 rad"
href="#showmodal=@Url.Page("./Index", "Edit", new {Id = item.Id})">
<i class="fa faSize fa-edit"></i>
</a>
<a permission="20114" class="btn btn-warning pull-right m-rl-5 rad"
href="#showmodal=@Url.Page("./Index", "Edit", new { item.Id })">
<i class="fa faSize fa-edit"></i>
</a>
@if (item.IsActiveString == "true")
{
<a permission="20116" id="googleLink" class="btn btn-danger pull-right m-rl-5 fff rad" onclick="DeActive('/Admin/Company/Chapter?id=@item.Id&amp;url=@url&amp;handler=DeActive')"><i class="fa faSize fa-trash"></i></a>
}
else
{
<a permission="20116" onclick="IsActive('/Admin/Company/Chapter?id=@item.Id&amp;url=@url&amp;handler=IsActive')" class="btn btn-success pull-right m-rl-5 rad"><i class="fa faSize fa-rotate-left"></i> </a> { }
}
</td>
</tr>
}
</tbody>
</table>
</div>
</div>
</div>
</div>
@if (item.IsActiveString == "true")
{
<a permission="20116" id="googleLink" class="btn btn-danger pull-right m-rl-5 fff rad" onclick="DeActive('/Admin/Company/Chapter?id=@item.Id&amp;url=@url&amp;handler=DeActive')">
<i class="fa faSize fa-trash"></i>
</a>
}
else
{
<a permission="20116" onclick="IsActive('/Admin/Company/Chapter?id=@item.Id&amp;url=@url&amp;handler=IsActive')" class="btn btn-success pull-right m-rl-5 rad">
<i class="fa faSize fa-rotate-left"></i>
</a>
{
}
}
</td>
</tr>
}
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
@section PanelScripts{
<script src="~/AdminTheme/assets/js/site.js"></script>
<script src="~/AdminTheme/assets/datatables/jquery.dataTables.min.js"></script>
<script src="~/AdminTheme/assets/datatables/dataTables.bootstrap.js"></script>
<script>
$('.activer').on('change',
function (e) {
e.preventDefault();
$('.search').click();
});
</script>
<script>
<script src="~/AdminTheme/assets/js/site.js"></script>
<script src="~/AdminTheme/assets/datatables/jquery.dataTables.min.js"></script>
<script src="~/AdminTheme/assets/datatables/dataTables.bootstrap.js"></script>
<script>
$('.activer').on('change',
function(e) {
e.preventDefault();
$('.search').click();
});
</script>
<script>
if (document.getElementById("activing").selectedIndex == 1) {
$('.deact').remove();
$('.act').append(
' <a class="btn btn-success pull-right m-rl-5 rad react" onclick="reActiveAll()">' + '<i class="fa faSize fa-rotate-left"></i>' + ' </a>'
);
}
if (document.getElementById("activing").selectedIndex == 2) {
$('.deact').remove();
}
if (document.getElementById("activing").selectedIndex == 1) {
$('.deact').remove();
$('.act').append(
' <a class="btn btn-success pull-right m-rl-5 rad react" onclick="reActiveAll()">' + '<i class="fa faSize fa-rotate-left"></i>' + ' </a>'
);
}
if (document.getElementById("activing").selectedIndex == 2) {
$('.deact').remove();
}
</script>
<script type="text/javascript">
$(document).ready(function () {
$('#datatable').dataTable({
"lengthMenu": [[25, 10, 50, 100, -1], [25, 10, 50, 100, "All"]]
});
});
</script>
<script>
$(document).ready(function () {
$('#datatable2').dataTable(
{
"lengthMenu": [[25, 10, 50, 100, -1], [25, 10, 50, 100, "All"]]
});
});
</script>
</script>
<script type="text/javascript">
$(document).ready(function() {
$('#datatable').dataTable({
"lengthMenu": [[25, 10, 50, 100, -1], [25, 10, 50, 100, "All"]]
});
});
</script>
<script>
$(document).ready(function() {
$('#datatable2').dataTable(
{
"lengthMenu": [[25, 10, 50, 100, -1], [25, 10, 50, 100, "All"]]
});
});
</script>
<script>
var checkboxes;
function selectori(source) {
checkboxes = document.getElementsByName('foo');
for (var i = 0, n = checkboxes.length; i < n; i++) {
checkboxes[i].checked = source.checked;
}
}
</script>
<script>
function deactiveAll() {
<script>
var checkboxes;
if (document.getElementById("checkSelect").checked == false) {
$.Notification.autoHideNotify('error', 'top center', 'پیام سیستم ', " هیچ بخشی انتخاب نشده است ");
} else {
if (document.getElementById("sercheCheck").value == "false") {
$.Notification.autoHideNotify('error', 'top center', 'پیام سیستم ', " لطفا در قسمت جستجوی متن حداقل یکی از فیلدهای عنوان وبخش را انتخاب نموده و سپس جستجو را کلیک کنید ");
} else if (document.getElementById("sercheCheck").value == "true") {
swal({
title: "آیا غیرفعال نمودن این موارد انتخاب شده اطمینان دارید؟",
text: "",
type: "warning",
showCancelButton: true,
confirmButtonColor: "#DD6B55",
confirmButtonText: "بله",
cancelButtonText: "خیر",
closeOnConfirm: false
}, function (isConfirm) {
if (isConfirm) {
checkboxes2 = document.getElementsByName('foo');
var url3b = '';
for (var i2 = 0, n2 = checkboxes2.length; i2 < n2; i2++) {
if (checkboxes2[i2].checked == true) {
var u2 = '&ids=' + checkboxes2[i2].value;
console.log(u2);
url3b = url3b + u2;
console.log(url3b);
}
}
var url2b = '@Url.Page("/Company/Chapter/Index", "GroupDeActive")';
window.location.href = url2b + url3b;
console.log(url2b);
}
});
function selectori(source) {
checkboxes = document.getElementsByName('foo');
for (var i = 0, n = checkboxes.length; i < n; i++) {
checkboxes[i].checked = source.checked;
}
}
</script>
<script>
function deactiveAll() {
}
}
}
</script>
<script>
function reActiveAll() {
if (document.getElementById("checkSelect").checked == false) {
$.Notification.autoHideNotify('error', 'top center', 'پیام سیستم ', " هیچ بخشی انتخاب نشده است ");
} else {
if (document.getElementById("sercheCheck").value == "false") {
$.Notification.autoHideNotify('error', 'top center', 'پیام سیستم ', " لطفا در قسمت جستجوی متن حداقل یکی از فیلدهای عنوان وبخش را انتخاب نموده و سپس جستجو را کلیک کنید ");
} else if (document.getElementById("sercheCheck").value == "true") {
swal({
title: "آیا فعال نمودن این موارد انتخاب شده اطمینان دارید؟",
text: "",
type: "warning",
showCancelButton: true,
confirmButtonColor: "#DD6B55",
confirmButtonText: "بله",
cancelButtonText: "خیر",
closeOnConfirm: false
}, function (isConfirm) {
if (isConfirm) {
checkboxes2 = document.getElementsByName('foo');
var url3b = '';
for (var i2 = 0, n2 = checkboxes2.length; i2 < n2; i2++) {
if (checkboxes2[i2].checked == true) {
var u2 = '&ids=' + checkboxes2[i2].value;
console.log(u2);
url3b = url3b + u2;
console.log(url3b);
}
}
var url2b = '@Url.Page("/Company/Chapter/Index", "GroupReActive")';
console.log(url2b);
window.location.href = url2b + url3b;
}
});
}
}
}
</script>
if (document.getElementById("checkSelect").checked == false) {
$.Notification.autoHideNotify('error', 'top center', 'پیام سیستم ', " هیچ بخشی انتخاب نشده است ");
} else {
if (document.getElementById("sercheCheck").value == "false") {
$.Notification.autoHideNotify('error', 'top center', 'پیام سیستم ', " لطفا در قسمت جستجوی متن حداقل یکی از فیلدهای عنوان وبخش را انتخاب نموده و سپس جستجو را کلیک کنید ");
} else if (document.getElementById("sercheCheck").value == "true") {
swal({
title: "آیا غیرفعال نمودن این موارد انتخاب شده اطمینان دارید؟",
text: "",
type: "warning",
showCancelButton: true,
confirmButtonColor: "#DD6B55",
confirmButtonText: "بله",
cancelButtonText: "خیر",
closeOnConfirm: false
},
function(isConfirm) {
if (isConfirm) {
checkboxes2 = document.getElementsByName('foo');
let url3b = '';
for (var i2 = 0, n2 = checkboxes2.length; i2 < n2; i2++) {
if (checkboxes2[i2].checked == true) {
const u2 = `&ids=${checkboxes2[i2].value}`;
console.log(u2);
url3b = url3b + u2;
console.log(url3b);
}
}
const url2b = '@Url.Page("/Company/Chapter/Index", "GroupDeActive")';
window.location.href = url2b + url3b;
console.log(url2b);
}
});
}
}
}
</script>
<script>
function reActiveAll() {
if (document.getElementById("checkSelect").checked == false) {
$.Notification.autoHideNotify('error', 'top center', 'پیام سیستم ', " هیچ بخشی انتخاب نشده است ");
} else {
if (document.getElementById("sercheCheck").value == "false") {
$.Notification.autoHideNotify('error', 'top center', 'پیام سیستم ', " لطفا در قسمت جستجوی متن حداقل یکی از فیلدهای عنوان وبخش را انتخاب نموده و سپس جستجو را کلیک کنید ");
} else if (document.getElementById("sercheCheck").value == "true") {
swal({
title: "آیا فعال نمودن این موارد انتخاب شده اطمینان دارید؟",
text: "",
type: "warning",
showCancelButton: true,
confirmButtonColor: "#DD6B55",
confirmButtonText: "بله",
cancelButtonText: "خیر",
closeOnConfirm: false
},
function(isConfirm) {
if (isConfirm) {
checkboxes2 = document.getElementsByName('foo');
let url3b = '';
for (var i2 = 0, n2 = checkboxes2.length; i2 < n2; i2++) {
if (checkboxes2[i2].checked == true) {
const u2 = `&ids=${checkboxes2[i2].value}`;
console.log(u2);
url3b = url3b + u2;
console.log(url3b);
}
}
const url2b = '@Url.Page("/Company/Chapter/Index", "GroupReActive")';
console.log(url2b);
window.location.href = url2b + url3b;
}
});
}
}
}
</script>
<script>
$(document).ready(function () {
$("#OriginalTitle_Id").change(function () {
$("#Subtitle_Id").empty();
$.ajax({
type: 'GET',
url: '/Admin/Company/TextManager?handler=SubtitleList',
dataType: 'json',
data: { OriginalTitle_Id: $("#OriginalTitle_Id").val() },
success: function (result) {
$("#Subtitle_Id").append(' <option value="' + 0 + '">' +
"نام بخش را انتخاب کنید" + '</option>');
$.each(result, function (i, result) {
$("#Subtitle_Id").append(' <option value="' + result.id + '">' +
result.subtitle + '</option>');
});
},
error: function (ex) {
alert('Error');
}
});
return false;
});
<script>
$(document).ready(function() {
$("#OriginalTitle_Id").change(function() {
$("#Subtitle_Id").empty();
$.ajax({
type: 'GET',
url: '/Admin/Company/TextManager?handler=SubtitleList',
dataType: 'json',
data: { OriginalTitle_Id: $("#OriginalTitle_Id").val() },
success: function(result) {
$("#Subtitle_Id").append(` <option value="${0}">نام بخش را انتخاب کنید</option>`);
$.each(result,
function(i, result) {
$("#Subtitle_Id").append(` <option value="${result.id}">${result.subtitle}</option>`);
});
},
error: function(ex) {
alert('Error');
}
});
return false;
});
});
</script>
});
</script>
}

View File

@@ -1,5 +1,3 @@
using System.Collections.Generic;
using System.Linq;
using CompanyManagment.App.Contracts.Chapter;
using CompanyManagment.App.Contracts.OriginalTitle;
using CompanyManagment.App.Contracts.Subtitle;
@@ -7,134 +5,135 @@ using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
using Microsoft.AspNetCore.Mvc.Rendering;
namespace ServiceHost.Areas.Admin.Pages.Company.Chapter
namespace ServiceHost.Areas.Admin.Pages.Company.Chapter;
public class IndexModel : PageModel
{
private readonly IChapterApplication _chapterApplication;
private readonly IOriginalTitleApplication _originalTitleApplication;
public class IndexModel : PageModel
{
public string ChapterSearch = "false";
public string Message { get; set; }
public ChapterSearchModel searchModel;
public SelectList SelectListOriginalTitle;
private readonly ISubtitleApplication _subtitleApplication;
public SelectList categoryListItems;
public SelectList SelectListSubtitles;
public List<ChapterViewModel> Chapters;
public string ChapterSearch = "false";
public ChapterSearchModel searchModel;
public SelectList SelectListOriginalTitle;
public List<ChapterViewModel> Chapters;
public SelectList categoryListItems;
public SelectList SelectListSubtitles;
private readonly ISubtitleApplication _subtitleApplication;
private readonly IOriginalTitleApplication _originalTitleApplication;
private readonly IChapterApplication _chapterApplication;
public IndexModel(IChapterApplication chapterApplication, ISubtitleApplication subtitleApplication,
IOriginalTitleApplication originalTitleApplication)
{
_subtitleApplication = subtitleApplication;
_originalTitleApplication = originalTitleApplication;
public IndexModel(IChapterApplication chapterApplication, ISubtitleApplication subtitleApplication, IOriginalTitleApplication originalTitleApplication)
{
_subtitleApplication = subtitleApplication;
_originalTitleApplication = originalTitleApplication;
_chapterApplication = chapterApplication;
}
_chapterApplication = chapterApplication;
}
public string Message { get; set; }
public void OnGet(ChapterSearchModel searchModel)
{
Chapters = _chapterApplication.Search(searchModel);
SelectListOriginalTitle = new SelectList(_originalTitleApplication.GetAllOriginalTitle(), "Id", "Title");
SelectListSubtitles = new SelectList(_subtitleApplication.GetAllSubtitle(), "Id", "Subtitle");
public void OnGet(ChapterSearchModel searchModel)
{
Chapters = _chapterApplication.Search(searchModel);
SelectListOriginalTitle = new SelectList(_originalTitleApplication.GetAllOriginalTitle(), "Id", "Title");
SelectListSubtitles = new SelectList(_subtitleApplication.GetAllSubtitle(), "Id", "Subtitle");
if (Chapters != null)
{
if (searchModel.Subtitle_Id != 0)
{
ChapterSearch = "true";
}
if (Chapters != null)
if (searchModel.Subtitle_Id != 0)
ChapterSearch = "true";
}
}
public IActionResult OnGetCreate()
{
var allCategory = new CreateChapter
{
OriginalTitleViewModels = _originalTitleApplication.GetAllOriginalTitle().ToList()
.Select(x => new SelectListItem { Text = x.Title, Value = x.Id.ToString() }).ToList(),
SubtitleViewModels = _subtitleApplication.GetAllSubtitle().ToList()
.Select(x => new SelectListItem { Text = x.Subtitle, Value = x.Id.ToString() }).ToList()
};
return Partial("./Create", allCategory);
}
public IActionResult OnPostCreate(CreateChapter command)
{
var result = _chapterApplication.Create(command);
return new JsonResult(result);
}
}
public IActionResult OnGetCreate()
{
var allCategory = new CreateChapter
{
OriginalTitleViewModels = _originalTitleApplication.GetAllOriginalTitle().ToList().Select(x => new SelectListItem { Text = x.Title, Value = x.Id.ToString() }).ToList(),
SubtitleViewModels = _subtitleApplication.GetAllSubtitle().ToList().Select(x => new SelectListItem { Text = x.Subtitle, Value = x.Id.ToString() }).ToList()
};
return Partial("./Create", allCategory);
}
public IActionResult OnPostCreate(CreateChapter command)
{
var result = _chapterApplication.Create(command);
return new JsonResult(result);
}
public IActionResult OnGetEdit(long id)
{
var Chapter = _chapterApplication.GetDetails(id);
var ChapterEdit = new EditChapter
{
Id = id,
public IActionResult OnGetEdit(long id)
{
var Chapter = _chapterApplication.GetDetails(id);
var ChapterEdit = new EditChapter
{
Id = id,
Chapter = Chapter.Chapter,
Subtitle_Id = Chapter.Subtitle_Id,
OriginalTitle_Id = _subtitleApplication.GetAllSubtitle().ToList().Where(s => s.Id == Chapter.Subtitle_Id)
.SingleOrDefault().OriginalTitle_Id,
OriginalTitleViewModels = _originalTitleApplication.GetAllOriginalTitle().ToList()
.Select(x => new SelectListItem { Text = x.Title, Value = x.Id.ToString() }).ToList(),
SubtitleViewModels = _subtitleApplication.GetAllSubtitle().ToList()
.Select(x => new SelectListItem { Text = x.Subtitle, Value = x.Id.ToString() }).ToList()
};
return Partial("Edit", ChapterEdit);
}
Chapter = Chapter.Chapter,
Subtitle_Id = Chapter.Subtitle_Id,
OriginalTitle_Id = _subtitleApplication.GetAllSubtitle().ToList().Where(s => s.Id == Chapter.Subtitle_Id).SingleOrDefault().OriginalTitle_Id,
OriginalTitleViewModels = _originalTitleApplication.GetAllOriginalTitle().ToList().Select(x => new SelectListItem { Text = x.Title, Value = x.Id.ToString() }).ToList(),
SubtitleViewModels = _subtitleApplication.GetAllSubtitle().ToList().Select(x => new SelectListItem { Text = x.Subtitle, Value = x.Id.ToString() }).ToList()
public JsonResult OnPostEdit(EditChapter command)
{
var result = _chapterApplication.Edit(command);
return new JsonResult(result);
}
};
return Partial("Edit", ChapterEdit);
}
public JsonResult OnPostEdit(EditChapter command)
{
var result = _chapterApplication.Edit(command);
return new JsonResult(result);
}
public JsonResult OnPostDelete(EditChapter command)
{
var result = _chapterApplication.Edit(command);
return new JsonResult(result);
}
public JsonResult OnPostDelete(EditChapter command)
{
var result = _chapterApplication.Edit(command);
return new JsonResult(result);
}
public IActionResult OnGetDetails(long id)
{
var editchapter = _chapterApplication.GetDetails(id);
return Partial("Details", editchapter);
}
public IActionResult OnGetGroupDeActive(List<long> ids)
{
public IActionResult OnGetDetails(long id)
{
var editchapter = _chapterApplication.GetDetails(id);
return Partial("Details", editchapter);
}
foreach (var item in ids)
{
var result = _chapterApplication.DeActive(item);
}
return RedirectToPage("./Index");
public IActionResult OnGetGroupDeActive(List<long> ids)
{
foreach (var item in ids)
{
var result = _chapterApplication.DeActive(item);
}
}
public IActionResult OnGetGroupReActive(List<long> ids)
{
return RedirectToPage("./Index");
}
foreach (var item in ids)
{
var result = _chapterApplication.Active(item);
}
return RedirectToPage("./Index");
}
public IActionResult OnGetGroupReActive(List<long> ids)
{
foreach (var item in ids)
{
var result = _chapterApplication.Active(item);
}
public IActionResult OnGetDeActive(long id, string url)
{
var result = _chapterApplication.DeActive(id);
if (result.IsSuccedded)
return new JsonResult(url);
Message = result.Message;
return RedirectToPage(url);
}
public IActionResult OnGetIsActive(long id, string url)
{
var result = _chapterApplication.Active(id);
if (result.IsSuccedded)
return new JsonResult(url);
Message = result.Message;
return RedirectToPage(url);
}
}
return RedirectToPage("./Index");
}
public IActionResult OnGetDeActive(long id, string url)
{
var result = _chapterApplication.DeActive(id);
if (result.IsSuccedded)
return new JsonResult(url);
Message = result.Message;
return RedirectToPage(url);
}
}
public IActionResult OnGetIsActive(long id, string url)
{
var result = _chapterApplication.Active(id);
if (result.IsSuccedded)
return new JsonResult(url);
Message = result.Message;
return RedirectToPage(url);
}
}

View File

@@ -1,239 +1,226 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using CompanyManagment.App.Contracts.Checkout;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
namespace ServiceHost.Areas.Admin.Pages.Company.Checkouts
namespace ServiceHost.Areas.Admin.Pages.Company.Checkouts;
public class CheckoutPrintAllModel : PageModel
{
public class CheckoutPrintAllModel : PageModel
{
private readonly ICheckoutApplication _checkoutApplication;
public List<CheckoutViewModel> GroupPrintList;
public ChekoutDividPrintViewModel DividList;
public int StartPrint;
public int EndPrint;
public List<long> printIdList;
public CheckoutGroupPrintViewModel sendIds;
private readonly ICheckoutApplication _checkoutApplication;
public ChekoutDividPrintViewModel DividList;
public int EndPrint;
public List<CheckoutViewModel> GroupPrintList;
public List<long> printIdList;
public CheckoutGroupPrintViewModel sendIds;
public int StartPrint;
public CheckoutPrintAllModel(ICheckoutApplication checkoutApplication)
{
_checkoutApplication = checkoutApplication;
}
public CheckoutPrintAllModel(ICheckoutApplication checkoutApplication)
{
_checkoutApplication = checkoutApplication;
}
public void OnGet(string idlist)
{
var ids = ExtractNumbers(idlist);
var resultList = new List<CheckoutGroupPrintViewModel>();
public void OnGet(string idlist)
{
var ids = ExtractNumbers(idlist);
var resultList = new List<CheckoutGroupPrintViewModel>();
var res = _checkoutApplication.PrintAll(ids);
var res = _checkoutApplication.PrintAll(ids);
var printCounter = res.Count();
if (printCounter <= 25)
{
GroupPrintList = res;
var addToList = new CheckoutGroupPrintViewModel()
{
CheckoutIdList = res.Select(x => x.Id).ToList(),
StartPrint = 1,
EndPrint = printCounter,
};
var printCounter = res.Count();
if (printCounter <= 25)
{
GroupPrintList = res;
var addToList = new CheckoutGroupPrintViewModel
{
CheckoutIdList = res.Select(x => x.Id).ToList(),
StartPrint = 1,
EndPrint = printCounter
};
resultList.Add(addToList);
var finalResult = new ChekoutDividPrintViewModel()
{
CheckoutGroupPrintViewModels = resultList,
ButtonConter = resultList.Count,
};
DividList = finalResult;
}
else
{
var divide20 = printCounter / 20;
var multiple = printCounter - (divide20 * 20);
if (multiple == 0)
{
for (int i = 1; i <= printCounter; i += 20)
{
var start = i;
var end = i + 19;
if (i == 1)
{
GroupPrintList = res.Where(x => x.PrintCounter >= start && x.PrintCounter <= end).ToList();
var addToList = new CheckoutGroupPrintViewModel()
{
CheckoutIdList = res.Where(x => x.PrintCounter >= start && x.PrintCounter <= end).Select(x => x.Id).ToList(),
StartPrint = start,
EndPrint = end,
};
resultList.Add(addToList);
var finalResult = new ChekoutDividPrintViewModel
{
CheckoutGroupPrintViewModels = resultList,
ButtonConter = resultList.Count
};
DividList = finalResult;
}
else
{
var divide20 = printCounter / 20;
var multiple = printCounter - divide20 * 20;
if (multiple == 0)
{
for (var i = 1; i <= printCounter; i += 20)
{
var start = i;
var end = i + 19;
if (i == 1)
{
GroupPrintList = res.Where(x => x.PrintCounter >= start && x.PrintCounter <= end).ToList();
resultList.Add(addToList);
}
else
{
var addToList = new CheckoutGroupPrintViewModel()
{
CheckoutIdList = res.Where(x => x.PrintCounter >= start && x.PrintCounter <= end).Select(x => x.Id).ToList(),
StartPrint = start,
EndPrint = end,
};
resultList.Add(addToList);
}
var addToList = new CheckoutGroupPrintViewModel
{
CheckoutIdList = res.Where(x => x.PrintCounter >= start && x.PrintCounter <= end)
.Select(x => x.Id).ToList(),
StartPrint = start,
EndPrint = end
};
}
resultList.Add(addToList);
}
else
{
var addToList = new CheckoutGroupPrintViewModel
{
CheckoutIdList = res.Where(x => x.PrintCounter >= start && x.PrintCounter <= end)
.Select(x => x.Id).ToList(),
StartPrint = start,
EndPrint = end
};
resultList.Add(addToList);
}
}
var finalResult = new ChekoutDividPrintViewModel()
{
CheckoutGroupPrintViewModels = resultList,
ButtonConter = resultList.Count,
};
DividList = finalResult;
var finalResult = new ChekoutDividPrintViewModel
{
CheckoutGroupPrintViewModels = resultList,
ButtonConter = resultList.Count
};
DividList = finalResult;
}
else if (multiple <= 5)
{
var endOfround = 0;
for (var i = 1; i <= printCounter - 26; i += 20)
{
var start = i;
var end = i + 19;
}
else if (multiple <= 5)
{
int endOfround = 0;
for (int i = 1; i <= printCounter-26; i += 20)
{
var start = i;
var end = i + 19;
if (i == 1)
{
GroupPrintList = res.Where(x => x.PrintCounter >= start && x.PrintCounter <= end).ToList();
endOfround = end;
var addToList = new CheckoutGroupPrintViewModel()
{
CheckoutIdList = res.Where(x => x.PrintCounter >= start && x.PrintCounter <= end).Select(x => x.Id).ToList(),
StartPrint = start,
EndPrint = end,
};
resultList.Add(addToList);
}
else
{
var addToList = new CheckoutGroupPrintViewModel()
{
CheckoutIdList = res.Where(x => x.PrintCounter >= start && x.PrintCounter <= end).Select(x => x.Id).ToList(),
StartPrint = start,
EndPrint = end,
};
endOfround = end;
resultList.Add(addToList);
}
if (i == 1)
{
GroupPrintList = res.Where(x => x.PrintCounter >= start && x.PrintCounter <= end).ToList();
endOfround = end;
var addToList = new CheckoutGroupPrintViewModel
{
CheckoutIdList = res.Where(x => x.PrintCounter >= start && x.PrintCounter <= end)
.Select(x => x.Id).ToList(),
StartPrint = start,
EndPrint = end
};
}
resultList.Add(addToList);
}
else
{
var addToList = new CheckoutGroupPrintViewModel
{
CheckoutIdList = res.Where(x => x.PrintCounter >= start && x.PrintCounter <= end)
.Select(x => x.Id).ToList(),
StartPrint = start,
EndPrint = end
};
endOfround = end;
resultList.Add(addToList);
}
}
var count = res.Where(x => x.PrintCounter > endOfround).ToList();
var addLastPart = new CheckoutGroupPrintViewModel()
{
CheckoutIdList = res.Where(x => x.PrintCounter > endOfround).Select(x => x.Id).ToList(),
StartPrint = count.Select(x=>x.PrintCounter).FirstOrDefault(),
EndPrint = count.Select(x => x.PrintCounter).LastOrDefault(),
};
resultList.Add(addLastPart);
var finalResult = new ChekoutDividPrintViewModel()
{
CheckoutGroupPrintViewModels = resultList,
ButtonConter = resultList.Count,
};
DividList = finalResult;
}else if (multiple > 5)
{
int endOfround = 0;
var pcounter = multiple + 1;
for (int i = 1; i <= printCounter - pcounter; i += 20)
{
var start = i;
var end = i + 19;
var count = res.Where(x => x.PrintCounter > endOfround).ToList();
var addLastPart = new CheckoutGroupPrintViewModel
{
CheckoutIdList = res.Where(x => x.PrintCounter > endOfround).Select(x => x.Id).ToList(),
StartPrint = count.Select(x => x.PrintCounter).FirstOrDefault(),
EndPrint = count.Select(x => x.PrintCounter).LastOrDefault()
};
resultList.Add(addLastPart);
var finalResult = new ChekoutDividPrintViewModel
{
CheckoutGroupPrintViewModels = resultList,
ButtonConter = resultList.Count
};
DividList = finalResult;
}
else if (multiple > 5)
{
var endOfround = 0;
var pcounter = multiple + 1;
for (var i = 1; i <= printCounter - pcounter; i += 20)
{
var start = i;
var end = i + 19;
if (i == 1)
{
GroupPrintList = res.Where(x => x.PrintCounter >= start && x.PrintCounter <= end).ToList();
if (i == 1)
{
GroupPrintList = res.Where(x => x.PrintCounter >= start && x.PrintCounter <= end).ToList();
endOfround = end;
var addToList = new CheckoutGroupPrintViewModel()
{
CheckoutIdList = res.Where(x => x.PrintCounter >= start && x.PrintCounter <= end).Select(x => x.Id).ToList(),
StartPrint = start,
EndPrint = end,
};
endOfround = end;
var addToList = new CheckoutGroupPrintViewModel
{
CheckoutIdList = res.Where(x => x.PrintCounter >= start && x.PrintCounter <= end)
.Select(x => x.Id).ToList(),
StartPrint = start,
EndPrint = end
};
resultList.Add(addToList);
}
else
{
var addToList = new CheckoutGroupPrintViewModel()
{
CheckoutIdList = res.Where(x => x.PrintCounter >= start && x.PrintCounter <= end).Select(x => x.Id).ToList(),
StartPrint = start,
EndPrint = end,
};
endOfround = end;
resultList.Add(addToList);
}
resultList.Add(addToList);
}
else
{
var addToList = new CheckoutGroupPrintViewModel
{
CheckoutIdList = res.Where(x => x.PrintCounter >= start && x.PrintCounter <= end)
.Select(x => x.Id).ToList(),
StartPrint = start,
EndPrint = end
};
endOfround = end;
resultList.Add(addToList);
}
}
var count = res.Where(x => x.PrintCounter > endOfround).ToList();
var addLastPart = new CheckoutGroupPrintViewModel
{
CheckoutIdList = res.Where(x => x.PrintCounter > endOfround).Select(x => x.Id).ToList(),
StartPrint = count.Select(x => x.PrintCounter).FirstOrDefault(),
EndPrint = count.Select(x => x.PrintCounter).LastOrDefault()
};
resultList.Add(addLastPart);
var finalResult = new ChekoutDividPrintViewModel
{
CheckoutGroupPrintViewModels = resultList,
ButtonConter = resultList.Count
};
DividList = finalResult;
}
}
}
}
public IActionResult OnGetPrintAll(CheckoutGroupPrintViewModel sendIds)
{
var res = _checkoutApplication.PrintAll(sendIds.CheckoutIdList);
var result = new CheckoutGroupPrintViewModel
{
CheckoutViewModels = res
};
return Partial("PrintAll", result);
}
var count = res.Where(x => x.PrintCounter > endOfround).ToList();
var addLastPart = new CheckoutGroupPrintViewModel()
{
CheckoutIdList = res.Where(x => x.PrintCounter > endOfround).Select(x => x.Id).ToList(),
StartPrint = count.Select(x => x.PrintCounter).FirstOrDefault(),
EndPrint = count.Select(x => x.PrintCounter).LastOrDefault(),
};
resultList.Add(addLastPart);
var finalResult = new ChekoutDividPrintViewModel()
{
CheckoutGroupPrintViewModels = resultList,
ButtonConter = resultList.Count,
};
DividList = finalResult;
}
}
private static List<long> ExtractNumbers(string input)
{
var numbers = new List<long>();
var pattern = @"\d+"; // Matches one or more digits
}
var matches = Regex.Matches(input, pattern);
public IActionResult OnGetPrintAll(CheckoutGroupPrintViewModel sendIds)
{
var res = _checkoutApplication.PrintAll(sendIds.CheckoutIdList);
var result = new CheckoutGroupPrintViewModel()
{
CheckoutViewModels = res,
};
return Partial("PrintAll", result);
}
foreach (Match match in matches)
if (long.TryParse(match.Value, out var number))
numbers.Add(number);
static List<long> ExtractNumbers(string input)
{
List<long> numbers = new List<long>();
string pattern = @"\d+"; // Matches one or more digits
MatchCollection matches = Regex.Matches(input, pattern);
foreach (Match match in matches)
{
if (long.TryParse(match.Value, out long number))
{
numbers.Add(number);
}
}
return numbers;
}
}
}
return numbers;
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -1,6 +1,6 @@
@model CompanyManagment.App.Contracts.Checkout.CheckoutViewModel
@{
<style>
<style>
/* .modal-dialog {
width: 94% !important;
@@ -82,112 +82,110 @@
}
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true"><span style="font-size: 24px">×</span></button>
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">
<span style="font-size: 24px">×</span>
</button>
</div>
<form asp-page="./Index" asp-page-handler="CustomSet" autocomplete="off"
method="post"
data-ajax="true"
data-callback=""
data-action="CustomSet">
<div class="modal-body">
<div class="row">
<form asp-page="./Index" asp-page-handler="CustomSet" autocomplete="off"
method="post"
data-ajax="true"
data-callback=""
data-action="CustomSet">
<div class="modal-body">
<div class="row">
<fieldset style="border: 1px solid black !important;-webkit-print-color-adjust: exact; border-radius: 10px 10px 10px 10px; margin: 20px 10px;">
<table style="table-layout: fixed; width: 100%">
<fieldset style="border: 1px solid black !important;-webkit-print-color-adjust: exact; border-radius: 10px 10px 10px 10px; margin: 20px 10px;">
<table style="table-layout: fixed; width: 100%">
<div class="topTable">
<span class="topRightTable"> @Model.EmployeeFullName </span>
@*<th style="text-align: center; border-left: 2px solid #000; font-size: 12px"> </th>*@
@*<th style="text-align: center; font-size: 13px; padding-top: 4px;"></th>*@
<span class="topLeftTable"> <span>@Model.Month </span>&nbsp;<span>@Model.Year</span> </span>
</div>
<div class="topTable">
<tr style="border-bottom: 1px solid; background-color: #e1e1e1 !important; height: 18px;-webkit-print-color-adjust: exact; ">
<th style="width: 30mm; text-align: center; border-left: 1px solid #000; font-size: 12px; background-color: #b0ffa2"> مطالبات </th>
<th style="width: 30mm; text-align: center; border-left: 2px solid #000; font-size: 12px; background-color: #b0ffa2"> مبلغ(ریال) </th>
<th style="width: 30mm; text-align: center; border-left: 1px solid #000; font-size: 12px; background-color: #ff9a9a"> کسورات </th>
<th style="width: 30mm; text-align: center; font-size: 12px; background-color: #ff9a9a"> مبلغ(ریال) </th>
</tr>
<span class="topRightTable"> @Model.EmployeeFullName </span>
@*<th style="text-align: center; border-left: 2px solid #000; font-size: 12px"> </th>*@
@*<th style="text-align: center; font-size: 13px; padding-top: 4px;"></th>*@
<span class="topLeftTable"> <span>@Model.Month </span>&nbsp;<span>@Model.Year</span> </span>
</div>
<tr style="border-bottom: 1px solid; background-color: #e1e1e1 !important; height: 18px;-webkit-print-color-adjust: exact; ">
<th style="width: 30mm; text-align: center; border-left: 1px solid #000; font-size: 12px; background-color: #b0ffa2"> مطالبات </th>
<th style="width: 30mm; text-align: center; border-left: 2px solid #000; font-size: 12px; background-color: #b0ffa2"> مبلغ(ریال) </th>
<th style="width: 30mm; text-align: center; border-left: 1px solid #000; font-size: 12px; background-color: #ff9a9a"> کسورات </th>
<th style="width: 30mm; text-align: center; font-size: 12px; background-color: #ff9a9a"> مبلغ(ریال) </th>
</tr>
<tr style="font-size: 12px; ">
<td style="padding-right: 8px; border-left: 1px solid #000;"> پاداش </td>
<td style="text-align: center; border-left: 2px solid #000;">
<input dir="ltr" type="text" id="amount" asp-for="RewardPay" style="text-align: center; width: 100%;" placeholder="مبلغ قرارداد" class="form-control" />
</td>
<td style="padding-right: 8px; border-left: 1px solid #000;"> مساعده</td>
<td style="text-align: center;">
<input dir="ltr" type="text" id="obligation" asp-for="SalaryAidDeduction" style="text-align: center; width: 100%;" placeholder="وجه التزام" class="form-control" />
</td>
</tr>
<tr style="font-size: 12px; ">
</table>
</fieldset>
<td style="padding-right: 8px; border-left: 1px solid #000;"> پاداش </td>
<td style="text-align: center; border-left: 2px solid #000;">
<input dir="ltr" type="text" id="amount" asp-for="RewardPay" style="text-align: center; width: 100%;" placeholder="مبلغ قرارداد" class="form-control"/>
</td>
<td style="padding-right: 8px; border-left: 1px solid #000;"> مساعده</td>
<td style="text-align: center;">
<input dir="ltr" type="text" id="obligation" asp-for="SalaryAidDeduction" style="text-align: center; width: 100%;" placeholder="وجه التزام" class="form-control"/>
</td>
</tr>
</table>
</fieldset>
</div>
</div>
</div>
<input type="hidden" asp-for="Id" value="@Model.Id"/>
</div>
<input type="hidden" asp-for="Id" value="@Model.Id" />
<div class="modal-footer m-b-10">
<div class="modal-footer m-b-10">
<button id="sendData" type="submit" class="btn btn-success btn-rounded waves-effect waves-light pull-left">ذخیره</button>
<button id="sendData" type="submit" class="btn btn-success btn-rounded waves-effect waves-light pull-left">ذخیره</button>
<button type="button" class="btn btn-default btn-rounded waves-effect waves-light pull-left m-b-5" id="closing" data-dismiss="modal">بستن</button>
</div>
<button type="button" class="btn btn-default btn-rounded waves-effect waves-light pull-left m-b-5" id="closing" data-dismiss="modal">بستن</button>
</div>
</form>
<script src="~/AdminTheme/js/numeral.min.js"></script>
</form>
<script src="~/AdminTheme/js/numeral.min.js"></script>
<script>
$(document).ready(function() {
$(document).ready(function() {
$('#amount').on('input', function () {
this.value = this.value.replace(/[^\d]/, '');
var contractAmount = $("#amount");
//setting format
numeral.defaultFormat("0,0 تومان");
contractAmount.on("keyup", function(e) {
contractAmount.val(numeral(contractAmount.val()).format());
});
});
$('#amount').on('input',
function() {
this.value = this.value.replace(/[^\d]/, '');
var contractAmount = $("#amount");
//setting format
numeral.defaultFormat("0,0 تومان");
contractAmount.on("keyup",
function(e) {
contractAmount.val(numeral(contractAmount.val()).format());
});
$('#obligation').on('input', function () {
this.value = this.value.replace(/[^\d]/, '');
var obligation = $("#obligation");
//setting format
numeral.defaultFormat("0,0 تومان");
obligation.on("keyup", function(e) {
obligation.val(numeral(obligation.val()).format());
});
});
});
$('#obligation').on('input',
function() {
this.value = this.value.replace(/[^\d]/, '');
var obligation = $("#obligation");
//setting format
numeral.defaultFormat("0,0 تومان");
obligation.on("keyup",
function(e) {
obligation.val(numeral(obligation.val()).format());
});
});
});
});
</script>

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -1,9 +1,9 @@
@model CompanyManagment.App.Contracts.Checkout.CheckoutLeavePrintViewModel
@{
<link href="~/AdminTheme/assets/printjs/print.min.css" rel="stylesheet" type="text/css" />
<link href="~/AdminTheme/assets/printjs/print.min.css" rel="stylesheet" type="text/css"/>
<style>
<style>
.modal .modal-dialog .modal-content {
background-color: white !important;
}
@@ -202,7 +202,7 @@
}
<div class="modal-header" style="border-bottom: unset">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
</div>
<form asp-page="./Index" asp-page-handler="Details"
@@ -211,83 +211,88 @@
data-callback=""
data-action="Refresh"
enctype="multipart/form-data">
<div class="modal-body print" id="printThis">
<div class="row">
<div class="col-md-12" style="margin-top: 10px;">
@if(Model.LeaveList.Count > 0) {
<fieldset style="border-radius: 10px; height: 28cm; margin: 3mm 5mm 0 5mm; ">
@foreach (var item in @Model.LeaveList)
{
<div class="section-leave">
<div class="row">
<div class="col-xs-3 d-inline-block"><fieldset style="border: 1px solid black; border-radius: 15px; padding: 1px 15px 1px 15px; width: 60%; font-size: 12px; text-align: center;"> @Model.ContractNo</fieldset></div>
<div class="col-xs-6 d-inline-block text-center">
<p style="font-size: 15px; font-weight: bold">برگ مرخصی</p>
</div>
<div class="col-xs-3 d-inline-block" style="text-align: left;">
@if (item.PaidLeaveType == "روزانه")
{
<span class="leave-day" style="font-size: 12px !important;">مرخصی روزانه</span>
}
else
{
<span class="leave-hour" style="font-size: 12px !important;">مرخصی ساعتی</span>
}
</div>
</div>
<div class="modal-body print" id="printThis">
<div class="row">
<div class="col-md-12" style="margin-top: 10px;">
@if (Model.LeaveList.Count > 0)
{
<fieldset style="border-radius: 10px; height: 28cm; margin: 3mm 5mm 0 5mm; ">
@foreach (var item in Model.LeaveList)
{
<div class="section-leave">
<div class="row">
<div class="col-xs-3 d-inline-block">
<fieldset style="border: 1px solid black; border-radius: 15px; padding: 1px 15px 1px 15px; width: 60%; font-size: 12px; text-align: center;"> @Model.ContractNo</fieldset>
</div>
<div class="col-xs-6 d-inline-block text-center">
<p style="font-size: 15px; font-weight: bold">برگ مرخصی</p>
</div>
<div class="col-xs-3 d-inline-block" style="text-align: left;">
@if (item.PaidLeaveType == "روزانه")
{
<span class="leave-day" style="font-size: 12px !important;">مرخصی روزانه</span>
}
else
{
<span class="leave-hour" style="font-size: 12px !important;">مرخصی ساعتی</span>
}
</div>
</div>
<p class="title"><span>@Model.WorkshopName</span></p>
<p class="title">
<span>@Model.WorkshopName</span>
</p>
<p class="paragraph">
اینجانب <span class="active-paragraph">@Model.EmployeeFullName</span> به کد ملی <span class="active-paragraph">@Model.NationalCode</span> پرسنل مجموعه <span class="active-paragraph">@Model.WorkshopName</span>
<p class="paragraph">
اینجانب <span class="active-paragraph">@Model.EmployeeFullName</span> به کد ملی <span class="active-paragraph">@Model.NationalCode</span> پرسنل مجموعه <span class="active-paragraph">@Model.WorkshopName</span>
@{
if (@Model.EmployerList.FirstOrDefault().IsLegal == "حقیقی")
{
<span>به کارفرمایی</span>
if (@Model.EmployerList.Count > 1)
{
<span class="active-paragraph"> @Model.EmployerList[0].EmployerFullName </span>
<span>، </span>
<span class="active-paragraph"> @Model.EmployerList[1].EmployerFullName </span>
if (@Model.EmployerList.Count > 2)
{
<span>و غیره</span>
}
}
else
{
<span class="active-paragraph">@Model.EmployerList.FirstOrDefault().EmployerFullName</span>
}
}
}
@{
if (Model.EmployerList.FirstOrDefault().IsLegal == "حقیقی")
{
<span>به کارفرمایی</span>
if (Model.EmployerList.Count > 1)
{
<span class="active-paragraph"> @Model.EmployerList[0].EmployerFullName </span>
<span>، </span>
<span class="active-paragraph"> @Model.EmployerList[1].EmployerFullName </span>
if (Model.EmployerList.Count > 2)
{
<span>و غیره</span>
}
}
else
{
<span class="active-paragraph">@Model.EmployerList.FirstOrDefault().EmployerFullName</span>
}
}
}
متقاضی استفاده از مرخصی استحقاقی وفق تاریخ ذیل می باشم.
متقاضی استفاده از مرخصی استحقاقی وفق تاریخ ذیل می باشم.
<br/>
<br/>
@if (item.PaidLeaveType == "روزانه")
{
<span class="active-paragraph">@item.StartLeave</span>
<span>لغایت</span>
<span class="active-paragraph">@item.EndLeave</span>
<span>به مدت</span>
<span class="active-paragraph">1</span>
<span>روز کاری.</span>
}
else
{
<span>مورخ <span class="active-paragraph">@item.StartLeave</span> از ساعت <span class="active-paragraph">@item.StartLeaveGr.ToString("HH:mm")</span> الی <span class="active-paragraph">@item.EndLeaveGr.ToString("HH:mm")</span> (مجموعا @item.LeaveHourses)</span>
}
@if (item.PaidLeaveType == "روزانه")
{
<span class="active-paragraph">@item.StartLeave</span>
<span>لغایت</span>
<span class="active-paragraph">@item.EndLeave</span>
<span>به مدت</span>
<span class="active-paragraph">1</span>
<span>روز کاری.</span>
}
else
{
<span>مورخ <span class="active-paragraph">@item.StartLeave</span> از ساعت <span class="active-paragraph">@item.StartLeaveGr.ToString("HH:mm")</span> الی <span class="active-paragraph">@item.EndLeaveGr.ToString("HH:mm")</span> (مجموعا @item.LeaveHourses)</span>
}
<br/>
<br/>
در صورت تایید کارفرما یا نماینده ایشان با بازه زمانی فوق از مرخصی استحقاقی استفاده می نمایم.
در صورت تایید کارفرما یا نماینده ایشان با بازه زمانی فوق از مرخصی استحقاقی استفاده می نمایم.
<br/>
<br/>
<br/>
<br/>
@* <div class="status">
@* <div class="status">
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<rect x="3.5" y="3.5" width="17" height="17" rx="2.5" stroke-width="1.5" stroke="#222222" />
<path d="M8 12L11 15L16 9" stroke-width="1.5" stroke="#222222" stroke-linecap="round" />
@@ -297,94 +302,92 @@
</span>
</div> *@
<div class="status">
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<rect x="3.5" y="3.5" width="17" height="17" rx="2.5" stroke-width="1.5" stroke="#222222"/>
<path d="M9 9L15 15" stroke-width="1.5" stroke="#222222" stroke-width="1.2" stroke-linecap="round"/>
<path d="M15 9L9 15" stroke-width="1.5" stroke="#222222" stroke-width="1.2" stroke-linecap="round"/>
</svg>
<span>
عدم موافقت: <span class="active-paragraph">به دلیل عدم انجام کارای اداری.</span>
</span>
</div>
</p>
<div class="status">
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<rect x="3.5" y="3.5" width="17" height="17" rx="2.5" stroke-width="1.5" stroke="#222222"/>
<path d="M9 9L15 15" stroke-width="1.5" stroke="#222222" stroke-width="1.2" stroke-linecap="round"/>
<path d="M15 9L9 15" stroke-width="1.5" stroke="#222222" stroke-width="1.2" stroke-linecap="round"/>
</svg>
<span>
عدم موافقت: <span class="active-paragraph">به دلیل عدم انجام کارای اداری.</span>
</span>
</div>
</p>
<div class="signature-section">
<div class="signature-card">
<p class="signature-title">امضاء کارفرما / نماینده کارفرما</p>
<div class="signature-border"></div>
</div>
<div class="signature-section">
<div class="signature-card">
<p class="signature-title">امضاء کارفرما / نماینده کارفرما</p>
<div class="signature-border"></div>
</div>
<div class="signature-card">
<p class="signature-title">امضاء پرسنل</p>
<div class="signature-border"></div>
</div>
</div>
</div>
}
</fieldset>
}
else
{
<div class="text-center">
<h3>هیچ مرخصی برای پرسنل @Model.EmployeeFullName ثبت نشده است!</h3>
</div>
}
</div>
</div>
</div>
<div class="signature-card">
<p class="signature-title">امضاء پرسنل</p>
<div class="signature-border"></div>
</div>
</div>
</div>
}
</fieldset>
}
else
{
<div class="text-center">
<h3>هیچ مرخصی برای پرسنل @Model.EmployeeFullName ثبت نشده است!</h3>
</div>
}
</div>
</div>
</div>
<input type="hidden" asp-for="Id" value="@Model.Id"/>
<input type="hidden" asp-for="Id" value="@Model.Id" />
<div class="modal-footer" style="border-top: unset; padding: 1px 15px 10px;">
@* <button type="button" onclick="printJS('printThis', 'html')">
<div class="modal-footer" style="border-top: unset; padding: 1px 15px 10px;">
@* <button type="button" onclick="printJS('printThis', 'html')">
Print Test
</button> *@
@if (Model.LeaveList.Count > 0)
{
<button id="btnPrint" type="button" class="btn btn-success btn-rounded waves-effect waves-light">پرینت برگ مرخصی </button>
}
<button type="button" id="closingOnePrint" class="btn btn-warning btn-rounded waves-effect waves-light m-b-10" data-dismiss="modal">بستن فرم</button>
</div>
@if (Model.LeaveList.Count > 0)
{
<button id="btnPrint" type="button" class="btn btn-success btn-rounded waves-effect waves-light">پرینت برگ مرخصی </button>
}
<button type="button" id="closingOnePrint" class="btn btn-warning btn-rounded waves-effect waves-light m-b-10" data-dismiss="modal">بستن فرم</button>
</div>
</form>
<!--<script src="~/AdminTheme/assets/js/workingHoursPrintable.js"></script>-->
<script src="~/AdminTheme/assets/printjs/print.min.js"></script>
<script>
$(document).ready(function () {
$(document).ready(function() {
document.getElementById("btnPrint").onclick = function () {
printElement(document.getElementById("printThis"));
}
document.getElementById("btnPrint").onclick = function() {
printElement(document.getElementById("printThis"));
};
function printElement(elem) {
var domClone = elem.cloneNode(true);
function printElement(elem) {
const domClone = elem.cloneNode(true);
var $printSection = document.getElementById("printSection");
var $printSection = document.getElementById("printSection");
if (!$printSection) {
$printSection = document.createElement("div");
$printSection.id = "printSection";
document.body.appendChild($printSection);
}
if (!$printSection) {
$printSection = document.createElement("div");
$printSection.id = "printSection";
document.body.appendChild($printSection);
}
$printSection.innerHTML = "";
$printSection.appendChild(domClone);
window.print();
$printSection.innerHTML = "";
$printSection.appendChild(domClone);
window.print();
}
});
// window.onfocus=function(){
// $('#closingOnePrint').click();
// }
// window.onafterprint=function(){
// $('#closingOnePrint').click();
// }
}
});
// window.onfocus=function(){
// $('#closingOnePrint').click();
// }
// window.onafterprint=function(){
// $('#closingOnePrint').click();
// }
</script>

View File

@@ -1,8 +1,7 @@
@model CompanyManagment.App.Contracts.Checkout.CreateCheckout
@{
int i = 1;
int b = 0;
var i = 1;
var b = 0;
@@ -17,75 +16,71 @@
@if (Model.Contracts != null)
{
@foreach (var item in Model.Contracts)
{
@foreach (var item in Model.Contracts)
{
<tr class="mytable">
@if (item.RedColor)
{
<input type="hidden" name="redColor"/>
}
@if (item.MoreThanOneMonth && item.Waiting == false)
{
<input type="hidden" value="@item.EmployeeName" name="MoreThanOneMonth"/>
}
else if (item.Waiting && item.MoreThanOneMonth == false)
{
<input type="hidden" value="@item.EmployeeName" name="Waiting"/>
}
else if (item.Waiting && item.MoreThanOneMonth)
{
<input type="hidden" value="@item.EmployeeName" name="MixWatingAndMore"/>
}
<td style="font-size: 12px !important; text-align: center">
@i
</td>
<td style="font-size: 12px !important; text-align: center">
@if (item.Extension)
{
<input type="checkbox" name="cheking" value="@item.Id" checked="checked"/>
<tr class="mytable">
@if (item.RedColor)
{
<input type="hidden" name="redColor" />
}
@if (item.MoreThanOneMonth && item.Waiting == false)
{
<input type="hidden" value="@item.EmployeeName" name="MoreThanOneMonth" />
}
else if (item.Waiting && item.MoreThanOneMonth == false)
{
<input type="hidden" value="@item.EmployeeName" name="Waiting" />
}
else if (item.Waiting && item.MoreThanOneMonth)
{
<input type="hidden" value="@item.EmployeeName" name="MixWatingAndMore" />
}
<td style="font-size: 12px !important; text-align: center">
@i
</td>
<td style="font-size: 12px !important; text-align: center">
@if (item.Extension)
{
<input type="checkbox" name="cheking" value="@item.Id" checked="checked" />
b++;
}
else
{
@if (item.RedColor)
{
<input type="checkbox" value="@item.Id" disabled="disabled" />
}
else
{
<input type="checkbox" name="cheking" value="@item.Id" />
}
}
b++;
}
else
{
@if (item.RedColor)
{
<input type="checkbox" value="@item.Id" disabled="disabled"/>
}
else
{
<input type="checkbox" name="cheking" value="@item.Id"/>
}
}
</td>
<td style="font-family: 'IranText' !important; font-size: 12px !important; text-align: center">
</td>
<td style="font-family: 'IranText' !important; font-size: 12px !important; text-align: center">
@item.PersonnelCode
@item.PersonnelCode
</td>
<td style="font-family: 'IranText' !important; font-size: 12px !important; text-align: center">
</td>
<td style="font-family: 'IranText' !important; font-size: 12px !important; text-align: center">
@item.ContractNo
@item.ContractNo
</td>
</td>
<td style="font-family: 'IranSans' !important; font-size: 12px !important; text-align: right">
@*@foreach (var emp in Model.Employers)
<td style="font-family: 'IranSans' !important; font-size: 12px !important; text-align: right">
@*@foreach (var emp in Model.Employers)
{
if (item.EmployerId == emp.Id)
{
@@ -93,160 +88,145 @@
}
}*@
@item.EmployerName
</td>
@item.EmployerName
</td>
<td style="font-family: 'IranSans' !important; font-size: 12px !important; text-align: right">
<td style="font-family: 'IranSans' !important; font-size: 12px !important; text-align: right">
@item.WorkshopName
</td>
@item.WorkshopName
</td>
<td style="font-family: 'IranSans' !important; font-size: 12px !important; text-align: right">
<td style="font-family: 'IranSans' !important; font-size: 12px !important; text-align: right">
@item.EmployeeName
@item.EmployeeName
</td>
</td>
<td style="font-family: 'IranSans' !important; font-size: 12px !important; text-align: center">
@item.ContarctStart
</td>
<td style="font-family: 'IranSans' !important; font-size: 12px !important; text-align: center">
@if (item.LaterThanEnd)
{
<span style="visibility: hidden">####/##/##</span>
}
else
{
@item.ContractEnd
}
</td>
<td style="font-family: 'IranSans' !important; font-size: 12px !important; text-align: center">
@if (item.RedColor == false)
{
<span style="color: #1e88e5;">
@item.NextMonthStart
<td style="font-family: 'IranSans' !important; font-size: 12px !important; text-align: center">
</span>
}
@item.ContarctStart
@if (item.NextMonthStart == null)
{
<span style="visibility: hidden">####/##/##</span>
}
</td>
<td style="font-family: 'IranSans' !important; font-size: 12px !important; text-align: center">
</td>
@if (item.LaterThanEnd)
{
<span style="visibility: hidden">####/##/##</span>
}
else
{
@item.ContractEnd
}
<td style="font-family: 'IranSans' !important; font-size: 12px !important; text-align: center">
@if (item.LaterThanEnd)
{
@item.ContractEnd
}
else
{
<span style="visibility: hidden">####/##/##</span>
}
</td>
@{
i++;
}
</td>
<td style="font-family: 'IranSans' !important; font-size: 12px !important; text-align: center">
@if (item.RedColor == false)
{
<span style="color: #1e88e5;">
@item.NextMonthStart
</span>
}
@if (@item.NextMonthStart == null)
{
<span style="visibility: hidden">####/##/##</span>
}
</td>
<td style="font-family: 'IranSans' !important; font-size: 12px !important; text-align: center">
@if (item.LaterThanEnd)
{
@item.ContractEnd
}
else
{
<span style="visibility: hidden">####/##/##</span>
}
</td>
@{
i++;
}
</tr>
}
</tr>
}
}
<script>
$(document).ready(function () {
var waitingLoad = $("#listwaiting");
waitingLoad.remove();
});
$(document).ready(function() {
const waitingLoad = $("#listwaiting");
waitingLoad.remove();
});
</script>
<script>
//var redCheck = $('.redColor').val();
//if (redCheck == true) {
// console.log("ok");
// $('.redColor').closest('tr').css("background", "red");
//}
//var redCheck = $('.redColor').val();
//if (redCheck == true) {
// console.log("ok");
// $('.redColor').closest('tr').css("background", "red");
//}
var checkboxes = document.getElementsByName('redColor');
for (var i = 0, n = checkboxes.length; i < n; i++) {
checkboxes[i].parentNode.style.background = "rgb(248 251 196)";
}
var checkboxes = document.getElementsByName('Waiting');
for (var i = 0, n = checkboxes.length; i < n; i++) {
checkboxes[i].parentNode.style.background = "#ffcd40";
}
var checkboxes = document.getElementsByName('MoreThanOneMonth');
for (var i = 0, n = checkboxes.length; i < n; i++) {
checkboxes[i].parentNode.style.background = "#daf9ca";
}
var checkboxes = document.getElementsByName('MixWatingAndMore');
for (var i = 0, n = checkboxes.length; i < n; i++) {
checkboxes[i].parentNode.style.background = "#ffcd40";
}
var checkboxes2 = document.getElementsByName('MixWatingAndMore');
//for (var s = 0, m = checkboxes2.length; s < m; s++) {
// $('#alarm').append(
var checkboxes = document.getElementsByName('redColor');
for (var i = 0, n = checkboxes.length; i < n; i++) {
checkboxes[i].parentNode.style.background = "rgb(248 251 196)";
}
var checkboxes = document.getElementsByName('Waiting');
for (var i = 0, n = checkboxes.length; i < n; i++) {
checkboxes[i].parentNode.style.background = "#ffcd40";
}
var checkboxes = document.getElementsByName('MoreThanOneMonth');
for (var i = 0, n = checkboxes.length; i < n; i++) {
checkboxes[i].parentNode.style.background = "#daf9ca";
}
var checkboxes = document.getElementsByName('MixWatingAndMore');
for (var i = 0, n = checkboxes.length; i < n; i++) {
checkboxes[i].parentNode.style.background = "#ffcd40";
}
var checkboxes2 = document.getElementsByName('MixWatingAndMore');
//for (var s = 0, m = checkboxes2.length; s < m; s++) {
// $('#alarm').append(
// '<h5 style="color:red; direction: rtl;" class="ConvertErr"><span> مدت قرارد </span> <span>&nbsp;</span><span>' + checkboxes2[s].value + '</span> <span>&nbsp;</span><span> بیش از یک ماه است</span></h5>'
// + '<h5 style="color: #ffa12c; direction: rtl;" class="ConvertErr"><span> از آخرین قرارداد </span> <span>&nbsp;</span><span>' + checkboxes2[s].value + '</span> <span>&nbsp;</span><span> تا تاریخ تبدیل انتخاب شده هیچ قراردادی وجود ندارد</span></h5>'
// );
//}
//var checkboxes2 = document.getElementsByName('MoreThanOneMonth');
//for (var b = 0, m = checkboxes2.length; b < m; b++) {
// $('#alarm').append(
// '<h5 style="color:red; direction: rtl;" class="ConvertErr"><span> مدت قرارد </span> <span>&nbsp;</span><span>' + checkboxes2[s].value + '</span> <span>&nbsp;</span><span> بیش از یک ماه است</span></h5>'
// + '<h5 style="color: #ffa12c; direction: rtl;" class="ConvertErr"><span> از آخرین قرارداد </span> <span>&nbsp;</span><span>' + checkboxes2[s].value + '</span> <span>&nbsp;</span><span> تا تاریخ تبدیل انتخاب شده هیچ قراردادی وجود ندارد</span></h5>'
// );
//}
//var checkboxes2 = document.getElementsByName('MoreThanOneMonth');
//for (var b = 0, m = checkboxes2.length; b < m; b++) {
// $('#alarm').append(
// '<h5 style="color:red; direction: rtl;" class="ConvertErr"><span> مدت قرارد </span> <span>&nbsp;</span><span>' + checkboxes2[b].value + '</span> <span>&nbsp;</span><span> بیش از یک ماه است</span></h5>'
// );
//}
//var checkboxes3 = document.getElementsByName('Waiting');
//for (var a = 0, f = checkboxes3.length; a < f; a++) {
// $('#alarm').append(
// '<h5 style="color: #ffa12c; direction: rtl;" class="ConvertErr"><span> از آخرین قرارداد </span> <span>&nbsp;</span><span>' + checkboxes3[a].value + '</span> <span>&nbsp;</span><span> تا تاریخ تبدیل انتخاب شده هیچ قراردادی وجود ندارد</span></h5>'
// );
//}
/*ff8f8d*/
</script>
// '<h5 style="color:red; direction: rtl;" class="ConvertErr"><span> مدت قرارد </span> <span>&nbsp;</span><span>' + checkboxes2[b].value + '</span> <span>&nbsp;</span><span> بیش از یک ماه است</span></h5>'
// );
//}
//var checkboxes3 = document.getElementsByName('Waiting');
//for (var a = 0, f = checkboxes3.length; a < f; a++) {
// $('#alarm').append(
// '<h5 style="color: #ffa12c; direction: rtl;" class="ConvertErr"><span> از آخرین قرارداد </span> <span>&nbsp;</span><span>' + checkboxes3[a].value + '</span> <span>&nbsp;</span><span> تا تاریخ تبدیل انتخاب شده هیچ قراردادی وجود ندارد</span></h5>'
// );
//}
/*ff8f8d*/
</script>

View File

@@ -1,7 +1,7 @@
@page
@model ServiceHost.Areas.Admin.Pages.Company.ClassifiedSalary.IndexModel
@{
<style>
<style>
.container .searchPannel {
background: aliceblue;
overflow-x: scroll;
@@ -284,138 +284,141 @@
bottom: 40px;
}
</style>
}
<div class="row">
<div class="col-sm-12 m-r-10">
<div class="col-sm-12 m-r-10">
<p class="pull-right">
<a id="btnPopModal" href="#showmodal=@Url.Page("/Company/ClassifiedSalary/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 class="pull-right">
<a id="btnPopModal" href="#showmodal=@Url.Page("/Company/ClassifiedSalary/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>
</p>
</div>
</div>
</div>
<div class="container searchPannel">
<h3 class="panel-title" style="display: inline-block;color: #7a96a6"><i class="fa fa-list" style="padding-left: 3px; font-size: 14px"></i> لیست کروه ها</h3>
<h3 class="panel-title" style="display: inline-block;color: #7a96a6"><i class="fa fa-list" style="padding-left: 3px; font-size: 14px"></i> لیست کروه ها</h3>
<table class="table">
<thead>
<tr>
<th>سال</th>
<th> گروه 1 </th>
<th> گروه 2 </th>
<th> گروه 3 </th>
<th> گروه 4 </th>
<th> گروه 5 </th>
<th> گروه 6 </th>
<th> گروه 7 </th>
<th> گروه 8 </th>
<th> گروه 9 </th>
<th> گروه 10 </th>
<th> گروه 11 </th>
<th> گروه 12 </th>
<th> گروه 13 </th>
<th> گروه 14 </th>
<th> گروه 15 </th>
<th> گروه 16 </th>
<th> گروه 17 </th>
<th> گروه 18 </th>
<th> گروه 19 </th>
<th> گروه 20 </th>
<th> عملیات</th>
<table class="table">
<thead>
<tr>
<th>سال</th>
<th> گروه 1 </th>
<th> گروه 2 </th>
<th> گروه 3 </th>
<th> گروه 4 </th>
<th> گروه 5 </th>
<th> گروه 6 </th>
<th> گروه 7 </th>
<th> گروه 8 </th>
<th> گروه 9 </th>
<th> گروه 10 </th>
<th> گروه 11 </th>
<th> گروه 12 </th>
<th> گروه 13 </th>
<th> گروه 14 </th>
<th> گروه 15 </th>
<th> گروه 16 </th>
<th> گروه 17 </th>
<th> گروه 18 </th>
<th> گروه 19 </th>
<th> گروه 20 </th>
<th> عملیات</th>
</tr>
</thead>
<tbody class="tb">
</tr>
</thead>
<tbody class="tb">
@foreach (var item in @Model.ClassifiedSalaryViewModes)
{
<tr>
<td style="text-align: center"><span class="numbers">@item.YearSt</span></td>
<td>@item.Group1</td>
<td>@item.Group2</td>
<td>@item.Group3</td>
<td>@item.Group4</td>
<td>@item.Group5</td>
<td>@item.Group6</td>
<td>@item.Group7</td>
<td>@item.Group8</td>
<td>@item.Group9</td>
<td>@item.Group10</td>
<td>@item.Group11</td>
<td>@item.Group12</td>
<td>@item.Group13</td>
<td>@item.Group14</td>
<td>@item.Group15</td>
<td>@item.Group16</td>
<td>@item.Group17</td>
<td>@item.Group18</td>
<td>@item.Group19</td>
<td>@item.Group20</td>
<td>
<a class="btn btn-danger pull-left m-rl-5 rad"
onclick="removeBlocked(@item.Id)">
<i class="fa faSize fa-trash"></i>
</a>
<a class="btn btn-warning pull-left m-rl-5 rad"
href="#showmodal=@Url.Page("/Company/ClassifiedSalary/Index", "Edit", new {Id = @item.Id})">
<i class="fa fa-edit"></i>
</a>
</td>
</tr>
}
</tbody>
</table>
@foreach (var item in Model.ClassifiedSalaryViewModes)
{
<tr>
<td style="text-align: center">
<span class="numbers">@item.YearSt</span>
</td>
<td>@item.Group1</td>
<td>@item.Group2</td>
<td>@item.Group3</td>
<td>@item.Group4</td>
<td>@item.Group5</td>
<td>@item.Group6</td>
<td>@item.Group7</td>
<td>@item.Group8</td>
<td>@item.Group9</td>
<td>@item.Group10</td>
<td>@item.Group11</td>
<td>@item.Group12</td>
<td>@item.Group13</td>
<td>@item.Group14</td>
<td>@item.Group15</td>
<td>@item.Group16</td>
<td>@item.Group17</td>
<td>@item.Group18</td>
<td>@item.Group19</td>
<td>@item.Group20</td>
<td>
<a class="btn btn-danger pull-left m-rl-5 rad"
onclick="removeBlocked(@item.Id)">
<i class="fa faSize fa-trash"></i>
</a>
<a class="btn btn-warning pull-left m-rl-5 rad"
href="#showmodal=@Url.Page("/Company/ClassifiedSalary/Index", "Edit", new { item.Id })">
<i class="fa fa-edit"></i>
</a>
</td>
</tr>
}
</tbody>
</table>
</div>
@section Script
{
<script src="~/AdminTheme/assets/js/site.js"></script>
<script>
function removeBlocked(trId) {
swal({
title: "توجه داشته باشید با تایید این پیام آیتم مورد نظر حذف می شود ",
text: "",
type: "warning",
showCancelButton: true,
confirmButtonColor: "#DD6B55",
confirmButtonText: "تایید",
cancelButtonText: "خیر",
closeOnConfirm: true
},
function(isConfirm) {
if (isConfirm) {
$.ajax({
async: false,
dataType: 'json',
type: 'GET',
url: '@Url.Page("./Index", "Remove")',
data: { "id": Number(trId) },
headers: { "RequestVerificationToken": $('input[name="__RequestVerificationToken"]').val() },
success: function(response) {
if (response.isSuccedded) {
window.location.reload();
} else {
$.Notification.autoHideNotify('error', 'top right', 'پیام سیستم ', "خطایی در حذف آیتم مورد بوجود آمده است");
}
},
failure: function(response) {
console.log(5, response);
}
}); //endOf Ajax
} else {
}
});
}
</script>
}
<script src="~/AdminTheme/assets/js/site.js"></script>
<script>
function removeBlocked(trId) {
swal({
title: "توجه داشته باشید با تایید این پیام آیتم مورد نظر حذف می شود ",
text: "",
type: "warning",
showCancelButton: true,
confirmButtonColor: "#DD6B55",
confirmButtonText: "تایید",
cancelButtonText: "خیر",
closeOnConfirm: true
},
function(isConfirm) {
if (isConfirm) {
$.ajax({
async: false,
dataType: 'json',
type: 'GET',
url: '@Url.Page("./Index", "Remove")',
data: { "id": Number(trId) },
headers: { "RequestVerificationToken": $('input[name="__RequestVerificationToken"]').val() },
success: function(response) {
if (response.isSuccedded) {
window.location.reload();
} else {
$.Notification.autoHideNotify('error', 'top right', 'پیام سیستم ', "خطایی در حذف آیتم مورد بوجود آمده است");
}
},
failure: function(response) {
console.log(5, response);
}
}); //endOf Ajax
} else {
}
});
}
</script>
}

View File

@@ -3,129 +3,117 @@ using CompanyManagment.App.Contracts.ClassifiedSalary;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
namespace ServiceHost.Areas.Admin.Pages.Company.ClassifiedSalary
namespace ServiceHost.Areas.Admin.Pages.Company.ClassifiedSalary;
public class IndexModel : PageModel
{
public class IndexModel : PageModel
{
private readonly IClassifiedSalaryApplication _classifiedSalaryApplication;
private readonly IClassifiedSalaryApplication _classifiedSalaryApplication;
public List<ClassifiedSalaryViewMode> ClassifiedSalaryViewModes;
public List<ClassifiedSalaryViewMode> ClassifiedSalaryViewModes;
public IndexModel(IClassifiedSalaryApplication classifiedSalaryApplication)
{
_classifiedSalaryApplication = classifiedSalaryApplication;
}
public IndexModel(IClassifiedSalaryApplication classifiedSalaryApplication)
{
_classifiedSalaryApplication = classifiedSalaryApplication;
}
public void OnGet(ClassifiedSalarySearchModel searchModel)
{
ClassifiedSalaryViewModes = _classifiedSalaryApplication.Search(searchModel);
}
public void OnGet(ClassifiedSalarySearchModel searchModel)
{
ClassifiedSalaryViewModes = _classifiedSalaryApplication.Search(searchModel);
}
public IActionResult OnPostFindEndOfYear(string start)
{
var end = start.FindeEndOfYear();
return new JsonResult(new
{
IsSuccedded = true,
public IActionResult OnPostFindEndOfYear(string start)
{
var end = start.FindeEndOfYear();
return new JsonResult(new
{
IsSuccedded = true, end
});
}
end = end,
public IActionResult OnGetCreate()
{
return Partial("Create");
}
public IActionResult OnPostCreate(CreateClassifiedSalary command)
{
#region ConvertMoneyToDouble
});
command.Group1 = !string.IsNullOrWhiteSpace(command.Group1Str) ? command.Group1Str.MoneyToDouble() : 0;
command.Group2 = !string.IsNullOrWhiteSpace(command.Group2Str) ? command.Group2Str.MoneyToDouble() : 0;
command.Group3 = !string.IsNullOrWhiteSpace(command.Group3Str) ? command.Group3Str.MoneyToDouble() : 0;
command.Group4 = !string.IsNullOrWhiteSpace(command.Group4Str) ? command.Group4Str.MoneyToDouble() : 0;
command.Group5 = !string.IsNullOrWhiteSpace(command.Group5Str) ? command.Group5Str.MoneyToDouble() : 0;
command.Group6 = !string.IsNullOrWhiteSpace(command.Group6Str) ? command.Group6Str.MoneyToDouble() : 0;
command.Group7 = !string.IsNullOrWhiteSpace(command.Group7Str) ? command.Group7Str.MoneyToDouble() : 0;
command.Group8 = !string.IsNullOrWhiteSpace(command.Group8Str) ? command.Group8Str.MoneyToDouble() : 0;
command.Group9 = !string.IsNullOrWhiteSpace(command.Group9Str) ? command.Group9Str.MoneyToDouble() : 0;
command.Group10 = !string.IsNullOrWhiteSpace(command.Group10Str) ? command.Group10Str.MoneyToDouble() : 0;
command.Group11 = !string.IsNullOrWhiteSpace(command.Group11Str) ? command.Group11Str.MoneyToDouble() : 0;
command.Group12 = !string.IsNullOrWhiteSpace(command.Group12Str) ? command.Group12Str.MoneyToDouble() : 0;
command.Group13 = !string.IsNullOrWhiteSpace(command.Group13Str) ? command.Group13Str.MoneyToDouble() : 0;
command.Group14 = !string.IsNullOrWhiteSpace(command.Group14Str) ? command.Group14Str.MoneyToDouble() : 0;
command.Group15 = !string.IsNullOrWhiteSpace(command.Group15Str) ? command.Group15Str.MoneyToDouble() : 0;
command.Group16 = !string.IsNullOrWhiteSpace(command.Group16Str) ? command.Group16Str.MoneyToDouble() : 0;
command.Group17 = !string.IsNullOrWhiteSpace(command.Group17Str) ? command.Group17Str.MoneyToDouble() : 0;
command.Group18 = !string.IsNullOrWhiteSpace(command.Group18Str) ? command.Group18Str.MoneyToDouble() : 0;
command.Group19 = !string.IsNullOrWhiteSpace(command.Group19Str) ? command.Group19Str.MoneyToDouble() : 0;
command.Group20 = !string.IsNullOrWhiteSpace(command.Group20Str) ? command.Group20Str.MoneyToDouble() : 0;
}
#endregion
public IActionResult OnGetCreate()
{
return Partial("Create");
}
var result = _classifiedSalaryApplication.Create(command);
return new JsonResult(result);
}
public IActionResult OnPostCreate(CreateClassifiedSalary command)
{
#region ConvertMoneyToDouble
public IActionResult OnGetEdit(long id)
{
var res = _classifiedSalaryApplication.GetDetails(id);
return Partial("Edit", res);
}
command.Group1 = !string.IsNullOrWhiteSpace(command.Group1Str) ? command.Group1Str.MoneyToDouble() : 0;
command.Group2 = !string.IsNullOrWhiteSpace(command.Group2Str) ? command.Group2Str.MoneyToDouble() : 0;
command.Group3 = !string.IsNullOrWhiteSpace(command.Group3Str) ? command.Group3Str.MoneyToDouble() : 0;
command.Group4 = !string.IsNullOrWhiteSpace(command.Group4Str) ? command.Group4Str.MoneyToDouble() : 0;
command.Group5 = !string.IsNullOrWhiteSpace(command.Group5Str) ? command.Group5Str.MoneyToDouble() : 0;
command.Group6 = !string.IsNullOrWhiteSpace(command.Group6Str) ? command.Group6Str.MoneyToDouble() : 0;
command.Group7 = !string.IsNullOrWhiteSpace(command.Group7Str) ? command.Group7Str.MoneyToDouble() : 0;
command.Group8 = !string.IsNullOrWhiteSpace(command.Group8Str) ? command.Group8Str.MoneyToDouble() : 0;
command.Group9 = !string.IsNullOrWhiteSpace(command.Group9Str) ? command.Group9Str.MoneyToDouble() : 0;
command.Group10 = !string.IsNullOrWhiteSpace(command.Group10Str) ? command.Group10Str.MoneyToDouble() : 0;
command.Group11 = !string.IsNullOrWhiteSpace(command.Group11Str) ? command.Group11Str.MoneyToDouble() : 0;
command.Group12 = !string.IsNullOrWhiteSpace(command.Group12Str) ? command.Group12Str.MoneyToDouble() : 0;
command.Group13 = !string.IsNullOrWhiteSpace(command.Group13Str) ? command.Group13Str.MoneyToDouble() : 0;
command.Group14 = !string.IsNullOrWhiteSpace(command.Group14Str) ? command.Group14Str.MoneyToDouble() : 0;
command.Group15 = !string.IsNullOrWhiteSpace(command.Group15Str) ? command.Group15Str.MoneyToDouble() : 0;
command.Group16 = !string.IsNullOrWhiteSpace(command.Group16Str) ? command.Group16Str.MoneyToDouble() : 0;
command.Group17 = !string.IsNullOrWhiteSpace(command.Group17Str) ? command.Group17Str.MoneyToDouble() : 0;
command.Group18 = !string.IsNullOrWhiteSpace(command.Group18Str) ? command.Group18Str.MoneyToDouble() : 0;
command.Group19 = !string.IsNullOrWhiteSpace(command.Group19Str) ? command.Group19Str.MoneyToDouble() : 0;
command.Group20 = !string.IsNullOrWhiteSpace(command.Group20Str) ? command.Group20Str.MoneyToDouble() : 0;
public IActionResult OnPostEdit(EditClassifiedSalary command)
{
#region ConvertMoneyToDouble
#endregion
command.Group1 = !string.IsNullOrWhiteSpace(command.Group1Str) ? command.Group1Str.MoneyToDouble() : 0;
command.Group2 = !string.IsNullOrWhiteSpace(command.Group2Str) ? command.Group2Str.MoneyToDouble() : 0;
command.Group3 = !string.IsNullOrWhiteSpace(command.Group3Str) ? command.Group3Str.MoneyToDouble() : 0;
command.Group4 = !string.IsNullOrWhiteSpace(command.Group4Str) ? command.Group4Str.MoneyToDouble() : 0;
command.Group5 = !string.IsNullOrWhiteSpace(command.Group5Str) ? command.Group5Str.MoneyToDouble() : 0;
command.Group6 = !string.IsNullOrWhiteSpace(command.Group6Str) ? command.Group6Str.MoneyToDouble() : 0;
command.Group7 = !string.IsNullOrWhiteSpace(command.Group7Str) ? command.Group7Str.MoneyToDouble() : 0;
command.Group8 = !string.IsNullOrWhiteSpace(command.Group8Str) ? command.Group8Str.MoneyToDouble() : 0;
command.Group9 = !string.IsNullOrWhiteSpace(command.Group9Str) ? command.Group9Str.MoneyToDouble() : 0;
command.Group10 = !string.IsNullOrWhiteSpace(command.Group10Str) ? command.Group10Str.MoneyToDouble() : 0;
command.Group11 = !string.IsNullOrWhiteSpace(command.Group11Str) ? command.Group11Str.MoneyToDouble() : 0;
command.Group12 = !string.IsNullOrWhiteSpace(command.Group12Str) ? command.Group12Str.MoneyToDouble() : 0;
command.Group13 = !string.IsNullOrWhiteSpace(command.Group13Str) ? command.Group13Str.MoneyToDouble() : 0;
command.Group14 = !string.IsNullOrWhiteSpace(command.Group14Str) ? command.Group14Str.MoneyToDouble() : 0;
command.Group15 = !string.IsNullOrWhiteSpace(command.Group15Str) ? command.Group15Str.MoneyToDouble() : 0;
command.Group16 = !string.IsNullOrWhiteSpace(command.Group16Str) ? command.Group16Str.MoneyToDouble() : 0;
command.Group17 = !string.IsNullOrWhiteSpace(command.Group17Str) ? command.Group17Str.MoneyToDouble() : 0;
command.Group18 = !string.IsNullOrWhiteSpace(command.Group18Str) ? command.Group18Str.MoneyToDouble() : 0;
command.Group19 = !string.IsNullOrWhiteSpace(command.Group19Str) ? command.Group19Str.MoneyToDouble() : 0;
command.Group20 = !string.IsNullOrWhiteSpace(command.Group20Str) ? command.Group20Str.MoneyToDouble() : 0;
var result = _classifiedSalaryApplication.Create(command);
return new JsonResult(result);
}
#endregion
public IActionResult OnGetEdit(long id)
{
var res = _classifiedSalaryApplication.Edit(command);
return new JsonResult(res);
}
var res = _classifiedSalaryApplication.GetDetails(id);
return Partial("Edit", res);
}
public IActionResult OnPostEdit(EditClassifiedSalary command)
{
#region ConvertMoneyToDouble
command.Group1 = !string.IsNullOrWhiteSpace(command.Group1Str) ? command.Group1Str.MoneyToDouble() : 0;
command.Group2 = !string.IsNullOrWhiteSpace(command.Group2Str) ? command.Group2Str.MoneyToDouble() : 0;
command.Group3 = !string.IsNullOrWhiteSpace(command.Group3Str) ? command.Group3Str.MoneyToDouble() : 0;
command.Group4 = !string.IsNullOrWhiteSpace(command.Group4Str) ? command.Group4Str.MoneyToDouble() : 0;
command.Group5 = !string.IsNullOrWhiteSpace(command.Group5Str) ? command.Group5Str.MoneyToDouble() : 0;
command.Group6 = !string.IsNullOrWhiteSpace(command.Group6Str) ? command.Group6Str.MoneyToDouble() : 0;
command.Group7 = !string.IsNullOrWhiteSpace(command.Group7Str) ? command.Group7Str.MoneyToDouble() : 0;
command.Group8 = !string.IsNullOrWhiteSpace(command.Group8Str) ? command.Group8Str.MoneyToDouble() : 0;
command.Group9 = !string.IsNullOrWhiteSpace(command.Group9Str) ? command.Group9Str.MoneyToDouble() : 0;
command.Group10 = !string.IsNullOrWhiteSpace(command.Group10Str) ? command.Group10Str.MoneyToDouble() : 0;
command.Group11 = !string.IsNullOrWhiteSpace(command.Group11Str) ? command.Group11Str.MoneyToDouble() : 0;
command.Group12 = !string.IsNullOrWhiteSpace(command.Group12Str) ? command.Group12Str.MoneyToDouble() : 0;
command.Group13 = !string.IsNullOrWhiteSpace(command.Group13Str) ? command.Group13Str.MoneyToDouble() : 0;
command.Group14 = !string.IsNullOrWhiteSpace(command.Group14Str) ? command.Group14Str.MoneyToDouble() : 0;
command.Group15 = !string.IsNullOrWhiteSpace(command.Group15Str) ? command.Group15Str.MoneyToDouble() : 0;
command.Group16 = !string.IsNullOrWhiteSpace(command.Group16Str) ? command.Group16Str.MoneyToDouble() : 0;
command.Group17 = !string.IsNullOrWhiteSpace(command.Group17Str) ? command.Group17Str.MoneyToDouble() : 0;
command.Group18 = !string.IsNullOrWhiteSpace(command.Group18Str) ? command.Group18Str.MoneyToDouble() : 0;
command.Group19 = !string.IsNullOrWhiteSpace(command.Group19Str) ? command.Group19Str.MoneyToDouble() : 0;
command.Group20 = !string.IsNullOrWhiteSpace(command.Group20Str) ? command.Group20Str.MoneyToDouble() : 0;
#endregion
var res = _classifiedSalaryApplication.Edit(command);
return new JsonResult(res);
}
public IActionResult OnGetRemove(long id)
{
var res = _classifiedSalaryApplication.RemoveClassifiedSalary(id);
if (res.IsSuccedded)
{
return new JsonResult(new
{
isSuccedded = true,
});
}
else
{
return new JsonResult(new
{
isSuccedded = false,
});
}
}
}
}
public IActionResult OnGetRemove(long id)
{
var res = _classifiedSalaryApplication.RemoveClassifiedSalary(id);
if (res.IsSuccedded)
return new JsonResult(new
{
isSuccedded = true
});
return new JsonResult(new
{
isSuccedded = false
});
}
}

View File

@@ -2,13 +2,13 @@
@model ServiceHost.Areas.Admin.Pages.Company.ConnectedPersonnels.IndexModel
@{
Layout = "Shared/_AdminLayout";
ViewData["title"] = "لیست پرسنل‌های " + @Model.WorkshopFullName;
Layout = "Shared/_AdminLayout";
ViewData["title"] = "لیست پرسنل‌های " + Model.WorkshopFullName;
int i = 1;
var i = 1;
<style>
<style>
table {
border-collapse: collapse;
width: 100%;
@@ -176,443 +176,446 @@
@section Styles
{
<link href="@Href("~/admintheme/css/moreBtnsPopup.css")" rel="stylesheet" />
<link href="~/admintheme/assets/datatables-new/css/dataTables.bootstrap4.min.css" rel="stylesheet" />
<link href="~/admintheme/assets/datatables-new/css/responsive.bootstrap4.min.css" rel="stylesheet" />
<link href="@Href("~/admintheme/css/moreBtnsPopup.css")" rel="stylesheet"/>
<link href="~/admintheme/assets/datatables-new/css/dataTables.bootstrap4.min.css" rel="stylesheet"/>
<link href="~/admintheme/assets/datatables-new/css/responsive.bootstrap4.min.css" rel="stylesheet"/>
}
<input type="hidden" asp-for="@Model.workshopId" value="@Model.workshopId" id="workshopId" />
<input type="hidden" asp-for="@Model.workshopId" value="@Model.workshopId" id="workshopId"/>
<div class="row">
<div class="col-sm-12">
<div permission="10312" class="panel panel-default">
<div class="panel-heading" style="background-color: #465149">
<h3 class="panel-title"><i class="fa fa-list" style="padding-left: 3px; font-size: 14px"></i> لیست پرسنل‌های @Model.WorkshopFullName</h3>
</div>
<div class="panel-body">
<div class="row">
<div class="col-sm-12 col-sm-12 col-xs-12">
<table id="responsive-data-table" class="table dt-responsive nowrap" style="width:100%" dir="rtl">
<thead>
<tr>
<th>ردیف</th>
<th>نام و نام خانوادگی</th>
<th>کد پرسنلی</th>
<th>دارای قرارداد</th>
<th>دارای بیمه</th>
<th>انتخاب نوع محاسبه طلب مرخصی</th>
<th>انتخاب نوع محاسبه سنوات</th>
<th>انتخاب نوع محاسبه عیدی و پاداش</th>
<th>عملیات</th>
</tr>
</thead>
<tbody>
@foreach (var item in @Model.PersonnelList.ConnectedPersonnelViewModels)
{
<tr class="tableFindBtn @(item.Black ? "black" : "")">
<td class="text-center">
<div class="border-index">@i</div>
</td>
@{
i++;
}
<td>
<h6>@item.PersonName</h6>
</td>
<td class="text-center">
<h6>@item.PersonelCode</h6>
</td>
<td class="text-center">
@if (@item.ContractPerson && !@item.ContractLeft)
{
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<circle cx="12" cy="12" r="9" fill="#BEF264" />
<path d="M12 21C14.0822 21 16.1 20.278 17.7095 18.9571C19.3191 17.6362 20.4209 15.798 20.8271 13.7558C21.2333 11.7136 20.9188 9.59376 19.9373 7.75743C18.9558 5.9211 17.3679 4.48191 15.4442 3.68508C13.5205 2.88826 11.38 2.78311 9.38744 3.38754C7.3949 3.99197 5.67358 5.26858 4.51677 6.99987C3.35997 8.73115 2.83925 10.81 3.04334 12.8822C3.24743 14.9543 4.1637 16.8916 5.63604 18.364" stroke="#3F6212" stroke-width="1.2" stroke-linecap="round" />
<path d="M16 10L12.402 14.3175C11.7465 15.1042 11.4187 15.4976 10.9781 15.5176C10.5375 15.5375 10.1755 15.1755 9.45139 14.4514L8 13" stroke="#3F6212" stroke-width="1.2" stroke-linecap="round" />
</svg>
}
else
{
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<circle cx="12" cy="12" r="9" fill="#FCA5A5" />
<path d="M12 21C14.0822 21 16.1 20.278 17.7095 18.9571C19.3191 17.6362 20.4209 15.798 20.8271 13.7558C21.2333 11.7136 20.9188 9.59376 19.9373 7.75743C18.9558 5.9211 17.3679 4.48191 15.4442 3.68508C13.5205 2.88826 11.38 2.78311 9.38744 3.38754C7.3949 3.99197 5.67358 5.26858 4.51677 6.99987C3.35997 8.73115 2.83925 10.81 3.04334 12.8822C3.24743 14.9543 4.1637 16.8916 5.63604 18.364" stroke="#B91C1C" stroke-width="1.2" stroke-linecap="round" />
<path d="M8 12H16" stroke="#B91C1C" stroke-width="1.2" stroke-linecap="round" />
</svg>
}
</td>
<td class="text-center">
@if (@item.InsurancePerson && !@item.InsurancetLeft)
{
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<circle cx="12" cy="12" r="9" fill="#BEF264" />
<path d="M12 21C14.0822 21 16.1 20.278 17.7095 18.9571C19.3191 17.6362 20.4209 15.798 20.8271 13.7558C21.2333 11.7136 20.9188 9.59376 19.9373 7.75743C18.9558 5.9211 17.3679 4.48191 15.4442 3.68508C13.5205 2.88826 11.38 2.78311 9.38744 3.38754C7.3949 3.99197 5.67358 5.26858 4.51677 6.99987C3.35997 8.73115 2.83925 10.81 3.04334 12.8822C3.24743 14.9543 4.1637 16.8916 5.63604 18.364" stroke="#3F6212" stroke-width="1.2" stroke-linecap="round" />
<path d="M16 10L12.402 14.3175C11.7465 15.1042 11.4187 15.4976 10.9781 15.5176C10.5375 15.5375 10.1755 15.1755 9.45139 14.4514L8 13" stroke="#3F6212" stroke-width="1.2" stroke-linecap="round" />
</svg>
}
else
{
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<circle cx="12" cy="12" r="9" fill="#FCA5A5" />
<path d="M12 21C14.0822 21 16.1 20.278 17.7095 18.9571C19.3191 17.6362 20.4209 15.798 20.8271 13.7558C21.2333 11.7136 20.9188 9.59376 19.9373 7.75743C18.9558 5.9211 17.3679 4.48191 15.4442 3.68508C13.5205 2.88826 11.38 2.78311 9.38744 3.38754C7.3949 3.99197 5.67358 5.26858 4.51677 6.99987C3.35997 8.73115 2.83925 10.81 3.04334 12.8822C3.24743 14.9543 4.1637 16.8916 5.63604 18.364" stroke="#B91C1C" stroke-width="1.2" stroke-linecap="round" />
<path d="M8 12H16" stroke="#B91C1C" stroke-width="1.2" stroke-linecap="round" />
</svg>
}
</td>
<td>
@if (@item.ContractPerson)
{
<select class="form-control" data-ComputeOptions="@item.EmployeeId" id="ComputeOptionsSelect" asp-for="@item.ComputeOptions" style="width: 230px;font-size: 12px;">
<option value="OnEndOfContract">محاسبه در پایان قرارداد</option>
<option value="OnLeftWork"> محاسبه در پایان همکاری (ترک کار از مجموعه) </option>
<option value="OnEndOfYear"> محاسبه در پایان سال به شرطی که قرارداد منتهی به پایان سال باشد </option>
</select>
}
</td>
<td>
@if (@item.ContractPerson)
{
<select class="form-control" data-YearsOptions="@item.EmployeeId" asp-for="@item.YearsOptions" style="width: 230px;font-size: 12px;">
<option value="OnCheckoutOfMonth"> محاسبه در فیش حقوقی ماهیانه </option>
<option value="OnEndOfContract"> محاسبه در پایان قرارداد </option>
<option value="OnLeftWork"> محاسبه در پایان همکاری (ترک کار از مجموعه) </option>
<option value="OnEndOfYear"> محاسبه در پایان سال به شرطی که قرارداد منتهی به پایان سال باشد </option>
</select>
}
</td>
<td>
@if (@item.ContractPerson)
{
<select class="form-control" data-BonusesOptions="@item.EmployeeId" asp-for="@item.BonusesOptions" style="width: 230px;font-size: 12px;">
<option value="OnCheckoutOfMonth"> محاسبه در فیش حقوقی ماهیانه </option>
<option value="OnEndOfContract"> محاسبه در پایان قرارداد </option>
<option value="OnEndOfYear"> محاسبه در پایان سال </option>
</select>
}
</td>
<td>
@if (@item.ContractPerson)
{
<button onclick="save(@item.EmployeeId)" class="btn btn-success save" data-save="@item.EmployeeId" disabled="disabled">ذخیره</button>
}
<a class="btn btn-success pull-left rad" style="margin-left: 5px"
href="#showmodal=@Url.Page("./Index", "TakePicture", new { employeeId = item.EmployeeId, workshopId = item.WorkshopId})">
<i class="ion-information-circled ionSize"></i>
</a>
</td>
<div class="col-sm-12">
<div permission="10312" class="panel panel-default">
<div class="panel-heading" style="background-color: #465149">
<h3 class="panel-title"><i class="fa fa-list" style="padding-left: 3px; font-size: 14px"></i> لیست پرسنل‌های @Model.WorkshopFullName</h3>
</div>
<div class="panel-body">
<div class="row">
<div class="col-sm-12 col-sm-12 col-xs-12">
<table id="responsive-data-table" class="table dt-responsive nowrap" style="width:100%" dir="rtl">
<thead>
<tr>
<th>ردیف</th>
<th>نام و نام خانوادگی</th>
<th>کد پرسنلی</th>
<th>دارای قرارداد</th>
<th>دارای بیمه</th>
<th>انتخاب نوع محاسبه طلب مرخصی</th>
<th>انتخاب نوع محاسبه سنوات</th>
<th>انتخاب نوع محاسبه عیدی و پاداش</th>
<th>عملیات</th>
</tr>
</thead>
<tbody>
@foreach (var item in Model.PersonnelList.ConnectedPersonnelViewModels)
{
<tr class="tableFindBtn @(item.Black ? "black" : "")">
<td class="text-center">
<div class="border-index">@i</div>
</td>
@{
i++;
}
<td>
<h6>@item.PersonName</h6>
</td>
<td class="text-center">
<h6>@item.PersonelCode</h6>
</td>
<td class="text-center">
@if (item.ContractPerson && !item.ContractLeft)
{
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<circle cx="12" cy="12" r="9" fill="#BEF264"/>
<path d="M12 21C14.0822 21 16.1 20.278 17.7095 18.9571C19.3191 17.6362 20.4209 15.798 20.8271 13.7558C21.2333 11.7136 20.9188 9.59376 19.9373 7.75743C18.9558 5.9211 17.3679 4.48191 15.4442 3.68508C13.5205 2.88826 11.38 2.78311 9.38744 3.38754C7.3949 3.99197 5.67358 5.26858 4.51677 6.99987C3.35997 8.73115 2.83925 10.81 3.04334 12.8822C3.24743 14.9543 4.1637 16.8916 5.63604 18.364" stroke="#3F6212" stroke-width="1.2" stroke-linecap="round"/>
<path d="M16 10L12.402 14.3175C11.7465 15.1042 11.4187 15.4976 10.9781 15.5176C10.5375 15.5375 10.1755 15.1755 9.45139 14.4514L8 13" stroke="#3F6212" stroke-width="1.2" stroke-linecap="round"/>
</svg>
}
else
{
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<circle cx="12" cy="12" r="9" fill="#FCA5A5"/>
<path d="M12 21C14.0822 21 16.1 20.278 17.7095 18.9571C19.3191 17.6362 20.4209 15.798 20.8271 13.7558C21.2333 11.7136 20.9188 9.59376 19.9373 7.75743C18.9558 5.9211 17.3679 4.48191 15.4442 3.68508C13.5205 2.88826 11.38 2.78311 9.38744 3.38754C7.3949 3.99197 5.67358 5.26858 4.51677 6.99987C3.35997 8.73115 2.83925 10.81 3.04334 12.8822C3.24743 14.9543 4.1637 16.8916 5.63604 18.364" stroke="#B91C1C" stroke-width="1.2" stroke-linecap="round"/>
<path d="M8 12H16" stroke="#B91C1C" stroke-width="1.2" stroke-linecap="round"/>
</svg>
}
</td>
<td class="text-center">
@if (item.InsurancePerson && !item.InsurancetLeft)
{
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<circle cx="12" cy="12" r="9" fill="#BEF264"/>
<path d="M12 21C14.0822 21 16.1 20.278 17.7095 18.9571C19.3191 17.6362 20.4209 15.798 20.8271 13.7558C21.2333 11.7136 20.9188 9.59376 19.9373 7.75743C18.9558 5.9211 17.3679 4.48191 15.4442 3.68508C13.5205 2.88826 11.38 2.78311 9.38744 3.38754C7.3949 3.99197 5.67358 5.26858 4.51677 6.99987C3.35997 8.73115 2.83925 10.81 3.04334 12.8822C3.24743 14.9543 4.1637 16.8916 5.63604 18.364" stroke="#3F6212" stroke-width="1.2" stroke-linecap="round"/>
<path d="M16 10L12.402 14.3175C11.7465 15.1042 11.4187 15.4976 10.9781 15.5176C10.5375 15.5375 10.1755 15.1755 9.45139 14.4514L8 13" stroke="#3F6212" stroke-width="1.2" stroke-linecap="round"/>
</svg>
}
else
{
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<circle cx="12" cy="12" r="9" fill="#FCA5A5"/>
<path d="M12 21C14.0822 21 16.1 20.278 17.7095 18.9571C19.3191 17.6362 20.4209 15.798 20.8271 13.7558C21.2333 11.7136 20.9188 9.59376 19.9373 7.75743C18.9558 5.9211 17.3679 4.48191 15.4442 3.68508C13.5205 2.88826 11.38 2.78311 9.38744 3.38754C7.3949 3.99197 5.67358 5.26858 4.51677 6.99987C3.35997 8.73115 2.83925 10.81 3.04334 12.8822C3.24743 14.9543 4.1637 16.8916 5.63604 18.364" stroke="#B91C1C" stroke-width="1.2" stroke-linecap="round"/>
<path d="M8 12H16" stroke="#B91C1C" stroke-width="1.2" stroke-linecap="round"/>
</svg>
}
</td>
<td>
@if (item.ContractPerson)
{
<select class="form-control" data-ComputeOptions="@item.EmployeeId" id="ComputeOptionsSelect" asp-for="@item.ComputeOptions" style="width: 230px;font-size: 12px;">
<option value="OnEndOfContract">محاسبه در پایان قرارداد</option>
<option value="OnLeftWork"> محاسبه در پایان همکاری (ترک کار از مجموعه) </option>
<option value="OnEndOfYear"> محاسبه در پایان سال به شرطی که قرارداد منتهی به پایان سال باشد </option>
</select>
}
</td>
<td>
@if (item.ContractPerson)
{
<select class="form-control" data-YearsOptions="@item.EmployeeId" asp-for="@item.YearsOptions" style="width: 230px;font-size: 12px;">
<option value="OnCheckoutOfMonth"> محاسبه در فیش حقوقی ماهیانه </option>
<option value="OnEndOfContract"> محاسبه در پایان قرارداد </option>
<option value="OnLeftWork"> محاسبه در پایان همکاری (ترک کار از مجموعه) </option>
<option value="OnEndOfYear"> محاسبه در پایان سال به شرطی که قرارداد منتهی به پایان سال باشد </option>
</select>
}
</td>
<td>
@if (item.ContractPerson)
{
<select class="form-control" data-BonusesOptions="@item.EmployeeId" asp-for="@item.BonusesOptions" style="width: 230px;font-size: 12px;">
<option value="OnCheckoutOfMonth"> محاسبه در فیش حقوقی ماهیانه </option>
<option value="OnEndOfContract"> محاسبه در پایان قرارداد </option>
<option value="OnEndOfYear"> محاسبه در پایان سال </option>
</select>
}
</td>
<td>
@if (item.ContractPerson)
{
<button onclick="save(@item.EmployeeId)" class="btn btn-success save" data-save="@item.EmployeeId" disabled="disabled">ذخیره</button>
}
<a class="btn btn-success pull-left rad" style="margin-left: 5px"
href="#showmodal=@Url.Page("./Index", "TakePicture", new { employeeId = item.EmployeeId, workshopId = item.WorkshopId })">
<i class="ion-information-circled ionSize"></i>
</a>
</td>
</tr>
}
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</tr>
}
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
@section Script {
<script src="~/AdminTheme/assets/js/site.js"></script>
<script src="~/AdminTheme/assets/js/site.js"></script>
<script src="~/adminTheme/assets/datatables-new/js/jquery.dataTables.min.js"></script>
<script src="~/adminTheme/assets/datatables-new/js/dataTables.bootstrap4.min.js"></script>
<script src="~/adminTheme/assets/datatables-new/js/dataTables.responsive.min.js"></script>
<script src="~/adminTheme/assets/datatables-new/js/jquery.dataTables.min.js"></script>
<script src="~/adminTheme/assets/datatables-new/js/dataTables.bootstrap4.min.js"></script>
<script src="~/adminTheme/assets/datatables-new/js/dataTables.responsive.min.js"></script>
@* <script src="~/adminTheme/assets/datatables/jquery.dataTables.min.js"></script>
@* <script src="~/adminTheme/assets/datatables/jquery.dataTables.min.js"></script>
<script src="~/adminTheme/assets/datatables/dataTables.bootstrap.js"></script> *@
<script type="text/javascript">
<script type="text/javascript">
$(document).ready(function () {
$('#responsive-data-table').DataTable({
"alengthMenu": [["All", 10, 50, 100, -1], ["All", 10, 50, 100, "All"]],
"order": [[0, 'asc']],
"dom": '<"row justify-content-between top-information"lf>rt<"row justify-content-between bottom-information"ip><"clear">',
"language": {
"emptyTable": "هیچ داده‌ای در جدول وجود ندارد",
"info": "نمایش _START_ تا _END_ از _TOTAL_ ردیف",
"infoEmpty": "نمایش 0 تا 0 از 0 ردیف",
"infoFiltered": "(فیلتر شده از _MAX_ ردیف)",
"infoThousands": ",",
"lengthMenu": "نمایش _MENU_ ردیف",
"processing": "در حال پردازش...",
"search": "جستجو:",
"zeroRecords": "رکوردی با این مشخصات پیدا نشد",
"paginate": {
"next": "بعدی",
"previous": "قبلی",
"first": "ابتدا",
"last": "انتها"
},
"aria": {
"sortAscending": ": فعال سازی نمایش به صورت صعودی",
"sortDescending": ": فعال سازی نمایش به صورت نزولی"
},
"autoFill": {
"cancel": "انصراف",
"fill": "پر کردن همه سلول ها با ساختار سیستم",
"fillHorizontal": "پر کردن سلول به صورت افقی",
"fillVertical": "پرکردن سلول به صورت عمودی"
},
"buttons": {
"collection": "مجموعه",
"colvis": "قابلیت نمایش ستون",
"colvisRestore": "بازنشانی قابلیت نمایش",
"copy": "کپی",
"copySuccess": {
"1": "یک ردیف داخل حافظه کپی شد",
"_": "%ds ردیف داخل حافظه کپی شد"
},
"copyTitle": "کپی در حافظه",
"pageLength": {
"-1": "نمایش همه ردیف‌ها",
"_": "نمایش %d ردیف",
"1": "نمایش 1 ردیف"
},
"print": "چاپ",
"copyKeys": "برای کپی داده جدول در حافظه سیستم کلید های ctrl یا ⌘ + C را فشار دهید",
"csv": "فایل CSV",
"pdf": "فایل PDF",
"renameState": "تغییر نام",
"updateState": "به روز رسانی",
"excel": "فایل اکسل",
"createState": "ایجاد وضعیت جدول",
"removeAllStates": "حذف همه وضعیت ها",
"removeState": "حذف",
"savedStates": "وضعیت های ذخیره شده",
"stateRestore": "بازگشت به وضعیت %d"
},
"searchBuilder": {
"add": "افزودن شرط",
"button": {
"0": "جستجو ساز",
"_": "جستجوساز (%d)"
},
"clearAll": "خالی کردن همه",
"condition": "شرط",
"conditions": {
"date": {
"after": "بعد از",
"before": "بعد از",
"between": "میان",
"empty": "خالی",
"not": "نباشد",
"notBetween": "میان نباشد",
"notEmpty": "خالی نباشد",
"equals": "برابر باشد با"
},
"number": {
"between": "میان",
"empty": "خالی",
"gt": "بزرگتر از",
"gte": "برابر یا بزرگتر از",
"lt": "کمتر از",
"lte": "برابر یا کمتر از",
"not": "نباشد",
"notBetween": "میان نباشد",
"notEmpty": "خالی نباشد",
"equals": "برابر باشد با"
},
"string": {
"contains": "حاوی",
"empty": "خالی",
"endsWith": "به پایان می رسد با",
"not": "نباشد",
"notEmpty": "خالی نباشد",
"startsWith": "شروع شود با",
"notContains": "نباشد حاوی",
"notEndsWith": "پایان نیابد با",
"notStartsWith": "شروع نشود با",
"equals": "برابر باشد با"
},
"array": {
"empty": "خالی",
"contains": "حاوی",
"not": "نباشد",
"notEmpty": "خالی نباشد",
"without": "بدون",
"equals": "برابر باشد با"
}
},
"data": "اطلاعات",
"logicAnd": "و",
"logicOr": "یا",
"title": {
"0": "جستجو ساز",
"_": "جستجوساز (%d)"
},
"value": "مقدار",
"deleteTitle": "حذف شرط فیلتر",
"leftTitle": "شرط بیرونی",
"rightTitle": "شرط فرورفتگی"
},
"select": {
"cells": {
"1": "1 سلول انتخاب شد",
"_": "%d سلول انتخاب شد"
},
"columns": {
"1": "یک ستون انتخاب شد",
"_": "%d ستون انتخاب شد"
},
"rows": {
"1": "1ردیف انتخاب شد",
"_": "%d انتخاب شد"
}
},
"thousands": ",",
"searchPanes": {
"clearMessage": "همه را پاک کن",
"collapse": {
"0": "صفحه جستجو",
"_": "صفحه جستجو (٪ d)"
},
"count": "{total}",
"countFiltered": "{shown} ({total})",
"emptyPanes": "صفحه جستجو وجود ندارد",
"loadMessage": "در حال بارگیری صفحات جستجو ...",
"title": "فیلترهای فعال - %d",
"showMessage": "نمایش همه",
"collapseMessage": "بستن همه"
},
"loadingRecords": "در حال بارگذاری...",
"datetime": {
"previous": "قبلی",
"next": "بعدی",
"hours": "ساعت",
"minutes": "دقیقه",
"seconds": "ثانیه",
"amPm": [
"صبح",
"عصر"
],
"months": {
"0": "ژانویه",
"1": "فوریه",
"10": "نوامبر",
"4": "می",
"8": "سپتامبر",
"11": "دسامبر",
"3": "آوریل",
"9": "اکتبر",
"7": "اوت",
"2": "مارس",
"5": "ژوئن",
"6": "ژوئیه"
},
"unknown": "-",
"weekdays": [
"یکشنبه",
"دوشنبه",
"سه‌شنبه",
"چهارشنبه",
"پنجشنبه",
"جمعه",
"شنبه"
]
},
"editor": {
"close": "بستن",
"create": {
"button": "جدید",
"title": "ثبت جدید",
"submit": "ایجــاد"
},
"edit": {
"button": "ویرایش",
"title": "ویرایش",
"submit": "به روز رسانی"
},
"remove": {
"button": "حذف",
"title": "حذف",
"submit": "حذف",
"confirm": {
"_": "آیا از حذف %d خط اطمینان دارید؟",
"1": "آیا از حذف یک خط اطمینان دارید؟"
}
},
"multi": {
"restore": "واگرد",
"noMulti": "این ورودی را می توان به صورت جداگانه ویرایش کرد، اما نه بخشی از یک گروه",
"title": "مقادیر متعدد",
"info": "مقادیر متعدد"
},
"error": {
"system": "خطایی رخ داده (اطلاعات بیشتر)"
}
},
"decimal": ".",
"stateRestore": {
"creationModal": {
"button": "ایجاد",
"columns": {
"search": "جستجوی ستون",
"visible": "وضعیت نمایش ستون"
},
"name": "نام:",
"order": "مرتب سازی",
"paging": "صفحه بندی",
"search": "جستجو",
"select": "انتخاب",
"title": "ایجاد وضعیت جدید",
"toggleLabel": "شامل:",
"scroller": "موقعیت جدول (اسکرول)",
"searchBuilder": "صفحه جستجو"
},
"emptyError": "نام نمیتواند خالی باشد.",
"removeConfirm": "آیا از حذف %s مطمئنید؟",
"removeJoiner": "و",
"renameButton": "تغییر نام",
"renameLabel": "نام جدید برای $s :",
"duplicateError": "وضعیتی با این نام از پیش ذخیره شده.",
"emptyStates": "هیچ وضعیتی ذخیره نشده",
"removeError": "حذف با خطا موماجه شد",
"removeSubmit": "حذف وضعیت",
"removeTitle": "حذف وضعیت جدول",
"renameTitle": "تغییر نام وضعیت"
}
}
});
$(document).ready(function() {
$('#responsive-data-table').DataTable({
"alengthMenu": [["All", 10, 50, 100, -1], ["All", 10, 50, 100, "All"]],
"order": [[0, 'asc']],
"dom": '<"row justify-content-between top-information"lf>rt<"row justify-content-between bottom-information"ip><"clear">',
"language": {
"emptyTable": "هیچ داده‌ای در جدول وجود ندارد",
"info": "نمایش _START_ تا _END_ از _TOTAL_ ردیف",
"infoEmpty": "نمایش 0 تا 0 از 0 ردیف",
"infoFiltered": "(فیلتر شده از _MAX_ ردیف)",
"infoThousands": ",",
"lengthMenu": "نمایش _MENU_ ردیف",
"processing": "در حال پردازش...",
"search": "جستجو:",
"zeroRecords": "رکوردی با این مشخصات پیدا نشد",
"paginate": {
"next": "بعدی",
"previous": "قبلی",
"first": "ابتدا",
"last": "انتها"
},
"aria": {
"sortAscending": ": فعال سازی نمایش به صورت صعودی",
"sortDescending": ": فعال سازی نمایش به صورت نزولی"
},
"autoFill": {
"cancel": "انصراف",
"fill": "پر کردن همه سلول ها با ساختار سیستم",
"fillHorizontal": "پر کردن سلول به صورت افقی",
"fillVertical": "پرکردن سلول به صورت عمودی"
},
"buttons": {
"collection": "مجموعه",
"colvis": "قابلیت نمایش ستون",
"colvisRestore": "بازنشانی قابلیت نمایش",
"copy": "کپی",
"copySuccess": {
"1": "یک ردیف داخل حافظه کپی شد",
"_": "%ds ردیف داخل حافظه کپی شد"
},
"copyTitle": "کپی در حافظه",
"pageLength": {
"-1": "نمایش همه ردیف‌ها",
"_": "نمایش %d ردیف",
"1": "نمایش 1 ردیف"
},
"print": "چاپ",
"copyKeys": "برای کپی داده جدول در حافظه سیستم کلید های ctrl یا ⌘ + C را فشار دهید",
"csv": "فایل CSV",
"pdf": "فایل PDF",
"renameState": "تغییر نام",
"updateState": "به روز رسانی",
"excel": "فایل اکسل",
"createState": "ایجاد وضعیت جدول",
"removeAllStates": "حذف همه وضعیت ها",
"removeState": "حذف",
"savedStates": "وضعیت های ذخیره شده",
"stateRestore": "بازگشت به وضعیت %d"
},
"searchBuilder": {
"add": "افزودن شرط",
"button": {
"0": "جستجو ساز",
"_": "جستجوساز (%d)"
},
"clearAll": "خالی کردن همه",
"condition": "شرط",
"conditions": {
"date": {
"after": "بعد از",
"before": "بعد از",
"between": "میان",
"empty": "خالی",
"not": "نباشد",
"notBetween": "میان نباشد",
"notEmpty": "خالی نباشد",
"equals": "برابر باشد با"
},
"number": {
"between": "میان",
"empty": "خالی",
"gt": "بزرگتر از",
"gte": "برابر یا بزرگتر از",
"lt": "کمتر از",
"lte": "برابر یا کمتر از",
"not": "نباشد",
"notBetween": "میان نباشد",
"notEmpty": "خالی نباشد",
"equals": "برابر باشد با"
},
"string": {
"contains": "حاوی",
"empty": "خالی",
"endsWith": "به پایان می رسد با",
"not": "نباشد",
"notEmpty": "خالی نباشد",
"startsWith": "شروع شود با",
"notContains": "نباشد حاوی",
"notEndsWith": "پایان نیابد با",
"notStartsWith": "شروع نشود با",
"equals": "برابر باشد با"
},
"array": {
"empty": "خالی",
"contains": "حاوی",
"not": "نباشد",
"notEmpty": "خالی نباشد",
"without": "بدون",
"equals": "برابر باشد با"
}
},
"data": "اطلاعات",
"logicAnd": "و",
"logicOr": "یا",
"title": {
"0": "جستجو ساز",
"_": "جستجوساز (%d)"
},
"value": "مقدار",
"deleteTitle": "حذف شرط فیلتر",
"leftTitle": "شرط بیرونی",
"rightTitle": "شرط فرورفتگی"
},
"select": {
"cells": {
"1": "1 سلول انتخاب شد",
"_": "%d سلول انتخاب شد"
},
"columns": {
"1": "یک ستون انتخاب شد",
"_": "%d ستون انتخاب شد"
},
"rows": {
"1": "1ردیف انتخاب شد",
"_": "%d انتخاب شد"
}
},
"thousands": ",",
"searchPanes": {
"clearMessage": "همه را پاک کن",
"collapse": {
"0": "صفحه جستجو",
"_": "صفحه جستجو (٪ d)"
},
"count": "{total}",
"countFiltered": "{shown} ({total})",
"emptyPanes": "صفحه جستجو وجود ندارد",
"loadMessage": "در حال بارگیری صفحات جستجو ...",
"title": "فیلترهای فعال - %d",
"showMessage": "نمایش همه",
"collapseMessage": "بستن همه"
},
"loadingRecords": "در حال بارگذاری...",
"datetime": {
"previous": "قبلی",
"next": "بعدی",
"hours": "ساعت",
"minutes": "دقیقه",
"seconds": "ثانیه",
"amPm": [
"صبح",
"عصر"
],
"months": {
"0": "ژانویه",
"1": "فوریه",
"10": "نوامبر",
"4": "می",
"8": "سپتامبر",
"11": "دسامبر",
"3": "آوریل",
"9": "اکتبر",
"7": "اوت",
"2": "مارس",
"5": "ژوئن",
"6": "ژوئیه"
},
"unknown": "-",
"weekdays": [
"یکشنبه",
"دوشنبه",
"سه‌شنبه",
"چهارشنبه",
"پنجشنبه",
"جمعه",
"شنبه"
]
},
"editor": {
"close": "بستن",
"create": {
"button": "جدید",
"title": "ثبت جدید",
"submit": "ایجــاد"
},
"edit": {
"button": "ویرایش",
"title": "ویرایش",
"submit": "به روز رسانی"
},
"remove": {
"button": "حذف",
"title": "حذف",
"submit": "حذف",
"confirm": {
"_": "آیا از حذف %d خط اطمینان دارید؟",
"1": "آیا از حذف یک خط اطمینان دارید؟"
}
},
"multi": {
"restore": "واگرد",
"noMulti": "این ورودی را می توان به صورت جداگانه ویرایش کرد، اما نه بخشی از یک گروه",
"title": "مقادیر متعدد",
"info": "مقادیر متعدد"
},
"error": {
"system": "خطایی رخ داده (اطلاعات بیشتر)"
}
},
"decimal": ".",
"stateRestore": {
"creationModal": {
"button": "ایجاد",
"columns": {
"search": "جستجوی ستون",
"visible": "وضعیت نمایش ستون"
},
"name": "نام:",
"order": "مرتب سازی",
"paging": "صفحه بندی",
"search": "جستجو",
"select": "انتخاب",
"title": "ایجاد وضعیت جدید",
"toggleLabel": "شامل:",
"scroller": "موقعیت جدول (اسکرول)",
"searchBuilder": "صفحه جستجو"
},
"emptyError": "نام نمیتواند خالی باشد.",
"removeConfirm": "آیا از حذف %s مطمئنید؟",
"removeJoiner": "و",
"renameButton": "تغییر نام",
"renameLabel": "نام جدید برای $s :",
"duplicateError": "وضعیتی با این نام از پیش ذخیره شده.",
"emptyStates": "هیچ وضعیتی ذخیره نشده",
"removeError": "حذف با خطا موماجه شد",
"removeSubmit": "حذف وضعیت",
"removeTitle": "حذف وضعیت جدول",
"renameTitle": "تغییر نام وضعیت"
}
}
});
$(document).on('change', '.tableFindBtn', function () {
$(this).find(".save").prop("disabled", false);
});
});
$(document).on('change',
'.tableFindBtn',
function() {
$(this).find(".save").prop("disabled", false);
});
});
function save(EmployeeId) {
var command = {};
command.WorkshopId = Number($("#workshopId").val());
command.EmployeeId = Number(EmployeeId);
command.ComputeOptions = $('[data-ComputeOptions="'+ EmployeeId +'"]').val();
command.BonusesOptions = $('[data-BonusesOptions="' + EmployeeId + '"]').val();
command.YearsOptions = $('[data-YearsOptions="' + EmployeeId + '"]').val();
$.ajax({
async: false,
dataType: 'json',
type: 'GET',
url: '@Url.Page("./Index", "Create")',
data: command,
headers: { "RequestVerificationToken": $('@Html.AntiForgeryToken()').val() },
success: function (response) {
if (response.isSuccedded) {
command = {};
console.log()
$('[data-save="' + EmployeeId + '"]').prop("disabled", true);
$.Notification.autoHideNotify('success', 'top center', 'پیام سیستم ', response.message);
} else {
command = {};
$.Notification.autoHideNotify('error', 'top center', 'پیام سیستم ', response.message);
}
},
failure: function (response) {
console.log(5, response);
function save(EmployeeId) {
var command = {};
command.WorkshopId = Number($("#workshopId").val());
command.EmployeeId = Number(EmployeeId);
command.ComputeOptions = $(`[data-ComputeOptions="${EmployeeId}"]`).val();
command.BonusesOptions = $(`[data-BonusesOptions="${EmployeeId}"]`).val();
command.YearsOptions = $(`[data-YearsOptions="${EmployeeId}"]`).val();
}
});
}
</script>
$.ajax({
async: false,
dataType: 'json',
type: 'GET',
url: '@Url.Page("./Index", "Create")',
data: command,
headers: { "RequestVerificationToken": $('@Html.AntiForgeryToken()').val() },
success: function(response) {
if (response.isSuccedded) {
command = {};
console.log();
$(`[data-save="${EmployeeId}"]`).prop("disabled", true);
$.Notification.autoHideNotify('success', 'top center', 'پیام سیستم ', response.message);
} else {
command = {};
$.Notification.autoHideNotify('error', 'top center', 'پیام سیستم ', response.message);
}
},
failure: function(response) {
console.log(5, response);
}
});
}
</script>
}

View File

@@ -1,178 +1,170 @@
using _0_Framework.Application;
using CompanyManagment.App.Contracts.EmployeeComputeOptions;
using CompanyManagment.App.Contracts.Workshop;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
namespace ServiceHost.Areas.Admin.Pages.Company.ConnectedPersonnels
namespace ServiceHost.Areas.Admin.Pages.Company.ConnectedPersonnels;
public class IndexModel : PageModel
{
public class IndexModel : PageModel
{
public ConnectedPersonnelViewModel PersonnelList;
public string WorkshopFullName;
private readonly IWorkshopApplication _workshopApplication;
private readonly IEmployeeComputeOptionsApplication _employeeComputeOptionsApplication;
private readonly IAuthHelper _authHelper;
public long workshopId;
private readonly IWebHostEnvironment _webHostEnvironment;
private readonly IAuthHelper _authHelper;
private readonly IEmployeeComputeOptionsApplication _employeeComputeOptionsApplication;
private readonly IWebHostEnvironment _webHostEnvironment;
private readonly IWorkshopApplication _workshopApplication;
public ConnectedPersonnelViewModel PersonnelList;
public string WorkshopFullName;
public long workshopId;
public IndexModel(IAuthHelper authHelper, IWorkshopApplication workshopApplication, IEmployeeComputeOptionsApplication employeeComputeOptionsApplication, IWebHostEnvironment webHostEnvironment)
{
_authHelper = authHelper;
_workshopApplication = workshopApplication;
_employeeComputeOptionsApplication = employeeComputeOptionsApplication;
_webHostEnvironment = webHostEnvironment;
}
public IndexModel(IAuthHelper authHelper, IWorkshopApplication workshopApplication,
IEmployeeComputeOptionsApplication employeeComputeOptionsApplication, IWebHostEnvironment webHostEnvironment)
{
_authHelper = authHelper;
_workshopApplication = workshopApplication;
_employeeComputeOptionsApplication = employeeComputeOptionsApplication;
_webHostEnvironment = webHostEnvironment;
}
public void OnGet(long workshopID)
{
var workshop = _workshopApplication.GetWorkshopInfo(workshopID);
WorkshopFullName = workshop.WorkshopFullName;
workshopId = workshopID;
public void OnGet(long workshopID)
{
var workshop = _workshopApplication.GetWorkshopInfo(workshopID);
WorkshopFullName = workshop.WorkshopFullName;
workshopId = workshopID;
var result = _workshopApplication.GetConnectedPersonnels(workshopID).GroupBy(x => x.PersonName).Select(x => x.First()).ToList();
var final = new List<ConnectedPersonnelViewModel>();
foreach (var item in result)
{
var option = new EmployeeComputeOptionsViewModel();
if (item.ContractPerson)
{
option = _employeeComputeOptionsApplication.GetEmployeeOptions(workshopID, item.EmployeeId);
}
var finalResult = new ConnectedPersonnelViewModel()
{
WorkshopId = item.WorkshopId,
EmployeeId = item.EmployeeId,
PersonName = item.PersonName,
PersonelCode = item.PersonelCode,
ContractPerson = item.ContractPerson,
InsurancePerson = item.InsurancePerson,
ContractLeft = item.ContractLeft,
InsurancetLeft = item.InsurancetLeft,
Black = item.Black,
StartWork = item.StartWork,
BonusesOptions = item.ContractPerson ? option.BonusesOptions : "null",
ComputeOptions = item.ContractPerson ? option.ComputeOptions : "null",
YearsOptions = item.ContractPerson ? option.YearsOptions : "null"
};
final.Add(finalResult);
}
PersonnelList = new ConnectedPersonnelViewModel()
{
ConnectedPersonnelViewModels = final.OrderBy(x => x.Black ? 1 : 0).ThenBy(x => x.PersonelCode).ToList(),
};
}
public IActionResult OnGetCreate(CreateEmployeeComputeOptions command)
{
var result = _employeeComputeOptionsApplication.Create(command);
return new JsonResult(new
{
isSuccedded = result.IsSuccedded,
message = result.Message
});
}
public IActionResult OnGetTakePicture(long employeeId, long workshopId)
{
var res = new TakePictureModel()
{
EmployeeId = employeeId,
WorkshopId = workshopId
};
var result = _workshopApplication.GetConnectedPersonnels(workshopID).GroupBy(x => x.PersonName)
.Select(x => x.First()).ToList();
return Partial("TakePicture", res);
var final = new List<ConnectedPersonnelViewModel>();
foreach (var item in result)
{
var option = new EmployeeComputeOptionsViewModel();
if (item.ContractPerson)
option = _employeeComputeOptionsApplication.GetEmployeeOptions(workshopID, item.EmployeeId);
}
var finalResult = new ConnectedPersonnelViewModel
{
WorkshopId = item.WorkshopId,
EmployeeId = item.EmployeeId,
PersonName = item.PersonName,
PersonelCode = item.PersonelCode,
ContractPerson = item.ContractPerson,
InsurancePerson = item.InsurancePerson,
ContractLeft = item.ContractLeft,
InsurancetLeft = item.InsurancetLeft,
Black = item.Black,
StartWork = item.StartWork,
BonusesOptions = item.ContractPerson ? option.BonusesOptions : "null",
ComputeOptions = item.ContractPerson ? option.ComputeOptions : "null",
YearsOptions = item.ContractPerson ? option.YearsOptions : "null"
};
public IActionResult OnPostTakePicture(string base64pic1, string base64pic2, long workshopId, long employeeId)
{
try
{
final.Add(finalResult);
}
var directoryPath = $"{_webHostEnvironment.WebRootPath}\\Faces\\{workshopId}\\{employeeId}";
if (!Directory.Exists(directoryPath))
Directory.CreateDirectory(directoryPath);
PersonnelList = new ConnectedPersonnelViewModel
{
ConnectedPersonnelViewModels = final.OrderBy(x => x.Black ? 1 : 0).ThenBy(x => x.PersonelCode).ToList()
};
}
var filePath1 = Path.Combine(directoryPath) + $@"\1.jpg";
CreateImageFromBase64(base64pic1, filePath1);
var filePath2 = Path.Combine(directoryPath) + $@"\2.jpg";
CreateImageFromBase64(base64pic2, filePath2);
return new JsonResult(new
{
IsSuccedded = true,
public IActionResult OnGetCreate(CreateEmployeeComputeOptions command)
{
var result = _employeeComputeOptionsApplication.Create(command);
return new JsonResult(new
{
isSuccedded = result.IsSuccedded,
message = result.Message
});
}
});
//var fileName = file.FileName;
//var fileExtention = Path.GetExtension(fileName);
//if (!string.IsNullOrWhiteSpace(filePath))
//{
// StoreInFolder(file, filePath);
//}
//var files = HttpContext.Request.Form.Files;
//if (files != null)
//{
// foreach (var file in files)
// {
// if (file.Length > 0)
// {
// var fileName = file.FileName;
// var uniqName = "1";
// var fileExtention = Path.GetExtension(fileName);
// var filePath = Path.Combine(_webHostEnvironment.WebRootPath, "Faces") + $@"\uniqName";
// if (!string.IsNullOrWhiteSpace(filePath))
// {
// StoreInFolder(file, filePath);
// }
// }
// }
// return new JsonResult(new
// {
// IsSuccedded = true,
// });
//}
//else
//{
// return new JsonResult(new
// {
// IsSuccedded = false,
// });
//}
}
catch (Exception e)
{
Console.WriteLine(e);
return new JsonResult(new
{
IsSuccedded = false,
});
}
public IActionResult OnGetTakePicture(long employeeId, long workshopId)
{
var res = new TakePictureModel
{
EmployeeId = employeeId,
WorkshopId = workshopId
};
}
return Partial("TakePicture", res);
}
public void CreateImageFromBase64(string base64, string imagePathWithExtension)
{
var subBase64 = base64.Substring(base64.LastIndexOf(',') + 1);
//Convert the base64 to byte array
byte[] bytes = Convert.FromBase64String(subBase64);
//Here you can save the byte array to the SQL database. You can use your own function
//bool saved = DAL.SaveUserPhoto(bytes);
//Create the physical image from the byte array
System.IO.File.WriteAllBytes(imagePathWithExtension, bytes);
}
}
}
public IActionResult OnPostTakePicture(string base64pic1, string base64pic2, long workshopId, long employeeId)
{
try
{
var directoryPath = $"{_webHostEnvironment.WebRootPath}\\Faces\\{workshopId}\\{employeeId}";
if (!Directory.Exists(directoryPath))
Directory.CreateDirectory(directoryPath);
var filePath1 = Path.Combine(directoryPath) + @"\1.jpg";
CreateImageFromBase64(base64pic1, filePath1);
var filePath2 = Path.Combine(directoryPath) + @"\2.jpg";
CreateImageFromBase64(base64pic2, filePath2);
return new JsonResult(new
{
IsSuccedded = true
});
//var fileName = file.FileName;
//var fileExtention = Path.GetExtension(fileName);
//if (!string.IsNullOrWhiteSpace(filePath))
//{
// StoreInFolder(file, filePath);
//}
//var files = HttpContext.Request.Form.Files;
//if (files != null)
//{
// foreach (var file in files)
// {
// if (file.Length > 0)
// {
// var fileName = file.FileName;
// var uniqName = "1";
// var fileExtention = Path.GetExtension(fileName);
// var filePath = Path.Combine(_webHostEnvironment.WebRootPath, "Faces") + $@"\uniqName";
// if (!string.IsNullOrWhiteSpace(filePath))
// {
// StoreInFolder(file, filePath);
// }
// }
// }
// return new JsonResult(new
// {
// IsSuccedded = true,
// });
//}
//else
//{
// return new JsonResult(new
// {
// IsSuccedded = false,
// });
//}
}
catch (Exception e)
{
Console.WriteLine(e);
return new JsonResult(new
{
IsSuccedded = false
});
}
}
public void CreateImageFromBase64(string base64, string imagePathWithExtension)
{
var subBase64 = base64.Substring(base64.LastIndexOf(',') + 1);
//Convert the base64 to byte array
var bytes = Convert.FromBase64String(subBase64);
//Here you can save the byte array to the SQL database. You can use your own function
//bool saved = DAL.SaveUserPhoto(bytes);
//Create the physical image from the byte array
System.IO.File.WriteAllBytes(imagePathWithExtension, bytes);
}
}

View File

@@ -1,8 +1,8 @@
@model CompanyManagment.App.Contracts.Workshop.TakePictureModel
@{
int index = 1;
var index = 1;
<style>
<style>
.test {
width: 55px;
height: 10px;
@@ -27,179 +27,174 @@
}
<div class="row" style="margin: 20px 0 0 0;">
<div class="col-xs-12">
<div class="panel panel-default">
<div class="panel-heading">
عکس اول
</div>
<div class="panel-body">
<div id="my_camera" style="margin: auto; display: none"></div>
<div id="video" style="margin: auto;">
<div class="col-xs-12">
<div class="panel panel-default">
<div class="panel-heading">
عکس اول
</div>
<div class="panel-body">
<div id="my_camera" style="margin: auto; display: none"></div>
<div id="video" style="margin: auto;">
</div>
<div style="margin: 10px 0 0 0;text-align: center;">
<input type="button" class="btn btn-success" value="گرفتن عکس اول" onclick="take_snapshot1()"/>
<input type="button" class="btn btn-success" value="گرفتن عکس دوم" onclick="take_snapshot2()"/>
</div>
</div>
</div>
</div>
</div>
<div style="margin: 10px 0 0 0;text-align: center;">
<input type="button" class="btn btn-success" value="گرفتن عکس اول" onclick="take_snapshot1()"/>
<input type="button" class="btn btn-success" value="گرفتن عکس دوم" onclick="take_snapshot2()"/>
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-xs-12">
<div class="panel panel-default">
<div class="panel-heading">
نمایش
</div>
<form asp-page="./Index" asp-page-handler="TakePicture" id="test"
method="post"
data-ajax="true"
data-callback=""
data-action="Refresh"
enctype="multipart/form-data">
<div class="panel-body text-center">
<div id="result1" style="margin-bottom: 5px;"></div>
<div id="result2" style="margin-bottom: 5px;"></div>
<div id="demoResult1" style="margin-bottom: 5px;"></div>
<div id="demoResult2" style="margin-bottom: 5px;"></div>
<button type="button" onclick="set()" class="btn btn-success">ذخیره</button>
<input type="hidden" id="workshopId" asp-for="@Model.WorkshopId" value="@Model.WorkshopId" />
<input type="hidden" id="employeeId" asp-for="@Model.EmployeeId" value="@Model.EmployeeId" />
</div>
</form>
</div>
</div>
<div class="col-xs-12">
<div class="panel panel-default">
<div class="panel-heading">
نمایش
</div>
<form asp-page="./Index" asp-page-handler="TakePicture" id="test"
method="post"
data-ajax="true"
data-callback=""
data-action="Refresh"
enctype="multipart/form-data">
<div class="panel-body text-center">
<div id="result1" style="margin-bottom: 5px;"></div>
<div id="result2" style="margin-bottom: 5px;"></div>
<div id="demoResult1" style="margin-bottom: 5px;"></div>
<div id="demoResult2" style="margin-bottom: 5px;"></div>
<button type="button" onclick="set()" class="btn btn-success">ذخیره</button>
<input type="hidden" id="workshopId" asp-for="@Model.WorkshopId" value="@Model.WorkshopId"/>
<input type="hidden" id="employeeId" asp-for="@Model.EmployeeId" value="@Model.EmployeeId"/>
</div>
</form>
</div>
</div>
</div>
<div class="row m-t-10">
<div class="col-md-9"></div>
<div class="modal2-btns col-md-3">
<a type="button" id="closeRotate" class="btn pull-left m-l-10" style="background-color: #e7f2f3;border-radius: 15px;box-shadow: 1px 1px 5px 2px rgb(0 0 0 / 19%);" data-dismiss="modal" data-parent-modal="#edit-modal">بستن</a>
<div class="col-md-9"></div>
<div class="modal2-btns col-md-3">
<a type="button" id="closeRotate" class="btn pull-left m-l-10" style="background-color: #e7f2f3;border-radius: 15px;box-shadow: 1px 1px 5px 2px rgb(0 0 0 / 19%);" data-dismiss="modal" data-parent-modal="#edit-modal">بستن</a>
</div>
</div>
</div>
<script src="~/webcamjs/webcam.js"></script>
<script>
if ($(window).width() < 992) {
Webcam.set({
width: 1800,
height: 1800,
if ($(window).width() < 992) {
// final cropped size
// crop_width: 296,
// crop_height: 396,
image_format: 'jpeg',
jpeg_quality: 90
});
Webcam.attach('#my_camera');
Webcam.attach('#video');
var demo = $('#video');
let demoVideo = $('#video').find('video[playsinline="playsinline"]');
demo.css({
width: "300px",
height: "300px",
});
demoVideo.css({
width: "300px",
height: "300px",
});
} else {
Webcam.set({
width: 600,
height: 600,
image_format: 'jpeg',
jpeg_quality: 100
Webcam.set({
width: 1800,
height: 1800,
});
Webcam.attach('#my_camera');
Webcam.attach('#video');
var demo = $('#video');
let demoVideo = $('#video').find('video[playsinline="playsinline"]');
demo.css({
width: "300px",
height: "400px",
});
demoVideo.css({
width: "300px",
height: "400px",
});
}
// final cropped size
// crop_width: 296,
// crop_height: 396,
image_format: 'jpeg',
jpeg_quality: 90
});
Webcam.attach('#my_camera');
Webcam.attach('#video');
var demo = $('#video');
let demoVideo = $('#video').find('video[playsinline="playsinline"]');
demo.css({
width: "300px",
height: "300px",
});
demoVideo.css({
width: "300px",
height: "300px",
});
} else {
Webcam.set({
width: 600,
height: 600,
image_format: 'jpeg',
jpeg_quality: 100
});
Webcam.attach('#my_camera');
Webcam.attach('#video');
var demo = $('#video');
let demoVideo = $('#video').find('video[playsinline="playsinline"]');
demo.css({
width: "300px",
height: "400px",
});
demoVideo.css({
width: "300px",
height: "400px",
});
}
</script>
<script>
function take_snapshot1() {
Webcam.snap(function (data_uri) {
document.getElementById('result1').innerHTML = '<img style="display:none;" id="pic1" data-uri="' + data_uri + '" src="' + data_uri + '"/>';
document.getElementById('demoResult1').innerHTML = '<img style="width: 300px; height: 300px;" data-uri="' + data_uri + '" src="' + data_uri + '"/>';
function take_snapshot1() {
Webcam.snap(function(data_uri) {
document.getElementById('result1').innerHTML = `<img style="display:none;" id="pic1" data-uri="${data_uri}" src="${data_uri}"/>`;
document.getElementById('demoResult1').innerHTML = `<img style="width: 300px; height: 300px;" data-uri="${data_uri}" src="${data_uri}"/>`;
});
}
function take_snapshot2() {
Webcam.snap(function (data_uri) {
document.getElementById('result2').innerHTML = '<img style="display:none;" id="pic2" data-uri="' + data_uri + '" src="' + data_uri + '"/>';
document.getElementById('demoResult2').innerHTML = '<img style="width: 300px; height: 300px;" data-uri="' + data_uri + '" src="' + data_uri + '"/>';
});
}
});
}
function take_snapshot2() {
Webcam.snap(function(data_uri) {
document.getElementById('result2').innerHTML = `<img style="display:none;" id="pic2" data-uri="${data_uri}" src="${data_uri}"/>`;
document.getElementById('demoResult2').innerHTML = `<img style="width: 300px; height: 300px;" data-uri="${data_uri}" src="${data_uri}"/>`;
});
}
function set() {
let pic1 = $("#pic1").attr('src');
let pic2 = $("#pic2").attr('src');
let workshopId = Number($('#workshopId').val());
let employeeId = Number($('#employeeId').val());
if (pic1 != null && pic2 != null) {
$.ajax({
// async: false,
// contentType: 'application/json',
// dataType: 'data',
type: 'POST',
url: '@Url.Page("./Index", "TakePicture")',
data: { "base64pic1": pic1, "base64pic2": pic2, "workshopId": workshopId, "employeeId": employeeId },
headers: { "RequestVerificationToken": $('input[name="__RequestVerificationToken"]').val() },
success: function (response) {
if (response.isSuccedded) {
$.Notification.autoHideNotify('success', 'top center', 'پیام سیستم ', "ok");
} else {
$.Notification.autoHideNotify('error', 'top center', 'پیام سیستم ', "not");
}
},
failure: function (response) {
console.log(5, response);
function set() {
}
});
} else {
$.Notification.autoHideNotify('error', 'top center', 'پیام سیستم ', "گرفتن دو عکس الزامیست");
}
}
const pic1 = $("#pic1").attr('src');
const pic2 = $("#pic2").attr('src');
const workshopId = Number($('#workshopId').val());
const employeeId = Number($('#employeeId').val());
if (pic1 != null && pic2 != null) {
$.ajax({
// async: false,
// contentType: 'application/json',
// dataType: 'data',
type: 'POST',
url: '@Url.Page("./Index", "TakePicture")',
data: { "base64pic1": pic1, "base64pic2": pic2, "workshopId": workshopId, "employeeId": employeeId },
headers: { "RequestVerificationToken": $('input[name="__RequestVerificationToken"]').val() },
success: function(response) {
if (response.isSuccedded) {
$.Notification.autoHideNotify('success', 'top center', 'پیام سیستم ', "ok");
} else {
$.Notification.autoHideNotify('error', 'top center', 'پیام سیستم ', "not");
}
},
failure: function(response) {
console.log(5, response);
}
});
} else {
$.Notification.autoHideNotify('error', 'top center', 'پیام سیستم ', "گرفتن دو عکس الزامیست");
}
}
</script>

View File

@@ -1,9 +1,8 @@
@model CompanyManagment.App.Contracts.Contact2.CreateContact2
@model CompanyManagment.App.Contracts.Contact2.CreateContact2
@{
}
@{
<style >
<style >
.ui-autocomplete-input {
border: none;
@@ -51,42 +50,42 @@
</style>
}
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<form asp-page="./Index" asp-page-handler="Create" id="workshops" autocomplete="off"
method="post"
data-ajax="true"
data-callback=""
data-action="Refresh"
enctype="multipart/form-data">
<div class="modal-body">
<div class="row">
<fieldset style="border: 1px solid #999797; border-radius: 10px; padding: revert">
<legend style="margin-bottom: 5px; font-size: large; border-bottom: 0px; color: #505458; width: 140px; text-align: center;"> تعریف مخاطب </legend>
<div class="row">
<div class="col-md-12">
<div class="form-group">
<label asp-for="NameContact" class="control-label"> نام مخاطب </label>
<input type="text" class="form-control" asp-for="NameContact" id="Contact_Id">
<span asp-validation-for="NameContact" class="error"></span>
</div>
</div>
</div>
</fieldset>
</div>
</div>
<div class="modal-footer">
<button type="submit" class="btn btn-success btn-rounded waves-effect waves-light">ذخیره</button>
<button type="button" class="btn btn-default btn-rounded waves-effect waves-light m-b-5" data-dismiss="modal">بستن</button>
</div>
</form>
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<form asp-page="./Index" asp-page-handler="Create" id="workshops" autocomplete="off"
method="post"
data-ajax="true"
data-callback=""
data-action="Refresh"
enctype="multipart/form-data">
<div class="modal-body">
<div class="row">
<fieldset style="border: 1px solid #999797; border-radius: 10px; padding: revert">
<legend style="margin-bottom: 5px; font-size: large; border-bottom: 0px; color: #505458; width: 140px; text-align: center;"> تعریف مخاطب </legend>
<div class="row">
<div class="col-md-12">
<div class="form-group">
<label asp-for="NameContact" class="control-label"> نام مخاطب </label>
<input type="text" class="form-control" asp-for="NameContact" id="Contact_Id">
<span asp-validation-for="NameContact" class="error"></span>
</div>
</div>
</div>
</fieldset>
</div>
</div>
<div class="modal-footer">
<button type="submit" class="btn btn-success btn-rounded waves-effect waves-light">ذخیره</button>
<button type="button" class="btn btn-default btn-rounded waves-effect waves-light m-b-5" data-dismiss="modal">بستن</button>
</div>
</form>
</div>
<link href="~/js/PTextManager/jquery-ui/jquery-ui.css" rel="stylesheet" />
<link href="~/js/PTextManager/jquery-ui/jquery-ui.css" rel="stylesheet"/>
<script src="~/js/PTextManager/jquery-ui/jquery-ui.min.js"></script>
<script>
$(document).ready(function () {
$('#Contact_Id').autocomplete({
source: '@Url.Page("Index", "Contact")'
});
});
</script>
$(document).ready(function() {
$('#Contact_Id').autocomplete({
source: '@Url.Page("Index", "Contact")'
});
});
</script>

View File

@@ -2,8 +2,7 @@
@{
}
@{
<style>
<style>
.ui-autocomplete-input {
border: none;
@@ -51,42 +50,42 @@
</style>
}
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<form asp-page="./Index" asp-page-handler="Edit" autocomplete="off"
method="post"
data-ajax="true"
data-callback=""
data-action="Refresh"
enctype="multipart/form-data">
<div class="modal-body">
<div class="row">
<fieldset style="border: 1px solid #999797; border-radius: 10px; padding: revert">
<legend style="margin-bottom: 5px; font-size: large; border-bottom: 0px; color: #505458; width: 140px; text-align: center;"> ویرایش عنوان </legend>
<div class="row">
<div class="col-md-12">
<div class="form-group">
<label asp-for="NameContact" class="control-label"> نام مخاطب </label>
<input type="text" class="form-control" asp-for="NameContact" id="Contact_Id">
<span asp-validation-for="NameContact" class="error"></span>
</div>
</div>
</div>
</fieldset>
</div>
</div>
<input type="hidden" asp-for="Id" value="@Model.Id" />
<div class="modal-footer">
<button type="submit" class="btn btn-success btn-rounded waves-effect waves-light">ذخیره</button>
<button type="button" class="btn btn-default btn-rounded waves-effect waves-light m-b-5" data-dismiss="modal">بستن</button>
</div>
</form>
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<form asp-page="./Index" asp-page-handler="Edit" autocomplete="off"
method="post"
data-ajax="true"
data-callback=""
data-action="Refresh"
enctype="multipart/form-data">
<div class="modal-body">
<div class="row">
<fieldset style="border: 1px solid #999797; border-radius: 10px; padding: revert">
<legend style="margin-bottom: 5px; font-size: large; border-bottom: 0px; color: #505458; width: 140px; text-align: center;"> ویرایش عنوان </legend>
<div class="row">
<div class="col-md-12">
<div class="form-group">
<label asp-for="NameContact" class="control-label"> نام مخاطب </label>
<input type="text" class="form-control" asp-for="NameContact" id="Contact_Id">
<span asp-validation-for="NameContact" class="error"></span>
</div>
</div>
</div>
</fieldset>
</div>
</div>
<input type="hidden" asp-for="Id" value="@Model.Id"/>
<div class="modal-footer">
<button type="submit" class="btn btn-success btn-rounded waves-effect waves-light">ذخیره</button>
<button type="button" class="btn btn-default btn-rounded waves-effect waves-light m-b-5" data-dismiss="modal">بستن</button>
</div>
</form>
</div>
<link href="~/js/PTextManager/jquery-ui/jquery-ui.css" rel="stylesheet" />
<link href="~/js/PTextManager/jquery-ui/jquery-ui.css" rel="stylesheet"/>
<script src="~/js/PTextManager/jquery-ui/jquery-ui.min.js"></script>
<script>
$(document).ready(function () {
$('#Contact_Id').autocomplete({
source: '@Url.Page("Index", "Contact")'
});
});
$(document).ready(function() {
$('#Contact_Id').autocomplete({
source: '@Url.Page("Index", "Contact")'
});
});
</script>

View File

@@ -1,18 +1,18 @@
@page
@using Microsoft.AspNetCore.Http.Extensions
@model ServiceHost.Areas.Admin.Pages.Company.Contact2.IndexModel
@using Microsoft.AspNetCore.Http.Extensions;
@{
}
@{
string url = HttpContext.Request.GetEncodedUrl();
//string colaps = "in";
//string act = "active";
int i = 1;
var url = HttpContext.Request.GetEncodedUrl();
//string colaps = "in";
//string act = "active";
var i = 1;
}
@{
//Layout = "~/Pages/Shared/_Layout.cshtml";
Layout = "Shared/_AdminLayout";
ViewData["title"] = "مخاطب";
//Layout = "~/Pages/Shared/_Layout.cshtml";
Layout = "Shared/_AdminLayout";
ViewData["title"] = "مخاطب";
}
<style>
.thh0 {
@@ -206,263 +206,267 @@
<div class="row">
<div class="col-sm-12 m-r-10">
<p class="pull-right">
<a id="btnPopModal" href="#showmodal=@Url.Page("/Company/Contact2/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 m-r-10">
<p class="pull-right">
<a id="btnPopModal" href="#showmodal=@Url.Page("/Company/Contact2/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>
<div class="row">
<div class="col-sm-12 m-r-10">
<input type="hidden" id="sercheCheck" value="@Model.searchModel" />
</div>
<div class="col-sm-12 m-r-10">
<input type="hidden" id="sercheCheck" value="@Model.searchModel"/>
</div>
</div>
<div class="col-sm-12">
<div class="panel-group panel-group-joined" id="accordion-test">
<div class="panel panel-default" style="border-radius: 15px !important; background-color: #fdc0c0; ">
<div class="panel-heading" style="background-color: #950000 !important">
<h4 class="panel-title" style="color: #edebeb !important; display: inline;">
<a data-toggle="collapse" data-parent="#accordion-test" href="#collapseOne" class="collapsed" style="display: inline;">
جستجوی مخاطبین
</a>
</h4>
</div>
<div id="collapseOne" class="panel-collapse collapse in ">
<div class="panel-body" style="padding-top: 15px; padding-bottom: 15px;">
<div class="row">
<div class="col-sm-12">
<form class="form-inline" role="form" method="get" name="search-theme-form" id="search-theme-form" autocomplete="off">
<div class="form-group col-sm-12">
<div class="row">
<div class="panel-group panel-group-joined" id="accordion-test">
<div class="panel panel-default" style="border-radius: 15px !important; background-color: #fdc0c0; ">
<div class="panel-heading" style="background-color: #950000 !important">
<h4 class="panel-title" style="color: #edebeb !important; display: inline;">
<a data-toggle="collapse" data-parent="#accordion-test" href="#collapseOne" class="collapsed" style="display: inline;">
جستجوی مخاطبین
</a>
</h4>
</div>
<div id="collapseOne" class="panel-collapse collapse in ">
<div class="panel-body" style="padding-top: 15px; padding-bottom: 15px;">
<div class="row">
<div class="col-sm-12">
<form class="form-inline" role="form" method="get" name="search-theme-form" id="search-theme-form" autocomplete="off">
<div class="form-group col-sm-12">
<div class="row">
<div class="col-sm-3 pull-right">
<label class="sr-only" asp-for="searchModel.NameContact"></label>
<input class=" form-control inpt" asp-for="searchModel.NameContact" placeholder="مخاطب " style="width: 100%">
</div>
<div class="col-sm-3 pull-right">
<label class="sr-only" asp-for="searchModel.NameContact"></label>
<input class=" form-control inpt" asp-for="searchModel.NameContact" placeholder="مخاطب " style="width: 100%">
</div>
</div>
<hr style=" margin-top: 12px;margin-bottom: 12px;" />
<div class="row" style="margin-top: 15px">
<div class="col-lg-9">
<label class="sr-only" asp-for="searchModel.IsActiveString"></label>
<select id="activing" class="form-control activer" asp-for="searchModel.IsActiveString" style="background-color: #dddddd; border-radius: 25px; border: 1px solid #bfbfbf;">
<option value="true"> فعال </option>
<option value="false"> غیرفعال</option>
<option value="both"> هردو</option>
</select>
</div>
<div class="col-lg-3">
<button type="submit" class="btn btn-success btn-rounded waves-effect waves-light m-b-5 search" style="border-bottom-left-radius: 0px; border-top-left-radius: 0px; background-color: #950000; border-color: #950000; font-family: 'Web_Yekan' !important; margin-left: -3px "> <i class="fa fa-search" style="padding-left: 3px; font-size: 14px;"></i> جستجو</button>
<a class="btn btn-info btn-rounded waves-effect waves-light m-b-5" style="border-bottom-right-radius: 0px; border-top-right-radius: 0px; background-color: #545353; border-color: #545353; font-family: 'Web_Yekan' !important;" asp-page="./Index">مشاهده همه</a>
</div>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<hr style=" margin-top: 12px;margin-bottom: 12px;"/>
<div class="row" style="margin-top: 15px">
<div class="col-lg-9">
<label class="sr-only" asp-for="searchModel.IsActiveString"></label>
<select id="activing" class="form-control activer" asp-for="searchModel.IsActiveString" style="background-color: #dddddd; border-radius: 25px; border: 1px solid #bfbfbf;">
<option value="true"> فعال </option>
<option value="false"> غیرفعال</option>
<option value="both"> هردو</option>
</select>
</div>
<div class="col-lg-3">
<button type="submit" class="btn btn-success btn-rounded waves-effect waves-light m-b-5 search" style="border-bottom-left-radius: 0px; border-top-left-radius: 0px; background-color: #950000; border-color: #950000; font-family: 'Web_Yekan' !important; margin-left: -3px "> <i class="fa fa-search" style="padding-left: 3px; font-size: 14px;"></i> جستجو</button>
<a class="btn btn-info btn-rounded waves-effect waves-light m-b-5" style="border-bottom-right-radius: 0px; border-top-right-radius: 0px; background-color: #545353; border-color: #545353; font-family: 'Web_Yekan' !important;" asp-page="./Index">مشاهده همه</a>
</div>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="col-sm-12">
<div permission="20113" class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title"><i class="fa fa-list" style="padding-left: 3px; font-size: 14px"></i> لیست مخاطبین</h3>
</div>
<div class="panel-body">
<div class="row">
<div class="col-sm-12 col-sm-12 col-xs-12">
<table id="datatable" class="table table-striped table-bordered">
<thead style="background-color: #ecefee">
<tr>
<th style="font-size: 10px !important; display: none" class="sizeSet">
<span class="tooltip-container">
<input class="checkboxtitle" type="checkbox" id="checkSelect" onclick="selectori(this)" checked="checked" />
</span>
</th>
<div permission="20113" class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title"><i class="fa fa-list" style="padding-left: 3px; font-size: 14px"></i> لیست مخاطبین</h3>
</div>
<div class="panel-body">
<div class="row">
<div class="col-sm-12 col-sm-12 col-xs-12">
<table id="datatable" class="table table-striped table-bordered">
<thead style="background-color: #ecefee">
<tr>
<th style="font-size: 10px !important; display: none" class="sizeSet">
<span class="tooltip-container">
<input class="checkboxtitle" type="checkbox" id="checkSelect" onclick="selectori(this)" checked="checked"/>
</span>
</th>
<th style="font-size: 10px !important; width: 5% !important ; text-align:center" class="sizeSet">#</th>
<th style="font-size: 10px !important; width: 80% !important ; text-align:center" class="sizeSet">نام مخاظب</th>
<th style="font-size: 10px !important; width: 65px; ">
<span style="float: right;">
<span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span>
</span>
<span class="act">
</span>
<a class="btn btn-danger pull-right m-rl-5 rad deact" onclick="deactiveAll()">
<i class="fa faSize fa-trash"></i>
</a>
</th>
</tr>
</thead>
<tbody>
@foreach (var item in Model.Contacts)
{
<tr>
<td style="font-size: 16px !important; text-align: center;display:none">
<input type="checkbox" name="foo" value="@item.Id" checked="checked" />
</td>
<td style="font-size: 16px !important; text-align: center">@i </td>
<td style="font-family: 'IranText' !important; font-size: 12px !important; text-align: center">
@item.NameContact
</td>
<th style="font-size: 10px !important; width: 5% !important ; text-align:center" class="sizeSet">#</th>
<th style="font-size: 10px !important; width: 80% !important ; text-align:center" class="sizeSet">نام مخاظب</th>
<th style="font-size: 10px !important; width: 65px; ">
<span style="float: right;">
<span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span>
</span>
<span class="act">
</span>
<a class="btn btn-danger pull-right m-rl-5 rad deact" onclick="deactiveAll()">
<i class="fa faSize fa-trash"></i>
</a>
</th>
</tr>
</thead>
<tbody>
@foreach (var item in Model.Contacts)
{
<tr>
<td style="font-size: 16px !important; text-align: center;display:none">
<input type="checkbox" name="foo" value="@item.Id" checked="checked"/>
</td>
<td style="font-size: 16px !important; text-align: center">@i </td>
<td style="font-family: 'IranText' !important; font-size: 12px !important; text-align: center">
@item.NameContact
</td>
@{
i++;
}
<td>
<a permission="20114" class="btn btn-warning pull-right m-rl-5 rad"
href="#showmodal=@Url.Page("./Index", "Edit", new {Id = item.Id})">
<i class="fa faSize fa-edit"></i>
</a>
@if (item.IsActiveString == "true")
{
<a permission="20116" id="googleLink" class="btn btn-danger pull-right m-rl-5 fff rad" onclick="DeActive('/Admin/Company/Contact2?id=@item.Id&amp;url=@url&amp;handler=DeActive')"><i class="fa faSize fa-trash"></i></a>
}
else
{
<a permission="20116" onclick="IsActive('/Admin/Company/Contact2?id=@item.Id&amp;url=@url&amp;handler=IsActive')" class="btn btn-success pull-right m-rl-5 rad"><i class="fa faSize fa-rotate-left"></i> </a>
@{
i++;
}
<td>
<a permission="20114" class="btn btn-warning pull-right m-rl-5 rad"
href="#showmodal=@Url.Page("./Index", "Edit", new { item.Id })">
<i class="fa faSize fa-edit"></i>
</a>
@if (item.IsActiveString == "true")
{
<a permission="20116" id="googleLink" class="btn btn-danger pull-right m-rl-5 fff rad" onclick="DeActive('/Admin/Company/Contact2?id=@item.Id&amp;url=@url&amp;handler=DeActive')">
<i class="fa faSize fa-trash"></i>
</a>
}
else
{
<a permission="20116" onclick="IsActive('/Admin/Company/Contact2?id=@item.Id&amp;url=@url&amp;handler=IsActive')" class="btn btn-success pull-right m-rl-5 rad">
<i class="fa faSize fa-rotate-left"></i>
</a>
}
}
</td>
</td>
</tr>
}
</tr>
}
</tbody>
</table>
</div>
</div>
</div>
</div>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
@section PanelScripts{
<script src="~/AdminTheme/assets/js/site.js"></script>
<script src="~/adminTheme/assets/datatables/jquery.dataTables.min.js"></script>
<script src="~/adminTheme/assets/datatables/dataTables.bootstrap.js"></script>
<script>
$('.activer').on('change',
function (e) {
e.preventDefault();
$('.search').click();
});
</script>
<script>
<script src="~/AdminTheme/assets/js/site.js"></script>
<script src="~/adminTheme/assets/datatables/jquery.dataTables.min.js"></script>
<script src="~/adminTheme/assets/datatables/dataTables.bootstrap.js"></script>
<script>
$('.activer').on('change',
function(e) {
e.preventDefault();
$('.search').click();
});
</script>
<script>
if (document.getElementById("activing").selectedIndex == 1) {
$('.deact').remove();
$('.act').append(
' <a class="btn btn-success pull-right m-rl-5 rad react" onclick="reActiveAll()">' + '<i class="fa faSize fa-rotate-left"></i>' + ' </a>'
);
}
if (document.getElementById("activing").selectedIndex == 2) {
$('.deact').remove();
}
if (document.getElementById("activing").selectedIndex == 1) {
$('.deact').remove();
$('.act').append(
' <a class="btn btn-success pull-right m-rl-5 rad react" onclick="reActiveAll()">' + '<i class="fa faSize fa-rotate-left"></i>' + ' </a>'
);
}
if (document.getElementById("activing").selectedIndex == 2) {
$('.deact').remove();
}
</script>
<script type="text/javascript">
$(document).ready(function () {
$('#datatable').dataTable({
"lengthMenu": [[25, 10, 50, 100, -1], [25, 10, 50, 100, "All"]]
});
});
</script>
<script>
$(document).ready(function () {
$('#datatable2').dataTable(
{
"lengthMenu": [[25, 10, 50, 100, -1], [25, 10, 50, 100, "All"]]
});
});
</script>
<script>
function selectori(source) {
checkboxes = document.getElementsByName('foo');
for (var i = 0, n = checkboxes.length; i < n; i++) {
checkboxes[i].checked = source.checked;
}
}
</script>
<script>
</script>
<script type="text/javascript">
$(document).ready(function() {
$('#datatable').dataTable({
"lengthMenu": [[25, 10, 50, 100, -1], [25, 10, 50, 100, "All"]]
});
});
</script>
<script>
$(document).ready(function() {
$('#datatable2').dataTable(
{
"lengthMenu": [[25, 10, 50, 100, -1], [25, 10, 50, 100, "All"]]
});
});
</script>
<script>
function selectori(source) {
checkboxes = document.getElementsByName('foo');
for (var i = 0, n = checkboxes.length; i < n; i++) {
checkboxes[i].checked = source.checked;
}
}
</script>
function deactiveAll() {
if (document.getElementById("checkSelect").checked == false) {
$.Notification.autoHideNotify('error', 'top center', 'پیام سیستم ', " هیچ موردی انتخاب نشده است ");
} else {
if (document.getElementById("sercheCheck").value == "true") {
swal({
title: "آیا حذف این قراردادها اطمینان دارید؟",
text: "",
type: "warning",
showCancelButton: true,
confirmButtonColor: "#DD6B55",
confirmButtonText: "بله",
cancelButtonText: "خیر",
closeOnConfirm: false
}, function (isConfirm) {
if (isConfirm) {
checkboxes2 = document.getElementsByName('foo');
var url3b = '';
for (var i2 = 0, n2 = checkboxes2.length; i2 < n2; i2++) {
if (checkboxes2[i2].checked == true) {
var u2 = '&ids=' + checkboxes2[i2].value;
url3b = url3b + u2;
}
}
/* var url1 = '#showmodal=';*/
var url2b = '@Url.Page("/Company/Contracts/Index", "GroupDeActive")';
/* var url3 = document.getElementById('yearSend').value;*/
window.location.href = url2b + url3b;
}
});
<script>
} else if (document.getElementById("sercheCheck").value == "false") {
console.log(document.getElementById("sercheCheck").value);
$.Notification.autoHideNotify('error', 'top center', 'پیام سیستم ', " لطفا در قسمت جستجوی قرارداد حداقل یکی از فیلدهای کارکاه یا پرسنل را انتخاب نموده و سپس جستجو را کلیک کنید ");
}
}
}
</script>
<script>
function reActiveAll() {
if (document.getElementById("checkSelect").checked == false) {
$.Notification.autoHideNotify('error', 'top center', 'پیام سیستم ', " هیچ موردی انتخاب نشده است ");
} else {
if (document.getElementById("sercheCheck").value == "false") {
$.Notification.autoHideNotify('error', 'top center', 'پیام سیستم ', " لطفا در قسمت جستجوی قرارداد حداقل یکی از فیلدهای کارکاه یا پرسنل را انتخاب نموده و سپس جستجو را کلیک کنید ");
} else if (document.getElementById("sercheCheck").value == "true") {
swal({
title: "آیا فعال نمودن این قراردادها اطمینان دارید؟",
text: "",
type: "warning",
showCancelButton: true,
confirmButtonColor: "#DD6B55",
confirmButtonText: "بله",
cancelButtonText: "خیر",
closeOnConfirm: false
}, function (isConfirm) {
if (isConfirm) {
checkboxes2 = document.getElementsByName('foo');
var url3b = '';
for (var i2 = 0, n2 = checkboxes2.length; i2 < n2; i2++) {
if (checkboxes2[i2].checked == true) {
var u2 = '&ids=' + checkboxes2[i2].value;
url3b = url3b + u2;
}
}
var url2b = '@Url.Page("/Company/Contracts/Index", "GroupReActive")';
window.location.href = url2b + url3b;
}
});
}
}
}
</script>
function deactiveAll() {
if (document.getElementById("checkSelect").checked == false) {
$.Notification.autoHideNotify('error', 'top center', 'پیام سیستم ', " هیچ موردی انتخاب نشده است ");
} else {
if (document.getElementById("sercheCheck").value == "true") {
swal({
title: "آیا حذف این قراردادها اطمینان دارید؟",
text: "",
type: "warning",
showCancelButton: true,
confirmButtonColor: "#DD6B55",
confirmButtonText: "بله",
cancelButtonText: "خیر",
closeOnConfirm: false
},
function(isConfirm) {
if (isConfirm) {
checkboxes2 = document.getElementsByName('foo');
let url3b = '';
for (var i2 = 0, n2 = checkboxes2.length; i2 < n2; i2++) {
if (checkboxes2[i2].checked == true) {
const u2 = `&ids=${checkboxes2[i2].value}`;
url3b = url3b + u2;
}
}
/* var url1 = '#showmodal=';*/
const url2b = '@Url.Page("/Company/Contracts/Index", "GroupDeActive")';
/* var url3 = document.getElementById('yearSend').value;*/
window.location.href = url2b + url3b;
}
});
} else if (document.getElementById("sercheCheck").value == "false") {
console.log(document.getElementById("sercheCheck").value);
$.Notification.autoHideNotify('error', 'top center', 'پیام سیستم ', " لطفا در قسمت جستجوی قرارداد حداقل یکی از فیلدهای کارکاه یا پرسنل را انتخاب نموده و سپس جستجو را کلیک کنید ");
}
}
}
</script>
<script>
function reActiveAll() {
if (document.getElementById("checkSelect").checked == false) {
$.Notification.autoHideNotify('error', 'top center', 'پیام سیستم ', " هیچ موردی انتخاب نشده است ");
} else {
if (document.getElementById("sercheCheck").value == "false") {
$.Notification.autoHideNotify('error', 'top center', 'پیام سیستم ', " لطفا در قسمت جستجوی قرارداد حداقل یکی از فیلدهای کارکاه یا پرسنل را انتخاب نموده و سپس جستجو را کلیک کنید ");
} else if (document.getElementById("sercheCheck").value == "true") {
swal({
title: "آیا فعال نمودن این قراردادها اطمینان دارید؟",
text: "",
type: "warning",
showCancelButton: true,
confirmButtonColor: "#DD6B55",
confirmButtonText: "بله",
cancelButtonText: "خیر",
closeOnConfirm: false
},
function(isConfirm) {
if (isConfirm) {
checkboxes2 = document.getElementsByName('foo');
let url3b = '';
for (var i2 = 0, n2 = checkboxes2.length; i2 < n2; i2++) {
if (checkboxes2[i2].checked == true) {
const u2 = `&ids=${checkboxes2[i2].value}`;
url3b = url3b + u2;
}
}
const url2b = '@Url.Page("/Company/Contracts/Index", "GroupReActive")';
window.location.href = url2b + url3b;
}
});
}
}
}
</script>
}
}

View File

@@ -1,145 +1,141 @@
using System.Collections.Generic;
using System.Linq;
using CompanyManagment.App.Contracts.Contact2;
using CompanyManagment.App.Contracts.Contract;
using CompanyManagment.EFCore;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
namespace ServiceHost.Areas.Admin.Pages.Company.Contact2
namespace ServiceHost.Areas.Admin.Pages.Company.Contact2;
public class IndexModel : PageModel
{
public class IndexModel : PageModel
{
public string Message { get; set; }
public Contact2ViewModel searchModel;
public List<Contact2ViewModel> Contacts;
private CompanyContext db;
public string cation2Search = "false";
private readonly IContactApplication2 _contactApplication2;
public string cation2Search = "false";
public List<Contact2ViewModel> Contacts;
private CompanyContext db;
public Contact2ViewModel searchModel;
private readonly IContactApplication2 _contactApplication2;
public IndexModel(IContactApplication2 contactApplication2, CompanyContext db)
{
_contactApplication2 = contactApplication2;
this.db = db;
}
public IndexModel(IContactApplication2 contactApplication2, CompanyContext db)
{
_contactApplication2 = contactApplication2;
this.db = db;
}
public void OnGet(Contact2SearchModel searchModel)
{
Contacts = _contactApplication2.Search(searchModel);
if (Contacts != null)
{
public string Message { get; set; }
if (!string.IsNullOrEmpty(searchModel.NameContact))
{
cation2Search = "true";
}
}
}
public IActionResult OnGetCreate()
{
return Partial("./Create");
}
public IActionResult OnPostCreate(CreateContact2 command)
{
var result = _contactApplication2.Create(command);
return new JsonResult(result);
}
public IActionResult OnGetEdit(long id)
{
var Contact = _contactApplication2.GetDetails(id);
return Partial("Edit", Contact);
}
public JsonResult OnPostEdit(EditContact2 command)
{
//if (ModelState.IsValid)
//{
//}
var result = _contactApplication2.Edit(command);
return new JsonResult(result);
}
public IActionResult OnGetDetails(long id)
{
var editJob = _contactApplication2.GetDetails(id);
return Partial("Details", editJob);
}
public void OnGet(Contact2SearchModel searchModel)
{
Contacts = _contactApplication2.Search(searchModel);
public IActionResult OnGetSearch(string term)
{
var names = db.EntityContacts.Where(p => p.NameContact.Contains(term)).Select(p => p.NameContact).ToList();
return new JsonResult(names);
}
if (Contacts != null)
if (!string.IsNullOrEmpty(searchModel.NameContact))
cation2Search = "true";
}
public IActionResult OnGetContact(string term)
{
var names = _contactApplication2.GetAllContact().Where(p => p.NameContact.Contains(term)).Select(p => p.NameContact).ToList();
return new JsonResult(names);
}
public IActionResult OnGetCreate()
{
return Partial("./Create");
}
public IActionResult OnGetDeActive(long id, string url)
{
var result = _contactApplication2.DeActive(id);
if (result.IsSuccedded)
return new JsonResult(url);
Message = result.Message;
return RedirectToPage(url);
}
public IActionResult OnGetIsActive(long id, string url)
{
var result = _contactApplication2.Active(id);
if (result.IsSuccedded)
return new JsonResult(url);
Message = result.Message;
return RedirectToPage(url);
}
public IActionResult OnGetGroupDeActive(List<long> ids)
{
foreach (var item in ids)
{
var result = _contactApplication2.DeActive(item);
}
return RedirectToPage("./Index");
public IActionResult OnPostCreate(CreateContact2 command)
{
var result = _contactApplication2.Create(command);
return new JsonResult(result);
}
}
public IActionResult OnGetGroupReActive(List<long> ids)
{
public IActionResult OnGetEdit(long id)
{
var Contact = _contactApplication2.GetDetails(id);
return Partial("Edit", Contact);
}
foreach (var item in ids)
{
var result = _contactApplication2.Active(item);
}
public JsonResult OnPostEdit(EditContact2 command)
{
//if (ModelState.IsValid)
//{
//}
var result = _contactApplication2.Edit(command);
return new JsonResult(result);
}
public IActionResult OnGetDetails(long id)
{
var editJob = _contactApplication2.GetDetails(id);
return Partial("Details", editJob);
}
public IActionResult OnGetSearch(string term)
{
var names = db.EntityContacts.Where(p => p.NameContact.Contains(term)).Select(p => p.NameContact).ToList();
return new JsonResult(names);
}
public IActionResult OnGetContact(string term)
{
var names = _contactApplication2.GetAllContact().Where(p => p.NameContact.Contains(term))
.Select(p => p.NameContact).ToList();
return new JsonResult(names);
}
public IActionResult OnGetDeActive(long id, string url)
{
var result = _contactApplication2.DeActive(id);
if (result.IsSuccedded)
return new JsonResult(url);
Message = result.Message;
return RedirectToPage(url);
}
public IActionResult OnGetIsActive(long id, string url)
{
var result = _contactApplication2.Active(id);
if (result.IsSuccedded)
return new JsonResult(url);
Message = result.Message;
return RedirectToPage(url);
}
public IActionResult OnGetGroupDeActive(List<long> ids)
{
foreach (var item in ids)
{
var result = _contactApplication2.DeActive(item);
}
return RedirectToPage("./Index");
}
public IActionResult OnGetGroupReActive(List<long> ids)
{
foreach (var item in ids)
{
var result = _contactApplication2.Active(item);
}
//if (result.IsSuccedded)
// return RedirectToPage("./Index");
//if (result.IsSuccedded)
// return RedirectToPage("./Index");
return RedirectToPage("./Index");
}
return RedirectToPage("./Index");
}
public IActionResult OnGetGroupSign(List<long> ids)
{
public IActionResult OnGetGroupSign(List<long> ids)
{
foreach (var item in ids)
{
var result = _contactApplication2.Sign(item);
}
foreach (var item in ids)
{
var result = _contactApplication2.Sign(item);
}
return RedirectToPage("./Index");
return RedirectToPage("./Index");
}
}
public IActionResult OnGetGroupUnSign(List<long> ids)
{
public IActionResult OnGetGroupUnSign(List<long> ids)
{
foreach (var item in ids)
{
var result = _contactApplication2.UnSign(item);
}
foreach (var item in ids)
{
var result = _contactApplication2.UnSign(item);
}
return RedirectToPage("./Index");
}
}
}
return RedirectToPage("./Index");
}
}

View File

@@ -1,7 +1,6 @@
@model CompanyManagment.App.Contracts.PersonalContractingParty.CreatePersonalContractingParty
@{
<style>
<style>
.modal-footer {
display: flex;
justify-content: flex-start;
@@ -172,10 +171,10 @@
}
</style>
}
<link href="~/lib/select2/css/select2.css" rel="stylesheet" />
<link href="~/lib/select2/css/select2.css" rel="stylesheet"/>
<div class="modal-header" id="createContractingParty">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
</div>
<form asp-page="./Index" asp-page-handler="Create" autocomplete="off"
method="post"
@@ -183,333 +182,336 @@
data-callback=""
data-action="Refresh"
enctype="multipart/form-data">
<div class="modal-body">
<div class="row">
<fieldset style="border: 1px solid #999797; border-radius: 10px; padding: revert;padding-bottom: 30px">
<legend style="margin-bottom: 5px; font-size: large; border-bottom: 0px; color: #505458; width: 245px; text-align: center;"> مشخصات طرف حساب حقیقی</legend>
<div class="modal-body">
<div class="row">
<fieldset style="border: 1px solid #999797; border-radius: 10px; padding: revert;padding-bottom: 30px">
<legend style="margin-bottom: 5px; font-size: large; border-bottom: 0px; color: #505458; width: 245px; text-align: center;"> مشخصات طرف حساب حقیقی</legend>
<div class="flexible-wrap">
<div class="col-md-6 col-xs-6">
<div class="form-group">
<label asp-for="RepresentativeId">انتخاب معرف</label>
<select class="form-control select-city" asp-for="RepresentativeId" asp-items='new SelectList(Model.RepresentativeViewModels, "Id", "FullName")'>
</select>
<span asp-validation-for="RepresentativeId" class="error"></span>
</div>
<div class="flexible-wrap">
<div class="col-md-6 col-xs-6">
<div class="form-group">
<label asp-for="RepresentativeId">انتخاب معرف</label>
<select class="form-control select-city" asp-for="RepresentativeId" asp-items='new SelectList(Model.RepresentativeViewModels, "Id", "FullName")'>
</select>
<span asp-validation-for="RepresentativeId" class="error"></span>
</div>
</div>
<div class="col-md-6 col-xs-6">
<div class="form-group">
<label asp-for="SureName" class="control-label">نام مستعار</label>
<input type="text" class="form-control" asp-for="SureName">
<span asp-validation-for="SureName" class="error"></span>
</div>
</div>
<div class="col-md-6 col-xs-6">
<div class="form-group">
<label asp-for="SureName" class="control-label">نام مستعار</label>
<input type="text" class="form-control" asp-for="SureName">
<span asp-validation-for="SureName" class="error"></span>
</div>
</div>
</div>
<div class="col-md-6 col-xs-6">
<div class="form-group">
<label asp-for="FName" class="control-label">نام</label>
<input type="text" class="form-control" asp-for="FName">
<span asp-validation-for="FName" class="error"></span>
@if (TempData["name"] != null)
{
<br />
<div class="col-md-6 col-xs-6">
<div class="form-group">
<label asp-for="FName" class="control-label">نام</label>
<input type="text" class="form-control" asp-for="FName">
<span asp-validation-for="FName" class="error"></span>
@if (TempData["name"] != null)
{
<br/>
<span class="error">@TempData["name"]</span>
}
<span class="error">@TempData["name"]</span>
}
</div>
</div>
<div class="col-md-6 col-xs-6">
<div class="form-group">
<label asp-for="LName" class="control-label">نام خانوادگی</label>
<input type="text" class="form-control" asp-for="LName">
<span asp-validation-for="LName" class="error"></span>
@if (TempData["family"] != null)
{
<br />
</div>
</div>
<div class="col-md-6 col-xs-6">
<div class="form-group">
<label asp-for="LName" class="control-label">نام خانوادگی</label>
<input type="text" class="form-control" asp-for="LName">
<span asp-validation-for="LName" class="error"></span>
@if (TempData["family"] != null)
{
<br/>
<span class="error">@TempData["family"]</span>
}
</div>
</div>
<div class="col-md-6 col-xs-6">
<div class="form-group">
<label asp-for="Nationalcode" class="control-label">کد ملی</label>
<input type="text" class="form-control" asp-for="Nationalcode">
<span asp-validation-for="Nationalcode" class="error"></span>
@if (TempData["err"] != null)
{
<br />
<span class="error">@TempData["family"]</span>
}
</div>
</div>
<div class="col-md-6 col-xs-6">
<div class="form-group">
<label asp-for="Nationalcode" class="control-label">کد ملی</label>
<input type="text" class="form-control" asp-for="Nationalcode">
<span asp-validation-for="Nationalcode" class="error"></span>
@if (TempData["err"] != null)
{
<br/>
<span class="error">@TempData["err"]</span>
}
@if (TempData["notok"] != null)
{
<br />
<span class="error">@TempData["err"]</span>
}
@if (TempData["notok"] != null)
{
<br/>
<span class="error">@TempData["notok"]</span>
}
@if (TempData["notvalid"] != null)
{
<br />
<span class="error">@TempData["notok"]</span>
}
@if (TempData["notvalid"] != null)
{
<br/>
<span class="error">@TempData["notvalid"]</span>
}
@if (TempData["NationalCode"] != null)
{
<br />
<span class="error">@TempData["notvalid"]</span>
}
@if (TempData["NationalCode"] != null)
{
<br/>
<span class="error">@TempData["NationalCode"]</span>
}
</div>
</div>
<div class="col-md-6 col-xs-6">
<div class="form-group">
<label asp-for="IdNumber" class="control-label">شماره شناسنامه</label>
<input type="text" class="form-control" asp-for="IdNumber">
<span asp-validation-for="IdNumber" class="error"></span>
@if (TempData["IdR"] != null)
{
<br />
<span class="error">@TempData["NationalCode"]</span>
}
</div>
</div>
<div class="col-md-6 col-xs-6">
<div class="form-group">
<label asp-for="IdNumber" class="control-label">شماره شناسنامه</label>
<input type="text" class="form-control" asp-for="IdNumber">
<span asp-validation-for="IdNumber" class="error"></span>
@if (TempData["IdR"] != null)
{
<br/>
<span class="error">@TempData["IdR"]</span>
}
</div>
</div>
<div class="col-md-4 col-xs-6 col-xs-6">
<div class="form-group">
<label asp-for="Phone" class="control-label">شماره تلفن</label>
<input type="text" class="form-control" asp-for="Phone">
<span asp-validation-for="Phone" class="error"></span>
</div>
</div>
<div class="col-md-4 col-xs-6">
<div class="form-group">
<label asp-for="AgentPhone" class="control-label">شماره تلفن نماینده</label>
<input type="text" class="form-control" asp-for="AgentPhone">
<span asp-validation-for="AgentPhone" class="error"></span>
</div>
</div>
<div class="col-md-4 col-xs-6">
<div class="form-group">
<label asp-for="ArchiveCode" class="control-label">کد طرف حساب</label>
<input type="text" class="form-control" asp-for="ArchiveCode">
<span asp-validation-for="ArchiveCode" class="error"></span>
</div>
</div>
<div class="col-md-4 col-xs-6 col-xs-12">
<div class="form-group">
<label class="input-label">نام استان </label>
<select class="form-control select-city" asp-for="State" name="state" onChange="iranwebsv(this.value);">
<option value="">انتخاب استان</option>
<option value="تهران"> تهران </option>
<option value="گیلان"> گیلان </option>
<option value="آذربایجان شرقی"> آذربایجان شرقی</option>
<option value="خوزستان"> خوزستان </option>
<option value="فارس"> فارس</option>
<option value="اصفهان"> اصفهان</option>
<option value="خراسان رضوی">خراسان رضوی </option>
<option value="قزوین"> قزوین</option>
<option value="سمنان"> سمنان </option>
<option value="قم"> قم</option>
<option value="مرکزی"> مرکزی</option>
<option value="زنجان"> زنجان</option>
<option value="مازندران"> مازندران</option>
<option value="گلستان"> گلستان</option>
<option value="اردبیل"> اردبیل </option>
<option value="آذربایجان غربی"> آذربایجان غربی</option>
<option value="همدان"> همدان </option>
<option value="کردستان"> کردستان </option>
<option value="کرمانشاه"> کرمانشاه </option>
<option value="لرستان"> لرستان</option>
<option value="بوشهر"> بوشهر</option>
<option value="کرمان"> کرمان</option>
<option value="هرمزگان"> هرمزگان</option>
<option value="چهارمحال و بختیاری"> چهارمحال و بختیاری</option>
<option value="یزد"> یزد</option>
<option value="سیستان و بلوچستان"> سیستان و بلوچستان</option>
<option value="ایلام"> ایلام</option>
<option value="کهگلویه و بویراحمد"> کهگلویه و بویراحمد</option>
<option value="خراسان شمالی"> خراسان شمالی</option>
<option value="خراسان جنوبی"> خراسان جنوبی</option>
<option value="البرز"> البرز</option>
</select>
</div>
</div>
<div class="col-md-4 col-xs-6 col-xs-12">
<div class="form-group">
<label class="input-label">نام شهر </label>
<select class="form-control select-city" name="cityy" id="city" onchange="changeCity(this)">
<option value="" placeholder="انتخاب شهر"> </option>
</select>
<input type="hidden" value="" id="hide2" asp-for="City">
</div>
</div>
<div class="col-md-4 col-xs-6 col-xs-12">
<div class="form-group">
<label class="input-label">نام محله </label>
<div class="neighborField">
<input type="text" @*asp-for="ZoneName"*@ class="neighborInput form-control" />
<a class="addNeighbor">
<i class="fa fa-plus"></i>
</a>
</div>
</div>
</div>
<div class="col-md-12 col-xs-12">
<div class="form-group">
<label class="input-label">جزئیات نشانی </label>
<input type="text" placeholder="" class="form-control" id="Address" name="Address" value="">
</div>
</div>
</div>
<div class="modal fade" id="edit-modal" tabindex="-1" role="dialog" aria-labelledby="edit-modal-label" aria-hidden="true" style="backdrop-filter: blur(6px);background-color: #0000005c;">
<div class="modal-dialoge" role="document">
<div class="modal-content2">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" data-parent-modal="#edit-modal" aria-hidden="true" style="left: auto;right: auto;margin-top: 20px;margin-right: 20px;">
×
</button>
<div class="modal-title">افزودن نشانی جدید</div>
</div>
<div class="modal-body">
<div class="col-md-4 col-xs-6 col-xs-12">
<label class="input-label">نام استان </label>
<select class="form-control" asp-for="State" name="state" onChange="iranwebsv(this.value);">
<option value="">انتخاب استان</option>
<option value="تهران"> تهران </option>
<option value="گیلان"> گیلان </option>
<option value="آذربایجان شرقی"> آذربایجان شرقی</option>
<option value="خوزستان"> خوزستان </option>
<option value="فارس"> فارس</option>
<option value="اصفهان"> اصفهان</option>
<option value="خراسان رضوی">خراسان رضوی </option>
<option value="قزوین"> قزوین</option>
<option value="سمنان"> سمنان </option>
<option value="قم"> قم</option>
<option value="مرکزی"> مرکزی</option>
<option value="زنجان"> زنجان</option>
<option value="مازندران"> مازندران</option>
<option value="گلستان"> گلستان</option>
<option value="اردبیل"> اردبیل </option>
<option value="آذربایجان غربی"> آذربایجان غربی</option>
<option value="همدان"> همدان </option>
<option value="کردستان"> کردستان </option>
<option value="کرمانشاه"> کرمانشاه </option>
<option value="لرستان"> لرستان</option>
<option value="بوشهر"> بوشهر</option>
<option value="کرمان"> کرمان</option>
<option value="هرمزگان"> هرمزگان</option>
<option value="چهارمحال و بختیاری"> چهارمحال و بختیاری</option>
<option value="یزد"> یزد</option>
<option value="سیستان و بلوچستان"> سیستان و بلوچستان</option>
<option value="ایلام"> ایلام</option>
<option value="کهگلویه و بویراحمد"> کهگلویه و بویراحمد</option>
<option value="خراسان شمالی"> خراسان شمالی</option>
<option value="خراسان جنوبی"> خراسان جنوبی</option>
<option value="البرز"> البرز</option>
</select>
</div>
<div class="col-md-4 col-xs-6 col-xs-12">
<label class="input-label">نام شهر </label>
<select class="form-control" name="cityy" id="modalCity">
<option value="" placeholder="انتخاب شهر"> </option>
</select>
@* <input type="hidden" value="" id="hide3" asp-for="City"> *@
</div>
<div class="col-md-4 col-xs-6 col-xs-12">
<label>نام محله </label>
<input type="text" class="form-control" />
<span class="error">@TempData["IdR"]</span>
}
</div>
</div>
<div class="col-md-4 col-xs-6 col-xs-6">
<div class="form-group">
<label asp-for="Phone" class="control-label">شماره تلفن</label>
<input type="text" class="form-control" asp-for="Phone">
<span asp-validation-for="Phone" class="error"></span>
</div>
</div>
<div class="col-md-4 col-xs-6">
<div class="form-group">
<label asp-for="AgentPhone" class="control-label">شماره تلفن نماینده</label>
<input type="text" class="form-control" asp-for="AgentPhone">
<span asp-validation-for="AgentPhone" class="error"></span>
</div>
</div>
<div class="col-md-4 col-xs-6">
<div class="form-group">
<label asp-for="ArchiveCode" class="control-label">کد طرف حساب</label>
<input type="text" class="form-control" asp-for="ArchiveCode">
<span asp-validation-for="ArchiveCode" class="error"></span>
</div>
</div>
<div class="col-md-4 col-xs-6 col-xs-12">
<div class="form-group">
<label class="input-label">نام استان </label>
<select class="form-control select-city" asp-for="State" name="state" onChange="iranwebsv(this.value);">
<option value="">انتخاب استان</option>
<option value="تهران"> تهران </option>
<option value="گیلان"> گیلان </option>
<option value="آذربایجان شرقی"> آذربایجان شرقی</option>
<option value="خوزستان"> خوزستان </option>
<option value="فارس"> فارس</option>
<option value="اصفهان"> اصفهان</option>
<option value="خراسان رضوی">خراسان رضوی </option>
<option value="قزوین"> قزوین</option>
<option value="سمنان"> سمنان </option>
<option value="قم"> قم</option>
<option value="مرکزی"> مرکزی</option>
<option value="زنجان"> زنجان</option>
<option value="مازندران"> مازندران</option>
<option value="گلستان"> گلستان</option>
<option value="اردبیل"> اردبیل </option>
<option value="آذربایجان غربی"> آذربایجان غربی</option>
<option value="همدان"> همدان </option>
<option value="کردستان"> کردستان </option>
<option value="کرمانشاه"> کرمانشاه </option>
<option value="لرستان"> لرستان</option>
<option value="بوشهر"> بوشهر</option>
<option value="کرمان"> کرمان</option>
<option value="هرمزگان"> هرمزگان</option>
<option value="چهارمحال و بختیاری"> چهارمحال و بختیاری</option>
<option value="یزد"> یزد</option>
<option value="سیستان و بلوچستان"> سیستان و بلوچستان</option>
<option value="ایلام"> ایلام</option>
<option value="کهگلویه و بویراحمد"> کهگلویه و بویراحمد</option>
<option value="خراسان شمالی"> خراسان شمالی</option>
<option value="خراسان جنوبی"> خراسان جنوبی</option>
<option value="البرز"> البرز</option>
</select>
</div>
</div>
<div class="col-md-4 col-xs-6 col-xs-12">
<div class="form-group">
<label class="input-label">نام شهر </label>
<select class="form-control select-city" name="cityy" id="city" onchange="changeCity(this)">
<option value="" placeholder="انتخاب شهر"> </option>
</select>
<input type="hidden" value="" id="hide2" asp-for="City">
</div>
</div>
<div class="col-md-4 col-xs-6 col-xs-12">
<div class="form-group">
<label class="input-label">نام محله </label>
<div class="neighborField">
<input type="text" @*asp-for="ZoneName"*@ class="neighborInput form-control"/>
<a class="addNeighbor">
<i class="fa fa-plus"></i>
</a>
</div>
</div>
</div>
<div class="col-md-12 col-xs-12">
<div class="form-group">
<label class="input-label">جزئیات نشانی </label>
<input type="text" placeholder="" class="form-control" id="Address" name="Address" value="">
</div>
</div>
</div>
<div class="modal fade" id="edit-modal" tabindex="-1" role="dialog" aria-labelledby="edit-modal-label" aria-hidden="true" style="backdrop-filter: blur(6px);background-color: #0000005c;">
<div class="modal-dialoge" role="document">
<div class="modal-content2">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" data-parent-modal="#edit-modal" aria-hidden="true" style="left: auto;right: auto;margin-top: 20px;margin-right: 20px;">
×
</button>
<div class="modal-title">افزودن نشانی جدید</div>
</div>
<div class="modal-body">
<div class="col-md-4 col-xs-6 col-xs-12">
<label class="input-label">نام استان </label>
<select class="form-control" asp-for="State" name="state" onChange="iranwebsv(this.value);">
<option value="">انتخاب استان</option>
<option value="تهران"> تهران </option>
<option value="گیلان"> گیلان </option>
<option value="آذربایجان شرقی"> آذربایجان شرقی</option>
<option value="خوزستان"> خوزستان </option>
<option value="فارس"> فارس</option>
<option value="اصفهان"> اصفهان</option>
<option value="خراسان رضوی">خراسان رضوی </option>
<option value="قزوین"> قزوین</option>
<option value="سمنان"> سمنان </option>
<option value="قم"> قم</option>
<option value="مرکزی"> مرکزی</option>
<option value="زنجان"> زنجان</option>
<option value="مازندران"> مازندران</option>
<option value="گلستان"> گلستان</option>
<option value="اردبیل"> اردبیل </option>
<option value="آذربایجان غربی"> آذربایجان غربی</option>
<option value="همدان"> همدان </option>
<option value="کردستان"> کردستان </option>
<option value="کرمانشاه"> کرمانشاه </option>
<option value="لرستان"> لرستان</option>
<option value="بوشهر"> بوشهر</option>
<option value="کرمان"> کرمان</option>
<option value="هرمزگان"> هرمزگان</option>
<option value="چهارمحال و بختیاری"> چهارمحال و بختیاری</option>
<option value="یزد"> یزد</option>
<option value="سیستان و بلوچستان"> سیستان و بلوچستان</option>
<option value="ایلام"> ایلام</option>
<option value="کهگلویه و بویراحمد"> کهگلویه و بویراحمد</option>
<option value="خراسان شمالی"> خراسان شمالی</option>
<option value="خراسان جنوبی"> خراسان جنوبی</option>
<option value="البرز"> البرز</option>
</select>
</div>
<div class="col-md-4 col-xs-6 col-xs-12">
<label class="input-label">نام شهر </label>
<select class="form-control" name="cityy" id="modalCity">
<option value="" placeholder="انتخاب شهر"> </option>
</select>
@* <input type="hidden" value="" id="hide3" asp-for="City"> *@
</div>
<div class="col-md-4 col-xs-6 col-xs-12">
<label>نام محله </label>
<input type="text" class="form-control"/>
</div>
<div class="col-md-12 col-xs-12" style="margin-top: 10px;padding: 0;">
<div class="panel panel-default" id="city-table">
<div class="panel-heading">
<h3 class="panel-title"><i class="fa fa-list" style="padding-left: 3px; font-size: 14px"></i> لیست عناوین </h3>
</div>
<div class="panel-body">
<div>
<div>
<table id="datatable" class="table table-striped table-bordered">
<thead>
<tr>
<th style="font-size: 12px !important;text-align: center">#</th>
<th style="font-size: 12px !important; text-align: center">نام استان</th>
<th style="font-size: 12px !important; text-align: center">نام شهر </th>
<th style="font-size: 12px !important; text-align: center">نام محله </th>
<th style="font-size: 12px !important; width: 20%; text-align: center">عملیات</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="modal2-btns">
<button type="button" class="btn modal2-btn" data-dismiss="modal" id="closing" data-parent-modal="#edit-modal">انصراف</button>
<button type="button" onclick="sendData()" class="btn modal2-btn" id="edit">ذخیره </button>
</div>
</div>
<div class="col-md-12 col-xs-12" style="margin-top: 10px;padding: 0;">
<div class="panel panel-default" id="city-table">
<div class="panel-heading">
<h3 class="panel-title"><i class="fa fa-list" style="padding-left: 3px; font-size: 14px"></i> لیست عناوین </h3>
</div>
<div class="panel-body">
<div>
<div>
<table id="datatable" class="table table-striped table-bordered">
<thead>
<tr>
<th style="font-size: 12px !important;text-align: center">#</th>
<th style="font-size: 12px !important; text-align: center">نام استان</th>
<th style="font-size: 12px !important; text-align: center">نام شهر </th>
<th style="font-size: 12px !important; text-align: center">نام محله </th>
<th style="font-size: 12px !important; width: 20%; text-align: center">عملیات</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="modal2-btns">
<button type="button" class="btn modal2-btn" data-dismiss="modal" id="closing" data-parent-modal="#edit-modal">انصراف</button>
<button type="button" onclick="sendData()" class="btn modal2-btn" id="edit">ذخیره </button>
</div>
</div>
</div>
</div>
</fieldset>
</div>
</div>
@*<input type="hidden" asp-for="id" value="id"/>*@
</div>
</div>
</div>
</fieldset>
</div>
</div>
@*<input type="hidden" asp-for="id" value="id"/>*@
<div class="modal-footer">
@*<button type="button" class="btn btn-default waves-effect" data-dismiss="modal">بستن</button>*@
<button type="submit" class="btn btn-success btn-rounded waves-effect waves-light" id="save"> ذخیره </button>
<button type="button" class="btn btn-default btn-rounded waves-effect waves-light m-b-5" data-dismiss="modal">بستن </button>
</div>
<div class="modal-footer">
@*<button type="button" class="btn btn-default waves-effect" data-dismiss="modal">بستن</button>*@
<button type="submit" class="btn btn-success btn-rounded waves-effect waves-light" id="save"> ذخیره </button>
<button type="button" class="btn btn-default btn-rounded waves-effect waves-light m-b-5" data-dismiss="modal">بستن </button>
</div>
</form>
<script language="javascript" src="~/AdminTheme/js/city.js"></script>
<script src="~/lib/select2/js/select2.js"></script>
<script>
$(document).ready(function () {
$(".select-city").select2({
language: "fa",
dir: "rtl"
});
});
var selectCity = $('#city.select-city');
var selectedCityOption = selectCity.find('option:selected');
$('#hide2').val(selectedCityOption.text());
$(document).ready(function() {
$(".select-city").select2({
language: "fa",
dir: "rtl"
});
});
var selectCity = $('#city.select-city');
var selectedCityOption = selectCity.find('option:selected');
$('#hide2').val(selectedCityOption.text());
var selectCity2 = $('#modalCity.select-city');
var selectedCityOption2 = selectCity.find('option:selected');
console.log(selectedCityOption2.text());
$('#hide3').val(selectedCityOption2.text());
var selectCity2 = $('#modalCity.select-city');
var selectedCityOption2 = selectCity.find('option:selected');
console.log(selectedCityOption2.text());
$('#hide3').val(selectedCityOption2.text());
$("#edit-modal").on('hidden.bs.modal', function () {
$('body').addClass('modal-open');
});
$("#edit-modal").on('hidden.bs.modal',
function() {
$('body').addClass('modal-open');
});
$(function () {
$('#edit-modal [data-parent-modal]').on('click', function (e) {
e.preventDefault();
e.stopPropagation();
var parentModalId = $(this).data('parent-modal');
$(parentModalId).modal('hide');
});
});
$(function () {
$('.addNeighbor').on('click', function (e) {
e.preventDefault();
$('#edit-modal').modal('show');
});
});
function changeCity(element){
$('#hide2').val($(element).find('option:selected').text());
}
$(function() {
$('#edit-modal [data-parent-modal]').on('click',
function(e) {
e.preventDefault();
e.stopPropagation();
const parentModalId = $(this).data('parent-modal');
$(parentModalId).modal('hide');
});
});
$(function() {
$('.addNeighbor').on('click',
function(e) {
e.preventDefault();
$('#edit-modal').modal('show');
});
});
function changeCity(element) {
$('#hide2').val($(element).find('option:selected').text());
}
</script>

View File

@@ -1,6 +1,6 @@
@model CompanyManagment.App.Contracts.PersonalContractingParty.EditPersonalContractingParty
@{
<style>
<style>
#MainModal {
backdrop-filter: blur(8px);
}
@@ -110,66 +110,66 @@
</style>
}
<div id="ContractingPartyDetails">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
</div>
<form asp-page="./Index" asp-page-handler="Details"
method="post"
data-ajax="true"
data-callback=""
data-action="Refresh"
enctype="multipart/form-data">
<div class="modal-body">
<div class="row">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
</div>
<form asp-page="./Index" asp-page-handler="Details"
method="post"
data-ajax="true"
data-callback=""
data-action="Refresh"
enctype="multipart/form-data">
<div class="modal-body">
<div class="row">
<fieldset style="border: 1px solid #999797; border-radius: 10px; padding: revert;">
<legend style="margin-bottom: 5px; font-size: large; border-bottom: 0px; color: #505458; width: 240px; text-align: center;"> اطلاعات طرف حساب حقیقی</legend>
<fieldset style="border: 1px solid #999797; border-radius: 10px; padding: revert;">
<legend style="margin-bottom: 5px; font-size: large; border-bottom: 0px; color: #505458; width: 240px; text-align: center;"> اطلاعات طرف حساب حقیقی</legend>
<table id="thh" style="height: 150px;width: 100%">
<tr>
<th>فیلد</th>
<th>اطلاعات</th>
<table id="thh" style="height: 150px;width: 100%">
<tr>
<th>فیلد</th>
<th>اطلاعات</th>
</tr>
<tr>
<td>نام و نام خانوادگی</td>
<td> @Model.FName @Model.LName</td>
</tr>
<tr>
<td>کد ملی</td>
<td> @Model.Nationalcode</td>
</tr>
<tr>
<td> شماره شناسنامه </td>
<td> @Model.IdNumber </td>
</tr>
<tr>
<td>نام و نام خانوادگی</td>
<td> @Model.FName @Model.LName</td>
</tr>
<tr>
<td>کد ملی</td>
<td> @Model.Nationalcode</td>
</tr>
<tr>
<td> شماره شناسنامه </td>
<td> @Model.IdNumber </td>
</tr>
<tr>
<td> شماره تلفن </td>
<td> @Model.Phone</td>
</tr>
<tr>
<td> شماره تلفن نماینده</td>
<td> @Model.AgentPhone </td>
</tr>
<tr>
<td> آدرس </td>
<td> @Model.Address </td>
</tr>
<tr>
<td> معرف </td>
<td> @Model.RepresentativeFullName </td>
</tr>
<tr>
<td> شماره تلفن </td>
<td> @Model.Phone</td>
</tr>
<tr>
<td> شماره تلفن نماینده</td>
<td> @Model.AgentPhone </td>
</tr>
<tr>
<td> آدرس </td>
<td> @Model.Address </td>
</tr>
<tr>
<td> معرف </td>
<td> @Model.RepresentativeFullName </td>
</tr>
</table>
</fieldset>
</div>
</div>
<input type="hidden" asp-for="Id" value="@Model.Id" />
<div class="modal-footer">
<button type="button" class="btn btn-warning btn-rounded waves-effect waves-light m-b-5" data-dismiss="modal">بستن فرم</button>
</div>
</form>
</tr>
</table>
</fieldset>
</div>
</div>
<input type="hidden" asp-for="Id" value="@Model.Id"/>
<div class="modal-footer">
<button type="button" class="btn btn-warning btn-rounded waves-effect waves-light m-b-5" data-dismiss="modal">بستن فرم</button>
</div>
</form>
</div>

View File

@@ -1,6 +1,6 @@
@model CompanyManagment.App.Contracts.PersonalContractingParty.EditPersonalContractingParty
@{
<style>
<style>
.modal-footer {
display: flex;
justify-content: flex-start;
@@ -184,326 +184,350 @@
</style>
}
<div id="ContractingPartyEdit">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
</div>
<form asp-page="./Index" asp-page-handler="Edit" autocomplete="off"
method="post"
data-ajax="true"
data-callback=""
data-action="Refresh"
enctype="multipart/form-data">
<div class="modal-body">
<div class="row">
<fieldset style="border: 1px solid #999797; border-radius: 10px; padding: revert;padding-bottom: 30px">
<legend style="margin-bottom: 5px; font-size: large; border-bottom: 0px; color: #505458; width: 245px; text-align: center;"> ویرایش طرف حساب حقیقی</legend>
<div class="flexible-wrap">
<div class="col-md-6 col-xs-6">
<div class="form-group">
<label asp-for="RepresentativeId">انتخاب معرف</label>
<select class="form-control select-city" asp-for="RepresentativeId" asp-items='new SelectList(Model.RepresentativeViewModels, "Id", "FullName")'>
</select>
<span asp-validation-for="RepresentativeId" class="error"></span>
</div>
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
</div>
<div class="col-md-6 col-xs-6">
<div class="form-group">
<label asp-for="SureName" class="control-label">نام مستعار</label>
<input type="text" class="form-control" asp-for="SureName">
<span asp-validation-for="SureName" class="error"></span>
</div>
</div>
<form asp-page="./Index" asp-page-handler="Edit" autocomplete="off"
method="post"
data-ajax="true"
data-callback=""
data-action="Refresh"
enctype="multipart/form-data">
<div class="modal-body">
<div class="row">
<fieldset style="border: 1px solid #999797; border-radius: 10px; padding: revert;padding-bottom: 30px">
<legend style="margin-bottom: 5px; font-size: large; border-bottom: 0px; color: #505458; width: 245px; text-align: center;"> ویرایش طرف حساب حقیقی</legend>
<div class="flexible-wrap">
<div class="col-md-6 col-xs-6">
<div class="form-group">
<label asp-for="RepresentativeId">انتخاب معرف</label>
<select class="form-control select-city" asp-for="RepresentativeId" asp-items='new SelectList(Model.RepresentativeViewModels, "Id", "FullName")'>
</select>
<span asp-validation-for="RepresentativeId" class="error"></span>
</div>
</div>
<div class="col-md-6 col-xs-6">
<div class="form-group">
<label asp-for="SureName" class="control-label">نام مستعار</label>
<input type="text" class="form-control" asp-for="SureName">
<span asp-validation-for="SureName" class="error"></span>
</div>
</div>
<div class="col-md-6 col-xs-6">
<div class="form-group">
<label asp-for="FName" class="control-label">نام</label>
<input type="text" class="form-control" asp-for="FName">
<span asp-validation-for="FName" class="error"></span>
@if (TempData["name"] != null)
{<br /><span class="error">@TempData["name"]</span>}
</div>
<div class="col-md-6 col-xs-6">
<div class="form-group">
<label asp-for="FName" class="control-label">نام</label>
<input type="text" class="form-control" asp-for="FName">
<span asp-validation-for="FName" class="error"></span>
@if (TempData["name"] != null)
{
<br/>
<span class="error">@TempData["name"]</span>
}
</div>
</div>
<div class="col-md-6 col-xs-6">
<div class="form-group">
<label asp-for="LName" class="control-label">نام خانوادگی</label>
<input type="text" class="form-control" asp-for="LName">
<span asp-validation-for="LName" class="error"></span>
@if (TempData["family"] != null)
{<br /><span class="error">@TempData["family"]</span>}
</div>
</div>
<div class="col-md-6 col-xs-6">
<div class="form-group">
<label asp-for="Nationalcode" class="control-label">کد ملی</label>
@if (Model.HasContract)
{
<input type="text" class="form-control" asp-for="Nationalcode" readonly >
}
else
{
<input type="text" class="form-control" asp-for="Nationalcode" >
}
<span asp-validation-for="Nationalcode" class="error"></span>
@if (TempData["err"] != null)
{<br /><span class="error">@TempData["err"]</span>}
@if (TempData["notok"] != null)
{<br /><span class="error">@TempData["notok"]</span>}
@if (TempData["notvalid"] != null)
{<br /><span class="error">@TempData["notvalid"]</span>}
@if (TempData["NationalCode"] != null)
{<br /><span class="error">@TempData["NationalCode"]</span>}
</div>
</div>
<div class="col-md-6 col-xs-6">
<div class="form-group">
<label asp-for="IdNumber" class="control-label">شماره شناسنامه</label>
<input type="text" class="form-control" asp-for="IdNumber">
<span asp-validation-for="IdNumber" class="error"></span>
@if (TempData["IdR"] != null)
{<br /><span class="error">@TempData["IdR"]</span>}
</div>
</div>
<div class="col-md-4 col-xs-6">
<div class="form-group">
<label asp-for="Phone" class="control-label">شماره تلفن</label>
<input type="text" class="form-control" asp-for="Phone">
<span asp-validation-for="Phone" class="error"></span>
</div>
</div>
<div class="col-md-4 col-xs-6">
<div class="form-group">
<label asp-for="AgentPhone" class="control-label">شماره تلفن نماینده</label>
<input type="text" class="form-control" asp-for="AgentPhone">
<span asp-validation-for="AgentPhone" class="error"></span>
</div>
</div>
<div class="col-md-4 col-xs-6">
<div class="form-group">
<label asp-for="ArchiveCode" class="control-label">کد طرف حساب</label>
<input type="text" class="form-control" asp-for="ArchiveCode">
<span asp-validation-for="ArchiveCode" class="error"></span>
</div>
</div>
<div class="col-md-4 col-xs-6 col-xs-12">
<div class="form-group">
<label class="input-label">نام استان </label>
<select class="form-control select-city" asp-for="State" name="state" onChange="iranwebsv(this.value);">
<option value="">انتخاب استان</option>
<option value="تهران"> تهران </option>
<option value="گیلان"> گیلان </option>
<option value="آذربایجان شرقی"> آذربایجان شرقی</option>
<option value="خوزستان"> خوزستان </option>
<option value="فارس"> فارس</option>
<option value="اصفهان"> اصفهان</option>
<option value="خراسان رضوی">خراسان رضوی </option>
<option value="قزوین"> قزوین</option>
<option value="سمنان"> سمنان </option>
<option value="قم"> قم</option>
<option value="مرکزی"> مرکزی</option>
<option value="زنجان"> زنجان</option>
<option value="مازندران"> مازندران</option>
<option value="گلستان"> گلستان</option>
<option value="اردبیل"> اردبیل </option>
<option value="آذربایجان غربی"> آذربایجان غربی</option>
<option value="همدان"> همدان </option>
<option value="کردستان"> کردستان </option>
<option value="کرمانشاه"> کرمانشاه </option>
<option value="لرستان"> لرستان</option>
<option value="بوشهر"> بوشهر</option>
<option value="کرمان"> کرمان</option>
<option value="هرمزگان"> هرمزگان</option>
<option value="چهارمحال و بختیاری"> چهارمحال و بختیاری</option>
<option value="یزد"> یزد</option>
<option value="سیستان و بلوچستان"> سیستان و بلوچستان</option>
<option value="ایلام"> ایلام</option>
<option value="کهگلویه و بویراحمد"> کهگلویه و بویراحمد</option>
<option value="خراسان شمالی"> خراسان شمالی</option>
<option value="خراسان جنوبی"> خراسان جنوبی</option>
<option value="البرز"> البرز</option>
</select>
</div>
</div>
<div class="col-md-4 col-xs-6 col-xs-12">
<div class="form-group">
<label class="input-label">نام شهر </label>
<select class="form-control select-city" name="cityy" id="city" onchange="changeCity(this)">
<option value="" placeholder="انتخاب شهر"> </option>
</select>
<input type="hidden" value="" id="hide2" asp-for="City" >
<input type="hidden" value="@Model.City" id="hide3">
</div>
</div>
<div class="col-md-4 col-xs-6 col-xs-12">
<div class="form-group">
<label class="input-label">نام محله </label>
<div class="neighborField">
<input type="text" @*asp-for="ZoneName"*@ class="neighborInput form-control" />
<a class="addNeighbor">
<i class="fa fa-plus"></i>
</a>
</div>
</div>
</div>
<div class="col-md-12 col-xs-12">
<div class="form-group">
<label class="input-label">جزئیات نشانی </label>
<input type="text" placeholder="" class="form-control" id="Address" name="Address" value="">
</div>
</div>
</div>
<div class="modal fade" id="edit-modal" tabindex="-1" role="dialog" aria-labelledby="edit-modal-label" aria-hidden="true" style="backdrop-filter: blur(6px);background-color: #0000005c;">
<div class="modal-dialoge" role="document">
<div class="modal-content2">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" data-parent-modal="#edit-modal" aria-hidden="true" style="left: auto;right: auto;margin-top: 20px;margin-right: 20px;">
×
</button>
<div class="modal-title">افزودن نشانی جدید</div>
</div>
<div class="modal-body">
<div class="col-md-4 col-xs-6 col-xs-12">
<label class="input-label">نام استان </label>
<select class="form-control select-city" @*asp-for="State"*@ name="state" onChange="iranwebsv(this.value);">
<option value="">انتخاب استان</option>
<option value="تهران"> تهران </option>
<option value="گیلان"> گیلان </option>
<option value="آذربایجان شرقی"> آذربایجان شرقی</option>
<option value="خوزستان"> خوزستان </option>
<option value="فارس"> فارس</option>
<option value="اصفهان"> اصفهان</option>
<option value="خراسان رضوی">خراسان رضوی </option>
<option value="قزوین"> قزوین</option>
<option value="سمنان"> سمنان </option>
<option value="قم"> قم</option>
<option value="مرکزی"> مرکزی</option>
<option value="زنجان"> زنجان</option>
<option value="مازندران"> مازندران</option>
<option value="گلستان"> گلستان</option>
<option value="اردبیل"> اردبیل </option>
<option value="آذربایجان غربی"> آذربایجان غربی</option>
<option value="همدان"> همدان </option>
<option value="کردستان"> کردستان </option>
<option value="کرمانشاه"> کرمانشاه </option>
<option value="لرستان"> لرستان</option>
<option value="بوشهر"> بوشهر</option>
<option value="کرمان"> کرمان</option>
<option value="هرمزگان"> هرمزگان</option>
<option value="چهارمحال و بختیاری"> چهارمحال و بختیاری</option>
<option value="یزد"> یزد</option>
<option value="سیستان و بلوچستان"> سیستان و بلوچستان</option>
<option value="ایلام"> ایلام</option>
<option value="کهگلویه و بویراحمد"> کهگلویه و بویراحمد</option>
<option value="خراسان شمالی"> خراسان شمالی</option>
<option value="خراسان جنوبی"> خراسان جنوبی</option>
<option value="البرز"> البرز</option>
</select>
</div>
<div class="col-md-4 col-xs-6 col-xs-12">
<label class="input-label">نام شهر </label>
<select class="form-control select-city" name="cityy" id="modalCity">
<option value="" placeholder="انتخاب شهر"> </option>
</select>
@* <input type="hidden" value="" id="hide3" > *@
</div>
<div class="col-md-4 col-xs-6 col-xs-12">
<label>نام محله </label>
<input type="text" class="form-control" />
</div>
</div>
<div class="col-md-6 col-xs-6">
<div class="form-group">
<label asp-for="LName" class="control-label">نام خانوادگی</label>
<input type="text" class="form-control" asp-for="LName">
<span asp-validation-for="LName" class="error"></span>
@if (TempData["family"] != null)
{
<br/>
<span class="error">@TempData["family"]</span>
}
</div>
</div>
<div class="col-md-6 col-xs-6">
<div class="form-group">
<label asp-for="Nationalcode" class="control-label">کد ملی</label>
@if (Model.HasContract)
{
<input type="text" class="form-control" asp-for="Nationalcode" readonly>
}
else
{
<input type="text" class="form-control" asp-for="Nationalcode">
}
</div>
<div class="col-md-12 col-xs-12" style="margin-top: 10px;padding: 0;">
<div class="panel panel-default" id="city-table">
<div class="panel-heading">
<h3 class="panel-title"><i class="fa fa-list" style="padding-left: 3px; font-size: 14px"></i> لیست عناوین </h3>
</div>
<div class="panel-body">
<div>
<div>
<table id="datatable" class="table table-striped table-bordered">
<thead>
<tr>
<th style="font-size: 12px !important;text-align: center">#</th>
<th style="font-size: 12px !important; text-align: center">نام استان</th>
<th style="font-size: 12px !important; text-align: center">نام شهر </th>
<th style="font-size: 12px !important; text-align: center">نام محله </th>
<th style="font-size: 12px !important; width: 20%; text-align: center">عملیات</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="modal2-btns">
<button type="button" class="btn modal2-btn" data-dismiss="modal" id="closing" data-parent-modal="#edit-modal">انصراف</button>
<button type="button" onclick="sendData()" class="btn modal2-btn" id="edit">ذخیره </button>
</div>
<span asp-validation-for="Nationalcode" class="error"></span>
@if (TempData["err"] != null)
{
<br/>
<span class="error">@TempData["err"]</span>
}
@if (TempData["notok"] != null)
{
<br/>
<span class="error">@TempData["notok"]</span>
}
@if (TempData["notvalid"] != null)
{
<br/>
<span class="error">@TempData["notvalid"]</span>
}
@if (TempData["NationalCode"] != null)
{
<br/>
<span class="error">@TempData["NationalCode"]</span>
}
</div>
</div>
<div class="col-md-6 col-xs-6">
<div class="form-group">
<label asp-for="IdNumber" class="control-label">شماره شناسنامه</label>
<input type="text" class="form-control" asp-for="IdNumber">
<span asp-validation-for="IdNumber" class="error"></span>
@if (TempData["IdR"] != null)
{
<br/>
<span class="error">@TempData["IdR"]</span>
}
</div>
</div>
<div class="col-md-4 col-xs-6">
<div class="form-group">
<label asp-for="Phone" class="control-label">شماره تلفن</label>
<input type="text" class="form-control" asp-for="Phone">
<span asp-validation-for="Phone" class="error"></span>
</div>
</div>
<div class="col-md-4 col-xs-6">
<div class="form-group">
<label asp-for="AgentPhone" class="control-label">شماره تلفن نماینده</label>
<input type="text" class="form-control" asp-for="AgentPhone">
<span asp-validation-for="AgentPhone" class="error"></span>
</div>
</div>
<div class="col-md-4 col-xs-6">
<div class="form-group">
<label asp-for="ArchiveCode" class="control-label">کد طرف حساب</label>
<input type="text" class="form-control" asp-for="ArchiveCode">
<span asp-validation-for="ArchiveCode" class="error"></span>
</div>
</div>
<div class="col-md-4 col-xs-6 col-xs-12">
<div class="form-group">
<label class="input-label">نام استان </label>
<select class="form-control select-city" asp-for="State" name="state" onChange="iranwebsv(this.value);">
<option value="">انتخاب استان</option>
<option value="تهران"> تهران </option>
<option value="گیلان"> گیلان </option>
<option value="آذربایجان شرقی"> آذربایجان شرقی</option>
<option value="خوزستان"> خوزستان </option>
<option value="فارس"> فارس</option>
<option value="اصفهان"> اصفهان</option>
<option value="خراسان رضوی">خراسان رضوی </option>
<option value="قزوین"> قزوین</option>
<option value="سمنان"> سمنان </option>
<option value="قم"> قم</option>
<option value="مرکزی"> مرکزی</option>
<option value="زنجان"> زنجان</option>
<option value="مازندران"> مازندران</option>
<option value="گلستان"> گلستان</option>
<option value="اردبیل"> اردبیل </option>
<option value="آذربایجان غربی"> آذربایجان غربی</option>
<option value="همدان"> همدان </option>
<option value="کردستان"> کردستان </option>
<option value="کرمانشاه"> کرمانشاه </option>
<option value="لرستان"> لرستان</option>
<option value="بوشهر"> بوشهر</option>
<option value="کرمان"> کرمان</option>
<option value="هرمزگان"> هرمزگان</option>
<option value="چهارمحال و بختیاری"> چهارمحال و بختیاری</option>
<option value="یزد"> یزد</option>
<option value="سیستان و بلوچستان"> سیستان و بلوچستان</option>
<option value="ایلام"> ایلام</option>
<option value="کهگلویه و بویراحمد"> کهگلویه و بویراحمد</option>
<option value="خراسان شمالی"> خراسان شمالی</option>
<option value="خراسان جنوبی"> خراسان جنوبی</option>
<option value="البرز"> البرز</option>
</select>
</div>
</div>
<div class="col-md-4 col-xs-6 col-xs-12">
<div class="form-group">
<label class="input-label">نام شهر </label>
<select class="form-control select-city" name="cityy" id="city" onchange="changeCity(this)">
<option value="" placeholder="انتخاب شهر"> </option>
</select>
<input type="hidden" value="" id="hide2" asp-for="City">
<input type="hidden" value="@Model.City" id="hide3">
</div>
</div>
<div class="col-md-4 col-xs-6 col-xs-12">
<div class="form-group">
<label class="input-label">نام محله </label>
<div class="neighborField">
<input type="text" @*asp-for="ZoneName"*@ class="neighborInput form-control"/>
<a class="addNeighbor">
<i class="fa fa-plus"></i>
</a>
</div>
</div>
</div>
<div class="col-md-12 col-xs-12">
<div class="form-group">
<label class="input-label">جزئیات نشانی </label>
<input type="text" placeholder="" class="form-control" id="Address" name="Address" value="">
</div>
</div>
</div>
<div class="modal fade" id="edit-modal" tabindex="-1" role="dialog" aria-labelledby="edit-modal-label" aria-hidden="true" style="backdrop-filter: blur(6px);background-color: #0000005c;">
<div class="modal-dialoge" role="document">
<div class="modal-content2">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" data-parent-modal="#edit-modal" aria-hidden="true" style="left: auto;right: auto;margin-top: 20px;margin-right: 20px;">
×
</button>
<div class="modal-title">افزودن نشانی جدید</div>
</div>
<div class="modal-body">
<div class="col-md-4 col-xs-6 col-xs-12">
<label class="input-label">نام استان </label>
<select class="form-control select-city" @*asp-for="State"*@ name="state" onChange="iranwebsv(this.value);">
<option value="">انتخاب استان</option>
<option value="تهران"> تهران </option>
<option value="گیلان"> گیلان </option>
<option value="آذربایجان شرقی"> آذربایجان شرقی</option>
<option value="خوزستان"> خوزستان </option>
<option value="فارس"> فارس</option>
<option value="اصفهان"> اصفهان</option>
<option value="خراسان رضوی">خراسان رضوی </option>
<option value="قزوین"> قزوین</option>
<option value="سمنان"> سمنان </option>
<option value="قم"> قم</option>
<option value="مرکزی"> مرکزی</option>
<option value="زنجان"> زنجان</option>
<option value="مازندران"> مازندران</option>
<option value="گلستان"> گلستان</option>
<option value="اردبیل"> اردبیل </option>
<option value="آذربایجان غربی"> آذربایجان غربی</option>
<option value="همدان"> همدان </option>
<option value="کردستان"> کردستان </option>
<option value="کرمانشاه"> کرمانشاه </option>
<option value="لرستان"> لرستان</option>
<option value="بوشهر"> بوشهر</option>
<option value="کرمان"> کرمان</option>
<option value="هرمزگان"> هرمزگان</option>
<option value="چهارمحال و بختیاری"> چهارمحال و بختیاری</option>
<option value="یزد"> یزد</option>
<option value="سیستان و بلوچستان"> سیستان و بلوچستان</option>
<option value="ایلام"> ایلام</option>
<option value="کهگلویه و بویراحمد"> کهگلویه و بویراحمد</option>
<option value="خراسان شمالی"> خراسان شمالی</option>
<option value="خراسان جنوبی"> خراسان جنوبی</option>
<option value="البرز"> البرز</option>
</select>
</div>
<div class="col-md-4 col-xs-6 col-xs-12">
<label class="input-label">نام شهر </label>
<select class="form-control select-city" name="cityy" id="modalCity">
<option value="" placeholder="انتخاب شهر"> </option>
</select>
@* <input type="hidden" value="" id="hide3" > *@
</div>
<div class="col-md-4 col-xs-6 col-xs-12">
<label>نام محله </label>
<input type="text" class="form-control"/>
</div>
</div>
</div>
</fieldset>
</div>
</div>
<div class="col-md-12 col-xs-12" style="margin-top: 10px;padding: 0;">
<div class="panel panel-default" id="city-table">
<div class="panel-heading">
<h3 class="panel-title"><i class="fa fa-list" style="padding-left: 3px; font-size: 14px"></i> لیست عناوین </h3>
</div>
<div class="panel-body">
<div>
<div>
<table id="datatable" class="table table-striped table-bordered">
<thead>
<tr>
<th style="font-size: 12px !important;text-align: center">#</th>
<th style="font-size: 12px !important; text-align: center">نام استان</th>
<th style="font-size: 12px !important; text-align: center">نام شهر </th>
<th style="font-size: 12px !important; text-align: center">نام محله </th>
<th style="font-size: 12px !important; width: 20%; text-align: center">عملیات</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="modal2-btns">
<button type="button" class="btn modal2-btn" data-dismiss="modal" id="closing" data-parent-modal="#edit-modal">انصراف</button>
<button type="button" onclick="sendData()" class="btn modal2-btn" id="edit">ذخیره </button>
</div>
</div>
<input type="hidden" asp-for="Id" value="@Model.Id" />
</div>
</div>
</div>
</fieldset>
</div>
<div class="modal-footer">
</div>
<input type="hidden" asp-for="Id" value="@Model.Id"/>
<button type="submit" class="btn btn-success btn-rounded waves-effect waves-light" id="save"> ویرایش </button>
<button type="button" class="btn btn-default btn-rounded waves-effect waves-light m-b-5" data-dismiss="modal">بستن </button>
</div>
</form>
<div class="modal-footer">
<button type="submit" class="btn btn-success btn-rounded waves-effect waves-light" id="save"> ویرایش </button>
<button type="button" class="btn btn-default btn-rounded waves-effect waves-light m-b-5" data-dismiss="modal">بستن </button>
</div>
</form>
</div>
<script language="javascript" src="~/AdminTheme/js/city.js"></script>
<script>
$(document).ready(function () {
let state = $('#State').val();
let city = $('#hide3').val();
iranwebsv(state);
//$(`#city [text="${city}"]`).attr("selected", true);
$("#city option").each(function () {
if ($(this).text() == city) {
$(this).attr('selected', 'selected');
}
});
});
// var selectCity2 = $('#modalCity.select-city');
// var selectedCityOption2 = selectCity.find('option:selected');
// console.log(selectedCityOption2.text());
// $('#hide3').val(selectedCityOption2.text());
$(document).ready(function() {
const state = $('#State').val();
const city = $('#hide3').val();
iranwebsv(state);
//$(`#city [text="${city}"]`).attr("selected", true);
$("#city option").each(function() {
if ($(this).text() == city) {
$(this).attr('selected', 'selected');
}
});
});
// var selectCity2 = $('#modalCity.select-city');
// var selectedCityOption2 = selectCity.find('option:selected');
// console.log(selectedCityOption2.text());
// $('#hide3').val(selectedCityOption2.text());
$("#edit-modal").on('hidden.bs.modal', function () {
$('body').addClass('modal-open');
});
$("#edit-modal").on('hidden.bs.modal',
function() {
$('body').addClass('modal-open');
});
$(function () {
$('#edit-modal [data-parent-modal]').on('click', function (e) {
e.preventDefault();
e.stopPropagation();
var parentModalId = $(this).data('parent-modal');
$(parentModalId).modal('hide');
});
});
$(function () {
$('.addNeighbor').on('click', function (e) {
e.preventDefault();
$('#edit-modal').modal('show');
});
});
$(function() {
$('#edit-modal [data-parent-modal]').on('click',
function(e) {
e.preventDefault();
e.stopPropagation();
const parentModalId = $(this).data('parent-modal');
$(parentModalId).modal('hide');
});
});
$(function() {
$('.addNeighbor').on('click',
function(e) {
e.preventDefault();
$('#edit-modal').modal('show');
});
});
function changeCity(element) {
$('#hide2').val($(element).find('option:selected').text());
}
function changeCity(element) {
$('#hide2').val($(element).find('option:selected').text());
}
</script>

View File

@@ -1,254 +1,255 @@
using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
using System.Threading.Tasks;
using System.Diagnostics.CodeAnalysis;
using _0_Framework.Application;
using Company.Domain.ContarctingPartyAgg;
using CompanyManagment.App.Contracts.InstitutionContract;
using CompanyManagment.App.Contracts.PersonalContractingParty;
using CompanyManagment.App.Contracts.Representative;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Diagnostics;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
using Microsoft.Extensions.Logging;
using static Microsoft.EntityFrameworkCore.DbLoggerCategory.Database;
namespace ServiceHost.Areas.Admin.Pages.Company.ContractingParties;
[Authorize]
public class IndexModel : PageModel
{
private readonly IPersonalContractingPartyApp _personalContractingPartyApp;
public PersonalContractingPartySearchModel SearchModel2;
public List<PersonalContractingPartyViewModel> Personals;
public List<CreatePersonalContractingParty> PersonCreat;
public string LName;
public string Nationalcode;
public string RepresentativeName;
private readonly IPersonalContractingPartyApp _personalContractingPartyApp;
private readonly IPersonalContractingPartyRepository _personalContractingPartyRepository;
private readonly IRepresentativeApplication _representativeApplication;
private readonly IPersonalContractingPartyRepository _personalContractingPartyRepository;
private readonly IRepresentativeApplication _representativeApplication;
public string LName;
public string Nationalcode;
public List<PersonalContractingPartyViewModel> Personals;
public List<CreatePersonalContractingParty> PersonCreat;
public string RepresentativeName;
public IndexModel(IPersonalContractingPartyApp personalContractingPartyApp, IPersonalContractingPartyRepository personalContractingPartyRepository, IRepresentativeApplication representativeApplication, IInstitutionContractApplication institutionContract)
{
_personalContractingPartyApp = personalContractingPartyApp;
_personalContractingPartyRepository = personalContractingPartyRepository;
_representativeApplication = representativeApplication;
}
public void OnGet(PersonalContractingPartySearchModel searchModel2)
{
if (searchModel2.IsActiveString == null)
{
searchModel2.IsActiveString = "true"; }
Personals = _personalContractingPartyApp.SearchForMain(searchModel2).OrderByDescending(x=>x.IsBlock=="true").ThenBy(x=>x.HasInstitutionContract).ToList();
if (!string.IsNullOrEmpty(searchModel2.Nationalcode) && searchModel2.Nationalcode.Length==10)
{
Nationalcode = Personals.Select(x => x.Nationalcode).FirstOrDefault();
}
else
{
Nationalcode = searchModel2.Nationalcode;
}
if (searchModel2.id > 0)
{
var pesonel= Personals.FirstOrDefault(x => x.id== searchModel2.id);
if (pesonel != null)
LName = (pesonel.IsLegal == "حقیقی" ? (pesonel.FName+" "+ pesonel.LName) : pesonel.LName);
}
else
{
LName = searchModel2.EmployeeName;
}
if (searchModel2.RepresentativeId > 0)
{
var representative = _representativeApplication.GetDetails(searchModel2.RepresentativeId);
RepresentativeName = representative.FullName;
}
else
{
RepresentativeName = searchModel2.RepresentativeName;
}
}
public PersonalContractingPartySearchModel SearchModel2;
public IActionResult OnGetCreate()
{
public IndexModel(IPersonalContractingPartyApp personalContractingPartyApp,
IPersonalContractingPartyRepository personalContractingPartyRepository,
IRepresentativeApplication representativeApplication, IInstitutionContractApplication institutionContract)
{
_personalContractingPartyApp = personalContractingPartyApp;
_personalContractingPartyRepository = personalContractingPartyRepository;
_representativeApplication = representativeApplication;
}
var command = new CreatePersonalContractingParty()
{
RepresentativeViewModels = _representativeApplication.GetRepresentatives(),
ArchiveCode = _personalContractingPartyApp.GetLastArchiveCode(),
};
public void OnGet(PersonalContractingPartySearchModel searchModel2)
{
if (searchModel2.IsActiveString == null) searchModel2.IsActiveString = "true";
Personals = _personalContractingPartyApp.SearchForMain(searchModel2).OrderByDescending(x => x.IsBlock == "true")
.ThenBy(x => x.HasInstitutionContract).ToList();
if (!string.IsNullOrEmpty(searchModel2.Nationalcode) && searchModel2.Nationalcode.Length == 10)
Nationalcode = Personals.Select(x => x.Nationalcode).FirstOrDefault();
else
Nationalcode = searchModel2.Nationalcode;
if (searchModel2.id > 0)
{
var pesonel = Personals.FirstOrDefault(x => x.id == searchModel2.id);
if (pesonel != null)
LName = pesonel.IsLegal == "حقیقی" ? pesonel.FName + " " + pesonel.LName : pesonel.LName;
}
else
{
LName = searchModel2.EmployeeName;
}
if (searchModel2.RepresentativeId > 0)
{
var representative = _representativeApplication.GetDetails(searchModel2.RepresentativeId);
RepresentativeName = representative.FullName;
}
else
{
RepresentativeName = searchModel2.RepresentativeName;
}
}
return Partial("./Create", command);
}
public IActionResult OnGetInsertLegal()
{
var command = new CreatePersonalContractingParty()
{
RepresentativeViewModels = _representativeApplication.GetRepresentatives(),
ArchiveCode = _personalContractingPartyApp.GetLastArchiveCode(),
};
return Partial("./InsertLegal", command);
}
public IActionResult OnPostCreate(CreatePersonalContractingParty command)
{
command.NationalId = !string.IsNullOrWhiteSpace(command.NationalId) ? command.NationalId.ConvertToEnglish() : "";
command.Phone = !string.IsNullOrWhiteSpace(command.Phone) ? command.Phone.ConvertToEnglish() : "";
command.AgentPhone = !string.IsNullOrWhiteSpace(command.AgentPhone) ? command.AgentPhone.ConvertToEnglish() : "";
command.Nationalcode = command.Nationalcode.ConvertToEnglish();
var result = _personalContractingPartyApp.Create(command);
return new JsonResult(result);
}
public IActionResult OnPostInsertLegal(CreatePersonalContractingParty command)
{
command.NationalId = command.NationalId.ConvertToEnglish();
command.RegisterId = command.RegisterId.ConvertToEnglish();
command.Phone = !string.IsNullOrWhiteSpace(command.Phone) ? command.Phone.ConvertToEnglish() : "";
command.AgentPhone = !string.IsNullOrWhiteSpace(command.AgentPhone) ? command.AgentPhone.ConvertToEnglish() : "";
var result2 = _personalContractingPartyApp.CreateLegals(command);
return new JsonResult(result2);
}
public IActionResult OnGetEdit(long id)
{
var productCategory = _personalContractingPartyApp.GetDetailsToEdit(id);
productCategory.HasContract = _personalContractingPartyApp.GetHasContract(id);
productCategory.RepresentativeViewModels = _representativeApplication.GetRepresentatives();
return Partial("Edit", productCategory);
}
public IActionResult OnGetLegalEdit(long id)
{
var legaly = _personalContractingPartyApp.GetDetailsToEdit(id);
legaly.HasContract = _personalContractingPartyApp.GetHasContract(id);
legaly.RepresentativeViewModels = _representativeApplication.GetRepresentatives();
return Partial("LegalEdit", legaly);
}
public JsonResult OnPostEdit(EditPersonalContractingParty command)
{
if (ModelState.IsValid)
{
}
command.Phone = !string.IsNullOrWhiteSpace(command.Phone) ? command.Phone.ConvertToEnglish() : "";
command.AgentPhone = !string.IsNullOrWhiteSpace(command.AgentPhone) ? command.AgentPhone.ConvertToEnglish() : "";
command.NationalId = !string.IsNullOrWhiteSpace(command.NationalId) ? command.NationalId.ConvertToEnglish() : "";
command.Nationalcode = command.Nationalcode.ConvertToEnglish();
var result = _personalContractingPartyApp.Edit(command);
return new JsonResult(result);
}
public JsonResult OnPostLegalEdit(EditPersonalContractingParty command)
{
if (ModelState.IsValid)
{
}
command.Phone = !string.IsNullOrWhiteSpace(command.Phone) ? command.Phone.ConvertToEnglish() : "";
command.AgentPhone = !string.IsNullOrWhiteSpace(command.AgentPhone) ? command.AgentPhone.ConvertToEnglish() : "";
command.NationalId = command.NationalId.ConvertToEnglish();
command.RegisterId = command.RegisterId.ConvertToEnglish();
var result = _personalContractingPartyApp.EditLegal(command);
return new JsonResult(result);
}
public IActionResult OnGetDetails(long id)
{
var productCategory = _personalContractingPartyApp.GetDetails(id);
return Partial("Details", productCategory);
}
public IActionResult OnGetLegalDetails(long id)
{
var legaldetails = _personalContractingPartyApp.GetDetails(id);
return Partial("LegalDetails", legaldetails);
}
public IActionResult OnGetCreate()
{
var command = new CreatePersonalContractingParty
{
RepresentativeViewModels = _representativeApplication.GetRepresentatives(),
ArchiveCode = _personalContractingPartyApp.GetLastArchiveCode()
};
#region NewByHeydari
public IActionResult OnGetRepresentativeList(string searchText)
{
var result = _representativeApplication.GetRepresentativeListForSearchText(searchText);
result = result.OrderBy(x => x.FullName.Length).ToList();
return new JsonResult(new
{
IsSuccedded = true,
mylist = result,
});
}
public IActionResult OnGetPersonalContractingPartyNationalcode(string searchText)
{
var result = _personalContractingPartyApp.GetPersonalContractingPartiesForNationalcode(searchText);
result = result.OrderBy(x => x.Nationalcode.Length).ToList();
return new JsonResult(new
{
IsSuccedded = true,
mylist = result,
});
}
[SuppressMessage("ReSharper.DPA", "DPA0007: Large number of DB records", MessageId = "count: 276")]
public IActionResult OnGetContractPartyList(string searchText)
{
var res = _personalContractingPartyApp.GetPersonalContractingParties().OrderBy(x=>x.FullName).ToList();
var result = res.Select(x => new PersonalContractingPartyViewModel()
{
id = x.id,
LName = x.LName,
FullName = x.FullName,
return Partial("./Create", command);
}
});
result = result.Where(x => x.FullName.Contains(searchText));
result = result.OrderBy(x => x.FullName.Length).ToList();
public IActionResult OnGetInsertLegal()
{
var command = new CreatePersonalContractingParty
{
RepresentativeViewModels = _representativeApplication.GetRepresentatives(),
ArchiveCode = _personalContractingPartyApp.GetLastArchiveCode()
};
return Partial("./InsertLegal", command);
}
return new JsonResult(new
{
IsSuccedded = true,
mylist = result,
});
public IActionResult OnPostCreate(CreatePersonalContractingParty command)
{
command.NationalId =
!string.IsNullOrWhiteSpace(command.NationalId) ? command.NationalId.ConvertToEnglish() : "";
command.Phone = !string.IsNullOrWhiteSpace(command.Phone) ? command.Phone.ConvertToEnglish() : "";
command.AgentPhone =
!string.IsNullOrWhiteSpace(command.AgentPhone) ? command.AgentPhone.ConvertToEnglish() : "";
command.Nationalcode = command.Nationalcode.ConvertToEnglish();
var result = _personalContractingPartyApp.Create(command);
return new JsonResult(result);
}
}
public IActionResult OnPostDeletePersonalContractingParties(long id)
{
var result = _personalContractingPartyApp.DeletePersonalContractingParties(id);
return new JsonResult(result);
}
public IActionResult OnPostActivePersonalContractingParties(long id)
{
var result = _personalContractingPartyApp.Active(id);
return new JsonResult(result);
}
public IActionResult OnPostBlockPersonalContractingParties(long id)
{
var result = _personalContractingPartyApp.Block(id);
return new JsonResult(result);
}
public IActionResult OnPostDisableBlockPersonalContractingParties(long id)
{
var result = _personalContractingPartyApp.DisableBlock(id);
return new JsonResult(result);
}
public IActionResult OnPostCheckHasContract(long id)
{
bool hasContract = _personalContractingPartyApp.GetHasContract(id);
if(hasContract)
return new JsonResult(new { isSuccedded = false, message = ""});
else
return new JsonResult(new { isSuccedded = true, message = "", });
}
#endregion
public IActionResult OnPostInsertLegal(CreatePersonalContractingParty command)
{
command.NationalId = command.NationalId.ConvertToEnglish();
command.RegisterId = command.RegisterId.ConvertToEnglish();
command.Phone = !string.IsNullOrWhiteSpace(command.Phone) ? command.Phone.ConvertToEnglish() : "";
command.AgentPhone =
!string.IsNullOrWhiteSpace(command.AgentPhone) ? command.AgentPhone.ConvertToEnglish() : "";
var result2 = _personalContractingPartyApp.CreateLegals(command);
return new JsonResult(result2);
}
public IActionResult OnGetEdit(long id)
{
var productCategory = _personalContractingPartyApp.GetDetailsToEdit(id);
productCategory.HasContract = _personalContractingPartyApp.GetHasContract(id);
productCategory.RepresentativeViewModels = _representativeApplication.GetRepresentatives();
return Partial("Edit", productCategory);
}
public IActionResult OnGetLegalEdit(long id)
{
var legaly = _personalContractingPartyApp.GetDetailsToEdit(id);
legaly.HasContract = _personalContractingPartyApp.GetHasContract(id);
legaly.RepresentativeViewModels = _representativeApplication.GetRepresentatives();
return Partial("LegalEdit", legaly);
}
public JsonResult OnPostEdit(EditPersonalContractingParty command)
{
if (ModelState.IsValid)
{
}
command.Phone = !string.IsNullOrWhiteSpace(command.Phone) ? command.Phone.ConvertToEnglish() : "";
command.AgentPhone =
!string.IsNullOrWhiteSpace(command.AgentPhone) ? command.AgentPhone.ConvertToEnglish() : "";
command.NationalId =
!string.IsNullOrWhiteSpace(command.NationalId) ? command.NationalId.ConvertToEnglish() : "";
command.Nationalcode = command.Nationalcode.ConvertToEnglish();
var result = _personalContractingPartyApp.Edit(command);
return new JsonResult(result);
}
public JsonResult OnPostLegalEdit(EditPersonalContractingParty command)
{
if (ModelState.IsValid)
{
}
command.Phone = !string.IsNullOrWhiteSpace(command.Phone) ? command.Phone.ConvertToEnglish() : "";
command.AgentPhone =
!string.IsNullOrWhiteSpace(command.AgentPhone) ? command.AgentPhone.ConvertToEnglish() : "";
command.NationalId = command.NationalId.ConvertToEnglish();
command.RegisterId = command.RegisterId.ConvertToEnglish();
var result = _personalContractingPartyApp.EditLegal(command);
return new JsonResult(result);
}
public IActionResult OnGetDetails(long id)
{
var productCategory = _personalContractingPartyApp.GetDetails(id);
return Partial("Details", productCategory);
}
public IActionResult OnGetLegalDetails(long id)
{
var legaldetails = _personalContractingPartyApp.GetDetails(id);
return Partial("LegalDetails", legaldetails);
}
#region NewByHeydari
public IActionResult OnGetRepresentativeList(string searchText)
{
var result = _representativeApplication.GetRepresentativeListForSearchText(searchText);
result = result.OrderBy(x => x.FullName.Length).ToList();
return new JsonResult(new
{
IsSuccedded = true,
mylist = result
});
}
public IActionResult OnGetPersonalContractingPartyNationalcode(string searchText)
{
var result = _personalContractingPartyApp.GetPersonalContractingPartiesForNationalcode(searchText);
result = result.OrderBy(x => x.Nationalcode.Length).ToList();
return new JsonResult(new
{
IsSuccedded = true,
mylist = result
});
}
[SuppressMessage("ReSharper.DPA", "DPA0007: Large number of DB records", MessageId = "count: 276")]
public IActionResult OnGetContractPartyList(string searchText)
{
var res = _personalContractingPartyApp.GetPersonalContractingParties().OrderBy(x => x.FullName).ToList();
var result = res.Select(x => new PersonalContractingPartyViewModel
{
id = x.id,
LName = x.LName,
FullName = x.FullName
});
result = result.Where(x => x.FullName.Contains(searchText));
result = result.OrderBy(x => x.FullName.Length).ToList();
return new JsonResult(new
{
IsSuccedded = true,
mylist = result
});
}
public IActionResult OnPostDeletePersonalContractingParties(long id)
{
var result = _personalContractingPartyApp.DeletePersonalContractingParties(id);
return new JsonResult(result);
}
public IActionResult OnPostActivePersonalContractingParties(long id)
{
var result = _personalContractingPartyApp.Active(id);
return new JsonResult(result);
}
public IActionResult OnPostBlockPersonalContractingParties(long id)
{
var result = _personalContractingPartyApp.Block(id);
return new JsonResult(result);
}
public IActionResult OnPostDisableBlockPersonalContractingParties(long id)
{
var result = _personalContractingPartyApp.DisableBlock(id);
return new JsonResult(result);
}
public IActionResult OnPostCheckHasContract(long id)
{
var hasContract = _personalContractingPartyApp.GetHasContract(id);
if (hasContract)
return new JsonResult(new { isSuccedded = false, message = "" });
return new JsonResult(new { isSuccedded = true, message = "" });
}
#endregion
}

View File

@@ -1,6 +1,6 @@
@model CompanyManagment.App.Contracts.PersonalContractingParty.CreatePersonalContractingParty
@{
<style>
<style>
#MainModal {
backdrop-filter: blur(8px);
}
@@ -175,300 +175,312 @@
}
<div id="insertLegal">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
</div>
<form asp-page="./Index" asp-page-handler="InsertLegal" autocomplete="off"
method="post"
data-ajax="true"
data-callback=""
data-action="Refresh"
enctype="multipart/form-data">
<div class="modal-body">
<div class="row">
<fieldset style="border: 1px solid #999797; border-radius: 10px; padding: revert;padding-bottom: 30px">
<legend style="margin-bottom: 5px; font-size: large; border-bottom: 0px; color: #505458; width: 245px; text-align: center;"> مشخصات طرف حساب حقوقی</legend>
<div class="flexible-wrap">
<div class="col-md-6 col-xs-6">
<div class="form-group">
<label asp-for="RepresentativeId">انتخاب معرف</label>
<select class="form-control select-city" asp-for="RepresentativeId" asp-items='new SelectList(Model.RepresentativeViewModels, "Id", "FullName")'>
</select>
<span asp-validation-for="RepresentativeId" class="error"></span>
</div>
</div>
<div class="col-md-6 col-xs-6">
<div class="form-group">
<label asp-for="SureName" class="control-label">نام مستعار</label>
<input type="text" class="form-control" asp-for="SureName">
<span asp-validation-for="SureName" class="error"></span>
</div>
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
</div>
<form asp-page="./Index" asp-page-handler="InsertLegal" autocomplete="off"
method="post"
data-ajax="true"
data-callback=""
data-action="Refresh"
enctype="multipart/form-data">
<div class="modal-body">
<div class="row">
<fieldset style="border: 1px solid #999797; border-radius: 10px; padding: revert;padding-bottom: 30px">
<legend style="margin-bottom: 5px; font-size: large; border-bottom: 0px; color: #505458; width: 245px; text-align: center;"> مشخصات طرف حساب حقوقی</legend>
<div class="flexible-wrap">
<div class="col-md-6 col-xs-6">
<div class="form-group">
<label asp-for="RepresentativeId">انتخاب معرف</label>
<select class="form-control select-city" asp-for="RepresentativeId" asp-items='new SelectList(Model.RepresentativeViewModels, "Id", "FullName")'>
</select>
<span asp-validation-for="RepresentativeId" class="error"></span>
</div>
</div>
<div class="col-md-6 col-xs-6">
<div class="form-group">
<label asp-for="SureName" class="control-label">نام مستعار</label>
<input type="text" class="form-control" asp-for="SureName">
<span asp-validation-for="SureName" class="error"></span>
</div>
</div>
<div class="col-md-12 col-xs-6">
<div class="form-group">
<label asp-for="LName" class="control-label">نام شرکت حقوقی</label>
<input type="text" class="form-control" asp-for="LName">
<span asp-validation-for="LName" class="error"></span>
@if (TempData["LgName"] != null)
{<br /><span class="error">@TempData["LgName"]</span>}
</div>
</div>
<div class="col-md-6 col-xs-6">
<div class="form-group">
<label asp-for="NationalId" class="control-label">شناسه ملی</label>
<input type="text" class="form-control" asp-for="NationalId">
<span asp-validation-for="NationalId" class="error"></span>
@if (TempData["NationalId"] != null)
{<br /><span class="error">@TempData["NationalId"]</span>}
</div>
</div>
<div class="col-md-6 col-xs-6">
<div class="form-group">
<label asp-for="RegisterId" class="control-label">شماره ثبت </label>
<input type="text" class="form-control" asp-for="RegisterId">
<span asp-validation-for="RegisterId" class="error"></span>
@if (TempData["RegId"] != null)
{<br /><span class="error">@TempData["RegId"]</span>}
</div>
</div>
<div class="col-md-4 col-xs-6">
<div class="form-group">
<label asp-for="Phone" class="control-label">شماره تلفن</label>
<input type="text" class="form-control" asp-for="Phone">
<span asp-validation-for="Phone" class="error"></span>
</div>
</div>
<div class="col-md-4 col-xs-6">
<div class="form-group">
<label asp-for="AgentPhone" class="control-label">شماره تلفن نماینده</label>
<input type="text" class="form-control" asp-for="AgentPhone">
<span asp-validation-for="AgentPhone" class="error"></span>
</div>
</div>
<div class="col-md-4 col-xs-6">
<div class="form-group">
<label asp-for="ArchiveCode" class="control-label">کد طرف حساب</label>
<input type="text" class="form-control" asp-for="ArchiveCode">
<span asp-validation-for="ArchiveCode" class="error"></span>
</div>
</div>
<div class="col-md-4 col-xs-6 col-xs-12">
<div class="form-group">
<label class="input-label">نام استان </label>
<select class="form-control select-city" asp-for="State" name="state" onChange="iranwebsv(this.value);">
<option value="">انتخاب استان</option>
<option value="تهران"> تهران </option>
<option value="گیلان"> گیلان </option>
<option value="آذربایجان شرقی"> آذربایجان شرقی</option>
<option value="خوزستان"> خوزستان </option>
<option value="فارس"> فارس</option>
<option value="اصفهان"> اصفهان</option>
<option value="خراسان رضوی">خراسان رضوی </option>
<option value="قزوین"> قزوین</option>
<option value="سمنان"> سمنان </option>
<option value="قم"> قم</option>
<option value="مرکزی"> مرکزی</option>
<option value="زنجان"> زنجان</option>
<option value="مازندران"> مازندران</option>
<option value="گلستان"> گلستان</option>
<option value="اردبیل"> اردبیل </option>
<option value="آذربایجان غربی"> آذربایجان غربی</option>
<option value="همدان"> همدان </option>
<option value="کردستان"> کردستان </option>
<option value="کرمانشاه"> کرمانشاه </option>
<option value="لرستان"> لرستان</option>
<option value="بوشهر"> بوشهر</option>
<option value="کرمان"> کرمان</option>
<option value="هرمزگان"> هرمزگان</option>
<option value="چهارمحال و بختیاری"> چهارمحال و بختیاری</option>
<option value="یزد"> یزد</option>
<option value="سیستان و بلوچستان"> سیستان و بلوچستان</option>
<option value="ایلام"> ایلام</option>
<option value="کهگلویه و بویراحمد"> کهگلویه و بویراحمد</option>
<option value="خراسان شمالی"> خراسان شمالی</option>
<option value="خراسان جنوبی"> خراسان جنوبی</option>
<option value="البرز"> البرز</option>
</select>
</div>
</div>
<div class="col-md-4 col-xs-6 col-xs-12">
<div class="form-group">
<label class="input-label">نام شهر </label>
<select class="form-control select-city" name="cityy" id="city" onchange="changeCity(this)">
<option value="" placeholder="انتخاب شهر"> </option>
</select>
<input type="hidden" value="" id="hide2" asp-for="City">
</div>
</div>
<div class="col-md-4 col-xs-6 col-xs-12">
<div class="form-group">
<label class="input-label">نام محله </label>
<div class="neighborField">
<input type="text" @*asp-for="ZoneName"*@ class="neighborInput form-control" />
<a class="addNeighbor">
<i class="fa fa-plus"></i>
</a>
</div>
</div>
</div>
<div class="col-md-12 col-xs-12">
<div class="form-group">
<label class="input-label">جزئیات نشانی </label>
<input type="text" placeholder="" class="form-control" id="Address" name="Address" value="">
</div>
</div>
</div>
<div class="modal fade" id="edit-modal" tabindex="-1" role="dialog" aria-labelledby="edit-modal-label" aria-hidden="true" style="backdrop-filter: blur(6px);background-color: #0000005c;">
<div class="modal-dialoge" role="document">
<div class="modal-content2">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" data-parent-modal="#edit-modal" aria-hidden="true" style="left: auto;right: auto;margin-top: 20px;margin-right: 20px;">
×
</button>
<div class="modal-title">افزودن نشانی جدید</div>
</div>
<div class="modal-body">
<div class="col-md-4 col-xs-6 col-xs-12">
<label class="input-label">نام استان </label>
<select class="form-control" asp-for="State" name="state" onChange="iranwebsv(this.value);">
<option value="">انتخاب استان</option>
<option value="تهران"> تهران </option>
<option value="گیلان"> گیلان </option>
<option value="آذربایجان شرقی"> آذربایجان شرقی</option>
<option value="خوزستان"> خوزستان </option>
<option value="فارس"> فارس</option>
<option value="اصفهان"> اصفهان</option>
<option value="خراسان رضوی">خراسان رضوی </option>
<option value="قزوین"> قزوین</option>
<option value="سمنان"> سمنان </option>
<option value="قم"> قم</option>
<option value="مرکزی"> مرکزی</option>
<option value="زنجان"> زنجان</option>
<option value="مازندران"> مازندران</option>
<option value="گلستان"> گلستان</option>
<option value="اردبیل"> اردبیل </option>
<option value="آذربایجان غربی"> آذربایجان غربی</option>
<option value="همدان"> همدان </option>
<option value="کردستان"> کردستان </option>
<option value="کرمانشاه"> کرمانشاه </option>
<option value="لرستان"> لرستان</option>
<option value="بوشهر"> بوشهر</option>
<option value="کرمان"> کرمان</option>
<option value="هرمزگان"> هرمزگان</option>
<option value="چهارمحال و بختیاری"> چهارمحال و بختیاری</option>
<option value="یزد"> یزد</option>
<option value="سیستان و بلوچستان"> سیستان و بلوچستان</option>
<option value="ایلام"> ایلام</option>
<option value="کهگلویه و بویراحمد"> کهگلویه و بویراحمد</option>
<option value="خراسان شمالی"> خراسان شمالی</option>
<option value="خراسان جنوبی"> خراسان جنوبی</option>
<option value="البرز"> البرز</option>
</select>
</div>
<div class="col-md-12 col-xs-6">
<div class="form-group">
<label asp-for="LName" class="control-label">نام شرکت حقوقی</label>
<input type="text" class="form-control" asp-for="LName">
<span asp-validation-for="LName" class="error"></span>
@if (TempData["LgName"] != null)
{
<br/>
<span class="error">@TempData["LgName"]</span>
}
</div>
</div>
<div class="col-md-6 col-xs-6">
<div class="form-group">
<label asp-for="NationalId" class="control-label">شناسه ملی</label>
<input type="text" class="form-control" asp-for="NationalId">
<span asp-validation-for="NationalId" class="error"></span>
@if (TempData["NationalId"] != null)
{
<br/>
<span class="error">@TempData["NationalId"]</span>
}
</div>
</div>
<div class="col-md-6 col-xs-6">
<div class="form-group">
<label asp-for="RegisterId" class="control-label">شماره ثبت </label>
<input type="text" class="form-control" asp-for="RegisterId">
<span asp-validation-for="RegisterId" class="error"></span>
@if (TempData["RegId"] != null)
{
<br/>
<span class="error">@TempData["RegId"]</span>
}
</div>
</div>
<div class="col-md-4 col-xs-6">
<div class="form-group">
<label asp-for="Phone" class="control-label">شماره تلفن</label>
<input type="text" class="form-control" asp-for="Phone">
<span asp-validation-for="Phone" class="error"></span>
</div>
</div>
<div class="col-md-4 col-xs-6">
<div class="form-group">
<label asp-for="AgentPhone" class="control-label">شماره تلفن نماینده</label>
<input type="text" class="form-control" asp-for="AgentPhone">
<span asp-validation-for="AgentPhone" class="error"></span>
</div>
</div>
<div class="col-md-4 col-xs-6">
<div class="form-group">
<label asp-for="ArchiveCode" class="control-label">کد طرف حساب</label>
<input type="text" class="form-control" asp-for="ArchiveCode">
<span asp-validation-for="ArchiveCode" class="error"></span>
</div>
</div>
<div class="col-md-4 col-xs-6 col-xs-12">
<div class="form-group">
<label class="input-label">نام استان </label>
<select class="form-control select-city" asp-for="State" name="state" onChange="iranwebsv(this.value);">
<option value="">انتخاب استان</option>
<option value="تهران"> تهران </option>
<option value="گیلان"> گیلان </option>
<option value="آذربایجان شرقی"> آذربایجان شرقی</option>
<option value="خوزستان"> خوزستان </option>
<option value="فارس"> فارس</option>
<option value="اصفهان"> اصفهان</option>
<option value="خراسان رضوی">خراسان رضوی </option>
<option value="قزوین"> قزوین</option>
<option value="سمنان"> سمنان </option>
<option value="قم"> قم</option>
<option value="مرکزی"> مرکزی</option>
<option value="زنجان"> زنجان</option>
<option value="مازندران"> مازندران</option>
<option value="گلستان"> گلستان</option>
<option value="اردبیل"> اردبیل </option>
<option value="آذربایجان غربی"> آذربایجان غربی</option>
<option value="همدان"> همدان </option>
<option value="کردستان"> کردستان </option>
<option value="کرمانشاه"> کرمانشاه </option>
<option value="لرستان"> لرستان</option>
<option value="بوشهر"> بوشهر</option>
<option value="کرمان"> کرمان</option>
<option value="هرمزگان"> هرمزگان</option>
<option value="چهارمحال و بختیاری"> چهارمحال و بختیاری</option>
<option value="یزد"> یزد</option>
<option value="سیستان و بلوچستان"> سیستان و بلوچستان</option>
<option value="ایلام"> ایلام</option>
<option value="کهگلویه و بویراحمد"> کهگلویه و بویراحمد</option>
<option value="خراسان شمالی"> خراسان شمالی</option>
<option value="خراسان جنوبی"> خراسان جنوبی</option>
<option value="البرز"> البرز</option>
</select>
</div>
</div>
<div class="col-md-4 col-xs-6 col-xs-12">
<div class="form-group">
<label class="input-label">نام شهر </label>
<select class="form-control select-city" name="cityy" id="city" onchange="changeCity(this)">
<option value="" placeholder="انتخاب شهر"> </option>
</select>
<input type="hidden" value="" id="hide2" asp-for="City">
</div>
</div>
<div class="col-md-4 col-xs-6 col-xs-12">
<div class="form-group">
<label class="input-label">نام محله </label>
<div class="neighborField">
<input type="text" @*asp-for="ZoneName"*@ class="neighborInput form-control"/>
<a class="addNeighbor">
<i class="fa fa-plus"></i>
</a>
</div>
</div>
</div>
<div class="col-md-12 col-xs-12">
<div class="form-group">
<label class="input-label">جزئیات نشانی </label>
<input type="text" placeholder="" class="form-control" id="Address" name="Address" value="">
</div>
</div>
</div>
<div class="modal fade" id="edit-modal" tabindex="-1" role="dialog" aria-labelledby="edit-modal-label" aria-hidden="true" style="backdrop-filter: blur(6px);background-color: #0000005c;">
<div class="modal-dialoge" role="document">
<div class="modal-content2">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" data-parent-modal="#edit-modal" aria-hidden="true" style="left: auto;right: auto;margin-top: 20px;margin-right: 20px;">
×
</button>
<div class="modal-title">افزودن نشانی جدید</div>
</div>
<div class="modal-body">
<div class="col-md-4 col-xs-6 col-xs-12">
<label class="input-label">نام استان </label>
<select class="form-control" asp-for="State" name="state" onChange="iranwebsv(this.value);">
<option value="">انتخاب استان</option>
<option value="تهران"> تهران </option>
<option value="گیلان"> گیلان </option>
<option value="آذربایجان شرقی"> آذربایجان شرقی</option>
<option value="خوزستان"> خوزستان </option>
<option value="فارس"> فارس</option>
<option value="اصفهان"> اصفهان</option>
<option value="خراسان رضوی">خراسان رضوی </option>
<option value="قزوین"> قزوین</option>
<option value="سمنان"> سمنان </option>
<option value="قم"> قم</option>
<option value="مرکزی"> مرکزی</option>
<option value="زنجان"> زنجان</option>
<option value="مازندران"> مازندران</option>
<option value="گلستان"> گلستان</option>
<option value="اردبیل"> اردبیل </option>
<option value="آذربایجان غربی"> آذربایجان غربی</option>
<option value="همدان"> همدان </option>
<option value="کردستان"> کردستان </option>
<option value="کرمانشاه"> کرمانشاه </option>
<option value="لرستان"> لرستان</option>
<option value="بوشهر"> بوشهر</option>
<option value="کرمان"> کرمان</option>
<option value="هرمزگان"> هرمزگان</option>
<option value="چهارمحال و بختیاری"> چهارمحال و بختیاری</option>
<option value="یزد"> یزد</option>
<option value="سیستان و بلوچستان"> سیستان و بلوچستان</option>
<option value="ایلام"> ایلام</option>
<option value="کهگلویه و بویراحمد"> کهگلویه و بویراحمد</option>
<option value="خراسان شمالی"> خراسان شمالی</option>
<option value="خراسان جنوبی"> خراسان جنوبی</option>
<option value="البرز"> البرز</option>
</select>
</div>
<div class="col-md-4 col-xs-6 col-xs-12">
<label class="input-label">نام شهر </label>
<select class="form-control" name="cityy" id="modalCity">
<option value="" placeholder="انتخاب شهر"> </option>
</select>
@* <input type="hidden" value="" id="hide3" asp-for="City"> *@
</div>
<div class="col-md-4 col-xs-6 col-xs-12">
<label>نام محله </label>
<input type="text" class="form-control" />
</div>
<div class="col-md-4 col-xs-6 col-xs-12">
<label class="input-label">نام شهر </label>
<select class="form-control" name="cityy" id="modalCity">
<option value="" placeholder="انتخاب شهر"> </option>
</select>
@* <input type="hidden" value="" id="hide3" asp-for="City"> *@
</div>
<div class="col-md-4 col-xs-6 col-xs-12">
<label>نام محله </label>
<input type="text" class="form-control"/>
</div>
<div class="col-md-12 col-xs-12" style="margin-top: 10px;padding: 0;">
<div class="panel panel-default" id="city-table">
<div class="panel-heading">
<h3 class="panel-title"><i class="fa fa-list" style="padding-left: 3px; font-size: 14px"></i> لیست عناوین </h3>
</div>
<div class="panel-body">
<div>
<div>
<table id="datatable" class="table table-striped table-bordered">
<thead>
<tr>
<th style="font-size: 12px !important;text-align: center">#</th>
<th style="font-size: 12px !important; text-align: center">نام استان</th>
<th style="font-size: 12px !important; text-align: center">نام شهر </th>
<th style="font-size: 12px !important; text-align: center">نام محله </th>
<th style="font-size: 12px !important; width: 20%; text-align: center">عملیات</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="modal2-btns">
<button type="button" class="btn modal2-btn" data-dismiss="modal" id="closing" data-parent-modal="#edit-modal">انصراف</button>
<button type="button" onclick="sendData()" class="btn modal2-btn" id="edit">ذخیره </button>
</div>
</div>
<div class="col-md-12 col-xs-12" style="margin-top: 10px;padding: 0;">
<div class="panel panel-default" id="city-table">
<div class="panel-heading">
<h3 class="panel-title"><i class="fa fa-list" style="padding-left: 3px; font-size: 14px"></i> لیست عناوین </h3>
</div>
<div class="panel-body">
<div>
<div>
<table id="datatable" class="table table-striped table-bordered">
<thead>
<tr>
<th style="font-size: 12px !important;text-align: center">#</th>
<th style="font-size: 12px !important; text-align: center">نام استان</th>
<th style="font-size: 12px !important; text-align: center">نام شهر </th>
<th style="font-size: 12px !important; text-align: center">نام محله </th>
<th style="font-size: 12px !important; width: 20%; text-align: center">عملیات</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="modal2-btns">
<button type="button" class="btn modal2-btn" data-dismiss="modal" id="closing" data-parent-modal="#edit-modal">انصراف</button>
<button type="button" onclick="sendData()" class="btn modal2-btn" id="edit">ذخیره </button>
</div>
</div>
</div>
</div>
</fieldset>
</div>
</div>
</div>
</div>
</fieldset>
</div>
</div>
@*input type="hidden" asp-for="id" value="id"/>*@
</div>
@*input type="hidden" asp-for="id" value="id"/>*@
<div class="modal-footer">
@*<button type="button" class="btn btn-default waves-effect" data-dismiss="modal">بستن</button>*@
<button type="submit" class="btn btn-success btn-rounded waves-effect waves-light" id="save"> ذخیره </button>
<button type="button" class="btn btn-default btn-rounded waves-effect waves-light m-b-5" data-dismiss="modal">بستن </button>
</div>
</form>
<div class="modal-footer">
@*<button type="button" class="btn btn-default waves-effect" data-dismiss="modal">بستن</button>*@
<button type="submit" class="btn btn-success btn-rounded waves-effect waves-light" id="save"> ذخیره </button>
<button type="button" class="btn btn-default btn-rounded waves-effect waves-light m-b-5" data-dismiss="modal">بستن </button>
</div>
</form>
</div>
<script language="javascript" src="~/AdminTheme/js/city.js"></script>
<script>
$(document).ready(function () {
$(".select-city").select2({
language: "fa",
dir: "rtl"
});
});
$("#edit-modal").on('hidden.bs.modal', function () {
$('body').addClass('modal-open');
});
$(document).ready(function() {
$(".select-city").select2({
language: "fa",
dir: "rtl"
});
});
$("#edit-modal").on('hidden.bs.modal',
function() {
$('body').addClass('modal-open');
});
$(function () {
$('#edit-modal [data-parent-modal]').on('click', function (e) {
e.preventDefault();
e.stopPropagation();
var parentModalId = $(this).data('parent-modal');
$(parentModalId).modal('hide');
});
});
$(function () {
$('.addNeighbor').on('click', function (e) {
e.preventDefault();
$('#edit-modal').modal('show');
});
});
$(function() {
$('#edit-modal [data-parent-modal]').on('click',
function(e) {
e.preventDefault();
e.stopPropagation();
const parentModalId = $(this).data('parent-modal');
$(parentModalId).modal('hide');
});
});
$(function() {
$('.addNeighbor').on('click',
function(e) {
e.preventDefault();
$('#edit-modal').modal('show');
});
});
var selectCity = $('#city.select-city');
var selectedCityOption = selectCity.find('option:selected');
$('#hide2').val(selectedCityOption.text());
var selectCity = $('#city.select-city');
var selectedCityOption = selectCity.find('option:selected');
$('#hide2').val(selectedCityOption.text());
var selectCity2 = $('#modalCity.select-city');
var selectedCityOption2 = selectCity.find('option:selected');
console.log(selectedCityOption2.text());
$('#hide3').val(selectedCityOption2.text());
var selectCity2 = $('#modalCity.select-city');
var selectedCityOption2 = selectCity.find('option:selected');
console.log(selectedCityOption2.text());
$('#hide3').val(selectedCityOption2.text());
function changeCity(element) {
$('#hide2').val($(element).find('option:selected').text());
}
function changeCity(element) {
$('#hide2').val($(element).find('option:selected').text());
}
</script>

View File

@@ -1,6 +1,6 @@
@model CompanyManagment.App.Contracts.PersonalContractingParty.EditPersonalContractingParty
@{
<style>
<style>
.modal-header .close {
margin-top: 10px;
margin-right: -15px;
@@ -110,92 +110,87 @@
</style>
}
<div id="legalDetails">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
</div>
<form asp-page="./Index" asp-page-handler="LegalDetails"
method="post"
data-ajax="true"
data-callback=""
data-action="Refresh"
enctype="multipart/form-data">
<div class="modal-body">
<div class="row">
<fieldset style="border: 1px solid #999797; border-radius: 10px; padding: revert;">
<legend style="margin-bottom: 5px; font-size: large; border-bottom: 0px; color: #505458; width: 240px; text-align: center;"> اطلاعات طرف حساب حقوقی</legend>
</div>
<form asp-page="./Index" asp-page-handler="LegalDetails"
method="post"
data-ajax="true"
data-callback=""
data-action="Refresh"
enctype="multipart/form-data">
<div class="modal-body">
<div class="row">
<fieldset style="border: 1px solid #999797; border-radius: 10px; padding: revert;">
<legend style="margin-bottom: 5px; font-size: large; border-bottom: 0px; color: #505458; width: 240px; text-align: center;"> اطلاعات طرف حساب حقوقی</legend>
<table id="thh" style="height: 150px;width: 100%">
<tr>
<th>فیلد</th>
<th>اطلاعات</th>
<table id="thh" style="height: 150px;width: 100%">
<tr>
<th>فیلد</th>
<th>اطلاعات</th>
</tr>
</tr>
<tr>
<td> نام شرکت حقوقی </td>
<td> @Model.LName</td>
<tr>
<td> نام شرکت حقوقی </td>
<td> @Model.LName</td>
</tr>
</tr>
<tr>
<td> شماره ثبت </td>
<td> @Model.RegisterId </td>
<tr>
<td> شماره ثبت </td>
<td> @Model.RegisterId </td>
</tr>
</tr>
<tr>
<td> شناسه ملی </td>
<td> @Model.NationalId </td>
<tr>
<td> شناسه ملی </td>
<td> @Model.NationalId </td>
</tr>
</tr>
<tr>
<td> شماره تلفن </td>
<td> @Model.Phone</td>
<tr>
<td> شماره تلفن </td>
<td> @Model.Phone</td>
</tr>
</tr>
<tr>
<td> شماره تلفن نماینده</td>
<td> @Model.AgentPhone </td>
<tr>
<td> شماره تلفن نماینده</td>
<td> @Model.AgentPhone </td>
</tr>
</tr>
<tr>
<td> آدرس </td>
<td> @Model.Address </td>
<tr>
<td> آدرس </td>
<td> @Model.Address </td>
</tr>
</tr>
<tr>
<td> معرف </td>
<td> @Model.RepresentativeFullName </td>
<tr>
<td> معرف </td>
<td> @Model.RepresentativeFullName </td>
</tr>
</tr>
</table>
</fieldset>
</div>
</table>
</div>
<input type="hidden" asp-for="Id" value="@Model.Id"/>
<div class="modal-footer">
</fieldset>
</div>
</div>
<input type="hidden" asp-for="Id" value="@Model.Id" />
<div class="modal-footer">
<button type="button" class="btn btn-warning btn-rounded waves-effect waves-light m-b-5" data-dismiss="modal">بستن فرم</button>
</div>
</form>
<button type="button" class="btn btn-warning btn-rounded waves-effect waves-light m-b-5" data-dismiss="modal">بستن فرم</button>
</div>
</form>
</div>

View File

@@ -1,6 +1,6 @@
@model CompanyManagment.App.Contracts.PersonalContractingParty.EditPersonalContractingParty
@{
<style>
<style>
#MainModal {
backdrop-filter: blur(8px);
}
@@ -181,317 +181,339 @@
</style>
}
<div id="legalEdit">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
</div>
<form asp-page="./Index" asp-page-handler="LegalEdit" autocomplete="off"
method="post"
data-ajax="true"
data-callback=""
data-action="Refresh"
enctype="multipart/form-data">
<div class="modal-body">
<div class="row">
<fieldset style="border: 1px solid #999797; border-radius: 10px; padding: revert;padding-bottom: 30px">
<legend style="margin-bottom: 5px; font-size: large; border-bottom: 0px; color: #505458; width: 245px; text-align: center;"> ویرایش طرف حساب حقوقی</legend>
<div class="flexible-wrap">
<div class="col-md-6 col-xs-6">
<div class="form-group">
<label asp-for="RepresentativeId">انتخاب معرف</label>
<select class="form-control select-city" asp-for="RepresentativeId" asp-items='new SelectList(Model.RepresentativeViewModels, "Id", "FullName")'>
</select>
<span asp-validation-for="RepresentativeId" class="error"></span>
</div>
</div>
<div class="col-md-6 col-xs-6">
<div class="form-group">
<label asp-for="SureName" class="control-label">نام مستعار</label>
<input type="text" class="form-control" asp-for="SureName">
<span asp-validation-for="SureName" class="error"></span>
</div>
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
</div>
<form asp-page="./Index" asp-page-handler="LegalEdit" autocomplete="off"
method="post"
data-ajax="true"
data-callback=""
data-action="Refresh"
enctype="multipart/form-data">
<div class="modal-body">
<div class="row">
<fieldset style="border: 1px solid #999797; border-radius: 10px; padding: revert;padding-bottom: 30px">
<legend style="margin-bottom: 5px; font-size: large; border-bottom: 0px; color: #505458; width: 245px; text-align: center;"> ویرایش طرف حساب حقوقی</legend>
<div class="flexible-wrap">
<div class="col-md-6 col-xs-6">
<div class="form-group">
<label asp-for="RepresentativeId">انتخاب معرف</label>
<select class="form-control select-city" asp-for="RepresentativeId" asp-items='new SelectList(Model.RepresentativeViewModels, "Id", "FullName")'>
</select>
<span asp-validation-for="RepresentativeId" class="error"></span>
</div>
</div>
<div class="col-md-6 col-xs-6">
<div class="form-group">
<label asp-for="SureName" class="control-label">نام مستعار</label>
<input type="text" class="form-control" asp-for="SureName">
<span asp-validation-for="SureName" class="error"></span>
</div>
</div>
<div class="col-md-12 col-xs-6">
<div class="form-group">
<label asp-for="LName" class="control-label">نام شرکت حقوقی</label>
<input type="text" class="form-control" asp-for="LName">
<span asp-validation-for="LName" class="error"></span>
@if (TempData["name"] != null)
{<br /><span class="error">@TempData["name"]</span>}
</div>
<div class="col-md-12 col-xs-6">
<div class="form-group">
<label asp-for="LName" class="control-label">نام شرکت حقوقی</label>
<input type="text" class="form-control" asp-for="LName">
<span asp-validation-for="LName" class="error"></span>
@if (TempData["name"] != null)
{
<br/>
<span class="error">@TempData["name"]</span>
}
</div>
</div>
<div class="col-md-6 col-xs-6">
<div class="form-group">
<label asp-for="NationalId" class="control-label">شناسه ملی </label>
@if (Model.HasContract)
{
<input type="text" class="form-control" asp-for="NationalId" readonly>
}
else
{
<input type="text" class="form-control" asp-for="NationalId">
}
<span asp-validation-for="NationalId" class="error"></span>
</div>
</div>
<div class="col-md-6 col-xs-6">
<div class="form-group">
<label asp-for="NationalId" class="control-label">شناسه ملی </label>
@if (TempData["IdR"] != null)
{<br /><span class="error">@TempData["IdR"]</span>}
</div>
</div>
<div class="col-md-6 col-xs-6">
<div class="form-group">
<label asp-for="RegisterId" class="control-label">شمارره ثبت </label>
<input type="text" class="form-control" asp-for="RegisterId">
<span asp-validation-for="RegisterId" class="error"></span>
@if (TempData["err"] != null)
{<br /><span class="error">@TempData["err"]</span>}
@if (TempData["notok"] != null)
{<br /><span class="error">@TempData["notok"]</span>}
@if (TempData["notvalid"] != null)
{<br /><span class="error">@TempData["notvalid"]</span>}
@if (TempData["NationalCode"] != null)
{<br /><span class="error">@TempData["NationalCode"]</span>}
</div>
</div>
<div class="col-md-4 col-xs-6">
<div class="form-group">
<label asp-for="Phone" class="control-label">شماره تلفن</label>
<input type="text" class="form-control" asp-for="Phone">
<span asp-validation-for="Phone" class="error"></span>
</div>
</div>
<div class="col-md-4 col-xs-6">
<div class="form-group">
<label asp-for="AgentPhone" class="control-label">شماره تلفن نماینده</label>
<input type="text" class="form-control" asp-for="AgentPhone">
<span asp-validation-for="AgentPhone" class="error"></span>
</div>
</div>
<div class="col-md-4 col-xs-6">
<div class="form-group">
<label asp-for="ArchiveCode" class="control-label">کد طرف حساب</label>
<input type="text" class="form-control" asp-for="ArchiveCode">
<span asp-validation-for="ArchiveCode" class="error"></span>
</div>
</div>
<div class="col-md-4 col-xs-6 col-xs-12">
<div class="form-group">
<label class="input-label">نام استان </label>
<select class="form-control select-city" asp-for="State" name="state" onChange="iranwebsv(this.value);">
<option value="">انتخاب استان</option>
<option value="تهران"> تهران </option>
<option value="گیلان"> گیلان </option>
<option value="آذربایجان شرقی"> آذربایجان شرقی</option>
<option value="خوزستان"> خوزستان </option>
<option value="فارس"> فارس</option>
<option value="اصفهان"> اصفهان</option>
<option value="خراسان رضوی">خراسان رضوی </option>
<option value="قزوین"> قزوین</option>
<option value="سمنان"> سمنان </option>
<option value="قم"> قم</option>
<option value="مرکزی"> مرکزی</option>
<option value="زنجان"> زنجان</option>
<option value="مازندران"> مازندران</option>
<option value="گلستان"> گلستان</option>
<option value="اردبیل"> اردبیل </option>
<option value="آذربایجان غربی"> آذربایجان غربی</option>
<option value="همدان"> همدان </option>
<option value="کردستان"> کردستان </option>
<option value="کرمانشاه"> کرمانشاه </option>
<option value="لرستان"> لرستان</option>
<option value="بوشهر"> بوشهر</option>
<option value="کرمان"> کرمان</option>
<option value="هرمزگان"> هرمزگان</option>
<option value="چهارمحال و بختیاری"> چهارمحال و بختیاری</option>
<option value="یزد"> یزد</option>
<option value="سیستان و بلوچستان"> سیستان و بلوچستان</option>
<option value="ایلام"> ایلام</option>
<option value="کهگلویه و بویراحمد"> کهگلویه و بویراحمد</option>
<option value="خراسان شمالی"> خراسان شمالی</option>
<option value="خراسان جنوبی"> خراسان جنوبی</option>
<option value="البرز"> البرز</option>
</select>
</div>
</div>
<div class="col-md-4 col-xs-6 col-xs-12">
<div class="form-group">
<label class="input-label">نام شهر </label>
<select class="form-control select-city" name="cityy" id="city" onchange="changeCity(this)">
<option value="" placeholder="انتخاب شهر"> </option>
</select>
<input type="hidden" value="" id="hide2" asp-for="City">
<input type="hidden" value="@Model.City" id="hide3">
</div>
</div>
<div class="col-md-4 col-xs-6 col-xs-12">
<div class="form-group">
<label class="input-label">نام محله </label>
<div class="neighborField">
<input type="text" @*asp-for="ZoneName"*@ class="neighborInput form-control" />
<a class="addNeighbor">
<i class="fa fa-plus"></i>
</a>
</div>
</div>
</div>
<div class="col-md-12 col-xs-12">
<div class="form-group">
<label class="input-label">جزئیات نشانی </label>
<input type="text" placeholder="" class="form-control" id="Address" name="Address" value="">
</div>
</div>
</div>
<div class="modal fade" id="edit-modal" tabindex="-1" role="dialog" aria-labelledby="edit-modal-label" aria-hidden="true" style="backdrop-filter: blur(6px);background-color: #0000005c;">
<div class="modal-dialoge" role="document">
<div class="modal-content2">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" data-parent-modal="#edit-modal" aria-hidden="true" style="left: auto;right: auto;margin-top: 20px;margin-right: 20px;">
×
</button>
<div class="modal-title">افزودن نشانی جدید</div>
</div>
<div class="modal-body">
<div class="col-md-4 col-xs-6 col-xs-12">
<label class="input-label">نام استان </label>
<select class="form-control select-city" @*asp-for="State"*@ name="state" onChange="iranwebsv(this.value);">
<option value="">انتخاب استان</option>
<option value="تهران"> تهران </option>
<option value="گیلان"> گیلان </option>
<option value="آذربایجان شرقی"> آذربایجان شرقی</option>
<option value="خوزستان"> خوزستان </option>
<option value="فارس"> فارس</option>
<option value="اصفهان"> اصفهان</option>
<option value="خراسان رضوی">خراسان رضوی </option>
<option value="قزوین"> قزوین</option>
<option value="سمنان"> سمنان </option>
<option value="قم"> قم</option>
<option value="مرکزی"> مرکزی</option>
<option value="زنجان"> زنجان</option>
<option value="مازندران"> مازندران</option>
<option value="گلستان"> گلستان</option>
<option value="اردبیل"> اردبیل </option>
<option value="آذربایجان غربی"> آذربایجان غربی</option>
<option value="همدان"> همدان </option>
<option value="کردستان"> کردستان </option>
<option value="کرمانشاه"> کرمانشاه </option>
<option value="لرستان"> لرستان</option>
<option value="بوشهر"> بوشهر</option>
<option value="کرمان"> کرمان</option>
<option value="هرمزگان"> هرمزگان</option>
<option value="چهارمحال و بختیاری"> چهارمحال و بختیاری</option>
<option value="یزد"> یزد</option>
<option value="سیستان و بلوچستان"> سیستان و بلوچستان</option>
<option value="ایلام"> ایلام</option>
<option value="کهگلویه و بویراحمد"> کهگلویه و بویراحمد</option>
<option value="خراسان شمالی"> خراسان شمالی</option>
<option value="خراسان جنوبی"> خراسان جنوبی</option>
<option value="البرز"> البرز</option>
</select>
</div>
<div class="col-md-4 col-xs-6 col-xs-12">
<label class="input-label">نام شهر </label>
<select class="form-control select-city" name="cityy" id="modalCity">
<option value="" placeholder="انتخاب شهر"> </option>
</select>
@*<input type="hidden" value="" id="hide3" asp-for="City">*@
</div>
<div class="col-md-4 col-xs-6 col-xs-12">
<label>نام محله </label>
<input type="text" class="form-control" />
@if (Model.HasContract)
{
<input type="text" class="form-control" asp-for="NationalId" readonly>
}
else
{
<input type="text" class="form-control" asp-for="NationalId">
}
<span asp-validation-for="NationalId" class="error"></span>
</div>
<div class="col-md-12 col-xs-12" style="margin-top: 10px;padding: 0;">
<div class="panel panel-default" id="city-table">
<div class="panel-heading">
<h3 class="panel-title"><i class="fa fa-list" style="padding-left: 3px; font-size: 14px"></i> لیست عناوین </h3>
</div>
<div class="panel-body">
<div>
<div>
<table id="datatable" class="table table-striped table-bordered">
<thead>
<tr>
<th style="font-size: 12px !important;text-align: center">#</th>
<th style="font-size: 12px !important; text-align: center">نام استان</th>
<th style="font-size: 12px !important; text-align: center">نام شهر </th>
<th style="font-size: 12px !important; text-align: center">نام محله </th>
<th style="font-size: 12px !important; width: 20%; text-align: center">عملیات</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="modal2-btns">
<button type="button" class="btn modal2-btn" data-dismiss="modal" id="closing" data-parent-modal="#edit-modal">انصراف</button>
<button type="button" onclick="sendData()" class="btn modal2-btn" id="edit">ذخیره </button>
</div>
@if (TempData["IdR"] != null)
{
<br/>
<span class="error">@TempData["IdR"]</span>
}
</div>
</div>
<div class="col-md-6 col-xs-6">
<div class="form-group">
<label asp-for="RegisterId" class="control-label">شمارره ثبت </label>
<input type="text" class="form-control" asp-for="RegisterId">
<span asp-validation-for="RegisterId" class="error"></span>
@if (TempData["err"] != null)
{
<br/>
<span class="error">@TempData["err"]</span>
}
@if (TempData["notok"] != null)
{
<br/>
<span class="error">@TempData["notok"]</span>
}
@if (TempData["notvalid"] != null)
{
<br/>
<span class="error">@TempData["notvalid"]</span>
}
@if (TempData["NationalCode"] != null)
{
<br/>
<span class="error">@TempData["NationalCode"]</span>
}
</div>
</div>
<div class="col-md-4 col-xs-6">
<div class="form-group">
<label asp-for="Phone" class="control-label">شماره تلفن</label>
<input type="text" class="form-control" asp-for="Phone">
<span asp-validation-for="Phone" class="error"></span>
</div>
</div>
<div class="col-md-4 col-xs-6">
<div class="form-group">
<label asp-for="AgentPhone" class="control-label">شماره تلفن نماینده</label>
<input type="text" class="form-control" asp-for="AgentPhone">
<span asp-validation-for="AgentPhone" class="error"></span>
</div>
</div>
<div class="col-md-4 col-xs-6">
<div class="form-group">
<label asp-for="ArchiveCode" class="control-label">کد طرف حساب</label>
<input type="text" class="form-control" asp-for="ArchiveCode">
<span asp-validation-for="ArchiveCode" class="error"></span>
</div>
</div>
<div class="col-md-4 col-xs-6 col-xs-12">
<div class="form-group">
<label class="input-label">نام استان </label>
<select class="form-control select-city" asp-for="State" name="state" onChange="iranwebsv(this.value);">
<option value="">انتخاب استان</option>
<option value="تهران"> تهران </option>
<option value="گیلان"> گیلان </option>
<option value="آذربایجان شرقی"> آذربایجان شرقی</option>
<option value="خوزستان"> خوزستان </option>
<option value="فارس"> فارس</option>
<option value="اصفهان"> اصفهان</option>
<option value="خراسان رضوی">خراسان رضوی </option>
<option value="قزوین"> قزوین</option>
<option value="سمنان"> سمنان </option>
<option value="قم"> قم</option>
<option value="مرکزی"> مرکزی</option>
<option value="زنجان"> زنجان</option>
<option value="مازندران"> مازندران</option>
<option value="گلستان"> گلستان</option>
<option value="اردبیل"> اردبیل </option>
<option value="آذربایجان غربی"> آذربایجان غربی</option>
<option value="همدان"> همدان </option>
<option value="کردستان"> کردستان </option>
<option value="کرمانشاه"> کرمانشاه </option>
<option value="لرستان"> لرستان</option>
<option value="بوشهر"> بوشهر</option>
<option value="کرمان"> کرمان</option>
<option value="هرمزگان"> هرمزگان</option>
<option value="چهارمحال و بختیاری"> چهارمحال و بختیاری</option>
<option value="یزد"> یزد</option>
<option value="سیستان و بلوچستان"> سیستان و بلوچستان</option>
<option value="ایلام"> ایلام</option>
<option value="کهگلویه و بویراحمد"> کهگلویه و بویراحمد</option>
<option value="خراسان شمالی"> خراسان شمالی</option>
<option value="خراسان جنوبی"> خراسان جنوبی</option>
<option value="البرز"> البرز</option>
</select>
</div>
</div>
<div class="col-md-4 col-xs-6 col-xs-12">
<div class="form-group">
<label class="input-label">نام شهر </label>
<select class="form-control select-city" name="cityy" id="city" onchange="changeCity(this)">
<option value="" placeholder="انتخاب شهر"> </option>
</select>
<input type="hidden" value="" id="hide2" asp-for="City">
<input type="hidden" value="@Model.City" id="hide3">
</div>
</div>
<div class="col-md-4 col-xs-6 col-xs-12">
<div class="form-group">
<label class="input-label">نام محله </label>
<div class="neighborField">
<input type="text" @*asp-for="ZoneName"*@ class="neighborInput form-control"/>
<a class="addNeighbor">
<i class="fa fa-plus"></i>
</a>
</div>
</div>
</div>
<div class="col-md-12 col-xs-12">
<div class="form-group">
<label class="input-label">جزئیات نشانی </label>
<input type="text" placeholder="" class="form-control" id="Address" name="Address" value="">
</div>
</div>
</div>
<div class="modal fade" id="edit-modal" tabindex="-1" role="dialog" aria-labelledby="edit-modal-label" aria-hidden="true" style="backdrop-filter: blur(6px);background-color: #0000005c;">
<div class="modal-dialoge" role="document">
<div class="modal-content2">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" data-parent-modal="#edit-modal" aria-hidden="true" style="left: auto;right: auto;margin-top: 20px;margin-right: 20px;">
×
</button>
<div class="modal-title">افزودن نشانی جدید</div>
</div>
<div class="modal-body">
<div class="col-md-4 col-xs-6 col-xs-12">
<label class="input-label">نام استان </label>
<select class="form-control select-city" @*asp-for="State"*@ name="state" onChange="iranwebsv(this.value);">
<option value="">انتخاب استان</option>
<option value="تهران"> تهران </option>
<option value="گیلان"> گیلان </option>
<option value="آذربایجان شرقی"> آذربایجان شرقی</option>
<option value="خوزستان"> خوزستان </option>
<option value="فارس"> فارس</option>
<option value="اصفهان"> اصفهان</option>
<option value="خراسان رضوی">خراسان رضوی </option>
<option value="قزوین"> قزوین</option>
<option value="سمنان"> سمنان </option>
<option value="قم"> قم</option>
<option value="مرکزی"> مرکزی</option>
<option value="زنجان"> زنجان</option>
<option value="مازندران"> مازندران</option>
<option value="گلستان"> گلستان</option>
<option value="اردبیل"> اردبیل </option>
<option value="آذربایجان غربی"> آذربایجان غربی</option>
<option value="همدان"> همدان </option>
<option value="کردستان"> کردستان </option>
<option value="کرمانشاه"> کرمانشاه </option>
<option value="لرستان"> لرستان</option>
<option value="بوشهر"> بوشهر</option>
<option value="کرمان"> کرمان</option>
<option value="هرمزگان"> هرمزگان</option>
<option value="چهارمحال و بختیاری"> چهارمحال و بختیاری</option>
<option value="یزد"> یزد</option>
<option value="سیستان و بلوچستان"> سیستان و بلوچستان</option>
<option value="ایلام"> ایلام</option>
<option value="کهگلویه و بویراحمد"> کهگلویه و بویراحمد</option>
<option value="خراسان شمالی"> خراسان شمالی</option>
<option value="خراسان جنوبی"> خراسان جنوبی</option>
<option value="البرز"> البرز</option>
</select>
</div>
<div class="col-md-4 col-xs-6 col-xs-12">
<label class="input-label">نام شهر </label>
<select class="form-control select-city" name="cityy" id="modalCity">
<option value="" placeholder="انتخاب شهر"> </option>
</select>
@*<input type="hidden" value="" id="hide3" asp-for="City">*@
</div>
<div class="col-md-4 col-xs-6 col-xs-12">
<label>نام محله </label>
<input type="text" class="form-control"/>
</div>
</div>
</div>
</fieldset>
</div>
</div>
<div class="col-md-12 col-xs-12" style="margin-top: 10px;padding: 0;">
<div class="panel panel-default" id="city-table">
<div class="panel-heading">
<h3 class="panel-title"><i class="fa fa-list" style="padding-left: 3px; font-size: 14px"></i> لیست عناوین </h3>
</div>
<div class="panel-body">
<div>
<div>
<table id="datatable" class="table table-striped table-bordered">
<thead>
<tr>
<th style="font-size: 12px !important;text-align: center">#</th>
<th style="font-size: 12px !important; text-align: center">نام استان</th>
<th style="font-size: 12px !important; text-align: center">نام شهر </th>
<th style="font-size: 12px !important; text-align: center">نام محله </th>
<th style="font-size: 12px !important; width: 20%; text-align: center">عملیات</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="modal2-btns">
<button type="button" class="btn modal2-btn" data-dismiss="modal" id="closing" data-parent-modal="#edit-modal">انصراف</button>
<button type="button" onclick="sendData()" class="btn modal2-btn" id="edit">ذخیره </button>
</div>
</div>
<input type="hidden" asp-for="Id" value="@Model.Id" />
</div>
</div>
</div>
</fieldset>
</div>
<div class="modal-footer">
<button type="submit" class="btn btn-success btn-rounded waves-effect waves-light" id="save"> ویرایش </button>
<button type="button" class="btn btn-default btn-rounded waves-effect waves-light m-b-5" data-dismiss="modal">بستن </button>
</div>
</form>
</div>
<input type="hidden" asp-for="Id" value="@Model.Id"/>
<div class="modal-footer">
<button type="submit" class="btn btn-success btn-rounded waves-effect waves-light" id="save"> ویرایش </button>
<button type="button" class="btn btn-default btn-rounded waves-effect waves-light m-b-5" data-dismiss="modal">بستن </button>
</div>
</form>
</div>
<script language="javascript" src="~/AdminTheme/js/city.js"></script>
<script>
$(document).ready(function () {
let state = $('#State').val();
let city = $('#hide3').val();
iranwebsv(state);
console.log(city);
$("#city option").each(function () {
if ($(this).text() == city) {
$(this).attr('selected', 'selected');
}
});
});
function changeCity(element) {
$('#hide2').val($(element).find('option:selected').text());
}
//var selectCity = $('#city.select-city');
//var selectedCityOption = selectCity.find('option:selected');
//$('#hide2').val(selectedCityOption.text());
$(document).ready(function() {
const state = $('#State').val();
const city = $('#hide3').val();
iranwebsv(state);
console.log(city);
$("#city option").each(function() {
if ($(this).text() == city) {
$(this).attr('selected', 'selected');
}
});
});
//var selectCity2 = $('#modalCity.select-city');
//var selectedCityOption2 = selectCity.find('option:selected');
//console.log(selectedCityOption2.text());
//$('#hide3').val(selectedCityOption2.text());
function changeCity(element) {
$('#hide2').val($(element).find('option:selected').text());
}
//var selectCity = $('#city.select-city');
//var selectedCityOption = selectCity.find('option:selected');
//$('#hide2').val(selectedCityOption.text());
$("#edit-modal").on('hidden.bs.modal', function () {
$('body').addClass('modal-open');
});
$(function () {
$('#edit-modal [data-parent-modal]').on('click', function (e) {
e.preventDefault();
e.stopPropagation();
var parentModalId = $(this).data('parent-modal');
$(parentModalId).modal('hide');
});
});
$(function () {
$('.addNeighbor').on('click', function (e) {
e.preventDefault();
$('#edit-modal').modal('show');
});
});
//var selectCity2 = $('#modalCity.select-city');
//var selectedCityOption2 = selectCity.find('option:selected');
//console.log(selectedCityOption2.text());
//$('#hide3').val(selectedCityOption2.text());
$("#edit-modal").on('hidden.bs.modal',
function() {
$('body').addClass('modal-open');
});
$(function() {
$('#edit-modal [data-parent-modal]').on('click',
function(e) {
e.preventDefault();
e.stopPropagation();
const parentModalId = $(this).data('parent-modal');
$(parentModalId).modal('hide');
});
});
$(function() {
$('.addNeighbor').on('click',
function(e) {
e.preventDefault();
$('#edit-modal').modal('show');
});
});
</script>

View File

@@ -1,7 +1,7 @@
@page
@model ServiceHost.Areas.Admin.Pages.Company.Contracts.ContractPrintAll
@{
<style>
<style>
.modal .modal-dialog .modal-content {
background-color: white !important;
}
@@ -145,417 +145,425 @@
}
<div class="row">
<!--دکمه ها-->
<div class="modal-footer" style="border-top: unset; padding: 10px 15px 10px; background: rgb(116 116 116 / 70%); border-radius: 15px; position: fixed; z-index: 999;">
@{
<form style="display: none" class="form-inline" role="form" name="search-theme-form" autocomplete="off"
method="get"
data-ajax="true"
data-ajax-method="get"
data-ajax-update="#mainPanel"
data-ajax-mode="replace"
data-ajax-url="@Url.Page("./ContractPrintAll", "PrintAll")">
<div id="copyInputs"></div>
<input type="submit" id="sendData" class="sendData" style="display: none" />
</form>
if (@Model.DividList != null)
{
@foreach (var btn in @Model.DividList.GroupPrintViewModel)
{
<div class="row m-t-5">
<a class="btn btn-success btn-rounded waves-effect waves-light m-b-5 send" style="background-color: #06ab08; border-color: #06ab08; border-bottom-left-radius: 0px; border-top-left-radius: 0px; font-family: 'Web_Yekan' !important; margin-left: -3px "> <i class="fa fa-print" style="padding-left: 3px; font-size: 15px; position: relative; top: 3px;"></i> پرینت</a>
<span>
@for (int j = 0; j < @btn.CantractIdList.Count; j++)
{
<input type="hidden" asp-for="sendIds.CantractIdList[j]" value="@btn.CantractIdList[j]" />
}
</span>
<a class="btn btn-info btn-rounded waves-effect waves-light m-b-5 counter" style="width: 110px; border-bottom-right-radius: 0px; border-top-right-radius: 0px; background-color: #545353; border-color: #545353; font-family: 'Web_Yekan' !important;">
<span>از</span> <span style="font-family: 'IranSans';">@btn.StartPrint</span><span>&nbsp;</span> <span>تا</span> <span style="font-family: 'IranSans';">@btn.EndPrint</span>
</a>
@if (btn.StartPrint == 1)
{
<a class="btn btn-warning btn-rounded waves-effect waves-light m-b-10" style="margin-bottom: 5px;"
onclick="history.back();" >
<i class="fa faSize fa-share-square-o"></i> بازگشت
</a>
}
</div>
}
}
}
</div>
<div style="width:100%; height:60px;">
</div>
<!--نمایش پرینت لیست اولیه-->
<div id="mainPanel">
<div class="modal-body print" style="width: 210mm; float: left;" id="printThis">
@foreach (var item in @Model.GroupPrintList)
{
<div class="container container2">
<div class="row">
<div class="col-md-12">
<fieldset style="border: 1px solid black; padding: revert; border-radius: 10px; height: 28cm; padding: 2mm">
<div class="row" dir="rtl">
<div class="col-xs-4 d-inline-block"><fieldset style="border: 1px solid black; border-radius: 10px; padding: 5px; margin-top: 5px; width: 180px;">شماره قرارداد :<span>&nbsp;</span> @item.ContractNo</fieldset></div>
<div class="col-xs-4 d-inline-block text-center"><h4>قرارداد کار</h4></div>
<div class="col-xs-4 d-inline-block"></div>
</div>
<div class="row text-center">
<h5>این قرارداد به موجب ماده 10 قانون کار جمهوری اسلامی ایران بین کارفرما و کارگر منعقد می گردد</h5>
</div>
<div class="row m-t-5">
<fieldset class="head" style="background-color: #ccc; border: 1px solid black; border-radius: 10px 10px 0px 0px; padding: 3px; margin: 4px 10px 0px 10px;"><h6 style="padding-right: 5px;">مشخصات کارفرما</h6></fieldset>
<fieldset style="border: 1px solid black; border-top: 0px; border-radius: 0px 0px 10px 10px; padding: 3px; margin: 0px 10px;">
<div class="row" style="padding: 4px;">
<div class="col-xs-2 fontBold">آقای/خانم/شرکت :</div>
<div class="col-xs-10">
<div class="row">
@foreach (var Employer in item.Employers)
{
if (Employer.NationalId == "*" || Employer.RegisterId == "*")
{
<div class="col-xs-4">@Employer.FullName</div>
<div class="col-xs-4"><span class="fontBold">کـــــد مـــلی</span> : <span class="fontNumber"> @Employer.Nationalcode</span></div>
<div class="col-xs-4">
<span class="fontBold">شماره شناسنامه </span> :
<span class="fontNumber">
@Employer.IdNumber
</span>
</div>
}
else
{
<div class="col-xs-4">@Employer.FullName </div>
<div class="col-xs-4 "><span class="fontBold">شناسه ملی </span> : <span class="fontNumber">@Employer.NationalId</span></div>
<div class="col-xs-4"><span class="fontBold">شماره ثـــــــــبــت </span> : <span class="fontNumber">@Employer.RegisterId</span></div>
}
}
</div>
</div>
</div>
<div class="row" style="padding: 4px">
@foreach (var Wk in item.Workshops)
{
<div class="col-xs-6"><span class="fontBold">نــــــام کـــــــارگـــاه</span> : <span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span> <span>@Wk.WorkshopName</span> </div>
<div class="col-xs-2"></div>
<div class="col-xs-4">
<span class="fontBold" style="margin-right: 41px;">کــــد کـــارگـاهـی</span> : <span>&nbsp;</span>
<span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>@Wk.InsuranceCode</span>
</div>
}
</div>
<div class="row" style="padding: 4px">
@foreach (var wk2 in item.Workshops)
{
<div class="col-xs-3" style="width: 124px"><span class="fontBold">بــــــه نــــــشـــانـی</span> : </div>
<div class="col-xs-9"><span>@wk2.Address</span></div>
}
</div>
</fieldset>
</div>
<div class="row m-t-5">
<fieldset class="head" style="background-color: #ccc; border: 1px solid black; border-radius: 10px 10px 0px 0px; padding: 3px; margin: 4px 10px 0px 10px;"><h6 style="padding-right: 5px;">مشخصات پرسنل</h6></fieldset>
<fieldset style="border: 1px solid black; border-top: 0px; border-radius: 0px 0px 10px 10px; padding: 3px; margin: 0px 10px; height: 3cm">
@foreach (var emloyee in item.Employees)
{
<div class="row" style="padding: 4px;">
<div class="col-xs-10">
<div class="row" style="padding: 4px;">
<div class="col-xs-5"><span class="fontBold">آقــا/خــانم</span> : <span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span> <span>@emloyee.EmployeeFullName</span></div>
<div class="col-xs-3"><span class="fontBold"> کد ملی</span> : <span>&nbsp;</span> <span class="fontNumber">@emloyee.NationalCode</span></div>
<div class="col-xs-4"><span class="fontBold">شماره شناسنامه</span> : <span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span> <span class="fontNumber">@emloyee.IdNumber</span></div>
</div>
<div class="row" style="padding: 4px;">
<div class="col-xs-5"><span class="fontBold">تاریخ تولد </span> : <span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span> <span class="fontNumber">@emloyee.DateOfBirth</span></div>
<div class="col-xs-3"><span class="fontBold"> نام پدر </span> :<span>&nbsp;</span> <span>@emloyee.FatherName</span></div>
<div class="col-xs-4"><span class="fontBold">میزان تحصیـلات </span> : <span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span> <span>@emloyee.LevelOfEducation</span></div>
</div>
<div class="row" style="padding: 4px;">
<div class="col-xs-2" style="width: 74px;"><span class="fontBold"> بـه نـشانی </span> : </div>
<div class="col-xs-10"><span>@emloyee.Address</span></div>
</div>
</div>
<div class="col-xs-2">
<span style="width: 2cm; height: 2.5cm; border: 1px solid #999595; border-radius: 7px; position: absolute; left: 15px;">
<h5 style="text-align: center; margin-top: 20px !important; color: #a5a9a9 !important; line-height: 1.5;">
عکس<br /> پرسنل
</h5>
</span>
</div>
</div>
}
</fieldset>
</div>
<div class="row m-t-5">
<fieldset class="head" style="background-color: #ccc; border: 1px solid black; border-radius: 10px 10px 0px 0px; padding: 3px; margin: 4px 10px 0px 10px;"><h6 style="padding-right: 5px;">مدت و نوع قرارداد </h6></fieldset>
<fieldset style="border: 1px solid black; border-top: 0px; border-radius: 0px 0px 10px 10px; padding: 3px; margin: 0px 10px;">
<div class="row" style="padding: 4px;">
<div class="col-xs-4">
<span class="fontBold"> نوع قرارداد </span> : <span>&nbsp;</span><span>&nbsp;</span>
<span class="radio-info">
@if (item.ContractType == "دائم")
{
<input style="vertical-align: sub;" type="radio" id="inlineRadio3" name="@item.Id" checked="checked">
<label for="inlineRadio3"> دائم </label>
}
else
{
<input style="vertical-align: sub;" type="radio" id="inlineRadio3" name="@item.Id">
<label for="inlineRadio3"> دائم </label>
}
</span><span>&nbsp;</span><span>&nbsp;</span>
<span class="radio-info">
@if (item.ContractType == "موقت")
{
<input style="vertical-align: sub;" type="radio" id="inlineRadio3" name="@item.Id" checked="checked">
<label for="inlineRadio3"> موقت </label>
}
else
{
<input style="vertical-align: sub;" type="radio" id="inlineRadio3" name="@item.Id">
<label for="inlineRadio3"> موقت </label>
}
</span><span>&nbsp;</span><span>&nbsp;</span>
<span class="radio-info">
@if (item.ContractType == "معین")
{
<input style="vertical-align: sub;" type="radio" id="inlineRadio3" name="@item.Id" checked="checked">
<label for="inlineRadio3"> معین </label>
}
else
{
<input style="vertical-align: sub;" type="radio" id="inlineRadio3" name="@item.Id">
<label for="inlineRadio3"> معین </label>
}
</span>
</div>
<div class="col-xs-8" style="margin-top: 3px;">
<span class="fontBold">نوع کار یا حرفه یا حجم کار یا وظیفه ای که کارگر به آن اشتغال می یابد</span> :
<span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span>
<span>@item.JobType</span>
</div>
</div>
<div class="row" style="padding: 4px;">
<div class="col-xs-4">
<span class="fontBold">تاریخ انعقاد قرارداد</span> :
<span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span>
<span class="fontNumber">@item.SetContractDate</span>
</div>
</div>
<div class="row" style="padding: 4px;">
<div class="col-xs-8">
<span class="fontBold">مـــدت قـــــــــــرارداد</span> :
<span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span>
<span class="fontNumber">@item.ContarctStart</span><span>&nbsp;</span><span>&nbsp;</span>
<span>الی</span><span>&nbsp;</span><span>&nbsp;</span>
<span class="fontNumber">@item.ContractEnd</span><span>&nbsp;</span><span>&nbsp;</span>
</div>
</div>
<div class="row" style="padding: 4px;">
<div class="col-xs-4">
<span class="fontBold">ساعت کار در هفته</span> :
<span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span>
<span class="fontNumber">@item.WorkingHoursWeekly</span>
</div>
</div>
<div class="row" style="padding: 4px; padding-right: 15px">
<span class="fontBold">
@if (item.WorkshopAddress2 != null)
{<span>محـل انــجـام کـار 1</span>}
else
{<span>محـل انــــجـام کـــار </span>}
</span> : <span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span>
<span>@item.WorkshopAddress1</span>
</div>
@if (item.WorkshopAddress2 != null)
{
<div class="row" style="padding: 4px; padding-right: 15px">
<span class="fontBold">محـل انــجـام کـار 2</span> : <span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span>
<span>@item.WorkshopAddress2</span>
</div>
}
</fieldset>
</div>
<div class="row m-t-5">
<fieldset class="head" style="background-color: #ccc; border: 1px solid black; border-radius: 10px 10px 0px 0px; padding: 3px; margin: 4px 10px 0px 10px;"><h6 style="padding-right: 5px;">حق السعی </h6></fieldset>
<fieldset style="border: 1px solid black; border-top: 0px; border-radius: 0px 0px 10px 10px; padding: 3px; margin: 0px 10px;">
<div class="row" style="padding: 7px;">
<div class="col-xs-3">
<span class="fontBold"> مزد روزانه : </span>
</div>
<div class="col-xs-3">
<span>@item.DayliWage</span><span>&nbsp;</span><span>ریال</span>
</div>
<div class="col-xs-2">
<span class="fontBold"> حق عائله مندی : </span>
</div>
<div class="col-xs-4">
@if (item.FamilyAllowance != "0")
{
<span>@item.FamilyAllowance</span><span>&nbsp;</span><span>ریال</span>
}
</div>
</div>
<div class="row" style="padding: 7px;">
<div class="col-xs-3">
<span class="fontBold"> کمک هزینه اقلام مصرفی خواربار : </span>
</div>
<div class="col-xs-9">
<span>@item.ConsumableItems</span><span>&nbsp;</span><span>ریال</span>
</div>
</div>
<div class="row" style="padding: 7px;">
<div class="col-xs-3">
<span class="fontBold"> کمک هزینه مسکن : </span>
<!--دکمه ها-->
<div class="modal-footer" style="border-top: unset; padding: 10px 15px 10px; background: rgb(116 116 116 / 70%); border-radius: 15px; position: fixed; z-index: 999;">
@{
<form style="display: none" class="form-inline" role="form" name="search-theme-form" autocomplete="off"
method="get"
data-ajax="true"
data-ajax-method="get"
data-ajax-update="#mainPanel"
data-ajax-mode="replace"
data-ajax-url="@Url.Page("./ContractPrintAll", "PrintAll")">
<div id="copyInputs"></div>
<input type="submit" id="sendData" class="sendData" style="display: none"/>
</form>
if (Model.DividList != null)
{
@foreach (var btn in Model.DividList.GroupPrintViewModel)
{
<div class="row m-t-5">
<a class="btn btn-success btn-rounded waves-effect waves-light m-b-5 send" style="background-color: #06ab08; border-color: #06ab08; border-bottom-left-radius: 0px; border-top-left-radius: 0px; font-family: 'Web_Yekan' !important; margin-left: -3px "> <i class="fa fa-print" style="padding-left: 3px; font-size: 15px; position: relative; top: 3px;"></i> پرینت</a>
<span>
@for (var j = 0; j < btn.CantractIdList.Count; j++)
{
<input type="hidden" asp-for="sendIds.CantractIdList[j]" value="@btn.CantractIdList[j]"/>
}
</span>
<a class="btn btn-info btn-rounded waves-effect waves-light m-b-5 counter" style="width: 110px; border-bottom-right-radius: 0px; border-top-right-radius: 0px; background-color: #545353; border-color: #545353; font-family: 'Web_Yekan' !important;">
<span>از</span> <span style="font-family: 'IranSans';">@btn.StartPrint</span><span>&nbsp;</span> <span>تا</span> <span style="font-family: 'IranSans';">@btn.EndPrint</span>
</a>
@if (btn.StartPrint == 1)
{
<a class="btn btn-warning btn-rounded waves-effect waves-light m-b-10" style="margin-bottom: 5px;"
onclick="history.back();">
<i class="fa faSize fa-share-square-o"></i> بازگشت
</a>
}
</div>
}
}
}
</div>
<div style="width:100%; height:60px;">
</div>
<!--نمایش پرینت لیست اولیه-->
<div id="mainPanel">
<div class="modal-body print" style="width: 210mm; float: left;" id="printThis">
@foreach (var item in Model.GroupPrintList)
{
<div class="container container2">
<div class="row">
<div class="col-md-12">
<fieldset style="border: 1px solid black; padding: revert; border-radius: 10px; height: 28cm; padding: 2mm">
<div class="row" dir="rtl">
<div class="col-xs-4 d-inline-block">
<fieldset style="border: 1px solid black; border-radius: 10px; padding: 5px; margin-top: 5px; width: 180px;">شماره قرارداد :<span>&nbsp;</span> @item.ContractNo</fieldset>
</div>
<div class="col-xs-4 d-inline-block text-center">
<h4>قرارداد کار</h4>
</div>
<div class="col-xs-4 d-inline-block"></div>
</div>
<div class="row text-center">
<h5>این قرارداد به موجب ماده 10 قانون کار جمهوری اسلامی ایران بین کارفرما و کارگر منعقد می گردد</h5>
</div>
<div class="row m-t-5">
<fieldset class="head" style="background-color: #ccc; border: 1px solid black; border-radius: 10px 10px 0px 0px; padding: 3px; margin: 4px 10px 0px 10px;">
<h6 style="padding-right: 5px;">مشخصات کارفرما</h6>
</fieldset>
<fieldset style="border: 1px solid black; border-top: 0px; border-radius: 0px 0px 10px 10px; padding: 3px; margin: 0px 10px;">
<div class="row" style="padding: 4px;">
<div class="col-xs-2 fontBold">آقای/خانم/شرکت :</div>
<div class="col-xs-10">
<div class="row">
@foreach (var Employer in item.Employers)
{
if (Employer.NationalId == "*" || Employer.RegisterId == "*")
{
<div class="col-xs-4">@Employer.FullName</div>
<div class="col-xs-4"><span class="fontBold">کـــــد مـــلی</span> : <span class="fontNumber"> @Employer.Nationalcode</span></div>
<div class="col-xs-4">
<span class="fontBold">شماره شناسنامه </span> :
<span class="fontNumber">
@Employer.IdNumber
</span>
</div>
}
else
{
<div class="col-xs-4">@Employer.FullName </div>
<div class="col-xs-4 "><span class="fontBold">شناسه ملی </span> : <span class="fontNumber">@Employer.NationalId</span></div>
<div class="col-xs-4"><span class="fontBold">شماره ثـــــــــبــت </span> : <span class="fontNumber">@Employer.RegisterId</span></div>
}
}
</div>
</div>
</div>
<div class="row" style="padding: 4px">
@foreach (var Wk in item.Workshops)
{
<div class="col-xs-6"><span class="fontBold">نــــــام کـــــــارگـــاه</span> : <span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span> <span>@Wk.WorkshopName</span> </div>
<div class="col-xs-2"></div>
<div class="col-xs-4">
<span class="fontBold" style="margin-right: 41px;">کــــد کـــارگـاهـی</span> : <span>&nbsp;</span>
<span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>@Wk.InsuranceCode</span>
</div>
}
</div>
<div class="row" style="padding: 4px">
@foreach (var wk2 in item.Workshops)
{
<div class="col-xs-3" style="width: 124px"><span class="fontBold">بــــــه نــــــشـــانـی</span> : </div>
<div class="col-xs-9">
<span>@wk2.Address</span>
</div>
}
</div>
</fieldset>
</div>
<div class="row m-t-5">
<fieldset class="head" style="background-color: #ccc; border: 1px solid black; border-radius: 10px 10px 0px 0px; padding: 3px; margin: 4px 10px 0px 10px;">
<h6 style="padding-right: 5px;">مشخصات پرسنل</h6>
</fieldset>
<fieldset style="border: 1px solid black; border-top: 0px; border-radius: 0px 0px 10px 10px; padding: 3px; margin: 0px 10px; height: 3cm">
@foreach (var emloyee in item.Employees)
{
<div class="row" style="padding: 4px;">
<div class="col-xs-10">
<div class="row" style="padding: 4px;">
<div class="col-xs-5"><span class="fontBold">آقــا/خــانم</span> : <span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span> <span>@emloyee.EmployeeFullName</span></div>
<div class="col-xs-3"><span class="fontBold"> کد ملی</span> : <span>&nbsp;</span> <span class="fontNumber">@emloyee.NationalCode</span></div>
<div class="col-xs-4"><span class="fontBold">شماره شناسنامه</span> : <span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span> <span class="fontNumber">@emloyee.IdNumber</span></div>
</div>
<div class="row" style="padding: 4px;">
<div class="col-xs-5"><span class="fontBold">تاریخ تولد </span> : <span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span> <span class="fontNumber">@emloyee.DateOfBirth</span></div>
<div class="col-xs-3"><span class="fontBold"> نام پدر </span> :<span>&nbsp;</span> <span>@emloyee.FatherName</span></div>
<div class="col-xs-4"><span class="fontBold">میزان تحصیـلات </span> : <span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span> <span>@emloyee.LevelOfEducation</span></div>
</div>
<div class="row" style="padding: 4px;">
<div class="col-xs-2" style="width: 74px;"><span class="fontBold"> بـه نـشانی </span> : </div>
<div class="col-xs-10">
<span>@emloyee.Address</span>
</div>
</div>
</div>
<div class="col-xs-2">
<span style="width: 2cm; height: 2.5cm; border: 1px solid #999595; border-radius: 7px; position: absolute; left: 15px;">
<h5 style="text-align: center; margin-top: 20px !important; color: #a5a9a9 !important; line-height: 1.5;">
عکس<br/> پرسنل
</h5>
</span>
</div>
</div>
}
</fieldset>
</div>
<div class="row m-t-5">
<fieldset class="head" style="background-color: #ccc; border: 1px solid black; border-radius: 10px 10px 0px 0px; padding: 3px; margin: 4px 10px 0px 10px;">
<h6 style="padding-right: 5px;">مدت و نوع قرارداد </h6>
</fieldset>
<fieldset style="border: 1px solid black; border-top: 0px; border-radius: 0px 0px 10px 10px; padding: 3px; margin: 0px 10px;">
<div class="row" style="padding: 4px;">
<div class="col-xs-4">
<span class="fontBold"> نوع قرارداد </span> : <span>&nbsp;</span><span>&nbsp;</span>
<span class="radio-info">
@if (item.ContractType == "دائم")
{
<input style="vertical-align: sub;" type="radio" id="inlineRadio3" name="@item.Id" checked="checked">
<label for="inlineRadio3"> دائم </label>
}
else
{
<input style="vertical-align: sub;" type="radio" id="inlineRadio3" name="@item.Id">
<label for="inlineRadio3"> دائم </label>
}
</span><span>&nbsp;</span><span>&nbsp;</span>
<span class="radio-info">
@if (item.ContractType == "موقت")
{
<input style="vertical-align: sub;" type="radio" id="inlineRadio3" name="@item.Id" checked="checked">
<label for="inlineRadio3"> موقت </label>
}
else
{
<input style="vertical-align: sub;" type="radio" id="inlineRadio3" name="@item.Id">
<label for="inlineRadio3"> موقت </label>
}
</span><span>&nbsp;</span><span>&nbsp;</span>
<span class="radio-info">
@if (item.ContractType == "معین")
{
<input style="vertical-align: sub;" type="radio" id="inlineRadio3" name="@item.Id" checked="checked">
<label for="inlineRadio3"> معین </label>
}
else
{
<input style="vertical-align: sub;" type="radio" id="inlineRadio3" name="@item.Id">
<label for="inlineRadio3"> معین </label>
}
</span>
</div>
<div class="col-xs-8" style="margin-top: 3px;">
<span class="fontBold">نوع کار یا حرفه یا حجم کار یا وظیفه ای که کارگر به آن اشتغال می یابد</span> :
<span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span>
<span>@item.JobType</span>
</div>
</div>
<div class="row" style="padding: 4px;">
<div class="col-xs-4">
<span class="fontBold">تاریخ انعقاد قرارداد</span> :
<span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span>
<span class="fontNumber">@item.SetContractDate</span>
</div>
</div>
<div class="row" style="padding: 4px;">
<div class="col-xs-8">
<span class="fontBold">مـــدت قـــــــــــرارداد</span> :
<span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span>
<span class="fontNumber">@item.ContarctStart</span><span>&nbsp;</span><span>&nbsp;</span>
<span>الی</span><span>&nbsp;</span><span>&nbsp;</span>
<span class="fontNumber">@item.ContractEnd</span><span>&nbsp;</span><span>&nbsp;</span>
</div>
</div>
<div class="row" style="padding: 4px;">
<div class="col-xs-4">
<span class="fontBold">ساعت کار در هفته</span> :
<span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span>
<span class="fontNumber">@item.WorkingHoursWeekly</span>
</div>
</div>
<div class="row" style="padding: 4px; padding-right: 15px">
<span class="fontBold">
@if (item.WorkshopAddress2 != null)
{
<span>محـل انــجـام کـار 1</span>
}
else
{
<span>محـل انــــجـام کـــار </span>
}
</span> : <span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span>
<span>@item.WorkshopAddress1</span>
</div>
@if (item.WorkshopAddress2 != null)
{
<div class="row" style="padding: 4px; padding-right: 15px">
<span class="fontBold">محـل انــجـام کـار 2</span> : <span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span>
<span>@item.WorkshopAddress2</span>
</div>
}
</fieldset>
</div>
<div class="row m-t-5">
<fieldset class="head" style="background-color: #ccc; border: 1px solid black; border-radius: 10px 10px 0px 0px; padding: 3px; margin: 4px 10px 0px 10px;">
<h6 style="padding-right: 5px;">حق السعی </h6>
</fieldset>
<fieldset style="border: 1px solid black; border-top: 0px; border-radius: 0px 0px 10px 10px; padding: 3px; margin: 0px 10px;">
<div class="row" style="padding: 7px;">
<div class="col-xs-3">
<span class="fontBold"> مزد روزانه : </span>
</div>
<div class="col-xs-3">
<span>@item.DayliWage</span><span>&nbsp;</span><span>ریال</span>
</div>
<div class="col-xs-2">
<span class="fontBold"> حق عائله مندی : </span>
</div>
<div class="col-xs-4">
@if (item.FamilyAllowance != "0")
{
<span>@item.FamilyAllowance</span>
<span>&nbsp;</span>
<span>ریال</span>
}
</div>
</div>
<div class="row" style="padding: 7px;">
<div class="col-xs-3">
<span class="fontBold"> کمک هزینه اقلام مصرفی خواربار : </span>
</div>
<div class="col-xs-9">
<span>@item.ConsumableItems</span><span>&nbsp;</span><span>ریال</span>
</div>
</div>
<div class="row" style="padding: 7px;">
<div class="col-xs-3">
<span class="fontBold"> کمک هزینه مسکن : </span>
</div>
<div class="col-xs-9">
<span>@item.HousingAllowance</span><span>&nbsp;</span><span>ریال</span>
</div>
</div>
</fieldset>
</div>
<div class="row m-t-5">
<fieldset class="head" style="background-color: #ccc; border: 1px solid black; border-radius: 10px 10px 0px 0px; padding: 3px; margin: 4px 10px 0px 10px;">
<h6 style="padding-right: 5px;"> شروط و توضیحات </h6>
</fieldset>
<fieldset style="border: 1px solid black; border-top: 0px; border-radius: 0px 0px 10px 10px; padding: 3px; margin: 0px 10px;">
<textarea class="form-control" style="height: 80px;"></textarea>
</fieldset>
</div>
<div class="row m-t-5" style="padding: 1px 10px 1px 10px ;">
<p style="margin-bottom: 2px !important">بیمه : به موجب ماده 148 قانون کار، کارفرما مکلف است کارگر را نزد سازمان تامین اجتماعی بیمه نماید.</p>
<p style="margin-bottom: 2px !important">یک نسخه از این قرارداد در ید کارگر می باشد و هر یک از نسخه های قرارداد، اعتبار و حکم واحد دارند.</p>
<p style="text-align: justify; margin-bottom: 2px !important">
مبلغ مزد روزانه در این قرارداد بر اساس قوانین کار می باشد و هیچگونه ارتباطی با تنظیم و ارسال لیست بیمه سازمان تامین اجتماعی ندارد. سازمان تامین اجتماعی
بر اساس بخشنامه های درون سازمانی مقادیری را برای ارسال لیست بیمه در اختیار کارفرما قرار میدهد (لیست مشاغل مقطوع) که خارج از قوانین کار می باشد.
</p>
</div>
<div class="row m-t-5" style="padding: 1px 10px 1px 0px;">
<div class="col-xs-6 text-center">
<h5>مهر/امضاء/اثر انگشت کارفرما</h5>
</div>
<div class="col-xs-6 text-center">
<h5>امضاء/اثر انگشت کارگر</h5>
</div>
</div>
</fieldset>
</div>
</div>
</div>
}
</div>
<div class="col-xs-9">
<span>@item.HousingAllowance</span><span>&nbsp;</span><span>ریال</span>
</div>
</div>
</fieldset>
</div>
<div class="row m-t-5">
<fieldset class="head" style="background-color: #ccc; border: 1px solid black; border-radius: 10px 10px 0px 0px; padding: 3px; margin: 4px 10px 0px 10px;"><h6 style="padding-right: 5px;"> شروط و توضیحات </h6></fieldset>
<fieldset style="border: 1px solid black; border-top: 0px; border-radius: 0px 0px 10px 10px; padding: 3px; margin: 0px 10px;">
</div>
<textarea class="form-control" style="height: 80px;"></textarea>
</fieldset>
</div>
<div class="row m-t-5" style="padding: 1px 10px 1px 10px ;">
<p style="margin-bottom: 2px !important">بیمه : به موجب ماده 148 قانون کار، کارفرما مکلف است کارگر را نزد سازمان تامین اجتماعی بیمه نماید.</p>
<p style="margin-bottom: 2px !important">یک نسخه از این قرارداد در ید کارگر می باشد و هر یک از نسخه های قرارداد، اعتبار و حکم واحد دارند.</p>
<p style="text-align: justify; margin-bottom: 2px !important">
مبلغ مزد روزانه در این قرارداد بر اساس قوانین کار می باشد و هیچگونه ارتباطی با تنظیم و ارسال لیست بیمه سازمان تامین اجتماعی ندارد. سازمان تامین اجتماعی
بر اساس بخشنامه های درون سازمانی مقادیری را برای ارسال لیست بیمه در اختیار کارفرما قرار میدهد (لیست مشاغل مقطوع) که خارج از قوانین کار می باشد.
</p>
</div>
<div class="row m-t-5" style="padding: 1px 10px 1px 0px;">
<div class="col-xs-6 text-center"><h5>مهر/امضاء/اثر انگشت کارفرما</h5></div>
<div class="col-xs-6 text-center"><h5>امضاء/اثر انگشت کارگر</h5></div>
</div>
</fieldset>
</div>
</div>
</div>
}
</div>
</div>
</div>
</div>
@section Script{
<script src="~/lib/jquery-ajax-unobtrusive/jquery.unobtrusive-ajax.min.js"></script>
<script>
$(document).ready(function() {
$('.send').on('click',
function(e) {
e.preventDefault();
$('.remover').remove();
var index = 0;
$(this).siblings('span').find('input[type="hidden"]').each(function() {
let ipValue = $(this).val();
const html = `<input type="hidden" class="remover" name="sendIds.CantractIdList[${index}]" value="${ipValue}" />`;
$('#copyInputs').append(html);
index += 1;
});
<script src="~/lib/jquery-ajax-unobtrusive/jquery.unobtrusive-ajax.min.js"></script>
<script>
$(document).ready(function() {
$('.send').on('click',
function(e) {
e.preventDefault();
//$(this).next('.form-inline').find('.sendData').click();
//$(this).next('.form-inline').find('.sendData').remove();
$('#sendData').click();
let counter = $(this).siblings('.counter');
$(counter).addClass('btncounter-text-disable');
$(this).addClass('btn-text-disable');
$('.remover').remove();
var index = 0;
$(this).siblings('span').find('input[type="hidden"]').each(function() {
const ipValue = $(this).val();
});
const html = `<input type="hidden" class="remover" name="sendIds.CantractIdList[${index}]" value="${ipValue}" />`;
$('#copyInputs').append(html);
index += 1;
});
});
</script>
//$(this).next('.form-inline').find('.sendData').click();
//$(this).next('.form-inline').find('.sendData').remove();
$('#sendData').click();
const counter = $(this).siblings('.counter');
$(counter).addClass('btncounter-text-disable');
$(this).addClass('btn-text-disable');
});
});
</script>
}

View File

@@ -1,249 +1,228 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using CompanyManagment.App.Contracts.Contract;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
using _0_Framework.Application;
namespace ServiceHost.Areas.Admin.Pages.Company.Contracts
namespace ServiceHost.Areas.Admin.Pages.Company.Contracts;
public class ContractPrintAll : PageModel
{
public class ContractPrintAll: PageModel
{
private readonly IContractApplication _contractApplication;
public List<ContractViweModel> GroupPrintList;
public ContractDividPrintViewModel DividList;
public List<long> printIdList;
public GroupPrintViewModel sendIds;
public ContractPrintAll(IContractApplication contractApplication)
{
_contractApplication = contractApplication;
}
private readonly IContractApplication _contractApplication;
public ContractDividPrintViewModel DividList;
public void OnGet(string idlist)
{
public List<ContractViweModel> GroupPrintList;
var ids = ExtractNumbers(idlist);
public List<long> printIdList;
public GroupPrintViewModel sendIds;
public ContractPrintAll(IContractApplication contractApplication)
{
_contractApplication = contractApplication;
}
var resultList = new List<GroupPrintViewModel>();
var res = _contractApplication.PrintAll(ids);
var printCounter = res.Count();
if (printCounter <= 25)
{
GroupPrintList = res;
var addToList = new GroupPrintViewModel()
{
CantractIdList = res.Select(x => x.Id).ToList(),
StartPrint = 1,
EndPrint = printCounter,
};
resultList.Add(addToList);
var finalResult = new ContractDividPrintViewModel()
{
GroupPrintViewModel = resultList,
ButtonConter = resultList.Count,
};
DividList = finalResult;
}
else
{
var divide20 = printCounter / 20;
var multiple = printCounter - (divide20 * 20);
if (multiple == 0)
{
for (int i = 1; i <= printCounter; i += 20)
{
var start = i;
var end = i + 19;
if (i == 1)
{
GroupPrintList = res.Where(x => x.PrintCounter >= start && x.PrintCounter <= end).ToList();
var addToList = new GroupPrintViewModel()
{
CantractIdList = res.Where(x => x.PrintCounter >= start && x.PrintCounter <= end).Select(x => x.Id).ToList(),
StartPrint = start,
EndPrint = end,
};
resultList.Add(addToList);
}
else
{
var addToList = new GroupPrintViewModel()
{
CantractIdList = res.Where(x => x.PrintCounter >= start && x.PrintCounter <= end).Select(x => x.Id).ToList(),
StartPrint = start,
EndPrint = end,
};
resultList.Add(addToList);
}
public void OnGet(string idlist)
{
var ids = ExtractNumbers(idlist);
}
var resultList = new List<GroupPrintViewModel>();
var finalResult = new ContractDividPrintViewModel()
{
GroupPrintViewModel = resultList,
ButtonConter = resultList.Count,
};
DividList = finalResult;
var res = _contractApplication.PrintAll(ids);
var printCounter = res.Count();
if (printCounter <= 25)
{
GroupPrintList = res;
var addToList = new GroupPrintViewModel
{
CantractIdList = res.Select(x => x.Id).ToList(),
StartPrint = 1,
EndPrint = printCounter
};
resultList.Add(addToList);
var finalResult = new ContractDividPrintViewModel
{
GroupPrintViewModel = resultList,
ButtonConter = resultList.Count
};
DividList = finalResult;
}
else
{
var divide20 = printCounter / 20;
var multiple = printCounter - divide20 * 20;
if (multiple == 0)
{
for (var i = 1; i <= printCounter; i += 20)
{
var start = i;
var end = i + 19;
if (i == 1)
{
GroupPrintList = res.Where(x => x.PrintCounter >= start && x.PrintCounter <= end).ToList();
var addToList = new GroupPrintViewModel
{
CantractIdList = res.Where(x => x.PrintCounter >= start && x.PrintCounter <= end)
.Select(x => x.Id).ToList(),
StartPrint = start,
EndPrint = end
};
resultList.Add(addToList);
}
else
{
var addToList = new GroupPrintViewModel
{
CantractIdList = res.Where(x => x.PrintCounter >= start && x.PrintCounter <= end)
.Select(x => x.Id).ToList(),
StartPrint = start,
EndPrint = end
};
resultList.Add(addToList);
}
}
var finalResult = new ContractDividPrintViewModel
{
GroupPrintViewModel = resultList,
ButtonConter = resultList.Count
};
DividList = finalResult;
}
else if (multiple <= 5)
{
var endOfround = 0;
for (var i = 1; i <= printCounter - 26; i += 20)
{
var start = i;
var end = i + 19;
if (i == 1)
{
GroupPrintList = res.Where(x => x.PrintCounter >= start && x.PrintCounter <= end).ToList();
endOfround = end;
var addToList = new GroupPrintViewModel
{
CantractIdList = res.Where(x => x.PrintCounter >= start && x.PrintCounter <= end)
.Select(x => x.Id).ToList(),
StartPrint = start,
EndPrint = end
};
resultList.Add(addToList);
}
else
{
var addToList = new GroupPrintViewModel
{
CantractIdList = res.Where(x => x.PrintCounter >= start && x.PrintCounter <= end)
.Select(x => x.Id).ToList(),
StartPrint = start,
EndPrint = end
};
endOfround = end;
resultList.Add(addToList);
}
}
var count = res.Where(x => x.PrintCounter > endOfround).ToList();
var addLastPart = new GroupPrintViewModel
{
CantractIdList = res.Where(x => x.PrintCounter > endOfround).Select(x => x.Id).ToList(),
StartPrint = count.Select(x => x.PrintCounter).FirstOrDefault(),
EndPrint = count.Select(x => x.PrintCounter).LastOrDefault()
};
resultList.Add(addLastPart);
var finalResult = new ContractDividPrintViewModel
{
GroupPrintViewModel = resultList,
ButtonConter = resultList.Count
};
DividList = finalResult;
}
else if (multiple > 5)
{
var endOfround = 0;
var pcounter = multiple + 1;
for (var i = 1; i <= printCounter - pcounter; i += 20)
{
var start = i;
var end = i + 19;
if (i == 1)
{
GroupPrintList = res.Where(x => x.PrintCounter >= start && x.PrintCounter <= end).ToList();
endOfround = end;
var addToList = new GroupPrintViewModel
{
CantractIdList = res.Where(x => x.PrintCounter >= start && x.PrintCounter <= end)
.Select(x => x.Id).ToList(),
StartPrint = start,
EndPrint = end
};
resultList.Add(addToList);
}
else
{
var addToList = new GroupPrintViewModel
{
CantractIdList = res.Where(x => x.PrintCounter >= start && x.PrintCounter <= end)
.Select(x => x.Id).ToList(),
StartPrint = start,
EndPrint = end
};
endOfround = end;
resultList.Add(addToList);
}
}
var count = res.Where(x => x.PrintCounter > endOfround).ToList();
var addLastPart = new GroupPrintViewModel
{
CantractIdList = res.Where(x => x.PrintCounter > endOfround).Select(x => x.Id).ToList(),
StartPrint = count.Select(x => x.PrintCounter).FirstOrDefault(),
EndPrint = count.Select(x => x.PrintCounter).LastOrDefault()
};
resultList.Add(addLastPart);
var finalResult = new ContractDividPrintViewModel
{
GroupPrintViewModel = resultList,
ButtonConter = resultList.Count
};
DividList = finalResult;
}
}
}
}
else if (multiple <= 5)
{
int endOfround = 0;
for (int i = 1; i <= printCounter - 26; i += 20)
{
var start = i;
var end = i + 19;
if (i == 1)
{
GroupPrintList = res.Where(x => x.PrintCounter >= start && x.PrintCounter <= end).ToList();
endOfround = end;
var addToList = new GroupPrintViewModel()
{
CantractIdList = res.Where(x => x.PrintCounter >= start && x.PrintCounter <= end).Select(x => x.Id).ToList(),
StartPrint = start,
EndPrint = end,
};
resultList.Add(addToList);
}
else
{
var addToList = new GroupPrintViewModel()
{
CantractIdList = res.Where(x => x.PrintCounter >= start && x.PrintCounter <= end).Select(x => x.Id).ToList(),
StartPrint = start,
EndPrint = end,
};
endOfround = end;
resultList.Add(addToList);
}
public IActionResult OnGetPrintAll(GroupPrintViewModel sendIds)
{
var res = _contractApplication.PrintAll(sendIds.CantractIdList);
var result = new GroupPrintViewModel
{
ContractList = res
};
return Partial("PrintAll", result);
}
}
private static List<long> ExtractNumbers(string input)
{
var numbers = new List<long>();
var pattern = @"\d+"; // Matches one or more digits
var count = res.Where(x => x.PrintCounter > endOfround).ToList();
var addLastPart = new GroupPrintViewModel()
{
CantractIdList = res.Where(x => x.PrintCounter > endOfround).Select(x => x.Id).ToList(),
StartPrint = count.Select(x => x.PrintCounter).FirstOrDefault(),
EndPrint = count.Select(x => x.PrintCounter).LastOrDefault(),
};
resultList.Add(addLastPart);
var finalResult = new ContractDividPrintViewModel()
{
GroupPrintViewModel = resultList,
ButtonConter = resultList.Count,
};
DividList = finalResult;
}
else if (multiple > 5)
{
int endOfround = 0;
var pcounter = multiple + 1;
for (int i = 1; i <= printCounter - pcounter; i += 20)
{
var start = i;
var end = i + 19;
var matches = Regex.Matches(input, pattern);
if (i == 1)
{
GroupPrintList = res.Where(x => x.PrintCounter >= start && x.PrintCounter <= end).ToList();
foreach (Match match in matches)
if (long.TryParse(match.Value, out var number))
numbers.Add(number);
endOfround = end;
var addToList = new GroupPrintViewModel()
{
CantractIdList = res.Where(x => x.PrintCounter >= start && x.PrintCounter <= end).Select(x => x.Id).ToList(),
StartPrint = start,
EndPrint = end,
};
resultList.Add(addToList);
}
else
{
var addToList = new GroupPrintViewModel()
{
CantractIdList = res.Where(x => x.PrintCounter >= start && x.PrintCounter <= end).Select(x => x.Id).ToList(),
StartPrint = start,
EndPrint = end,
};
endOfround = end;
resultList.Add(addToList);
}
}
var count = res.Where(x => x.PrintCounter > endOfround).ToList();
var addLastPart = new GroupPrintViewModel()
{
CantractIdList = res.Where(x => x.PrintCounter > endOfround).Select(x => x.Id).ToList(),
StartPrint = count.Select(x => x.PrintCounter).FirstOrDefault(),
EndPrint = count.Select(x => x.PrintCounter).LastOrDefault(),
};
resultList.Add(addLastPart);
var finalResult = new ContractDividPrintViewModel()
{
GroupPrintViewModel = resultList,
ButtonConter = resultList.Count,
};
DividList = finalResult;
}
}
}
public IActionResult OnGetPrintAll(GroupPrintViewModel sendIds)
{
var res = _contractApplication.PrintAll(sendIds.CantractIdList);
var result = new GroupPrintViewModel()
{
ContractList = res,
};
return Partial("PrintAll", result);
}
static List<long> ExtractNumbers(string input)
{
List<long> numbers = new List<long>();
string pattern = @"\d+"; // Matches one or more digits
MatchCollection matches = Regex.Matches(input, pattern);
foreach (Match match in matches)
{
if (long.TryParse(match.Value, out long number))
{
numbers.Add(number);
}
}
return numbers;
}
}
}
return numbers;
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -1,8 +1,6 @@
@using _0_Framework.Application
@using System.Security.Cryptography.X509Certificates
@model CompanyManagment.App.Contracts.Contract.EditContract
@model CompanyManagment.App.Contracts.Contract.EditContract
@{
<style>
<style>
.modal .modal-dialog .modal-content {
background-color: white !important;
}
@@ -127,7 +125,7 @@
}
<div class="modal-header" style="border-bottom: unset">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
</div>
<form asp-page="./Index" asp-page-handler="Details"
@@ -136,347 +134,363 @@
data-callback=""
data-action="Refresh"
enctype="multipart/form-data">
<div class="modal-body print" id="printThis" >
<div class="row">
<div class="col-md-12">
<fieldset style="border: 1px solid black;
<div class="modal-body print" id="printThis">
<div class="row">
<div class="col-md-12">
<fieldset style="border: 1px solid black;
padding: revert;
border-radius: 10px;
height: 28cm;
margin: 3mm 5mm 0 5mm; ">
<div class="row" dir="rtl">
<div class="col-xs-4 d-inline-block"><fieldset style="border: 1px solid black; border-radius: 10px; padding: 5px; margin-top: 5px; width: 180px">شماره قرارداد :<span>&nbsp;</span> @Model.ContractNo</fieldset></div>
<div class="col-xs-4 d-inline-block text-center"><h4>قرارداد کار</h4></div>
<div class="col-xs-4 d-inline-block"></div>
</div>
<div class="row text-center">
<h5>این قرارداد به موجب ماده 10 قانون کار جمهوری اسلامی ایران بین کارفرما و کارگر منعقد می گردد</h5>
</div>
<div class="row m-t-5">
<fieldset class="head" style="background-color: #ccc; border: 1px solid black; border-radius: 10px 10px 0px 0px; padding: 3px; margin: 4px 10px 0px 10px;"><h6 style="padding-right: 5px;">مشخصات کارفرما</h6></fieldset>
<fieldset style="border: 1px solid black; border-top: 0px; border-radius: 0px 0px 10px 10px; padding: 3px; margin: 0px 10px;">
<div class="row" style="padding: 4px;">
<div class="col-xs-2 fontBold">آقای/خانم/شرکت :</div>
<div class="col-xs-10">
<div class="row">
@foreach (var Employer in @Model.Employers)
{
if (Employer.NationalId == "*" || Employer.RegisterId == "*")
{
<div class="col-xs-4">@Employer.FullName</div>
<div class="col-xs-4"><span class="fontBold">کـــــد مـــلی</span> : <span class="fontNumber"> @Employer.Nationalcode</span></div>
<div class="col-xs-4">
<span class="fontBold">شماره شناسنامه </span> : <span class="fontNumber">
@Employer.IdNumber
</span>
</div>
<div class="row" dir="rtl">
<div class="col-xs-4 d-inline-block">
<fieldset style="border: 1px solid black; border-radius: 10px; padding: 5px; margin-top: 5px; width: 180px">شماره قرارداد :<span>&nbsp;</span> @Model.ContractNo</fieldset>
</div>
<div class="col-xs-4 d-inline-block text-center">
<h4>قرارداد کار</h4>
</div>
<div class="col-xs-4 d-inline-block"></div>
</div>
<div class="row text-center">
<h5>این قرارداد به موجب ماده 10 قانون کار جمهوری اسلامی ایران بین کارفرما و کارگر منعقد می گردد</h5>
</div>
<div class="row m-t-5">
<fieldset class="head" style="background-color: #ccc; border: 1px solid black; border-radius: 10px 10px 0px 0px; padding: 3px; margin: 4px 10px 0px 10px;">
<h6 style="padding-right: 5px;">مشخصات کارفرما</h6>
</fieldset>
<fieldset style="border: 1px solid black; border-top: 0px; border-radius: 0px 0px 10px 10px; padding: 3px; margin: 0px 10px;">
<div class="row" style="padding: 4px;">
<div class="col-xs-2 fontBold">آقای/خانم/شرکت :</div>
<div class="col-xs-10">
<div class="row">
}
else
{
<div class="col-xs-4">@Employer.FullName </div>
<div class="col-xs-4 "><span class="fontBold">شناسه ملی </span> : <span class="fontNumber">@Employer.NationalId</span></div>
<div class="col-xs-4"><span class="fontBold">شماره ثـــــــــبــت </span> : <span class="fontNumber">@Employer.RegisterId</span></div>
}
}
</div>
@foreach (var Employer in Model.Employers)
{
if (Employer.NationalId == "*" || Employer.RegisterId == "*")
{
<div class="col-xs-4">@Employer.FullName</div>
<div class="col-xs-4"><span class="fontBold">کـــــد مـــلی</span> : <span class="fontNumber"> @Employer.Nationalcode</span></div>
<div class="col-xs-4">
<span class="fontBold">شماره شناسنامه </span> :
<span class="fontNumber">
@Employer.IdNumber
</span>
</div>
}
else
{
<div class="col-xs-4">@Employer.FullName </div>
<div class="col-xs-4 "><span class="fontBold">شناسه ملی </span> : <span class="fontNumber">@Employer.NationalId</span></div>
<div class="col-xs-4"><span class="fontBold">شماره ثـــــــــبــت </span> : <span class="fontNumber">@Employer.RegisterId</span></div>
}
}
</div>
</div>
</div>
<div class="row" style="padding: 4px">
</div>
@foreach (var item in @Model.Workshops)
{
<div class="col-xs-6"><span class="fontBold">نــــــام کـــــــارگـــاه</span> : <span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span> <span>@item.WorkshopName</span> </div>
<div class="col-xs-2"></div>
<div class="col-xs-4">
<span class="fontBold" style="margin-right: 41px;">کــــد کـــارگـاهـی</span> : <span>&nbsp;</span>
<span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>@item.InsuranceCode</span>
</div>
}
</div>
</div>
<div class="row" style="padding: 4px">
<div class="row" style="padding: 4px">
@foreach (var item in @Model.Workshops)
{
<div class="col-xs-3" style="width: 124px"><span class="fontBold">بــــــه نــــــشـــانـی</span> : </div>
<div class="col-xs-9"><span>@item.Address</span></div>
}
@foreach (var item in Model.Workshops)
{
<div class="col-xs-6"><span class="fontBold">نــــــام کـــــــارگـــاه</span> : <span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span> <span>@item.WorkshopName</span> </div>
<div class="col-xs-2"></div>
<div class="col-xs-4">
<span class="fontBold" style="margin-right: 41px;">کــــد کـــارگـاهـی</span> : <span>&nbsp;</span>
<span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>@item.InsuranceCode</span>
</div>
}
</div>
</fieldset>
</div>
<div class="row m-t-5">
<fieldset class="head" style="background-color: #ccc; border: 1px solid black; border-radius: 10px 10px 0px 0px; padding: 3px; margin: 4px 10px 0px 10px;"><h6 style="padding-right: 5px;">مشخصات پرسنل</h6></fieldset>
<fieldset style="border: 1px solid black; border-top: 0px; border-radius: 0px 0px 10px 10px; padding: 3px; margin: 0px 10px; height: 3cm">
@foreach (var item in @Model.Employees)
{
<div class="row" style="padding: 4px;">
<div class="col-xs-10">
<div class="row" style="padding: 4px;">
<div class="col-xs-5"><span class="fontBold">آقــا/خــانم</span> : <span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span> <span>@item.EmployeeFullName</span></div>
<div class="col-xs-3"><span class="fontBold"> کد ملی</span> : <span>&nbsp;</span> <span class="fontNumber">@item.NationalCode</span></div>
<div class="col-xs-4"><span class="fontBold">شماره شناسنامه</span> : <span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span> <span class="fontNumber">@item.IdNumber</span></div>
</div>
<div class="row" style="padding: 4px;">
<div class="col-xs-5"><span class="fontBold">تاریخ تولد </span> : <span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span> <span class="fontNumber">@item.DateOfBirth</span></div>
<div class="col-xs-3"><span class="fontBold"> نام پدر </span> : <span>&nbsp;</span> <span>@item.FatherName</span></div>
<div class="col-xs-4"><span class="fontBold">میزان تحصیـلات </span> : <span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span> <span>@item.LevelOfEducation</span></div>
</div>
<div class="row" style="padding: 4px;">
<div class="col-xs-2" style="width: 74px;"><span class="fontBold"> بـه نـشانی </span> : </div>
<div class="col-xs-10"><span>@item.Address</span></div>
</div>
</div>
<div class="col-xs-2">
<span style="width: 2cm; height: 2.5cm; border: 1px solid #999595; border-radius: 7px; position: fixed; left: 65px;">
<h5 style="text-align: center;
</div>
<div class="row" style="padding: 4px">
@foreach (var item in Model.Workshops)
{
<div class="col-xs-3" style="width: 124px"><span class="fontBold">بــــــه نــــــشـــانـی</span> : </div>
<div class="col-xs-9">
<span>@item.Address</span>
</div>
}
</div>
</fieldset>
</div>
<div class="row m-t-5">
<fieldset class="head" style="background-color: #ccc; border: 1px solid black; border-radius: 10px 10px 0px 0px; padding: 3px; margin: 4px 10px 0px 10px;">
<h6 style="padding-right: 5px;">مشخصات پرسنل</h6>
</fieldset>
<fieldset style="border: 1px solid black; border-top: 0px; border-radius: 0px 0px 10px 10px; padding: 3px; margin: 0px 10px; height: 3cm">
@foreach (var item in Model.Employees)
{
<div class="row" style="padding: 4px;">
<div class="col-xs-10">
<div class="row" style="padding: 4px;">
<div class="col-xs-5"><span class="fontBold">آقــا/خــانم</span> : <span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span> <span>@item.EmployeeFullName</span></div>
<div class="col-xs-3"><span class="fontBold"> کد ملی</span> : <span>&nbsp;</span> <span class="fontNumber">@item.NationalCode</span></div>
<div class="col-xs-4"><span class="fontBold">شماره شناسنامه</span> : <span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span> <span class="fontNumber">@item.IdNumber</span></div>
</div>
<div class="row" style="padding: 4px;">
<div class="col-xs-5"><span class="fontBold">تاریخ تولد </span> : <span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span> <span class="fontNumber">@item.DateOfBirth</span></div>
<div class="col-xs-3"><span class="fontBold"> نام پدر </span> : <span>&nbsp;</span> <span>@item.FatherName</span></div>
<div class="col-xs-4"><span class="fontBold">میزان تحصیـلات </span> : <span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span> <span>@item.LevelOfEducation</span></div>
</div>
<div class="row" style="padding: 4px;">
<div class="col-xs-2" style="width: 74px;"><span class="fontBold"> بـه نـشانی </span> : </div>
<div class="col-xs-10">
<span>@item.Address</span>
</div>
</div>
</div>
<div class="col-xs-2">
<span style="width: 2cm; height: 2.5cm; border: 1px solid #999595; border-radius: 7px; position: fixed; left: 65px;">
<h5 style="text-align: center;
margin-top: 20px !important;
color: #a5a9a9 !important;
line-height: 1.5;">
عکس<br /> پرسنل
</h5>
</span>
</div>
عکس<br/> پرسنل
</h5>
</span>
</div>
</div>
</div>
}
</fieldset>
</div>
<div class="row m-t-5">
<fieldset class="head" style="background-color: #ccc; border: 1px solid black; border-radius: 10px 10px 0px 0px; padding: 3px; margin: 4px 10px 0px 10px;">
<h6 style="padding-right: 5px;">مدت و نوع قرارداد </h6>
</fieldset>
<fieldset style="border: 1px solid black; border-top: 0px; border-radius: 0px 0px 10px 10px; padding: 3px; margin: 0px 10px;">
<div class="row" style="padding: 4px;">
<div class="col-xs-4">
<span class="fontBold"> نوع قرارداد </span> : <span>&nbsp;</span><span>&nbsp;</span>
<span class="radio-info">
@if (Model.ContractType == "دائم")
{
<input style="vertical-align: sub;" type="radio" id="inlineRadio3" name="a" checked="checked">
<label for="inlineRadio3"> دائم </label>
}
else
{
<input style="vertical-align: sub;" type="radio" id="inlineRadio3" name="a">
<label for="inlineRadio3"> دائم </label>
}
</span><span>&nbsp;</span><span>&nbsp;</span>
<span class="radio-info">
@if (Model.ContractType == "موقت")
{
<input style="vertical-align: sub;" type="radio" id="inlineRadio3" name="a" checked="checked">
<label for="inlineRadio3"> موقت </label>
}
else
{
<input style="vertical-align: sub;" type="radio" id="inlineRadio3" name="a">
<label for="inlineRadio3"> موقت </label>
}
}
</fieldset>
</div>
<div class="row m-t-5">
<fieldset class="head" style="background-color: #ccc; border: 1px solid black; border-radius: 10px 10px 0px 0px; padding: 3px; margin: 4px 10px 0px 10px;"><h6 style="padding-right: 5px;">مدت و نوع قرارداد </h6></fieldset>
<fieldset style="border: 1px solid black; border-top: 0px; border-radius: 0px 0px 10px 10px; padding: 3px; margin: 0px 10px;">
<div class="row" style="padding: 4px;">
<div class="col-xs-4">
<span class="fontBold"> نوع قرارداد </span> : <span>&nbsp;</span><span>&nbsp;</span>
</span><span>&nbsp;</span><span>&nbsp;</span>
<span class="radio-info">
@if (Model.ContractType == "معین")
{
<input style="vertical-align: sub;" type="radio" id="inlineRadio3" name="a" checked="checked">
<label for="inlineRadio3"> معین </label>
}
else
{
<input style="vertical-align: sub;" type="radio" id="inlineRadio3" name="a">
<label for="inlineRadio3"> معین </label>
}
<span class="radio-info">
@if (@Model.ContractType == "دائم")
{
<input style="vertical-align: sub;" type="radio" id="inlineRadio3" name="a" checked="checked">
<label for="inlineRadio3"> دائم </label>
}
else
{
<input style="vertical-align: sub;" type="radio" id="inlineRadio3" name="a">
<label for="inlineRadio3"> دائم </label>
}
</span>
</span><span>&nbsp;</span><span>&nbsp;</span>
<span class="radio-info">
@if (@Model.ContractType == "موقت")
{
<input style="vertical-align: sub;" type="radio" id="inlineRadio3" name="a" checked="checked">
<label for="inlineRadio3"> موقت </label>
}
else
{
<input style="vertical-align: sub;" type="radio" id="inlineRadio3" name="a">
<label for="inlineRadio3"> موقت </label>
}
</div>
<div class="col-xs-8" style="margin-top: 3px;">
<span class="fontBold">نوع کار یا حرفه یا حجم کار یا وظیفه ای که کارگر به آن اشتغال می یابد</span> :
<span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span>
<span>@Model.JobType</span>
</div>
</div>
<div class="row" style="padding: 4px;">
<div class="col-xs-4">
<span class="fontBold">تاریخ انعقاد قرارداد</span> :
<span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span>
<span class="fontNumber">@Model.SetContractDate</span>
</div>
</span><span>&nbsp;</span><span>&nbsp;</span>
<span class="radio-info">
@if (@Model.ContractType == "معین")
{
<input style="vertical-align: sub;" type="radio" id="inlineRadio3" name="a" checked="checked">
<label for="inlineRadio3"> معین </label>
}
else
{
<input style="vertical-align: sub;" type="radio" id="inlineRadio3" name="a">
<label for="inlineRadio3"> معین </label>
}
</div>
<div class="row" style="padding: 4px;">
<div class="col-xs-8">
<span class="fontBold">مـــدت قـــــــــــرارداد</span> :
<span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span>
<span class="fontNumber">@Model.ContarctStart</span><span>&nbsp;</span><span>&nbsp;</span>
<span>الی</span><span>&nbsp;</span><span>&nbsp;</span>
<span class="fontNumber">@Model.ContractEnd</span><span>&nbsp;</span><span>&nbsp;</span>
</div>
</span>
</div>
<div class="row" style="padding: 4px;">
<div class="col-xs-4">
<span class="fontBold">ساعت کار در هفته</span> :
<span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span>
<span class="fontNumber">@Model.WorkingHoursWeekly</span>
</div>
</div>
</div>
<div class="col-xs-8" style="margin-top: 3px;">
<span class="fontBold">نوع کار یا حرفه یا حجم کار یا وظیفه ای که کارگر به آن اشتغال می یابد</span> :
<span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span>
<span>@Model.JobType</span>
</div>
</div>
<div class="row" style="padding: 4px;">
<div class="col-xs-4">
<span class="fontBold">تاریخ انعقاد قرارداد</span> :
<span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span>
<span class="fontNumber">@Model.SetContractDate</span>
</div>
<div class="row" style="padding: 4px;padding-right: 15px">
<span class="fontBold">
@if (Model.WorkshopAddress2 != null)
{
<span>محـل انــجـام کـار 1</span>
}
else
{
<span>محـل انــــجـام کـــار </span>
}
</span> : <span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span>
<span>@Model.WorkshopAddress1</span>
</div>
<div class="row" style="padding: 4px;">
<div class="col-xs-8">
<span class="fontBold">مـــدت قـــــــــــرارداد</span> :
<span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span>
<span class="fontNumber">@Model.ContarctStart</span><span>&nbsp;</span><span>&nbsp;</span>
<span>الی</span><span>&nbsp;</span><span>&nbsp;</span>
<span class="fontNumber">@Model.ContractEnd</span><span>&nbsp;</span><span>&nbsp;</span>
</div>
</div>
@if (Model.WorkshopAddress2 != null)
{
<div class="row" style="padding: 4px; padding-right: 15px">
<span class="fontBold">محـل انــجـام کـار 2</span> : <span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span>
<span>@Model.WorkshopAddress2</span>
</div>
<div class="row" style="padding: 4px;">
<div class="col-xs-4">
<span class="fontBold">ساعت کار در هفته</span> :
<span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span>
<span class="fontNumber">@Model.WorkingHoursWeekly</span>
</div>
</div>
}
</div>
</fieldset>
</div>
<div class="row m-t-5">
<fieldset class="head" style="background-color: #ccc; border: 1px solid black; border-radius: 10px 10px 0px 0px; padding: 3px; margin: 4px 10px 0px 10px;">
<h6 style="padding-right: 5px;">حق السعی </h6>
</fieldset>
<fieldset style="border: 1px solid black; border-top: 0px; border-radius: 0px 0px 10px 10px; padding: 3px; margin: 0px 10px;">
<div class="row" style="padding: 7px;">
<div class="col-xs-3">
<span class="fontBold"> مزد روزانه : </span>
<div class="row" style="padding: 4px;padding-right: 15px">
<span class="fontBold">
@if (@Model.WorkshopAddress2 != null)
{<span>محـل انــجـام کـار 1</span>}
else
{<span>محـل انــــجـام کـــار </span>}
</span> : <span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span>
<span>@Model.WorkshopAddress1</span>
</div>
@if (@Model.WorkshopAddress2 != null)
{
<div class="row" style="padding: 4px; padding-right: 15px">
<span class="fontBold">محـل انــجـام کـار 2</span> : <span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span>
<span>@Model.WorkshopAddress2</span>
</div>
}
</fieldset>
</div>
<div class="row m-t-5">
<fieldset class="head" style="background-color: #ccc; border: 1px solid black; border-radius: 10px 10px 0px 0px; padding: 3px; margin: 4px 10px 0px 10px;"><h6 style="padding-right: 5px;">حق السعی </h6></fieldset>
<fieldset style="border: 1px solid black; border-top: 0px; border-radius: 0px 0px 10px 10px; padding: 3px; margin: 0px 10px;">
<div class="row" style="padding: 7px;">
<div class="col-xs-3">
<span class="fontBold"> مزد روزانه : </span>
</div>
<div class="col-xs-3">
<span>@Model.DayliWage</span><span>&nbsp;</span><span>ریال</span>
</div>
<div class="col-xs-2">
<span class="fontBold"> حق عائله مندی : </span>
</div>
<div class="col-xs-3">
<span>@Model.DayliWage</span><span>&nbsp;</span><span>ریال</span>
</div>
<div class="col-xs-2">
<span class="fontBold"> حق عائله مندی : </span>
</div>
<div class="col-xs-4">
@if (Model.FamilyAllowance != "0")
{
<span>@Model.FamilyAllowance</span>
<span>&nbsp;</span>
<span>ریال</span>
}
</div>
</div>
<div class="row" style="padding: 7px;">
<div class="col-xs-3">
<span class="fontBold"> کمک هزینه اقلام مصرفی خواربار : </span>
</div>
<div class="col-xs-4">
@if (@Model.FamilyAllowance != "0")
{
<span>@Model.FamilyAllowance</span><span>&nbsp;</span><span>ریال</span>
}
</div>
</div>
<div class="row" style="padding: 7px;">
<div class="col-xs-3">
<span class="fontBold"> کمک هزینه اقلام مصرفی خواربار : </span>
</div>
<div class="col-xs-9">
<span>@Model.ConsumableItems</span><span>&nbsp;</span><span>ریال</span>
</div>
</div>
<div class="row" style="padding: 7px;">
<div class="col-xs-3">
<span class="fontBold"> کمک هزینه مسکن : </span>
</div>
<div class="col-xs-9">
<span>@Model.ConsumableItems</span><span>&nbsp;</span><span>ریال</span>
</div>
</div>
<div class="row" style="padding: 7px;">
<div class="col-xs-3">
<span class="fontBold"> کمک هزینه مسکن : </span>
</div>
<div class="col-xs-9">
<span>@Model.HousingAllowance</span><span>&nbsp;</span><span>ریال</span>
</div>
</div>
</div>
<div class="col-xs-9">
<span>@Model.HousingAllowance</span><span>&nbsp;</span><span>ریال</span>
</div>
</div>
</fieldset>
</div>
<div class="row m-t-5">
<fieldset class="head" style="background-color: #ccc; border: 1px solid black; border-radius: 10px 10px 0px 0px; padding: 3px; margin: 4px 10px 0px 10px;">
<h6 style="padding-right: 5px;"> شروط و توضیحات </h6>
</fieldset>
<fieldset style="border: 1px solid black; border-top: 0px; border-radius: 0px 0px 10px 10px; padding: 3px; margin: 0px 10px;">
</fieldset>
</div>
<div class="row m-t-5">
<fieldset class="head" style="background-color: #ccc; border: 1px solid black; border-radius: 10px 10px 0px 0px; padding: 3px; margin: 4px 10px 0px 10px;"><h6 style="padding-right: 5px;"> شروط و توضیحات </h6></fieldset>
<fieldset style="border: 1px solid black; border-top: 0px; border-radius: 0px 0px 10px 10px; padding: 3px; margin: 0px 10px;">
<textarea class="form-control"></textarea>
<textarea class="form-control"></textarea>
</fieldset>
</div>
<div class="row m-t-5" style="padding: 10px;">
<p>بیمه : به موجب ماده 148 قانون کار، کارفرما مکلف است کارگر را نزد سازمان تامین اجتماعی بیمه نماید.</p>
<p>یک نسخه از این قرارداد در ید کارگر می باشد و هر یک از نسخه های قرارداد، اعتبار و حکم واحد دارند.</p>
<p style="text-align: justify">
مبلغ مزد روزانه در این قرارداد بر اساس قوانین کار می باشد و هیچگونه ارتباطی با تنظیم و ارسال لیست بیمه سازمان تامین اجتماعی ندارد. سازمان تامین اجتماعی
بر اساس بخشنامه های درون سازمانی مقادیری را برای ارسال لیست بیمه در اختیار کارفرما قرار میدهد (لیست مشاغل مقطوع) که خارج از قوانین کار می باشد.
</p>
</div>
<div class="row m-t-5" style="padding: 10px;">
<div class="col-xs-6 text-center">
<h5>مهر/امضاء/اثر انگشت کارفرما</h5>
</div>
<div class="col-xs-6 text-center">
<h5>امضاء/اثر انگشت کارگر</h5>
</div>
</div>
</fieldset>
</div>
</fieldset>
</div>
<div class="row m-t-5" style="padding: 10px;">
<p>بیمه : به موجب ماده 148 قانون کار، کارفرما مکلف است کارگر را نزد سازمان تامین اجتماعی بیمه نماید.</p>
<p>یک نسخه از این قرارداد در ید کارگر می باشد و هر یک از نسخه های قرارداد، اعتبار و حکم واحد دارند.</p>
<p style="text-align: justify">
مبلغ مزد روزانه در این قرارداد بر اساس قوانین کار می باشد و هیچگونه ارتباطی با تنظیم و ارسال لیست بیمه سازمان تامین اجتماعی ندارد. سازمان تامین اجتماعی
بر اساس بخشنامه های درون سازمانی مقادیری را برای ارسال لیست بیمه در اختیار کارفرما قرار میدهد (لیست مشاغل مقطوع) که خارج از قوانین کار می باشد.
</p>
</div>
<div class="row m-t-5" style="padding: 10px;">
<div class="col-xs-6 text-center"><h5>مهر/امضاء/اثر انگشت کارفرما</h5></div>
<div class="col-xs-6 text-center"><h5>امضاء/اثر انگشت کارگر</h5></div>
</div>
</div>
</div>
<input type="hidden" asp-for="Id" value="@Model.Id"/>
</fieldset>
</div>
<div class="modal-footer" style="border-top: unset; padding: 1px 15px 10px;">
</div>
</div>
<input type="hidden" asp-for="Id" value="@Model.Id" />
<div class="modal-footer" style="border-top: unset; padding: 1px 15px 10px;">
<button id="btnPrint" type="button" class="btn btn-success btn-rounded waves-effect waves-light">پرینت قرارداد </button>
<button type="button" class="btn btn-warning btn-rounded waves-effect waves-light m-b-10" data-dismiss="modal">بستن فرم</button>
</div>
<button id="btnPrint" type="button" class="btn btn-success btn-rounded waves-effect waves-light">پرینت قرارداد </button>
<button type="button" class="btn btn-warning btn-rounded waves-effect waves-light m-b-10" data-dismiss="modal">بستن فرم</button>
</div>
</form>
<script>
document.getElementById("btnPrint").onclick = function () {
printElement(document.getElementById("printThis"));
}
document.getElementById("btnPrint").onclick = function() {
printElement(document.getElementById("printThis"));
};
function printElement(elem) {
var domClone = elem.cloneNode(true);
function printElement(elem) {
const domClone = elem.cloneNode(true);
var $printSection = document.getElementById("printSection");
var $printSection = document.getElementById("printSection");
if (!$printSection) {
$printSection = document.createElement("div");
$printSection.id = "printSection";
document.body.appendChild($printSection);
}
if (!$printSection) {
$printSection = document.createElement("div");
$printSection.id = "printSection";
document.body.appendChild($printSection);
}
$printSection.innerHTML = "";
$printSection.appendChild(domClone);
window.print();
}
$printSection.innerHTML = "";
$printSection.appendChild(domClone);
window.print();
}
</script>

File diff suppressed because it is too large Load Diff

View File

@@ -4,150 +4,145 @@
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<form asp-page="./Index" asp-page-handler="EditLeftWork" autocomplete="off"
method="post"
data-ajax="true"
data-callback=""
data-action="ReloadLeftWork">
<div class="modal-body">
<div class="row">
<form asp-page="./Index" asp-page-handler="EditLeftWork" autocomplete="off"
method="post"
data-ajax="true"
data-callback=""
data-action="ReloadLeftWork">
<div class="modal-body">
<div class="row">
<fieldset style="border: 1px solid #999797; height: 120px; border-radius: 10px; padding: revert">
<legend style="margin-bottom: 5px; font-size: large; border-bottom: 0px; color: #505458; width: 140px;text-align: center;">ویرایش </legend>
<fieldset style="border: 1px solid #999797; height: 120px; border-radius: 10px; padding: revert">
<legend style="margin-bottom: 5px; font-size: large; border-bottom: 0px; color: #505458; width: 140px;text-align: center;">ویرایش </legend>
<div class="row">
<div class="col-md-6">
<div class="form-group m-b-0" dir="rtl">
<label asp-for="StartWorkDate" class="control-label m-r-5">تاریخ شروع به کار</label>
<input id="endDate" dir="ltr" maxlength="10" style="text-align: center" class="form-control persianDateInputb" onchange="validDate(this);" asp-for="StartWorkDate" />
<div class="row">
<div class="col-md-6">
<div class="form-group m-b-0" dir="rtl">
<label asp-for="StartWorkDate" class="control-label m-r-5">تاریخ شروع به کار</label>
<input id="endDate" dir="ltr" maxlength="10" style="text-align: center" class="form-control persianDateInputb" onchange="validDate(this);" asp-for="StartWorkDate"/>
<span asp-validation-for="StartWorkDate" class="error"></span>
<span asp-validation-for="StartWorkDate" class="error"></span>
</div>
</div>
</div>
</div>
<div class="col-md-6">
<div class="form-group m-b-0" dir="rtl">
<label asp-for="LeftWorkDate" class="control-label m-r-5">تاریخ ترک کار</label>
<input id="endDate" dir="ltr" maxlength="10" style="text-align: center" class="form-control persianDateInputb" onchange="validDate(this);" asp-for="LeftWorkDate" />
<div class="col-md-6">
<div class="form-group m-b-0" dir="rtl">
<label asp-for="LeftWorkDate" class="control-label m-r-5">تاریخ ترک کار</label>
<input id="endDate" dir="ltr" maxlength="10" style="text-align: center" class="form-control persianDateInputb" onchange="validDate(this);" asp-for="LeftWorkDate"/>
<span asp-validation-for="LeftWorkDate" class="error"></span>
<span asp-validation-for="LeftWorkDate" class="error"></span>
</div>
</div>
</div>
</div>
</div>
</div>
</fieldset>
</fieldset>
</div>
</div>
<input type="hidden" asp-for="Id" value="@Model.Id"/>
<input type="hidden" asp-for="EmployeeId"/>
<input type="hidden" asp-for="WorkshopId"/>
<input type="hidden" asp-for="WorkshopName"/>
<input type="hidden" asp-for="EmployeeFullName"/>
<div class="modal-footer">
</div>
<button type="submit" class="btn btn-success btn-rounded waves-effect waves-light">ذخیره</button>
<a href="#showmodal=@Url.Page("/Company/Contracts/Index", "CreateLeftWork", new { employeeId = Model.EmployeeId, workshopId = Model.WorkshopId, hd = 1 })" class="btn btn-default btn-rounded waves-effect waves-light m-b-5"> بازگشت</a>
</div>
</div>
<input type="hidden" asp-for="Id" value="@Model.Id" />
<input type="hidden" asp-for="EmployeeId" />
<input type="hidden" asp-for="WorkshopId" />
<input type="hidden" asp-for="WorkshopName" />
<input type="hidden" asp-for="EmployeeFullName" />
<div class="modal-footer">
<button type="submit" class="btn btn-success btn-rounded waves-effect waves-light">ذخیره</button>
<a href="#showmodal=@Url.Page("/Company/Contracts/Index", "CreateLeftWork", new { employeeId = @Model.EmployeeId, workshopId = @Model.WorkshopId, hd = 1 })" class="btn btn-default btn-rounded waves-effect waves-light m-b-5"> بازگشت</a>
</div>
</form>
</form>
</div>
<script>
function validDate(inputField) {
function validDate(inputField) {
var persianNumbers = [/۰/g, /۱/g, /۲/g, /۳/g, /۴/g, /۵/g, /۶/g, /۷/g, /۸/g, /۹/g],
arabicNumbers = [/٠/g, /١/g, /٢/g, /٣/g, /٤/g, /٥/g, /٦/g, /٧/g, /٨/g, /٩/g],
fixNumbers = function (str) {
if (typeof str === 'string') {
for (var i = 0; i < 10; i++) {
str = str.replace(persianNumbers[i], i).replace(arabicNumbers[i], i);
}
}
return str;
};
let getdate = inputField.value;
var persianNumbers = [/۰/g, /۱/g, /۲/g, /۳/g, /۴/g, /۵/g, /۶/g, /۷/g, /۸/g, /۹/g],
arabicNumbers = [/٠/g, /١/g, /٢/g, /٣/g, /٤/g, /٥/g, /٦/g, /٧/g, /٨/g, /٩/g],
fixNumbers = function(str) {
if (typeof str === 'string') {
for (let i = 0; i < 10; i++) {
str = str.replace(persianNumbers[i], i).replace(arabicNumbers[i], i);
}
}
return str;
};
let getdate = inputField.value;
var m1, m2;
var y1, y2, y3, y4;
var d1, d2;
var s1, s2;
for (var i = 0; i < getdate.length; i++) {
if (i === 0) {
y1 = fixNumbers(getdate[i]);
}
if (i === 1) {
y2 = fixNumbers(getdate[i]);
}
if (i === 2) {
y3 = fixNumbers(getdate[i]);
}
if (i === 3) {
y4 = fixNumbers(getdate[i]);
}
if (i === 4) {
s1 = fixNumbers(getdate[i]);
}
if (i === 5) {
m1 = fixNumbers(getdate[i]);
}
if (i === 6) {
m2 = fixNumbers(getdate[i]);
}
if (i === 7) {
s2 = fixNumbers(getdate[i]);
}
if (i === 8) {
d1 = fixNumbers(getdate[i]);
}
if (i === 9) {
d2 = fixNumbers(getdate[i]);
}
var m1, m2;
var y1, y2, y3, y4;
var d1, d2;
var s1, s2;
for (var i = 0; i < getdate.length; i++) {
if (i === 0) {
y1 = fixNumbers(getdate[i]);
}
if (i === 1) {
y2 = fixNumbers(getdate[i]);
}
if (i === 2) {
y3 = fixNumbers(getdate[i]);
}
if (i === 3) {
y4 = fixNumbers(getdate[i]);
}
if (i === 4) {
s1 = fixNumbers(getdate[i]);
}
if (i === 5) {
m1 = fixNumbers(getdate[i]);
}
if (i === 6) {
m2 = fixNumbers(getdate[i]);
}
if (i === 7) {
s2 = fixNumbers(getdate[i]);
}
if (i === 8) {
d1 = fixNumbers(getdate[i]);
}
if (i === 9) {
d2 = fixNumbers(getdate[i]);
}
}
var yRes = y1 + y2 + y3 + y4;
var year = parseInt(yRes);
var mRes = m1 + m2;
var month = parseInt(mRes);
var dRes = d1 + d2;
var day = parseInt(dRes);
var FixResult = yRes + s1 + mRes + s2 + dRes;
}
var yRes = y1 + y2 + y3 + y4;
var year = parseInt(yRes);
var mRes = m1 + m2;
var month = parseInt(mRes);
var dRes = d1 + d2;
var day = parseInt(dRes);
var FixResult = yRes + s1 + mRes + s2 + dRes;
var isValid = /^([1][3-4][0-9][0-9][/])([0][1-9]|[1][0-2])([/])([0][1-9]|[1-2][0-9]|[3][0-1])$/.test(FixResult);
var isValid = /^([1][3-4][0-9][0-9][/])([0][1-9]|[1][0-2])([/])([0][1-9]|[1-2][0-9]|[3][0-1])$/.test(FixResult);
if (isValid) {
inputField.style.backgroundColor = '#a6e9a6';
$("button[type=submit]").attr('disabled', false);
validCheck = true;
if (isValid) {
inputField.style.backgroundColor = '#a6e9a6';
$("button[type=submit]").attr('disabled', false);
validCheck = true;
} else {
inputField.style.backgroundColor = '#f94c4c';
$.Notification.autoHideNotify('error', 'top center', 'پیام سیستم ', "لطفا تاریخ را بصورت صحیح وارد کنید");
$("button[type=submit]").attr('disabled', true)
validCheck = false;
} else {
inputField.style.backgroundColor = '#f94c4c';
$.Notification.autoHideNotify('error', 'top center', 'پیام سیستم ', "لطفا تاریخ را بصورت صحیح وارد کنید");
$("button[type=submit]").attr('disabled', true);
validCheck = false;
}
return validCheck;
}
return validCheck;
}
}
</script>

View File

@@ -1,7 +1,7 @@
@model CompanyManagment.App.Contracts.Leave.EditLeave
@{
<style>
<style>
.panel-title {
font-size: 14px;
text-transform: uppercase;
@@ -81,430 +81,432 @@
</style>
}
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<form asp-page="./Index" asp-page-handler="EditSickLeave" autocomplete="off"
method="post"
data-ajax="true"
data-callback=""
data-action="ReloadSickLeave">
<div class="modal-body">
<div class="row">
<form asp-page="./Index" asp-page-handler="EditSickLeave" autocomplete="off"
method="post"
data-ajax="true"
data-callback=""
data-action="ReloadSickLeave">
<div class="modal-body">
<div class="row">
<fieldset style="border: 1px solid #999797; border-radius: 10px; padding: revert">
<legend style="margin-bottom: 5px; font-size: large; border-bottom: 0px; color: #505458; width: 180px; text-align: center;"> ویرایش تاریخ مرخصی </legend>
<fieldset style="border: 1px solid #999797; border-radius: 10px; padding: revert">
<legend style="margin-bottom: 5px; font-size: large; border-bottom: 0px; color: #505458; width: 180px; text-align: center;"> ویرایش تاریخ مرخصی </legend>
<div class="row m-t-10">
<div class="col-md-6">
<div class="form-group m-b-0" dir="rtl">
<label asp-for="StartLeave" class="control-label m-r-5">تاریخ شروع مرخصی</label>
<input id="startLeave" dir="ltr" maxlength="10" style="text-align: center" class="form-control persianDateInputb date" asp-for="StartLeave" />
<div class="row m-t-10">
<div class="col-md-6">
<div class="form-group m-b-0" dir="rtl">
<label asp-for="StartLeave" class="control-label m-r-5">تاریخ شروع مرخصی</label>
<input id="startLeave" dir="ltr" maxlength="10" style="text-align: center" class="form-control persianDateInputb date" asp-for="StartLeave"/>
<span asp-validation-for="StartLeave" class="error"></span>
<span asp-validation-for="StartLeave" class="error"></span>
</div>
</div>
<div class="col-md-6">
<div class="form-group m-b-0" dir="rtl">
<label asp-for="EndLeave" class="control-label m-r-5">تاریخ پایان مرخصی</label>
<input id="endLeave" dir="ltr" maxlength="10" style="text-align: center" class="form-control persianDateInputb date" asp-for="EndLeave" />
</div>
</div>
<div class="col-md-6">
<div class="form-group m-b-0" dir="rtl">
<label asp-for="EndLeave" class="control-label m-r-5">تاریخ پایان مرخصی</label>
<input id="endLeave" dir="ltr" maxlength="10" style="text-align: center" class="form-control persianDateInputb date" asp-for="EndLeave"/>
<span asp-validation-for="EndLeave" class="error"></span>
<span asp-validation-for="EndLeave" class="error"></span>
</div>
</div>
</div>
<div class="row m-t-10 sumDaysDiv">
<div class="col-xs-12">
<fieldset style="border: 1px solid #c3c3c3; background-color: #ddd; border-radius: 10px; padding: 5px 0 5px 0; margin-bottom: 10px;">
<div style="padding: 4px;">
<span style="padding: 3px;">
مدت مرخصی
</span>
</div>
</div>
</div>
<span class="sumDays" style="padding: 3px;">
<div class="row m-t-10 sumDaysDiv">
<div class="col-xs-12">
<fieldset style="border: 1px solid #c3c3c3; background-color: #ddd; border-radius: 10px; padding: 5px 0 5px 0; margin-bottom: 10px;">
<div style="padding: 4px;">
<span style="padding: 3px;">
مدت مرخصی
</span>
</span>
</div>
</fieldset>
</div>
</div>
<div class="row m-t-10">
<div class="col-xs-12 m-t-10">
<div class="form-group">
<p class="m-r-5">موافقت یا عدم موافقت</p>
<div class="switch-content">
<input type="checkbox" id="IsAccepted" asp-for="IsAccepted" />
<label class="switch" asp-for="IsAccepted">
<span class="slider"></span>
</label>
</div>
</div>
</div>
<span class="sumDays" style="padding: 3px;">
<div class="col-xs-12 m-t-10">
<div class="form-group">
<label class="control-label m-r-5 ">توضیحات در صورت عدم موافقت</label>
<textarea class="form-control" id="descriptionAcceptedCheck" asp-for="Decription"></textarea>
</div>
</div>
</div>
</fieldset>
</div>
</div>
<input type="hidden" asp-for="Id" value="@Model.Id" />
<input type="hidden" asp-for="EmployeeId" />
<input type="hidden" asp-for="WorkshopId" />
<div class="modal-footer">
<a href="#" id="save" class="btn btn-success btn-rounded waves-effect waves-light">ذخیره</a>
<button style="display: none;" type="submit" id="editFinaly"></button>
<a href="#showmodal=@Url.Page("/Company/Contracts/Index", "CreateSickLeave", new { employeeId = @Model.EmployeeId, workshopId = @Model.WorkshopId, hd = 1 })" class="btn btn-default btn-rounded waves-effect waves-light m-b-5"> بازگشت</a>
</div>
</span>
</div>
</fieldset>
</div>
</div>
</form>
<div class="row m-t-10">
<div class="col-xs-12 m-t-10">
<div class="form-group">
<p class="m-r-5">موافقت یا عدم موافقت</p>
<div class="switch-content">
<input type="checkbox" id="IsAccepted" asp-for="IsAccepted"/>
<label class="switch" asp-for="IsAccepted">
<span class="slider"></span>
</label>
</div>
</div>
</div>
<div class="col-xs-12 m-t-10">
<div class="form-group">
<label class="control-label m-r-5 ">توضیحات در صورت عدم موافقت</label>
<textarea class="form-control" id="descriptionAcceptedCheck" asp-for="Decription"></textarea>
</div>
</div>
</div>
</fieldset>
</div>
</div>
<input type="hidden" asp-for="Id" value="@Model.Id"/>
<input type="hidden" asp-for="EmployeeId"/>
<input type="hidden" asp-for="WorkshopId"/>
<div class="modal-footer">
<a href="#" id="save" class="btn btn-success btn-rounded waves-effect waves-light">ذخیره</a>
<button style="display: none;" type="submit" id="editFinaly"></button>
<a href="#showmodal=@Url.Page("/Company/Contracts/Index", "CreateSickLeave", new { employeeId = Model.EmployeeId, workshopId = Model.WorkshopId, hd = 1 })" class="btn btn-default btn-rounded waves-effect waves-light m-b-5"> بازگشت</a>
</div>
</form>
</div>
<script src="~/admintheme/js/jquery.mask_1.14.16.min.js"></script>
<script>
$(document).ready(function () {
var IsAcceptedCheck = $('#IsAccepted').is(':checked');
if (IsAcceptedCheck) {
$('#descriptionAcceptedCheck').removeClass('errored');
$('#descriptionAcceptedCheck').addClass('disable-input');
$("#descriptionAcceptedCheck").prop('disabled', true);
} else {
$('#descriptionAcceptedCheck').removeClass('disable-input');
$("#descriptionAcceptedCheck").prop('disabled', false);
}
});
$(document).ready(function() {
const IsAcceptedCheck = $('#IsAccepted').is(':checked');
if (IsAcceptedCheck) {
$('#descriptionAcceptedCheck').removeClass('errored');
$('#descriptionAcceptedCheck').addClass('disable-input');
$("#descriptionAcceptedCheck").prop('disabled', true);
} else {
$('#descriptionAcceptedCheck').removeClass('disable-input');
$("#descriptionAcceptedCheck").prop('disabled', false);
}
});
$('#save').on('click', function () {
$("#descriptionAcceptedCheck").on("change", function () {
$('#descriptionAcceptedCheck').removeClass('errored');
});
$('#save').on('click',
function() {
$("#descriptionAcceptedCheck").on("change",
function() {
$('#descriptionAcceptedCheck').removeClass('errored');
});
var IsAcceptedCheck = $('#IsAccepted').is(':checked');
var descriptionAcceptedCheck = $('#descriptionAcceptedCheck').val();
if (!IsAcceptedCheck && descriptionAcceptedCheck.length === 0) {
$('#descriptionAcceptedCheck').addClass('errored');
$.Notification.autoHideNotify('error', 'top center', 'پیام سیستم ', "لطفا توضیحات در صورت عدم موافقت را پر کنید.");
return;
}
const IsAcceptedCheck = $('#IsAccepted').is(':checked');
const descriptionAcceptedCheck = $('#descriptionAcceptedCheck').val();
if (!IsAcceptedCheck && descriptionAcceptedCheck.length === 0) {
$('#descriptionAcceptedCheck').addClass('errored');
$.Notification.autoHideNotify('error', 'top center', 'پیام سیستم ', "لطفا توضیحات در صورت عدم موافقت را پر کنید.");
return;
}
if ($('.errored').length < 1) {
$('#editFinaly').click();
}
});
$(".date").mask("0000/00/00");
$('.date').on('input',
function () {
let startDate = this.value;
if (startDate.length == 10) {
let submitcheck = dateValidcheck(this);
if (submitcheck) {
if ($('.errored').length < 1) {
$('#editFinaly').click();
}
});
$(".date").mask("0000/00/00");
$('.date').on('input',
function() {
const startDate = this.value;
if (startDate.length == 10) {
const submitcheck = dateValidcheck(this);
if (submitcheck) {
$(this).removeClass('errored');
if ($('#startLeave').val() != '' && $('#endLeave').val() != '') {
computeDays();
}
$(this).removeClass('errored');
if ($('#startLeave').val() != '' && $('#endLeave').val() != '') {
computeDays();
}
} else {
$(this).addClass('errored');
} else {
$(this).addClass('errored');
}
}
} else {
$(this).addClass('errored');
}
} else {
$(this).addClass('errored');
}
});
});
function dateValidcheck(inputField1) {
function dateValidcheck(inputField1) {
let persianNumbers = [/۰/g, /۱/g, /۲/g, /۳/g, /۴/g, /۵/g, /۶/g, /۷/g, /۸/g, /۹/g],
arabicNumbers = [/٠/g, /١/g, /٢/g, /٣/g, /٤/g, /٥/g, /٦/g, /٧/g, /٨/g, /٩/g],
fixNumbers = function (str) {
if (typeof str === 'string') {
for (var i = 0; i < 10; i++) {
str = str.replace(persianNumbers[i], i).replace(arabicNumbers[i], i);
}
}
return str;
};
let getdate = inputField1.value;
const persianNumbers = [/۰/g, /۱/g, /۲/g, /۳/g, /۴/g, /۵/g, /۶/g, /۷/g, /۸/g, /۹/g];
const arabicNumbers = [/٠/g, /١/g, /٢/g, /٣/g, /٤/g, /٥/g, /٦/g, /٧/g, /٨/g, /٩/g];
const fixNumbers = function(str) {
if (typeof str === 'string') {
for (let i = 0; i < 10; i++) {
str = str.replace(persianNumbers[i], i).replace(arabicNumbers[i], i);
}
}
return str;
};
const getdate = inputField1.value;
let m1, m2;
let y1, y2, y3, y4;
let d1, d2;
let s1, s2;
for (var i = 0; i < getdate.length; i++) {
if (i === 0) {
y1 = fixNumbers(getdate[i]);
}
if (i === 1) {
y2 = fixNumbers(getdate[i]);
}
if (i === 2) {
y3 = fixNumbers(getdate[i]);
}
if (i === 3) {
y4 = fixNumbers(getdate[i]);
}
if (i === 4) {
s1 = fixNumbers(getdate[i]);
}
if (i === 5) {
m1 = fixNumbers(getdate[i]);
}
if (i === 6) {
m2 = fixNumbers(getdate[i]);
}
if (i === 7) {
s2 = fixNumbers(getdate[i]);
}
if (i === 8) {
d1 = fixNumbers(getdate[i]);
}
if (i === 9) {
d2 = fixNumbers(getdate[i]);
}
let m1, m2;
let y1, y2, y3, y4;
let d1, d2;
let s1, s2;
for (let i = 0; i < getdate.length; i++) {
if (i === 0) {
y1 = fixNumbers(getdate[i]);
}
if (i === 1) {
y2 = fixNumbers(getdate[i]);
}
if (i === 2) {
y3 = fixNumbers(getdate[i]);
}
if (i === 3) {
y4 = fixNumbers(getdate[i]);
}
if (i === 4) {
s1 = fixNumbers(getdate[i]);
}
if (i === 5) {
m1 = fixNumbers(getdate[i]);
}
if (i === 6) {
m2 = fixNumbers(getdate[i]);
}
if (i === 7) {
s2 = fixNumbers(getdate[i]);
}
if (i === 8) {
d1 = fixNumbers(getdate[i]);
}
if (i === 9) {
d2 = fixNumbers(getdate[i]);
}
}
let yRes = y1 + y2 + y3 + y4;
let year = parseInt(yRes);
let mRes = m1 + m2;
let month = parseInt(mRes);
let dRes = d1 + d2;
let day = parseInt(dRes);
let fixResult = yRes + s1 + mRes + s2 + dRes;
let test1 = checkEnValid(inputField1.value);
}
const yRes = y1 + y2 + y3 + y4;
const year = parseInt(yRes);
const mRes = m1 + m2;
const month = parseInt(mRes);
const dRes = d1 + d2;
const day = parseInt(dRes);
const fixResult = yRes + s1 + mRes + s2 + dRes;
const test1 = checkEnValid(inputField1.value);
let isValid = /^([1][3-4][0-9][0-9][/])([0][1-9]|[1][0-2])([/])([0][1-9]|[1-2][0-9]|[3][0-1])$/.test(fixResult);
const isValid = /^([1][3-4][0-9][0-9][/])([0][1-9]|[1][0-2])([/])([0][1-9]|[1-2][0-9]|[3][0-1])$/.test(fixResult);
if (isValid && test1) {
// inputField1.style.backgroundColor = '#a6e9a6';
start1valid = true;
if (isValid && test1) {
// inputField1.style.backgroundColor = '#a6e9a6';
start1valid = true;
} else {
} else {
if (inputField1.value != "") {
// inputField1.style.backgroundColor = '#f94c4c';
$.Notification.autoHideNotify('error', 'top center', 'پیام سیستم ', "لطفا تاریخ را بصورت صحیح وارد کنید");
start1valid = false;
}
if (inputField1.value != "") {
// inputField1.style.backgroundColor = '#f94c4c';
$.Notification.autoHideNotify('error', 'top center', 'پیام سیستم ', "لطفا تاریخ را بصورت صحیح وارد کنید");
start1valid = false;
}
}
return start1valid;
}
return start1valid;
}
}
function checkEnValid(fixDate1) {
function checkEnValid(fixDate1) {
let persianNumbers = [/۰/g, /۱/g, /۲/g, /۳/g, /۴/g, /۵/g, /۶/g, /۷/g, /۸/g, /۹/g],
arabicNumbers = [/٠/g, /١/g, /٢/g, /٣/g, /٤/g, /٥/g, /٦/g, /٧/g, /٨/g, /٩/g],
fixNumbers = function (str) {
if (typeof str === 'string') {
for (var i = 0; i < 10; i++) {
str = str.replace(persianNumbers[i], i).replace(arabicNumbers[i], i);
}
}
return str;
};
let getdate = fixDate1;
let persianNumbers = [/۰/g, /۱/g, /۲/g, /۳/g, /۴/g, /۵/g, /۶/g, /۷/g, /۸/g, /۹/g],
arabicNumbers = [/٠/g, /١/g, /٢/g, /٣/g, /٤/g, /٥/g, /٦/g, /٧/g, /٨/g, /٩/g],
fixNumbers = function(str) {
if (typeof str === 'string') {
for (let i = 0; i < 10; i++) {
str = str.replace(persianNumbers[i], i).replace(arabicNumbers[i], i);
}
}
return str;
};
let getdate = fixDate1;
let m1, m2;
let y1, y2, y3, y4;
let d1, d2;
for (let i = 0; i < getdate.length; i++) {
if (i === 0) {
y1 = fixNumbers(getdate[i]);
}
if (i === 1) {
y2 = fixNumbers(getdate[i]);
}
if (i === 2) {
y3 = fixNumbers(getdate[i]);
}
if (i === 3) {
y4 = fixNumbers(getdate[i]);
}
if (i === 5) {
m1 = fixNumbers(getdate[i]);
}
if (i === 6) {
m2 = fixNumbers(getdate[i]);
}
if (i === 8) {
d1 = fixNumbers(getdate[i]);
}
if (i === 9) {
d2 = fixNumbers(getdate[i]);
}
let m1, m2;
let y1, y2, y3, y4;
let d1, d2;
for (let i = 0; i < getdate.length; i++) {
if (i === 0) {
y1 = fixNumbers(getdate[i]);
}
if (i === 1) {
y2 = fixNumbers(getdate[i]);
}
if (i === 2) {
y3 = fixNumbers(getdate[i]);
}
if (i === 3) {
y4 = fixNumbers(getdate[i]);
}
if (i === 5) {
m1 = fixNumbers(getdate[i]);
}
if (i === 6) {
m2 = fixNumbers(getdate[i]);
}
if (i === 8) {
d1 = fixNumbers(getdate[i]);
}
if (i === 9) {
d2 = fixNumbers(getdate[i]);
}
}
let yRes = y1 + y2 + y3 + y4;
let year = parseInt(yRes);
let mRes = m1 + m2;
let month = parseInt(mRes);
let dRes = d1 + d2;
let day = parseInt(dRes);
let kabiseh = false;
if (month <= 6 && day > 31) {
return false;
} else if (month > 6 && month < 12 && day > 30) {
return false;
} else if (month === 12) {
}
let yRes = y1 + y2 + y3 + y4;
let year = parseInt(yRes);
let mRes = m1 + m2;
let month = parseInt(mRes);
let dRes = d1 + d2;
let day = parseInt(dRes);
let kabiseh = false;
if (month <= 6 && day > 31) {
return false;
} else if (month > 6 && month < 12 && day > 30) {
return false;
} else if (month === 12) {
switch (year) {
case 1346:
kabiseh = true;
break;
case 1350:
kabiseh = true;
break;
case 1354:
kabiseh = true;
break;
case 1358:
kabiseh = true;
break;
case 1362:
kabiseh = true;
break;
case 1366:
kabiseh = true;
break;
case 1370:
kabiseh = true;
break;
case 1375:
kabiseh = true;
break;
case 1379:
kabiseh = true;
break;
case 1383:
kabiseh = true;
break;
case 1387:
kabiseh = true;
break;
case 1391:
kabiseh = true;
break;
case 1395:
kabiseh = true;
break;
case 1399:
kabiseh = true;
break;
case 1403:
kabiseh = true;
break;
case 1408:
kabiseh = true;
break;
case 1412:
kabiseh = true;
break;
case 1416:
kabiseh = true;
break;
case 1420:
kabiseh = true;
break;
case 1424:
kabiseh = true;
break;
case 1428:
kabiseh = true;
break;
case 1432:
kabiseh = true;
break;
case 1436:
kabiseh = true;
break;
case 1441:
kabiseh = true;
break;
case 1445:
kabiseh = true;
break;
default:
kabiseh = false;
switch (year) {
case 1346:
kabiseh = true;
break;
case 1350:
kabiseh = true;
break;
case 1354:
kabiseh = true;
break;
case 1358:
kabiseh = true;
break;
case 1362:
kabiseh = true;
break;
case 1366:
kabiseh = true;
break;
case 1370:
kabiseh = true;
break;
case 1375:
kabiseh = true;
break;
case 1379:
kabiseh = true;
break;
case 1383:
kabiseh = true;
break;
case 1387:
kabiseh = true;
break;
case 1391:
kabiseh = true;
break;
case 1395:
kabiseh = true;
break;
case 1399:
kabiseh = true;
break;
case 1403:
kabiseh = true;
break;
case 1408:
kabiseh = true;
break;
case 1412:
kabiseh = true;
break;
case 1416:
kabiseh = true;
break;
case 1420:
kabiseh = true;
break;
case 1424:
kabiseh = true;
break;
case 1428:
kabiseh = true;
break;
case 1432:
kabiseh = true;
break;
case 1436:
kabiseh = true;
break;
case 1441:
kabiseh = true;
break;
case 1445:
kabiseh = true;
break;
default:
kabiseh = false;
}
if (kabiseh == true && day > 30) {
return false;
} else if (kabiseh == false && day > 29) {
return false;
} else {
return true;
}
} else {
return true;
}
}
if (kabiseh == true && day > 30) {
return false;
} else if (kabiseh == false && day > 29) {
return false;
} else {
return true;
}
} else {
return true;
}
}
}
</script>
<script>
$(document).ready(function () {
computeDays();
var saati = $('input:radio[class="saati"]');
var roozane = $('input:radio[class="roozane"]');
if ($(roozane).is(':checked') && $(roozane).val() == 'روزانه') {
$("#hours").val('');
$("#hours").attr("disabled", "disabled");
$("#endLeave").removeAttr("disabled");
$("#saati").css("visibility", "hidden");
$('.hourses').css({
display: "none"
});
$('.sumHourseDiv').hide();
$('.sumDaysDiv').show();
$('.res').remove();
$('.validTime').removeClass("validTime");
}
});
$(document).ready(function() {
computeDays();
const saati = $('input:radio[class="saati"]');
const roozane = $('input:radio[class="roozane"]');
if ($(roozane).is(':checked') && $(roozane).val() == 'روزانه') {
$("#hours").val('');
$("#hours").attr("disabled", "disabled");
$("#endLeave").removeAttr("disabled");
$("#saati").css("visibility", "hidden");
$('.hourses').css({
display: "none"
});
$('.sumHourseDiv').hide();
$('.sumDaysDiv').show();
$('.res').remove();
$('.validTime').removeClass("validTime");
}
});
function computeDays() {
$('.resultDays').remove();
$.ajax({
/* contentType: 'charset=utf-8',*/
async: false,
dataType: 'json',
type: 'GET',
url: '@Url.Page("/Company/Contracts/Index", "ComputeLeavdays")',
headers: { "RequestVerificationToken": $('input[name="__RequestVerificationToken"]').val() },
data: { "startDay": $('#startLeave').val(), "endDay": $('#endLeave').val() },
success: function (response) {
let res = ` <span class="resultDays"><span>&nbsp;</span><span>:</span> <span>&nbsp;</span><span>${response.res}</span></span>`;
$('.sumDays').append(res);
},
failure: function (response) {
console.log(5, response);
}
});
}
function computeDays() {
$('.resultDays').remove();
$.ajax({
/* contentType: 'charset=utf-8',*/
async: false,
dataType: 'json',
type: 'GET',
url: '@Url.Page("/Company/Contracts/Index", "ComputeLeavdays")',
headers: { "RequestVerificationToken": $('input[name="__RequestVerificationToken"]').val() },
data: { "startDay": $('#startLeave').val(), "endDay": $('#endLeave').val() },
success: function(response) {
const res = ` <span class="resultDays"><span>&nbsp;</span><span>:</span> <span>&nbsp;</span><span>${response.res}</span></span>`;
$('.sumDays').append(res);
},
failure: function(response) {
console.log(5, response);
}
});
}
$(document).ready(function () {
setTimeout(function () {
$(document).ready(function() {
setTimeout(function() {
window.location.hash = "##";
}, 1000);
});
window.location.hash = "##";
},
1000);
});
</script>

View File

@@ -4,151 +4,147 @@
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<form asp-page="./Index" asp-page-handler="EditLeftWork" autocomplete="off"
method="post"
data-ajax="true"
data-callback=""
data-action="ReloadLeftWork">
<div class="modal-body">
<div class="row">
<form asp-page="./Index" asp-page-handler="EditLeftWork" autocomplete="off"
method="post"
data-ajax="true"
data-callback=""
data-action="ReloadLeftWork">
<div class="modal-body">
<div class="row">
<fieldset style="border: 1px solid #999797; height: 120px; border-radius: 10px; padding: revert">
<legend style="margin-bottom: 5px; font-size: large; border-bottom: 0px; color: #505458; width: 140px;text-align: center;">ویرایش </legend>
<fieldset style="border: 1px solid #999797; height: 120px; border-radius: 10px; padding: revert">
<legend style="margin-bottom: 5px; font-size: large; border-bottom: 0px; color: #505458; width: 140px;text-align: center;">ویرایش </legend>
<div class="row">
<div class="col-md-12">
<div class="form-group m-b-0" dir="rtl">
<label asp-for="LeftWorkDate" class="control-label m-r-5">تاریخ ترک کار</label>
<input id="endDate" dir="ltr" maxlength="10" style="text-align: center" class="form-control persianDateInputb" onchange="validDate(this);" asp-for="LeftWorkDate" />
<span asp-validation-for="LeftWorkDate" class="error"></span>
</div>
</div>
<div class="row">
</div>
<div class="col-md-12">
<div class="form-group m-b-0" dir="rtl">
<label asp-for="LeftWorkDate" class="control-label m-r-5">تاریخ ترک کار</label>
<input id="endDate" dir="ltr" maxlength="10" style="text-align: center" class="form-control persianDateInputb" onchange="validDate(this);" asp-for="LeftWorkDate"/>
<span asp-validation-for="LeftWorkDate" class="error"></span>
</div>
</div>
</div>
</fieldset>
</fieldset>
</div>
</div>
</div>
<input type="hidden" asp-for="Id" value="@Model.Id"/>
<input type="hidden" asp-for="EmployeeId"/>
<input type="hidden" asp-for="WorkshopId"/>
<input type="hidden" asp-for="StartWorkDate"/>
<input type="hidden" asp-for="WorkshopName"/>
<input type="hidden" asp-for="EmployeeFullName"/>
<div class="modal-footer">
</div>
<input type="hidden" asp-for="Id" value="@Model.Id" />
<input type="hidden" asp-for="EmployeeId" />
<input type="hidden" asp-for="WorkshopId" />
<input type="hidden" asp-for="StartWorkDate" />
<input type="hidden" asp-for="WorkshopName" />
<input type="hidden" asp-for="EmployeeFullName" />
<div class="modal-footer">
<button type="submit" class="btn btn-success btn-rounded waves-effect waves-light">ذخیره</button>
<a href="#showmodal=@Url.Page("/Company/Contracts/Index", "CreateLeftWork", new { employeeId = Model.EmployeeId })" class="btn btn-default btn-rounded waves-effect waves-light m-b-5"> بازگشت</a>
<button type="submit" class="btn btn-success btn-rounded waves-effect waves-light">ذخیره</button>
<a href="#showmodal=@Url.Page("/Company/Contracts/Index", "CreateLeftWork", new { employeeId = @Model.EmployeeId})" class="btn btn-default btn-rounded waves-effect waves-light m-b-5"> بازگشت</a>
</div>
</div>
</form>
</form>
</div>
<script>
function validDate(inputField) {
function validDate(inputField) {
var persianNumbers = [/۰/g, /۱/g, /۲/g, /۳/g, /۴/g, /۵/g, /۶/g, /۷/g, /۸/g, /۹/g],
arabicNumbers = [/٠/g, /١/g, /٢/g, /٣/g, /٤/g, /٥/g, /٦/g, /٧/g, /٨/g, /٩/g],
fixNumbers = function (str) {
if (typeof str === 'string') {
for (var i = 0; i < 10; i++) {
str = str.replace(persianNumbers[i], i).replace(arabicNumbers[i], i);
}
}
return str;
};
let getdate = inputField.value;
var persianNumbers = [/۰/g, /۱/g, /۲/g, /۳/g, /۴/g, /۵/g, /۶/g, /۷/g, /۸/g, /۹/g],
arabicNumbers = [/٠/g, /١/g, /٢/g, /٣/g, /٤/g, /٥/g, /٦/g, /٧/g, /٨/g, /٩/g],
fixNumbers = function(str) {
if (typeof str === 'string') {
for (let i = 0; i < 10; i++) {
str = str.replace(persianNumbers[i], i).replace(arabicNumbers[i], i);
}
}
return str;
};
let getdate = inputField.value;
var m1, m2;
var y1, y2, y3, y4;
var d1, d2;
var s1, s2;
for (var i = 0; i < getdate.length; i++) {
if (i === 0) {
y1 = fixNumbers(getdate[i]);
}
if (i === 1) {
y2 = fixNumbers(getdate[i]);
}
if (i === 2) {
y3 = fixNumbers(getdate[i]);
}
if (i === 3) {
y4 = fixNumbers(getdate[i]);
}
if (i === 4) {
s1 = fixNumbers(getdate[i]);
}
if (i === 5) {
m1 = fixNumbers(getdate[i]);
}
if (i === 6) {
m2 = fixNumbers(getdate[i]);
}
if (i === 7) {
s2 = fixNumbers(getdate[i]);
}
if (i === 8) {
d1 = fixNumbers(getdate[i]);
}
if (i === 9) {
d2 = fixNumbers(getdate[i]);
}
var m1, m2;
var y1, y2, y3, y4;
var d1, d2;
var s1, s2;
for (var i = 0; i < getdate.length; i++) {
if (i === 0) {
y1 = fixNumbers(getdate[i]);
}
if (i === 1) {
y2 = fixNumbers(getdate[i]);
}
if (i === 2) {
y3 = fixNumbers(getdate[i]);
}
if (i === 3) {
y4 = fixNumbers(getdate[i]);
}
if (i === 4) {
s1 = fixNumbers(getdate[i]);
}
if (i === 5) {
m1 = fixNumbers(getdate[i]);
}
if (i === 6) {
m2 = fixNumbers(getdate[i]);
}
if (i === 7) {
s2 = fixNumbers(getdate[i]);
}
if (i === 8) {
d1 = fixNumbers(getdate[i]);
}
if (i === 9) {
d2 = fixNumbers(getdate[i]);
}
}
var yRes = y1 + y2 + y3 + y4;
var year = parseInt(yRes);
var mRes = m1 + m2;
var month = parseInt(mRes);
var dRes = d1 + d2;
var day = parseInt(dRes);
var FixResult = yRes + s1 + mRes + s2 + dRes;
}
var yRes = y1 + y2 + y3 + y4;
var year = parseInt(yRes);
var mRes = m1 + m2;
var month = parseInt(mRes);
var dRes = d1 + d2;
var day = parseInt(dRes);
var FixResult = yRes + s1 + mRes + s2 + dRes;
var isValid = /^([1][3-4][0-9][0-9][/])([0][1-9]|[1][0-2])([/])([0][1-9]|[1-2][0-9]|[3][0-1])$/.test(FixResult);
var isValid = /^([1][3-4][0-9][0-9][/])([0][1-9]|[1][0-2])([/])([0][1-9]|[1-2][0-9]|[3][0-1])$/.test(FixResult);
if (isValid) {
inputField.style.backgroundColor = '#a6e9a6';
$("button[type=submit]").attr('disabled', false);
validCheck = true;
if (isValid) {
inputField.style.backgroundColor = '#a6e9a6';
$("button[type=submit]").attr('disabled', false);
validCheck = true;
} else {
inputField.style.backgroundColor = '#f94c4c';
$.Notification.autoHideNotify('error', 'top center', 'پیام سیستم ', "لطفا تاریخ را بصورت صحیح وارد کنید");
$("button[type=submit]").attr('disabled', true)
validCheck = false;
} else {
inputField.style.backgroundColor = '#f94c4c';
$.Notification.autoHideNotify('error', 'top center', 'پیام سیستم ', "لطفا تاریخ را بصورت صحیح وارد کنید");
$("button[type=submit]").attr('disabled', true);
validCheck = false;
}
return validCheck;
}
return validCheck;
}
}
</script>
<script>
$(document).ready(function () {
setTimeout(function () {
$(document).ready(function() {
setTimeout(function() {
window.location.hash = "##";
}, 1000);
});
window.location.hash = "##";
},
1000);
});
</script>

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -1,12 +1,11 @@
@model CompanyManagment.App.Contracts.LeftWork.CreateLeftWork
@{
int i = 1;
var i = 1;
}
@{
<style>
<style>
.panel-title {
font-size: 14px;
text-transform: uppercase;
@@ -25,225 +24,192 @@
font-size: 22px !important;
}
</style>
<link href="~/AdminTheme/assets/datatables/jquery.dataTables.min.css" rel="stylesheet" type="text/css" />
<link href="~/AdminTheme/assets/datatables/jquery.dataTables.min.css" rel="stylesheet" type="text/css"/>
}
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<form asp-page="./Index" asp-page-handler="CreateLetWork" autocomplete="off"
method="post"
data-ajax="true"
data-callback=""
data-action="ReloadLeftWork">
<div class="modal-body">
<div class="row">
<form asp-page="./Index" asp-page-handler="CreateLetWork" autocomplete="off"
method="post"
data-ajax="true"
data-callback=""
data-action="ReloadLeftWork">
<div class="modal-body">
<div class="row">
<fieldset style="border: 1px solid #999797; border-radius: 10px; padding: revert">
<legend style="margin-bottom: 5px; font-size: 14px; border-bottom: 0px; color: #505458; width: 145px; text-align: center;"> شروع به کار / ترک کار </legend>
<fieldset style="border: 1px solid #999797; border-radius: 10px; padding: revert">
<legend style="margin-bottom: 5px; font-size: 14px; border-bottom: 0px; color: #505458; width: 145px; text-align: center;"> شروع به کار / ترک کار </legend>
<div class="row">
<div class="row">
<div class="form-group col-md-12" dir="rtl" style="padding-left: 2.5%">
<label class="sr-only" asp-for="WorkshopId"></label>
<select class="form-control select-city" asp-for="WorkshopId" asp-items='new SelectList(Model.Workshops, "Id", "WorkshopFullName")'>
<option value="">انتخاب کارگاه</option>
<div class="form-group col-md-12" dir="rtl" style="padding-left: 2.5%">
<label class="sr-only" asp-for="WorkshopId"></label>
<select class="form-control select-city" asp-for="WorkshopId" asp-items='new SelectList(Model.Workshops, "Id", "WorkshopFullName")'>
<option value="">انتخاب کارگاه</option>
</select>
<span asp-validation-for="WorkshopId" class="error"></span>
</div>
</select>
<span asp-validation-for="WorkshopId" class="error"></span>
</div>
<div class="col-md-12">
<div class="form-group m-b-0" dir="rtl">
<div class="col-md-12">
<div class="form-group m-b-0" dir="rtl">
<input id="endDate" dir="ltr" maxlength="10" style="text-align: center" placeholder="تاریخ شروع به کار" class="form-control persianDateInputb" onchange="validDate(this);" asp-for="StartWorkDate"/>
<span asp-validation-for="StartWorkDate" class="error"></span>
</div>
</div>
</div>
</fieldset>
</div>
<div class="row">
<div class="m-t-10">
<div class="panel panel-default" style="margin-bottom: 0px">
<div class="panel-heading">
<h3 class="panel-title"><i class="fa fa-list" style="padding-left: 3px; font-size: 14px"></i> سوابق شروع بکار و ترک کار(@Model.EmployeeFullName) </h3>
</div>
<div class="panel-body">
<div class="row">
<div class="col-sm-12 col-sm-12 col-xs-12">
<table id="datatable" class="table table-striped table-bordered">
<thead>
<tr>
<th style="font-size: 12px !important;text-align: center">#</th>
<th style="font-size: 12px !important; text-align: center"> نام کارگاه</th>
<th style="font-size: 12px !important; text-align: center"> تاریخ شروع</th>
<th style="font-size: 12px !important; text-align: center"> تاریخ ترک کار </th>
<th style="font-size: 12px !important; width: 10%; text-align: center">عملیات</th>
</tr>
</thead>
<tbody>
@foreach (var item in Model.LeftWorkSearch)
{
<tr>
<td style="font-size: 12px !important; text-align: center">@i </td>
<td style="font-size: 12px !important; text-align: center">@item.WorkshopName </td>
<td style="font-size: 12px !important; text-align: center">@item.StartWorkDate </td>
@if (item.LeftWorkDate == "1500/01/01")
{
<td style="text-align: center">
<a class="btn btn-block btn-success pull-right m-rl-5 rad" style="max-width: -webkit-fill-available; padding: 3px"
href="#showmodal=@Url.Page("/Company/Contracts/Index", "EnterLeftWork", new { item.Id, employeeName = Model.EmployeeFullName })">
<span style="font-size: 16px !important"> <i class="fa fa-sign-out"></i> ثبت ترک کار </span>
</a>
</td>
}
else
{
<td style="font-family: 'IranText' !important; font-size: 12px !important; text-align: center">
@item.LeftWorkDate
</td>
}
@{
i++;
}
<td>
<input id="endDate" dir="ltr" maxlength="10" style="text-align: center" placeholder="تاریخ شروع به کار" class="form-control persianDateInputb" onchange="validDate(this);" asp-for="StartWorkDate" />
<span asp-validation-for="StartWorkDate" class="error"></span>
</div>
</div>
</div>
</fieldset>
</div>
<div class="row">
<div class="m-t-10">
<div class="panel panel-default" style="margin-bottom: 0px">
<div class="panel-heading">
<h3 class="panel-title"><i class="fa fa-list" style="padding-left: 3px; font-size: 14px"></i> سوابق شروع بکار و ترک کار(@Model.EmployeeFullName) </h3>
</div>
<div class="panel-body">
<div class="row">
<div class="col-sm-12 col-sm-12 col-xs-12">
<table id="datatable" class="table table-striped table-bordered">
<thead>
<tr>
<th style="font-size: 12px !important;text-align: center">#</th>
<th style="font-size: 12px !important; text-align: center"> نام کارگاه</th>
<th style="font-size: 12px !important; text-align: center"> تاریخ شروع</th>
<th style="font-size: 12px !important; text-align: center"> تاریخ ترک کار </th>
<th style="font-size: 12px !important; width: 10%; text-align: center">عملیات</th>
</tr>
</thead>
<tbody>
@foreach (var item in Model.LeftWorkSearch)
{
<tr>
<td style="font-size: 12px !important; text-align: center">@i </td>
<td style="font-size: 12px !important; text-align: center">@item.WorkshopName </td>
<td style="font-size: 12px !important; text-align: center">@item.StartWorkDate </td>
@if (item.LeftWorkDate == "1500/01/01")
{
<td style="text-align: center">
<a class="btn btn-block btn-success pull-right m-rl-5 rad" style="max-width: -webkit-fill-available; padding: 3px"
href="#showmodal=@Url.Page("/Company/Contracts/Index", "EnterLeftWork", new {Id = item.Id, employeeName = @Model.EmployeeFullName})">
<span style="font-size: 16px !important"> <i class="fa fa-sign-out"></i> ثبت ترک کار </span>
</a>
</td>
}
else
{
<td style="font-family: 'IranText' !important; font-size: 12px !important; text-align: center">
@item.LeftWorkDate
</td>
}
@{
i++;
}
<td>
@*<a class="btn btn-warning pull-right m-rl-5 rad"
@*<a class="btn btn-warning pull-right m-rl-5 rad"
href="#showmodal=@Url.Page("/Company/Contracts/Index", "EditLeftWork", new { Id = item.Id })">
<i class="fa faSize fa-edit"></i>
</a>*@
<a href="#" class="btn btn-danger pull-right m-rl-5 fff rad RemoveLeftWork"><i class="fa faSize fa-trash"></i></a>
<div style="display: none">
<input type="hidden" name="LeftworkId" value="@item.Id" />
</div>
<a href="#" class="btn btn-danger pull-right m-rl-5 fff rad RemoveLeftWork">
<i class="fa faSize fa-trash"></i>
</a>
<div style="display: none">
<input type="hidden" name="LeftworkId" value="@item.Id"/>
</div>
</td>
</td>
</tr>
</tr>
}
}
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
<input type="hidden" asp-for="EmployeeId"/>
<input type="hidden" id="emp" asp-for="EmployeeFullName"/>
<div class="modal-footer">
<button type="submit" class="btn btn-success btn-rounded waves-effect waves-light">ذخیره</button>
<button type="button" class="btn btn-default btn-rounded waves-effect waves-light m-b-5" data-dismiss="modal">بستن</button>
</div>
</form>
<form asp-page="./Index" asp-page-handler="RemoveLeftWork" autocomplete="off" id="sub"
method="post"
data-ajax="true"
data-callback=""
data-action="DeletLeftWork">
<div style="display: none">
<input type="hidden" id="LeftId" name="id"/>
<input type="hidden" id="empName" name="employeeName"/>
</div>
<input type="hidden" asp-for="EmployeeId"/>
<input type="hidden" asp-for="WorkshopId"/>
<input type="hidden" asp-for="EmployeeFullName"/>
</div>
<input type="hidden" asp-for="EmployeeId" />
<input type="hidden" id="emp" asp-for="EmployeeFullName" />
<div class="modal-footer">
<button type="submit" class="btn btn-success btn-rounded waves-effect waves-light">ذخیره</button>
<button type="button" class="btn btn-default btn-rounded waves-effect waves-light m-b-5" data-dismiss="modal">بستن</button>
</div>
</form>
@*<input type="hidden" asp-for="id" value="id"/>*@
<div class="modal-footer" style="margin-bottom: 10px">
<input type="submit" id="sendFinaly" form="sub" value="fine" name="fine" style="display: none"/>
<form asp-page="./Index" asp-page-handler="RemoveLeftWork" autocomplete="off" id="sub"
method="post"
data-ajax="true"
data-callback=""
data-action="DeletLeftWork">
</div>
</div>
<div style="display: none">
<input type="hidden" id="LeftId" name="id" />
<input type="hidden" id="empName" name="employeeName" />
<input type="hidden" asp-for="EmployeeId" />
<input type="hidden" asp-for="WorkshopId" />
<input type="hidden" asp-for="EmployeeFullName" />
@*<input type="hidden" asp-for="id" value="id"/>*@
<div class="modal-footer" style="margin-bottom: 10px">
<input type="submit" id="sendFinaly" form="sub" value="fine" name="fine" style="display: none" />
</div>
</div>
</form>
</form>
</div>
@@ -253,138 +219,139 @@
<script>
$('.RemoveLeftWork').on("click",
function () {
var id = $(this).closest("div").find("input[name='LeftworkId']").val();
var emp = $('#emp').val();
$('#LeftId').val(id);
$('#empName').val(emp);
$('.RemoveLeftWork').on("click",
function() {
const id = $(this).closest("div").find("input[name='LeftworkId']").val();
const emp = $('#emp').val();
$('#LeftId').val(id);
$('#empName').val(emp);
swal({
title: "آیا حذف این سابقه ترک کار اطمینان دارید؟",
text: "",
type: "warning",
showCancelButton: true,
confirmButtonColor: "#DD6B55",
confirmButtonText: "بله",
cancelButtonText: "خیر",
closeOnConfirm: true,
closeOnCancel: true
},
function(isConfirm) {
if (isConfirm) {
swal({
title: "آیا حذف این سابقه ترک کار اطمینان دارید؟",
text: "",
type: "warning",
showCancelButton: true,
confirmButtonColor: "#DD6B55",
confirmButtonText: "بله",
cancelButtonText: "خیر",
closeOnConfirm: true,
closeOnCancel: true
}, function (isConfirm) {
if (isConfirm) {
$('#sendFinaly').click();
$('#sendFinaly').click();
}
}
});
});
});
});
</script>
<script>
function validDate(inputField) {
function validDate(inputField) {
var persianNumbers = [/۰/g, /۱/g, /۲/g, /۳/g, /۴/g, /۵/g, /۶/g, /۷/g, /۸/g, /۹/g],
arabicNumbers = [/٠/g, /١/g, /٢/g, /٣/g, /٤/g, /٥/g, /٦/g, /٧/g, /٨/g, /٩/g],
fixNumbers = function (str) {
if (typeof str === 'string') {
for (var i = 0; i < 10; i++) {
str = str.replace(persianNumbers[i], i).replace(arabicNumbers[i], i);
}
}
return str;
};
let getdate = inputField.value;
var persianNumbers = [/۰/g, /۱/g, /۲/g, /۳/g, /۴/g, /۵/g, /۶/g, /۷/g, /۸/g, /۹/g],
arabicNumbers = [/٠/g, /١/g, /٢/g, /٣/g, /٤/g, /٥/g, /٦/g, /٧/g, /٨/g, /٩/g],
fixNumbers = function(str) {
if (typeof str === 'string') {
for (let i = 0; i < 10; i++) {
str = str.replace(persianNumbers[i], i).replace(arabicNumbers[i], i);
}
}
return str;
};
let getdate = inputField.value;
var m1, m2;
var y1, y2, y3, y4;
var d1, d2;
var s1, s2;
for (var i = 0; i < getdate.length; i++) {
if (i === 0) {
y1 = fixNumbers(getdate[i]);
}
if (i === 1) {
y2 = fixNumbers(getdate[i]);
}
if (i === 2) {
y3 = fixNumbers(getdate[i]);
}
if (i === 3) {
y4 = fixNumbers(getdate[i]);
}
if (i === 4) {
s1 = fixNumbers(getdate[i]);
}
if (i === 5) {
m1 = fixNumbers(getdate[i]);
}
if (i === 6) {
m2 = fixNumbers(getdate[i]);
}
if (i === 7) {
s2 = fixNumbers(getdate[i]);
}
if (i === 8) {
d1 = fixNumbers(getdate[i]);
}
if (i === 9) {
d2 = fixNumbers(getdate[i]);
}
var m1, m2;
var y1, y2, y3, y4;
var d1, d2;
var s1, s2;
for (var i = 0; i < getdate.length; i++) {
if (i === 0) {
y1 = fixNumbers(getdate[i]);
}
if (i === 1) {
y2 = fixNumbers(getdate[i]);
}
if (i === 2) {
y3 = fixNumbers(getdate[i]);
}
if (i === 3) {
y4 = fixNumbers(getdate[i]);
}
if (i === 4) {
s1 = fixNumbers(getdate[i]);
}
if (i === 5) {
m1 = fixNumbers(getdate[i]);
}
if (i === 6) {
m2 = fixNumbers(getdate[i]);
}
if (i === 7) {
s2 = fixNumbers(getdate[i]);
}
if (i === 8) {
d1 = fixNumbers(getdate[i]);
}
if (i === 9) {
d2 = fixNumbers(getdate[i]);
}
}
var yRes = y1 + y2 + y3 + y4;
var year = parseInt(yRes);
var mRes = m1 + m2;
var month = parseInt(mRes);
var dRes = d1 + d2;
var day = parseInt(dRes);
var FixResult = yRes + s1 + mRes + s2 + dRes;
}
var yRes = y1 + y2 + y3 + y4;
var year = parseInt(yRes);
var mRes = m1 + m2;
var month = parseInt(mRes);
var dRes = d1 + d2;
var day = parseInt(dRes);
var FixResult = yRes + s1 + mRes + s2 + dRes;
var isValid = /^([1][3-4][0-9][0-9][/])([0][1-9]|[1][0-2])([/])([0][1-9]|[1-2][0-9]|[3][0-1])$/.test(FixResult);
var isValid = /^([1][3-4][0-9][0-9][/])([0][1-9]|[1][0-2])([/])([0][1-9]|[1-2][0-9]|[3][0-1])$/.test(FixResult);
if (isValid) {
inputField.style.backgroundColor = '#a6e9a6';
$("button[type=submit]").attr('disabled', false);
validCheck = true;
if (isValid) {
inputField.style.backgroundColor = '#a6e9a6';
$("button[type=submit]").attr('disabled', false);
validCheck = true;
} else {
inputField.style.backgroundColor = '#f94c4c';
$.Notification.autoHideNotify('error', 'top center', 'پیام سیستم ', "لطفا تاریخ را بصورت صحیح وارد کنید");
$("button[type=submit]").attr('disabled', true)
validCheck = false;
} else {
inputField.style.backgroundColor = '#f94c4c';
$.Notification.autoHideNotify('error', 'top center', 'پیام سیستم ', "لطفا تاریخ را بصورت صحیح وارد کنید");
$("button[type=submit]").attr('disabled', true);
validCheck = false;
}
return validCheck;
}
return validCheck;
}
}
</script>
<script>
$(document).ready(function () {
$('.select-city').select2({
language: "fa",
dir: "rtl"
});
});
$(document).ready(function() {
$('.select-city').select2({
language: "fa",
dir: "rtl"
});
});
</script>
<script>
$(document).ready(function () {
setTimeout(function () {
$(document).ready(function() {
setTimeout(function() {
window.location.hash = "##";
}, 1000);
});
window.location.hash = "##";
},
1000);
});
</script>
<script>
@*function EditLeft(id) {
@*function EditLeft(id) {
const leftId = id.value;
@@ -418,6 +385,4 @@
});
}*@
</script>
</script>

View File

@@ -1,6 +1,6 @@
@model CompanyManagment.App.Contracts.Contract.GroupPrintViewModel
@{
<style>
<style>
.modal .modal-dialog .modal-content {
background-color: white !important;
}
@@ -131,326 +131,338 @@
</style>
}
<div class="modal-header" style="border-bottom: unset">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
</div>
<div class="modal-body print" style="width: 210mm; float: left;" id="printThis">
@foreach (var item in @Model.ContractList)
{
<div class="container container2">
<div class="row">
<div class="col-md-12">
<fieldset style="border: 1px solid black; padding: revert; border-radius: 10px; height: 28cm; padding: 2mm">
<div class="row" dir="rtl">
<div class="col-xs-4 d-inline-block"><fieldset style="border: 1px solid black; border-radius: 10px; padding: 5px; margin-top: 5px; width: 180px;">شماره قرارداد :<span>&nbsp;</span> @item.ContractNo</fieldset></div>
<div class="col-xs-4 d-inline-block text-center"><h4>قرارداد کار</h4></div>
<div class="col-xs-4 d-inline-block"></div>
</div>
<div class="row text-center">
<h5>این قرارداد به موجب ماده 10 قانون کار جمهوری اسلامی ایران بین کارفرما و کارگر منعقد می گردد</h5>
</div>
<div class="row m-t-5">
<fieldset class="head" style="background-color: #ccc; border: 1px solid black; border-radius: 10px 10px 0px 0px; padding: 3px; margin: 4px 10px 0px 10px;"><h6 style="padding-right: 5px;">مشخصات کارفرما</h6></fieldset>
<fieldset style="border: 1px solid black; border-top: 0px; border-radius: 0px 0px 10px 10px; padding: 3px; margin: 0px 10px;">
<div class="row" style="padding: 4px;">
<div class="col-xs-2 fontBold">آقای/خانم/شرکت :</div>
<div class="col-xs-10">
<div class="row">
@foreach (var Employer in item.Employers)
{
if (Employer.NationalId == "*" || Employer.RegisterId == "*")
{
<div class="col-xs-4">@Employer.FullName</div>
<div class="col-xs-4"><span class="fontBold">کـــــد مـــلی</span> : <span class="fontNumber"> @Employer.Nationalcode</span></div>
<div class="col-xs-4">
<span class="fontBold">شماره شناسنامه </span> :
<span class="fontNumber">
@Employer.IdNumber
</span>
</div>
}
else
{
<div class="col-xs-4">@Employer.FullName </div>
<div class="col-xs-4 "><span class="fontBold">شناسه ملی </span> : <span class="fontNumber">@Employer.NationalId</span></div>
<div class="col-xs-4"><span class="fontBold">شماره ثـــــــــبــت </span> : <span class="fontNumber">@Employer.RegisterId</span></div>
}
}
</div>
</div>
</div>
<div class="row" style="padding: 4px">
@foreach (var Wk in item.Workshops)
{
<div class="col-xs-6"><span class="fontBold">نــــــام کـــــــارگـــاه</span> : <span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span> <span>@Wk.WorkshopName</span> </div>
<div class="col-xs-2"></div>
<div class="col-xs-4">
<span class="fontBold" style="margin-right: 41px;">کــــد کـــارگـاهـی</span> : <span>&nbsp;</span>
<span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>@Wk.InsuranceCode</span>
</div>
}
</div>
<div class="row" style="padding: 4px">
@foreach (var wk2 in item.Workshops)
{
<div class="col-xs-3" style="width: 124px"><span class="fontBold">بــــــه نــــــشـــانـی</span> : </div>
<div class="col-xs-9"><span>@wk2.Address</span></div>
}
</div>
</fieldset>
</div>
<div class="row m-t-5">
<fieldset class="head" style="background-color: #ccc; border: 1px solid black; border-radius: 10px 10px 0px 0px; padding: 3px; margin: 4px 10px 0px 10px;"><h6 style="padding-right: 5px;">مشخصات پرسنل</h6></fieldset>
<fieldset style="border: 1px solid black; border-top: 0px; border-radius: 0px 0px 10px 10px; padding: 3px; margin: 0px 10px; height: 3cm">
@foreach (var emloyee in item.Employees)
{
<div class="row" style="padding: 4px;">
<div class="col-xs-10">
<div class="row" style="padding: 4px;">
<div class="col-xs-5"><span class="fontBold">آقــا/خــانم</span> : <span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span> <span>@emloyee.EmployeeFullName</span></div>
<div class="col-xs-3"><span class="fontBold"> کد ملی</span> : <span>&nbsp;</span> <span class="fontNumber">@emloyee.NationalCode</span></div>
<div class="col-xs-4"><span class="fontBold">شماره شناسنامه</span> : <span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span> <span class="fontNumber">@emloyee.IdNumber</span></div>
</div>
<div class="row" style="padding: 4px;">
<div class="col-xs-5"><span class="fontBold">تاریخ تولد </span> : <span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span> <span class="fontNumber">@emloyee.DateOfBirth</span></div>
<div class="col-xs-3"><span class="fontBold"> نام پدر </span> :<span>&nbsp;</span> <span>@emloyee.FatherName</span></div>
<div class="col-xs-4"><span class="fontBold">میزان تحصیـلات </span> : <span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span> <span>@emloyee.LevelOfEducation</span></div>
</div>
<div class="row" style="padding: 4px;">
<div class="col-xs-2" style="width: 74px;"><span class="fontBold"> بـه نـشانی </span> : </div>
<div class="col-xs-10"><span>@emloyee.Address</span></div>
</div>
</div>
<div class="col-xs-2">
<span style="width: 2cm; height: 2.5cm; border: 1px solid #999595; border-radius: 7px; position: absolute; left: 15px;">
<h5 style="text-align: center; margin-top: 20px !important; color: #a5a9a9 !important; line-height: 1.5;">
عکس<br /> پرسنل
</h5>
</span>
</div>
</div>
}
</fieldset>
</div>
<div class="row m-t-5">
<fieldset class="head" style="background-color: #ccc; border: 1px solid black; border-radius: 10px 10px 0px 0px; padding: 3px; margin: 4px 10px 0px 10px;"><h6 style="padding-right: 5px;">مدت و نوع قرارداد </h6></fieldset>
<fieldset style="border: 1px solid black; border-top: 0px; border-radius: 0px 0px 10px 10px; padding: 3px; margin: 0px 10px;">
<div class="row" style="padding: 4px;">
<div class="col-xs-4">
<span class="fontBold"> نوع قرارداد </span> : <span>&nbsp;</span><span>&nbsp;</span>
<span class="radio-info">
@if (item.ContractType == "دائم")
{
<input style="vertical-align: sub;" type="radio" id="inlineRadio3" name="@item.Id" checked="checked">
<label for="inlineRadio3"> دائم </label>
}
else
{
<input style="vertical-align: sub;" type="radio" id="inlineRadio3" name="@item.Id">
<label for="inlineRadio3"> دائم </label>
}
</span><span>&nbsp;</span><span>&nbsp;</span>
<span class="radio-info">
@if (item.ContractType == "موقت")
{
<input style="vertical-align: sub;" type="radio" id="inlineRadio3" name="@item.Id" checked="checked">
<label for="inlineRadio3"> موقت </label>
}
else
{
<input style="vertical-align: sub;" type="radio" id="inlineRadio3" name="@item.Id">
<label for="inlineRadio3"> موقت </label>
}
</span><span>&nbsp;</span><span>&nbsp;</span>
<span class="radio-info">
@if (item.ContractType == "معین")
{
<input style="vertical-align: sub;" type="radio" id="inlineRadio3" name="@item.Id" checked="checked">
<label for="inlineRadio3"> معین </label>
}
else
{
<input style="vertical-align: sub;" type="radio" id="inlineRadio3" name="@item.Id">
<label for="inlineRadio3"> معین </label>
}
</span>
</div>
<div class="col-xs-8" style="margin-top: 3px;">
<span class="fontBold">نوع کار یا حرفه یا حجم کار یا وظیفه ای که کارگر به آن اشتغال می یابد</span> :
<span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span>
<span>@item.JobType</span>
</div>
</div>
<div class="row" style="padding: 4px;">
<div class="col-xs-4">
<span class="fontBold">تاریخ انعقاد قرارداد</span> :
<span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span>
<span class="fontNumber">@item.SetContractDate</span>
</div>
</div>
<div class="row" style="padding: 4px;">
<div class="col-xs-8">
<span class="fontBold">مـــدت قـــــــــــرارداد</span> :
<span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span>
<span class="fontNumber">@item.ContarctStart</span><span>&nbsp;</span><span>&nbsp;</span>
<span>الی</span><span>&nbsp;</span><span>&nbsp;</span>
<span class="fontNumber">@item.ContractEnd</span><span>&nbsp;</span><span>&nbsp;</span>
</div>
</div>
<div class="row" style="padding: 4px;">
<div class="col-xs-4">
<span class="fontBold">ساعت کار در هفته</span> :
<span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span>
<span class="fontNumber">@item.WorkingHoursWeekly</span>
</div>
</div>
<div class="row" style="padding: 4px; padding-right: 15px">
<span class="fontBold">
@if (item.WorkshopAddress2 != null)
{<span>محـل انــجـام کـار 1</span>}
else
{<span>محـل انــــجـام کـــار </span>}
</span> : <span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span>
<span>@item.WorkshopAddress1</span>
</div>
@if (item.WorkshopAddress2 != null)
{
<div class="row" style="padding: 4px; padding-right: 15px">
<span class="fontBold">محـل انــجـام کـار 2</span> : <span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span>
<span>@item.WorkshopAddress2</span>
</div>
}
</fieldset>
</div>
<div class="row m-t-5">
<fieldset class="head" style="background-color: #ccc; border: 1px solid black; border-radius: 10px 10px 0px 0px; padding: 3px; margin: 4px 10px 0px 10px;"><h6 style="padding-right: 5px;">حق السعی </h6></fieldset>
<fieldset style="border: 1px solid black; border-top: 0px; border-radius: 0px 0px 10px 10px; padding: 3px; margin: 0px 10px;">
<div class="row" style="padding: 7px;">
<div class="col-xs-3">
<span class="fontBold"> مزد روزانه : </span>
</div>
<div class="col-xs-3">
<span>@item.DayliWage</span><span>&nbsp;</span><span>ریال</span>
</div>
<div class="col-xs-2">
<span class="fontBold"> حق عائله مندی : </span>
</div>
<div class="col-xs-4">
@if (item.FamilyAllowance != "0")
{
<span>@item.FamilyAllowance</span><span>&nbsp;</span><span>ریال</span>
}
</div>
</div>
<div class="row" style="padding: 7px;">
<div class="col-xs-3">
<span class="fontBold"> کمک هزینه اقلام مصرفی خواربار : </span>
</div>
<div class="col-xs-9">
<span>@item.ConsumableItems</span><span>&nbsp;</span><span>ریال</span>
</div>
</div>
<div class="row" style="padding: 7px;">
<div class="col-xs-3">
<span class="fontBold"> کمک هزینه مسکن : </span>
</div>
<div class="col-xs-9">
<span>@item.HousingAllowance</span><span>&nbsp;</span><span>ریال</span>
</div>
</div>
</fieldset>
</div>
<div class="row m-t-5">
<fieldset class="head" style="background-color: #ccc; border: 1px solid black; border-radius: 10px 10px 0px 0px; padding: 3px; margin: 4px 10px 0px 10px;"><h6 style="padding-right: 5px;"> شروط و توضیحات </h6></fieldset>
<fieldset style="border: 1px solid black; border-top: 0px; border-radius: 0px 0px 10px 10px; padding: 3px; margin: 0px 10px;">
<textarea class="form-control" style="height: 80px;"></textarea>
</fieldset>
</div>
<div class="row m-t-5" style="padding: 1px 10px 1px 10px ;">
<p style="margin-bottom: 2px !important">بیمه : به موجب ماده 148 قانون کار، کارفرما مکلف است کارگر را نزد سازمان تامین اجتماعی بیمه نماید.</p>
<p style="margin-bottom: 2px !important">یک نسخه از این قرارداد در ید کارگر می باشد و هر یک از نسخه های قرارداد، اعتبار و حکم واحد دارند.</p>
<p style="text-align: justify; margin-bottom: 2px !important">
مبلغ مزد روزانه در این قرارداد بر اساس قوانین کار می باشد و هیچگونه ارتباطی با تنظیم و ارسال لیست بیمه سازمان تامین اجتماعی ندارد. سازمان تامین اجتماعی
بر اساس بخشنامه های درون سازمانی مقادیری را برای ارسال لیست بیمه در اختیار کارفرما قرار میدهد (لیست مشاغل مقطوع) که خارج از قوانین کار می باشد.
</p>
</div>
<div class="row m-t-5" style="padding: 1px 10px 1px 0px;">
<div class="col-xs-6 text-center"><h5>مهر/امضاء/اثر انگشت کارفرما</h5></div>
<div class="col-xs-6 text-center"><h5>امضاء/اثر انگشت کارگر</h5></div>
</div>
</fieldset>
</div>
</div>
</div>
}
@foreach (var item in Model.ContractList)
{
<div class="container container2">
<div class="row">
<div class="col-md-12">
<fieldset style="border: 1px solid black; padding: revert; border-radius: 10px; height: 28cm; padding: 2mm">
<div class="row" dir="rtl">
<div class="col-xs-4 d-inline-block">
<fieldset style="border: 1px solid black; border-radius: 10px; padding: 5px; margin-top: 5px; width: 180px;">شماره قرارداد :<span>&nbsp;</span> @item.ContractNo</fieldset>
</div>
<div class="col-xs-4 d-inline-block text-center">
<h4>قرارداد کار</h4>
</div>
<div class="col-xs-4 d-inline-block"></div>
</div>
<div class="row text-center">
<h5>این قرارداد به موجب ماده 10 قانون کار جمهوری اسلامی ایران بین کارفرما و کارگر منعقد می گردد</h5>
</div>
<div class="row m-t-5">
<fieldset class="head" style="background-color: #ccc; border: 1px solid black; border-radius: 10px 10px 0px 0px; padding: 3px; margin: 4px 10px 0px 10px;">
<h6 style="padding-right: 5px;">مشخصات کارفرما</h6>
</fieldset>
<fieldset style="border: 1px solid black; border-top: 0px; border-radius: 0px 0px 10px 10px; padding: 3px; margin: 0px 10px;">
<div class="row" style="padding: 4px;">
<div class="col-xs-2 fontBold">آقای/خانم/شرکت :</div>
<div class="col-xs-10">
<div class="row">
@foreach (var Employer in item.Employers)
{
if (Employer.NationalId == "*" || Employer.RegisterId == "*")
{
<div class="col-xs-4">@Employer.FullName</div>
<div class="col-xs-4"><span class="fontBold">کـــــد مـــلی</span> : <span class="fontNumber"> @Employer.Nationalcode</span></div>
<div class="col-xs-4">
<span class="fontBold">شماره شناسنامه </span> :
<span class="fontNumber">
@Employer.IdNumber
</span>
</div>
}
else
{
<div class="col-xs-4">@Employer.FullName </div>
<div class="col-xs-4 "><span class="fontBold">شناسه ملی </span> : <span class="fontNumber">@Employer.NationalId</span></div>
<div class="col-xs-4"><span class="fontBold">شماره ثـــــــــبــت </span> : <span class="fontNumber">@Employer.RegisterId</span></div>
}
}
</div>
</div>
</div>
<div class="row" style="padding: 4px">
@foreach (var Wk in item.Workshops)
{
<div class="col-xs-6"><span class="fontBold">نــــــام کـــــــارگـــاه</span> : <span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span> <span>@Wk.WorkshopName</span> </div>
<div class="col-xs-2"></div>
<div class="col-xs-4">
<span class="fontBold" style="margin-right: 41px;">کــــد کـــارگـاهـی</span> : <span>&nbsp;</span>
<span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>@Wk.InsuranceCode</span>
</div>
}
</div>
<div class="row" style="padding: 4px">
@foreach (var wk2 in item.Workshops)
{
<div class="col-xs-3" style="width: 124px"><span class="fontBold">بــــــه نــــــشـــانـی</span> : </div>
<div class="col-xs-9">
<span>@wk2.Address</span>
</div>
}
</div>
</fieldset>
</div>
<div class="row m-t-5">
<fieldset class="head" style="background-color: #ccc; border: 1px solid black; border-radius: 10px 10px 0px 0px; padding: 3px; margin: 4px 10px 0px 10px;">
<h6 style="padding-right: 5px;">مشخصات پرسنل</h6>
</fieldset>
<fieldset style="border: 1px solid black; border-top: 0px; border-radius: 0px 0px 10px 10px; padding: 3px; margin: 0px 10px; height: 3cm">
@foreach (var emloyee in item.Employees)
{
<div class="row" style="padding: 4px;">
<div class="col-xs-10">
<div class="row" style="padding: 4px;">
<div class="col-xs-5"><span class="fontBold">آقــا/خــانم</span> : <span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span> <span>@emloyee.EmployeeFullName</span></div>
<div class="col-xs-3"><span class="fontBold"> کد ملی</span> : <span>&nbsp;</span> <span class="fontNumber">@emloyee.NationalCode</span></div>
<div class="col-xs-4"><span class="fontBold">شماره شناسنامه</span> : <span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span> <span class="fontNumber">@emloyee.IdNumber</span></div>
</div>
<div class="row" style="padding: 4px;">
<div class="col-xs-5"><span class="fontBold">تاریخ تولد </span> : <span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span> <span class="fontNumber">@emloyee.DateOfBirth</span></div>
<div class="col-xs-3"><span class="fontBold"> نام پدر </span> :<span>&nbsp;</span> <span>@emloyee.FatherName</span></div>
<div class="col-xs-4"><span class="fontBold">میزان تحصیـلات </span> : <span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span> <span>@emloyee.LevelOfEducation</span></div>
</div>
<div class="row" style="padding: 4px;">
<div class="col-xs-2" style="width: 74px;"><span class="fontBold"> بـه نـشانی </span> : </div>
<div class="col-xs-10">
<span>@emloyee.Address</span>
</div>
</div>
</div>
<div class="col-xs-2">
<span style="width: 2cm; height: 2.5cm; border: 1px solid #999595; border-radius: 7px; position: absolute; left: 15px;">
<h5 style="text-align: center; margin-top: 20px !important; color: #a5a9a9 !important; line-height: 1.5;">
عکس<br/> پرسنل
</h5>
</span>
</div>
</div>
}
</fieldset>
</div>
<div class="row m-t-5">
<fieldset class="head" style="background-color: #ccc; border: 1px solid black; border-radius: 10px 10px 0px 0px; padding: 3px; margin: 4px 10px 0px 10px;">
<h6 style="padding-right: 5px;">مدت و نوع قرارداد </h6>
</fieldset>
<fieldset style="border: 1px solid black; border-top: 0px; border-radius: 0px 0px 10px 10px; padding: 3px; margin: 0px 10px;">
<div class="row" style="padding: 4px;">
<div class="col-xs-4">
<span class="fontBold"> نوع قرارداد </span> : <span>&nbsp;</span><span>&nbsp;</span>
<span class="radio-info">
@if (item.ContractType == "دائم")
{
<input style="vertical-align: sub;" type="radio" id="inlineRadio3" name="@item.Id" checked="checked">
<label for="inlineRadio3"> دائم </label>
}
else
{
<input style="vertical-align: sub;" type="radio" id="inlineRadio3" name="@item.Id">
<label for="inlineRadio3"> دائم </label>
}
</span><span>&nbsp;</span><span>&nbsp;</span>
<span class="radio-info">
@if (item.ContractType == "موقت")
{
<input style="vertical-align: sub;" type="radio" id="inlineRadio3" name="@item.Id" checked="checked">
<label for="inlineRadio3"> موقت </label>
}
else
{
<input style="vertical-align: sub;" type="radio" id="inlineRadio3" name="@item.Id">
<label for="inlineRadio3"> موقت </label>
}
</span><span>&nbsp;</span><span>&nbsp;</span>
<span class="radio-info">
@if (item.ContractType == "معین")
{
<input style="vertical-align: sub;" type="radio" id="inlineRadio3" name="@item.Id" checked="checked">
<label for="inlineRadio3"> معین </label>
}
else
{
<input style="vertical-align: sub;" type="radio" id="inlineRadio3" name="@item.Id">
<label for="inlineRadio3"> معین </label>
}
</span>
</div>
<div class="col-xs-8" style="margin-top: 3px;">
<span class="fontBold">نوع کار یا حرفه یا حجم کار یا وظیفه ای که کارگر به آن اشتغال می یابد</span> :
<span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span>
<span>@item.JobType</span>
</div>
</div>
<div class="row" style="padding: 4px;">
<div class="col-xs-4">
<span class="fontBold">تاریخ انعقاد قرارداد</span> :
<span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span>
<span class="fontNumber">@item.SetContractDate</span>
</div>
</div>
<div class="row" style="padding: 4px;">
<div class="col-xs-8">
<span class="fontBold">مـــدت قـــــــــــرارداد</span> :
<span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span>
<span class="fontNumber">@item.ContarctStart</span><span>&nbsp;</span><span>&nbsp;</span>
<span>الی</span><span>&nbsp;</span><span>&nbsp;</span>
<span class="fontNumber">@item.ContractEnd</span><span>&nbsp;</span><span>&nbsp;</span>
</div>
</div>
<div class="row" style="padding: 4px;">
<div class="col-xs-4">
<span class="fontBold">ساعت کار در هفته</span> :
<span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span>
<span class="fontNumber">@item.WorkingHoursWeekly</span>
</div>
</div>
<div class="row" style="padding: 4px; padding-right: 15px">
<span class="fontBold">
@if (item.WorkshopAddress2 != null)
{
<span>محـل انــجـام کـار 1</span>
}
else
{
<span>محـل انــــجـام کـــار </span>
}
</span> : <span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span>
<span>@item.WorkshopAddress1</span>
</div>
@if (item.WorkshopAddress2 != null)
{
<div class="row" style="padding: 4px; padding-right: 15px">
<span class="fontBold">محـل انــجـام کـار 2</span> : <span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span>
<span>@item.WorkshopAddress2</span>
</div>
}
</fieldset>
</div>
<div class="row m-t-5">
<fieldset class="head" style="background-color: #ccc; border: 1px solid black; border-radius: 10px 10px 0px 0px; padding: 3px; margin: 4px 10px 0px 10px;">
<h6 style="padding-right: 5px;">حق السعی </h6>
</fieldset>
<fieldset style="border: 1px solid black; border-top: 0px; border-radius: 0px 0px 10px 10px; padding: 3px; margin: 0px 10px;">
<div class="row" style="padding: 7px;">
<div class="col-xs-3">
<span class="fontBold"> مزد روزانه : </span>
</div>
<div class="col-xs-3">
<span>@item.DayliWage</span><span>&nbsp;</span><span>ریال</span>
</div>
<div class="col-xs-2">
<span class="fontBold"> حق عائله مندی : </span>
</div>
<div class="col-xs-4">
@if (item.FamilyAllowance != "0")
{
<span>@item.FamilyAllowance</span>
<span>&nbsp;</span>
<span>ریال</span>
}
</div>
</div>
<div class="row" style="padding: 7px;">
<div class="col-xs-3">
<span class="fontBold"> کمک هزینه اقلام مصرفی خواربار : </span>
</div>
<div class="col-xs-9">
<span>@item.ConsumableItems</span><span>&nbsp;</span><span>ریال</span>
</div>
</div>
<div class="row" style="padding: 7px;">
<div class="col-xs-3">
<span class="fontBold"> کمک هزینه مسکن : </span>
</div>
<div class="col-xs-9">
<span>@item.HousingAllowance</span><span>&nbsp;</span><span>ریال</span>
</div>
</div>
</fieldset>
</div>
<div class="row m-t-5">
<fieldset class="head" style="background-color: #ccc; border: 1px solid black; border-radius: 10px 10px 0px 0px; padding: 3px; margin: 4px 10px 0px 10px;">
<h6 style="padding-right: 5px;"> شروط و توضیحات </h6>
</fieldset>
<fieldset style="border: 1px solid black; border-top: 0px; border-radius: 0px 0px 10px 10px; padding: 3px; margin: 0px 10px;">
<textarea class="form-control" style="height: 80px;"></textarea>
</fieldset>
</div>
<div class="row m-t-5" style="padding: 1px 10px 1px 10px ;">
<p style="margin-bottom: 2px !important">بیمه : به موجب ماده 148 قانون کار، کارفرما مکلف است کارگر را نزد سازمان تامین اجتماعی بیمه نماید.</p>
<p style="margin-bottom: 2px !important">یک نسخه از این قرارداد در ید کارگر می باشد و هر یک از نسخه های قرارداد، اعتبار و حکم واحد دارند.</p>
<p style="text-align: justify; margin-bottom: 2px !important">
مبلغ مزد روزانه در این قرارداد بر اساس قوانین کار می باشد و هیچگونه ارتباطی با تنظیم و ارسال لیست بیمه سازمان تامین اجتماعی ندارد. سازمان تامین اجتماعی
بر اساس بخشنامه های درون سازمانی مقادیری را برای ارسال لیست بیمه در اختیار کارفرما قرار میدهد (لیست مشاغل مقطوع) که خارج از قوانین کار می باشد.
</p>
</div>
<div class="row m-t-5" style="padding: 1px 10px 1px 0px;">
<div class="col-xs-6 text-center">
<h5>مهر/امضاء/اثر انگشت کارفرما</h5>
</div>
<div class="col-xs-6 text-center">
<h5>امضاء/اثر انگشت کارگر</h5>
</div>
</div>
</fieldset>
</div>
</div>
</div>
}
@@ -458,28 +470,25 @@
</div>
<script>
$(document).ready(function () {
printElement(document.getElementById("printThis"));
});
$(document).ready(function() {
printElement(document.getElementById("printThis"));
});
function printElement(elem) {
var domClone = elem.cloneNode(true);
function printElement(elem) {
const domClone = elem.cloneNode(true);
var $printSection = document.getElementById("printSection");
var $printSection = document.getElementById("printSection");
if (!$printSection) {
$printSection = document.createElement("div");
$printSection.id = "printSection";
document.body.appendChild($printSection);
}
if (!$printSection) {
$printSection = document.createElement("div");
$printSection.id = "printSection";
document.body.appendChild($printSection);
}
$printSection.innerHTML = "";
$printSection.appendChild(domClone);
window.print();
}
$printSection.innerHTML = "";
$printSection.appendChild(domClone);
window.print();
}
</script>

View File

@@ -1,6 +1,6 @@
@model CompanyManagment.App.Contracts.Contract.GroupPrintViewModel
@{
<style>
<style>
.modal .modal-dialog .modal-content {
background-color: white !important;
}
@@ -126,292 +126,315 @@
</style>
}
<div class="modal-header" style="border-bottom: unset">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
</div>
<div class="modal-footer" style="border-top: unset; padding: 1px 15px 10px;">
<div class="modal-footer" style="border-top: unset; padding: 1px 15px 10px;">
<button id="btnPrint" type="button" class="btn btn-success btn-rounded waves-effect waves-light">پرینت قرارداد </button>
<button type="button" class="btn btn-warning btn-rounded waves-effect waves-light m-b-10" data-dismiss="modal">بستن فرم</button>
</div>
<div class="modal-body print" id="printThis">
<button id="btnPrint" type="button" class="btn btn-success btn-rounded waves-effect waves-light">پرینت قرارداد </button>
<button type="button" class="btn btn-warning btn-rounded waves-effect waves-light m-b-10" data-dismiss="modal">بستن فرم</button>
</div>
<div class="modal-body print" id="printThis">
@foreach (var item in @Model.ContractList)
{
<div class="container container2">
<div class="row">
<div class="col-md-12">
<fieldset style="border: 1px solid black; padding: revert; border-radius: 10px; height: 28cm; padding: 2mm">
<div class="row" dir="rtl">
<div class="col-xs-4 d-inline-block"><fieldset style="border: 1px solid black; border-radius: 10px; padding: 5px; margin-top: 5px; width: 180px;">شماره قرارداد :<span>&nbsp;</span> @item.ContractNo</fieldset></div>
<div class="col-xs-4 d-inline-block text-center"><h4>قرارداد کار</h4></div>
<div class="col-xs-4 d-inline-block"></div>
</div>
<div class="row text-center">
<h5>این قرارداد به موجب ماده 10 قانون کار جمهوری اسلامی ایران بین کارفرما و کارگر منعقد می گردد</h5>
</div>
<div class="row m-t-5">
<fieldset class="head" style="background-color: #ccc; border: 1px solid black; border-radius: 10px 10px 0px 0px; padding: 3px; margin: 4px 10px 0px 10px;"><h6 style="padding-right: 5px;">مشخصات کارفرما</h6></fieldset>
<fieldset style="border: 1px solid black; border-top: 0px; border-radius: 0px 0px 10px 10px; padding: 3px; margin: 0px 10px;">
<div class="row" style="padding: 4px;">
<div class="col-xs-2 fontBold">آقای/خانم/شرکت :</div>
<div class="col-xs-10">
<div class="row">
@foreach (var Employer in item.Employers)
{
if (Employer.NationalId == "*" || Employer.RegisterId == "*")
{
<div class="col-xs-4">@Employer.FullName</div>
<div class="col-xs-4"><span class="fontBold">کـــــد مـــلی</span> : <span class="fontNumber"> @Employer.Nationalcode</span></div>
<div class="col-xs-4">
<span class="fontBold">شماره شناسنامه </span> :
<span class="fontNumber">
@Employer.IdNumber
</span>
</div>
}
else
{
<div class="col-xs-4">@Employer.FullName </div>
<div class="col-xs-4 "><span class="fontBold">شناسه ملی </span> : <span class="fontNumber">@Employer.NationalId</span></div>
<div class="col-xs-4"><span class="fontBold">شماره ثـــــــــبــت </span> : <span class="fontNumber">@Employer.RegisterId</span></div>
}
@foreach (var item in Model.ContractList)
{
<div class="container container2">
<div class="row">
<div class="col-md-12">
<fieldset style="border: 1px solid black; padding: revert; border-radius: 10px; height: 28cm; padding: 2mm">
<div class="row" dir="rtl">
<div class="col-xs-4 d-inline-block">
<fieldset style="border: 1px solid black; border-radius: 10px; padding: 5px; margin-top: 5px; width: 180px;">شماره قرارداد :<span>&nbsp;</span> @item.ContractNo</fieldset>
</div>
<div class="col-xs-4 d-inline-block text-center">
<h4>قرارداد کار</h4>
</div>
<div class="col-xs-4 d-inline-block"></div>
</div>
<div class="row text-center">
<h5>این قرارداد به موجب ماده 10 قانون کار جمهوری اسلامی ایران بین کارفرما و کارگر منعقد می گردد</h5>
</div>
<div class="row m-t-5">
<fieldset class="head" style="background-color: #ccc; border: 1px solid black; border-radius: 10px 10px 0px 0px; padding: 3px; margin: 4px 10px 0px 10px;">
<h6 style="padding-right: 5px;">مشخصات کارفرما</h6>
</fieldset>
<fieldset style="border: 1px solid black; border-top: 0px; border-radius: 0px 0px 10px 10px; padding: 3px; margin: 0px 10px;">
<div class="row" style="padding: 4px;">
<div class="col-xs-2 fontBold">آقای/خانم/شرکت :</div>
<div class="col-xs-10">
<div class="row">
@foreach (var Employer in item.Employers)
{
if (Employer.NationalId == "*" || Employer.RegisterId == "*")
{
<div class="col-xs-4">@Employer.FullName</div>
<div class="col-xs-4"><span class="fontBold">کـــــد مـــلی</span> : <span class="fontNumber"> @Employer.Nationalcode</span></div>
<div class="col-xs-4">
<span class="fontBold">شماره شناسنامه </span> :
<span class="fontNumber">
@Employer.IdNumber
</span>
</div>
}
else
{
<div class="col-xs-4">@Employer.FullName </div>
<div class="col-xs-4 "><span class="fontBold">شناسه ملی </span> : <span class="fontNumber">@Employer.NationalId</span></div>
<div class="col-xs-4"><span class="fontBold">شماره ثـــــــــبــت </span> : <span class="fontNumber">@Employer.RegisterId</span></div>
}
}
</div>
</div>
}
</div>
</div>
</div>
</div>
<div class="row" style="padding: 4px">
@foreach (var Wk in item.Workshops)
{
<div class="col-xs-6"><span class="fontBold">نــــــام کـــــــارگـــاه</span> : <span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span> <span>@Wk.WorkshopName</span> </div>
<div class="col-xs-2"></div>
<div class="col-xs-4">
<span class="fontBold" style="margin-right: 41px;">کــــد کـــارگـاهـی</span> : <span>&nbsp;</span>
<span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>@Wk.InsuranceCode</span>
</div>
}
</div>
<div class="row" style="padding: 4px">
@foreach (var wk2 in item.Workshops)
{
<div class="col-xs-12"><span class="fontBold">بــــــه نــــــشـــانـی</span> : <span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span> <span>@wk2.Address</span> </div>
}
</div>
</fieldset>
</div>
<div class="row" style="padding: 4px">
@foreach (var Wk in item.Workshops)
{
<div class="col-xs-6"><span class="fontBold">نــــــام کـــــــارگـــاه</span> : <span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span> <span>@Wk.WorkshopName</span> </div>
<div class="col-xs-2"></div>
<div class="col-xs-4">
<span class="fontBold" style="margin-right: 41px;">کــــد کـــارگـاهـی</span> : <span>&nbsp;</span>
<span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>@Wk.InsuranceCode</span>
</div>
}
</div>
<div class="row" style="padding: 4px">
@foreach (var wk2 in item.Workshops)
{
<div class="col-xs-12"><span class="fontBold">بــــــه نــــــشـــانـی</span> : <span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span> <span>@wk2.Address</span> </div>
}
</div>
</fieldset>
</div>
<div class="row m-t-5">
<fieldset class="head" style="background-color: #ccc; border: 1px solid black; border-radius: 10px 10px 0px 0px; padding: 3px; margin: 4px 10px 0px 10px;">
<h6 style="padding-right: 5px;">مشخصات پرسنل</h6>
</fieldset>
<fieldset style="border: 1px solid black; border-top: 0px; border-radius: 0px 0px 10px 10px; padding: 3px; margin: 0px 10px; height: 3cm">
@foreach (var emloyee in item.Employees)
{
<div class="row" style="padding: 4px;">
<div class="col-xs-10">
<div class="row" style="padding: 4px;">
<div class="col-xs-5"><span class="fontBold">آقــا/خــانم</span> : <span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span> <span>@emloyee.EmployeeFullName</span></div>
<div class="col-xs-3"><span class="fontBold"> کد ملی</span> : <span>&nbsp;</span> <span class="fontNumber">@emloyee.NationalCode</span></div>
<div class="col-xs-4"><span class="fontBold">شماره شناسنامه</span> : <span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span> <span class="fontNumber">@emloyee.IdNumber</span></div>
</div>
<div class="row" style="padding: 4px;">
<div class="col-xs-5"><span class="fontBold">تاریخ تولد </span> : <span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span> <span class="fontNumber">@emloyee.DateOfBirth</span></div>
<div class="col-xs-3"><span class="fontBold"> نام پدر </span> :<span>&nbsp;</span> <span>@emloyee.FatherName</span></div>
<div class="col-xs-4"><span class="fontBold">میزان تحصیـلات </span> : <span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span> <span>@emloyee.FieldOfStudy</span></div>
</div>
<div class="row" style="padding: 4px;">
<div class="col-xs-8"><span class="fontBold"> بـه نـشانی </span> : <span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span> <span>@emloyee.Address</span></div>
</div>
</div>
<div class="col-xs-2">
<span style="width: 2cm; height: 2.5cm; border: 1px solid #999595; border-radius: 7px; position: absolute; left: 15px;">
<h5 style="text-align: center; margin-top: 20px !important; color: #a5a9a9 !important; line-height: 1.5;">
عکس<br/> پرسنل
</h5>
</span>
</div>
</div>
}
</fieldset>
</div>
<div class="row m-t-5">
<fieldset class="head" style="background-color: #ccc; border: 1px solid black; border-radius: 10px 10px 0px 0px; padding: 3px; margin: 4px 10px 0px 10px;">
<h6 style="padding-right: 5px;">مدت و نوع قرارداد </h6>
</fieldset>
<fieldset style="border: 1px solid black; border-top: 0px; border-radius: 0px 0px 10px 10px; padding: 3px; margin: 0px 10px;">
<div class="row" style="padding: 4px;">
<div class="col-xs-4">
<span class="fontBold"> نوع قرارداد </span> : <span>&nbsp;</span><span>&nbsp;</span>
<div class="row m-t-5">
<fieldset class="head" style="background-color: #ccc; border: 1px solid black; border-radius: 10px 10px 0px 0px; padding: 3px; margin: 4px 10px 0px 10px;"><h6 style="padding-right: 5px;">مشخصات پرسنل</h6></fieldset>
<fieldset style="border: 1px solid black; border-top: 0px; border-radius: 0px 0px 10px 10px; padding: 3px; margin: 0px 10px; height: 3cm">
@foreach (var emloyee in item.Employees)
{
<div class="row" style="padding: 4px;">
<div class="col-xs-10">
<div class="row" style="padding: 4px;">
<div class="col-xs-5"><span class="fontBold">آقــا/خــانم</span> : <span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span> <span>@emloyee.EmployeeFullName</span></div>
<div class="col-xs-3"><span class="fontBold"> کد ملی</span> : <span>&nbsp;</span> <span class="fontNumber">@emloyee.NationalCode</span></div>
<div class="col-xs-4"><span class="fontBold">شماره شناسنامه</span> : <span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span> <span class="fontNumber">@emloyee.IdNumber</span></div>
</div>
<div class="row" style="padding: 4px;">
<div class="col-xs-5"><span class="fontBold">تاریخ تولد </span> : <span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span> <span class="fontNumber">@emloyee.DateOfBirth</span></div>
<div class="col-xs-3"><span class="fontBold"> نام پدر </span> :<span>&nbsp;</span> <span>@emloyee.FatherName</span></div>
<div class="col-xs-4"><span class="fontBold">میزان تحصیـلات </span> : <span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span> <span>@emloyee.FieldOfStudy</span></div>
</div>
<div class="row" style="padding: 4px;">
<div class="col-xs-8"><span class="fontBold"> بـه نـشانی </span> : <span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span> <span>@emloyee.Address</span></div>
</div>
</div>
<div class="col-xs-2">
<span style="width: 2cm; height: 2.5cm; border: 1px solid #999595; border-radius: 7px; position: absolute; left: 15px;">
<h5 style="text-align: center; margin-top: 20px !important; color: #a5a9a9 !important; line-height: 1.5;">
عکس<br /> پرسنل
</h5>
</span>
</div>
</div>
}
</fieldset>
</div>
<div class="row m-t-5">
<fieldset class="head" style="background-color: #ccc; border: 1px solid black; border-radius: 10px 10px 0px 0px; padding: 3px; margin: 4px 10px 0px 10px;"><h6 style="padding-right: 5px;">مدت و نوع قرارداد </h6></fieldset>
<fieldset style="border: 1px solid black; border-top: 0px; border-radius: 0px 0px 10px 10px; padding: 3px; margin: 0px 10px;">
<div class="row" style="padding: 4px;">
<div class="col-xs-4">
<span class="fontBold"> نوع قرارداد </span> : <span>&nbsp;</span><span>&nbsp;</span>
<span class="radio-info">
@if (item.ContractType == "دائم")
{
<input style="vertical-align: sub;" type="radio" id="inlineRadio3" name="@item.Id" checked="checked">
<label for="inlineRadio3"> دائم </label>
}
else
{
<input style="vertical-align: sub;" type="radio" id="inlineRadio3" name="@item.Id">
<label for="inlineRadio3"> دائم </label>
}
</span><span>&nbsp;</span><span>&nbsp;</span>
<span class="radio-info">
@if (item.ContractType == "موقت")
{
<input style="vertical-align: sub;" type="radio" id="inlineRadio3" name="@item.Id" checked="checked">
<label for="inlineRadio3"> موقت </label>
}
else
{
<input style="vertical-align: sub;" type="radio" id="inlineRadio3" name="@item.Id">
<label for="inlineRadio3"> موقت </label>
}
</span><span>&nbsp;</span><span>&nbsp;</span>
<span class="radio-info">
@if (item.ContractType == "معین")
{
<input style="vertical-align: sub;" type="radio" id="inlineRadio3" name="@item.Id" checked="checked">
<label for="inlineRadio3"> معین </label>
}
else
{
<input style="vertical-align: sub;" type="radio" id="inlineRadio3" name="@item.Id">
<label for="inlineRadio3"> معین </label>
}
</span>
</div>
<div class="col-xs-8" style="margin-top: 3px;">
<span class="fontBold">نوع کار یا حرفه یا حجم کار یا وظیفه ای که کارگر به آن اشتغال می یابد</span> :
<span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span>
<span>@item.JobType</span>
</div>
</div>
<div class="row" style="padding: 4px;">
<div class="col-xs-4">
<span class="fontBold">تاریخ انعقاد قرارداد</span> :
<span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span>
<span class="fontNumber">@item.SetContractDate</span>
</div>
</div>
<div class="row" style="padding: 4px;">
<div class="col-xs-8">
<span class="fontBold">مـــدت قـــــــــــرارداد</span> :
<span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span>
<span class="fontNumber">@item.ContarctStart</span><span>&nbsp;</span><span>&nbsp;</span>
<span>الی</span><span>&nbsp;</span><span>&nbsp;</span>
<span class="fontNumber">@item.ContractEnd</span><span>&nbsp;</span><span>&nbsp;</span>
</div>
<span class="radio-info">
@if (item.ContractType == "دائم")
{
<input style="vertical-align: sub;" type="radio" id="inlineRadio3" name="@item.Id" checked="checked">
<label for="inlineRadio3"> دائم </label>
}
else
{
<input style="vertical-align: sub;" type="radio" id="inlineRadio3" name="@item.Id">
<label for="inlineRadio3"> دائم </label>
}
</span><span>&nbsp;</span><span>&nbsp;</span>
<span class="radio-info">
@if (item.ContractType == "موقت")
{
<input style="vertical-align: sub;" type="radio" id="inlineRadio3" name="@item.Id" checked="checked">
<label for="inlineRadio3"> موقت </label>
}
else
{
<input style="vertical-align: sub;" type="radio" id="inlineRadio3" name="@item.Id">
<label for="inlineRadio3"> موقت </label>
}
</span><span>&nbsp;</span><span>&nbsp;</span>
<span class="radio-info">
@if (item.ContractType == "معین")
{
<input style="vertical-align: sub;" type="radio" id="inlineRadio3" name="@item.Id" checked="checked">
<label for="inlineRadio3"> معین </label>
}
else
{
<input style="vertical-align: sub;" type="radio" id="inlineRadio3" name="@item.Id">
<label for="inlineRadio3"> معین </label>
}
</span>
</div>
<div class="col-xs-8" style="margin-top: 3px;">
<span class="fontBold">نوع کار یا حرفه یا حجم کار یا وظیفه ای که کارگر به آن اشتغال می یابد</span> :
<span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span>
<span>@item.JobType</span>
</div>
</div>
<div class="row" style="padding: 4px;">
<div class="col-xs-4">
<span class="fontBold">تاریخ انعقاد قرارداد</span> :
<span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span>
<span class="fontNumber">@item.SetContractDate</span>
</div>
</div>
<div class="row" style="padding: 4px;">
<div class="col-xs-8">
<span class="fontBold">مـــدت قـــــــــــرارداد</span> :
<span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span>
<span class="fontNumber">@item.ContarctStart</span><span>&nbsp;</span><span>&nbsp;</span>
<span>الی</span><span>&nbsp;</span><span>&nbsp;</span>
<span class="fontNumber">@item.ContractEnd</span><span>&nbsp;</span><span>&nbsp;</span>
</div>
</div>
<div class="row" style="padding: 4px;">
<div class="col-xs-4">
<span class="fontBold">ساعت کار در هفته</span> :
<span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span>
<span class="fontNumber">@item.WorkingHoursWeekly</span>
</div>
</div>
<div class="row" style="padding: 4px;">
<div class="col-xs-4">
<span class="fontBold">ساعت کار در هفته</span> :
<span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span>
<span class="fontNumber">@item.WorkingHoursWeekly</span>
</div>
</div>
<div class="row" style="padding: 4px; padding-right: 15px">
<span class="fontBold">
@if (item.WorkshopAddress2 != null)
{
<span>محـل انــجـام کـار 1</span>
}
else
{
<span>محـل انــــجـام کـــار </span>
}
</span> : <span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span>
<span>@item.WorkshopAddress1</span>
</div>
@if (item.WorkshopAddress2 != null)
{
<div class="row" style="padding: 4px; padding-right: 15px">
<span class="fontBold">محـل انــجـام کـار 2</span> : <span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span>
<span>@item.WorkshopAddress2</span>
</div>
}
</div>
<div class="row" style="padding: 4px; padding-right: 15px">
<span class="fontBold">
@if (item.WorkshopAddress2 != null)
{<span>محـل انــجـام کـار 1</span>}
else
{<span>محـل انــــجـام کـــار </span>}
</span> : <span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span>
<span>@item.WorkshopAddress1</span>
</div>
@if (item.WorkshopAddress2 != null)
{
<div class="row" style="padding: 4px; padding-right: 15px">
<span class="fontBold">محـل انــجـام کـار 2</span> : <span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span>
<span>@item.WorkshopAddress2</span>
</div>
}
</fieldset>
</div>
<div class="row m-t-5">
<fieldset class="head" style="background-color: #ccc; border: 1px solid black; border-radius: 10px 10px 0px 0px; padding: 3px; margin: 4px 10px 0px 10px;">
<h6 style="padding-right: 5px;">حق السعی </h6>
</fieldset>
<fieldset style="border: 1px solid black; border-top: 0px; border-radius: 0px 0px 10px 10px; padding: 3px; margin: 0px 10px;">
<div class="row" style="padding: 7px;">
<div class="col-xs-3">
<span class="fontBold"> مزد روزانه : </span>
</div>
<div class="col-xs-3">
<span>@item.DayliWage</span><span>&nbsp;</span><span>ریال</span>
</div>
<div class="col-xs-2">
<span class="fontBold"> حق عائله مندی : </span>
</div>
<div class="col-xs-4">
@if (item.FamilyAllowance != "0")
{
<span>@item.FamilyAllowance</span>
<span>&nbsp;</span>
<span>ریال</span>
}
</div>
</div>
<div class="row" style="padding: 7px;">
<div class="col-xs-3">
<span class="fontBold"> کمک هزینه اقلام مصرفی خواربار : </span>
</div>
<div class="col-xs-9">
<span>@item.ConsumableItems</span><span>&nbsp;</span><span>ریال</span>
</div>
</div>
<div class="row" style="padding: 7px;">
<div class="col-xs-3">
<span class="fontBold"> کمک هزینه مسکن : </span>
</div>
<div class="col-xs-9">
<span>@item.HousingAllowance</span><span>&nbsp;</span><span>ریال</span>
</div>
</div>
</fieldset>
</div>
<div class="row m-t-5">
<fieldset class="head" style="background-color: #ccc; border: 1px solid black; border-radius: 10px 10px 0px 0px; padding: 3px; margin: 4px 10px 0px 10px;">
<h6 style="padding-right: 5px;"> شروط و توضیحات </h6>
</fieldset>
<fieldset style="border: 1px solid black; border-top: 0px; border-radius: 0px 0px 10px 10px; padding: 3px; margin: 0px 10px;">
<textarea class="form-control" style="height: 80px;"></textarea>
</fieldset>
</div>
</fieldset>
</div>
<div class="row m-t-5">
<fieldset class="head" style="background-color: #ccc; border: 1px solid black; border-radius: 10px 10px 0px 0px; padding: 3px; margin: 4px 10px 0px 10px;"><h6 style="padding-right: 5px;">حق السعی </h6></fieldset>
<fieldset style="border: 1px solid black; border-top: 0px; border-radius: 0px 0px 10px 10px; padding: 3px; margin: 0px 10px;">
<div class="row" style="padding: 7px;">
<div class="col-xs-3">
<span class="fontBold"> مزد روزانه : </span>
</div>
<div class="col-xs-3">
<span>@item.DayliWage</span><span>&nbsp;</span><span>ریال</span>
</div>
<div class="col-xs-2">
<span class="fontBold"> حق عائله مندی : </span>
</div>
<div class="col-xs-4">
@if (item.FamilyAllowance != "0")
{
<span>@item.FamilyAllowance</span><span>&nbsp;</span><span>ریال</span>
}
</div>
</div>
<div class="row" style="padding: 7px;">
<div class="col-xs-3">
<span class="fontBold"> کمک هزینه اقلام مصرفی خواربار : </span>
</div>
<div class="col-xs-9">
<span>@item.ConsumableItems</span><span>&nbsp;</span><span>ریال</span>
</div>
</div>
<div class="row" style="padding: 7px;">
<div class="col-xs-3">
<span class="fontBold"> کمک هزینه مسکن : </span>
</div>
<div class="col-xs-9">
<span>@item.HousingAllowance</span><span>&nbsp;</span><span>ریال</span>
</div>
</div>
</fieldset>
</div>
<div class="row m-t-5">
<fieldset class="head" style="background-color: #ccc; border: 1px solid black; border-radius: 10px 10px 0px 0px; padding: 3px; margin: 4px 10px 0px 10px;"><h6 style="padding-right: 5px;"> شروط و توضیحات </h6></fieldset>
<fieldset style="border: 1px solid black; border-top: 0px; border-radius: 0px 0px 10px 10px; padding: 3px; margin: 0px 10px;">
<textarea class="form-control" style="height: 80px;"></textarea>
</fieldset>
</div>
<div class="row m-t-5" style="padding: 1px 10px 1px 10px ;">
<p style="margin-bottom: 2px !important">بیمه : به موجب ماده 148 قانون کار، کارفرما مکلف است کارگر را نزد سازمان تامین اجتماعی بیمه نماید.</p>
<p style="margin-bottom: 2px !important">یک نسخه از این قرارداد در ید کارگر می باشد و هر یک از نسخه های قرارداد، اعتبار و حکم واحد دارند.</p>
<p style="text-align: justify; margin-bottom: 2px !important">
مبلغ مزد روزانه در این قرارداد بر اساس قوانین کار می باشد و هیچگونه ارتباطی با تنظیم و ارسال لیست بیمه سازمان تامین اجتماعی ندارد. سازمان تامین اجتماعی
بر اساس بخشنامه های درون سازمانی مقادیری را برای ارسال لیست بیمه در اختیار کارفرما قرار میدهد (لیست مشاغل مقطوع) که خارج از قوانین کار می باشد.
</p>
</div>
<div class="row m-t-5" style="padding: 1px 10px 1px 0px;">
<div class="col-xs-6 text-center">
<h5>مهر/امضاء/اثر انگشت کارفرما</h5>
</div>
<div class="col-xs-6 text-center">
<h5>امضاء/اثر انگشت کارگر</h5>
</div>
</div>
</fieldset>
</div>
</div>
</div>
}
</div>
<script>
document.getElementById("btnPrint").onclick = function() {
printElement(document.getElementById("printThis"));
};
<div class="row m-t-5" style="padding: 1px 10px 1px 10px ;">
<p style="margin-bottom: 2px !important">بیمه : به موجب ماده 148 قانون کار، کارفرما مکلف است کارگر را نزد سازمان تامین اجتماعی بیمه نماید.</p>
<p style="margin-bottom: 2px !important">یک نسخه از این قرارداد در ید کارگر می باشد و هر یک از نسخه های قرارداد، اعتبار و حکم واحد دارند.</p>
<p style="text-align: justify; margin-bottom: 2px !important">
مبلغ مزد روزانه در این قرارداد بر اساس قوانین کار می باشد و هیچگونه ارتباطی با تنظیم و ارسال لیست بیمه سازمان تامین اجتماعی ندارد. سازمان تامین اجتماعی
بر اساس بخشنامه های درون سازمانی مقادیری را برای ارسال لیست بیمه در اختیار کارفرما قرار میدهد (لیست مشاغل مقطوع) که خارج از قوانین کار می باشد.
</p>
</div>
<div class="row m-t-5" style="padding: 1px 10px 1px 0px;">
<div class="col-xs-6 text-center"><h5>مهر/امضاء/اثر انگشت کارفرما</h5></div>
<div class="col-xs-6 text-center"><h5>امضاء/اثر انگشت کارگر</h5></div>
</div>
</fieldset>
</div>
</div>
</div>
}
</div>
<script>
document.getElementById("btnPrint").onclick = function () {
printElement(document.getElementById("printThis"));
}
function printElement(elem) {
const domClone = elem.cloneNode(true);
function printElement(elem) {
var domClone = elem.cloneNode(true);
var $printSection = document.getElementById("printSection");
var $printSection = document.getElementById("printSection");
if (!$printSection) {
$printSection = document.createElement("div");
$printSection.id = "printSection";
document.body.appendChild($printSection);
}
if (!$printSection) {
$printSection = document.createElement("div");
$printSection.id = "printSection";
document.body.appendChild($printSection);
}
$printSection.innerHTML = "";
$printSection.appendChild(domClone);
window.print();
}
</script>
$printSection.innerHTML = "";
$printSection.appendChild(domClone);
window.print();
}
</script>

View File

@@ -1,8 +1,7 @@
@model CompanyManagment.App.Contracts.Contract.ExtensionViewModel
@{
int i = 1;
int b = 0;
var i = 1;
var b = 0;
@@ -15,72 +14,66 @@
@if (Model.Contracts != null)
{
@foreach (var item in Model.Contracts)
{
@if (Model.Contracts != null)
{
@foreach (var item in Model.Contracts)
{
<tr>
@if (item.RedColor)
{
<input type="hidden" name="redColor"/>
}
@if (item.MoreThanOneMonth && item.Waiting == false)
{
<input type="hidden" value="@item.EmployeeName" name="MoreThanOneMonth"/>
}
else if (item.Waiting && item.MoreThanOneMonth == false)
{
<input type="hidden" value="@item.EmployeeName" name="Waiting"/>
}
else if (item.Waiting && item.MoreThanOneMonth)
{
<input type="hidden" value="@item.EmployeeName" name="MixWatingAndMore"/>
}
<td style="font-size: 12px !important; text-align: center">
@i
</td>
<td style="font-size: 12px !important; text-align: center">
@if (Model.FormStep == "convert")
{
@if (item.Extension)
{
<input type="checkbox" name="cheking" value="@item.Id" checked="checked"/>
<tr>
@if (item.RedColor)
{
<input type="hidden" name="redColor" />
}
@if (item.MoreThanOneMonth && item.Waiting == false)
{
<input type="hidden" value="@item.EmployeeName" name="MoreThanOneMonth" />
}
else if (item.Waiting && item.MoreThanOneMonth == false)
{
<input type="hidden" value="@item.EmployeeName" name="Waiting" />
}
else if (item.Waiting && item.MoreThanOneMonth)
{
<input type="hidden" value="@item.EmployeeName" name="MixWatingAndMore" />
}
<td style="font-size: 12px !important; text-align: center">
@i
</td>
<td style="font-size: 12px !important; text-align: center">
@if (@Model.FormStep == "convert")
{
@if (item.Extension)
{
b++;
}
else
{
@if (item.RedColor)
{
<input type="checkbox" value="@item.Id" disabled="disabled"/>
}
else
{
<input type="checkbox" name="cheking" value="@item.Id"/>
}
}
}
</td>
<input type="checkbox" name="cheking" value="@item.Id" checked="checked"/>
<td style="font-family: 'IranText' !important; font-size: 12px !important; text-align: center">
b++;
}
else
{
@if (item.RedColor)
{
<input type="checkbox" value="@item.Id" disabled="disabled"/>
}
else
{
<input type="checkbox" name="cheking" value="@item.Id"/>
}
}
}
</td>
<td style="font-family: 'IranText' !important; font-size: 12px !important; text-align: center">
@item.ContractNo
@item.ContractNo
</td>
</td>
<td style="font-family: 'IranSans' !important; font-size: 12px !important; text-align: right">
@*@foreach (var emp in Model.Employers)
<td style="font-family: 'IranSans' !important; font-size: 12px !important; text-align: right">
@*@foreach (var emp in Model.Employers)
{
if (item.EmployerId == emp.Id)
{
@@ -88,178 +81,155 @@
}
}*@
@item.EmployerName
</td>
@item.EmployerName
</td>
<td style="font-family: 'IranSans' !important; font-size: 12px !important; text-align: right">
<td style="font-family: 'IranSans' !important; font-size: 12px !important; text-align: right">
@item.WorkshopName
</td>
@item.WorkshopName
</td>
<td style="font-family: 'IranSans' !important; font-size: 12px !important; text-align: right">
@item.EmployeeName
<td style="font-family: 'IranSans' !important; font-size: 12px !important; text-align: right">
</td>
@item.EmployeeName
</td>
<td style="font-family: 'IranSans' !important; font-size: 12px !important; text-align: center">
@item.ContarctStart
</td>
<td style="font-family: 'IranSans' !important; font-size: 12px !important; text-align: center">
@if (item.LaterThanEnd)
{
<span style="visibility: hidden">####/##/##</span>
}
else
{
@item.ContractEnd
}
</td>
<td style="font-family: 'IranSans' !important; font-size: 12px !important; text-align: center">
@if (item.RedColor == false)
{
<span style="color: #1e88e5;">
@item.NextMonthStart
</span>
}
@if (item.NextMonthStart == null)
{
<span style="visibility: hidden">####/##/##</span>
}
</td>
<td style="font-family: 'IranSans' !important; font-size: 12px !important; text-align: center">
@if (item.RedColor == false)
{
<span style="color: #1e88e5;">
@item.NextMonthEnd
</span>
}
@if (item.NextMonthEnd == null)
{
<span style="visibility: hidden">####/##/##</span>
}
</td>
<td style="font-family: 'IranSans' !important; font-size: 12px !important; text-align: center">
<td style="font-family: 'IranSans' !important; font-size: 12px !important; text-align: center">
@item.ContarctStart
@if (item.LaterThanEnd)
{
@item.ContractEnd
}
else
{
<span style="visibility: hidden">####/##/##</span>
}
</td>
</td>
<td style="font-family: 'IranSans' !important; font-size: 12px !important; text-align: center">
@if (item.LaterThanEnd)
{
<span style="visibility: hidden">####/##/##</span>
}
else
{
@item.ContractEnd
}
</td>
<td style="font-family: 'IranSans' !important; font-size: 12px !important; text-align: center">
@if (item.RedColor == false)
{
<span style="color: #1e88e5;">
@item.NextMonthStart
</span>
}
@if (@item.NextMonthStart == null)
{
<span style="visibility: hidden">####/##/##</span>
}
</td>
<td style="font-family: 'IranSans' !important; font-size: 12px !important; text-align: center">
@if (item.RedColor == false)
{
<span style="color: #1e88e5;">
@item.NextMonthEnd
</span>
}
@if (@item.NextMonthEnd == null)
{
<span style="visibility: hidden">####/##/##</span>
}
</td>
<td style="font-family: 'IranSans' !important; font-size: 12px !important; text-align: center">
@if (item.LaterThanEnd)
{
@item.ContractEnd
}
else
{
<span style="visibility: hidden">####/##/##</span>
}
</td>
@{
i++;
}
</tr>
}
}
@{
i++;
}
</tr>
}
}
<script>
//var redCheck = $('.redColor').val();
//if (redCheck == true) {
// console.log("ok");
// $('.redColor').closest('tr').css("background", "red");
//}
var checkboxes = document.getElementsByName('redColor');
for (var i = 0, n = checkboxes.length; i < n; i++) {
checkboxes[i].parentNode.style.background = "#ff8f8d";
}
var checkboxes = document.getElementsByName('Waiting');
for (var i = 0, n = checkboxes.length; i < n; i++) {
checkboxes[i].parentNode.style.background = "#ffcd40";
}
var checkboxes = document.getElementsByName('MoreThanOneMonth');
for (var i = 0, n = checkboxes.length; i < n; i++) {
checkboxes[i].parentNode.style.background = "#cbff7c";
}
var checkboxes = document.getElementsByName('MixWatingAndMore');
for (var i = 0, n = checkboxes.length; i < n; i++) {
checkboxes[i].parentNode.style.background = "#ffcd40";
}
var checkboxes2 = document.getElementsByName('MixWatingAndMore');
for (var s = 0, m = checkboxes2.length; s < m; s++) {
$('#alarm').append(
'<h5 style="color:red; direction: rtl;" class="ConvertErr"><span> مدت قرارد </span> <span>&nbsp;</span><span>' + checkboxes2[s].value + '</span> <span>&nbsp;</span><span> بیش از یک ماه است</span></h5>'
+ '<h5 style="color: #ffa12c; direction: rtl;" class="ConvertErr"><span> از آخرین قرارداد </span> <span>&nbsp;</span><span>' + checkboxes2[s].value + '</span> <span>&nbsp;</span><span> تا تاریخ تبدیل انتخاب شده هیچ قراردادی وجود ندارد</span></h5>'
);
}
var checkboxes2 = document.getElementsByName('MoreThanOneMonth');
for (var b = 0, m = checkboxes2.length; b < m; b++) {
$('#alarm').append(
'<h5 style="color:red; direction: rtl;" class="ConvertErr"><span> مدت قرارد </span> <span>&nbsp;</span><span>' + checkboxes2[b].value + '</span> <span>&nbsp;</span><span> بیش از یک ماه است</span></h5>'
);
}
var checkboxes3 = document.getElementsByName('Waiting');
for (var a = 0, f = checkboxes3.length; a < f; a++) {
$('#alarm').append(
'<h5 style="color: #ffa12c; direction: rtl;" class="ConvertErr"><span> از آخرین قرارداد </span> <span>&nbsp;</span><span>' + checkboxes3[a].value + '</span> <span>&nbsp;</span><span> تا تاریخ تبدیل انتخاب شده هیچ قراردادی وجود ندارد</span></h5>'
);
}
/*ff8f8d*/
</script>
//var redCheck = $('.redColor').val();
//if (redCheck == true) {
// console.log("ok");
// $('.redColor').closest('tr').css("background", "red");
//}
var checkboxes = document.getElementsByName('redColor');
for (var i = 0, n = checkboxes.length; i < n; i++) {
checkboxes[i].parentNode.style.background = "#ff8f8d";
}
var checkboxes = document.getElementsByName('Waiting');
for (var i = 0, n = checkboxes.length; i < n; i++) {
checkboxes[i].parentNode.style.background = "#ffcd40";
}
var checkboxes = document.getElementsByName('MoreThanOneMonth');
for (var i = 0, n = checkboxes.length; i < n; i++) {
checkboxes[i].parentNode.style.background = "#cbff7c";
}
var checkboxes = document.getElementsByName('MixWatingAndMore');
for (var i = 0, n = checkboxes.length; i < n; i++) {
checkboxes[i].parentNode.style.background = "#ffcd40";
}
var checkboxes2 = document.getElementsByName('MixWatingAndMore');
for (var s = 0, m = checkboxes2.length; s < m; s++) {
$('#alarm').append(
`<h5 style="color:red; direction: rtl;" class="ConvertErr"><span> مدت قرارد </span> <span>&nbsp;</span><span>${checkboxes2[s].value
}</span> <span>&nbsp;</span><span> بیش از یک ماه است</span></h5><h5 style="color: #ffa12c; direction: rtl;" class="ConvertErr"><span> از آخرین قرارداد </span> <span>&nbsp;</span><span>${
checkboxes2[s].value}</span> <span>&nbsp;</span><span> تا تاریخ تبدیل انتخاب شده هیچ قراردادی وجود ندارد</span></h5>`
);
}
var checkboxes2 = document.getElementsByName('MoreThanOneMonth');
for (var b = 0, m = checkboxes2.length; b < m; b++) {
$('#alarm').append(
`<h5 style="color:red; direction: rtl;" class="ConvertErr"><span> مدت قرارد </span> <span>&nbsp;</span><span>${checkboxes2[b].value
}</span> <span>&nbsp;</span><span> بیش از یک ماه است</span></h5>`
);
}
var checkboxes3 = document.getElementsByName('Waiting');
for (var a = 0, f = checkboxes3.length; a < f; a++) {
$('#alarm').append(
`<h5 style="color: #ffa12c; direction: rtl;" class="ConvertErr"><span> از آخرین قرارداد </span> <span>&nbsp;</span><span>${
checkboxes3[a].value}</span> <span>&nbsp;</span><span> تا تاریخ تبدیل انتخاب شده هیچ قراردادی وجود ندارد</span></h5>`
);
}
/*ff8f8d*/
</script>

View File

@@ -1,7 +1,6 @@
@using _0_Framework.Application
@model CompanyManagment.App.Contracts.CrossJobGuild.CreateCrossJobGuild
@model CompanyManagment.App.Contracts.CrossJobGuild.CreateCrossJobGuild
@{
<style>
<style>
.select2-container {
width: 100% !important;
}
@@ -35,168 +34,168 @@
}
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<form asp-page="./Index" asp-page-handler="Create" id="workshops" autocomplete="off"
method="post"
data-ajax="true"
data-callback=""
data-action="Refresh"
enctype="multipart/form-data">
<div class="modal-body">
<div class="row">
<fieldset style="border: 1px solid #999797; border-radius: 10px; padding: revert">
<legend style="margin-bottom: 5px; font-size: large; border-bottom: 0px; color: #505458; width: 380px; text-align: center;">
ثبت مشاغل قیمت مقطوع سازمان تامین اجتماعی
</legend>
<div class="row">
<div class="col-md-2">
<div class="form-group">
<label asp-for="Year" class="control-label"> سال </label>
<input type="text" class="form-control" asp-for="Year" data-val="true" data-val-required="فیلد الزامی است">
<span asp-validation-for="Year" class="error"></span>
</div>
</div>
</div>
<div class="row">
<div class="col-md-4">
<div class="form-group">
<label asp-for="Title" class="control-label"> عنوان صنف و درجه </label>
<input type="text" class="form-control" asp-for="Title" data-val="true" data-val-required="فیلد الزامی است">
<span asp-validation-for="Title" class="error"></span>
</div>
</div>
</div>
<div class="row">
<div class="col-md-2">
<label asp-for="EconomicCode" class="control-label"> کد اقتصادی </label>
</div>
</div>
<div class="row">
<div id="ecoList">
<form asp-page="./Index" asp-page-handler="Create" id="workshops" autocomplete="off"
method="post"
data-ajax="true"
data-callback=""
data-action="Refresh"
enctype="multipart/form-data">
<div class="modal-body">
<div class="row">
<fieldset style="border: 1px solid #999797; border-radius: 10px; padding: revert">
<legend style="margin-bottom: 5px; font-size: large; border-bottom: 0px; color: #505458; width: 380px; text-align: center;">
ثبت مشاغل قیمت مقطوع سازمان تامین اجتماعی
</legend>
<div class="row">
<div class="col-md-2">
<div class="form-group">
<label asp-for="Year" class="control-label"> سال </label>
<input type="text" class="form-control" asp-for="Year" data-val="true" data-val-required="فیلد الزامی است">
<span asp-validation-for="Year" class="error"></span>
</div>
</div>
</div>
<div class="row">
<div class="col-md-4">
<div class="form-group">
<label asp-for="Title" class="control-label"> عنوان صنف و درجه </label>
<input type="text" class="form-control" asp-for="Title" data-val="true" data-val-required="فیلد الزامی است">
<span asp-validation-for="Title" class="error"></span>
</div>
</div>
</div>
<div class="row">
<div class="col-md-2">
<label asp-for="EconomicCode" class="control-label"> کد اقتصادی </label>
</div>
</div>
<div class="row">
<div id="ecoList">
<div class="col-md-2">
<div class="form-group">
<input type="number" class="form-control" asp-for="economicCodeList[0]" maxlength="5"
data-val="true" data-val-required="فیلد الزامی است" data-val-number="فقط عدد وارد نمایید"
data-val-maxlength="بیشتر از 5 رقم مجاز نیست"
data-val-maxlength-max="5">
<span asp-validation-for="economicCodeList[0]" style="font-size: 10px !important; text-align: center"
class="error">
</span>
<div class="col-md-2">
<div class="form-group">
<input type="number" class="form-control" asp-for="economicCodeList[0]" maxlength="5"
data-val="true" data-val-required="فیلد الزامی است" data-val-number="فقط عدد وارد نمایید"
data-val-maxlength="بیشتر از 5 رقم مجاز نیست"
data-val-maxlength-max="5">
<span asp-validation-for="economicCodeList[0]" style="font-size: 10px !important; text-align: center"
class="error">
</span>
</div>
</div>
</div>
<div class="col-md-2">
<div class="form-group">
<button type="button" onclick="addrowEconomicCode()"
class="btn btn-sm btn-success btn-rounded waves-effect waves-light ">
+ افزودن
</button>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="col-md-2">
<div class="form-group">
<button type="button" onclick="addrowEconomicCode()"
class="btn btn-sm btn-success btn-rounded waves-effect waves-light ">
+ افزودن
</button>
</div>
</div>
</div>
<table id="datatableCreate" class="table table-bordered">
<thead style="background-color:#a9fcff">
<tr>
<th style=" text-align: center; vertical-align: middle;" rowspan="2">#</th>
<th style=" font-size: 20px; text-align: center; vertical-align: middle" rowspan="2" colspan="1"> مشاغل </th>
<th style=" font-size: 20px; text-align: center; vertical-align: middle" colspan="2"> برای شهرهای کمتر از 500000 نفر </th>
<th style=" font-size: 20px; text-align: center; vertical-align: middle" colspan="3"> برای شهرهای بیشتر از 500000 نفر </th>
</tr>
<table id="datatableCreate" class="table table-bordered">
<thead style="background-color:#a9fcff">
<tr>
<th style=" text-align: center; vertical-align: middle;" rowspan="2">#</th>
<th style=" font-size: 20px; text-align: center; vertical-align: middle" rowspan="2" colspan="1"> مشاغل </th>
<th style=" font-size: 20px; text-align: center; vertical-align: middle" colspan="2"> برای شهرهای کمتر از 500000 نفر </th>
<th style=" font-size: 20px; text-align: center; vertical-align: middle" colspan="3"> برای شهرهای بیشتر از 500000 نفر </th>
</tr>
<tr>
<th style=" font-size: 15px; text-align: center; vertical-align: middle"> به نسبت حداقل دستمزد </th>
<th style=" font-size: 15px; text-align: center; vertical-align: middle"> معادل ریالی </th>
<th style=" font-size: 15px; text-align: center; vertical-align: middle"> به نسبت حداقل دستمزد </th>
<th style=" font-size: 15px; text-align: center; vertical-align: middle" colspan="2"> معادل ریالی </th>
</tr>
</thead>
@{
var i = 0;
}
<tbody id="datatableTbody_@i">
<tr id="datatableTr">
<td style="font-size: 14px !important; text-align: center" class="order">
1
</td>
@{
var idstr = "crossJobsList_" + i + "__TitleStr";
var namestr = "crossJobsList[" + i + "].TitleStr";
<tr>
<th style=" font-size: 15px; text-align: center; vertical-align: middle"> به نسبت حداقل دستمزد </th>
<th style=" font-size: 15px; text-align: center; vertical-align: middle"> معادل ریالی </th>
<th style=" font-size: 15px; text-align: center; vertical-align: middle"> به نسبت حداقل دستمزد </th>
<th style=" font-size: 15px; text-align: center; vertical-align: middle" colspan="2"> معادل ریالی </th>
</tr>
</thead>
@{
var i = 0;
}
<tbody id="datatableTbody_@i">
<tr id="datatableTr">
<td style="font-size: 14px !important; text-align: center" class="order">
1
</td>
@{
var idstr = "crossJobsList_" + i + "__TitleStr";
var namestr = "crossJobsList[" + i + "].TitleStr";
var h = "textareacrossJobsList_" + i + "__Title";
var n = "textareacrossJobsList[" + i + "].Title";
var h = "textareacrossJobsList_" + i + "__Title";
var n = "textareacrossJobsList[" + i + "].Title";
var Listid = "crossJobsList_" + i + "__jobItems";
var ListName = "crossJobsList[" + i + "].jobItems";
var Listid = "crossJobsList_" + i + "__jobItems";
var ListName = "crossJobsList[" + i + "].jobItems";
}
<td style="font-size: 14px !important; text-align: right !important;width:240px !important;" class="crossJobssession">
<select id=@Listid name=@ListName asp-items="@Model.jobs" multiple="multiple" class="sel2">
<option value="0" disabled>شفل را انتخاب کنید</option>
</select>
</td>
<td style="font-size: 14px !important; text-align: center" class="crossJobssession">
<input type="text" class="form-control " asp-for="crossJobsList[i].SalaryRatioUnder" data-val="true" data-val-required="فیلد الزامی است">
<span asp-validation-for="crossJobsList[i].SalaryRatioUnder" class="error"></span>
</td>
<td style="font-size: 14px !important; text-align: center" class="crossJobssession">
<input type="text" class="form-control " asp-for="crossJobsList[i].EquivalentRialUnder" data-val="true" data-val-required="فیلد الزامی است">
<span asp-validation-for="crossJobsList[i].EquivalentRialUnder" class="error"></span>
</td>
<td style="font-size: 14px !important; text-align: center" class="crossJobssession">
<input type="text" class="form-control " asp-for="crossJobsList[i].SalaryRatioOver" data-val="true" data-val-required="فیلد الزامی است">
<span asp-validation-for="crossJobsList[i].SalaryRatioOver" class="error"></span>
</td>
<td style="font-size: 14px !important; text-align: center" class="crossJobssession">
<input type="text" class="form-control " asp-for="crossJobsList[i].EquivalentRialOver" data-val="true" data-val-required="فیلد الزامی است">
<span asp-validation-for="crossJobsList[i].EquivalentRialOver" class="error"></span>
</td>
<td style="font-size: 14px !important; text-align: center">
<div class="removeRow" >
<i class="fa fa-minus-circle fa-2x" style="color: gray; cursor: pointer;"></i>
</div>
</td>
</tr>
</tbody>
</table>
}
<td style="font-size: 14px !important; text-align: right !important;width:240px !important;" class="crossJobssession">
<select id="@Listid" name="@ListName" asp-items="@Model.jobs" multiple="multiple" class="sel2">
<option value="0" disabled>شفل را انتخاب کنید</option>
</select>
</td>
<td style="font-size: 14px !important; text-align: center" class="crossJobssession">
<input type="text" class="form-control " asp-for="crossJobsList[i].SalaryRatioUnder" data-val="true" data-val-required="فیلد الزامی است">
<span asp-validation-for="crossJobsList[i].SalaryRatioUnder" class="error"></span>
</td>
<td style="font-size: 14px !important; text-align: center" class="crossJobssession">
<input type="text" class="form-control " asp-for="crossJobsList[i].EquivalentRialUnder" data-val="true" data-val-required="فیلد الزامی است">
<span asp-validation-for="crossJobsList[i].EquivalentRialUnder" class="error"></span>
</td>
<td style="font-size: 14px !important; text-align: center" class="crossJobssession">
<input type="text" class="form-control " asp-for="crossJobsList[i].SalaryRatioOver" data-val="true" data-val-required="فیلد الزامی است">
<span asp-validation-for="crossJobsList[i].SalaryRatioOver" class="error"></span>
</td>
<td style="font-size: 14px !important; text-align: center" class="crossJobssession">
<input type="text" class="form-control " asp-for="crossJobsList[i].EquivalentRialOver" data-val="true" data-val-required="فیلد الزامی است">
<span asp-validation-for="crossJobsList[i].EquivalentRialOver" class="error"></span>
</td>
<td style="font-size: 14px !important; text-align: center">
<div class="removeRow">
<i class="fa fa-minus-circle fa-2x" style="color: gray; cursor: pointer;"></i>
</div>
</td>
</tr>
</tbody>
</table>
<button type="button" onclick="addrowTable()" class="btn btn-sm btn-success btn-rounded waves-effect waves-light pull-left">افزودن +</button>
</fieldset>
</div>
<button type="button" onclick="addrowTable()" class="btn btn-sm btn-success btn-rounded waves-effect waves-light pull-left">افزودن +</button>
</fieldset>
</div>
</div>
<div class="modal-footer">
</div>
<div class="modal-footer">
<button type="submit" id="createButtom" class="btn btn-success btn-rounded waves-effect waves-light">ذخیره</button>
<button type="button" class="btn btn-default btn-rounded waves-effect waves-light m-b-5" data-dismiss="modal">بستن</button>
</div>
<button type="submit" id="createButtom" class="btn btn-success btn-rounded waves-effect waves-light">ذخیره</button>
<button type="button" class="btn btn-default btn-rounded waves-effect waves-light m-b-5" data-dismiss="modal">بستن</button>
</div>
</form>
</form>
</div>
<script type="text/javascript">
$(function () {
$("#crossJobsList_0__jobItems").select2({
placeholder: "انتخاب کنید",
dir: "rtl",
});
});
$(function () {
$("#jobslst_10").select2();
});
$(function() {
$("#crossJobsList_0__jobItems").select2({
placeholder: "انتخاب کنید",
dir: "rtl",
});
});
$(function() {
$("#jobslst_10").select2();
});
</script>
<script>
$(document).ready(function () {
$('.modal-dialog').addClass('modal-lg');
})
$(document).ready(function() {
$('.modal-dialog').addClass('modal-lg');
});
function addrowEconomicCode() {
var addNewEconomicCounter = $("#ecoList input[name^='economicCodeList']").length;
console.log("Add row : " + addNewEconomicCounter);
const htmls = ` <div class="col-md-2">
function addrowEconomicCode() {
const addNewEconomicCounter = $("#ecoList input[name^='economicCodeList']").length;
console.log(`Add row : ${addNewEconomicCounter}`);
const htmls = ` <div class="col-md-2">
<div class="form-group">
<input type="number" class="form-control" name="economicCodeList[${addNewEconomicCounter}]"
id="economicCodeList_${addNewEconomicCounter}_" maxlength="5"
@@ -207,16 +206,16 @@
<span class="error " data-valmsg-for="economicCodeList[${addNewEconomicCounter}]"
style="font-size: 10px !important; text-align: center" data-valmsg-replace="true"></span>
</div>
</div>`
</div>`;
$('#ecoList ').prepend(htmls);
}
$('#ecoList ').prepend(htmls);
}
function addrowTable() {
function addrowTable() {
var addNewCrossJobCounter = $("#datatableCreate input[name$='.SalaryRatioUnder']").length;
console.log("Add row : " + addNewCrossJobCounter);
const htmls = `
const addNewCrossJobCounter = $("#datatableCreate input[name$='.SalaryRatioUnder']").length;
console.log(`Add row : ${addNewCrossJobCounter}`);
const htmls = `
<tbody id="datatableTbody_${addNewCrossJobCounter}">
<tr >
<td style="font-size: 14px !important; text-align: center" class="order">
@@ -258,211 +257,215 @@
</div>
</td >
</tr>
</tbody>`
</tbody>`;
$('#datatableCreate ').append(htmls);
$('#datatableCreate ').append(htmls);
select(addNewCrossJobCounter);
}
var jobs;
select(addNewCrossJobCounter);
}
function select(id) {
getJob(id);
$("#jobslst_" + id).select2({
placeholder: "انتخاب کنید",
dir: "rtl",
});
}
var jobs;
function getJob(id) {
$.ajax({
dataType: 'json',
type: 'Get',
url: '@Url.Page("./Index", "Job")',
headers: { "RequestVerificationToken": $('@Html.AntiForgeryToken()').val() },
success: function (response) {
jobs = response;
for (var i = 0; i < jobs.length; i++) {
$("#jobslst_" + id).append(`<option value=` + jobs[i].id + `>` + jobs[i].jobName+`</option>`);
}
function select(id) {
getJob(id);
$(`#jobslst_${id}`).select2({
placeholder: "انتخاب کنید",
dir: "rtl",
});
}
},
failure: function (response) {
console.log(5, response)
$.Notification.autoHideNotify('error', 'top center', 'پیام سیستم ', response.message);
}
});
}
function getJob(id) {
$.ajax({
dataType: 'json',
type: 'Get',
url: '@Url.Page("./Index", "Job")',
headers: { "RequestVerificationToken": $('@Html.AntiForgeryToken()').val() },
success: function(response) {
jobs = response;
for (let i = 0; i < jobs.length; i++) {
$(`#jobslst_${id}`).append(`<option value=${jobs[i].id}>${jobs[i].jobName}</option>`);
}
},
failure: function(response) {
console.log(5, response);
$.Notification.autoHideNotify('error', 'top center', 'پیام سیستم ', response.message);
}
});
}
function addToTitle(id) {
const text = document.getElementById(`crossJobsList_${id}__TitleStr`).value;
//var text = document.getElementById('crossJobsList_Title_' + id).value;
if (text == '') {
return;
}
$(`#crossJobsList_${id}__Title`).val($(`#crossJobsList_${id}__Title`).val() + '-' + text);
const oldval = $(`#crossJobsList_${id}__Title`).val();
$(`#textareacrossJobsList_${id}__Title`).val(oldval.trim());
document.getElementById(`crossJobsList_${id}__TitleStr`).value = '';
}
function getInputSelection(el) {
var start = 0,
end = 0,
normalizedValue,
range,
textInputRange,
len,
endRange;
if (typeof el.selectionStart == "number" && typeof el.selectionEnd == "number") {
start = el.selectionStart;
end = el.selectionEnd;
} else {
range = document.selection.createRange();
if (range && range.parentElement() == el) {
len = el.value.length;
normalizedValue = el.value.replace(/\r\n/g, "\n");
// Create a working TextRange that lives only in the input
textInputRange = el.createTextRange();
textInputRange.moveToBookmark(range.getBookmark());
// Check if the start and end of the selection are at the very end
// of the input, since moveStart/moveEnd doesn't return what we want
// in those cases
endRange = el.createTextRange();
endRange.collapse(false);
if (textInputRange.compareEndPoints("StartToEnd", endRange) > -1) {
start = end = len;
} else {
start = -textInputRange.moveStart("character", -len);
start += normalizedValue.slice(0, start).split("\n").length - 1;
if (textInputRange.compareEndPoints("EndToEnd", endRange) > -1) {
end = len;
} else {
end = -textInputRange.moveEnd("character", -len);
end += normalizedValue.slice(0, end).split("\n").length - 1;
}
}
}
}
return {
start: start,
end: end
};
}
function replaceSelectedText(el, text) {
const sel = getInputSelection(el);
const val = el.value;
const selected = val.slice(sel.start, sel.end);
var arr = [];
arr = val.split('-');
var str = "";
for (let i = 0; i < arr.length; i++) {
if (arr[i] == selected) {
arr[i] = '';
}
if (arr[i] !== '') {
str += `-${arr[i]}`;
}
}
el.value = str;
}
function selectedText(id) {
const el = document.getElementById(`textareacrossJobsList_${id}__Title`);
replaceSelectedText(el, "");
}
function removeRowCrossJob(className) {
const list = document.getElementById(className);
const lst = list.value;
list.remove();
const unit = $("#datatableCreate").parent().find('input').length;
$('td.order').text(function(i) {
return i + 1;
});
className = "crossJobssession";
const id = "datatableCreate"; // "crossJobsList";
sortInputs(id, className, 5);
}
function sortInputs(id, className, unit) {
var PSInput = $(`#${id} .${className} input`);
for (var i = 0; i < PSInput.length; i++) {
try {
var split_0 = $(PSInput[i]).attr('name').split('[');
var split_1 = split_0[0];
var split_2 = split_0[1];
var split_2 = split_2.split(']');
var split_2 = split_2[1];
var split_00 = $(PSInput[i]).attr('id').split('_');
var split_11 = split_00[0];
var split_22 = split_00[3];
$(PSInput[i]).attr('name', split_1 + "[" + Math.floor(i / unit) + "]" + split_2);
$(PSInput[i]).next('span').attr('name', split_1 + "[" + Math.floor(i / unit) + "]" + split_2);
$(PSInput[i]).next('span').attr('data-valmsg-for', split_1 + "[" + Math.floor(i / unit) + "]" + split_2);
$(PSInput[i]).attr('id', split_11 + "_" + Math.floor(i / unit) + "__" + split_22);
$(PSInput[i]).prev('label').attr('for', split_11 + "_" + Math.floor(i / unit) + "__" + split_22);
} catch (e) {
}
}
var PSButton = $(`#${id} button`);
for (var i = 0; i < PSButton.length; i++) {
$(PSButton[i]).attr("onclick", `addToTitle(${i})`);
}
var PSTbody = $(`#${id} Tbody`);
for (var i = 0; i < PSTbody.length; i++) {
$(PSTbody[i]).attr("id", `datatableTbody_${i}`);
}
var PSSelect2 = $(".sel2");
for (var i = 0; i < PSSelect2.length; i++) {
$(PSSelect2[i]).attr("id", `crossJobsList_${i}__jobItems`);
$(PSSelect2[i]).attr("data-select2-id", `crossJobsList_${i}__jobItems`);
$(PSSelect2[i]).attr("name", `crossJobsList[${i}].jobItems`);
}
var PSRemove = $(`#${id} .removeRow`);
for (var i = 0; i < PSRemove.length; i++) {
$(PSRemove[i]).attr("onclick", `removeRowCrossJob('datatableTbody_${i + 1}')`);
}
}
function addToTitle(id) {
var text = document.getElementById('crossJobsList_' + id + '__TitleStr').value;
//var text = document.getElementById('crossJobsList_Title_' + id).value;
if (text == '') {
return;
}
$('#' + 'crossJobsList_' + id + '__Title').val($('#' + 'crossJobsList_' + id + '__Title').val() + '-' + text);
var oldval = $('#' + 'crossJobsList_' + id + '__Title').val();
$('#' + 'textareacrossJobsList_' + id + '__Title').val(oldval.trim());
document.getElementById('crossJobsList_' + id + '__TitleStr').value = '';
}
function validDate(inputField, id) {
function getInputSelection(el) {
var start = 0, end = 0, normalizedValue, range,
textInputRange, len, endRange;
if (inputField.value != '') {
if (typeof el.selectionStart == "number" && typeof el.selectionEnd == "number") {
start = el.selectionStart;
end = el.selectionEnd;
} else {
range = document.selection.createRange();
validCheck = true;
$(`#${id}`).val("فیلد الزامی است");
} else {
validCheck = false;
$(`#${id}`).val();
if (range && range.parentElement() == el) {
len = el.value.length;
normalizedValue = el.value.replace(/\r\n/g, "\n");
}
// Create a working TextRange that lives only in the input
textInputRange = el.createTextRange();
textInputRange.moveToBookmark(range.getBookmark());
// Check if the start and end of the selection are at the very end
// of the input, since moveStart/moveEnd doesn't return what we want
// in those cases
endRange = el.createTextRange();
endRange.collapse(false);
if (textInputRange.compareEndPoints("StartToEnd", endRange) > -1) {
start = end = len;
} else {
start = -textInputRange.moveStart("character", -len);
start += normalizedValue.slice(0, start).split("\n").length - 1;
if (textInputRange.compareEndPoints("EndToEnd", endRange) > -1) {
end = len;
} else {
end = -textInputRange.moveEnd("character", -len);
end += normalizedValue.slice(0, end).split("\n").length - 1;
}
}
}
}
return {
start: start,
end: end
};
}
function replaceSelectedText(el, text) {
var sel = getInputSelection(el), val = el.value;
var selected = val.slice(sel.start, sel.end);
var arr = []; arr = val.split('-')
var str = "";
for (var i = 0; i < arr.length; i++) {
if (arr[i] == selected) {
arr[i] = '';
}
if (arr[i] !== '') {
str += '-' + arr[i];
}
}
el.value = str;
}
function selectedText(id) {
var el = document.getElementById('textareacrossJobsList_' + id + '__Title');
replaceSelectedText(el, "");
}
function removeRowCrossJob(className) {
var list = document.getElementById(className);
var lst = list.value;
list.remove();
var unit = $("#datatableCreate").parent().find('input').length;
$('td.order').text(function (i) {
return i + 1;
});
className = "crossJobssession";
var id = "datatableCreate";// "crossJobsList";
sortInputs(id, className, 5)
}
function sortInputs(id, className, unit) {
var PSInput = $("#" + id + " ." + className + " input");
for (var i = 0; i < PSInput.length; i++) {
try {
var split_0 = $(PSInput[i]).attr('name').split('[')
var split_1 = split_0[0]
var split_2 = split_0[1]
var split_2 = split_2.split(']')
var split_2 = split_2[1]
var split_00 = $(PSInput[i]).attr('id').split('_')
var split_11 = split_00[0]
var split_22 = split_00[3]
$(PSInput[i]).attr('name', split_1 + "[" + Math.floor(i / unit) + "]" + split_2)
$(PSInput[i]).next('span').attr('name', split_1 + "[" + Math.floor(i / unit) + "]" + split_2)
$(PSInput[i]).next('span').attr('data-valmsg-for', split_1 + "[" + Math.floor(i / unit) + "]" + split_2)
$(PSInput[i]).attr('id', split_11 + "_" + Math.floor(i / unit) + "__" + split_22)
$(PSInput[i]).prev('label').attr('for', split_11 + "_" + Math.floor(i / unit) + "__" + split_22)
} catch (e) {
}
}
var PSButton = $("#" + id + " button");
for (var i = 0; i < PSButton.length; i++) {
$(PSButton[i]).attr("onclick", "addToTitle(" + i + ")");
}
var PSTbody = $("#" + id + " Tbody");
for (var i = 0; i < PSTbody.length; i++) {
$(PSTbody[i]).attr("id", "datatableTbody_" + i);
}
var PSSelect2 = $(".sel2");
for (var i = 0; i < PSSelect2.length; i++) {
$(PSSelect2[i]).attr("id", "crossJobsList_" + i + "__jobItems");
$(PSSelect2[i]).attr("data-select2-id", "crossJobsList_" + i + "__jobItems");
$(PSSelect2[i]).attr("name", "crossJobsList[" + i + "].jobItems");
}
var PSRemove = $("#" + id + " .removeRow");
for (var i = 0; i < PSRemove.length; i++) {
$(PSRemove[i]).attr("onclick", "removeRowCrossJob('datatableTbody_" + (i + 1) + "')");
}
}
function validDate(inputField, id) {
if (inputField.value != '') {
validCheck = true;
$('#' + id).val("فیلد الزامی است");
}
else {
validCheck = false;
$('#' + id).val();
}
}
</script>
}
</script>

View File

@@ -1,8 +1,6 @@
@using _0_Framework.Application
@model CompanyManagment.App.Contracts.CrossJobGuild.EditCrossJobGuild
@model CompanyManagment.App.Contracts.CrossJobGuild.EditCrossJobGuild
@{
<style>
<style>
.select2-container {
width: 100% !important;
}
@@ -36,126 +34,126 @@
}
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<form asp-page="./Index" asp-page-handler="Details" id="workshops" autocomplete="off"
method="post"
data-ajax="true"
data-callback=""
data-action="Refresh"
enctype="multipart/form-data">
<div class="modal-body">
<div class="row">
<fieldset style="border: 1px solid #999797; border-radius: 10px; padding: revert">
<legend style="margin-bottom: 5px; font-size: large; border-bottom: 0px; color: #505458; width: 200px; text-align: center;"> جزئیات واحد صنفی </legend>
<form asp-page="./Index" asp-page-handler="Details" id="workshops" autocomplete="off"
method="post"
data-ajax="true"
data-callback=""
data-action="Refresh"
enctype="multipart/form-data">
<div class="modal-body">
<div class="row">
<fieldset style="border: 1px solid #999797; border-radius: 10px; padding: revert">
<legend style="margin-bottom: 5px; font-size: large; border-bottom: 0px; color: #505458; width: 200px; text-align: center;"> جزئیات واحد صنفی </legend>
<div class="row">
<div class="col-md-2">
<div class="form-group">
<label class="control-label"> سال </label>
<p class="form-control "> @Model.Year </p>
</div>
</div>
</div>
<div class="row">
<div class="col-md-4">
<div class="form-group">
<label class="control-label"> عنوان صنف و درجه </label>
<p class="form-control "> @Model.Title </p>
</div>
</div>
</div>
<div class="row">
<div class="col-md-2">
<label class="control-label"> کد اقتصادی </label>
<div class="row">
<div class="col-md-2">
<div class="form-group">
<label class="control-label"> سال </label>
<p class="form-control "> @Model.Year </p>
</div>
</div>
</div>
<div class="row">
<div class="col-md-4">
<div class="form-group">
<label class="control-label"> عنوان صنف و درجه </label>
<p class="form-control "> @Model.Title </p>
</div>
</div>
</div>
<div class="row">
<div class="col-md-2">
<label class="control-label"> کد اقتصادی </label>
</div>
</div>
<div class="row">
@{
var split = Model.EconomicCode.Split("-");
foreach (var itemcode in split)
{
<div class="col-md-2">
<div class="form-group">
<p class="form-control "> @itemcode </p>
</div>
</div>
}
}
</div>
<table id="datatableCreate" class="table table-bordered">
<thead style="background-color:#a9fcff">
<tr>
<th style=" text-align: center; vertical-align: middle;" rowspan="2">#</th>
<th style=" font-size: 20px; text-align: center; vertical-align: middle" rowspan="2"> مشاغل </th>
<th style=" font-size: 20px; text-align: center; vertical-align: middle" colspan="2"> برای شهریه های کمتر از 500000 نفر </th>
<th style=" font-size: 20px; text-align: center; vertical-align: middle" colspan="3"> برای شهریه های بیشتر از 500000 نفر </th>
</tr>
</div>
</div>
<div class="row">
@{
var split = Model.EconomicCode.Split("-");
foreach (var itemcode in split)
{
<div class="col-md-2">
<div class="form-group">
<p class="form-control "> @itemcode </p>
</div>
</div>
}
}
</div>
<table id="datatableCreate" class="table table-bordered">
<thead style="background-color:#a9fcff">
<tr>
<th style=" text-align: center; vertical-align: middle;" rowspan="2">#</th>
<th style=" font-size: 20px; text-align: center; vertical-align: middle" rowspan="2"> مشاغل </th>
<th style=" font-size: 20px; text-align: center; vertical-align: middle" colspan="2"> برای شهریه های کمتر از 500000 نفر </th>
<th style=" font-size: 20px; text-align: center; vertical-align: middle" colspan="3"> برای شهریه های بیشتر از 500000 نفر </th>
</tr>
<tr>
<th style=" font-size: 15px; text-align: center; vertical-align: middle"> به نسبت حداقل دستمزد </th>
<th style=" font-size: 15px; text-align: center; vertical-align: middle"> معادل ریالی </th>
<th style=" font-size: 15px; text-align: center; vertical-align: middle"> به نسبت حداقل دستمزد </th>
<th style=" font-size: 15px; text-align: center; vertical-align: middle" colspan="2"> معادل ریالی </th>
</tr>
</thead>
<tr>
<th style=" font-size: 15px; text-align: center; vertical-align: middle"> به نسبت حداقل دستمزد </th>
<th style=" font-size: 15px; text-align: center; vertical-align: middle"> معادل ریالی </th>
<th style=" font-size: 15px; text-align: center; vertical-align: middle"> به نسبت حداقل دستمزد </th>
<th style=" font-size: 15px; text-align: center; vertical-align: middle" colspan="2"> معادل ریالی </th>
</tr>
</thead>
@{
int i = 0;
foreach (var cj in Model.crossJobsList)
{
<tbody id="datatableTbody_@i">
<tr id="datatableTr">
<td style="font-size: 14px !important; text-align: center">
@{
var index = i + 1;
}
@index
</td>
@{
var str = " ";
foreach (var cjItem in Model.crossJobItemsList.Where(x => x.crossJobId == cj.Id).ToList())
{
str = str+ "-" + cjItem.job.JobName;
str = str.Trim();
}
}
<td style="font-size: 14px !important; text-align: center">
<textarea disabled rows="3" cols="50" style="width:240px"
@{
var i = 0;
foreach (var cj in Model.crossJobsList)
{
<tbody id="datatableTbody_@i">
<tr id="datatableTr">
<td style="font-size: 14px !important; text-align: center">
@{
var index = i + 1;
}
@index
</td>
@{
var str = " ";
foreach (var cjItem in Model.crossJobItemsList.Where(x => x.crossJobId == cj.Id).ToList())
{
str = str + "-" + cjItem.job.JobName;
str = str.Trim();
}
}
<td style="font-size: 14px !important; text-align: center">
<textarea disabled rows="3" cols="50" style="width:240px"
class="form-control">@str.Substring(1)</textarea>
</td>
<td style="font-size: 14px !important; text-align: center">
<input disabled type="text" class="form-control " asp-for="@cj.SalaryRatioUnder">
</td>
<td style="font-size: 14px !important; text-align: center">
<input disabled type="text" class="form-control " asp-for="@cj.EquivalentRialUnder">
</td>
<td style="font-size: 14px !important; text-align: center">
<input disabled type="text" class="form-control " asp-for="@cj.SalaryRatioOver">
</td>
<td style="font-size: 14px !important; text-align: center">
<input disabled type="text" class="form-control " asp-for="@cj.EquivalentRialOver">
</td>
<td style="font-size: 14px !important; text-align: center">
</td>
</tr>
</tbody>
i++;
}
}
</td>
<td style="font-size: 14px !important; text-align: center">
<input disabled type="text" class="form-control " asp-for="@cj.SalaryRatioUnder">
</td>
<td style="font-size: 14px !important; text-align: center">
<input disabled type="text" class="form-control " asp-for="@cj.EquivalentRialUnder">
</td>
<td style="font-size: 14px !important; text-align: center">
<input disabled type="text" class="form-control " asp-for="@cj.SalaryRatioOver">
</td>
<td style="font-size: 14px !important; text-align: center">
<input disabled type="text" class="form-control " asp-for="@cj.EquivalentRialOver">
</td>
<td style="font-size: 14px !important; text-align: center">
</td>
</tr>
</tbody>
i++;
}
}
</table>
</fieldset>
</div>
</table>
</fieldset>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default btn-rounded waves-effect waves-light m-b-5" data-dismiss="modal">بستن</button>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default btn-rounded waves-effect waves-light m-b-5" data-dismiss="modal">بستن</button>
</div>
</form>
</form>
</div>
@@ -163,12 +161,10 @@
<script>
$(document).ready(function () {
$(document).ready(function() {
$('.modal-dialog').addClass('modal-lg');
})
</script>
$('.modal-dialog').addClass('modal-lg');
})
</script>

View File

@@ -1,7 +1,6 @@
@using _0_Framework.Application
@model CompanyManagment.App.Contracts.CrossJobGuild.EditCrossJobGuild
@model CompanyManagment.App.Contracts.CrossJobGuild.EditCrossJobGuild
@{
<style>
<style>
.select2-container {
width: 100% !important;
}
@@ -35,192 +34,192 @@
}
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<form asp-page="./Index" asp-page-handler="Edit" id="workshops" autocomplete="off"
method="post"
data-ajax="true"
data-callback=""
data-action="Refresh"
enctype="multipart/form-data">
<div class="modal-body">
<div class="row">
<fieldset style="border: 1px solid #999797; border-radius: 10px; padding: revert">
<legend style="margin-bottom: 5px; font-size: large; border-bottom: 0px; color: #505458; width: 420px; text-align: center;">
ویرایش مشاغل قیمت مقطوع سازمان تامین اجتماعی
</legend>
<input type="hidden" asp-for="Id" value="@Model.Id" />
<div class="row">
<div class="col-md-2">
<div class="form-group">
<label asp-for="Year" class="control-label"> سال </label>
<input type="text" class="form-control" asp-for="Year" data-val="true" data-val-required="فیلد الزامی است">
<span asp-validation-for="Year" class="error"></span>
</div>
</div>
</div>
<div class="row">
<div class="col-md-4">
<div class="form-group">
<label asp-for="Title" class="control-label"> عنوان صنف و درجه </label>
<input type="text" class="form-control" asp-for="Title" data-val="true" data-val-required="فیلد الزامی است">
<span asp-validation-for="Title" class="error"></span>
</div>
</div>
</div>
<div class="row">
<div class="col-md-2">
<label asp-for="EconomicCode" class="control-label"> کد اقتصادی </label>
</div>
</div>
<div class="row">
<div id="ecoList">
@{ int index1 = Model.economicCodeList.Count-1;}
@foreach (var item in Model.economicCodeList)
{
<div class="col-md-2">
<div class="form-group">
<input type="number" class="form-control" asp-for="economicCodeList[index1]" maxlength="5" min="0" max="99999"
data-val="false" data-val-number="فقط عدد وارد نمایید"
data-val-maxlength="بیشتر از 5 رقم مجاز نیست"
data-val-maxlength-max="5">
<span asp-validation-for="economicCodeList[index1]" style="font-size: 10px !important; text-align: center"
class="error">
</span>
<form asp-page="./Index" asp-page-handler="Edit" id="workshops" autocomplete="off"
method="post"
data-ajax="true"
data-callback=""
data-action="Refresh"
enctype="multipart/form-data">
<div class="modal-body">
<div class="row">
<fieldset style="border: 1px solid #999797; border-radius: 10px; padding: revert">
<legend style="margin-bottom: 5px; font-size: large; border-bottom: 0px; color: #505458; width: 420px; text-align: center;">
ویرایش مشاغل قیمت مقطوع سازمان تامین اجتماعی
</legend>
<input type="hidden" asp-for="Id" value="@Model.Id"/>
<div class="row">
<div class="col-md-2">
<div class="form-group">
<label asp-for="Year" class="control-label"> سال </label>
<input type="text" class="form-control" asp-for="Year" data-val="true" data-val-required="فیلد الزامی است">
<span asp-validation-for="Year" class="error"></span>
</div>
</div>
</div>
<div class="row">
<div class="col-md-4">
<div class="form-group">
<label asp-for="Title" class="control-label"> عنوان صنف و درجه </label>
<input type="text" class="form-control" asp-for="Title" data-val="true" data-val-required="فیلد الزامی است">
<span asp-validation-for="Title" class="error"></span>
</div>
</div>
</div>
<div class="row">
<div class="col-md-2">
<label asp-for="EconomicCode" class="control-label"> کد اقتصادی </label>
</div>
</div>
<div class="row">
<div id="ecoList">
@{ var index1 = Model.economicCodeList.Count - 1; }
@foreach (var item in Model.economicCodeList)
{
<div class="col-md-2">
<div class="form-group">
<input type="number" class="form-control" asp-for="economicCodeList[index1]" maxlength="5" min="0" max="99999"
data-val="false" data-val-number="فقط عدد وارد نمایید"
data-val-maxlength="بیشتر از 5 رقم مجاز نیست"
data-val-maxlength-max="5">
<span asp-validation-for="economicCodeList[index1]" style="font-size: 10px !important; text-align: center"
class="error">
</span>
</div>
</div>
index1 = index1 -1;
}
</div>
<div class="col-md-2">
<div class="form-group">
<button type="button" onclick="addrowEconomicCode()"
class="btn btn-sm btn-success btn-rounded waves-effect waves-light ">
+ افزودن
</button>
</div>
</div>
</div>
</div>
</div>
index1 = index1 - 1;
}
</div>
<div class="col-md-2">
<div class="form-group">
<button type="button" onclick="addrowEconomicCode()"
class="btn btn-sm btn-success btn-rounded waves-effect waves-light ">
+ افزودن
</button>
</div>
</div>
</div>
<table id="datatableCreate" class="table table-bordered">
<thead style="background-color:#a9fcff">
<tr>
<th style=" text-align: center; vertical-align: middle;" rowspan="2">#</th>
<th style=" font-size: 20px; text-align: center; vertical-align: middle" rowspan="2" colspan="1"> مشاغل </th>
<th style=" font-size: 20px; text-align: center; vertical-align: middle" colspan="2"> برای شهرهای کمتر از 500000 نفر </th>
<th style=" font-size: 20px; text-align: center; vertical-align: middle" colspan="3"> برای شهرهای بیشتر از 500000 نفر </th>
</tr>
<table id="datatableCreate" class="table table-bordered">
<thead style="background-color:#a9fcff">
<tr>
<th style=" text-align: center; vertical-align: middle;" rowspan="2">#</th>
<th style=" font-size: 20px; text-align: center; vertical-align: middle" rowspan="2" colspan="1"> مشاغل </th>
<th style=" font-size: 20px; text-align: center; vertical-align: middle" colspan="2"> برای شهرهای کمتر از 500000 نفر </th>
<th style=" font-size: 20px; text-align: center; vertical-align: middle" colspan="3"> برای شهرهای بیشتر از 500000 نفر </th>
</tr>
<tr>
<th style=" font-size: 15px; text-align: center; vertical-align: middle"> به نسبت حداقل دستمزد </th>
<th style=" font-size: 15px; text-align: center; vertical-align: middle"> معادل ریالی </th>
<th style=" font-size: 15px; text-align: center; vertical-align: middle"> به نسبت حداقل دستمزد </th>
<th style=" font-size: 15px; text-align: center; vertical-align: middle" colspan="2"> معادل ریالی </th>
</tr>
</thead>
<tr>
<th style=" font-size: 15px; text-align: center; vertical-align: middle"> به نسبت حداقل دستمزد </th>
<th style=" font-size: 15px; text-align: center; vertical-align: middle"> معادل ریالی </th>
<th style=" font-size: 15px; text-align: center; vertical-align: middle"> به نسبت حداقل دستمزد </th>
<th style=" font-size: 15px; text-align: center; vertical-align: middle" colspan="2"> معادل ریالی </th>
</tr>
</thead>
@{
int i = 0;
if (Model.crossJobsList != null)
foreach (var cj in Model.crossJobsList)
{
var idstr = "crossJobsList_" + i + "__TitleStr";
var namestr = "crossJobsList[" + i + "].TitleStr";
@{
var i = 0;
if (Model.crossJobsList != null)
foreach (var cj in Model.crossJobsList)
{
var idstr = "crossJobsList_" + i + "__TitleStr";
var namestr = "crossJobsList[" + i + "].TitleStr";
var h = "textareacrossJobsList_" + i + "__Title";
var n = "textareacrossJobsList[" + i + "].Title";
var Listid = "crossJobsList_" + i + "__jobItems";// "jobslst_" + i;
var ListName = "crossJobsList[" + i + "].jobItems";
var h = "textareacrossJobsList_" + i + "__Title";
var n = "textareacrossJobsList[" + i + "].Title";
var Listid = "crossJobsList_" + i + "__jobItems"; // "jobslst_" + i;
var ListName = "crossJobsList[" + i + "].jobItems";
<tbody id="datatableTbody_@i">
<tr id="datatableTr">
<td style="font-size: 14px !important; text-align: center" class="order">
@{ var index = i + 1; }
@index
</td>
<tbody id="datatableTbody_@i">
<tr id="datatableTr">
<td style="font-size: 14px !important; text-align: center" class="order">
@{ var index = i + 1; }
@index
</td>
<td style="font-size: 14px !important; text-align: right;width:240px !important;" class="crossJobssession">
<td style="font-size: 14px !important; text-align: right;width:240px !important;" class="crossJobssession">
@Html.ListBoxFor(model => model.crossJobsList[i].SelectedValues, Model.jobs, new { @Id = Listid, @name = ListName, @class = "form-control sel2" })
@Html.ListBoxFor(model => model.crossJobsList[i].SelectedValues, Model.jobs, new { Id = Listid, name = ListName, @class = "form-control sel2" })
<input type="hidden" asp-for="crossJobsList[i].Id" />
<input type="hidden" asp-for="crossJobsList[i].Id"/>
</td>
<td style="font-size: 14px !important; text-align: center" class="crossJobssession">
<input type="text" class="form-control " asp-for="crossJobsList[i].SalaryRatioUnder" data-val="true" data-val-required="فیلد الزامی است">
<span asp-validation-for="crossJobsList[i].SalaryRatioUnder" class="error"></span>
</td>
<td style="font-size: 14px !important; text-align: center" class="crossJobssession">
<input type="text" class="form-control " asp-for="crossJobsList[i].EquivalentRialUnder" data-val="true" data-val-required="فیلد الزامی است">
<span asp-validation-for="crossJobsList[i].EquivalentRialUnder" class="error"></span>
</td>
<td style="font-size: 14px !important; text-align: center" class="crossJobssession">
<input type="text" class="form-control " asp-for="crossJobsList[i].SalaryRatioOver" data-val="true" data-val-required="فیلد الزامی است">
<span asp-validation-for="crossJobsList[i].SalaryRatioOver" class="error"></span>
</td>
<td style="font-size: 14px !important; text-align: center" class="crossJobssession">
<input type="text" class="form-control " asp-for="crossJobsList[i].EquivalentRialOver" data-val="true" data-val-required="فیلد الزامی است">
<span asp-validation-for="crossJobsList[i].EquivalentRialOver" class="error"></span>
</td>
<td style="font-size: 14px !important; text-align: center">
<div class="removeRow" onclick="editRemoveRowCrossJob(@i);">
<i class="fa fa-minus-circle fa-2x" style="color: red; cursor: pointer;"></i>
</div>
</td>
</tr>
</tbody>
i++;
}
}
</td>
<td style="font-size: 14px !important; text-align: center" class="crossJobssession">
<input type="text" class="form-control " asp-for="crossJobsList[i].SalaryRatioUnder" data-val="true" data-val-required="فیلد الزامی است">
<span asp-validation-for="crossJobsList[i].SalaryRatioUnder" class="error"></span>
</td>
<td style="font-size: 14px !important; text-align: center" class="crossJobssession">
<input type="text" class="form-control " asp-for="crossJobsList[i].EquivalentRialUnder" data-val="true" data-val-required="فیلد الزامی است">
<span asp-validation-for="crossJobsList[i].EquivalentRialUnder" class="error"></span>
</td>
<td style="font-size: 14px !important; text-align: center" class="crossJobssession">
<input type="text" class="form-control " asp-for="crossJobsList[i].SalaryRatioOver" data-val="true" data-val-required="فیلد الزامی است">
<span asp-validation-for="crossJobsList[i].SalaryRatioOver" class="error"></span>
</td>
<td style="font-size: 14px !important; text-align: center" class="crossJobssession">
<input type="text" class="form-control " asp-for="crossJobsList[i].EquivalentRialOver" data-val="true" data-val-required="فیلد الزامی است">
<span asp-validation-for="crossJobsList[i].EquivalentRialOver" class="error"></span>
</td>
<td style="font-size: 14px !important; text-align: center">
<div class="removeRow" onclick="editRemoveRowCrossJob(@i);">
<i class="fa fa-minus-circle fa-2x" style="color: red; cursor: pointer;"></i>
</div>
</td>
</tr>
</tbody>
i++;
}
}
</table>
</table>
<button type="button" onclick="addrowTable()" class="btn btn-sm btn-success btn-rounded waves-effect waves-light pull-left">افزودن +</button>
</fieldset>
</div>
<button type="button" onclick="addrowTable()" class="btn btn-sm btn-success btn-rounded waves-effect waves-light pull-left">افزودن +</button>
</fieldset>
</div>
</div>
<div class="modal-footer">
</div>
<div class="modal-footer">
<button type="submit" id="createButtom" class="btn btn-success btn-rounded waves-effect waves-light">ذخیره</button>
<button type="button" class="btn btn-default btn-rounded waves-effect waves-light m-b-5" data-dismiss="modal">بستن</button>
</div>
<button type="submit" id="createButtom" class="btn btn-success btn-rounded waves-effect waves-light">ذخیره</button>
<button type="button" class="btn btn-default btn-rounded waves-effect waves-light m-b-5" data-dismiss="modal">بستن</button>
</div>
</form>
</form>
</div>
<script type="text/javascript">
$(function () {
for (var i = 0; i < 10; i++) {
$(function() {
for (let i = 0; i < 10; i++) {
$("#crossJobsList_" + i + "__jobItems").select2({
placeholder: "انتخاب کنید",
dir: "rtl",
id: "crossJobsList_" + i + "__jobItems",
name: "crossJobsList[" + i + "].jobItems",
});
}
$(`#crossJobsList_${i}__jobItems`).select2({
placeholder: "انتخاب کنید",
dir: "rtl",
id: `crossJobsList_${i}__jobItems`,
name: `crossJobsList[${i}].jobItems`,
});
}
});
$(function () {
$("#jobslst_10").select2();
});
});
$(function() {
$("#jobslst_10").select2();
});
</script>
<script>
$(document).ready(function () {
$('.modal-dialog').addClass('modal-lg');
})
$(document).ready(function() {
$('.modal-dialog').addClass('modal-lg');
});
function addrowEconomicCode() {
var addNewEconomicCounter = $("#ecoList input[name^='economicCodeList']").length;
console.log("Add row : " + addNewEconomicCounter);
const htmls = ` <div class="col-md-2">
function addrowEconomicCode() {
const addNewEconomicCounter = $("#ecoList input[name^='economicCodeList']").length;
console.log(`Add row : ${addNewEconomicCounter}`);
const htmls = ` <div class="col-md-2">
<div class="form-group">
<input type="number" class="form-control" name="economicCodeList[${addNewEconomicCounter}]"
id="economicCodeList_${addNewEconomicCounter}_" maxlength="5" min="0" max="99999"
@@ -231,16 +230,16 @@
<span class="error " data-valmsg-for="economicCodeList[${addNewEconomicCounter}]"
style="font-size: 10px !important; text-align: center" data-valmsg-replace="true"></span>
</div>
</div>`
</div>`;
$('#ecoList ').prepend(htmls);
$('#ecoList ').prepend(htmls);
}
}
function addrowTable() {
var addNewCrossJobCounter = $("#datatableCreate input[name$='.SalaryRatioUnder']").length;
console.log("Add row : " + addNewCrossJobCounter);
const htmls = `
function addrowTable() {
const addNewCrossJobCounter = $("#datatableCreate input[name$='.SalaryRatioUnder']").length;
console.log(`Add row : ${addNewCrossJobCounter}`);
const htmls = `
<tbody id="datatableTbody_${addNewCrossJobCounter}">
<tr >
<td style="font-size: 14px !important; text-align: center" class="order">
@@ -282,211 +281,217 @@
</div>
</td >
</tr>
</tbody>`
</tbody>`;
$('#datatableCreate ').append(htmls);
$('#datatableCreate ').append(htmls);
select(addNewCrossJobCounter);
}
var jobs;
select(addNewCrossJobCounter);
}
function select(id) {
getJob(id);
$("#crossJobsList_" + id + "__jobItems").select2({
placeholder: "انتخاب کنید",
dir: "rtl",
id: "crossJobsList_" + id + "__jobItems",
name: "crossJobsList[" + id + "].jobItems",
});
}
var jobs;
function getJob(id) {
$.ajax({
dataType: 'json',
type: 'Get',
url: '@Url.Page("./Index", "Job")',
headers: { "RequestVerificationToken": $('@Html.AntiForgeryToken()').val() },
function select(id) {
getJob(id);
$(`#crossJobsList_${id}__jobItems`).select2({
placeholder: "انتخاب کنید",
dir: "rtl",
id: `crossJobsList_${id}__jobItems`,
name: `crossJobsList[${id}].jobItems`,
});
}
success: function (response) {
jobs = response;
for (var i = 0; i < jobs.length; i++) {
$("#crossJobsList_" + id + "__jobItems").append(`<option value=` + jobs[i].id + `>` + jobs[i].jobName+`</option>`);
}
$("#crossJobsList_" + id + "__jobItems").select2({
placeholder: "انتخاب کنید",
dir: "rtl",
id: "crossJobsList_" + id + "__jobItems",
name: "crossJobsList[" + id + "].jobItems",
});
},
failure: function (response) {
console.log(5, response)
$.Notification.autoHideNotify('error', 'top center', 'پیام سیستم ', response.message);
}
});
}
function getJob(id) {
$.ajax({
dataType: 'json',
type: 'Get',
url: '@Url.Page("./Index", "Job")',
headers: { "RequestVerificationToken": $('@Html.AntiForgeryToken()').val() },
success: function(response) {
jobs = response;
for (let i = 0; i < jobs.length; i++) {
$(`#crossJobsList_${id}__jobItems`).append(`<option value=${jobs[i].id}>${jobs[i].jobName}</option>`);
}
$(`#crossJobsList_${id}__jobItems`).select2({
placeholder: "انتخاب کنید",
dir: "rtl",
id: `crossJobsList_${id}__jobItems`,
name: `crossJobsList[${id}].jobItems`,
});
},
failure: function(response) {
console.log(5, response);
$.Notification.autoHideNotify('error', 'top center', 'پیام سیستم ', response.message);
}
});
}
function addToTitle(id) {
var text = document.getElementById('crossJobsList_' + id + '__TitleStr').value;
if (text == '') {
return;
}
$('#' + 'crossJobsList_' + id + '__Title').val($('#' + 'crossJobsList_' + id + '__Title').val() + '-' + text);
var oldval = $('#' + 'crossJobsList_' + id + '__Title').val();
$('#' + 'textareacrossJobsList_' + id + '__Title').val(oldval.trim());
document.getElementById('crossJobsList_' + id + '__TitleStr').value = '';
}
function addToTitle(id) {
const text = document.getElementById(`crossJobsList_${id}__TitleStr`).value;
if (text == '') {
return;
}
$(`#crossJobsList_${id}__Title`).val($(`#crossJobsList_${id}__Title`).val() + '-' + text);
const oldval = $(`#crossJobsList_${id}__Title`).val();
$(`#textareacrossJobsList_${id}__Title`).val(oldval.trim());
document.getElementById(`crossJobsList_${id}__TitleStr`).value = '';
}
function getInputSelection(el) {
var start = 0, end = 0, normalizedValue, range,
textInputRange, len, endRange;
function getInputSelection(el) {
var start = 0,
end = 0,
normalizedValue,
range,
textInputRange,
len,
endRange;
if (typeof el.selectionStart == "number" && typeof el.selectionEnd == "number") {
start = el.selectionStart;
end = el.selectionEnd;
} else {
range = document.selection.createRange();
if (typeof el.selectionStart == "number" && typeof el.selectionEnd == "number") {
start = el.selectionStart;
end = el.selectionEnd;
} else {
range = document.selection.createRange();
if (range && range.parentElement() == el) {
len = el.value.length;
normalizedValue = el.value.replace(/\r\n/g, "\n");
if (range && range.parentElement() == el) {
len = el.value.length;
normalizedValue = el.value.replace(/\r\n/g, "\n");
// Create a working TextRange that lives only in the input
textInputRange = el.createTextRange();
textInputRange.moveToBookmark(range.getBookmark());
// Create a working TextRange that lives only in the input
textInputRange = el.createTextRange();
textInputRange.moveToBookmark(range.getBookmark());
// Check if the start and end of the selection are at the very end
// of the input, since moveStart/moveEnd doesn't return what we want
// in those cases
endRange = el.createTextRange();
endRange.collapse(false);
// Check if the start and end of the selection are at the very end
// of the input, since moveStart/moveEnd doesn't return what we want
// in those cases
endRange = el.createTextRange();
endRange.collapse(false);
if (textInputRange.compareEndPoints("StartToEnd", endRange) > -1) {
start = end = len;
} else {
start = -textInputRange.moveStart("character", -len);
start += normalizedValue.slice(0, start).split("\n").length - 1;
if (textInputRange.compareEndPoints("StartToEnd", endRange) > -1) {
start = end = len;
} else {
start = -textInputRange.moveStart("character", -len);
start += normalizedValue.slice(0, start).split("\n").length - 1;
if (textInputRange.compareEndPoints("EndToEnd", endRange) > -1) {
end = len;
} else {
end = -textInputRange.moveEnd("character", -len);
end += normalizedValue.slice(0, end).split("\n").length - 1;
}
}
}
}
if (textInputRange.compareEndPoints("EndToEnd", endRange) > -1) {
end = len;
} else {
end = -textInputRange.moveEnd("character", -len);
end += normalizedValue.slice(0, end).split("\n").length - 1;
}
}
}
}
return {
start: start,
end: end
};
}
return {
start: start,
end: end
};
}
function replaceSelectedText(el, text) {
var sel = getInputSelection(el), val = el.value;
var selected = val.slice(sel.start, sel.end);
var arr = []; arr = val.split('-')
var str = "";
function replaceSelectedText(el, text) {
const sel = getInputSelection(el);
const val = el.value;
const selected = val.slice(sel.start, sel.end);
var arr = [];
arr = val.split('-');
var str = "";
for (var i = 0; i < arr.length; i++) {
if (arr[i] == selected) {
arr[i] = '';
}
if (arr[i] !== '') {
str += '-' + arr[i];
}
}
el.value = str;
}
for (let i = 0; i < arr.length; i++) {
if (arr[i] == selected) {
arr[i] = '';
}
if (arr[i] !== '') {
str += `-${arr[i]}`;
}
}
el.value = str;
}
function selectedText(id) {
var el = document.getElementById('textareacrossJobsList_' + id + '__Title');
replaceSelectedText(el, "");
}
function editRemoveRowCrossJob (className) {
className = "datatableTbody_" + className;
var list = document.getElementById(className);
var lst = list.value;
list.remove();
var unit = $("#datatableCreate").parent().find('input').length;
$('td.order').text(function (i) {
return i + 1;
});
className = "crossJobssession";
var id = "datatableCreate";// "crossJobsList";
sortInputs(id, className, 6)
}
function selectedText(id) {
const el = document.getElementById(`textareacrossJobsList_${id}__Title`);
replaceSelectedText(el, "");
}
function sortInputs(id, className, unit) {
function editRemoveRowCrossJob(className) {
className = `datatableTbody_${className}`;
const list = document.getElementById(className);
const lst = list.value;
list.remove();
const unit = $("#datatableCreate").parent().find('input').length;
$('td.order').text(function(i) {
return i + 1;
});
className = "crossJobssession";
const id = "datatableCreate"; // "crossJobsList";
sortInputs(id, className, 6);
}
var PSInput = $("#" + id + " ." + className + " input");
for (var i = 0; i < PSInput.length; i++) {
try {
function sortInputs(id, className, unit) {
var split_0 = $(PSInput[i]).attr('name').split('[')
var PSInput = $(`#${id} .${className} input`);
for (var i = 0; i < PSInput.length; i++) {
try {
var split_1 = split_0[0]
var split_2 = split_0[1]
var split_2 = split_2.split(']')
var split_2 = split_2[1]
var split_0 = $(PSInput[i]).attr('name').split('[');
var split_1 = split_0[0];
var split_2 = split_0[1];
var split_2 = split_2.split(']');
var split_2 = split_2[1];
var split_00 = $(PSInput[i]).attr('id').split('_');
var split_11 = split_00[0];
var split_22 = split_00[3];
var split_00 = $(PSInput[i]).attr('id').split('_')
var split_11 = split_00[0]
var split_22 = split_00[3]
$(PSInput[i]).attr('name', split_1 + "[" + Math.floor(i / unit) + "]" + split_2);
$(PSInput[i]).next('span').attr('name', split_1 + "[" + Math.floor(i / unit) + "]" + split_2);
$(PSInput[i]).next('span').attr('data-valmsg-for', split_1 + "[" + Math.floor(i / unit) + "]" + split_2);
$(PSInput[i]).attr('name', split_1 + "[" + Math.floor(i / unit) + "]" + split_2)
$(PSInput[i]).next('span').attr('name', split_1 + "[" + Math.floor(i / unit) + "]" + split_2)
$(PSInput[i]).next('span').attr('data-valmsg-for', split_1 + "[" + Math.floor(i / unit) + "]" + split_2)
$(PSInput[i]).attr('id', split_11 + "_" + Math.floor(i / unit) + "__" + split_22);
$(PSInput[i]).prev('label').attr('for', split_11 + "_" + Math.floor(i / unit) + "__" + split_22);
$(PSInput[i]).attr('id', split_11 + "_" + Math.floor(i / unit) + "__" + split_22)
$(PSInput[i]).prev('label').attr('for', split_11 + "_" + Math.floor(i / unit) + "__" + split_22)
} catch (e) {
console.log(e);
}
}
} catch (e) {
console.log(e);
}
}
var PSButton = $(`#${id} button`);
for (var i = 0; i < PSButton.length; i++) {
$(PSButton[i]).attr("onclick", `addToTitle(${i})`);
}
var PSButton = $("#" + id + " button");
for (var i = 0; i < PSButton.length; i++) {
$(PSButton[i]).attr("onclick", "addToTitle(" + i + ")");
}
var PSTbody = $(`#${id} Tbody`);
for (var i = 0; i < PSTbody.length; i++) {
$(PSTbody[i]).attr("id", `datatableTbody_${i}`);
}
var PSSelect2 = $(".sel2");
for (var i = 0; i < PSSelect2.length; i++) {
$(PSSelect2[i]).attr("id", `crossJobsList_${i}__jobItems`);
$(PSSelect2[i]).attr("data-select2-id", `crossJobsList_${i}__jobItems`);
$(PSSelect2[i]).attr("name", `crossJobsList[${i}].jobItems`);
}
var PSTbody = $("#" + id + " Tbody");
for (var i = 0; i < PSTbody.length; i++) {
$(PSTbody[i]).attr("id", "datatableTbody_" + i);
}
var PSSelect2 = $(".sel2");
for (var i = 0; i < PSSelect2.length; i++) {
$(PSSelect2[i]).attr("id", "crossJobsList_" + i + "__jobItems");
$(PSSelect2[i]).attr("data-select2-id", "crossJobsList_" + i + "__jobItems");
$(PSSelect2[i]).attr("name", "crossJobsList["+ i +"].jobItems");
}
var PSRemove = $(`#${id} .removeRow`);
for (var i = 0; i < PSRemove.length; i++) {
$(PSRemove[i]).attr("onclick", `editRemoveRowCrossJob(${i})`);
}
var PSRemove = $("#" + id + " .removeRow");
for (var i = 0; i < PSRemove.length; i++) {
$(PSRemove[i]).attr("onclick", "editRemoveRowCrossJob("+ i + ")");
}
}
}
function validDate(inputField, id) {
function validDate(inputField, id) {
if (inputField.value != '') {
if (inputField.value != '') {
validCheck = true;
$(`#${id}`).val("فیلد الزامی است");
} else {
validCheck = false;
$(`#${id}`).val();
validCheck = true;
$('#' + id).val("فیلد الزامی است");
}
else {
validCheck = false;
$('#' + id).val();
}
}
}
</script>
}
</script>

View File

@@ -2,14 +2,14 @@
@model ServiceHost.Areas.Admin.Pages.Company.CrossJobGuild.IndexModel
@{
int i = 1;
var i = 1;
}
@{
Layout = "Shared/_AdminLayout";
ViewData["title"] = "مشاغل مقطوع";
var str_title = "صنف و درجه";
<style>
Layout = "Shared/_AdminLayout";
ViewData["title"] = "مشاغل مقطوع";
var str_title = "صنف و درجه";
<style>
.thh0 {
width: 8px !important;
}
@@ -38,229 +38,227 @@
}
<div class="row">
<div class="row">
<div class="col-sm-12 m-r-10">
<p class="pull-right">
<a id="btnPopModal" href="#showmodal=@Url.Page("/Company/CrossJobGuild/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>
<div class="row">
<div class="col-sm-12 m-r-10">
<p class="pull-right">
<a id="btnPopModal" href="#showmodal=@Url.Page("/Company/CrossJobGuild/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>
<div class="col-sm-12">
<div class="panel-group panel-group-joined" id="accordion-test">
<div class="col-sm-12">
<div class="panel-group panel-group-joined" id="accordion-test">
<div class="panel panel-default" style="border-radius: 15px !important;">
<div class="panel-heading" style="background-color: #545353 !important">
<h4 class="panel-title" style="color: #edebeb !important; display: inline;">
<a data-toggle="collapse" data-parent="#accordion-test" href="#collapseOne" class="collapsed" style="display: inline;">
جستجوی مشاغل
</a>
</h4>
<div class="panel panel-default" style="border-radius: 15px !important;">
<div class="panel-heading" style="background-color: #545353 !important">
<h4 class="panel-title" style="color: #edebeb !important; display: inline;">
<a data-toggle="collapse" data-parent="#accordion-test" href="#collapseOne" class="collapsed" style="display: inline;">
جستجوی مشاغل
</a>
</h4>
</div>
<div id="collapseOne" class="panel-collapse collapse in ">
<div class="panel-body" style="padding-top: 15px; padding-bottom: 15px;">
@*===================================================================================================================*@
</div>
<div id="collapseOne" class="panel-collapse collapse in ">
<div class="panel-body" style="padding-top: 15px; padding-bottom: 15px;">
@*===================================================================================================================*@
<div class="row">
<div class="row">
<div class="col-sm-12">
<div class="col-sm-12">
<form class="form-inline" role="form" method="get" name="search-theme-form" id="search-theme-form" autocomplete="off">
<div class="form-group col-sm-12">
<div class="row">
<div class="col-lg-3 pull-right">
<label class="sr-only" asp-for="searchModel.Year"></label>
<input class="form-control inpt" asp-for="searchModel.Year" data-val="false" placeholder="سال " style="width: 100%">
</div>
<div class="col-lg-3 pull-right">
<label class="sr-only" asp-for="searchModel.Title"></label>
<input class="form-control inpt" asp-for="searchModel.Title" placeholder="@str_title" style="width: 100%">
</div>
<div class="col-lg-3 pull-right">
<label class="sr-only" asp-for="searchModel.EconomicCode"></label>
<input class="form-control inpt" asp-for="searchModel.EconomicCode" placeholder="کد اقتصادی " style="width: 100%">
</div>
</div>
<div class="row" style="margin-top: 15px">
<div class="col-lg-9">
<form class="form-inline" role="form" method="get" name="search-theme-form" id="search-theme-form" autocomplete="off">
<div class="form-group col-sm-12">
<div class="row">
<div class="col-lg-3 pull-right">
<label class="sr-only" asp-for="searchModel.Year"></label>
<input class="form-control inpt" asp-for="searchModel.Year" data-val="false" placeholder="سال " style="width: 100%">
</div>
<div class="col-lg-3 pull-right">
<label class="sr-only" asp-for="searchModel.Title"></label>
<input class="form-control inpt" asp-for="searchModel.Title" placeholder="@str_title" style="width: 100%">
</div>
<div class="col-lg-3 pull-right">
<label class="sr-only" asp-for="searchModel.EconomicCode"></label>
<input class="form-control inpt" asp-for="searchModel.EconomicCode" placeholder="کد اقتصادی " style="width: 100%">
</div>
</div>
<div class="row" style="margin-top: 15px">
<div class="col-lg-9">
</div>
<div class="col-lg-3">
<button type="submit" class="btn btn-success btn-rounded waves-effect waves-light m-b-5"
style="border-bottom-left-radius: 0px; border-top-left-radius: 0px; background-color: #950000;
</div>
<div class="col-lg-3">
<button type="submit" class="btn btn-success btn-rounded waves-effect waves-light m-b-5"
style="border-bottom-left-radius: 0px; border-top-left-radius: 0px; background-color: #950000;
border-color: #950000; font-family: 'Web_Yekan' !important; margin-left: -3px">
<i class="fa fa-search" style="padding-left: 3px; font-size: 14px;"></i> جستجو
</button>
<a class="btn btn-info btn-rounded waves-effect waves-light m-b-5"
style="border-bottom-right-radius: 0px; border-top-right-radius: 0px; background-color: #545353;
border-color: #545353; font-family: 'Web_Yekan' !important;" asp-page="./Index">مشاهده همه</a>
</div>
</div>
</div>
</form>
</div>
</div>
@*==================================================================crossJobGuild=====*@
</div>
</div>
</div>
<i class="fa fa-search" style="padding-left: 3px; font-size: 14px;"></i> جستجو
</button>
<a class="btn btn-info btn-rounded waves-effect waves-light m-b-5"
style="border-bottom-right-radius: 0px; border-top-right-radius: 0px; background-color: #545353;
border-color: #545353; font-family: 'Web_Yekan' !important;" asp-page="./Index">
مشاهده همه
</a>
</div>
</div>
</div>
</form>
</div>
</div>
@*==================================================================crossJobGuild=====*@
</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" style="padding-left: 3px; font-size: 14px"></i> لیست مشاغل مقطوع</h3>
</div>
<div class="panel-body">
<div class="row">
<div class="col-sm-12 col-sm-12 col-xs-12">
<table id="datatable" class="table table-striped table-bordered">
<thead>
<tr>
<th style="font-size: 16px !important; width: 5% !important">#</th>
<th style="font-size: 16px !important; width: 5% !important; text-align: center"> سال</th>
<th style="font-size: 16px !important; text-align: center"> @str_title </th>
<th style="font-size: 16px !important; text-align: center"> شغل </th>
<th style="font-size: 16px !important; text-align: center">کد اقتصادی</th>
<th style="font-size: 16px !important; "></th>
</tr>
</thead>
<tbody>
@foreach (var item in Model.crossJobGuilds)
{
<tr>
<td style="font-size: 14px !important; text-align: center">@i </td>
<td style="font-size: 14px !important; text-align: center">@item.Year </td>
<td style="font-size: 14px !important; text-align: center">@item.Title </td>
<td style="font-size: 14px !important; text-align: center;width:350px !important">
@{Model.GetCrossJobs(item.Id);
string str = " ";
foreach (var child in Model.crossJobs)
{
Model.GetCrossJobItems(child.Id);
foreach (var it in Model.crossJobItems)
{
str = str + " - " + it.job.JobName;
str = str.Trim();
}
}
<span>@str.Substring(1)</span>
}
</td>
<div class="col-sm-12">
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title"><i class="fa fa-list" style="padding-left: 3px; font-size: 14px"></i> لیست مشاغل مقطوع</h3>
</div>
<div class="panel-body">
<div class="row">
<div class="col-sm-12 col-sm-12 col-xs-12">
<table id="datatable" class="table table-striped table-bordered">
<thead>
<tr>
<th style="font-size: 16px !important; width: 5% !important">#</th>
<th style="font-size: 16px !important; width: 5% !important; text-align: center"> سال</th>
<th style="font-size: 16px !important; text-align: center"> @str_title </th>
<th style="font-size: 16px !important; text-align: center"> شغل </th>
<th style="font-size: 16px !important; text-align: center">کد اقتصادی</th>
<th style="font-size: 16px !important; "></th>
</tr>
</thead>
<tbody>
@foreach (var item in Model.crossJobGuilds)
{
<tr>
<td style="font-size: 14px !important; text-align: center">@i </td>
<td style="font-size: 14px !important; text-align: center">@item.Year </td>
<td style="font-size: 14px !important; text-align: center">@item.Title </td>
<td style="font-size: 14px !important; text-align: center;width:350px !important">
@{
Model.GetCrossJobs(item.Id);
var str = " ";
foreach (var child in Model.crossJobs)
{
Model.GetCrossJobItems(child.Id);
foreach (var it in Model.crossJobItems)
{
str = str + " - " + it.job.JobName;
str = str.Trim();
}
}
<span>@str.Substring(1)</span>
}
</td>
<td style="font-family: 'IranText' !important; font-size: 14px !important; text-align: center">
@item.EconomicCode
</td>
@{ i++; }
<td>
<a class="btn btn-warning pull-left m-rl-5"
href="#showmodal=@Url.Page("./Index", "Edit", new {Id = item.Id})">
<i class="fa fa-edit"></i>
</a>
<a class="btn btn-success pull-left m-rl-5"
href="#showmodal=@Url.Page("./Index", "Details", new { Id = item.Id })">
<i class="fa fa-file-text ionSize"></i>
</a>
<a class="btn btn-danger ionRad pull-left m-rl-5 " onclick="removeJob(@item.Id)">
<i class="fa fa-trash ionSize"></i>
</a>
</td>
</tr>
}
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
<td style="font-family: 'IranText' !important; font-size: 14px !important; text-align: center">
@item.EconomicCode
</td>
@{ i++; }
<td>
<a class="btn btn-warning pull-left m-rl-5"
href="#showmodal=@Url.Page("./Index", "Edit", new { item.Id })">
<i class="fa fa-edit"></i>
</a>
<a class="btn btn-success pull-left m-rl-5"
href="#showmodal=@Url.Page("./Index", "Details", new { item.Id })">
<i class="fa fa-file-text ionSize"></i>
</a>
<a class="btn btn-danger ionRad pull-left m-rl-5 " onclick="removeJob(@item.Id)">
<i class="fa fa-trash ionSize"></i>
</a>
</td>
</tr>
}
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
@section Script {
<script src="~/AdminTheme/assets/js/site.js"></script>
<script src="~/adminTheme/assets/datatables/jquery.dataTables.min.js"></script>
<script src="~/adminTheme/assets/datatables/dataTables.bootstrap.js"></script>
<script src="~/AdminTheme/assets/js/site.js"></script>
<script src="~/adminTheme/assets/datatables/jquery.dataTables.min.js"></script>
<script src="~/adminTheme/assets/datatables/dataTables.bootstrap.js"></script>
<script type="text/javascript">
$(document).ready(function () {
$('#datatable').dataTable({
"lengthMenu": [[25, 10, 50, 100, -1], [25, 10, 50, 100, "All"]]
});
});
<script type="text/javascript">
$(document).ready(function() {
$('#datatable').dataTable({
"lengthMenu": [[25, 10, 50, 100, -1], [25, 10, 50, 100, "All"]]
});
});
</script>
<script>
$(document).ready(function () {
$('#datatable2').dataTable(
{
"lengthMenu": [[25, 10, 50, 100, -1], [25, 10, 50, 100, "All"]]
});
});
function removeJob(id) {
</script>
<script>
$(document).ready(function() {
$('#datatable2').dataTable(
{
"lengthMenu": [[25, 10, 50, 100, -1], [25, 10, 50, 100, "All"]]
});
});
swal({
title: "آیا برای حذف اطمینان دارید؟",
text: "",
type: "warning",
showCancelButton: true,
confirmButtonColor: "#DD6B55",
confirmButtonText: "بله",
cancelButtonText: "خیر",
closeOnConfirm: true,
closeOnCancel: true
}, function (isConfirm) {
if (isConfirm) {
function removeJob(id) {
$.ajax({
dataType: 'json',
type: 'POST',
url: '@Url.Page("./Index", "Remove")',
headers: { "RequestVerificationToken": $('@Html.AntiForgeryToken()').val() },
data: { "id" : id },
swal({
title: "آیا برای حذف اطمینان دارید؟",
text: "",
type: "warning",
showCancelButton: true,
confirmButtonColor: "#DD6B55",
confirmButtonText: "بله",
cancelButtonText: "خیر",
closeOnConfirm: true,
closeOnCancel: true
},
function(isConfirm) {
if (isConfirm) {
success: function (response) {
$.Notification.autoHideNotify('success', 'top center', 'پیام سیستم ', response.message);
setTimeout(function () {
window.location.reload();
}, 1200);
window.location.hash = "##";
},
failure: function (response) {
console.log(5, response)
$.Notification.autoHideNotify('error', 'top center', 'پیام سیستم ', response.message);
}
});
$.ajax({
dataType: 'json',
type: 'POST',
url: '@Url.Page("./Index", "Remove")',
headers: { "RequestVerificationToken": $('@Html.AntiForgeryToken()').val() },
data: { "id": id },
}
success: function(response) {
$.Notification.autoHideNotify('success', 'top center', 'پیام سیستم ', response.message);
setTimeout(function() {
window.location.reload();
},
1200);
window.location.hash = "##";
},
failure: function(response) {
console.log(5, response);
$.Notification.autoHideNotify('error', 'top center', 'پیام سیستم ', response.message);
}
});
}
});
}
</script>
}
});
}
</script>
}

View File

@@ -1,467 +1,407 @@
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using _0_Framework.Application;
using Company.Domain.ContarctingPartyAgg;
using _0_Framework.Application;
using CompanyManagment.App.Contracts.CrossJob;
using CompanyManagment.App.Contracts.CrossJobGuild;
using CompanyManagment.App.Contracts.CrossJobItems;
using CompanyManagment.App.Contracts.Job;
using CompanyManagment.EFCore;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
using Microsoft.AspNetCore.Mvc.Rendering;
using Newtonsoft.Json;
namespace ServiceHost.Areas.Admin.Pages.Company.CrossJobGuild
namespace ServiceHost.Areas.Admin.Pages.Company.CrossJobGuild;
[Authorize]
public class IndexModel : PageModel
{
[Authorize]
public class IndexModel : PageModel
{
private const char Separator = '-';
public CrossJobGuildSearchModel searchModel;
public List<CrossJobGuildViewModel> crossJobGuilds;
public List<CrossJobViewModel> crossJobs;
public List<CrossJobItemsViewModel> crossJobItems;
private readonly ICrossJobGuildApplication _crossJobGuildApplication;
private readonly ICrossJobApplication _crossJobApplication;
private readonly ICrossJobItemsApplication _crossJobItemsApplication;
public IndexModel(ICrossJobGuildApplication crossJobGuildApplication,
ICrossJobApplication crossJobApplication,
ICrossJobItemsApplication crossJobItemsApplication)
{
_crossJobGuildApplication = crossJobGuildApplication;
_crossJobItemsApplication = crossJobItemsApplication;
_crossJobApplication = crossJobApplication;
}
public void OnGet(CrossJobGuildSearchModel searchModel)
{
crossJobGuilds = _crossJobGuildApplication.Search(searchModel);
}
public void GetCrossJobs(long id)
{
CrossJobSearchModel searchModel = new CrossJobSearchModel();
searchModel.CrossJobGuildId = id;
crossJobs = _crossJobApplication.Search(searchModel);
}
public void GetCrossJobItems(long id)
{
CrossJobItemsSearchModel searchModel = new CrossJobItemsSearchModel();
searchModel.crossJobId = id;
crossJobItems = _crossJobItemsApplication.Search(searchModel);
}
public IActionResult OnGetCreate()
{
CreateCrossJobGuild detail = new CreateCrossJobGuild();
var deta = _crossJobGuildApplication.GetCrossJobGuild().LastOrDefault();
detail.jobs = new SelectList(_crossJobGuildApplication.GetJob(), "Id", "JobName");
if (deta != null)
{
detail.Year = deta.Year;
}
return Partial("./Create", detail);
}
public IActionResult OnPostCreate(CreateCrossJobGuild command)
{
#region Validation
var valid = _crossJobGuildApplication.Validation(command);
if (valid.IsSuccedded == false)
{
return new JsonResult(valid);
}
#endregion
#region Economic String
string economicString = "";
foreach (var item in command.economicCodeList)
{
if (!string.IsNullOrWhiteSpace(item))
{
economicString += "-" + item;
}
}
if (economicString.Length > 2)
{
command.EconomicCode = economicString.Substring(1);
}
#endregion
#region Create CrossJob Guild
var result = _crossJobGuildApplication.Create(command);
Thread.Sleep(1000);
#endregion
if (result.IsSuccedded)
{
var items = command.crossJobsList.Count();
#region Get New ID Crossob Guild
var searchModel = new CrossJobGuildSearchModel
{
Title = command.Title,
Year = command.Year,
EconomicCode = command.EconomicCode
};
var query_new_crossjobGuild = _crossJobGuildApplication.Search(searchModel).FirstOrDefault();
#endregion
for (int i = 0; i <= items - 1; i++)
{
#region Create_crossJob
var new_createCrosJob = new CreateCrossJob
{
EquivalentRialUnder = command.crossJobsList[i].EquivalentRialUnder,
SalaryRatioUnder = command.crossJobsList[i].SalaryRatioUnder,
EquivalentRialOver = command.crossJobsList[i].EquivalentRialOver,
SalaryRatioOver = command.crossJobsList[i].SalaryRatioOver,
CrossJobGuildId = query_new_crossjobGuild.Id
};
var newRecord_crossJob = _crossJobApplication.CreateBackId(new_createCrosJob);
#endregion
#region Create new CrossJoItem
if (newRecord_crossJob.IsSuccedded)
{
if (command.crossJobsList[i].jobItems != null)
foreach (var newItem in command.crossJobsList[i].jobItems)
{
var new_CrossJobItems = new CreateCrossJobItems
{
crossJobId = newRecord_crossJob.EntityId,
jobId = newItem
};
var newRecord_crossJobItem = _crossJobItemsApplication.Create(new_CrossJobItems);
}
}
#endregion
}
}
return new JsonResult(result);
}
public IActionResult OnGetEdit(long id)
{
var detail = _crossJobGuildApplication.GetDetails(id);
detail.crossJobsList = _crossJobApplication.GetCrossJob(id);
detail.crossJobItemsList = _crossJobItemsApplication.GetCrossJobItems(id);
if (!string.IsNullOrWhiteSpace(detail.EconomicCode))
{
var economicCodeList = detail.EconomicCode.Split(Separator);
detail.economicCodeList = economicCodeList.ToList();
}
foreach (var item in detail.crossJobsList)
{
item.SelectedValues = detail.crossJobItemsList.Where(x => x.crossJobId == item.Id).Select(c => c.jobId).ToList();
}
detail.jobs = new SelectList(_crossJobGuildApplication.GetJob(), "Id", "JobName");
return Partial("Edit", detail);
}
public JsonResult OnPostEdit(EditCrossJobGuild command)
{
#region Validation
var valid = _crossJobGuildApplication.Validation(command);
if (valid.IsSuccedded == false)
{
return new JsonResult(valid);
}
#endregion
#region Economic Code
string economicString = "";
foreach (var item in command.economicCodeList)
{
if (!string.IsNullOrWhiteSpace(item))
{
economicString += "-" + item;
}
}
if (economicString.Length > 2)
{
command.EconomicCode = economicString.Substring(1);
}
#endregion
#region Edit Guild
var result = _crossJobGuildApplication.Edit(command);
Thread.Sleep(1000);
#endregion
#region Remove Row CrossJob
var searchModelCrossJobs = new CrossJobSearchModel
{
CrossJobGuildId = command.Id
};
var crossjobList = _crossJobApplication.Search(searchModelCrossJobs).ToList();
if (crossjobList != null)
{
bool flg = false;
foreach (var oldCrossJob in crossjobList)
{
flg = false;
if (command.crossJobsList != null)
foreach (var newCrossJob in command.crossJobsList)
{
if (oldCrossJob.Id == newCrossJob.Id)
{
flg = true;
}
}
if (flg == false)
{
var res = _crossJobItemsApplication.RemoveRange(oldCrossJob.Id);
if (res.IsSuccedded)
{
res = _crossJobApplication.Remove(oldCrossJob.Id);
if (res.IsSuccedded)
{
//OK
}
else
{
return new JsonResult(res);
}
}
else
{
return new JsonResult(res);
}
}
}
}
#endregion
#region Remove crossJoItem
foreach (var _cj in command.crossJobsList)
{
if (_cj.Id != 0)
{
var _searchItem = new CrossJobItemsSearchModel
{
crossJobId = _cj.Id,
};
var _itemResult = _crossJobItemsApplication.Search(_searchItem);
if (_itemResult != null)
foreach (var oldItems in _itemResult)
{
bool flg = false;
if (_cj.SelectedValues != null)
foreach (var NewItems in _cj.SelectedValues)
{
if (oldItems.jobId == NewItems)
{
flg = true;
}
}
if (flg == false)
{
var Item_res = _crossJobItemsApplication.Remove(oldItems.Id);
if (Item_res.IsSuccedded)
{
}
else
{
return new JsonResult(Item_res);
}
}
if (_cj.jobItems != null)
foreach (var sel in _cj.jobItems)
{
}
}
}
}
#endregion
if (result.IsSuccedded)
{
foreach (var cj in command.crossJobsList)
{
if (cj.Id != 0) //Edit CrossJo
{
EditCrossJob _editCrossJob = new EditCrossJob()
{
Id = cj.Id,
CrossJobGuildId = command.Id,
SalaryRatioOver = cj.SalaryRatioOver,
SalaryRatioUnder = cj.SalaryRatioUnder,
EquivalentRialOver = cj.EquivalentRialOver,
EquivalentRialUnder = cj.EquivalentRialUnder,
};
_crossJobApplication.Edit(_editCrossJob);
}
else //new CrossJob
{
var _createCrossjob = new CreateCrossJob
{
CrossJobGuildId = command.Id,
EquivalentRialUnder = cj.EquivalentRialUnder,
SalaryRatioUnder = cj.SalaryRatioUnder,
EquivalentRialOver = cj.EquivalentRialOver,
SalaryRatioOver = cj.SalaryRatioOver,
};
var res = _crossJobApplication.CreateBackId(_createCrossjob);
cj.Id = res.EntityId;
}
if (cj.SelectedValues != null)
foreach (var sel in cj.SelectedValues)
{
var searchItem = new CrossJobItemsSearchModel
{
crossJobId = cj.Id,
jobId = sel
};
var itemResult = _crossJobItemsApplication.Search(searchItem);
if (itemResult.Count == 0)
{
var createItem = new CreateCrossJobItems
{
crossJobId = cj.Id,
jobId = sel
};
var createResult = _crossJobItemsApplication.Create(createItem);
if (!createResult.IsSuccedded)
{
return new JsonResult(createResult);
}
}
}
if (cj.jobItems != null)
foreach (var sel in cj.jobItems)
{
var searchItem = new CrossJobItemsSearchModel
{
crossJobId = cj.Id,
jobId = sel
};
var itemResult = _crossJobItemsApplication.Search(searchItem);
if (itemResult.Count == 0)
{
var createItem = new CreateCrossJobItems
{
crossJobId = cj.Id,
jobId = sel
};
var createResult = _crossJobItemsApplication.Create(createItem);
if (!createResult.IsSuccedded)
{
return new JsonResult(createResult);
}
}
}
}
}
return new JsonResult(result);
}
public IActionResult OnGetDetails(long id)
{
var detail = _crossJobGuildApplication.GetDetails(id);
detail.crossJobsList = _crossJobApplication.GetCrossJob(id);
detail.crossJobItemsList = _crossJobItemsApplication.GetCrossJobItems(id);
if (!string.IsNullOrWhiteSpace(detail.EconomicCode))
{
var economicCodeList = detail.EconomicCode.Split(Separator);
detail.economicCodeList = economicCodeList.ToList();
}
return Partial("Details", detail);
}
public IActionResult OnPostRemove(long id)
{
var result = new OperationResult();
var searchModel = new CrossJobSearchModel
{
CrossJobGuildId = id
};
var query_crossJob = _crossJobApplication.Search(searchModel);
foreach (var op in query_crossJob)
{
var searchModel_crossJobItem = new CrossJobItemsSearchModel
{
crossJobId = op.Id
};
var items = _crossJobItemsApplication.Search(searchModel_crossJobItem);
var res = _crossJobItemsApplication.RemoveRange(op.Id);
if (!res.IsSuccedded)
{
return new JsonResult(res);
}
}
if (query_crossJob.Count > 0)
{
var res = _crossJobApplication.RemoveRange(id);
if (res.IsSuccedded)
{
result = _crossJobGuildApplication.Remove(id);
}
else
{
result = res;
}
}
else
{
result = _crossJobGuildApplication.Remove(id);
}
return new JsonResult(result);
}
public JsonResult OnGetJob(long id)
{
var res = _crossJobGuildApplication.GetJob();
return new JsonResult(res);
}
}
}
private const char Separator = '-';
private readonly ICrossJobApplication _crossJobApplication;
private readonly ICrossJobGuildApplication _crossJobGuildApplication;
private readonly ICrossJobItemsApplication _crossJobItemsApplication;
public List<CrossJobGuildViewModel> crossJobGuilds;
public List<CrossJobItemsViewModel> crossJobItems;
public List<CrossJobViewModel> crossJobs;
public CrossJobGuildSearchModel searchModel;
public IndexModel(ICrossJobGuildApplication crossJobGuildApplication,
ICrossJobApplication crossJobApplication,
ICrossJobItemsApplication crossJobItemsApplication)
{
_crossJobGuildApplication = crossJobGuildApplication;
_crossJobItemsApplication = crossJobItemsApplication;
_crossJobApplication = crossJobApplication;
}
public void OnGet(CrossJobGuildSearchModel searchModel)
{
crossJobGuilds = _crossJobGuildApplication.Search(searchModel);
}
public void GetCrossJobs(long id)
{
var searchModel = new CrossJobSearchModel();
searchModel.CrossJobGuildId = id;
crossJobs = _crossJobApplication.Search(searchModel);
}
public void GetCrossJobItems(long id)
{
var searchModel = new CrossJobItemsSearchModel();
searchModel.crossJobId = id;
crossJobItems = _crossJobItemsApplication.Search(searchModel);
}
public IActionResult OnGetCreate()
{
var detail = new CreateCrossJobGuild();
var deta = _crossJobGuildApplication.GetCrossJobGuild().LastOrDefault();
detail.jobs = new SelectList(_crossJobGuildApplication.GetJob(), "Id", "JobName");
if (deta != null) detail.Year = deta.Year;
return Partial("./Create", detail);
}
public IActionResult OnPostCreate(CreateCrossJobGuild command)
{
#region Validation
var valid = _crossJobGuildApplication.Validation(command);
if (valid.IsSuccedded == false) return new JsonResult(valid);
#endregion
#region Economic String
var economicString = "";
foreach (var item in command.economicCodeList)
if (!string.IsNullOrWhiteSpace(item))
economicString += "-" + item;
if (economicString.Length > 2) command.EconomicCode = economicString.Substring(1);
#endregion
#region Create CrossJob Guild
var result = _crossJobGuildApplication.Create(command);
Thread.Sleep(1000);
#endregion
if (result.IsSuccedded)
{
var items = command.crossJobsList.Count();
#region Get New ID Crossob Guild
var searchModel = new CrossJobGuildSearchModel
{
Title = command.Title,
Year = command.Year,
EconomicCode = command.EconomicCode
};
var query_new_crossjobGuild = _crossJobGuildApplication.Search(searchModel).FirstOrDefault();
#endregion
for (var i = 0; i <= items - 1; i++)
{
#region Create_crossJob
var new_createCrosJob = new CreateCrossJob
{
EquivalentRialUnder = command.crossJobsList[i].EquivalentRialUnder,
SalaryRatioUnder = command.crossJobsList[i].SalaryRatioUnder,
EquivalentRialOver = command.crossJobsList[i].EquivalentRialOver,
SalaryRatioOver = command.crossJobsList[i].SalaryRatioOver,
CrossJobGuildId = query_new_crossjobGuild.Id
};
var newRecord_crossJob = _crossJobApplication.CreateBackId(new_createCrosJob);
#endregion
#region Create new CrossJoItem
if (newRecord_crossJob.IsSuccedded)
if (command.crossJobsList[i].jobItems != null)
foreach (var newItem in command.crossJobsList[i].jobItems)
{
var new_CrossJobItems = new CreateCrossJobItems
{
crossJobId = newRecord_crossJob.EntityId,
jobId = newItem
};
var newRecord_crossJobItem = _crossJobItemsApplication.Create(new_CrossJobItems);
}
#endregion
}
}
return new JsonResult(result);
}
public IActionResult OnGetEdit(long id)
{
var detail = _crossJobGuildApplication.GetDetails(id);
detail.crossJobsList = _crossJobApplication.GetCrossJob(id);
detail.crossJobItemsList = _crossJobItemsApplication.GetCrossJobItems(id);
if (!string.IsNullOrWhiteSpace(detail.EconomicCode))
{
var economicCodeList = detail.EconomicCode.Split(Separator);
detail.economicCodeList = economicCodeList.ToList();
}
foreach (var item in detail.crossJobsList)
item.SelectedValues = detail.crossJobItemsList.Where(x => x.crossJobId == item.Id).Select(c => c.jobId)
.ToList();
detail.jobs = new SelectList(_crossJobGuildApplication.GetJob(), "Id", "JobName");
return Partial("Edit", detail);
}
public JsonResult OnPostEdit(EditCrossJobGuild command)
{
#region Validation
var valid = _crossJobGuildApplication.Validation(command);
if (valid.IsSuccedded == false) return new JsonResult(valid);
#endregion
#region Economic Code
var economicString = "";
foreach (var item in command.economicCodeList)
if (!string.IsNullOrWhiteSpace(item))
economicString += "-" + item;
if (economicString.Length > 2) command.EconomicCode = economicString.Substring(1);
#endregion
#region Edit Guild
var result = _crossJobGuildApplication.Edit(command);
Thread.Sleep(1000);
#endregion
#region Remove Row CrossJob
var searchModelCrossJobs = new CrossJobSearchModel
{
CrossJobGuildId = command.Id
};
var crossjobList = _crossJobApplication.Search(searchModelCrossJobs).ToList();
if (crossjobList != null)
{
var flg = false;
foreach (var oldCrossJob in crossjobList)
{
flg = false;
if (command.crossJobsList != null)
foreach (var newCrossJob in command.crossJobsList)
if (oldCrossJob.Id == newCrossJob.Id)
flg = true;
if (flg == false)
{
var res = _crossJobItemsApplication.RemoveRange(oldCrossJob.Id);
if (res.IsSuccedded)
{
res = _crossJobApplication.Remove(oldCrossJob.Id);
if (res.IsSuccedded)
{
//OK
}
else
{
return new JsonResult(res);
}
}
else
{
return new JsonResult(res);
}
}
}
}
#endregion
#region Remove crossJoItem
foreach (var _cj in command.crossJobsList)
if (_cj.Id != 0)
{
var _searchItem = new CrossJobItemsSearchModel
{
crossJobId = _cj.Id
};
var _itemResult = _crossJobItemsApplication.Search(_searchItem);
if (_itemResult != null)
foreach (var oldItems in _itemResult)
{
var flg = false;
if (_cj.SelectedValues != null)
foreach (var NewItems in _cj.SelectedValues)
if (oldItems.jobId == NewItems)
flg = true;
if (flg == false)
{
var Item_res = _crossJobItemsApplication.Remove(oldItems.Id);
if (Item_res.IsSuccedded)
{
}
else
{
return new JsonResult(Item_res);
}
}
if (_cj.jobItems != null)
foreach (var sel in _cj.jobItems)
{
}
}
}
#endregion
if (result.IsSuccedded)
foreach (var cj in command.crossJobsList)
{
if (cj.Id != 0) //Edit CrossJo
{
var _editCrossJob = new EditCrossJob
{
Id = cj.Id,
CrossJobGuildId = command.Id,
SalaryRatioOver = cj.SalaryRatioOver,
SalaryRatioUnder = cj.SalaryRatioUnder,
EquivalentRialOver = cj.EquivalentRialOver,
EquivalentRialUnder = cj.EquivalentRialUnder
};
_crossJobApplication.Edit(_editCrossJob);
}
else //new CrossJob
{
var _createCrossjob = new CreateCrossJob
{
CrossJobGuildId = command.Id,
EquivalentRialUnder = cj.EquivalentRialUnder,
SalaryRatioUnder = cj.SalaryRatioUnder,
EquivalentRialOver = cj.EquivalentRialOver,
SalaryRatioOver = cj.SalaryRatioOver
};
var res = _crossJobApplication.CreateBackId(_createCrossjob);
cj.Id = res.EntityId;
}
if (cj.SelectedValues != null)
foreach (var sel in cj.SelectedValues)
{
var searchItem = new CrossJobItemsSearchModel
{
crossJobId = cj.Id,
jobId = sel
};
var itemResult = _crossJobItemsApplication.Search(searchItem);
if (itemResult.Count == 0)
{
var createItem = new CreateCrossJobItems
{
crossJobId = cj.Id,
jobId = sel
};
var createResult = _crossJobItemsApplication.Create(createItem);
if (!createResult.IsSuccedded) return new JsonResult(createResult);
}
}
if (cj.jobItems != null)
foreach (var sel in cj.jobItems)
{
var searchItem = new CrossJobItemsSearchModel
{
crossJobId = cj.Id,
jobId = sel
};
var itemResult = _crossJobItemsApplication.Search(searchItem);
if (itemResult.Count == 0)
{
var createItem = new CreateCrossJobItems
{
crossJobId = cj.Id,
jobId = sel
};
var createResult = _crossJobItemsApplication.Create(createItem);
if (!createResult.IsSuccedded) return new JsonResult(createResult);
}
}
}
return new JsonResult(result);
}
public IActionResult OnGetDetails(long id)
{
var detail = _crossJobGuildApplication.GetDetails(id);
detail.crossJobsList = _crossJobApplication.GetCrossJob(id);
detail.crossJobItemsList = _crossJobItemsApplication.GetCrossJobItems(id);
if (!string.IsNullOrWhiteSpace(detail.EconomicCode))
{
var economicCodeList = detail.EconomicCode.Split(Separator);
detail.economicCodeList = economicCodeList.ToList();
}
return Partial("Details", detail);
}
public IActionResult OnPostRemove(long id)
{
var result = new OperationResult();
var searchModel = new CrossJobSearchModel
{
CrossJobGuildId = id
};
var query_crossJob = _crossJobApplication.Search(searchModel);
foreach (var op in query_crossJob)
{
var searchModel_crossJobItem = new CrossJobItemsSearchModel
{
crossJobId = op.Id
};
var items = _crossJobItemsApplication.Search(searchModel_crossJobItem);
var res = _crossJobItemsApplication.RemoveRange(op.Id);
if (!res.IsSuccedded) return new JsonResult(res);
}
if (query_crossJob.Count > 0)
{
var res = _crossJobApplication.RemoveRange(id);
if (res.IsSuccedded)
result = _crossJobGuildApplication.Remove(id);
else
result = res;
}
else
{
result = _crossJobGuildApplication.Remove(id);
}
return new JsonResult(result);
}
public JsonResult OnGetJob(long id)
{
var res = _crossJobGuildApplication.GetJob();
return new JsonResult(res);
}
}

View File

@@ -1,13 +1,6 @@
@using _0_Framework.Application
@model CompanyManagment.App.Contracts.Checkout.CreateCheckout
@model CompanyManagment.App.Contracts.Checkout.CreateCheckout
@{
<style>
<style>
.sendSelectDate {
border-color: #ff4e4e !important;
background-color: #ffe4e4 !important;
@@ -216,402 +209,377 @@
}
@{
<script src="~/lib/jquery-ajax-unobtrusive/jquery.unobtrusive-ajax.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/select2/js/select2.js"></script>
<script src="~/lib/select2/js/i18n/fa.js"></script>
<link href="~/AdminTheme/assets/datatables/jquery.dataTables.min.css" rel="stylesheet" type="text/css" />
<script src="~/lib/jquery-ajax-unobtrusive/jquery.unobtrusive-ajax.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/select2/js/select2.js"></script>
<script src="~/lib/select2/js/i18n/fa.js"></script>
<link href="~/AdminTheme/assets/datatables/jquery.dataTables.min.css" rel="stylesheet" type="text/css"/>
<link href="~/lib/select2/css/select2.css" rel="stylesheet" />
<link href="~/lib/select2/css/select2.css" rel="stylesheet"/>
}
<div class="modal-header">
<button type="button" class="close pull-right" data-dismiss="modal" aria-hidden="true"><span style="font-size: 24px">×</span></button>
<button type="button" class="close pull-right" data-dismiss="modal" aria-hidden="true">
<span style="font-size: 24px">×</span>
</button>
</div>
<div class="modal-body">
<div class="row">
<div class="col-md-12">
<fieldset style="border: 1px solid #999797; border-radius: 10px; padding: revert;">
<legend style="margin-bottom: 5px; font-size: large; border-bottom: 0px; color: #505458; width: 150px; text-align: center;"> ویرایش کد پرسنلی </legend>
<div class="row">
<div class="col-md-12">
<fieldset style="border: 1px solid #999797; border-radius: 10px; padding: revert;">
<legend style="margin-bottom: 5px; font-size: large; border-bottom: 0px; color: #505458; width: 150px; text-align: center;"> ویرایش کد پرسنلی </legend>
<form id="my_form" asp-page="./Index" asp-page-handler="ChangeCode" autocomplete="off"
method="get"
data-ajax="true"
data-ajax-method="get"
data-ajax-update="#panel"
data-ajax-mode="replace"
data-ajax-url="@Url.Page("./Index","LoadContracts")">
<div id="progress-bar" class="progress" style="display: none;">
<div style="background-color: #28a711" class="progress-bar progress-bar-striped progress-bar-animated" role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100"></div>
</div>
<form id="my_form" asp-page="./Index" asp-page-handler="ChangeCode" autocomplete="off"
method="get"
data-ajax="true"
data-ajax-method="get"
data-ajax-update="#panel"
data-ajax-mode="replace"
data-ajax-url="@Url.Page("./Index", "LoadContracts")">
<div class="row">
<div id="progress-bar" class="progress" style="display: none;">
<div style="background-color: #28a711" class="progress-bar progress-bar-striped progress-bar-animated" role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100"></div>
</div>
<div class="row">
<div class="col-md-4">
<label> نام کارگاه </label>
<div class="form-group se" dir="rtl">
<div class="col-md-4">
<label> نام کارگاه </label>
<div class="form-group se" dir="rtl">
<select id="getWorkshopWithName" onchange="loadWorkshopWithName()" class="form-control select-city" asp-for="WorkshopId" asp-items='@Model.WorkshopNameSelectList'>
<option value="WorkshopIds"> انتخاب کارگاه </option>
<select id="getWorkshopWithName" onchange="loadWorkshopWithName()" class="form-control select-city" asp-for="WorkshopId" asp-items="@Model.WorkshopNameSelectList">
<option value="WorkshopIds"> انتخاب کارگاه </option>
</select>
</select>
@*<a class="btn btn-info btn-rounded waves-effect waves-light" style="border-bottom-right-radius: 0px; border-top-right-radius: 0px; background-color: #257212; border-color: #545353; font-size: 14px; margin-right: -3px; font-family: 'IranSans' !important;" onclick="show()">تایید</a>*@
</div>
<span asp-validation-for="WorkshopId" class="error"></span>
</div>
@*<a class="btn btn-info btn-rounded waves-effect waves-light" style="border-bottom-right-radius: 0px; border-top-right-radius: 0px; background-color: #257212; border-color: #545353; font-size: 14px; margin-right: -3px; font-family: 'IranSans' !important;" onclick="show()">تایید</a>*@
</div>
<span asp-validation-for="WorkshopId" class="error"></span>
</div>
<div class="col-md-4">
<label>کد بایگانی کارگاه</label>
<div class="form-group se" dir="rtl">
<div class="col-md-4">
<label>کد بایگانی کارگاه</label>
<div class="form-group se" dir="rtl">
<select id="getWorkshopWithCode" onchange="loadWorkshopWithCode()" class="form-control select-city" asp-for="WorkshopId" asp-items='@Model.WorkshopCodeSelectList'>
<option value="WorkshopIds"> انتخاب کد کارگاه </option>
<select id="getWorkshopWithCode" onchange="loadWorkshopWithCode()" class="form-control select-city" asp-for="WorkshopId" asp-items="@Model.WorkshopCodeSelectList">
<option value="WorkshopIds"> انتخاب کد کارگاه </option>
</select>
</select>
</div>
</div>
</div>
</div>
<div class="col-md-4">
<label>نام پرسنل</label>
<div id="person">
<div class="form-group se person" dir="rtl">
<div class="col-md-4">
<label>نام پرسنل</label>
<div id="person">
<div class="form-group se person" dir="rtl">
<select id="getPersonnel" onchange="loadPersonnel()" class="form-control select-city" asp-for="EmployeeId" asp-items='@Model.EmployeeSelectList'>
<option value="0"> انتخاب پرسنل </option>
<select id="getPersonnel" onchange="loadPersonnel()" class="form-control select-city" asp-for="EmployeeId" asp-items="@Model.EmployeeSelectList">
<option value="0"> انتخاب پرسنل </option>
</select>
</select>
</div>
</div>
</div>
</div>
<span asp-validation-for="EmployeeId" class="error"></span>
</div>
<span asp-validation-for="EmployeeId" class="error"></span>
</div>
</div>
</div>
<div class="row" dir="rtl">
<div class="col-md-1 pull-left">
<a class="btn btn-success btn-rounded waves-effect waves-light" onclick="sendData()" style="float: left;">انتخاب</a>
<input type="submit" form="my_form" value="Search" name="Search" id="select" style="display: none"/>
</div>
<div class="row" dir="rtl">
<div class="col-md-1 pull-left">
<a class="btn btn-success btn-rounded waves-effect waves-light" onclick="sendData()" style="float: left;">انتخاب</a>
<input type="submit" form="my_form" value="Search" name="Search" id="select" style="display: none" />
</div>
<div class="col-md-11">
<span id="montAndYearError"></span>
</div>
</div>
<div class="col-md-11">
<span id="montAndYearError"></span>
</div>
</div>
<hr style=" margin-top: 12px;margin-bottom: 12px;" />
<hr style=" margin-top: 12px;margin-bottom: 12px;"/>
</form>
</form>
<form asp-page="./Index" asp-page-handler="ChangeCode" autocomplete="off" id="sub"
method="post"
data-ajax="true"
data-ajax-method="post"
data-ajax-url="@Url.Page("./Index", "Check")"
data-callback=""
data-action="Refresh">
<form asp-page="./Index" asp-page-handler="ChangeCode" autocomplete="off" id="sub"
method="post"
data-ajax="true"
data-ajax-method="post"
data-ajax-url="@Url.Page("./Index","Check")"
data-callback=""
data-action="Refresh">
<div class="row">
<div class="col-sm-12">
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title"><i class="fa fa-list" style="padding-left: 3px; font-size: 14px"></i> لیست شماره پرسنلی </h3>
</div>
<div class="panel-body">
<div class="row">
<div class="col-sm-12 col-sm-12 col-xs-12" style="max-height: 300px; overflow-y: scroll; direction: ltr; max-width: 99%;">
<table id="datatable" class="table table-striped table-bordered" style="direction: rtl">
<thead style="background-color: #ecefee">
<tr>
<th style="font-size: 10px !important" class="sizeSet">#</th>
<th style="font-size: 10px !important" class="sizeSet decorCheckbox">
<input class="checkboxtitle" type="checkbox" id="checkSelect1" disabled="disabled"/>
</th>
<th style="font-size: 10px !important" class="sizeSet">شماره پرسنلی</th>
<th style="font-size: 10px !important" class="sizeSet"> پرسنل </th>
<div class="row">
<div class="col-sm-12">
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title"><i class="fa fa-list" style="padding-left: 3px; font-size: 14px"></i> لیست شماره پرسنلی </h3>
</div>
<div class="panel-body">
<div class="row">
<div class="col-sm-12 col-sm-12 col-xs-12" style="max-height: 300px; overflow-y: scroll; direction: ltr; max-width: 99%;">
<table id="datatable" class="table table-striped table-bordered" style="direction: rtl">
<thead style="background-color: #ecefee">
<tr>
<th style="font-size: 10px !important" class="sizeSet">#</th>
<th style="font-size: 10px !important" class="sizeSet decorCheckbox">
<input class="checkboxtitle" type="checkbox" id="checkSelect1" disabled="disabled" />
</th>
<th style="font-size: 10px !important" class="sizeSet">شماره پرسنلی</th>
</tr>
</thead>
<tbody id="panel">
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
<th style="font-size: 10px !important" class="sizeSet"> پرسنل </th>
<input type="hidden" id="sendWId" name="workshopId"/>
<div id="listOfContract" style="display: none">
</div>
@*<input type="hidden" asp-for="id" value="id"/>*@
<div class="modal-footer m-b-10">
<a href="#" onclick="final()" class="btn btn-success btn-rounded waves-effect waves-light pull-left final">ثبت نهایی</a>
<button type="button" class="btn btn-default btn-rounded waves-effect waves-light pull-left m-b-5" data-dismiss="modal">بستن</button>
<input type="submit" id="sendFinaly" form="sub" value="fine" name="fine" style="display: none"/>
</div>
</form>
</fieldset>
</div>
</tr>
</thead>
<tbody id="panel">
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
<input type="hidden" id="sendWId" name="workshopId" />
<div id="listOfContract" style="display: none">
</div>
@*<input type="hidden" asp-for="id" value="id"/>*@
<div class="modal-footer m-b-10">
<a href="#" onclick="final()" class="btn btn-success btn-rounded waves-effect waves-light pull-left final">ثبت نهایی</a>
<button type="button" class="btn btn-default btn-rounded waves-effect waves-light pull-left m-b-5" data-dismiss="modal">بستن</button>
<input type="submit" id="sendFinaly" form="sub" value="fine" name="fine" style="display: none" />
</div>
</form>
</fieldset>
</div>
</div>
</div>
</div>
<script>
setInterval(function () {
$.ajax({
type: "GET",
url: '@Url.Page("/Company/Employees/Index", "Progress")',
headers: { "RequestVerificationToken": $('input[name="__RequestVerificationToken"]').val() },
success: function (progress) {
if (progress !== 300) {
var progressBarValue = $("#progress-bar .progress-bar");
progressBarValue.css("width", progress + "%");
}
}
});
}, 1000);
$('.final').attr('disabled', 'disabled');
$('.final').css("background-color", "gray");
$('.byStep').attr('disabled', 'disabled');
$('.byStep').css("background-color", "unset");
$('.byStepButton').attr('disabled', 'disabled');
$('.byStepButton').css("background-color", "gray");
setInterval(function() {
$.ajax({
type: "GET",
url: '@Url.Page("/Company/Employees/Index", "Progress")',
headers: { "RequestVerificationToken": $('input[name="__RequestVerificationToken"]').val() },
success: function(progress) {
if (progress !== 300) {
const progressBarValue = $("#progress-bar .progress-bar");
progressBarValue.css("width", progress + "%");
}
}
});
},
1000);
$('.final').attr('disabled', 'disabled');
$('.final').css("background-color", "gray");
$('.byStep').attr('disabled', 'disabled');
$('.byStep').css("background-color", "unset");
$('.byStepButton').attr('disabled', 'disabled');
$('.byStepButton').css("background-color", "gray");
</script>
<script>
function final() {
function final() {
//$('.final').attr('disabled', 'disabled');
//$('.final').css("background-color", "gray");
//$('.byStep').attr('disabled', 'disabled');
//$('.byStep').css("background-color", "unset");
//$('.byStepButton').attr('disabled', 'disabled');
//$('.byStepButton').css("background-color", "gray");
//$('#sub').on('submit', function(e) {
//$('.final').attr('disabled', 'disabled');
//$('.final').css("background-color", "gray");
//$('.byStep').attr('disabled', 'disabled');
//$('.byStep').css("background-color", "unset");
//$('.byStepButton').attr('disabled', 'disabled');
//$('.byStepButton').css("background-color", "gray");
//$('#sub').on('submit', function(e) {
// e.preventDefault();
// e.preventDefault();
//});
//});
$('.item1').remove();
const wId = document.getElementById("getWorkshopWithName").value;
const checkboxId = document.getElementsByName("cheking");
const personnelCodeChange = document.getElementsByClassName("pCode");
//var listArray = [];
//for (var j = 0, p = personnelCodeChange[j].length; j < p; j++) {
// console.log(personnelCodeChange[j].name);
//}
$('#panel').append(
`<input class="item1" type="hidden" value="${wId}" name="WorkshopId"/>`
);
for (var i = 0, n = checkboxId.length; i < n; i++) {
if (checkboxId[i].checked) {
const pname = checkboxId[i].value;
const inputElement = document.querySelector(`input[name="${pname}"]`);
$('#panel').append(
`<input class="item1" type="hidden" value="${pname}" name="Contracts[${i
}].EmployeeId"/><input class="item1" type="hidden" value="${inputElement.value}" name="Contracts[${i}].PersonnelCode"/>`
);
} else {
$('#panel').append(
`<input class="item1" type="hidden" value="${0}" name="Contracts[${i
}].EmployeeId"/><input class="item1" type="hidden" value="${0}" name="Contracts[${i}].PersonnelCode"/>`
);
}
}
if (checkboxId.length > 0) {
$('.item1').remove();
//$('.final').attr('disabled', 'disabled');
//$('.final').css("background-color", "gray");
//$('.byStep').attr('disabled', 'disabled');
//$('.byStep').css("background-color", "unset");
//$('.byStepButton').attr('disabled', 'disabled');
//$('.byStepButton').css("background-color", "gray");
const wId = document.getElementById("getWorkshopWithName").value;
var checkboxId = document.getElementsByName("cheking");
var personnelCodeChange = document.getElementsByClassName("pCode");
//var listArray = [];
//for (var j = 0, p = personnelCodeChange[j].length; j < p; j++) {
// console.log(personnelCodeChange[j].name);
//}
$('#panel').append(
'<input class="item1" type="hidden" value="' + wId + '" name="WorkshopId"/>'
);
for (var i = 0, n = checkboxId.length; i < n; i++) {
if (checkboxId[i].checked) {
let pname = checkboxId[i].value;
let inputElement = document.querySelector('input[name="' + pname + '"]');
$('#panel').append(
'<input class="item1" type="hidden" value="' + pname + '" name="Contracts[' + i + '].EmployeeId"/>'
+ '<input class="item1" type="hidden" value="' + inputElement.value + '" name="Contracts[' + i + '].PersonnelCode"/>'
);
} else {
$('#panel').append(
'<input class="item1" type="hidden" value="' + 0 + '" name="Contracts[' + i + '].EmployeeId"/>'
+ '<input class="item1" type="hidden" value="' + 0 + '" name="Contracts[' + i + '].PersonnelCode"/>'
);
}
}
if (checkboxId.length > 0) {
$('#sendFinaly').click();
//$('#sendFinaly').remove();
//$('#sub').on('submit', function (e) {
//$('.final').attr('disabled', 'disabled');
//$('.final').css("background-color", "gray");
//$('.byStep').attr('disabled', 'disabled');
//$('.byStep').css("background-color", "unset");
//$('.byStepButton').attr('disabled', 'disabled');
//$('.byStepButton').css("background-color", "gray");
$('#sendFinaly').click();
//$('#sendFinaly').remove();
//$('#sub').on('submit', function (e) {
// e.preventDefault();
// e.preventDefault();
//});
$('.contractList').remove();
$('#my_form').reset();
} else {
$.Notification.autoHideNotify('error', 'top center', 'پیام سیستم ', "هیچ پرسنلی برای ویرایش انتخاب نشده است");
}
//});
$('.contractList').remove();
$('#my_form').reset();
} else {
$.Notification.autoHideNotify('error', 'top center', 'پیام سیستم ', "هیچ پرسنلی برای ویرایش انتخاب نشده است");
}
}
}
</script>
<script>
$(document).ready(function () {
$(".select-city2").select2({
language: "fa",
dir: "rtl"
});
})
$(document).ready(function() {
$(".select-city2").select2({
language: "fa",
dir: "rtl"
});
})
</script>
<script type="text/javascript">
function loadWorkshopWithName() {
/* loadPersonnel();*/
const nameId = document.getElementById("getWorkshopWithName").value;
const nameIndex = document.getElementById("getWorkshopWithName");
function loadWorkshopWithName() {
/* loadPersonnel();*/
const nameId = document.getElementById("getWorkshopWithName").value;
const nameIndex = document.getElementById("getWorkshopWithName");
var myArray = document.getElementById('getWorkshopWithName').options.selectedIndex;
document.getElementById("getWorkshopWithCode").options.selectedIndex = myArray;
var codeId = document.getElementById("getWorkshopWithCode");
var archiveCodee = codeId.options[codeId.selectedIndex];
const myArray = document.getElementById('getWorkshopWithName').options.selectedIndex;
document.getElementById("getWorkshopWithCode").options.selectedIndex = myArray;
const codeId = document.getElementById("getWorkshopWithCode");
const archiveCodee = codeId.options[codeId.selectedIndex];
document.getElementById("select2-getWorkshopWithCode-container").innerHTML = archiveCodee.text;
document.getElementById("select2-getWorkshopWithCode-container").innerHTML = archiveCodee.text;
$('#getPersonnel').empty().append('<option selected="selected" value="0" >انتخاب پرسنل</option>');
$('#getPersonnel').empty().append('<option selected="selected" value="0" >انتخاب پرسنل</option>');
$('#archiveCode').val(archiveCodee.text);
$('#archiveCode').val(archiveCodee.text);
if (nameId != "WorkshopIds") {
$.ajax({
//contentType: 'application/json; charset=utf-8',
dataType: 'json',
type: 'POST',
url: '@Url.Page("/Company/Contracts/Index", "LoadWorkshops")',
headers: { "RequestVerificationToken": $('input[name="__RequestVerificationToken"]').val() },
data: { "id": nameId },
if (nameId != "WorkshopIds") {
$.ajax({
//contentType: 'application/json; charset=utf-8',
dataType: 'json',
type: 'POST',
url: '@Url.Page("/Company/Contracts/Index", "LoadWorkshops")',
headers: { "RequestVerificationToken": $('input[name="__RequestVerificationToken"]').val() },
data: { "id": nameId },
success: function(response) {
var items2 = [];
success: function(response) {
var items2 = [];
$.each(response,
function(key, val) {
items2.push({ id: key, vall: val });
$.each(response,
function(key, val) {
items2.push({ id: key, vall: val });
});
});
//document.getElementById("InsurancCode").innerHTML = items2[1].vall;
//document.getElementById("InsurancCode").innerHTML = items2[1].vall;
$.each(response.employeeList, function(i, item)
{
$('#getPersonnel').append($('<option>',
{
value: item.id,
text: item.employeeFullName
}));
});
$.each(response.employeeList,
function(i, item) {
$('#getPersonnel').append($('<option>',
{
value: item.id,
text: item.employeeFullName
}));
});
},
failure: function(response) {
console.log(5, response);
},
failure: function(response) {
console.log(5, response);
}
});
}
}
}
});
}
}
function loadWorkshopWithCode() {
function loadWorkshopWithCode() {
var myArray = document.getElementById('getWorkshopWithCode').options.selectedIndex;
document.getElementById("getWorkshopWithName").options.selectedIndex = myArray;
var getNameId = document.getElementById("getWorkshopWithName");
var getWithName = getNameId.options[getNameId.selectedIndex];
const myArray = document.getElementById('getWorkshopWithCode').options.selectedIndex;
document.getElementById("getWorkshopWithName").options.selectedIndex = myArray;
const getNameId = document.getElementById("getWorkshopWithName");
const getWithName = getNameId.options[getNameId.selectedIndex];
document.getElementById("select2-getWorkshopWithName-container").innerHTML = getWithName.text;
document.getElementById("select2-getWorkshopWithName-container").innerHTML = getWithName.text;
loadWorkshopWithName();
}
loadWorkshopWithName();
}
</script>
@@ -619,90 +587,82 @@
<script type="text/javascript">
function loadPersonnel() {
const id = document.getElementById("getPersonnel").value;
const workshopId = document.getElementById("getWorkshopWithName").value;
function loadPersonnel() {
const id = document.getElementById("getPersonnel").value;
const workshopId = document.getElementById("getWorkshopWithName").value;
if (workshopId == "WorkshopIds") {
$.Notification.autoHideNotify('error', 'top center', 'پیام سیستم ',"ابتدا کارگاه را انتخاب نمایید");
}
if (workshopId == "WorkshopIds") {
$.Notification.autoHideNotify('error', 'top center', 'پیام سیستم ', "ابتدا کارگاه را انتخاب نمایید");
}
if (id > 0 && workshopId != "WorkshopIds") {
$.ajax({
//contentType: 'application/json; charset=utf-8',
dataType: 'json',
type: 'POST',
url: '@Url.Page("/Company/Contracts/Index", "LoadPersonel")',
headers: { "RequestVerificationToken": $('input[name="__RequestVerificationToken"]').val() },
data: { "id": id, "workshopId": workshopId },
if (id > 0 && workshopId != "WorkshopIds") {
$.ajax({
//contentType: 'application/json; charset=utf-8',
dataType: 'json',
type: 'POST',
url: '@Url.Page("/Company/Contracts/Index", "LoadPersonel")',
headers: { "RequestVerificationToken": $('input[name="__RequestVerificationToken"]').val() },
data: { "id": id, "workshopId": workshopId },
success: function (response) {
var items2 = [];
$.each(response, function (key, val) {
items2.push({ id: key, vall: val });
success: function(response) {
var items2 = [];
$.each(response,
function(key, val) {
items2.push({ id: key, vall: val });
});
//if (items2[8].vall == "")
// $.Notification.autoHideNotify('error', 'top center', 'پیام سیستم ',"ابتدا تاریخ شروع به کار را در بخش پرسنل <br/>برای این شخص و کارگاه مورد نظر ایجاد نموده و سپس اقدام به ایجاد قرارداد نمایید");
//document.getElementById("FatherName").innerHTML = items2[1].vall;
//document.getElementById("PersonnelNationalCode").innerHTML = items2[2].vall;
});
//if (items2[8].vall == "")
// $.Notification.autoHideNotify('error', 'top center', 'پیام سیستم ',"ابتدا تاریخ شروع به کار را در بخش پرسنل <br/>برای این شخص و کارگاه مورد نظر ایجاد نموده و سپس اقدام به ایجاد قرارداد نمایید");
//document.getElementById("FatherName").innerHTML = items2[1].vall;
//document.getElementById("PersonnelNationalCode").innerHTML = items2[2].vall;
},
failure: function(response) {
console.log(5, response);
},
failure: function (response) {
console.log(5, response);
}
});
}
}
});
}
}
}
</script>
<script>
function sendData() {
var checkSendWorkshop = false;
function sendData() {
var checkSendWorkshop = false;
if (!isNaN($('#getWorkshopWithName').val())) {
if (!isNaN($('#getWorkshopWithName').val())) {
checkSendWorkshop = true;
}
checkSendWorkshop = true;
}
if (checkSendWorkshop == true) {
if (checkSendWorkshop == true) {
$('.formStep').remove();
$('.ConvertErr').remove();
$('.formStep').remove();
$('.ConvertErr').remove();
$('#convertError').append(
'<input type="hidden" class="formStep" value="select" name="FormStep"/>'
$('#convertError').append(
'<input type="hidden" class="formStep" value="select" name="FormStep"/>'
);
$('#select').click();
$('.byStep').removeAttr('disabled');
$('.byStepButton').removeAttr('disabled');
$('.byStep').css({ 'background-color': '' });
$('.byStepButton').css({ 'background-color': '' });
$('.final').removeAttr('disabled');
$('.final').css({ "background-color": '' });
);
$('#select').click();
$('.byStep').removeAttr('disabled');
$('.byStepButton').removeAttr('disabled');
$('.byStep').css({ 'background-color': '' });
$('.byStepButton').css({ 'background-color': '' });
$('.final').removeAttr('disabled');
$('.final').css({ "background-color": '' });
} else {
$.Notification.autoHideNotify('error', 'top center', 'پیام سیستم ', " انتخاب کارگاه اجباری است ");
}
} else {
$.Notification.autoHideNotify('error', 'top center', 'پیام سیستم ', " انتخاب کارگاه اجباری است ");
}
}
}
</script>

View File

@@ -1,13 +1,6 @@
@using _0_Framework.Application
@model CompanyManagment.App.Contracts.Checkout.CreateCheckout
@model CompanyManagment.App.Contracts.Checkout.CreateCheckout
@{
<style>
<style>
.sendSelectDate {
border-color: #ff4e4e !important;
background-color: #ffe4e4 !important;
@@ -216,103 +209,96 @@
}
@{
<script src="~/lib/jquery-ajax-unobtrusive/jquery.unobtrusive-ajax.min.js"></script>
<script src="~/lib/jquery-ajax-unobtrusive/jquery.unobtrusive-ajax.min.js"></script>
}
<div class="modal-header">
<button type="button" class="close pull-right" data-dismiss="modal" aria-hidden="true"><span style="font-size: 24px">×</span></button>
<button type="button" class="close pull-right" data-dismiss="modal" aria-hidden="true">
<span style="font-size: 24px">×</span>
</button>
</div>
<div class="modal-body">
<div class="row">
<div class="col-md-12">
<fieldset style="border: 1px solid #999797; border-radius: 10px; padding: revert;">
<legend style="margin-bottom: 5px; font-size: large; border-bottom: 0px; color: #505458; width: 150px; text-align: center;"> ویرایش کد پرسنلی </legend>
<div class="row">
<div class="col-md-12">
<fieldset style="border: 1px solid #999797; border-radius: 10px; padding: revert;">
<legend style="margin-bottom: 5px; font-size: large; border-bottom: 0px; color: #505458; width: 150px; text-align: center;"> ویرایش کد پرسنلی </legend>
<div id="panel" style="width: 70%; height: 300px; overflow-y: scroll ">
<div id="panel" style="width: 70%; height: 300px; overflow-y: scroll ">
</div>
</div>
<div class="modal-footer m-b-10">
<div class="modal-footer m-b-10">
<a href="#" onclick="final()" class="btn btn-success btn-rounded waves-effect waves-light pull-left final">شروع عملیات</a>
<a href="#" onclick="final()" class="btn btn-success btn-rounded waves-effect waves-light pull-left final">شروع عملیات</a>
<button type="button" class="btn btn-default btn-rounded waves-effect waves-light pull-left m-b-5" data-dismiss="modal">بستن</button>
<button type="button" class="btn btn-default btn-rounded waves-effect waves-light pull-left m-b-5" data-dismiss="modal">بستن</button>
<input type="submit" id="sendFinaly" form="sub" value="fine" name="fine" style="display: none" />
<input type="submit" id="sendFinaly" form="sub" value="fine" name="fine" style="display: none"/>
</div>
</div>
</fieldset>
</div>
</fieldset>
</div>
</div>
</div>
</div>
<script>
function final() {
$.ajax({
//contentType: 'application/json; charset=utf-8',
dataType: 'json',
type: 'GET',
url: '@Url.Page("/Company/Employees/Index", "CopyPersonnelCode")',
headers: { "RequestVerificationToken": $('input[name="__RequestVerificationToken"]').val() },
success: function(response) {
function final() {
$.ajax({
//contentType: 'application/json; charset=utf-8',
dataType: 'json',
type: 'GET',
url: '@Url.Page("/Company/Employees/Index", "CopyPersonnelCode")',
headers: { "RequestVerificationToken": $('input[name="__RequestVerificationToken"]').val() },
},
failure: function(response) {
console.log(5, response);
success: function(response) {
}
});
}
},
failure: function(response) {
console.log(5, response);
}
});
}
</script>
<script>
setInterval(function () {
$.ajax({
type: "GET",
url: '@Url.Page("/Company/Employees/Index", "Proccess")',
headers: { "RequestVerificationToken": $('input[name="__RequestVerificationToken"]').val() },
success: function (response) {
var items2 = [];
$.each(response,
function(key, val) {
items2.push({ id: key, vall: val });
});
setInterval(function() {
$.ajax({
type: "GET",
url: '@Url.Page("/Company/Employees/Index", "Proccess")',
headers: { "RequestVerificationToken": $('input[name="__RequestVerificationToken"]').val() },
success: function(response) {
var items2 = [];
var html = `
$.each(response,
function(key, val) {
items2.push({ id: key, vall: val });
});
const html = `
<div class="row">
<di class="col-xs-4">${items2[0].vall}</di>
<di class="col-xs-4">${items2[1].vall}</di>
@@ -320,15 +306,14 @@
</div>
`;
if (items2[0].vall != null) {
$('#panel').append(html);
}
}
});
}, 300);
</script>
if (items2[0].vall != null) {
$('#panel').append(html);
}
}
});
},
300);
</script>

File diff suppressed because it is too large Load Diff

View File

@@ -1,7 +1,6 @@
@using _0_Framework.Application
@model CompanyManagment.App.Contracts.Employee.EditEmployee
@model CompanyManagment.App.Contracts.Employee.EditEmployee
@{
<style>
<style>
.modal-dialog {
width: 90% !important;
}
@@ -139,7 +138,7 @@
</style>
}
<div class="modal-header" style="border-bottom: unset">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
</div>
<form asp-page="./Index" asp-page-handler="Details"
@@ -148,254 +147,240 @@
data-callback=""
data-action="Refresh"
enctype="multipart/form-data">
<div class="modal-body">
<div class="row">
<div class="col-md-6">
<fieldset style="border: 1px solid #999797; border-radius: 10px; padding: revert;">
<legend style="margin-bottom: 5px; font-size: large; border-bottom: 0px; color: #505458; width: 130px; text-align: center;"> اطلاعات پرسنل</legend>
<div class="modal-body">
<div class="row">
<div class="col-md-6">
<fieldset style="border: 1px solid #999797; border-radius: 10px; padding: revert;">
<legend style="margin-bottom: 5px; font-size: large; border-bottom: 0px; color: #505458; width: 130px; text-align: center;"> اطلاعات پرسنل</legend>
<table id="thh" style="height: 150px; width: 100%">
<tr>
<th>فیلد</th>
<th>اطلاعات</th>
<table id="thh" style="height: 150px; width: 100%">
<tr>
<th>فیلد</th>
<th>اطلاعات</th>
</tr>
</tr>
<tr>
<td>نام و نام خانوادگی</td>
<td> @Model.FName @Model.LName</td>
<tr>
<td>نام و نام خانوادگی</td>
<td> @Model.FName @Model.LName</td>
</tr>
</tr>
<tr>
<td> جنسیت </td>
<td> @Model.Gender</td>
<tr>
<td> جنسیت </td>
<td> @Model.Gender</td>
</tr>
</tr>
<tr>
<td> ملیت </td>
<td> @Model.Nationality</td>
<tr>
<td> ملیت </td>
<td> @Model.Nationality</td>
</tr>
<tr>
<td> وضعیت تاهل </td>
<td> @Model.MaritalStatus </td>
</tr>
<tr>
<td> وضعیت تاهل </td>
<td> @Model.MaritalStatus </td>
</tr>
</tr>
<tr>
<td>نام پدر</td>
<td> @Model.FatherName</td>
<tr>
<td>نام پدر</td>
<td> @Model.FatherName</td>
</tr>
@if (@Model.Gender == "مرد")
{
<tr>
<td> وضعیت نظام وظیفه </td>
<td> @Model.MilitaryService </td>
</tr>
@if (Model.Gender == "مرد")
{
<tr>
<td> وضعیت نظام وظیفه </td>
<td> @Model.MilitaryService </td>
</tr>
}
</tr>
}
<tr>
<td>کد ملی</td>
<td> @Model.NationalCode</td>
<tr>
<td>کد ملی</td>
<td> @Model.NationalCode</td>
</tr>
</tr>
<tr>
<td> شماره شناسنامه </td>
<td> @Model.IdNumber </td>
<tr>
<td> شماره شناسنامه </td>
<td> @Model.IdNumber </td>
</tr>
</tr>
<tr>
<td> محل صدور شناسنامه </td>
<td> @Model.PlaceOfIssue</td>
<tr>
<td> محل صدور شناسنامه </td>
<td> @Model.PlaceOfIssue</td>
</tr>
<tr>
<td> تاریخ تولد </td>
<td> @Model.DateOfBirth</td>
</tr>
<tr>
<td> تاریخ تولد </td>
<td> @Model.DateOfBirth</td>
</tr>
</tr>
<tr>
<td> تاریخ صدور شناسنامه </td>
<td> @Model.DateOfIssue</td>
<tr>
<td> تاریخ صدور شناسنامه </td>
<td> @Model.DateOfIssue</td>
</tr>
</tr>
<tr>
<td> شماره تماس </td>
<td> @Model.Phone</td>
<tr>
<td> شماره تماس </td>
<td> @Model.Phone</td>
</tr>
</tr>
<tr>
<td> سطح تحصیلات </td>
<td> @Model.LevelOfEducation </td>
<tr>
<td> سطح تحصیلات </td>
<td> @Model.LevelOfEducation </td>
</tr>
</tr>
<tr>
<td> رشته تحصیلی </td>
<td> @Model.FieldOfStudy </td>
<tr>
<td> رشته تحصیلی </td>
<td> @Model.FieldOfStudy </td>
</tr>
</tr>
<tr>
<td> کد بیمه </td>
<td> @Model.InsuranceCode </td>
<tr>
<td> کد بیمه </td>
<td> @Model.InsuranceCode </td>
</tr>
<tr>
<td> سابقه کلی بیمه </td>
<td> سال : @Model.InsuranceHistoryByYear ماه : @Model.InsuranceHistoryByMonth </td>
</tr>
<tr>
<td> سابقه کلی بیمه </td>
<td> سال : @Model.InsuranceHistoryByYear ماه : @Model.InsuranceHistoryByMonth </td>
</tr>
</tr>
<tr>
<td> شماره کارت بانکی </td>
<td> @Model.BankCardNumber </td>
<tr>
<td> شماره کارت بانکی </td>
<td> @Model.BankCardNumber </td>
</tr>
<tr>
<td> شعبه بانک </td>
<td> @Model.BankBranch </td>
</tr>
<tr>
<td> شعبه بانک </td>
<td> @Model.BankBranch </td>
</tr>
<tr>
<td> استان </td>
<td> @Model.State </td>
</tr>
<tr>
<td> استان </td>
<td> @Model.State </td>
</tr>
</tr>
<tr>
<td> شهر </td>
<td> @Model.City </td>
<tr>
<td> شهر </td>
<td> @Model.City </td>
</tr>
</tr>
<tr>
<td> آدرس </td>
<td> @Model.Address </td>
<tr>
<td> آدرس </td>
<td> @Model.Address </td>
</tr>
</table>
</tr>
</table>
</fieldset>
</div>
<div class="col-md-6">
<fieldset style="border: 1px solid #999797; border-radius: 10px; padding: revert;">
<legend style="margin-bottom: 5px; font-size: large; border-bottom: 0px; color: #505458; width: 145px; text-align: center;"> اطلاعات فرزندان</legend>
<table id="thh1" style="height: 150px; width: 100%">
<tr>
<th>فیلد</th>
<th>اطلاعات</th>
</tr>
</fieldset>
</div>
<div class="col-md-6">
<fieldset style="border: 1px solid #999797; border-radius: 10px; padding: revert;">
<legend style="margin-bottom: 5px; font-size: large; border-bottom: 0px; color: #505458; width: 145px; text-align: center;"> اطلاعات فرزندان</legend>
<tr>
<td>تعداد فرزندان</td>
<td>
@if (Model.NumberOfChildren != null)
{
@Model.NumberOfChildren
}
else
{
<span>0</span>
}
</td>
<table id="thh1" style="height: 150px; width: 100%">
<tr>
<th>فیلد</th>
<th>اطلاعات</th>
</tr>
</tr>
<tr>
<td> تاریخ تولد فرزندان </td>
<td>
<ul style="list-style-type: none;">
@foreach (var item in Model.CreateEmployeChildrenList)
{
if (Model.NationalCode == item.ParentNationalCode)
{
<li style="font-family: 'IranText' !important; font-size: 14px !important">@item.DateOfBirth</li>
<hr style="margin: 0; border-color: #bdbdbd"/>
}
}
</ul>
</td>
<tr>
<td>تعداد فرزندان</td>
<td>@if (@Model.NumberOfChildren != null)
{
@Model.NumberOfChildren
}
else
{
<span>0</span>
}
</td>
</tr>
</tr>
<tr>
<td> تاریخ تولد فرزندان </td>
<td>
<ul style="list-style-type: none;">
@foreach (var item in @Model.CreateEmployeChildrenList)
{
if (@Model.NationalCode == @item.ParentNationalCode)
{
<li style="font-family: 'IranText' !important; font-size: 14px !important">@item.DateOfBirth</li>
<hr style="margin: 0; border-color: #bdbdbd" />
}
</table>
}
</ul>
</td>
</tr>
</fieldset>
<fieldset style="border: 1px solid #999797; border-radius: 10px; padding: revert;">
<legend style="margin-bottom: 5px; font-size: large; border-bottom: 0px; color: #505458; width: 250px; text-align: center;"> اطلاعات کارگاه و شماره پرسنلی</legend>
<table id="thh2" style="height: 150px; width: 100%">
<tr>
<th>فیلد</th>
<th>اطلاعات</th>
</table>
</tr>
<tr>
<td> نام کارگاه </td>
<td> </td>
</tr>
<tr>
<td> شماره کارگاه </td>
<td> </td>
</fieldset>
<fieldset style="border: 1px solid #999797; border-radius: 10px; padding: revert;">
<legend style="margin-bottom: 5px; font-size: large; border-bottom: 0px; color: #505458; width: 250px; text-align: center;"> اطلاعات کارگاه و شماره پرسنلی</legend>
</tr>
<tr>
<td> شماره پرسنلی </td>
<td> </td>
<table id="thh2" style="height: 150px; width: 100%">
<tr>
<th>فیلد</th>
<th>اطلاعات</th>
</tr>
</tr>
</table>
<tr>
<td> نام کارگاه </td>
<td> </td>
</tr>
</fieldset>
</div>
</div>
<tr>
<td> شماره کارگاه </td>
<td> </td>
</tr>
<tr>
<td> شماره پرسنلی </td>
<td> </td>
</div>
<input type="hidden" asp-for="Id" value="@Model.Id"/>
<div class="modal-footer">
<div class="modal-footer" style="border-top: unset; padding-top: unset">
</tr>
</table>
<button type="button" class="btn btn-warning btn-rounded waves-effect waves-light m-b-10" data-dismiss="modal">بستن فرم</button>
</div>
</div>
</fieldset>
</div>
</div>
</div>
<input type="hidden" asp-for="Id" value="@Model.Id" />
<div class="modal-footer">
<div class="modal-footer" style="border-top: unset; padding-top: unset">
<button type="button" class="btn btn-warning btn-rounded waves-effect waves-light m-b-10" data-dismiss="modal">بستن فرم</button>
</div>
</div>
</form>
</form>

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -1,9 +1,6 @@
@using _0_Framework.Application
@model CompanyManagment.App.Contracts.EmployeeInsuranceRecord.EditEmployeeInsuranceRecord
@model CompanyManagment.App.Contracts.EmployeeInsuranceRecord.EditEmployeeInsuranceRecord
@{
<style>
<style>
#thh table {
width: 150px;
@@ -196,284 +193,283 @@
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<form asp-page="./Index" asp-page-handler="InsuranceRecords" id="InsuranceRecords" autocomplete="off"
method="post"
data-ajax="true"
data-callback=""
data-action="Refresh">
<div class="modal-body">
<div class="row">
<fieldset style=" border: 1px solid #999797; border-radius: 10px; padding: revert;">
<legend style="margin-bottom: 5px;font-size: large;border-bottom: 0px;color: #505458;width: 210px;text-align: center;"> مشخصات بیمه ای پرسنل</legend>
<fieldset style="border: 1px solid #999797;border-radius: 10px;padding: revert;">
<div class="row">
<div class="form-group">
<label class="control-label">افزودن کارگاه</label>
</div>
<form asp-page="./Index" asp-page-handler="InsuranceRecords" id="InsuranceRecords" autocomplete="off"
method="post"
data-ajax="true"
data-callback=""
data-action="Refresh">
<div class="modal-body">
<div class="row">
<fieldset style=" border: 1px solid #999797; border-radius: 10px; padding: revert;">
<legend style="margin-bottom: 5px;font-size: large;border-bottom: 0px;color: #505458;width: 210px;text-align: center;"> مشخصات بیمه ای پرسنل</legend>
<fieldset style="border: 1px solid #999797;border-radius: 10px;padding: revert;">
<div class="row">
<div class="form-group">
<label class="control-label">افزودن کارگاه</label>
</div>
<div class="row">
<div class=" col-md-9 col-sm-9 col-lg-9">
<div class="form-group">
<select id="WorkshopSelectList" name="WorkshopSelectList" asp-items="@Model.WorkshopSelectList" class="sel2">
<option value="0" disabled selected>لطفا انتخاب کنید</option>
</select>
</div>
</div>
<div class="col-md-3 col-sm-3 col-lg-3">
<div class="form-group">
<button type="button" onclick="AddTab()" class="btn btn-success btn-rounded waves-effect waves-light">ثبت</button>
</div>
</div>
</div>
</div>
</fieldset>
<div class="row">
<div class=" col-md-9 col-sm-9 col-lg-9">
<div class="form-group">
<select id="WorkshopSelectList" name="WorkshopSelectList" asp-items="@Model.WorkshopSelectList" class="sel2">
<option value="0" disabled selected>لطفا انتخاب کنید</option>
</select>
</div>
</div>
<div class="col-md-3 col-sm-3 col-lg-3">
<div class="form-group">
<button type="button" onclick="AddTab()" class="btn btn-success btn-rounded waves-effect waves-light">ثبت</button>
</div>
</div>
</div>
</div>
</fieldset>
<input type="hidden" asp-for="EmployeeId" value="@Model.EmployeeId" />
<input type="hidden" asp-for="EmployeeId" value="@Model.EmployeeId"/>
<div class="row">
</div>
<fieldset style="border: 1px solid #999797;border-radius: 10px;padding: revert;">
<div class="row">
</div>
<fieldset style="border: 1px solid #999797;border-radius: 10px;padding: revert;">
<div class="tabs-left">
<ul class="nav nav-tabs " id="headerTab" style="padding-right:3px !important">
@{
var ws = Model.employeeInsuranceRecordViewModels.Select(x => x.Workshop.Id).Distinct();
var active = "active";
}
@foreach (var wsId in ws)
{
<div class="tabs-left">
<ul class="nav nav-tabs " id="headerTab" style="padding-right:3px !important">
@{
var ws = Model.employeeInsuranceRecordViewModels.Select(x => x.Workshop.Id).Distinct();
var active = "active";
}
@foreach (var wsId in ws)
{
<li class="@active ctab " id="ctab_@wsId">
<a href="#@wsId" onclick="totaldays_ws(@wsId)" data-toggle="tab" class="ctaba" id="a_@wsId" style="border-left: 1px solid #d3d1d1;">
@Model.employeeInsuranceRecordViewModels.Select(x => x.Workshop).Where(x => x.Id == wsId).FirstOrDefault().WorkshopFullName
<li class="@active ctab " id="ctab_@wsId">
<a href="#@wsId" onclick="totaldays_ws(@wsId)" data-toggle="tab" class="ctaba" id="a_@wsId" style="border-left: 1px solid #d3d1d1;">
@Model.employeeInsuranceRecordViewModels.Select(x => x.Workshop).Where(x => x.Id == wsId).FirstOrDefault().WorkshopFullName
@*@Model.employeeInsuranceRecordViewModels.Select(x => x.Workshop).Where(x => x.Id == wsId).FirstOrDefault().IsActiveString*@
@*@Model.employeeInsuranceRecordViewModels.Select(x => x.Workshop).Where(x => x.Id == wsId).FirstOrDefault().IsActiveString*@
<i class="btn-success btn-sm btn-rounded fa fa-plus" style="font-size:10px !important" onclick="plusRow(@wsId)"></i>
<i class="btn-success btn-sm btn-rounded fa fa-plus" style="font-size:10px !important" onclick="plusRow(@wsId)"></i>
</a>
</li>
active = "";
}
</a>
</li>
active = "";
}
</ul>
</div>
</ul>
</div>
<div class="tab-content">
@{
active = "active";
<div class="tab-content">
@{
active = "active";
var counter = 0;
var index = 0;
decimal totalDays_ws = 0;
int counter = 0;
int index = 0;
decimal totalDays_ws = 0;
foreach (var wsId in ws)
{
<div class="tab-pane @active" id="@wsId">
foreach (var wsId in ws)
{
<div class="tab-pane @active" id="@wsId">
<table id="thh" style="height: 100px; margin-right: 1px;">
<thead>
<tr>
<th style="font-size:smaller"> تاریخ شروع بیمه </th>
<th style="font-size:smaller">تاریخ پایان بیمه</th>
<th> </th>
<th></th>
</tr>
</thead>
<tfoot id="item-list" class="tfoot_@wsId">
@{
var query = Model.employeeInsuranceRecordViewModels.Where(x => x.WorkShopId == wsId).OrderBy(x => x.DateOfStart).ToList();
var i = 0;
}
@for (index = counter; index < Model.employeeInsuranceRecordViewModels.Where(x => x.WorkShopId == wsId).Count() + counter; index++)
{
var idst = "employeeInsuranceRecordViewModels_" + index + "__DateOfStart";
var iden = "employeeInsuranceRecordViewModels_" + index + "__DateOfEnd";
var ds = "employeeInsuranceRecordViewModels[" + index + "].DateOfStart";
var de = "employeeInsuranceRecordViewModels[" + index + "].DateOfEnd";
var id_id = "employeeInsuranceRecordViewModels_" + index + "__Id";
var id_name = "employeeInsuranceRecordViewModels[" + index + "].Id";
var id_workshop = "employeeInsuranceRecordViewModels_" + index + "__WorkShopId";
var name_workshop = "employeeInsuranceRecordViewModels[" + index + "].WorkShopId";
var TotalDays = "employeeInsuranceRecordViewModels[" + index + "].TotalDays";
if (active == "active")
{
totalDays_ws += query[i].TotalDays;
}
<tr id="tr_@index">
<td class="col-md-3 eirsession">
<input type="hidden" name="@id_name" id="@id_id" value="@query[i].Id"/>
<input type="hidden" name="@name_workshop" id="@id_workshop" value="@query[i].WorkShopId"/>
<input class="form-control date" style="width: 90px !important"
id="@idst"
name="@ds"
value="@query[i].DateOfStart"
onchange="validDate(this);calculatedays(@index);"
onfocusout="CompareDates($(this), false, false)"
dir="ltr"
maxlength="10"
data-val="true" data-val-required="فیلد الزامی است"/>
<span class="error field-validation-valid"
data-valmsg-for="@ds"
data-valmsg-replace="true">
</span>
</td>
<td class="col-md-3 eirsession">
<input class="form-control date" style="width:90px !important"
id="@iden"
name="@de"
value="@query[i].DateOfEnd"
onchange="validDate(this);calculatedays(@index);"
onfocusout="CompareDates($(this), false, false)"
dir="ltr"/>
<span class="error field-validation-valid"
data-valmsg-for="@de"
data-valmsg-replace="true">
</span>
</td>
<td style="margin:0px !important;padding:0px !important">
<a class="btn btn-danger rad removeRow" onclick="RemoveRow(@index);">
<i class="fa fa-trash"></i>
</a>
</td>
<td style="margin:0px !important;padding:0px !important">
<label id="lbl_@index">@query[i].TotalDays</label>
</td>
</tr>
i++;
}
<table id="thh" style="height: 100px; margin-right: 1px;">
<thead>
<tr>
<th style="font-size:smaller"> تاریخ شروع بیمه </th>
<th style="font-size:smaller">تاریخ پایان بیمه</th>
<th> </th>
<th></th>
</tr>
</thead>
<tfoot id="item-list" class="tfoot_@wsId">
@{
var query = Model.employeeInsuranceRecordViewModels.Where(x => x.WorkShopId == wsId).OrderBy(x => x.DateOfStart).ToList();
int i = 0;
}
@for (index = counter; index < Model.employeeInsuranceRecordViewModels.Where(x => x.WorkShopId == wsId).Count() + counter; index++)
{
@{
counter = index;
}
</tfoot>
</table>
</div>
active = "";
}
}
var idst = "employeeInsuranceRecordViewModels_" + index + "__DateOfStart";
var iden = "employeeInsuranceRecordViewModels_" + index + "__DateOfEnd";
var ds = "employeeInsuranceRecordViewModels[" + index + "].DateOfStart";
var de = "employeeInsuranceRecordViewModels[" + index + "].DateOfEnd";
var id_id = "employeeInsuranceRecordViewModels_" + index + "__Id";
var id_name = "employeeInsuranceRecordViewModels[" + index + "].Id";
var id_workshop = "employeeInsuranceRecordViewModels_" + index + "__WorkShopId";
var name_workshop = "employeeInsuranceRecordViewModels[" + index + "].WorkShopId";
var TotalDays = "employeeInsuranceRecordViewModels[" + index + "].TotalDays";
if(active == "active")
{
totalDays_ws += query[i].TotalDays;
}
<tr id="tr_@index">
<td class="col-md-3 eirsession">
<input type="hidden" name="@id_name" id="@id_id" value="@query[i].Id" />
<input type="hidden" name="@name_workshop" id="@id_workshop" value="@query[i].WorkShopId" />
<input class="form-control date" style="width: 90px !important"
id="@idst"
name="@ds"
value="@query[i].DateOfStart"
onchange="validDate(this); calculatedays(@index);"
onfocusout="CompareDates($(this), false, false)"
dir="ltr"
maxlength="10"
data-val="true" data-val-required="فیلد الزامی است" />
<span class="error field-validation-valid"
data-valmsg-for="@ds"
data-valmsg-replace="true"></span>
</td>
<td class="col-md-3 eirsession">
<input class="form-control date" style="width:90px !important"
id="@iden"
name="@de"
value="@query[i].DateOfEnd"
onchange="validDate(this); calculatedays(@index)"
onfocusout="CompareDates($(this), false, false)"
dir="ltr"
/>
<span class="error field-validation-valid"
data-valmsg-for="@de"
data-valmsg-replace="true"></span>
</td>
<td style="margin:0px !important;padding:0px !important">
<a class="btn btn-danger rad removeRow" onclick="RemoveRow(@index);">
<i class="fa fa-trash"></i>
</a>
</td>
<td style="margin:0px !important;padding:0px !important">
<label id="lbl_@index">@query[i].TotalDays</label>
</td>
</tr>
i++;
}
</div>
<input type="hidden" id="counter" value="@counter"/>
</fieldset>
@{
counter = index;
}
</tfoot>
</table>
</div>
active = "";
}
}
<fieldset style="border: 1px solid #999797;border-radius: 10px;padding: revert;">
</div>
<input type="hidden" id="counter" value="@counter" />
</fieldset>
@{
decimal totalDays = 0;
foreach (var item in Model.employeeInsuranceRecordViewModels)
{
totalDays += item.TotalDays;
}
totalDays = 0;
var totalYears = 0; // Math.Truncate(totalDays / 365);
var totalMonths = 0; // Math.Truncate((totalDays % 365) / 30);
var remainingDays = 0; // Math.Truncate((totalDays % 365) % 30);
<fieldset style="border: 1px solid #999797;border-radius: 10px;padding: revert;">
var totalYears_ws = Math.Truncate(totalDays_ws / 365);
var totalMonths_ws = Math.Truncate(totalDays_ws % 365 / 30);
var remainingDays_ws = Math.Truncate(totalDays_ws % 365 % 30);
}
<div class="row">
<div class="col-md-3">
<label class="control-label">سابقه کار در کارگاه</label>
</div>
<div class="col-md-2">
<input style="background-color: #e0ffe0;" type="text" class="form-control" value="@totalYears سال">
</div>
<div class="col-md-2">
<input style="background-color: #e0ffe0;" type="text" class="form-control" value="@totalMonths ماه">
</div>
<div class="col-md-2">
<input style="background-color: #e0ffe0;" type="text" class="form-control" value="@remainingDays روز">
</div>
<div class="col-md-2">
<input style="background-color: #fff;" type="text" class="form-control" value="@totalDays">
</div>
</div>
<div class="row">
<div class="col-md-3">
<label class="control-label">سابقه بیمه در کارگاه</label>
</div>
<div class="col-md-2">
<input style="background-color: #e0ffe0;" type="text" class="form-control" id="totalYears_ws" value="@totalYears_ws سال">
</div>
<div class="col-md-2">
<input style="background-color: #e0ffe0;" type="text" class="form-control" id="totalMonths_ws" value="@totalMonths_ws ماه">
</div>
<div class="col-md-2">
<input style="background-color: #e0ffe0;" type="text" class="form-control" id="remainingDays_ws" value="@remainingDays_ws روز">
</div>
<div class="col-md-2">
<input style="background-color: #fff;" type="text" class="form-control" id="totalDays_ws"value="@totalDays_ws">
</div>
</div>
@{
decimal totalDays = 0;
foreach (var item in Model.employeeInsuranceRecordViewModels)
{
totalDays += item.TotalDays;
}
totalDays = 0;
var totalYears = 0;// Math.Truncate(totalDays / 365);
var totalMonths = 0;// Math.Truncate((totalDays % 365) / 30);
var remainingDays = 0;// Math.Truncate((totalDays % 365) % 30);
</fieldset>
</fieldset>
</div>
</div>
@*<input type="hidden" asp-for="id" value="id"/>*@
var totalYears_ws = Math.Truncate(totalDays_ws / 365);
var totalMonths_ws = Math.Truncate((totalDays_ws % 365) / 30);
var remainingDays_ws = Math.Truncate((totalDays_ws % 365) % 30);
}
<div class="row">
<div class="col-md-3">
<label class="control-label">سابقه کار در کارگاه</label>
</div>
<div class="col-md-2">
<input style="background-color: #e0ffe0;" type="text" class="form-control" value="@totalYears سال">
</div>
<div class="col-md-2">
<input style="background-color: #e0ffe0;" type="text" class="form-control" value="@totalMonths ماه">
</div>
<div class="col-md-2">
<input style="background-color: #e0ffe0;" type="text" class="form-control" value="@remainingDays روز">
</div>
<div class="col-md-2">
<input style="background-color: #fff;" type="text" class="form-control" value="@totalDays">
</div>
</div>
<div class="row">
<div class="col-md-3">
<label class="control-label">سابقه بیمه در کارگاه</label>
</div>
<div class="col-md-2">
<input style="background-color: #e0ffe0;" type="text" class="form-control" id="totalYears_ws" value="@totalYears_ws سال">
</div>
<div class="col-md-2">
<input style="background-color: #e0ffe0;" type="text" class="form-control" id="totalMonths_ws" value="@totalMonths_ws ماه">
</div>
<div class="col-md-2">
<input style="background-color: #e0ffe0;" type="text" class="form-control" id="remainingDays_ws" value="@remainingDays_ws روز">
</div>
<div class="col-md-2">
<input style="background-color: #fff;" type="text" class="form-control" id="totalDays_ws"value="@totalDays_ws">
</div>
</div>
<div class="modal-footer">
</fieldset>
</fieldset>
</div>
</div>
@*<input type="hidden" asp-for="id" value="id"/>*@
<button type="submit" id="createButtom" class="btn btn-success btn-rounded waves-effect waves-light">ذخیره</button>
<div class="modal-footer">
<button type="button" class="btn btn-default btn-rounded waves-effect waves-light m-b-5" data-dismiss="modal">بستن</button>
</div>
<button type="submit" id="createButtom" class="btn btn-success btn-rounded waves-effect waves-light">ذخیره</button>
<button type="button" class="btn btn-default btn-rounded waves-effect waves-light m-b-5" data-dismiss="modal">بستن</button>
</div>
</form>
</form>
</div>
<script>
function AddTab(counter) {
var a = $(".tab").length;
var selectedItem = $("#WorkshopSelectList").val();
function AddTab(counter) {
const a = $(".tab").length;
const selectedItem = $("#WorkshopSelectList").val();
var data = $("#WorkshopSelectList").select2('data');
var selectedItemText = data[0].text;
const data = $("#WorkshopSelectList").select2('data');
const selectedItemText = data[0].text;
if (data[0].id == 0) {
return false;
}
if (data[0].id == 0) {
return false;
}
var ul = document.getElementById("headerTab");
var li = document.createElement("li");
const ul = document.getElementById("headerTab");
const li = document.createElement("li");
var nodes = document.querySelectorAll('.ctaba[id]');
var ids = {};
var totalNodes = nodes.length;
var flg = false;
for (var i = 0; i < totalNodes; i++) {
var currentId = nodes[i].id ? nodes[i].id : "undefined";
if (isNaN(ids[currentId])) {
ids[currentId] = 0;
}
if (currentId == ("a_" + selectedItem)) {
flg = true;
break;
}
ids[currentId]++;
}
const nodes = document.querySelectorAll('.ctaba[id]');
const ids = {};
const totalNodes = nodes.length;
var flg = false;
for (let i = 0; i < totalNodes; i++) {
const currentId = nodes[i].id ? nodes[i].id : "undefined";
if (isNaN(ids[currentId])) {
ids[currentId] = 0;
}
if (currentId == (`a_${selectedItem}`)) {
flg = true;
break;
}
ids[currentId]++;
}
if (flg == false) {
if (flg == false) {
const htmls = `
const htmls = `
<li class="ctab " id="ctab_${selectedItem}" >
<a href="#${selectedItem}" onclick="totaldays_ws(${selectedItem})" data-toggle="tab" class="ctaba" id="a_${selectedItem}">
${selectedItemText}
<i class="btn-success btn-sm btn-rounded fa fa-plus" style="font-size:10px !important" onclick="plusRow(${selectedItem})"></i>
</a>
</li> `
ul.innerHTML += htmls;
//-------------------------------------------------------------------------------------------
var index = $("#item-list" + " Tr").length;
</li> `;
ul.innerHTML += htmls;
//-------------------------------------------------------------------------------------------
var index = $("#item-list" + " Tr").length;
const htm = `
const htm = `
<div class="tab-pane " id="${selectedItem}">
<table id="thh" style="height: 100px; margin-right: 1px;">
@@ -529,36 +525,37 @@
</div>
`;
$("#counter").val(parseInt($("#counter").val()) + 1);
$(".tab-content").append(htm);
//$(".tab-content").tabs( "active","a_"selectedItem);
$('#a_' + selectedItem).tab('show')
var $tabPane = $('.tab-pane'),
tabsHeight = $('.nav-tabs').height();
$tabPane.css({
height: 250 //tabsHeight
});
}
else {
var index = $("#item-list" + " Tr").length;
console.log(index);
$("#counter").val(parseInt($("#counter").val()) + 1);
$('.tfoot_' + selectedItem).append(html_part2(index, selectedItem));
$('#a_' + selectedItem).tab('show')
}
totaldays_ws(selectedItem);
}
function plusRow(selectedItem) {
var index = $("#item-list" + " Tr").length;
$("#counter").val(parseInt($("#counter").val()) + 1);
$("#counter").val(parseInt($("#counter").val()) + 1);
$(".tab-content").append(htm);
//$(".tab-content").tabs( "active","a_"selectedItem);
$(`#a_${selectedItem}`).tab('show');
const $tabPane = $('.tab-pane');
const tabsHeight = $('.nav-tabs').height();
$tabPane.css({
height: 250 //tabsHeight
});
} else {
var index = $("#item-list" + " Tr").length;
console.log(index);
$("#counter").val(parseInt($("#counter").val()) + 1);
$('.tfoot_' + selectedItem).append(html_part2(index, selectedItem));
$('#a_' + selectedItem).tab('show')
$(`.tfoot_${selectedItem}`).append(html_part2(index, selectedItem));
$(`#a_${selectedItem}`).tab('show');
}
totaldays_ws(selectedItem);
}
}
function html_part2(id, selectedItem2) {
var htmls = `
function plusRow(selectedItem) {
const index = $("#item-list" + " Tr").length;
$("#counter").val(parseInt($("#counter").val()) + 1);
$(`.tfoot_${selectedItem}`).append(html_part2(index, selectedItem));
$(`#a_${selectedItem}`).tab('show');
}
function html_part2(id, selectedItem2) {
const htmls = `
<tr id="tr_${id}">
<td class="col-md-3 eirsession">
<input type="hidden" name="employeeInsuranceRecordViewModels[${id}].Id"
@@ -597,85 +594,85 @@
</td>
</tr>
`;
return htmls;
};
function RemoveRow(className) {
var WorkShopId = "employeeInsuranceRecordViewModels_" + className + "__WorkShopId";
var wsId = $("#" + WorkShopId).val();
classNameNew = "tr_" + className;
var list = document.getElementById(classNameNew);
list.remove();
return htmls;
};
var WSInput = $("#" + wsId + " input[name$='.DateOfStart']");
if (WSInput.length == 0) {
var li_tab = document.getElementById("ctab_" + wsId);
li_tab.remove();
var tr_tab = document.getElementById(wsId);
tr_tab.remove();
}
function RemoveRow(className) {
const WorkShopId = `employeeInsuranceRecordViewModels_${className}__WorkShopId`;
const wsId = $(`#${WorkShopId}`).val();
classNameNew = `tr_${className}`;
const list = document.getElementById(classNameNew);
list.remove();
if (className != 0) {
var selectedNew = "employeeInsuranceRecordViewModels_" + (className - 1) + "__WorkShopId";
var wsIds = $("#" + selectedNew).val();
$('#a_' + wsIds).tab('show');
}
try {
if (className == 0) {
var selectedNew = "employeeInsuranceRecordViewModels_" + (className + 1) + "__WorkShopId";
var wsIds = $("#" + selectedNew).val();
$('#a_' + wsIds).tab('show');
}
} catch (e) {
const WSInput = $(`#${wsId} input[name$='.DateOfStart']`);
if (WSInput.length == 0) {
const li_tab = document.getElementById(`ctab_${wsId}`);
li_tab.remove();
const tr_tab = document.getElementById(wsId);
tr_tab.remove();
}
}
if (className != 0) {
var selectedNew = `employeeInsuranceRecordViewModels_${className - 1}__WorkShopId`;
var wsIds = $(`#${selectedNew}`).val();
$(`#a_${wsIds}`).tab('show');
}
try {
if (className == 0) {
var selectedNew = `employeeInsuranceRecordViewModels_${className + 1}__WorkShopId`;
var wsIds = $(`#${selectedNew}`).val();
$(`#a_${wsIds}`).tab('show');
}
} catch (e) {
className = "eirsession";
var id = "tab-content";// "crossJobsList";
sortInputs(id, className, 4);
}
}
function sortInputs(id, className, unit) {
var PSInput = $("." + id + " ." + className + " input");
for (var i = 0; i < PSInput.length; i++) {
try {
var split_0 = $(PSInput[i]).attr('name').split('[')
var split_1 = split_0[0]
var split_2 = split_0[1]
var split_2 = split_2.split(']')
var split_2 = split_2[1]
className = "eirsession";
const id = "tab-content"; // "crossJobsList";
sortInputs(id, className, 4);
}
var split_00 = $(PSInput[i]).attr('id').split('_')
var split_11 = split_00[0]
var split_22 = split_00[3]
function sortInputs(id, className, unit) {
$(PSInput[i]).attr('name', split_1 + "[" + Math.floor(i / unit) + "]" + split_2)
$(PSInput[i]).next('span').attr('name', split_1 + "[" + Math.floor(i / unit) + "]" + split_2)
$(PSInput[i]).next('span').attr('data-valmsg-for', split_1 + "[" + Math.floor(i / unit) + "]" + split_2)
var PSInput = $(`.${id} .${className} input`);
for (var i = 0; i < PSInput.length; i++) {
try {
var split_0 = $(PSInput[i]).attr('name').split('[');
$(PSInput[i]).attr('id', split_11 + "_" + Math.floor(i / unit) + "__" + split_22)
$(PSInput[i]).prev('label').attr('for', split_11 + "_" + Math.floor(i / unit) + "__" + split_22)
var split_1 = split_0[0];
var split_2 = split_0[1];
var split_2 = split_2.split(']');
var split_2 = split_2[1];
} catch (e) {
console.log(e);
}
}
var PSTbody = $("#item-list" + " Tr");
for (var i = 0; i < PSTbody.length; i++) {
$(PSTbody[i]).attr("id", "tr_" + i);
}
var PSRemove = $(".removeRow");
for (var i = 0; i < PSRemove.length; i++) {
$(PSRemove[i]).attr("onclick", "RemoveRow(" + i + ")");
}
var split_00 = $(PSInput[i]).attr('id').split('_');
var split_11 = split_00[0];
var split_22 = split_00[3];
}
$(PSInput[i]).attr('name', split_1 + "[" + Math.floor(i / unit) + "]" + split_2);
$(PSInput[i]).next('span').attr('name', split_1 + "[" + Math.floor(i / unit) + "]" + split_2);
$(PSInput[i]).next('span').attr('data-valmsg-for', split_1 + "[" + Math.floor(i / unit) + "]" + split_2);
$(PSInput[i]).attr('id', split_11 + "_" + Math.floor(i / unit) + "__" + split_22);
$(PSInput[i]).prev('label').attr('for', split_11 + "_" + Math.floor(i / unit) + "__" + split_22);
} catch (e) {
console.log(e);
}
}
var PSTbody = $("#item-list" + " Tr");
for (var i = 0; i < PSTbody.length; i++) {
$(PSTbody[i]).attr("id", `tr_${i}`);
}
var PSRemove = $(".removeRow");
for (var i = 0; i < PSRemove.length; i++) {
$(PSRemove[i]).attr("onclick", `RemoveRow(${i})`);
}
}
</script>
@@ -684,136 +681,136 @@
<script type="text/javascript">
function calculatedays(id) {
var idst = "employeeInsuranceRecordViewModels_" + id + "__DateOfStart";
var iden = "employeeInsuranceRecordViewModels_" + id + "__DateOfEnd";
$.ajax({
dataType: 'json',
type: 'POST',
url: '@Url.Page("./Index", "Caldate")',
headers: { "RequestVerificationToken": $('@Html.AntiForgeryToken()').val() },
data: { "dateOfstart": $("#" + idst).val(), "dateOfend": $("#" + iden).val() },
function calculatedays(id) {
const idst = `employeeInsuranceRecordViewModels_${id}__DateOfStart`;
const iden = `employeeInsuranceRecordViewModels_${id}__DateOfEnd`;
$.ajax({
dataType: 'json',
type: 'POST',
url: '@Url.Page("./Index", "Caldate")',
headers: { "RequestVerificationToken": $('@Html.AntiForgeryToken()').val() },
data: { "dateOfstart": $(`#${idst}`).val(), "dateOfend": $(`#${iden}`).val() },
success: function (response) {
$("#lbl_" + id).empty();
$("#lbl_" + id).append(response);
},
failure: function (response) {
console.log(5, response)
$.Notification.autoHideNotify('error', 'top center', 'پیام سیستم ', response.message);
}
});
var wsId = $("#" + "employeeInsuranceRecordViewModels_" + id + "__WorkShopId").val();
totaldays_ws(wsId);
}
success: function(response) {
$(`#lbl_${id}`).empty();
$(`#lbl_${id}`).append(response);
},
failure: function(response) {
console.log(5, response);
$.Notification.autoHideNotify('error', 'top center', 'پیام سیستم ', response.message);
}
});
const wsId = $(`#employeeInsuranceRecordViewModels_${id}__WorkShopId`).val();
totaldays_ws(wsId);
}
function totaldays_ws(wsId) {
const arr = [];
const arr_dateofstart = [];
const arr_dateofend = [];
$("#totalYears_ws").val("-");
$("#totalMonths_ws").val("-");
$("#remainingDays_ws").val("-");
$("#totalDays_ws").val("-");
function totaldays_ws(wsId) {
const arr_dateofstart = [];
const arr_dateofend = [];
$("#totalYears_ws").val("-");
$("#totalMonths_ws").val("-");
$("#remainingDays_ws").val("-");
$("#totalDays_ws").val("-");
var WSInput = $("#" + wsId + " input[name$='.DateOfStart']");
for (var i = 0; i < WSInput.length; i++) {
try {
var split_0 = $(WSInput[i]).attr('name').split('[')
var split_1 = split_0[0]
var split_2 = split_0[1]
var split_2 = split_2.split(']')
var split_2 = split_2[1]
var split_00 = $(WSInput[i]).attr('id').split('_')
arr[i] = split_00[1];
var idst= "employeeInsuranceRecordViewModels_" + split_00[1] + "__DateOfStart";
arr_dateofstart[i] = $("#" + idst).val();
var iden = "employeeInsuranceRecordViewModels_" + split_00[1] + "__DateOfEnd";
arr_dateofend[i] = $("#" + iden).val();
const WSInput = $(`#${wsId} input[name$='.DateOfStart']`);
for (let i = 0; i < WSInput.length; i++) {
try {
const split_0 = $(WSInput[i]).attr('name').split('[');
const split_1 = split_0[0];
var split_2 = split_0[1];
var split_2 = split_2.split(']');
var split_2 = split_2[1];
const split_00 = $(WSInput[i]).attr('id').split('_');
const arr = [];
arr[i] = split_00[1];
const idst = `employeeInsuranceRecordViewModels_${split_00[1]}__DateOfStart`;
arr_dateofstart[i] = $(`#${idst}`).val();
const iden = `employeeInsuranceRecordViewModels_${split_00[1]}__DateOfEnd`;
arr_dateofend[i] = $(`#${iden}`).val();
} catch (e) {
console.log(e);
}
}
$.ajax({
dataType: 'json',
type: 'POST',
url: '@Url.Page("./Index", "Caldatearr")',
headers: { "RequestVerificationToken": $('@Html.AntiForgeryToken()').val() },
data: { "dateOfstart": arr_dateofstart, "dateOfend": arr_dateofend },
} catch (e) {
console.log(e);
}
}
$.ajax({
dataType: 'json',
type: 'POST',
url: '@Url.Page("./Index", "Caldatearr")',
headers: { "RequestVerificationToken": $('@Html.AntiForgeryToken()').val() },
data: { "dateOfstart": arr_dateofstart, "dateOfend": arr_dateofend },
success: function (response) {
$("#totalYears_ws").val(response.totalYears_ws);
$("#totalMonths_ws").val(response.totalMonths_ws);
$("#remainingDays_ws").val(response.remainingDays_ws);
$("#totalDays_ws").val(response.totalDays_ws);
success: function(response) {
$("#totalYears_ws").val(response.totalYears_ws);
$("#totalMonths_ws").val(response.totalMonths_ws);
$("#remainingDays_ws").val(response.remainingDays_ws);
$("#totalDays_ws").val(response.totalDays_ws);
},
failure: function (response) {
console.log(5, response)
$.Notification.autoHideNotify('error', 'top center', 'پیام سیستم ', response.message);
}
});
}
},
failure: function(response) {
console.log(5, response);
$.Notification.autoHideNotify('error', 'top center', 'پیام سیستم ', response.message);
}
});
}
function betweenDate() {
console.log("this");
}
$(function () {
$("#WorkshopSelectList").select2({
placeholder: "کارگاه",
dir: "rtl",
});
});
var tabsFn = (function () {
function betweenDate() {
console.log("this");
}
function init() {
setHeight();
}
$(function() {
$("#WorkshopSelectList").select2({
placeholder: "کارگاه",
dir: "rtl",
});
});
var tabsFn = (function() {
function setHeight() {
var $tabPane = $('.tab-pane'),
tabsHeight = $('.nav-tabs').height();
console.log(tabsHeight);
$tabPane.css({
height: 250 //tabsHeight
});
}
function init() {
setHeight();
}
$(init);
})();
function setHeight() {
const $tabPane = $('.tab-pane');
const tabsHeight = $('.nav-tabs').height();
console.log(tabsHeight);
$tabPane.css({
height: 250 //tabsHeight
});
}
$(init);
})();
</script>
<script>
$(document).ready(function () {
$('input').each(function () {
$(this).click(function () {
this.select();
});
});
});
$(document).ready(function() {
$('input').each(function() {
$(this).click(function() {
this.select();
});
});
});
</script>
<script>
$('.add_project_file').click(function (e) {
e.preventDefault();
var a = ($(".items").length) / 2;
$(".project_images").append(
$('.add_project_file').click(function(e) {
e.preventDefault();
const a = ($(".items").length) / 2;
$(".project_images").append(
`<tr><td><input type="text" class="items" name="CreateEmployeChildrenList[${a
}].FName" /></td><td><input type="text" style="text-align: center !important;" class="items " name="CreateEmployeChildrenList[${
a}].DateOfBirth" /><a href="#" class="remove_project_file" style="padding-right:5px"><i style="color: red;" class="ion-close-circled"></i></a></td></tr>`);
});
'<tr>'
+ '<td><input type="text" class="items" name="CreateEmployeChildrenList[' + a + '].FName" /></td>'
+ '<td><input type="text" style="text-align: center !important;" class="items " name="CreateEmployeChildrenList[' + a + '].DateOfBirth" /><a href="#" class="remove_project_file" style="padding-right:5px"><i style="color: red;" class="ion-close-circled"></i></a></td>'
+ '</tr>');
});
// Remove parent of 'remove' link when link is clicked.
$('.project_images').on('click',
'.remove_project_file',
function(e) {
e.preventDefault();
// Remove parent of 'remove' link when link is clicked.
$('.project_images').on('click', '.remove_project_file', function (e) {
e.preventDefault();
$(this).closest('tr').remove();
});
$(this).closest('tr').remove();
});
</script>

File diff suppressed because one or more lines are too long

View File

@@ -1,6 +1,6 @@
@model List<_0_Framework.Application.OperationResult>
@{
<style>
<style>
.modal .modal-dialog .modal-content {
background-color: #ffffff;
border-radius: 30px;
@@ -13,18 +13,20 @@
<button type="button" class="close" data-dismiss="modal" aria-hidden="true"><span style="font-size: 24px">×</span></button>
</div>
<div class="modal-body">*@
<div class="row" style="font-size: 16px;">
@if (Model != null && Model.Count > 0)
{
foreach (var item in Model)
{
<div class="col-xs-12 m-b-15">
<span class="@(item.IsSuccedded ? "text-success" : "text-danger")"><i class="ion-arrow-left-c"></i><span>&nbsp;</span> @item.Message </span>
</div>
}
}
</div>
<div class="row" style="font-size: 16px;">
@if (Model != null && Model.Count > 0)
{
foreach (var item in Model)
{
<div class="col-xs-12 m-b-15">
<span class="@(item.IsSuccedded ? "text-success" : "text-danger")">
<i class="ion-arrow-left-c"></i><span>&nbsp;</span> @item.Message
</span>
</div>
}
}
</div>
@* <div class="modal-footer">
<button type="button" class="btn modal2-btn btn-warning pull-left" data-dismiss="modal">بستن</button>

View File

@@ -1,8 +1,7 @@
@model CompanyManagment.App.Contracts.Checkout.CreateCheckout
@{
int i = 1;
int b = 0;
var i = 1;
var b = 0;
@@ -17,170 +16,145 @@
@if (Model.Contracts != null)
{
@foreach (var item in Model.Contracts)
{
@foreach (var item in Model.Contracts)
{
<tr class="contractList">
@if (item.RedColor)
{
<input type="hidden" name="redColor"/>
}
@if (item.MoreThanOneMonth && item.Waiting == false)
{
<input type="hidden" value="@item.EmployeeName" name="MoreThanOneMonth"/>
}
else if (item.Waiting && item.MoreThanOneMonth == false)
{
<input type="hidden" value="@item.EmployeeName" name="Waiting"/>
}
else if (item.Waiting && item.MoreThanOneMonth)
{
<input type="hidden" value="@item.EmployeeName" name="MixWatingAndMore"/>
}
<td style="font-size: 12px !important; text-align: center; width: 10px">
@i
</td>
<td style="font-size: 12px !important; text-align: center; width: 10px">
@if (item.Extension)
{
<input type="checkbox" class="chekedId" name="cheking" value="@item.EmployeeId"/>
<tr class="contractList">
@if (item.RedColor)
{
<input type="hidden" name="redColor" />
}
@if (item.MoreThanOneMonth && item.Waiting == false)
{
<input type="hidden" value="@item.EmployeeName" name="MoreThanOneMonth" />
}
else if (item.Waiting && item.MoreThanOneMonth == false)
{
<input type="hidden" value="@item.EmployeeName" name="Waiting" />
}
else if (item.Waiting && item.MoreThanOneMonth)
{
<input type="hidden" value="@item.EmployeeName" name="MixWatingAndMore" />
}
<td style="font-size: 12px !important; text-align: center; width: 10px">
@i
</td>
<td style="font-size: 12px !important; text-align: center; width: 10px">
@if (item.Extension)
{
<input type="checkbox" class="chekedId" name="cheking" value="@item.EmployeeId" />
b++;
}
else
{
@if (item.RedColor)
{
<input type="checkbox" value="@item.EmployeeId" disabled="disabled" />
}
else
{
<input type="checkbox" name="cheking" value="@item.EmployeeId" />
}
}
b++;
}
else
{
@if (item.RedColor)
{
<input type="checkbox" value="@item.EmployeeId" disabled="disabled"/>
}
else
{
<input type="checkbox" name="cheking" value="@item.EmployeeId"/>
}
}
</td>
<td style="font-family: 'IranText' !important; font-size: 12px !important; text-align: center; width: 100px">
<input type="text" class="pCode form-control" style="text-align: center; border-radius: 7px; background-color: #e9e9e9; height: 24px; " disabled="disabled" name="@item.EmployeeId" value="@item.PersonnelCode" />
</td>
<td style="font-family: 'IranSans' !important; font-size: 12px !important; text-align: right">
@item.EmployeeName
</td>
</td>
<td style="font-family: 'IranText' !important; font-size: 12px !important; text-align: center; width: 100px">
<input type="text" class="pCode form-control" style="text-align: center; border-radius: 7px; background-color: #e9e9e9; height: 24px; " disabled="disabled" name="@item.EmployeeId" value="@item.PersonnelCode"/>
</td>
<td style="font-family: 'IranSans' !important; font-size: 12px !important; text-align: right">
@{
i++;
@item.EmployeeName
}
</td>
</tr>
@{
i++;
}
}
</tr>
}
}
<script>
//var redCheck = $('.redColor').val();
//if (redCheck == true) {
// console.log("ok");
// $('.redColor').closest('tr').css("background", "red");
//}
//var redCheck = $('.redColor').val();
//if (redCheck == true) {
// console.log("ok");
// $('.redColor').closest('tr').css("background", "red");
//}
$(document).ready(function() {
$('.chekedId').on('change', function () {
let pname = this.value;
let inputElement = document.querySelector('input[name="' + pname + '"]');
if (this.checked) {
$(document).ready(function() {
$('.chekedId').on('change',
function() {
const pname = this.value;
const inputElement = document.querySelector(`input[name="${pname}"]`);
if (this.checked) {
inputElement.disabled = false;
inputElement.style.backgroundColor = '#fff';
inputElement.disabled = false;
inputElement.style.backgroundColor = '#fff';
} else {
inputElement.disabled = true;
inputElement.style.backgroundColor = '#e9e9e9';
}
} else {
inputElement.disabled = true;
inputElement.style.backgroundColor = '#e9e9e9';
}
});
});
var checkboxes = document.getElementsByName('redColor');
for (var i = 0, n = checkboxes.length; i < n; i++) {
checkboxes[i].parentNode.style.background = "rgb(248 251 196)";
}
var checkboxes = document.getElementsByName('Waiting');
for (var i = 0, n = checkboxes.length; i < n; i++) {
checkboxes[i].parentNode.style.background = "#ffcd40";
}
var checkboxes = document.getElementsByName('MoreThanOneMonth');
for (var i = 0, n = checkboxes.length; i < n; i++) {
checkboxes[i].parentNode.style.background = "#daf9ca";
}
var checkboxes = document.getElementsByName('MixWatingAndMore');
for (var i = 0, n = checkboxes.length; i < n; i++) {
checkboxes[i].parentNode.style.background = "#ffcd40";
}
var checkboxes2 = document.getElementsByName('MixWatingAndMore');
//for (var s = 0, m = checkboxes2.length; s < m; s++) {
// $('#alarm').append(
});
});
var checkboxes = document.getElementsByName('redColor');
for (var i = 0, n = checkboxes.length; i < n; i++) {
checkboxes[i].parentNode.style.background = "rgb(248 251 196)";
}
var checkboxes = document.getElementsByName('Waiting');
for (var i = 0, n = checkboxes.length; i < n; i++) {
checkboxes[i].parentNode.style.background = "#ffcd40";
}
var checkboxes = document.getElementsByName('MoreThanOneMonth');
for (var i = 0, n = checkboxes.length; i < n; i++) {
checkboxes[i].parentNode.style.background = "#daf9ca";
}
var checkboxes = document.getElementsByName('MixWatingAndMore');
for (var i = 0, n = checkboxes.length; i < n; i++) {
checkboxes[i].parentNode.style.background = "#ffcd40";
}
var checkboxes2 = document.getElementsByName('MixWatingAndMore');
//for (var s = 0, m = checkboxes2.length; s < m; s++) {
// $('#alarm').append(
// '<h5 style="color:red; direction: rtl;" class="ConvertErr"><span> مدت قرارد </span> <span>&nbsp;</span><span>' + checkboxes2[s].value + '</span> <span>&nbsp;</span><span> بیش از یک ماه است</span></h5>'
// + '<h5 style="color: #ffa12c; direction: rtl;" class="ConvertErr"><span> از آخرین قرارداد </span> <span>&nbsp;</span><span>' + checkboxes2[s].value + '</span> <span>&nbsp;</span><span> تا تاریخ تبدیل انتخاب شده هیچ قراردادی وجود ندارد</span></h5>'
// );
//}
//var checkboxes2 = document.getElementsByName('MoreThanOneMonth');
//for (var b = 0, m = checkboxes2.length; b < m; b++) {
// $('#alarm').append(
// '<h5 style="color:red; direction: rtl;" class="ConvertErr"><span> مدت قرارد </span> <span>&nbsp;</span><span>' + checkboxes2[s].value + '</span> <span>&nbsp;</span><span> بیش از یک ماه است</span></h5>'
// + '<h5 style="color: #ffa12c; direction: rtl;" class="ConvertErr"><span> از آخرین قرارداد </span> <span>&nbsp;</span><span>' + checkboxes2[s].value + '</span> <span>&nbsp;</span><span> تا تاریخ تبدیل انتخاب شده هیچ قراردادی وجود ندارد</span></h5>'
// );
//}
//var checkboxes2 = document.getElementsByName('MoreThanOneMonth');
//for (var b = 0, m = checkboxes2.length; b < m; b++) {
// $('#alarm').append(
// '<h5 style="color:red; direction: rtl;" class="ConvertErr"><span> مدت قرارد </span> <span>&nbsp;</span><span>' + checkboxes2[b].value + '</span> <span>&nbsp;</span><span> بیش از یک ماه است</span></h5>'
// );
//}
//var checkboxes3 = document.getElementsByName('Waiting');
//for (var a = 0, f = checkboxes3.length; a < f; a++) {
// $('#alarm').append(
// '<h5 style="color: #ffa12c; direction: rtl;" class="ConvertErr"><span> از آخرین قرارداد </span> <span>&nbsp;</span><span>' + checkboxes3[a].value + '</span> <span>&nbsp;</span><span> تا تاریخ تبدیل انتخاب شده هیچ قراردادی وجود ندارد</span></h5>'
// );
//}
/*ff8f8d*/
</script>
// '<h5 style="color:red; direction: rtl;" class="ConvertErr"><span> مدت قرارد </span> <span>&nbsp;</span><span>' + checkboxes2[b].value + '</span> <span>&nbsp;</span><span> بیش از یک ماه است</span></h5>'
// );
//}
//var checkboxes3 = document.getElementsByName('Waiting');
//for (var a = 0, f = checkboxes3.length; a < f; a++) {
// $('#alarm').append(
// '<h5 style="color: #ffa12c; direction: rtl;" class="ConvertErr"><span> از آخرین قرارداد </span> <span>&nbsp;</span><span>' + checkboxes3[a].value + '</span> <span>&nbsp;</span><span> تا تاریخ تبدیل انتخاب شده هیچ قراردادی وجود ندارد</span></h5>'
// );
//}
/*ff8f8d*/
</script>

File diff suppressed because it is too large Load Diff

View File

@@ -1,7 +1,6 @@
@using _0_Framework.Application
@model CompanyManagment.App.Contracts.Employer.EditEmployer
@model CompanyManagment.App.Contracts.Employer.EditEmployer
@{
<style>
<style>
#thh table {
width: 100%;
@@ -90,205 +89,204 @@
</style>
}
<div id="actualDetails">
<div class="modal-header" style="border-bottom: unset">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
</div>
<div class="modal-header" style="border-bottom: unset">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
</div>
<form asp-page="./Index" asp-page-handler="Details"
method="post"
data-ajax="true"
data-callback=""
data-action="Refresh"
enctype="multipart/form-data">
<div class="modal-body">
<div class="row">
<fieldset style="border: 1px solid #999797; border-radius: 10px; padding: revert;">
<legend style="margin-bottom: 5px;font-size: 12px;border-bottom: 0px;color: #505458;width: 50%;text-align: center;"> اطلاعات کارفرمای حقیقی</legend>
<form asp-page="./Index" asp-page-handler="Details"
method="post"
data-ajax="true"
data-callback=""
data-action="Refresh"
enctype="multipart/form-data">
<div class="modal-body">
<div class="row">
<fieldset style="border: 1px solid #999797; border-radius: 10px; padding: revert;">
<legend style="margin-bottom: 5px;font-size: 12px;border-bottom: 0px;color: #505458;width: 50%;text-align: center;"> اطلاعات کارفرمای حقیقی</legend>
<table id="thh" style="height: 150px;width: 100%;font-size: 12px;">
<tr>
<th>فیلد</th>
<th>اطلاعات</th>
<table id="thh" style="height: 150px;width: 100%;font-size: 12px;">
<tr>
<th>فیلد</th>
<th>اطلاعات</th>
</tr>
</tr>
<tr>
<td>نام و نام خانوادگی</td>
<td> @Model.FName @Model.LName</td>
<tr>
<td>نام و نام خانوادگی</td>
<td> @Model.FName @Model.LName</td>
</tr>
</tr>
<tr>
<td> جنسیت </td>
<td> @Model.Gender</td>
<tr>
<td> جنسیت </td>
<td> @Model.Gender</td>
</tr>
</tr>
<tr>
<td> ملیت </td>
<td> @Model.Nationality</td>
<tr>
<td> ملیت </td>
<td> @Model.Nationality</td>
</tr>
</tr>
<tr>
<td>نام پدر</td>
<td> @Model.FatherName</td>
<tr>
<td>نام پدر</td>
<td> @Model.FatherName</td>
</tr>
</tr>
<tr>
<td>کد ملی</td>
<td> @Model.Nationalcode</td>
<tr>
<td>کد ملی</td>
<td> @Model.Nationalcode</td>
</tr>
</tr>
<tr>
<td> شماره شناسنامه </td>
<td> @Model.IdNumber </td>
<tr>
<td> شماره شناسنامه </td>
<td> @Model.IdNumber </td>
</tr>
</tr>
<tr>
<td> محل صدور شناسنامه </td>
<td> @Model.PlaceOfIssue</td>
<tr>
<td> محل صدور شناسنامه </td>
<td> @Model.PlaceOfIssue</td>
</tr>
<tr>
<td> تاریخ تولد </td>
<td> @Model.DateOfBirth </td>
</tr>
<tr>
<td> تاریخ تولد </td>
<td> @Model.DateOfBirth </td>
</tr>
</tr>
<tr>
<td> تاریخ صدور شناسنامه </td>
<td> @Model.DateOfIssue</td>
<tr>
<td> تاریخ صدور شناسنامه </td>
<td> @Model.DateOfIssue</td>
</tr>
</tr>
<tr>
<td> شماره تلفن همراه </td>
<td> @Model.Phone</td>
<tr>
<td> شماره تلفن همراه </td>
<td> @Model.Phone</td>
</tr>
</tr>
<tr>
<td> شماره تلفن ثابت</td>
<td> @Model.AgentPhone </td>
<tr>
<td> شماره تلفن ثابت</td>
<td> @Model.AgentPhone </td>
</tr>
</tr>
<tr>
<td> کد کارفرما </td>
<td> @Model.EmployerNo </td>
<tr>
<td> کد کارفرما </td>
<td> @Model.EmployerNo </td>
</tr>
</tr>
<tr>
<td>
<tr>
<td>
طرف حساب
طرف حساب
</td>
<td>
</td>
<td>
@foreach (var n in @Model.ContractingParties)
{
if (@Model.ContractingPartyId == n.id)
{
<span>@n.FName</span><span>@n.LName</span>
}
}
@foreach (var n in Model.ContractingParties)
{
if (Model.ContractingPartyId == n.id)
{
<span>@n.FName</span>
<span>@n.LName</span>
}
}
</td>
</td>
</tr>
</tr>
</table>
</fieldset>
</div>
<div class="row">
<fieldset style="border: 1px solid #999797; border-radius: 10px; padding: revert;">
<legend style="margin-bottom: 5px;font-size: 14px;border-bottom: 0px;color: #505458;width: 50%;text-align: center;"> اطلاعات سامانه های دولتی</legend>
</table>
<table id="thh2" style="height: 150px;width: 100%">
<tr>
<th> نام کاربری اداره کار </th>
<th> رمز عبور اداره کار </th>
</tr>
<tr>
<td> @Model.MclsUserName </td>
<td>
<i class="md-vpn-key"></i> @Model.MclsPassword
</td>
</tr>
</fieldset>
</div>
<div class="row">
<fieldset style="border: 1px solid #999797; border-radius: 10px; padding: revert;">
<legend style="margin-bottom: 5px;font-size: 14px;border-bottom: 0px;color: #505458;width: 50%;text-align: center;"> اطلاعات سامانه های دولتی</legend>
<tr>
<th dir="ltr"> E Service نام کاربری </th>
<th dir="ltr"> E Service رمز عبور </th>
<table id="thh2" style="height: 150px;width: 100%">
</tr>
<tr>
<td> @Model.EserviceUserName </td>
<td>
<i class="md-vpn-key"></i> @Model.EservicePassword
</td>
</tr>
<tr>
<th> نام کاربری اداره کار </th>
<th> رمز عبور اداره کار </th>
</tr>
<tr>
<th> نام کاربری سامانه مالیات </th>
<th> رمز عبور سامانه مالیات </th>
<tr>
</tr>
<td> @Model.MclsUserName </td>
<td> <i class="md-vpn-key"></i> @Model.MclsPassword </td>
</tr>
<tr>
<tr>
<th dir="ltr"> E Service نام کاربری </th>
<th dir="ltr"> E Service رمز عبور </th>
<td> @Model.TaxOfficeUserName </td>
<td>
<i class="md-vpn-key"></i> @Model.TaxOfficepassword
</td>
</tr>
</tr>
<tr>
<th> نام کاربری سامانه ثنا </th>
<th> رمز عبور سامانه ثنا </th>
<tr>
</tr>
<td> @Model.EserviceUserName </td>
<td><i class="md-vpn-key"></i> @Model.EservicePassword </td>
</tr>
<tr>
<tr>
<th> نام کاربری سامانه مالیات </th>
<th> رمز عبور سامانه مالیات </th>
<td> @Model.SanaUserName </td>
<td>
<i class="md-vpn-key"></i> @Model.SanaPassword
</td>
</tr>
</tr>
<tr>
</table>
<td> @Model.TaxOfficeUserName </td>
<td><i class="md-vpn-key"></i> @Model.TaxOfficepassword </td>
</tr>
<tr>
<th> نام کاربری سامانه ثنا </th>
<th> رمز عبور سامانه ثنا </th>
</fieldset>
</div>
</tr>
</div>
<input type="hidden" asp-for="Id" value="@Model.Id"/>
<tr>
<div class="modal-footer" style="border-top: unset; padding-top: unset">
<td> @Model.SanaUserName </td>
<td><i class="md-vpn-key"></i> @Model.SanaPassword </td>
</tr>
</table>
</fieldset>
</div>
</div>
<input type="hidden" asp-for="Id" value="@Model.Id" />
<div class="modal-footer" style="border-top: unset; padding-top: unset">
<button type="button" class="btn btn-warning btn-rounded waves-effect waves-light m-b-10" data-dismiss="modal">بستن فرم</button>
</div>
</form>
<button type="button" class="btn btn-warning btn-rounded waves-effect waves-light m-b-10" data-dismiss="modal">بستن فرم</button>
</div>
</form>
</div>

View File

@@ -1,447 +1,450 @@
@using _0_Framework.Application
@model CompanyManagment.App.Contracts.Employer.EditEmployer
@model CompanyManagment.App.Contracts.Employer.EditEmployer
@{
}
<link href="@Href("~/admintheme/css/actualEmployer.css")" rel="stylesheet" />
<link href="@Href("~/admintheme/css/actualEmployer.css")" rel="stylesheet"/>
<div class="container" id="actualEdit">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<div class="main-title">ویرایش مشخصات کارفرمای حقیقی</div>
<form asp-page="./Index" asp-page-handler="Edit" autocomplete="off" id="actualEmployer"
method="post"
data-ajax="true"
data-callback=""
data-action="Refresh">
<div class="box">
<div class="steps col-md-12">
<div id="progressBar"></div>
<div class="step col-md-6 col-xs-6">مشخصات کارفرمای حقیقی</div>
<div class="step col-md-6 col-xs-6">اطلاعات سامانه ای</div>
</div>
<div class="form" id="form1">
<div class="form-group col-md-12" id="divParty" dir="rtl" style="padding-left: 2.5%">
<label class="sr-only" asp-for="ContractingPartyId"></label>
<select class="form-control select-city" id="party" asp-for="ContractingPartyId" asp-items='new SelectList(Model.ContractingParties, "id", "LName")'>
<option value="">انتخاب طرف حساب</option>
</select>
<span asp-validation-for="ContractingPartyId" class="error"></span>
</div>
<div class="d-flex w-100">
<div class="col-md-6 col-xs-6 right-one">
<div class="radio-box radio-box-gender">
<label class="radio-label">جنسیت </label>
<div class="radio-input radio-gender">
<label>
آقا<input type="radio" value="مرد" asp-for="Gender" name="Gender">
</label>
<label>
خانم<input type="radio" value="زن" asp-for="Gender" name="Gender">
</label>
</div>
</div>
</div>
<div class="col-md-6 col-xs-6 left-one">
<div class="radio-box">
<label class="radio-label">ملیت </label>
<div class="radio-input nationality">
<label>
ایرانی<input type="radio" value="ایرانی" name="Nationality" asp-for="Nationality" checked="checked">
</label>
<label>
غیر ایرانی<input type="radio" value="غیر ایرانی" name="Nationality" asp-for="Nationality">
</label>
</div>
</div>
</div>
</div>
<div class="flexible-wrap">
<div class="col-md-4 col-xs-6">
<div class="form-group">
<label asp-for="FName" class="control-label">نام</label>
@* @if (Model.HasWorkshop)
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<div class="main-title">ویرایش مشخصات کارفرمای حقیقی</div>
<form asp-page="./Index" asp-page-handler="Edit" autocomplete="off" id="actualEmployer"
method="post"
data-ajax="true"
data-callback=""
data-action="Refresh">
<div class="box">
<div class="steps col-md-12">
<div id="progressBar"></div>
<div class="step col-md-6 col-xs-6">مشخصات کارفرمای حقیقی</div>
<div class="step col-md-6 col-xs-6">اطلاعات سامانه ای</div>
</div>
<div class="form" id="form1">
<div class="form-group col-md-12" id="divParty" dir="rtl" style="padding-left: 2.5%">
<label class="sr-only" asp-for="ContractingPartyId"></label>
<select class="form-control select-city" id="party" asp-for="ContractingPartyId" asp-items='new SelectList(Model.ContractingParties, "id", "LName")'>
<option value="">انتخاب طرف حساب</option>
</select>
<span asp-validation-for="ContractingPartyId" class="error"></span>
</div>
<div class="d-flex w-100">
<div class="col-md-6 col-xs-6 right-one">
<div class="radio-box radio-box-gender">
<label class="radio-label">جنسیت </label>
<div class="radio-input radio-gender">
<label>
آقا<input type="radio" value="مرد" asp-for="Gender" name="Gender">
</label>
<label>
خانم<input type="radio" value="زن" asp-for="Gender" name="Gender">
</label>
</div>
</div>
</div>
<div class="col-md-6 col-xs-6 left-one">
<div class="radio-box">
<label class="radio-label">ملیت </label>
<div class="radio-input nationality">
<label>
ایرانی<input type="radio" value="ایرانی" name="Nationality" asp-for="Nationality" checked="checked">
</label>
<label>
غیر ایرانی<input type="radio" value="غیر ایرانی" name="Nationality" asp-for="Nationality">
</label>
</div>
</div>
</div>
</div>
<div class="flexible-wrap">
<div class="col-md-4 col-xs-6">
<div class="form-group">
<label asp-for="FName" class="control-label">نام</label>
@* @if (Model.HasWorkshop)
{
<input type="text" class="form-control not-empty" asp-for="FName" pattern="[\u0600-\u06FF\s]*" readonly />
}
else
{ *@
<input type="text" class="form-control not-empty" asp-for="FName" pattern="[\u0600-\u06FF\s]*" />
@* } *@
<i class="fa fa-exclamation-circle error-icon"></i>
<p class="error-message">فقط حروف فارسی وارد شود.</p>
</div>
</div>
<div class="col-md-4 col-xs-6">
<div class="form-group">
<label asp-for="LName" class="control-label">نام خانوادگی</label>
@* @if (Model.HasWorkshop)
<input type="text" class="form-control not-empty" asp-for="FName" pattern="[\u0600-\u06FF\s]*"/>
@* } *@
<i class="fa fa-exclamation-circle error-icon"></i>
<p class="error-message">فقط حروف فارسی وارد شود.</p>
</div>
</div>
<div class="col-md-4 col-xs-6">
<div class="form-group">
<label asp-for="LName" class="control-label">نام خانوادگی</label>
@* @if (Model.HasWorkshop)
{
<input type="text" class="form-control not-empty" asp-for="LName" pattern="[\u0600-\u06FF\s]*" readonly />
}
else
{ *@
<input type="text" class="form-control not-empty" asp-for="LName" pattern="[\u0600-\u06FF\s]*" />
@* } *@
<i class="fa fa-exclamation-circle error-icon"></i>
<p class="error-message">فقط حروف فارسی وارد شود.</p>
</div>
</div>
<div class="col-md-4 col-xs-6">
<div class="form-group">
<label asp-for="FatherName" class="control-label"> نام پدر</label>
@* @if (Model.HasWorkshop)
<input type="text" class="form-control not-empty" asp-for="LName" pattern="[\u0600-\u06FF\s]*"/>
@* } *@
<i class="fa fa-exclamation-circle error-icon"></i>
<p class="error-message">فقط حروف فارسی وارد شود.</p>
</div>
</div>
<div class="col-md-4 col-xs-6">
<div class="form-group">
<label asp-for="FatherName" class="control-label"> نام پدر</label>
@* @if (Model.HasWorkshop)
{
<input type="text" class="form-control" asp-for="FatherName" pattern="[\u0600-\u06FF\s]*" readonly />
}
else
{ *@
<input type="text" class="form-control" asp-for="FatherName" pattern="[\u0600-\u06FF\s]*" />
@*} *@
<input type="text" class="form-control" asp-for="FatherName" pattern="[\u0600-\u06FF\s]*"/>
<i class="fa fa-exclamation-circle error-icon"></i>
<p class="error-message">فقط حروف فارسی وارد شود.</p>
</div>
</div>
<div class="col-md-4 col-xs-6">
<div class="form-group">
<label asp-for="Nationalcode" class="control-label">کد ملی</label>
@if (Model.HasWorkshop)
{
<input type="text" class="form-control" asp-for="Nationalcode" pattern="\d*" maxlength="10" readonly />
}
else
{
<input type="text" class="form-control" asp-for="Nationalcode" pattern="\d*" maxlength="10" />
}
@*} *@
<i class="fa fa-exclamation-circle error-icon"></i>
<p class="error-message">فقط عدد وارد شود.</p>
</div>
</div>
<div class="col-md-4 col-xs-6">
<div class="form-group">
<label asp-for="IdNumber" class="control-label">شماره شناسنامه</label>
@if (Model.HasWorkshop)
{
<input type="text" class="form-control" asp-for="IdNumber" pattern="\d*" maxlength="10" readonly />
}
else
{
<input type="text" class="form-control" asp-for="IdNumber" pattern="\d*" maxlength="10" />
}
<i class="fa fa-exclamation-circle error-icon"></i>
<p class="error-message">فقط حروف فارسی وارد شود.</p>
</div>
</div>
<div class="col-md-4 col-xs-6">
<div class="form-group">
<label asp-for="Nationalcode" class="control-label">کد ملی</label>
<i class="fa fa-exclamation-circle error-icon"></i>
<p class="error-message">فقط عدد وارد شود.</p>
</div>
</div>
<div class="col-md-4 col-xs-6">
<div class="form-group">
<label asp-for="PlaceOfIssue" class="control-label"> محل صدور شناسنامه</label>
<input type="text" class="form-control" asp-for="PlaceOfIssue" pattern="[\u0600-\u06FF\s]*" />
<i class="fa fa-exclamation-circle error-icon"></i>
<p class="error-message">فقط حروف فارسی وارد شود.</p>
</div>
</div>
<div class="col-md-6 col-xs-6">
<div class="form-group">
<div>
<label asp-for="DateOfBirth" class="control-label">تاریخ تولد</label>
<input class="form-control persianDateInput" asp-for="DateOfBirth" maxlength="10" />
<span asp-validation-for="DateOfBirth" class="error"></span>
</div>
</div>
</div>
<div class="col-md-6 col-xs-6">
<div class="form-group">
<label asp-for="DateOfIssue" class="control-label"> تاریخ صدور شناسنامه</label>
<input class="form-control persianDateInput" asp-for="DateOfIssue" maxlength="10" />
<span asp-validation-for="DateOfIssue" class="error"></span>
</div>
</div>
<div class="col-md-6 col-xs-6">
<div class="form-group">
<label asp-for="Phone" class="control-label">شماره تلفن همراه</label>
<input type="text" class="form-control" asp-for="Phone" pattern="\d*" maxlength="11" />
<i class="fa fa-exclamation-circle error-icon"></i>
<p class="error-message">فقط عدد وارد شود.</p>
</div>
</div>
<div class="col-md-6 col-xs-6">
<div class="form-group">
<label asp-for="AgentPhone" class="control-label">شماره تلفن ثابت</label>
<input type="text" class="form-control" asp-for="AgentPhone" pattern="\d*" maxlength="11" />
<i class="fa fa-exclamation-circle error-icon"></i>
<p class="error-message">فقط عدد وارد شود.</p>
</div>
</div>
</div>
</div>
<div class="form" id="form2">
<div class="flexible-wrap" style="padding: 0 10px;">
<fieldset>
<legend> اداره کار </legend>
<div class="col-md-6 col-xs-6">
<div class="form-group">
<label asp-for="MclsUserName" class="control-label">نام کاربری</label>
<input style="background-color: #e0ffe0;" type="text" class="form-control" asp-for="MclsUserName">
</div>
</div>
<div class="col-md-6 col-xs-6">
<div class="form-group">
<label asp-for="MclsPassword" class="control-label">گذرواژه</label>
<input style="background-color: #e0ffe0;" type="text" class="form-control" asp-for="MclsPassword">
</div>
</div>
</fieldset>
<fieldset>
<legend> تامین اجتماعی</legend>
<div class="col-md-6 col-xs-6">
<div class="form-group">
<label asp-for="EserviceUserName" class="control-label" style="direction: ltr">نام کاربری </label>
<input style="background-color: #e0ffe0;" type="text" class="form-control" asp-for="EserviceUserName">
</div>
</div>
<div class="col-md-6 col-xs-6">
<div class="form-group">
<label asp-for="EservicePassword" class="control-label" style="direction: ltr"> گذرواژه</label>
<input style="background-color: #e0ffe0;" type="text" class="form-control" asp-for="EservicePassword">
</div>
</div>
</fieldset>
<fieldset>
<legend> قوه قضائیه </legend>
<div class="col-md-6 col-xs-6">
<div class="form-group">
<label asp-for="TaxOfficeUserName" class="control-label"> نام کاربری </label>
<input style="background-color: #e0ffe0;" type="text" class="form-control" asp-for="TaxOfficeUserName">
</div>
</div>
<div class="col-md-6 col-xs-6">
<div class="form-group">
<label asp-for="TaxOfficepassword" class="control-label"> گذرواژه </label>
<input style="background-color: #e0ffe0;" type="text" class="form-control" asp-for="TaxOfficepassword">
</div>
</div>
</fieldset>
<fieldset>
<legend> امور مالیاتی </legend>
<div class="col-md-6 col-xs-6">
<div class="form-group">
<label asp-for="SanaUserName" class="control-label"> نام کاربری </label>
<input style="background-color: #e0ffe0;" type="text" class="form-control" asp-for="SanaUserName">
</div>
</div>
<div class="col-md-6 col-xs-6">
<div class="form-group">
<label asp-for="SanaPassword" class="control-label"> گذرواژه </label>
<input style="background-color: #e0ffe0;" type="text" class="form-control" asp-for="SanaPassword">
</div>
</div>
</fieldset>
</div>
</div>
@*<input type="hidden" asp-for="id" value="id"/>*@
<div class="form-footer-btns">
<a class="btn btn-modal pre">مرحله قبل</a>
<a class="btn btn-modal next">مرحله بعد</a>
</div>
</div>
<input type="hidden" asp-for="Id" value="@Model.Id" />
<div class="form-footer">
<a class="btn btn-rounded waves-effect waves-light bg-white" id="close" data-dismiss="modal">بستن</a>
<a class="btn btn-rounded waves-effect waves-light" id="save">ویرایش</a>
<a href="#" class="btn btn-success btn-rounded waves-effect waves-light" id="fakeSave" style="display: none;">ذخیره</a>
</div>
</form>
@if (Model.HasWorkshop)
{
<input type="text" class="form-control" asp-for="Nationalcode" pattern="\d*" maxlength="10" readonly/>
}
else
{
<input type="text" class="form-control" asp-for="Nationalcode" pattern="\d*" maxlength="10"/>
}
<i class="fa fa-exclamation-circle error-icon"></i>
<p class="error-message">فقط عدد وارد شود.</p>
</div>
</div>
<div class="col-md-4 col-xs-6">
<div class="form-group">
<label asp-for="IdNumber" class="control-label">شماره شناسنامه</label>
@if (Model.HasWorkshop)
{
<input type="text" class="form-control" asp-for="IdNumber" pattern="\d*" maxlength="10" readonly/>
}
else
{
<input type="text" class="form-control" asp-for="IdNumber" pattern="\d*" maxlength="10"/>
}
<i class="fa fa-exclamation-circle error-icon"></i>
<p class="error-message">فقط عدد وارد شود.</p>
</div>
</div>
<div class="col-md-4 col-xs-6">
<div class="form-group">
<label asp-for="PlaceOfIssue" class="control-label"> محل صدور شناسنامه</label>
<input type="text" class="form-control" asp-for="PlaceOfIssue" pattern="[\u0600-\u06FF\s]*"/>
<i class="fa fa-exclamation-circle error-icon"></i>
<p class="error-message">فقط حروف فارسی وارد شود.</p>
</div>
</div>
<div class="col-md-6 col-xs-6">
<div class="form-group">
<div>
<label asp-for="DateOfBirth" class="control-label">تاریخ تولد</label>
<input class="form-control persianDateInput" asp-for="DateOfBirth" maxlength="10"/>
<span asp-validation-for="DateOfBirth" class="error"></span>
</div>
</div>
</div>
<div class="col-md-6 col-xs-6">
<div class="form-group">
<label asp-for="DateOfIssue" class="control-label"> تاریخ صدور شناسنامه</label>
<input class="form-control persianDateInput" asp-for="DateOfIssue" maxlength="10"/>
<span asp-validation-for="DateOfIssue" class="error"></span>
</div>
</div>
<div class="col-md-6 col-xs-6">
<div class="form-group">
<label asp-for="Phone" class="control-label">شماره تلفن همراه</label>
<input type="text" class="form-control" asp-for="Phone" pattern="\d*" maxlength="11"/>
<i class="fa fa-exclamation-circle error-icon"></i>
<p class="error-message">فقط عدد وارد شود.</p>
</div>
</div>
<div class="col-md-6 col-xs-6">
<div class="form-group">
<label asp-for="AgentPhone" class="control-label">شماره تلفن ثابت</label>
<input type="text" class="form-control" asp-for="AgentPhone" pattern="\d*" maxlength="11"/>
<i class="fa fa-exclamation-circle error-icon"></i>
<p class="error-message">فقط عدد وارد شود.</p>
</div>
</div>
</div>
</div>
<div class="form" id="form2">
<div class="flexible-wrap" style="padding: 0 10px;">
<fieldset>
<legend> اداره کار </legend>
<div class="col-md-6 col-xs-6">
<div class="form-group">
<label asp-for="MclsUserName" class="control-label">نام کاربری</label>
<input style="background-color: #e0ffe0;" type="text" class="form-control" asp-for="MclsUserName">
</div>
</div>
<div class="col-md-6 col-xs-6">
<div class="form-group">
<label asp-for="MclsPassword" class="control-label">گذرواژه</label>
<input style="background-color: #e0ffe0;" type="text" class="form-control" asp-for="MclsPassword">
</div>
</div>
</fieldset>
<fieldset>
<legend> تامین اجتماعی</legend>
<div class="col-md-6 col-xs-6">
<div class="form-group">
<label asp-for="EserviceUserName" class="control-label" style="direction: ltr">نام کاربری </label>
<input style="background-color: #e0ffe0;" type="text" class="form-control" asp-for="EserviceUserName">
</div>
</div>
<div class="col-md-6 col-xs-6">
<div class="form-group">
<label asp-for="EservicePassword" class="control-label" style="direction: ltr"> گذرواژه</label>
<input style="background-color: #e0ffe0;" type="text" class="form-control" asp-for="EservicePassword">
</div>
</div>
</fieldset>
<fieldset>
<legend> قوه قضائیه </legend>
<div class="col-md-6 col-xs-6">
<div class="form-group">
<label asp-for="TaxOfficeUserName" class="control-label"> نام کاربری </label>
<input style="background-color: #e0ffe0;" type="text" class="form-control" asp-for="TaxOfficeUserName">
</div>
</div>
<div class="col-md-6 col-xs-6">
<div class="form-group">
<label asp-for="TaxOfficepassword" class="control-label"> گذرواژه </label>
<input style="background-color: #e0ffe0;" type="text" class="form-control" asp-for="TaxOfficepassword">
</div>
</div>
</fieldset>
<fieldset>
<legend> امور مالیاتی </legend>
<div class="col-md-6 col-xs-6">
<div class="form-group">
<label asp-for="SanaUserName" class="control-label"> نام کاربری </label>
<input style="background-color: #e0ffe0;" type="text" class="form-control" asp-for="SanaUserName">
</div>
</div>
<div class="col-md-6 col-xs-6">
<div class="form-group">
<label asp-for="SanaPassword" class="control-label"> گذرواژه </label>
<input style="background-color: #e0ffe0;" type="text" class="form-control" asp-for="SanaPassword">
</div>
</div>
</fieldset>
</div>
</div>
@*<input type="hidden" asp-for="id" value="id"/>*@
<div class="form-footer-btns">
<a class="btn btn-modal pre">مرحله قبل</a>
<a class="btn btn-modal next">مرحله بعد</a>
</div>
</div>
<input type="hidden" asp-for="Id" value="@Model.Id"/>
<div class="form-footer">
<a class="btn btn-rounded waves-effect waves-light bg-white" id="close" data-dismiss="modal">بستن</a>
<a class="btn btn-rounded waves-effect waves-light" id="save">ویرایش</a>
<a href="#" class="btn btn-success btn-rounded waves-effect waves-light" id="fakeSave" style="display: none;">ذخیره</a>
</div>
</form>
</div>
<script>
$(document).ready(function () {
$('.error-message').hide();
$('.error-icon').hide();
})
$('#MainModal').on('hidden.bs.modal', function () {
$(".datepicker-container").hide();
});
$(document).ready(function() {
$('.error-message').hide();
$('.error-icon').hide();
});
$('#MainModal').on('hidden.bs.modal',
function() {
$(".datepicker-container").hide();
});
$('.form-control').on('keyup', function () {
const errorMessage = $(this).parent().find('.error-message');
const errorIcon = $(this).parent().find('.error-icon');
if (this.validity.patternMismatch) {
errorMessage.show();
errorIcon.show();
$(this).addClass('errored');
$(this).addClass('patternMisMatch');
$('.form-control').on('keyup',
function() {
const errorMessage = $(this).parent().find('.error-message');
const errorIcon = $(this).parent().find('.error-icon');
if (this.validity.patternMismatch) {
errorMessage.show();
errorIcon.show();
$(this).addClass('errored');
$(this).addClass('patternMisMatch');
} else {
errorMessage.hide();
errorIcon.hide();
$(this).removeClass('errored');
$(this).removeClass('patternMisMatch');
}
});
} else {
errorMessage.hide();
errorIcon.hide();
$(this).removeClass('errored');
$(this).removeClass('patternMisMatch');
}
});
$(".next").click(function () {
$("#form1").find('.not-empty').each(function () {
if ($(this).val() === '') {
$(this).addClass('errored');
} else {
$(this).removeClass('errored');
}
});
var option1 = document.getElementById("party").options.selectedIndex;
if (option1 == 0) {
$("#divParty .select2-selection").addClass('errored');
} else {
$("#divParty .select2-selection").removeClass('errored');
}
if ($('#form1 .errored').length > 0 || $('#form1 input.patternMisMatch').length > 0) {
$('.sweet-alert').removeClass("successSwall");
$('.sweet-alert').removeClass("errorSwall");
swal({
title: 'لطفا موارد اجباری را تکمیل کنید.',
text: "",
type: "warning",
showCancelButton: true,
confirmButtonColor: "#DD6B55",
//confirmButtonText: "بستن",
cancelButtonText: "بستن",
closeOnConfirm: false,
customClass: "errorSwall"
});
$(".next").click(function() {
$("#form1").find('.not-empty').each(function() {
if ($(this).val() === '') {
$(this).addClass('errored');
} else {
$(this).removeClass('errored');
}
});
const option1 = document.getElementById("party").options.selectedIndex;
if (option1 == 0) {
$("#divParty .select2-selection").addClass('errored');
} else {
$("#divParty .select2-selection").removeClass('errored');
}
if ($('#form1 .errored').length > 0 || $('#form1 input.patternMisMatch').length > 0) {
$('.sweet-alert').removeClass("successSwall");
$('.sweet-alert').removeClass("errorSwall");
swal({
title: 'لطفا موارد اجباری را تکمیل کنید.',
text: "",
type: "warning",
showCancelButton: true,
confirmButtonColor: "#DD6B55",
//confirmButtonText: "بستن",
cancelButtonText: "بستن",
closeOnConfirm: false,
customClass: "errorSwall"
});
} else {
if ($('#form2').css('left') == '0px') {
$(".next").css({
'background-color': "#c7c0c0ba",
'color': '#000000b8',
'box-shadow': 'none'
})
} else if ($('#form2').css('left') == '3000px') {
$(".next").css({
'background-color': "#c7c0c0ba",
'color': '#000000b8',
'box-shadow': 'none'
})
$(".pre").css({
'background-color': "white",
'color': '#0f9500'
})
$("#progressBar").css({
'width': '100%'
} else {
if ($('#form2').css('left') == '0px') {
$(".next").css({
'background-color': "#c7c0c0ba",
'color': '#000000b8',
'box-shadow': 'none'
});
} else if ($('#form2').css('left') == '3000px') {
$(".next").css({
'background-color': "#c7c0c0ba",
'color': '#000000b8',
'box-shadow': 'none'
});
$(".pre").css({
'background-color': "white",
'color': '#0f9500'
});
$("#progressBar").css({
'width': '100%'
})
$("#form1").css({
right: '3000px'
})
$("#form2").css({
left: '0px'
})
}
}
})
$(".pre").click(function () {
$(".next").css({
'background-color': "white",
'color': '#1763b1'
})
if ($('#form2').css('left') == '3000px') {
$(".pre").css({
'background-color': "#c7c0c0ba",
'color': '#000000b8',
'box-shadow': 'none'
})
} else if ($('#form2').css('left') == '0px') {
$("#progressBar").css({
'width': '50%',
'border-top-right-radius': '0px'
})
$(".pre").css({
'background-color': "#c7c0c0ba",
'color': '#000000b8',
'box-shadow': 'none'
})
$("#form2").css({
left: '3000px'
})
$("#form1").css({
right: '0px'
})
}
})
$("#save").click(function () {
$("#form1").find('.not-empty').each(function () {
if ($(this).val() === '') {
$(this).addClass('errored');
} else {
$(this).removeClass('errored');
}
});
var option1 = document.getElementById("party").options.selectedIndex;
if (option1 == 0) {
$("#divParty .select2-selection").addClass('errored');
} else {
$("#divParty .select2-selection").removeClass('errored');
}
if ($('#form1 .errored').length > 0 || $('#form1 input.patternMisMatch').length > 0) {
$('.sweet-alert').removeClass("successSwall");
$('.sweet-alert').removeClass("errorSwall");
swal({
title: 'لطفا موارد اجباری را تکمیل کنید.',
text: "",
type: "warning",
showCancelButton: true,
confirmButtonColor: "#DD6B55",
//confirmButtonText: "بستن",
cancelButtonText: "بستن",
closeOnConfirm: false,
customClass: "errorSwall"
});
});
$("#form1").css({
right: '3000px'
});
$("#form2").css({
left: '0px'
});
}
}
});
$(".pre").click(function() {
$(".next").css({
'background-color': "white",
'color': '#1763b1'
});
if ($('#form2').css('left') == '3000px') {
$(".pre").css({
'background-color': "#c7c0c0ba",
'color': '#000000b8',
'box-shadow': 'none'
});
} else if ($('#form2').css('left') == '0px') {
$("#progressBar").css({
'width': '50%',
'border-top-right-radius': '0px'
});
$(".pre").css({
'background-color': "#c7c0c0ba",
'color': '#000000b8',
'box-shadow': 'none'
});
$("#form2").css({
left: '3000px'
});
$("#form1").css({
right: '0px'
});
}
});
$("#save").click(function() {
$("#form1").find('.not-empty').each(function() {
if ($(this).val() === '') {
$(this).addClass('errored');
} else {
$(this).removeClass('errored');
}
});
const option1 = document.getElementById("party").options.selectedIndex;
if (option1 == 0) {
$("#divParty .select2-selection").addClass('errored');
} else {
$("#divParty .select2-selection").removeClass('errored');
}
if ($('#form1 .errored').length > 0 || $('#form1 input.patternMisMatch').length > 0) {
$('.sweet-alert').removeClass("successSwall");
$('.sweet-alert').removeClass("errorSwall");
swal({
title: 'لطفا موارد اجباری را تکمیل کنید.',
text: "",
type: "warning",
showCancelButton: true,
confirmButtonColor: "#DD6B55",
//confirmButtonText: "بستن",
cancelButtonText: "بستن",
closeOnConfirm: false,
customClass: "errorSwall"
});
} else {
$("#actualEmployer").submit();
}
})
//تنظیمات تاریخ
$(".persianDateInput").on('keyup', function () {
if (event.which !== 8 && event.which !== 46) {
let value = $(this).val();
let lengthValue = value.length;
if (lengthValue === 4) {
value += '/'
}
if (lengthValue === 7) {
value += '/'
}
$(this).val(value);
}
});
$(".persianDateInput").on("keydown", function (event) {
var keyCode = event.which || event.keyCode;
var isDigit = (keyCode >= 48 && keyCode <= 57) || (keyCode >= 96 && keyCode <= 105);
var isControlKey = (keyCode === 8) || (keyCode === 9) || (keyCode === 13) || (keyCode === 35) || (keyCode === 36) || (keyCode === 37) || (keyCode === 39) || (keyCode === 46);
if (!isDigit && !isControlKey) {
event.preventDefault();
}
});
$(".persianDateInput").on('blur', function () {
let value = $(this).val();
let lengthValue = value.length;
if (!dateValidCheck(this)) {
$(this).addClass("errored");
}
else {
$(this).removeClass("errored");
}
});
</script>
} else {
$("#actualEmployer").submit();
}
});
//تنظیمات تاریخ
$(".persianDateInput").on('keyup',
function() {
if (event.which !== 8 && event.which !== 46) {
let value = $(this).val();
const lengthValue = value.length;
if (lengthValue === 4) {
value += '/';
}
if (lengthValue === 7) {
value += '/';
}
$(this).val(value);
}
});
$(".persianDateInput").on("keydown",
function(event) {
const keyCode = event.which || event.keyCode;
const isDigit = (keyCode >= 48 && keyCode <= 57) || (keyCode >= 96 && keyCode <= 105);
const isControlKey = (keyCode === 8) || (keyCode === 9) || (keyCode === 13) || (keyCode === 35) || (keyCode === 36) || (keyCode === 37) || (keyCode === 39) || (keyCode === 46);
if (!isDigit && !isControlKey) {
event.preventDefault();
}
});
$(".persianDateInput").on('blur',
function() {
const value = $(this).val();
const lengthValue = value.length;
if (!dateValidCheck(this)) {
$(this).addClass("errored");
} else {
$(this).removeClass("errored");
}
});
</script>

File diff suppressed because it is too large Load Diff

View File

@@ -1,8 +1,5 @@
using System.Collections.Generic;
using System.Linq;
using _0_Framework.Application;
using _0_Framework.Application;
using Company.Domain.ContarctingPartyAgg;
using Company.Domain.empolyerAgg;
using CompanyManagment.App.Contracts.Employer;
using CompanyManagment.App.Contracts.PersonalContractingParty;
using CompanyManagment.App.Contracts.Workshop;
@@ -11,254 +8,270 @@ using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
using Microsoft.AspNetCore.Mvc.Rendering;
namespace ServiceHost.Areas.Admin.Pages.Company.Employers
namespace ServiceHost.Areas.Admin.Pages.Company.Employers;
[Authorize]
public class IndexModel : PageModel
{
[Authorize]
public class IndexModel : PageModel
{
[TempData]
public string Message { get; set; }
public EmployerSearchModel SearchModel;
public List<EmployerViewModel> Employers;
private readonly IEmployerApplication _employerApplication;
private readonly IPersonalContractingPartyApp _personalContractingPartyApp;
private readonly IPersonalContractingPartyRepository _personalContractingPartyRepository2;
private readonly IWorkshopApplication _workshopApplication;
public SelectList ContactingParties;
public string ContactingPartyName;
public string Nationalcode;
public string IdNumber;
public string LName;
private readonly IEmployerApplication _employerApplication;
private readonly IWorkshopApplication _workshopApplication;
private readonly IPersonalContractingPartyApp _personalContractingPartyApp;
private readonly IPersonalContractingPartyRepository _personalContractingPartyRepository2;
public SelectList ContactingParties;
public string ContactingPartyName;
public List<EmployerViewModel> Employers;
public string IdNumber;
public string LName;
public string Nationalcode;
public EmployerSearchModel SearchModel;
public IndexModel(IEmployerApplication employerApplication, IPersonalContractingPartyApp personalContractingPartyApp, IPersonalContractingPartyRepository personalContractingPartyRepository, IWorkshopApplication workshopApplication)
{
public IndexModel(IEmployerApplication employerApplication,
IPersonalContractingPartyApp personalContractingPartyApp,
IPersonalContractingPartyRepository personalContractingPartyRepository,
IWorkshopApplication workshopApplication)
{
_employerApplication = employerApplication;
_personalContractingPartyApp = personalContractingPartyApp;
_personalContractingPartyRepository2 = personalContractingPartyRepository;
_workshopApplication = workshopApplication;
}
_employerApplication = employerApplication;
_personalContractingPartyApp = personalContractingPartyApp;
_personalContractingPartyRepository2 = personalContractingPartyRepository;
_workshopApplication = workshopApplication;
}
[TempData] public string Message { get; set; }
public void OnGet(EmployerSearchModel searchModel)
{
ContactingParties =new SelectList(_personalContractingPartyApp.GetPersonalContractingParties(), "id", "LName");
Employers = _employerApplication.Search(searchModel).OrderByDescending(x => x.HasBlockContractingParty==true).ThenByDescending(x=>x.HasContractingParty).ToList();
public void OnGet(EmployerSearchModel searchModel)
{
ContactingParties = new SelectList(_personalContractingPartyApp.GetPersonalContractingParties(), "id", "LName");
Employers = _employerApplication.Search(searchModel).OrderByDescending(x => x.HasBlockContractingParty)
.ThenByDescending(x => x.HasContractingParty).ToList();
//-----FName or LName-----
//-----FName or LName-----
if (searchModel.Id > 0)
{
var employer = Employers.FirstOrDefault(x => x.Id == searchModel.Id);
if (employer != null)
LName = (employer.IsLegal == "حقیقی" ? (employer.FName + " " + employer.LName) : employer.LName);
}
else
{
LName = searchModel.EmployerLName;
}
if (searchModel.Id > 0)
{
var employer = Employers.FirstOrDefault(x => x.Id == searchModel.Id);
if (employer != null)
LName = employer.IsLegal == "حقیقی" ? employer.FName + " " + employer.LName : employer.LName;
}
else
{
LName = searchModel.EmployerLName;
}
//-----RegisterId or IdNumber-----
if (!string.IsNullOrEmpty(searchModel.IdNumber))
{
IdNumber = searchModel.IdNumber;
}
//-----RegisterId or IdNumber-----
if (!string.IsNullOrEmpty(searchModel.IdNumber)) IdNumber = searchModel.IdNumber;
//-----Nationalcode or NationalId-----
if (!string.IsNullOrEmpty(searchModel.Nationalcode) )
{
Nationalcode = searchModel.Nationalcode;
}
//-----Nationalcode or NationalId-----
if (!string.IsNullOrEmpty(searchModel.Nationalcode)) Nationalcode = searchModel.Nationalcode;
//-----ContractingParty-----
if (searchModel.ContractingPartyID > 0)
{
var representative = _personalContractingPartyApp.GetDetails(searchModel.ContractingPartyID);
ContactingPartyName = representative.FullName;
}
else
{
ContactingPartyName = searchModel.ContactingPartyName;
}
}
//-----ContractingParty-----
if (searchModel.ContractingPartyID > 0)
{
var representative = _personalContractingPartyApp.GetDetails(searchModel.ContractingPartyID);
ContactingPartyName = representative.FullName;
}
else
{
ContactingPartyName = searchModel.ContactingPartyName;
}
}
public IActionResult OnGetCreate()
{
var command = new CreateEmployer
{
ContractingParties = _personalContractingPartyApp.GetPersonalContractingParties()
};
return Partial("./Create", command);
}
public IActionResult OnGetCreate()
{
var command = new CreateEmployer
{
ContractingParties = _personalContractingPartyApp.GetPersonalContractingParties()
};
public IActionResult OnGetInsertLegal()
{
var command = new CreateEmployer
{
ContractingParties = _personalContractingPartyApp.GetPersonalContractingParties()
};
return Partial("./InsertLegal", command);
}
public IActionResult OnPostCreate(CreateEmployer command)
{
//var personalContractingParty = _personalContractingPartyRepository2.Get(command.ContractingPartyId);
//personalContractingParty.Edit2( "test");
command.IdNumber = !string.IsNullOrWhiteSpace(command.IdNumber) ? command.IdNumber.ConvertToEnglish() : "";
command.Nationalcode = !string.IsNullOrWhiteSpace(command.Nationalcode) ? command.Nationalcode.ConvertToEnglish() : "";
command.Phone = !string.IsNullOrWhiteSpace(command.Phone) ? command.Phone.ConvertToEnglish() : "";
command.AgentPhone = !string.IsNullOrWhiteSpace(command.AgentPhone) ? command.AgentPhone.ConvertToEnglish() : "";
var result = _employerApplication.Create(command);
return new JsonResult(result);
}
return Partial("./Create", command);
}
public IActionResult OnGetInsertLegal()
{
var command = new CreateEmployer
{
ContractingParties = _personalContractingPartyApp.GetPersonalContractingParties()
};
return Partial("./InsertLegal", command);
}
public IActionResult OnPostCreate(CreateEmployer command)
{
//var personalContractingParty = _personalContractingPartyRepository2.Get(command.ContractingPartyId);
//personalContractingParty.Edit2( "test");
command.IdNumber = !string.IsNullOrWhiteSpace(command.IdNumber) ? command.IdNumber.ConvertToEnglish() : "";
command.Nationalcode = !string.IsNullOrWhiteSpace(command.Nationalcode)
? command.Nationalcode.ConvertToEnglish()
: "";
command.Phone = !string.IsNullOrWhiteSpace(command.Phone) ? command.Phone.ConvertToEnglish() : "";
command.AgentPhone =
!string.IsNullOrWhiteSpace(command.AgentPhone) ? command.AgentPhone.ConvertToEnglish() : "";
var result = _employerApplication.Create(command);
return new JsonResult(result);
}
public IActionResult OnPostInsertLegal(CreateEmployer command)
{
command.RegisterId = !string.IsNullOrWhiteSpace(command.RegisterId) ? command.RegisterId.ConvertToEnglish() : "";
command.NationalId = !string.IsNullOrWhiteSpace(command.NationalId) ? command.NationalId.ConvertToEnglish() : "";
command.Phone = !string.IsNullOrWhiteSpace(command.Phone) ? command.Phone.ConvertToEnglish() : "";
command.AgentPhone = !string.IsNullOrWhiteSpace(command.AgentPhone) ? command.AgentPhone.ConvertToEnglish() : "";
var result2 = _employerApplication.CreateLegals(command);
return new JsonResult(result2);
}
public IActionResult OnPostInsertLegal(CreateEmployer command)
{
command.RegisterId =
!string.IsNullOrWhiteSpace(command.RegisterId) ? command.RegisterId.ConvertToEnglish() : "";
command.NationalId =
!string.IsNullOrWhiteSpace(command.NationalId) ? command.NationalId.ConvertToEnglish() : "";
command.Phone = !string.IsNullOrWhiteSpace(command.Phone) ? command.Phone.ConvertToEnglish() : "";
command.AgentPhone =
!string.IsNullOrWhiteSpace(command.AgentPhone) ? command.AgentPhone.ConvertToEnglish() : "";
var result2 = _employerApplication.CreateLegals(command);
return new JsonResult(result2);
}
public IActionResult OnGetEdit(long id)
{
var employer = _employerApplication.GetDetails(id);
employer.ContractingParties = _personalContractingPartyApp.GetPersonalContractingParties();
var ids=new List<long>(){id};
employer.HasWorkshop = _workshopApplication.GetWorkshopsByEmployerId(ids).Count()>0?true:false;
return Partial("Edit", employer);
}
public IActionResult OnGetEdit(long id)
{
var employer = _employerApplication.GetDetails(id);
employer.ContractingParties = _personalContractingPartyApp.GetPersonalContractingParties();
var ids = new List<long> { id };
employer.HasWorkshop = _workshopApplication.GetWorkshopsByEmployerId(ids).Count() > 0 ? true : false;
return Partial("Edit", employer);
}
public IActionResult OnGetLegalEdit(long id)
{
var employerlegaly = _employerApplication.GetDetails(id);
employerlegaly.ContractingParties = _personalContractingPartyApp.GetPersonalContractingParties();
var ids = new List<long>() { id };
employerlegaly.HasWorkshop = _workshopApplication.GetWorkshopsByEmployerId(ids).Count() > 0 ? true : false;
return Partial("LegalEdit", employerlegaly);
}
public IActionResult OnGetLegalEdit(long id)
{
var employerlegaly = _employerApplication.GetDetails(id);
employerlegaly.ContractingParties = _personalContractingPartyApp.GetPersonalContractingParties();
var ids = new List<long> { id };
employerlegaly.HasWorkshop = _workshopApplication.GetWorkshopsByEmployerId(ids).Count() > 0 ? true : false;
return Partial("LegalEdit", employerlegaly);
}
public JsonResult OnPostEdit(EditEmployer command)
{
if (ModelState.IsValid)
{
}
command.IdNumber = !string.IsNullOrWhiteSpace(command.IdNumber) ? command.IdNumber.ConvertToEnglish() : "";
command.Nationalcode = !string.IsNullOrWhiteSpace(command.Nationalcode) ? command.Nationalcode.ConvertToEnglish() : "";
command.Phone = !string.IsNullOrWhiteSpace(command.Phone) ? command.Phone.ConvertToEnglish() : "";
command.AgentPhone = !string.IsNullOrWhiteSpace(command.AgentPhone) ? command.AgentPhone.ConvertToEnglish() : "";
public JsonResult OnPostEdit(EditEmployer command)
{
if (ModelState.IsValid)
{
}
var result = _employerApplication.Edit(command);
return new JsonResult(result);
}
public JsonResult OnPostLegalEdit(EditEmployer command)
{
command.IdNumber = !string.IsNullOrWhiteSpace(command.IdNumber) ? command.IdNumber.ConvertToEnglish() : "";
command.Nationalcode = !string.IsNullOrWhiteSpace(command.Nationalcode)
? command.Nationalcode.ConvertToEnglish()
: "";
command.Phone = !string.IsNullOrWhiteSpace(command.Phone) ? command.Phone.ConvertToEnglish() : "";
command.AgentPhone =
!string.IsNullOrWhiteSpace(command.AgentPhone) ? command.AgentPhone.ConvertToEnglish() : "";
if (ModelState.IsValid)
{
}
var result = _employerApplication.Edit(command);
return new JsonResult(result);
}
command.RegisterId = !string.IsNullOrWhiteSpace(command.RegisterId) ? command.RegisterId.ConvertToEnglish() : "";
command.NationalId = !string.IsNullOrWhiteSpace(command.NationalId) ? command.NationalId.ConvertToEnglish() : "";
command.Phone = !string.IsNullOrWhiteSpace(command.Phone) ? command.Phone.ConvertToEnglish() : "";
command.AgentPhone = !string.IsNullOrWhiteSpace(command.AgentPhone) ? command.AgentPhone.ConvertToEnglish() : "";
var result = _employerApplication.EditLegal(command);
return new JsonResult(result);
}
public IActionResult OnGetDetails(long id)
{
var emp = _employerApplication.GetDetails(id);
emp.ContractingParties = _personalContractingPartyApp.GetPersonalContractingParties();
return Partial("Details", emp);
}
public IActionResult OnGetLegalDetails(long id)
{
var legaldetails = _employerApplication.GetDetails(id);
legaldetails.ContractingParties = _personalContractingPartyApp.GetPersonalContractingParties();
return Partial("LegalDetails", legaldetails);
}
public JsonResult OnPostLegalEdit(EditEmployer command)
{
if (ModelState.IsValid)
{
}
public IActionResult OnGetDeActive(long id)
{
var result = _employerApplication.DeActive(id);
if (result.IsSuccedded)
return RedirectToPage("./Index");
Message = result.Message;
return RedirectToPage("./Index");
}
command.RegisterId =
!string.IsNullOrWhiteSpace(command.RegisterId) ? command.RegisterId.ConvertToEnglish() : "";
command.NationalId =
!string.IsNullOrWhiteSpace(command.NationalId) ? command.NationalId.ConvertToEnglish() : "";
command.Phone = !string.IsNullOrWhiteSpace(command.Phone) ? command.Phone.ConvertToEnglish() : "";
command.AgentPhone =
!string.IsNullOrWhiteSpace(command.AgentPhone) ? command.AgentPhone.ConvertToEnglish() : "";
var result = _employerApplication.EditLegal(command);
return new JsonResult(result);
}
public IActionResult OnGetIsActive(long id)
{
var result = _employerApplication.Active(id);
if (result.IsSuccedded)
return RedirectToPage("./Index");
Message = result.Message;
return RedirectToPage("./Index");
}
public IActionResult OnGetDetails(long id)
{
var emp = _employerApplication.GetDetails(id);
emp.ContractingParties = _personalContractingPartyApp.GetPersonalContractingParties();
return Partial("Details", emp);
}
public IActionResult OnGetLegalDetails(long id)
{
var legaldetails = _employerApplication.GetDetails(id);
legaldetails.ContractingParties = _personalContractingPartyApp.GetPersonalContractingParties();
return Partial("LegalDetails", legaldetails);
}
public IActionResult OnGetDeActive(long id)
{
var result = _employerApplication.DeActive(id);
if (result.IsSuccedded)
return RedirectToPage("./Index");
Message = result.Message;
return RedirectToPage("./Index");
}
public IActionResult OnGetIsActive(long id)
{
var result = _employerApplication.Active(id);
if (result.IsSuccedded)
return RedirectToPage("./Index");
Message = result.Message;
return RedirectToPage("./Index");
}
#region NewByHeydari
public IActionResult OnPostDeleteEmployer(long id)
{
var result = _employerApplication.DeleteEmployer(id);
return new JsonResult(result);
}
public IActionResult OnPostActiveEmployer(long id)
{
var result = _employerApplication.ActiveAll(id);
return new JsonResult(result);
}
public IActionResult OnGetContractPartyList(string searchText)
{
var res = _personalContractingPartyApp.GetPersonalContractingParties();
var result = res.Where(x => x.LName.Contains(searchText)).Take(200).ToList();
result = result.OrderBy(x => x.LName.Length).ToList();
#region NewByHeydari
return new JsonResult(new
{
IsSuccedded = true,
mylist = result,
});
}
public IActionResult OnPostDeleteEmployer(long id)
{
var result = _employerApplication.DeleteEmployer(id);
return new JsonResult(result);
}
public IActionResult OnGetEmployerNationalcode(string searchText)
{
var result = _employerApplication.GetEmployerWithNationalcodeOrNationalId(searchText);
result = result.OrderBy(x => x.Nationalcode.Length).ToList();
return new JsonResult(new
{
IsSuccedded = true,
mylist = result,
});
}
public IActionResult OnGetEmployerIdNumber(string searchText)
{
var result = _employerApplication.GetEmployerWithIdNumberOrRegisterId(searchText);
result = result.OrderBy(x => x.IdNumber.Length).ToList();
return new JsonResult(new
{
IsSuccedded = true,
mylist = result,
});
}
public IActionResult OnGetEmployerName(string searchText)
{
var result = _employerApplication.GetEmployerWithFNameOrLName(searchText);
result = result.OrderBy(x => x.LName.Length).ToList();
return new JsonResult(new
{
IsSuccedded = true,
mylist = result,
});
}
#endregion
}
}
public IActionResult OnPostActiveEmployer(long id)
{
var result = _employerApplication.ActiveAll(id);
return new JsonResult(result);
}
public IActionResult OnGetContractPartyList(string searchText)
{
var res = _personalContractingPartyApp.GetPersonalContractingParties();
var result = res.Where(x => x.LName.Contains(searchText)).Take(200).ToList();
result = result.OrderBy(x => x.LName.Length).ToList();
return new JsonResult(new
{
IsSuccedded = true,
mylist = result
});
}
public IActionResult OnGetEmployerNationalcode(string searchText)
{
var result = _employerApplication.GetEmployerWithNationalcodeOrNationalId(searchText);
result = result.OrderBy(x => x.Nationalcode.Length).ToList();
return new JsonResult(new
{
IsSuccedded = true,
mylist = result
});
}
public IActionResult OnGetEmployerIdNumber(string searchText)
{
var result = _employerApplication.GetEmployerWithIdNumberOrRegisterId(searchText);
result = result.OrderBy(x => x.IdNumber.Length).ToList();
return new JsonResult(new
{
IsSuccedded = true,
mylist = result
});
}
public IActionResult OnGetEmployerName(string searchText)
{
var result = _employerApplication.GetEmployerWithFNameOrLName(searchText);
result = result.OrderBy(x => x.LName.Length).ToList();
return new JsonResult(new
{
IsSuccedded = true,
mylist = result
});
}
#endregion
}

View File

@@ -4,470 +4,474 @@
<link href="@Href("~/admintheme/css/legalEmployer.css")" rel="stylesheet"/>
<div class="container" id="createLegal">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<div class="main-title">مشخصات کارفرمای حقوقی</div>
<form asp-page="./Index" asp-page-handler="InsertLegal" autocomplete="off" id="legalEmployer"
method="post"
data-ajax="true"
data-callback=""
data-action="Refresh"
enctype="multipart/form-data">
<div class="box">
<div class="steps col-md-12">
<div id="progressBar"></div>
<div class="step">مشخصات کارفرما</div>
<div class="step">مشخصات مدیر عامل</div>
<div class="step">اطلاعات سامانه ای</div>
</div>
<div class="form" id="form1">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<div class="main-title">مشخصات کارفرمای حقوقی</div>
<form asp-page="./Index" asp-page-handler="InsertLegal" autocomplete="off" id="legalEmployer"
method="post"
data-ajax="true"
data-callback=""
data-action="Refresh"
enctype="multipart/form-data">
<div class="box">
<div class="steps col-md-12">
<div id="progressBar"></div>
<div class="step">مشخصات کارفرما</div>
<div class="step">مشخصات مدیر عامل</div>
<div class="step">اطلاعات سامانه ای</div>
</div>
<div class="form" id="form1">
<div class="flexible-wrap w-100">
<div class="col-md-12 col-xs-6" id="divParty" dir="rtl" style="align-self: center;">
<label class="sr-only" asp-for="ContractingPartyId"></label>
<select class="form-control select-city" id="party" data-live-search="true" asp-for="ContractingPartyId" asp-items='new SelectList(Model.ContractingParties, "id", "LName")'>
<option value="">انتخاب طرف حساب</option>
</select>
@*<span asp-validation-for="ContractingPartyId" class="error"></span>*@
</div>
<div class="col-md-4 col-xs-6">
<div class="form-group">
<label asp-for="LName" class="control-label">نام شرکت</label>
<input type="text" class="form-control not-empty" asp-for="LName">
@*<span asp-validation-for="LName" class="error"></span>*@
</div>
</div>
<div class="col-md-4 col-xs-6">
<div class="form-group">
<label asp-for="NationalId" class="control-label"> شناسه ملی</label>
<input type="text" class="form-control" asp-for="NationalId" pattern="\d*" maxlength="11" />
<i class="fa fa-exclamation-circle error-icon"></i>
<p class="error-message">فقط عدد وارد شود.</p>
</div>
</div>
<div class="col-md-4 col-xs-6">
<div class="form-group">
<label asp-for="RegisterId" class="control-label">شماره ثبت </label>
<input type="text" class="form-control" asp-for="RegisterId" pattern="\d*"/>
<i class="fa fa-exclamation-circle error-icon"></i>
<p class="error-message">فقط عدد وارد شود.</p>
</div>
</div>
<div class="col-md-6 col-xs-6">
<div class="form-group">
<label asp-for="Phone" class="control-label"> شماره تلفن همراه </label>
<input type="text" class="form-control" asp-for="Phone" pattern="\d*" maxlength="10" />
<i class="fa fa-exclamation-circle error-icon"></i>
<p class="error-message">فقط عدد وارد شود.</p>
</div>
</div>
<div class="col-md-6 col-xs-6">
<div class="form-group">
<label asp-for="AgentPhone" class="control-label">شماره تلفن ثابت</label>
<input type="text" class="form-control" asp-for="AgentPhone" pattern="\d*" maxlength="10" />
<i class="fa fa-exclamation-circle error-icon"></i>
<p class="error-message">فقط عدد وارد شود.</p>
</div>
</div>
</div>
</div>
<div class="form" id="form2">
<div class="row d-flex">
<div class="col-md-6 col-xs-6 col-xs-6 right-one">
<div class="radio-box radio-box-gender">
<label class="radio-label">جنسیت </label>
<div class="radio-input radio-gender">
<label>
آقا<input type="radio" value="مرد" asp-for="Gender" name="Gender">
</label>
<label>
خانم<input type="radio" value="زن" asp-for="Gender" name="Gender">
</label>
</div>
</div>
</div>
<div class="col-md-6 col-xs-6 col-xs-6 left-one">
<div class="radio-box">
<label class="radio-label">ملیت </label>
<div class="radio-input nationality">
<label>
ایرانی<input type="radio" value="ایرانی" name="Nationality" asp-for="Nationality" checked="checked">
</label>
<label>
غیر ایرانی<input type="radio" value="غیر ایرانی" name="Nationality" asp-for="Nationality">
</label>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-6 col-xs-6">
<div class="form-group">
<label asp-for="FName" class="control-label">نام مدیرعامل</label>
<input type="text" class="form-control" asp-for="FName" pattern="[\u0600-\u06FF\s]*" />
<i class="fa fa-exclamation-circle error-icon"></i>
<p class="error-message">فقط حروف فارسی وارد شود.</p>
</div>
</div>
<div class="col-md-6 col-xs-6">
<div class="form-group">
<label asp-for="EmployerLName" class="control-label">نام خانوادگی مدیرعامل</label>
<input type="text" class="form-control" asp-for="EmployerLName" pattern="[\u0600-\u06FF\s]*" />
<i class="fa fa-exclamation-circle error-icon"></i>
<p class="error-message">فقط حروف فارسی وارد شود.</p>
</div>
</div>
</div>
<div class="row">
<div class="col-md-6 col-xs-6">
<div class="form-group">
<label asp-for="Nationalcode" class="control-label"> کد ملی مدیرعامل</label>
<input type="text" class="form-control" asp-for="Nationalcode" pattern="\d*" maxlength="10" />
<i class="fa fa-exclamation-circle error-icon"></i>
<p class="error-message">فقط عدد وارد شود.</p>
</div>
</div>
<div class="col-md-6 col-xs-6">
<div class="form-group">
<label asp-for="IdNumber" class="control-label"> شماره شناسنامه مدیرعامل</label>
<input type="text" class="form-control" asp-for="IdNumber" pattern="\d*" maxlength="10" />
<i class="fa fa-exclamation-circle error-icon"></i>
<p class="error-message">فقط عدد وارد شود.</p>
</div>
</div>
</div>
<div class="row">
<div class="col-md-6 col-xs-6">
<div class="form-group">
<label asp-for="DateOfBirth" class="control-label">تاریخ تولد</label>
<input class="form-control persianDateInput" asp-for="DateOfBirth" />
@*<span asp-validation-for="DateOfBirth" class="error"></span>*@
</div>
</div>
<div class="col-md-6 col-xs-6">
<div class="form-group">
<label asp-for="FatherName" class="control-label">نام پدر مدیرعامل </label>
<input type="text" class="form-control" asp-for="FatherName" pattern="[\u0600-\u06FF\s]*" />
<i class="fa fa-exclamation-circle error-icon"></i>
<p class="error-message">فقط حروف فارسی وارد شود.</p>
</div>
</div>
</div>
<div class="row">
<div class="col-md-6 col-xs-6">
<div class="form-group">
<label asp-for="DateOfIssue" class="control-label"> تاریخ صدور شناسنامه</label>
<input class="form-control persianDateInput" asp-for="DateOfIssue" />
@*<span asp-validation-for="DateOfIssue" class="error"></span>*@
</div>
</div>
<div class="col-md-6 col-xs-6">
<div class="form-group">
<label asp-for="PlaceOfIssue" class="control-label"> محل صدور شناسنامه</label>
<input type="text" class="form-control" asp-for="PlaceOfIssue" pattern="[\u0600-\u06FF\s]*" />
<i class="fa fa-exclamation-circle error-icon"></i>
<p class="error-message">فقط حروف فارسی وارد شود.</p>
</div>
</div>
</div>
</div>
<div class="row form" id="form3">
<div class="flexible-wrap" style="padding: 0 10px;">
<fieldset>
<legend> اداره کار </legend>
<div class="col-md-6 col-xs-6">
<div class="form-group">
<label asp-for="MclsUserName" class="control-label">نام کاربری</label>
<input style="background-color: #e0ffe0;" type="text" class="form-control" asp-for="MclsUserName">
</div>
</div>
<div class="col-md-6 col-xs-6">
<div class="form-group">
<label asp-for="MclsPassword" class="control-label">گذرواژه</label>
<input style="background-color: #e0ffe0;" type="text" class="form-control" asp-for="MclsPassword">
</div>
</div>
</fieldset>
<fieldset>
<legend> تامین اجتماعی</legend>
<div class="col-md-6 col-xs-6">
<div class="form-group">
<label asp-for="EserviceUserName" class="control-label" style="direction: ltr">نام کاربری </label>
<input style="background-color: #e0ffe0;" type="text" class="form-control" asp-for="EserviceUserName">
</div>
</div>
<div class="col-md-6 col-xs-6">
<div class="form-group">
<label asp-for="EservicePassword" class="control-label" style="direction: ltr"> گذرواژه</label>
<input style="background-color: #e0ffe0;" type="text" class="form-control" asp-for="EservicePassword">
</div>
</div>
</fieldset>
<fieldset>
<legend> قوه قضائیه </legend>
<div class="col-md-6 col-xs-6">
<div class="form-group">
<label asp-for="TaxOfficeUserName" class="control-label"> نام کاربری </label>
<input style="background-color: #e0ffe0;" type="text" class="form-control" asp-for="TaxOfficeUserName">
</div>
</div>
<div class="col-md-6 col-xs-6">
<div class="form-group">
<label asp-for="TaxOfficepassword" class="control-label"> گذرواژه </label>
<input style="background-color: #e0ffe0;" type="text" class="form-control" asp-for="TaxOfficepassword">
</div>
</div>
</fieldset>
<fieldset>
<legend> امور مالیاتی </legend>
<div class="col-md-6 col-xs-6">
<div class="form-group">
<label asp-for="SanaUserName" class="control-label"> نام کاربری </label>
<input style="background-color: #e0ffe0;" type="text" class="form-control" asp-for="SanaUserName">
</div>
</div>
<div class="col-md-6 col-xs-6">
<div class="form-group">
<label asp-for="SanaPassword" class="control-label"> گذرواژه </label>
<input style="background-color: #e0ffe0;" type="text" class="form-control" asp-for="SanaPassword">
</div>
</div>
</fieldset>
</div>
</div>
<div class="form-footer-btns">
<a class="btn btn-modal pre" onclick="prevButton($(this))">مرحله قبل</a>
<a class="btn btn-modal next" onclick="nextButton($(this))">مرحله بعد</a>
</div>
</div>
<div class="form-footer">
<a class="btn btn-rounded waves-effect waves-light bg-white" id="close" data-dismiss="modal">بستن</a>
<a class="btn btn-rounded waves-effect waves-light" id="save">ذخیره</a>
<a href="#" class="btn btn-success btn-rounded waves-effect waves-light" id="fakeSave" style="display: none;">ذخیره</a>
</div>
</form>
<div class="flexible-wrap w-100">
<div class="col-md-12 col-xs-6" id="divParty" dir="rtl" style="align-self: center;">
<label class="sr-only" asp-for="ContractingPartyId"></label>
<select class="form-control select-city" id="party" data-live-search="true" asp-for="ContractingPartyId" asp-items='new SelectList(Model.ContractingParties, "id", "LName")'>
<option value="">انتخاب طرف حساب</option>
</select>
@*<span asp-validation-for="ContractingPartyId" class="error"></span>*@
</div>
<div class="col-md-4 col-xs-6">
<div class="form-group">
<label asp-for="LName" class="control-label">نام شرکت</label>
<input type="text" class="form-control not-empty" asp-for="LName">
@*<span asp-validation-for="LName" class="error"></span>*@
</div>
</div>
<div class="col-md-4 col-xs-6">
<div class="form-group">
<label asp-for="NationalId" class="control-label"> شناسه ملی</label>
<input type="text" class="form-control" asp-for="NationalId" pattern="\d*" maxlength="11"/>
<i class="fa fa-exclamation-circle error-icon"></i>
<p class="error-message">فقط عدد وارد شود.</p>
</div>
</div>
<div class="col-md-4 col-xs-6">
<div class="form-group">
<label asp-for="RegisterId" class="control-label">شماره ثبت </label>
<input type="text" class="form-control" asp-for="RegisterId" pattern="\d*"/>
<i class="fa fa-exclamation-circle error-icon"></i>
<p class="error-message">فقط عدد وارد شود.</p>
</div>
</div>
<div class="col-md-6 col-xs-6">
<div class="form-group">
<label asp-for="Phone" class="control-label"> شماره تلفن همراه </label>
<input type="text" class="form-control" asp-for="Phone" pattern="\d*" maxlength="10"/>
<i class="fa fa-exclamation-circle error-icon"></i>
<p class="error-message">فقط عدد وارد شود.</p>
</div>
</div>
<div class="col-md-6 col-xs-6">
<div class="form-group">
<label asp-for="AgentPhone" class="control-label">شماره تلفن ثابت</label>
<input type="text" class="form-control" asp-for="AgentPhone" pattern="\d*" maxlength="10"/>
<i class="fa fa-exclamation-circle error-icon"></i>
<p class="error-message">فقط عدد وارد شود.</p>
</div>
</div>
</div>
</div>
<div class="form" id="form2">
<div class="row d-flex">
<div class="col-md-6 col-xs-6 col-xs-6 right-one">
<div class="radio-box radio-box-gender">
<label class="radio-label">جنسیت </label>
<div class="radio-input radio-gender">
<label>
آقا<input type="radio" value="مرد" asp-for="Gender" name="Gender">
</label>
<label>
خانم<input type="radio" value="زن" asp-for="Gender" name="Gender">
</label>
</div>
</div>
</div>
<div class="col-md-6 col-xs-6 col-xs-6 left-one">
<div class="radio-box">
<label class="radio-label">ملیت </label>
<div class="radio-input nationality">
<label>
ایرانی<input type="radio" value="ایرانی" name="Nationality" asp-for="Nationality" checked="checked">
</label>
<label>
غیر ایرانی<input type="radio" value="غیر ایرانی" name="Nationality" asp-for="Nationality">
</label>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-6 col-xs-6">
<div class="form-group">
<label asp-for="FName" class="control-label">نام مدیرعامل</label>
<input type="text" class="form-control" asp-for="FName" pattern="[\u0600-\u06FF\s]*"/>
<i class="fa fa-exclamation-circle error-icon"></i>
<p class="error-message">فقط حروف فارسی وارد شود.</p>
</div>
</div>
<div class="col-md-6 col-xs-6">
<div class="form-group">
<label asp-for="EmployerLName" class="control-label">نام خانوادگی مدیرعامل</label>
<input type="text" class="form-control" asp-for="EmployerLName" pattern="[\u0600-\u06FF\s]*"/>
<i class="fa fa-exclamation-circle error-icon"></i>
<p class="error-message">فقط حروف فارسی وارد شود.</p>
</div>
</div>
</div>
<div class="row">
<div class="col-md-6 col-xs-6">
<div class="form-group">
<label asp-for="Nationalcode" class="control-label"> کد ملی مدیرعامل</label>
<input type="text" class="form-control" asp-for="Nationalcode" pattern="\d*" maxlength="10"/>
<i class="fa fa-exclamation-circle error-icon"></i>
<p class="error-message">فقط عدد وارد شود.</p>
</div>
</div>
<div class="col-md-6 col-xs-6">
<div class="form-group">
<label asp-for="IdNumber" class="control-label"> شماره شناسنامه مدیرعامل</label>
<input type="text" class="form-control" asp-for="IdNumber" pattern="\d*" maxlength="10"/>
<i class="fa fa-exclamation-circle error-icon"></i>
<p class="error-message">فقط عدد وارد شود.</p>
</div>
</div>
</div>
<div class="row">
<div class="col-md-6 col-xs-6">
<div class="form-group">
<label asp-for="DateOfBirth" class="control-label">تاریخ تولد</label>
<input class="form-control persianDateInput" asp-for="DateOfBirth"/>
@*<span asp-validation-for="DateOfBirth" class="error"></span>*@
</div>
</div>
<div class="col-md-6 col-xs-6">
<div class="form-group">
<label asp-for="FatherName" class="control-label">نام پدر مدیرعامل </label>
<input type="text" class="form-control" asp-for="FatherName" pattern="[\u0600-\u06FF\s]*"/>
<i class="fa fa-exclamation-circle error-icon"></i>
<p class="error-message">فقط حروف فارسی وارد شود.</p>
</div>
</div>
</div>
<div class="row">
<div class="col-md-6 col-xs-6">
<div class="form-group">
<label asp-for="DateOfIssue" class="control-label"> تاریخ صدور شناسنامه</label>
<input class="form-control persianDateInput" asp-for="DateOfIssue"/>
@*<span asp-validation-for="DateOfIssue" class="error"></span>*@
</div>
</div>
<div class="col-md-6 col-xs-6">
<div class="form-group">
<label asp-for="PlaceOfIssue" class="control-label"> محل صدور شناسنامه</label>
<input type="text" class="form-control" asp-for="PlaceOfIssue" pattern="[\u0600-\u06FF\s]*"/>
<i class="fa fa-exclamation-circle error-icon"></i>
<p class="error-message">فقط حروف فارسی وارد شود.</p>
</div>
</div>
</div>
</div>
<div class="row form" id="form3">
<div class="flexible-wrap" style="padding: 0 10px;">
<fieldset>
<legend> اداره کار </legend>
<div class="col-md-6 col-xs-6">
<div class="form-group">
<label asp-for="MclsUserName" class="control-label">نام کاربری</label>
<input style="background-color: #e0ffe0;" type="text" class="form-control" asp-for="MclsUserName">
</div>
</div>
<div class="col-md-6 col-xs-6">
<div class="form-group">
<label asp-for="MclsPassword" class="control-label">گذرواژه</label>
<input style="background-color: #e0ffe0;" type="text" class="form-control" asp-for="MclsPassword">
</div>
</div>
</fieldset>
<fieldset>
<legend> تامین اجتماعی</legend>
<div class="col-md-6 col-xs-6">
<div class="form-group">
<label asp-for="EserviceUserName" class="control-label" style="direction: ltr">نام کاربری </label>
<input style="background-color: #e0ffe0;" type="text" class="form-control" asp-for="EserviceUserName">
</div>
</div>
<div class="col-md-6 col-xs-6">
<div class="form-group">
<label asp-for="EservicePassword" class="control-label" style="direction: ltr"> گذرواژه</label>
<input style="background-color: #e0ffe0;" type="text" class="form-control" asp-for="EservicePassword">
</div>
</div>
</fieldset>
<fieldset>
<legend> قوه قضائیه </legend>
<div class="col-md-6 col-xs-6">
<div class="form-group">
<label asp-for="TaxOfficeUserName" class="control-label"> نام کاربری </label>
<input style="background-color: #e0ffe0;" type="text" class="form-control" asp-for="TaxOfficeUserName">
</div>
</div>
<div class="col-md-6 col-xs-6">
<div class="form-group">
<label asp-for="TaxOfficepassword" class="control-label"> گذرواژه </label>
<input style="background-color: #e0ffe0;" type="text" class="form-control" asp-for="TaxOfficepassword">
</div>
</div>
</fieldset>
<fieldset>
<legend> امور مالیاتی </legend>
<div class="col-md-6 col-xs-6">
<div class="form-group">
<label asp-for="SanaUserName" class="control-label"> نام کاربری </label>
<input style="background-color: #e0ffe0;" type="text" class="form-control" asp-for="SanaUserName">
</div>
</div>
<div class="col-md-6 col-xs-6">
<div class="form-group">
<label asp-for="SanaPassword" class="control-label"> گذرواژه </label>
<input style="background-color: #e0ffe0;" type="text" class="form-control" asp-for="SanaPassword">
</div>
</div>
</fieldset>
</div>
</div>
<div class="form-footer-btns">
<a class="btn btn-modal pre" onclick="prevButton($(this))">مرحله قبل</a>
<a class="btn btn-modal next" onclick="nextButton($(this))">مرحله بعد</a>
</div>
</div>
<div class="form-footer">
<a class="btn btn-rounded waves-effect waves-light bg-white" id="close" data-dismiss="modal">بستن</a>
<a class="btn btn-rounded waves-effect waves-light" id="save">ذخیره</a>
<a href="#" class="btn btn-success btn-rounded waves-effect waves-light" id="fakeSave" style="display: none;">ذخیره</a>
</div>
</form>
</div>
<script>
$(document).ready(function () {
$('.error-message').hide();
$('.error-icon').hide();
})
$('#MainModal').on('hidden.bs.modal', function () {
$(".datepicker-container").hide();
});
$('.form-control').on('keyup', function () {
const errorMessage = $(this).parent().find('.error-message');
const errorIcon = $(this).parent().find('.error-icon');
if (this.validity.patternMismatch) {
errorMessage.show();
errorIcon.show();
$(this).addClass('errored');
$(this).addClass('patternMisMatch');
$(document).ready(function() {
$('.error-message').hide();
$('.error-icon').hide();
});
$('#MainModal').on('hidden.bs.modal',
function() {
$(".datepicker-container").hide();
});
$('.form-control').on('keyup',
function() {
const errorMessage = $(this).parent().find('.error-message');
const errorIcon = $(this).parent().find('.error-icon');
if (this.validity.patternMismatch) {
errorMessage.show();
errorIcon.show();
$(this).addClass('errored');
$(this).addClass('patternMisMatch');
} else {
errorMessage.hide();
errorIcon.hide();
$(this).removeClass('errored');
$(this).removeClass('patternMisMatch');
}
});
} else {
errorMessage.hide();
errorIcon.hide();
$(this).removeClass('errored');
$(this).removeClass('patternMisMatch');
}
});
function nextButton(element) {
let nextBtn = element;
let prevBtn = $(".pre");
let form1 = $("#form1");
let form2 = $("#form2");
let form3 = $("#form3");
let progressBar = $("#progressBar");
$("#form1").find('.not-empty').each(function () {
if ($(this).val() === '') {
$(this).addClass('errored');
} else {
$(this).removeClass('errored');
}
});
var option1 = document.getElementById("party").options.selectedIndex;
if (option1 == 0) {
$("#divParty .select2-selection").addClass('errored');
} else {
$("#divParty .select2-selection").removeClass('errored');
}
if ($('#form1 .errored').length > 0 || $('#form1 input.patternMisMatch').length > 0) {
$('.sweet-alert').removeClass("successSwall");
$('.sweet-alert').removeClass("errorSwall");
swal({
title: 'لطفا موارد اجباری را تکمیل کنید.',
text: "",
type: "warning",
showCancelButton: true,
confirmButtonColor: "#DD6B55",
//confirmButtonText: "بستن",
cancelButtonText: "بستن",
closeOnConfirm: false,
customClass: "errorSwall"
});
function nextButton(element) {
const nextBtn = element;
const prevBtn = $(".pre");
const form1 = $("#form1");
const form2 = $("#form2");
const form3 = $("#form3");
const progressBar = $("#progressBar");
$("#form1").find('.not-empty').each(function() {
if ($(this).val() === '') {
$(this).addClass('errored');
} else {
$(this).removeClass('errored');
}
});
const option1 = document.getElementById("party").options.selectedIndex;
if (option1 == 0) {
$("#divParty .select2-selection").addClass('errored');
} else {
$("#divParty .select2-selection").removeClass('errored');
}
if ($('#form1 .errored').length > 0 || $('#form1 input.patternMisMatch').length > 0) {
$('.sweet-alert').removeClass("successSwall");
$('.sweet-alert').removeClass("errorSwall");
swal({
title: 'لطفا موارد اجباری را تکمیل کنید.',
text: "",
type: "warning",
showCancelButton: true,
confirmButtonColor: "#DD6B55",
//confirmButtonText: "بستن",
cancelButtonText: "بستن",
closeOnConfirm: false,
customClass: "errorSwall"
});
} else {
if (form3.css('right') == '10px') {
nextBtn.css({
'background-color': "#c7c0c0ba",
'color': '#000000b8',
'box-shadow': 'none'
})
}
else if (form2.css('left') == '3000px') {
prevBtn.css({
'background-color': "white",
'color': '#0f9500',
'box-shadow': '0 2px 5px 0 rgba(0, 0, 0, 0.16), 0 2px 10px 0 rgba(0, 0, 0, 0.12)'
})
progressBar.css({
'width': '66.66%'
})
form1.css({
right: '3000px'
})
form2.css({
left: '0px'
})
}
else if (form2.css('left') == '0px') {
nextBtn.css({
'background-color': "#c7c0c0ba",
'color': '#000000b8',
'box-shadow': 'none'
})
prevBtn.css({
'background-color': "white",
'color': '#0f9500',
'box-shadow': '0 2px 5px 0 rgba(0, 0, 0, 0.16), 0 2px 10px 0 rgba(0, 0, 0, 0.12)'
})
progressBar.css({
'width': '100%'
})
form2.css({
left: '3000px'
})
form3.css({
right: '10px'
})
}
}
}
function prevButton(element) {
let prevBtn = element;
let nextBtn = $(".next");
let form1 = $("#form1");
let form2 = $("#form2");
let form3 = $("#form3");
let progressBar = $("#progressBar");
nextBtn.css({
'background-color': "white",
'color': '#1763b1'
})
if (form2.css('left') == '3000px' && form3.css('right') == '3000px') {
prevBtn.css({
'background-color': "#c7c0c0ba",
'color': '#000000b8',
'box-shadow': 'none'
})
} else {
if (form3.css('right') == '10px') {
nextBtn.css({
'background-color': "#c7c0c0ba",
'color': '#000000b8',
'box-shadow': 'none'
});
} else if (form2.css('left') == '3000px') {
prevBtn.css({
'background-color': "white",
'color': '#0f9500',
'box-shadow': '0 2px 5px 0 rgba(0, 0, 0, 0.16), 0 2px 10px 0 rgba(0, 0, 0, 0.12)'
});
progressBar.css({
'width': '66.66%'
});
form1.css({
right: '3000px'
});
form2.css({
left: '0px'
});
} else if (form2.css('left') == '0px') {
nextBtn.css({
'background-color': "#c7c0c0ba",
'color': '#000000b8',
'box-shadow': 'none'
});
prevBtn.css({
'background-color': "white",
'color': '#0f9500',
'box-shadow': '0 2px 5px 0 rgba(0, 0, 0, 0.16), 0 2px 10px 0 rgba(0, 0, 0, 0.12)'
});
progressBar.css({
'width': '100%'
});
form2.css({
left: '3000px'
});
form3.css({
right: '10px'
});
}
}
}
} else if (form2.css('left') == '0px') {
progressBar.css({
'width': '33.33%'
})
prevBtn.css({
'background-color': "#c7c0c0ba",
'color': '#000000b8',
'box-shadow': 'none'
})
form2.css({
left: '3000px'
})
form1.css({
right: '0px'
})
} else if (form3.css('right') == '10px') {
progressBar.css({
'width': '66.66%'
})
prevBtn.css({
'background-color': "white",
'color': '#0f9500',
'box-shadow': '0 2px 5px 0 rgba(0, 0, 0, 0.16), 0 2px 10px 0 rgba(0, 0, 0, 0.12)'
})
form2.css({
left: '0px'
})
form3.css({
right: '3000px'
})
}
}
$("#save").click(function () {
$("#form1").find('.not-empty').each(function () {
if ($(this).val() === '') {
$(this).addClass('errored');
} else {
$(this).removeClass('errored');
}
});
var option1 = document.getElementById("party").options.selectedIndex;
if (option1 == 0) {
$("#divParty .select2-selection").addClass('errored');
} else {
$("#divParty .select2-selection").removeClass('errored');
}
if ($('#form1 .errored').length > 0 || $('#form1 input.patternMisMatch').length > 0) {
$('.sweet-alert').removeClass("successSwall");
$('.sweet-alert').removeClass("errorSwall");
swal({
title: 'لطفا موارد اجباری را تکمیل کنید.',
text: "",
type: "warning",
showCancelButton: true,
confirmButtonColor: "#DD6B55",
//confirmButtonText: "بستن",
cancelButtonText: "بستن",
closeOnConfirm: false,
customClass: "errorSwall"
});
function prevButton(element) {
const prevBtn = element;
const nextBtn = $(".next");
const form1 = $("#form1");
const form2 = $("#form2");
const form3 = $("#form3");
const progressBar = $("#progressBar");
nextBtn.css({
'background-color': "white",
'color': '#1763b1'
});
if (form2.css('left') == '3000px' && form3.css('right') == '3000px') {
prevBtn.css({
'background-color': "#c7c0c0ba",
'color': '#000000b8',
'box-shadow': 'none'
});
} else {
$("#legalEmployer").submit();
}
})
//تنظیمات تاریخ
$(".persianDateInput").on('keyup', function () {
if (event.which !== 8 && event.which !== 46) {
let value = $(this).val();
let lengthValue = value.length;
if (lengthValue === 4) {
value += '/'
}
if (lengthValue === 7) {
value += '/'
}
$(this).val(value);
}
});
$(".persianDateInput").on("keydown", function (event) {
var keyCode = event.which || event.keyCode;
var isDigit = (keyCode >= 48 && keyCode <= 57) || (keyCode >= 96 && keyCode <= 105);
var isControlKey = (keyCode === 8) || (keyCode === 9) || (keyCode === 13) || (keyCode === 35) || (keyCode === 36) || (keyCode === 37) || (keyCode === 39) || (keyCode === 46);
if (!isDigit && !isControlKey) {
event.preventDefault();
}
});
$(".persianDateInput").on('blur', function () {
let value = $(this).val();
let lengthValue = value.length;
if (!dateValidCheck(this)) {
$(this).addClass("errored");
}
else {
$(this).removeClass("errored");
}
});
} else if (form2.css('left') == '0px') {
progressBar.css({
'width': '33.33%'
});
prevBtn.css({
'background-color': "#c7c0c0ba",
'color': '#000000b8',
'box-shadow': 'none'
});
form2.css({
left: '3000px'
});
form1.css({
right: '0px'
});
} else if (form3.css('right') == '10px') {
progressBar.css({
'width': '66.66%'
});
prevBtn.css({
'background-color': "white",
'color': '#0f9500',
'box-shadow': '0 2px 5px 0 rgba(0, 0, 0, 0.16), 0 2px 10px 0 rgba(0, 0, 0, 0.12)'
});
form2.css({
left: '0px'
});
form3.css({
right: '3000px'
});
}
}
$("#save").click(function() {
$("#form1").find('.not-empty').each(function() {
if ($(this).val() === '') {
$(this).addClass('errored');
} else {
$(this).removeClass('errored');
}
});
const option1 = document.getElementById("party").options.selectedIndex;
if (option1 == 0) {
$("#divParty .select2-selection").addClass('errored');
} else {
$("#divParty .select2-selection").removeClass('errored');
}
if ($('#form1 .errored').length > 0 || $('#form1 input.patternMisMatch').length > 0) {
$('.sweet-alert').removeClass("successSwall");
$('.sweet-alert').removeClass("errorSwall");
swal({
title: 'لطفا موارد اجباری را تکمیل کنید.',
text: "",
type: "warning",
showCancelButton: true,
confirmButtonColor: "#DD6B55",
//confirmButtonText: "بستن",
cancelButtonText: "بستن",
closeOnConfirm: false,
customClass: "errorSwall"
});
} else {
$("#legalEmployer").submit();
}
});
//تنظیمات تاریخ
$(".persianDateInput").on('keyup',
function() {
if (event.which !== 8 && event.which !== 46) {
let value = $(this).val();
const lengthValue = value.length;
if (lengthValue === 4) {
value += '/';
}
if (lengthValue === 7) {
value += '/';
}
$(this).val(value);
}
});
$(".persianDateInput").on("keydown",
function(event) {
const keyCode = event.which || event.keyCode;
const isDigit = (keyCode >= 48 && keyCode <= 57) || (keyCode >= 96 && keyCode <= 105);
const isControlKey = (keyCode === 8) || (keyCode === 9) || (keyCode === 13) || (keyCode === 35) || (keyCode === 36) || (keyCode === 37) || (keyCode === 39) || (keyCode === 46);
if (!isDigit && !isControlKey) {
event.preventDefault();
}
});
$(".persianDateInput").on('blur',
function() {
const value = $(this).val();
const lengthValue = value.length;
if (!dateValidCheck(this)) {
$(this).addClass("errored");
} else {
$(this).removeClass("errored");
}
});
</script>

View File

@@ -1,7 +1,6 @@
@using _0_Framework.Application
@model CompanyManagment.App.Contracts.Employer.EditEmployer
@model CompanyManagment.App.Contracts.Employer.EditEmployer
@{
<style>
<style>
#thh table {
width: 100%;
@@ -136,232 +135,234 @@
</style>
}
<div id="LegalDetails">
<div class="modal-header" style="border-bottom: unset">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
</div>
<div class="modal-header" style="border-bottom: unset">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
</div>
<form asp-page="./Index" asp-page-handler="LegalDetails"
method="post"
data-ajax="true"
data-callback=""
data-action="Refresh"
enctype="multipart/form-data">
<div class="modal-body">
<div class="row">
<fieldset style="border: 1px solid #999797; border-radius: 10px; padding: revert;">
<legend style="margin-bottom: 5px; font-size: 14px; border-bottom: 0px; color: #505458; width: 50%; text-align: center;"> اطلاعات کارفرمای حقوقی</legend>
<table id="thh" style="height: 150px; width: 100%">
<tr>
<th>فیلد</th>
<th>اطلاعات</th>
<form asp-page="./Index" asp-page-handler="LegalDetails"
method="post"
data-ajax="true"
data-callback=""
data-action="Refresh"
enctype="multipart/form-data">
<div class="modal-body">
<div class="row">
<fieldset style="border: 1px solid #999797; border-radius: 10px; padding: revert;">
<legend style="margin-bottom: 5px; font-size: 14px; border-bottom: 0px; color: #505458; width: 50%; text-align: center;"> اطلاعات کارفرمای حقوقی</legend>
<table id="thh" style="height: 150px; width: 100%">
<tr>
<th>فیلد</th>
<th>اطلاعات</th>
</tr>
</tr>
<tr>
<td> نام شرکت </td>
<td> @Model.LName</td>
<tr>
<td> نام شرکت </td>
<td> @Model.LName</td>
</tr>
</tr>
<tr>
<td> شناسه ملی </td>
<td> @Model.NationalId</td>
<tr>
<td> شناسه ملی </td>
<td> @Model.NationalId</td>
</tr>
</tr>
<tr>
<td> شماره ثبت </td>
<td> @Model.RegisterId</td>
<tr>
<td> شماره ثبت </td>
<td> @Model.RegisterId</td>
</tr>
</tr>
<tr>
<td> شماره تلفن همراه </td>
<td> @Model.Phone</td>
<tr>
<td> شماره تلفن همراه </td>
<td> @Model.Phone</td>
</tr>
</tr>
<tr>
<td> شماره تلفن ثابت </td>
<td> @Model.AgentPhone</td>
<tr>
<td> شماره تلفن ثابت </td>
<td> @Model.AgentPhone</td>
</tr>
</tr>
<tr>
<td> کد کارفرما </td>
<td> @Model.EmployerNo </td>
<tr>
<td> کد کارفرما </td>
<td> @Model.EmployerNo </td>
</tr>
</tr>
<tr>
<td>
طرف حساب
<tr>
<td>
طرف حساب
</td>
<td>
@foreach (var n in @Model.ContractingParties)
{
if (@Model.ContractingPartyId == n.id)
{
<span>@n.FName</span><span>@n.LName</span>
}
}
</td>
<td>
</td>
@foreach (var n in Model.ContractingParties)
{
if (Model.ContractingPartyId == n.id)
{
<span>@n.FName</span>
<span>@n.LName</span>
}
}
</td>
</tr>
</tr>
</table>
</fieldset>
</div>
<div class="row">
<fieldset style="border: 1px solid #999797; border-radius: 10px; padding: revert;">
<legend style="margin-bottom: 5px; font-size: 14px; border-bottom: 0px; color: #505458; width: 50%; text-align: center;"> اطلاعات مربوط به مدیرعامل</legend>
</table>
</fieldset>
</div>
<table id="thh3" style="height: 150px; width: 100%">
<tr>
<th>فیلد</th>
<th>اطلاعات</th>
<div class="row">
<fieldset style="border: 1px solid #999797; border-radius: 10px; padding: revert;">
<legend style="margin-bottom: 5px; font-size: 14px; border-bottom: 0px; color: #505458; width: 50%; text-align: center;"> اطلاعات مربوط به مدیرعامل</legend>
</tr>
<table id="thh3" style="height: 150px; width: 100%">
<tr>
<th>فیلد</th>
<th>اطلاعات</th>
<tr>
<td> نام و نام خانوادگی مدیر عامل</td>
<td> @Model.FName @Model.EmployerLName</td>
</tr>
</tr>
<tr>
<td> نام و نام خانوادگی مدیر عامل</td>
<td> @Model.FName @Model.EmployerLName</td>
<tr>
<td> جنسیت </td>
<td> @Model.Gender</td>
</tr>
</tr>
<tr>
<td> جنسیت </td>
<td> @Model.Gender</td>
<tr>
<td> ملیت </td>
<td> @Model.Nationality</td>
</tr>
</tr>
<tr>
<td> ملیت </td>
<td> @Model.Nationality</td>
<tr>
<td>نام پدر</td>
<td> @Model.FatherName</td>
</tr>
</tr>
<tr>
<td>نام پدر</td>
<td> @Model.FatherName</td>
<tr>
<td>کد ملی</td>
<td> @Model.Nationalcode</td>
</tr>
</tr>
<tr>
<td>کد ملی</td>
<td> @Model.Nationalcode</td>
<tr>
<td> شماره شناسنامه </td>
<td> @Model.IdNumber </td>
</tr>
</tr>
<tr>
<td> شماره شناسنامه </td>
<td> @Model.IdNumber </td>
<tr>
<td> محل صدور شناسنامه </td>
<td> @Model.PlaceOfIssue</td>
</tr>
</tr>
<tr>
<td> تاریخ تولد </td>
<td> @Model.DateOfBirth </td>
<tr>
<td> محل صدور شناسنامه </td>
<td> @Model.PlaceOfIssue</td>
</tr>
</tr>
<tr>
<td> تاریخ تولد </td>
<td> @Model.DateOfBirth </td>
<tr>
<td> تاریخ صدور شناسنامه </td>
<td> @Model.DateOfIssue</td>
</tr>
</tr>
</table>
</fieldset>
</div>
<div class="row">
<fieldset style="border: 1px solid #999797; border-radius: 10px; padding: revert;">
<legend style="margin-bottom: 5px; font-size: 14px; border-bottom: 0px; color: #505458; width: 50%; text-align: center;"> اطلاعات سامانه های دولتی</legend>
<tr>
<td> تاریخ صدور شناسنامه </td>
<td> @Model.DateOfIssue</td>
<table id="thh2" style="height: 150px; width: 100%">
</tr>
</table>
</fieldset>
</div>
<div class="row">
<fieldset style="border: 1px solid #999797; border-radius: 10px; padding: revert;">
<legend style="margin-bottom: 5px; font-size: 14px; border-bottom: 0px; color: #505458; width: 50%; text-align: center;"> اطلاعات سامانه های دولتی</legend>
<table id="thh2" style="height: 150px; width: 100%">
<tr>
<th> نام کاربری اداره کار </th>
<th> رمز عبور اداره کار </th>
</tr>
<tr>
<td> @Model.MclsUserName </td>
<td>
<i class="md-vpn-key"></i> @Model.MclsPassword
</td>
</tr>
<tr>
<th> نام کاربری اداره کار </th>
<th> رمز عبور اداره کار </th>
</tr>
<tr>
<th dir="ltr"> E Service نام کاربری </th>
<th dir="ltr"> E Service رمز عبور </th>
<tr>
</tr>
<td> @Model.MclsUserName </td>
<td> <i class="md-vpn-key"></i> @Model.MclsPassword </td>
</tr>
<tr>
<tr>
<th dir="ltr"> E Service نام کاربری </th>
<th dir="ltr"> E Service رمز عبور </th>
<td> @Model.EserviceUserName </td>
<td>
<i class="md-vpn-key"></i> @Model.EservicePassword
</td>
</tr>
</tr>
<tr>
<th> نام کاربری سامانه مالیات </th>
<th> رمز عبور سامانه مالیات </th>
<tr>
</tr>
<td> @Model.EserviceUserName </td>
<td><i class="md-vpn-key"></i> @Model.EservicePassword </td>
</tr>
<tr>
<tr>
<th> نام کاربری سامانه مالیات </th>
<th> رمز عبور سامانه مالیات </th>
<td> @Model.TaxOfficeUserName </td>
<td>
<i class="md-vpn-key"></i> @Model.TaxOfficepassword
</td>
</tr>
</tr>
<tr>
<th> نام کاربری سامانه ثنا </th>
<th> رمز عبور سامانه ثنا </th>
<tr>
</tr>
<td> @Model.TaxOfficeUserName </td>
<td><i class="md-vpn-key"></i> @Model.TaxOfficepassword </td>
</tr>
<tr>
<tr>
<th> نام کاربری سامانه ثنا </th>
<th> رمز عبور سامانه ثنا </th>
<td> @Model.SanaUserName </td>
<td>
<i class="md-vpn-key"></i> @Model.SanaPassword
</td>
</tr>
</tr>
<tr>
</table>
<td> @Model.SanaUserName </td>
<td><i class="md-vpn-key"></i> @Model.SanaPassword </td>
</tr>
</fieldset>
</div>
</table>
</div>
<input type="hidden" asp-for="Id" value="@Model.Id"/>
<div class="modal-footer" style="border-top: unset; padding-top: unset">
</fieldset>
</div>
</div>
<input type="hidden" asp-for="Id" value="@Model.Id" />
<div class="modal-footer" style="border-top: unset; padding-top: unset">
<button type="button" class="btn btn-warning btn-rounded waves-effect waves-light m-b-10" data-dismiss="modal">بستن فرم</button>
</div>
</form>
<button type="button" class="btn btn-warning btn-rounded waves-effect waves-light m-b-10" data-dismiss="modal">بستن فرم</button>
</div>
</form>
</div>

View File

@@ -1,473 +1,477 @@
@using _0_Framework.Application
@model CompanyManagment.App.Contracts.Employer.EditEmployer
@model CompanyManagment.App.Contracts.Employer.EditEmployer
@{
}
<link href="@Href("~/admintheme/css/legalEmployer.css")" rel="stylesheet" />
<link href="@Href("~/admintheme/css/legalEmployer.css")" rel="stylesheet"/>
<div class="container" id="legalEdit">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<div class="main-title">ویرایش مشخصات کارفرمای حقوقی</div>
<form asp-page="./Index" asp-page-handler="LegalEdit" autocomplete="off" id="legalEmployer"
method="post"
data-ajax="true"
data-callback=""
data-action="Refresh"
enctype="multipart/form-data">
<div class="box">
<div class="steps col-md-12">
<div id="progressBar"></div>
<div class="step">مشخصات کارفرما</div>
<div class="step">مشخصات مدیر عامل</div>
<div class="step">اطلاعات سامانه ای</div>
</div>
<div class="form" id="form1">
<div class="flexible-wrap w-100">
<div class="col-md-12 col-xs-6" id="divParty" dir="rtl" style="align-self: center;">
<label class="sr-only" asp-for="ContractingPartyId"></label>
<select class="form-control select-city" id="party" data-live-search="true" asp-for="ContractingPartyId" asp-items='new SelectList(Model.ContractingParties, "id", "LName")'>
<option value="">انتخاب طرف حساب</option>
</select>
@*<span asp-validation-for="ContractingPartyId" class="error"></span>*@
</div>
<div class="col-md-4 col-xs-6">
<div class="form-group">
<label asp-for="LName" class="control-label">نام شرکت</label>
<input type="text" class="form-control not-empty" asp-for="LName">
@*<span asp-validation-for="LName" class="error"></span>*@
</div>
</div>
<div class="col-md-4 col-xs-6">
<div class="form-group">
<label asp-for="NationalId" class="control-label"> شناسه ملی</label>
<input type="text" class="form-control" asp-for="NationalId" pattern="\d*" maxlength="11" />
<i class="fa fa-exclamation-circle error-icon"></i>
<p class="error-message">فقط عدد وارد شود.</p>
</div>
</div>
<div class="col-md-4 col-xs-6">
<div class="form-group">
<label asp-for="RegisterId" class="control-label">شماره ثبت </label>
<input type="text" class="form-control" asp-for="RegisterId" pattern="\d*" />
<i class="fa fa-exclamation-circle error-icon"></i>
<p class="error-message">فقط عدد وارد شود.</p>
</div>
</div>
<div class="col-md-6 col-xs-6">
<div class="form-group">
<label asp-for="Phone" class="control-label"> شماره تلفن همراه </label>
<input type="text" class="form-control" asp-for="Phone" pattern="\d*" maxlength="10" />
<i class="fa fa-exclamation-circle error-icon"></i>
<p class="error-message">فقط عدد وارد شود.</p>
</div>
</div>
<div class="col-md-6 col-xs-6">
<div class="form-group">
<label asp-for="AgentPhone" class="control-label">شماره تلفن ثابت</label>
<input type="text" class="form-control" asp-for="AgentPhone" pattern="\d*" maxlength="10" />
<i class="fa fa-exclamation-circle error-icon"></i>
<p class="error-message">فقط عدد وارد شود.</p>
</div>
</div>
</div>
</div>
<div class="form" id="form2">
<div class="row d-flex">
<div class="col-md-6 col-xs-6 col-xs-6 right-one">
<div class="radio-box radio-box-gender">
<label class="radio-label">جنسیت </label>
<div class="radio-input radio-gender">
<label>
آقا<input type="radio" value="مرد" asp-for="Gender" name="Gender">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<div class="main-title">ویرایش مشخصات کارفرمای حقوقی</div>
<form asp-page="./Index" asp-page-handler="LegalEdit" autocomplete="off" id="legalEmployer"
method="post"
data-ajax="true"
data-callback=""
data-action="Refresh"
enctype="multipart/form-data">
<div class="box">
<div class="steps col-md-12">
<div id="progressBar"></div>
<div class="step">مشخصات کارفرما</div>
<div class="step">مشخصات مدیر عامل</div>
<div class="step">اطلاعات سامانه ای</div>
</div>
<div class="form" id="form1">
<div class="flexible-wrap w-100">
<div class="col-md-12 col-xs-6" id="divParty" dir="rtl" style="align-self: center;">
<label class="sr-only" asp-for="ContractingPartyId"></label>
<select class="form-control select-city" id="party" data-live-search="true" asp-for="ContractingPartyId" asp-items='new SelectList(Model.ContractingParties, "id", "LName")'>
<option value="">انتخاب طرف حساب</option>
</select>
@*<span asp-validation-for="ContractingPartyId" class="error"></span>*@
</div>
<div class="col-md-4 col-xs-6">
<div class="form-group">
<label asp-for="LName" class="control-label">نام شرکت</label>
<input type="text" class="form-control not-empty" asp-for="LName">
@*<span asp-validation-for="LName" class="error"></span>*@
</div>
</div>
<div class="col-md-4 col-xs-6">
<div class="form-group">
<label asp-for="NationalId" class="control-label"> شناسه ملی</label>
<input type="text" class="form-control" asp-for="NationalId" pattern="\d*" maxlength="11"/>
<i class="fa fa-exclamation-circle error-icon"></i>
<p class="error-message">فقط عدد وارد شود.</p>
</div>
</div>
<div class="col-md-4 col-xs-6">
<div class="form-group">
<label asp-for="RegisterId" class="control-label">شماره ثبت </label>
<input type="text" class="form-control" asp-for="RegisterId" pattern="\d*"/>
<i class="fa fa-exclamation-circle error-icon"></i>
<p class="error-message">فقط عدد وارد شود.</p>
</div>
</div>
<div class="col-md-6 col-xs-6">
<div class="form-group">
<label asp-for="Phone" class="control-label"> شماره تلفن همراه </label>
<input type="text" class="form-control" asp-for="Phone" pattern="\d*" maxlength="10"/>
<i class="fa fa-exclamation-circle error-icon"></i>
<p class="error-message">فقط عدد وارد شود.</p>
</div>
</div>
<div class="col-md-6 col-xs-6">
<div class="form-group">
<label asp-for="AgentPhone" class="control-label">شماره تلفن ثابت</label>
<input type="text" class="form-control" asp-for="AgentPhone" pattern="\d*" maxlength="10"/>
<i class="fa fa-exclamation-circle error-icon"></i>
<p class="error-message">فقط عدد وارد شود.</p>
</div>
</div>
</div>
</div>
<div class="form" id="form2">
<div class="row d-flex">
<div class="col-md-6 col-xs-6 col-xs-6 right-one">
<div class="radio-box radio-box-gender">
<label class="radio-label">جنسیت </label>
<div class="radio-input radio-gender">
<label>
آقا<input type="radio" value="مرد" asp-for="Gender" name="Gender">
</label>
<label>
خانم<input type="radio" value="زن" asp-for="Gender" name="Gender">
</label>
</div>
</div>
</div>
<div class="col-md-6 col-xs-6 col-xs-6 left-one">
<div class="radio-box">
<label class="radio-label">ملیت </label>
<div class="radio-input nationality">
<label>
ایرانی<input type="radio" value="ایرانی" name="Nationality" asp-for="Nationality" checked="checked">
</label>
<label>
غیر ایرانی<input type="radio" value="غیر ایرانی" name="Nationality" asp-for="Nationality">
</label>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-6 col-xs-6">
<div class="form-group">
<label asp-for="FName" class="control-label">نام مدیرعامل</label>
<input type="text" class="form-control" asp-for="FName" pattern="[\u0600-\u06FF\s]*" />
<i class="fa fa-exclamation-circle error-icon"></i>
<p class="error-message">فقط حروف فارسی وارد شود.</p>
</div>
</div>
<div class="col-md-6 col-xs-6">
<div class="form-group">
<label asp-for="EmployerLName" class="control-label">نام خانوادگی مدیرعامل</label>
<input type="text" class="form-control" asp-for="EmployerLName" pattern="[\u0600-\u06FF\s]*" />
<i class="fa fa-exclamation-circle error-icon"></i>
<p class="error-message">فقط حروف فارسی وارد شود.</p>
</div>
</div>
</div>
<div class="row">
<div class="col-md-6 col-xs-6">
<div class="form-group">
<label asp-for="Nationalcode" class="control-label"> کد ملی مدیرعامل</label>
<input type="text" class="form-control" asp-for="Nationalcode" pattern="\d*" maxlength="10" />
<i class="fa fa-exclamation-circle error-icon"></i>
<p class="error-message">فقط عدد وارد شود.</p>
</div>
</div>
<div class="col-md-6 col-xs-6">
<div class="form-group">
<label asp-for="IdNumber" class="control-label"> شماره شناسنامه مدیرعامل</label>
<input type="text" class="form-control" asp-for="IdNumber" pattern="\d*" maxlength="10" />
<i class="fa fa-exclamation-circle error-icon"></i>
<p class="error-message">فقط عدد وارد شود.</p>
</div>
</div>
</div>
<div class="row">
<div class="col-md-6 col-xs-6">
<div class="form-group">
<label asp-for="DateOfBirth" class="control-label">تاریخ تولد</label>
<input class="form-control persianDateInput" asp-for="DateOfBirth" />
@*<span asp-validation-for="DateOfBirth" class="error"></span>*@
</div>
</div>
<div class="col-md-6 col-xs-6">
<div class="form-group">
<label asp-for="FatherName" class="control-label">نام پدر مدیرعامل </label>
<input type="text" class="form-control" asp-for="FatherName" pattern="[\u0600-\u06FF\s]*" />
<i class="fa fa-exclamation-circle error-icon"></i>
<p class="error-message">فقط حروف فارسی وارد شود.</p>
</div>
</div>
</div>
<div class="row">
<div class="col-md-6 col-xs-6">
<div class="form-group">
<label asp-for="DateOfIssue" class="control-label"> تاریخ صدور شناسنامه</label>
<input class="form-control persianDateInput" asp-for="DateOfIssue" />
@*<span asp-validation-for="DateOfIssue" class="error"></span>*@
</div>
</div>
<div class="col-md-6 col-xs-6">
<div class="form-group">
<label asp-for="PlaceOfIssue" class="control-label"> محل صدور شناسنامه</label>
<input type="text" class="form-control" asp-for="PlaceOfIssue" pattern="[\u0600-\u06FF\s]*" />
<i class="fa fa-exclamation-circle error-icon"></i>
<p class="error-message">فقط حروف فارسی وارد شود.</p>
</div>
</div>
</div>
</div>
<div class="row form" id="form3">
<div class="flexible-wrap" style="padding: 0 10px;">
<fieldset>
<legend> اداره کار </legend>
<div class="col-md-6 col-xs-6">
<div class="form-group">
<label asp-for="MclsUserName" class="control-label">نام کاربری</label>
<input style="background-color: #e0ffe0;" type="text" class="form-control" asp-for="MclsUserName">
</div>
</div>
<div class="col-md-6 col-xs-6">
<div class="form-group">
<label asp-for="MclsPassword" class="control-label">گذرواژه</label>
<input style="background-color: #e0ffe0;" type="text" class="form-control" asp-for="MclsPassword">
</div>
</div>
</fieldset>
<fieldset>
<legend> تامین اجتماعی</legend>
<div class="col-md-6 col-xs-6">
<div class="form-group">
<label asp-for="EserviceUserName" class="control-label" style="direction: ltr">نام کاربری </label>
<input style="background-color: #e0ffe0;" type="text" class="form-control" asp-for="EserviceUserName">
</div>
</div>
<div class="col-md-6 col-xs-6">
<div class="form-group">
<label asp-for="EservicePassword" class="control-label" style="direction: ltr"> گذرواژه</label>
<input style="background-color: #e0ffe0;" type="text" class="form-control" asp-for="EservicePassword">
</div>
</div>
</fieldset>
<fieldset>
<legend> قوه قضائیه </legend>
<div class="col-md-6 col-xs-6">
<div class="form-group">
<label asp-for="TaxOfficeUserName" class="control-label"> نام کاربری </label>
<input style="background-color: #e0ffe0;" type="text" class="form-control" asp-for="TaxOfficeUserName">
</div>
</div>
<div class="col-md-6 col-xs-6">
<div class="form-group">
<label asp-for="TaxOfficepassword" class="control-label"> گذرواژه </label>
<input style="background-color: #e0ffe0;" type="text" class="form-control" asp-for="TaxOfficepassword">
</div>
</div>
</fieldset>
<fieldset>
<legend> امور مالیاتی </legend>
<div class="col-md-6 col-xs-6">
<div class="form-group">
<label asp-for="SanaUserName" class="control-label"> نام کاربری </label>
<input style="background-color: #e0ffe0;" type="text" class="form-control" asp-for="SanaUserName">
</div>
</div>
<div class="col-md-6 col-xs-6">
<div class="form-group">
<label asp-for="SanaPassword" class="control-label"> گذرواژه </label>
<input style="background-color: #e0ffe0;" type="text" class="form-control" asp-for="SanaPassword">
</div>
</div>
</fieldset>
</div>
</div>
<div class="form-footer-btns">
<a class="btn btn-modal pre" onclick="prevButton($(this))">مرحله قبل</a>
<a class="btn btn-modal next" onclick="nextButton($(this))">مرحله بعد</a>
</div>
<input type="hidden" asp-for="Id" value="@Model.Id" />
</div>
<div class="form-footer">
<a class="btn btn-rounded waves-effect waves-light bg-white" id="close" data-dismiss="modal">بستن</a>
<a class="btn btn-rounded waves-effect waves-light" id="save">ویرایش</a>
<a href="#" class="btn btn-success btn-rounded waves-effect waves-light" id="fakeSave" style="display: none;">ذخیره</a>
</div>
</form>
</label>
<label>
خانم<input type="radio" value="زن" asp-for="Gender" name="Gender">
</label>
</div>
</div>
</div>
<div class="col-md-6 col-xs-6 col-xs-6 left-one">
<div class="radio-box">
<label class="radio-label">ملیت </label>
<div class="radio-input nationality">
<label>
ایرانی<input type="radio" value="ایرانی" name="Nationality" asp-for="Nationality" checked="checked">
</label>
<label>
غیر ایرانی<input type="radio" value="غیر ایرانی" name="Nationality" asp-for="Nationality">
</label>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-6 col-xs-6">
<div class="form-group">
<label asp-for="FName" class="control-label">نام مدیرعامل</label>
<input type="text" class="form-control" asp-for="FName" pattern="[\u0600-\u06FF\s]*"/>
<i class="fa fa-exclamation-circle error-icon"></i>
<p class="error-message">فقط حروف فارسی وارد شود.</p>
</div>
</div>
<div class="col-md-6 col-xs-6">
<div class="form-group">
<label asp-for="EmployerLName" class="control-label">نام خانوادگی مدیرعامل</label>
<input type="text" class="form-control" asp-for="EmployerLName" pattern="[\u0600-\u06FF\s]*"/>
<i class="fa fa-exclamation-circle error-icon"></i>
<p class="error-message">فقط حروف فارسی وارد شود.</p>
</div>
</div>
</div>
<div class="row">
<div class="col-md-6 col-xs-6">
<div class="form-group">
<label asp-for="Nationalcode" class="control-label"> کد ملی مدیرعامل</label>
<input type="text" class="form-control" asp-for="Nationalcode" pattern="\d*" maxlength="10"/>
<i class="fa fa-exclamation-circle error-icon"></i>
<p class="error-message">فقط عدد وارد شود.</p>
</div>
</div>
<div class="col-md-6 col-xs-6">
<div class="form-group">
<label asp-for="IdNumber" class="control-label"> شماره شناسنامه مدیرعامل</label>
<input type="text" class="form-control" asp-for="IdNumber" pattern="\d*" maxlength="10"/>
<i class="fa fa-exclamation-circle error-icon"></i>
<p class="error-message">فقط عدد وارد شود.</p>
</div>
</div>
</div>
<div class="row">
<div class="col-md-6 col-xs-6">
<div class="form-group">
<label asp-for="DateOfBirth" class="control-label">تاریخ تولد</label>
<input class="form-control persianDateInput" asp-for="DateOfBirth"/>
@*<span asp-validation-for="DateOfBirth" class="error"></span>*@
</div>
</div>
<div class="col-md-6 col-xs-6">
<div class="form-group">
<label asp-for="FatherName" class="control-label">نام پدر مدیرعامل </label>
<input type="text" class="form-control" asp-for="FatherName" pattern="[\u0600-\u06FF\s]*"/>
<i class="fa fa-exclamation-circle error-icon"></i>
<p class="error-message">فقط حروف فارسی وارد شود.</p>
</div>
</div>
</div>
<div class="row">
<div class="col-md-6 col-xs-6">
<div class="form-group">
<label asp-for="DateOfIssue" class="control-label"> تاریخ صدور شناسنامه</label>
<input class="form-control persianDateInput" asp-for="DateOfIssue"/>
@*<span asp-validation-for="DateOfIssue" class="error"></span>*@
</div>
</div>
<div class="col-md-6 col-xs-6">
<div class="form-group">
<label asp-for="PlaceOfIssue" class="control-label"> محل صدور شناسنامه</label>
<input type="text" class="form-control" asp-for="PlaceOfIssue" pattern="[\u0600-\u06FF\s]*"/>
<i class="fa fa-exclamation-circle error-icon"></i>
<p class="error-message">فقط حروف فارسی وارد شود.</p>
</div>
</div>
</div>
</div>
<div class="row form" id="form3">
<div class="flexible-wrap" style="padding: 0 10px;">
<fieldset>
<legend> اداره کار </legend>
<div class="col-md-6 col-xs-6">
<div class="form-group">
<label asp-for="MclsUserName" class="control-label">نام کاربری</label>
<input style="background-color: #e0ffe0;" type="text" class="form-control" asp-for="MclsUserName">
</div>
</div>
<div class="col-md-6 col-xs-6">
<div class="form-group">
<label asp-for="MclsPassword" class="control-label">گذرواژه</label>
<input style="background-color: #e0ffe0;" type="text" class="form-control" asp-for="MclsPassword">
</div>
</div>
</fieldset>
<fieldset>
<legend> تامین اجتماعی</legend>
<div class="col-md-6 col-xs-6">
<div class="form-group">
<label asp-for="EserviceUserName" class="control-label" style="direction: ltr">نام کاربری </label>
<input style="background-color: #e0ffe0;" type="text" class="form-control" asp-for="EserviceUserName">
</div>
</div>
<div class="col-md-6 col-xs-6">
<div class="form-group">
<label asp-for="EservicePassword" class="control-label" style="direction: ltr"> گذرواژه</label>
<input style="background-color: #e0ffe0;" type="text" class="form-control" asp-for="EservicePassword">
</div>
</div>
</fieldset>
<fieldset>
<legend> قوه قضائیه </legend>
<div class="col-md-6 col-xs-6">
<div class="form-group">
<label asp-for="TaxOfficeUserName" class="control-label"> نام کاربری </label>
<input style="background-color: #e0ffe0;" type="text" class="form-control" asp-for="TaxOfficeUserName">
</div>
</div>
<div class="col-md-6 col-xs-6">
<div class="form-group">
<label asp-for="TaxOfficepassword" class="control-label"> گذرواژه </label>
<input style="background-color: #e0ffe0;" type="text" class="form-control" asp-for="TaxOfficepassword">
</div>
</div>
</fieldset>
<fieldset>
<legend> امور مالیاتی </legend>
<div class="col-md-6 col-xs-6">
<div class="form-group">
<label asp-for="SanaUserName" class="control-label"> نام کاربری </label>
<input style="background-color: #e0ffe0;" type="text" class="form-control" asp-for="SanaUserName">
</div>
</div>
<div class="col-md-6 col-xs-6">
<div class="form-group">
<label asp-for="SanaPassword" class="control-label"> گذرواژه </label>
<input style="background-color: #e0ffe0;" type="text" class="form-control" asp-for="SanaPassword">
</div>
</div>
</fieldset>
</div>
</div>
<div class="form-footer-btns">
<a class="btn btn-modal pre" onclick="prevButton($(this))">مرحله قبل</a>
<a class="btn btn-modal next" onclick="nextButton($(this))">مرحله بعد</a>
</div>
<input type="hidden" asp-for="Id" value="@Model.Id"/>
</div>
<div class="form-footer">
<a class="btn btn-rounded waves-effect waves-light bg-white" id="close" data-dismiss="modal">بستن</a>
<a class="btn btn-rounded waves-effect waves-light" id="save">ویرایش</a>
<a href="#" class="btn btn-success btn-rounded waves-effect waves-light" id="fakeSave" style="display: none;">ذخیره</a>
</div>
</form>
</div>
<script>
$(document).ready(function () {
$('.error-message').hide();
$('.error-icon').hide();
})
$('#MainModal').on('hidden.bs.modal', function () {
$(".datepicker-container").hide();
});
$('.form-control').on('keyup', function () {
const errorMessage = $(this).parent().find('.error-message');
const errorIcon = $(this).parent().find('.error-icon');
if (this.validity.patternMismatch) {
errorMessage.show();
errorIcon.show();
$(this).addClass('errored');
$(this).addClass('patternMisMatch');
$(document).ready(function() {
$('.error-message').hide();
$('.error-icon').hide();
});
$('#MainModal').on('hidden.bs.modal',
function() {
$(".datepicker-container").hide();
});
$('.form-control').on('keyup',
function() {
const errorMessage = $(this).parent().find('.error-message');
const errorIcon = $(this).parent().find('.error-icon');
if (this.validity.patternMismatch) {
errorMessage.show();
errorIcon.show();
$(this).addClass('errored');
$(this).addClass('patternMisMatch');
} else {
errorMessage.hide();
errorIcon.hide();
$(this).removeClass('errored');
$(this).removeClass('patternMisMatch');
}
});
function nextButton(element) {
let nextBtn = element;
let prevBtn = $(".pre");
let form1 = $("#form1");
let form2 = $("#form2");
let form3 = $("#form3");
let progressBar = $("#progressBar");
$("#form1").find('.not-empty').each(function () {
if ($(this).val() === '') {
$(this).addClass('errored');
} else {
$(this).removeClass('errored');
}
});
var option1 = document.getElementById("party").options.selectedIndex;
if (option1 == 0) {
$("#divParty .select2-selection").addClass('errored');
} else {
$("#divParty .select2-selection").removeClass('errored');
}
if ($('#form1 .errored').length > 0 || $('#form1 input.patternMisMatch').length > 0) {
$('.sweet-alert').removeClass("successSwall");
$('.sweet-alert').removeClass("errorSwall");
swal({
title: 'لطفا موارد اجباری را تکمیل کنید.',
text: "",
type: "warning",
showCancelButton: true,
confirmButtonColor: "#DD6B55",
//confirmButtonText: "بستن",
cancelButtonText: "بستن",
closeOnConfirm: false,
customClass: "errorSwall"
});
} else {
errorMessage.hide();
errorIcon.hide();
$(this).removeClass('errored');
$(this).removeClass('patternMisMatch');
}
});
} else {
if (form3.css('right') == '10px') {
nextBtn.css({
'background-color': "#c7c0c0ba",
'color': '#000000b8',
'box-shadow': 'none'
})
}
else if (form2.css('left') == '3000px') {
prevBtn.css({
'background-color': "white",
'color': '#0f9500',
'box-shadow': '0 2px 5px 0 rgba(0, 0, 0, 0.16), 0 2px 10px 0 rgba(0, 0, 0, 0.12)'
})
progressBar.css({
'width': '66.66%'
})
form1.css({
right: '3000px'
})
form2.css({
left: '0px'
})
}
else if (form2.css('left') == '0px') {
nextBtn.css({
'background-color': "#c7c0c0ba",
'color': '#000000b8',
'box-shadow': 'none'
})
prevBtn.css({
'background-color': "white",
'color': '#0f9500',
'box-shadow': '0 2px 5px 0 rgba(0, 0, 0, 0.16), 0 2px 10px 0 rgba(0, 0, 0, 0.12)'
})
progressBar.css({
'width': '100%'
})
form2.css({
left: '3000px'
})
form3.css({
right: '10px'
})
}
}
}
function prevButton(element) {
let prevBtn = element;
let nextBtn = $(".next");
let form1 = $("#form1");
let form2 = $("#form2");
let form3 = $("#form3");
let progressBar = $("#progressBar");
nextBtn.css({
'background-color': "white",
'color': '#1763b1'
})
if (form2.css('left') == '3000px' && form3.css('right') == '3000px') {
prevBtn.css({
'background-color': "#c7c0c0ba",
'color': '#000000b8',
'box-shadow': 'none'
})
function nextButton(element) {
const nextBtn = element;
const prevBtn = $(".pre");
const form1 = $("#form1");
const form2 = $("#form2");
const form3 = $("#form3");
const progressBar = $("#progressBar");
$("#form1").find('.not-empty').each(function() {
if ($(this).val() === '') {
$(this).addClass('errored');
} else {
$(this).removeClass('errored');
}
});
const option1 = document.getElementById("party").options.selectedIndex;
if (option1 == 0) {
$("#divParty .select2-selection").addClass('errored');
} else {
$("#divParty .select2-selection").removeClass('errored');
}
if ($('#form1 .errored').length > 0 || $('#form1 input.patternMisMatch').length > 0) {
$('.sweet-alert').removeClass("successSwall");
$('.sweet-alert').removeClass("errorSwall");
swal({
title: 'لطفا موارد اجباری را تکمیل کنید.',
text: "",
type: "warning",
showCancelButton: true,
confirmButtonColor: "#DD6B55",
//confirmButtonText: "بستن",
cancelButtonText: "بستن",
closeOnConfirm: false,
customClass: "errorSwall"
});
} else if (form2.css('left') == '0px') {
progressBar.css({
'width': '33.33%'
})
prevBtn.css({
'background-color': "#c7c0c0ba",
'color': '#000000b8',
'box-shadow': 'none'
})
form2.css({
left: '3000px'
})
form1.css({
right: '0px'
})
} else if (form3.css('right') == '10px') {
progressBar.css({
'width': '66.66%'
})
prevBtn.css({
'background-color': "white",
'color': '#0f9500',
'box-shadow': '0 2px 5px 0 rgba(0, 0, 0, 0.16), 0 2px 10px 0 rgba(0, 0, 0, 0.12)'
})
form2.css({
left: '0px'
})
form3.css({
right: '3000px'
})
}
}
$("#save").click(function () {
$("#form1").find('.not-empty').each(function () {
if ($(this).val() === '') {
$(this).addClass('errored');
} else {
$(this).removeClass('errored');
}
});
var option1 = document.getElementById("party").options.selectedIndex;
if (option1 == 0) {
$("#divParty .select2-selection").addClass('errored');
} else {
$("#divParty .select2-selection").removeClass('errored');
}
if ($('#form1 .errored').length > 0 || $('#form1 input.patternMisMatch').length > 0) {
$('.sweet-alert').removeClass("successSwall");
$('.sweet-alert').removeClass("errorSwall");
swal({
title: 'لطفا موارد اجباری را تکمیل کنید.',
text: "",
type: "warning",
showCancelButton: true,
confirmButtonColor: "#DD6B55",
//confirmButtonText: "بستن",
cancelButtonText: "بستن",
closeOnConfirm: false,
customClass: "errorSwall"
});
} else {
if (form3.css('right') == '10px') {
nextBtn.css({
'background-color': "#c7c0c0ba",
'color': '#000000b8',
'box-shadow': 'none'
});
} else if (form2.css('left') == '3000px') {
prevBtn.css({
'background-color': "white",
'color': '#0f9500',
'box-shadow': '0 2px 5px 0 rgba(0, 0, 0, 0.16), 0 2px 10px 0 rgba(0, 0, 0, 0.12)'
});
progressBar.css({
'width': '66.66%'
});
form1.css({
right: '3000px'
});
form2.css({
left: '0px'
});
} else if (form2.css('left') == '0px') {
nextBtn.css({
'background-color': "#c7c0c0ba",
'color': '#000000b8',
'box-shadow': 'none'
});
prevBtn.css({
'background-color': "white",
'color': '#0f9500',
'box-shadow': '0 2px 5px 0 rgba(0, 0, 0, 0.16), 0 2px 10px 0 rgba(0, 0, 0, 0.12)'
});
progressBar.css({
'width': '100%'
});
form2.css({
left: '3000px'
});
form3.css({
right: '10px'
});
}
}
}
} else {
$("#legalEmployer").submit();
}
})
//تنظیمات تاریخ
$(".persianDateInput").on('keyup', function () {
if (event.which !== 8 && event.which !== 46) {
let value = $(this).val();
let lengthValue = value.length;
if (lengthValue === 4) {
value += '/'
}
if (lengthValue === 7) {
value += '/'
}
$(this).val(value);
}
});
$(".persianDateInput").on("keydown", function (event) {
var keyCode = event.which || event.keyCode;
var isDigit = (keyCode >= 48 && keyCode <= 57) || (keyCode >= 96 && keyCode <= 105);
var isControlKey = (keyCode === 8) || (keyCode === 9) || (keyCode === 13) || (keyCode === 35) || (keyCode === 36) || (keyCode === 37) || (keyCode === 39) || (keyCode === 46);
if (!isDigit && !isControlKey) {
event.preventDefault();
}
});
$(".persianDateInput").on('blur', function () {
let value = $(this).val();
let lengthValue = value.length;
if (!dateValidCheck(this)) {
$(this).addClass("errored");
}
else {
$(this).removeClass("errored");
}
});
</script>
function prevButton(element) {
const prevBtn = element;
const nextBtn = $(".next");
const form1 = $("#form1");
const form2 = $("#form2");
const form3 = $("#form3");
const progressBar = $("#progressBar");
nextBtn.css({
'background-color': "white",
'color': '#1763b1'
});
if (form2.css('left') == '3000px' && form3.css('right') == '3000px') {
prevBtn.css({
'background-color': "#c7c0c0ba",
'color': '#000000b8',
'box-shadow': 'none'
});
} else if (form2.css('left') == '0px') {
progressBar.css({
'width': '33.33%'
});
prevBtn.css({
'background-color': "#c7c0c0ba",
'color': '#000000b8',
'box-shadow': 'none'
});
form2.css({
left: '3000px'
});
form1.css({
right: '0px'
});
} else if (form3.css('right') == '10px') {
progressBar.css({
'width': '66.66%'
});
prevBtn.css({
'background-color': "white",
'color': '#0f9500',
'box-shadow': '0 2px 5px 0 rgba(0, 0, 0, 0.16), 0 2px 10px 0 rgba(0, 0, 0, 0.12)'
});
form2.css({
left: '0px'
});
form3.css({
right: '3000px'
});
}
}
$("#save").click(function() {
$("#form1").find('.not-empty').each(function() {
if ($(this).val() === '') {
$(this).addClass('errored');
} else {
$(this).removeClass('errored');
}
});
const option1 = document.getElementById("party").options.selectedIndex;
if (option1 == 0) {
$("#divParty .select2-selection").addClass('errored');
} else {
$("#divParty .select2-selection").removeClass('errored');
}
if ($('#form1 .errored').length > 0 || $('#form1 input.patternMisMatch').length > 0) {
$('.sweet-alert').removeClass("successSwall");
$('.sweet-alert').removeClass("errorSwall");
swal({
title: 'لطفا موارد اجباری را تکمیل کنید.',
text: "",
type: "warning",
showCancelButton: true,
confirmButtonColor: "#DD6B55",
//confirmButtonText: "بستن",
cancelButtonText: "بستن",
closeOnConfirm: false,
customClass: "errorSwall"
});
} else {
$("#legalEmployer").submit();
}
});
//تنظیمات تاریخ
$(".persianDateInput").on('keyup',
function() {
if (event.which !== 8 && event.which !== 46) {
let value = $(this).val();
const lengthValue = value.length;
if (lengthValue === 4) {
value += '/';
}
if (lengthValue === 7) {
value += '/';
}
$(this).val(value);
}
});
$(".persianDateInput").on("keydown",
function(event) {
const keyCode = event.which || event.keyCode;
const isDigit = (keyCode >= 48 && keyCode <= 57) || (keyCode >= 96 && keyCode <= 105);
const isControlKey = (keyCode === 8) || (keyCode === 9) || (keyCode === 13) || (keyCode === 35) || (keyCode === 36) || (keyCode === 37) || (keyCode === 39) || (keyCode === 46);
if (!isDigit && !isControlKey) {
event.preventDefault();
}
});
$(".persianDateInput").on('blur',
function() {
const value = $(this).val();
const lengthValue = value.length;
if (!dateValidCheck(this)) {
$(this).addClass("errored");
} else {
$(this).removeClass("errored");
}
});
</script>

View File

@@ -1,9 +1,9 @@
@page
@model ServiceHost.Areas.Admin.Pages.Company.FaceRecognition.IndexModel
@{
Layout = "Shared/_AdminLayoutCopy";
ViewData["title"] = "حضور غیاب";
<style>
Layout = "Shared/_AdminLayoutCopy";
ViewData["title"] = "حضور غیاب";
<style>
#btnName {
@@ -107,375 +107,373 @@
}
<div style="display: block; position: relative; width: 4000px; height: 200px; background-color: #888888;">
<div id="reAnalyz" style="position: absolute; top: 70px;z-index: 999 ">
<a id="reloadRec" class="btn btn-primary " style="border-radius: 15px;display: none; right: 40px; position: absolute; font-size: 62px">شروع شناسایی </a>
<a id="notFound" class="btn btn-warning " style="border-radius: 15px;display: none; right: 484px; position: absolute; font-size: 64px"> شناسایی نشد </a>
</div>
<div id="waiting" style=" display: none;position: absolute; top: 100px; right: 40px; color: #ffffff; z-index: 996;font-size: 64px">
<i class="ion-loading-a" style="font-size: 60px"> </i> آماده سازی...
</div>
<div id="recognizing" style="display: none; position: absolute; top: 100px; right: 40px; color: #ffffff; z-index: 997;font-size: 64px">
<i class="ion-loading-a" style="font-size: 60px"> </i> در حال شناسایی...
</div>
<div id="users" style="position: absolute; top: 62px; z-index: 998; right: 40px;">
<div style="display: block; position: relative; width: 4000px; height: 200px; background-color: #888888;">
<div id="reAnalyz" style="position: absolute; top: 70px;z-index: 999 ">
<a id="reloadRec" class="btn btn-primary " style="border-radius: 15px;display: none; right: 40px; position: absolute; font-size: 62px">شروع شناسایی </a>
<a id="notFound" class="btn btn-warning " style="border-radius: 15px;display: none; right: 484px; position: absolute; font-size: 64px"> شناسایی نشد </a>
</div>
<div id="waiting" style=" display: none;position: absolute; top: 100px; right: 40px; color: #ffffff; z-index: 996;font-size: 64px">
<i class="ion-loading-a" style="font-size: 60px"> </i> آماده سازی...
</div>
<div id="recognizing" style="display: none; position: absolute; top: 100px; right: 40px; color: #ffffff; z-index: 997;font-size: 64px">
<i class="ion-loading-a" style="font-size: 60px"> </i> در حال شناسایی...
</div>
<div id="users" style="position: absolute; top: 62px; z-index: 998; right: 40px;">
</div>
</div>
<div id="display" style="display: block;position: relative;width: 1800px; height: 1800px; background-color:#cfdddb;">
<video style="position: absolute; top: 0px;object-fit: cover" id="video" width="1000" height="1000" autoplay></video>
</div>
<div style="display: block; position: relative; width: 1600px; height: 200px;">
<div id="testDistance" dir="ltr">
</div>
</div>
</div>
</div>
<div id="display" style="display: block;position: relative;width: 1800px; height: 1800px; background-color:#cfdddb;">
<video style="position: absolute; top: 0px;object-fit: cover" id="video" width="1000" height="1000" autoplay></video>
</div>
<div style="display: block; position: relative; width: 1600px; height: 200px;">
<div id="testDistance" dir="ltr">
</div>
</div>
<input type="hidden" asp-for="@Model.filePath" value="@Model.filePath" id="filePath"/>
<input type="hidden" asp-for="@Model.modelPath" value="@Model.modelPath" id="modelPath" />
<input type="hidden" asp-for="@Model.modelPath" value="@Model.modelPath" id="modelPath"/>
@section Script
{
@* <script src="~/weights/face-api.js"></script> *@
@* <script src="@Model.faceApiJs"></script> *@
<script src="~/weights/face-api.js"></script>
@* <script src="~/weights/face-api.js"></script> *@
@* <script src="@Model.faceApiJs"></script> *@
<script src="~/weights/face-api.js"></script>
<script>
const video = document.getElementById("video");
const waiting = document.getElementById("waiting");
const recognizing = document.getElementById("recognizing");
const reloadRec = document.getElementById("reloadRec");
const notFound = document.getElementById("notFound");
const filePath = document.getElementById("filePath").value;
const modelPath = document.getElementById("modelPath").value;
// let modelsUrl = "https://raw.githubusercontent.com/justadudewhohacks/face-api.js/master/weights/";
<script>
const video = document.getElementById("video");
const waiting = document.getElementById("waiting");
const recognizing = document.getElementById("recognizing");
const reloadRec = document.getElementById("reloadRec");
const notFound = document.getElementById("notFound");
const filePath = document.getElementById("filePath").value;
const modelPath = document.getElementById("modelPath").value;
// let modelsUrl = "https://raw.githubusercontent.com/justadudewhohacks/face-api.js/master/weights/";
const run = async () => {
const run = async () => {
await Promise.all([
//api
// faceapi.nets.ssdMobilenetv1.loadFromUri(modelsUrl + 'ssd_mobilenetv1_model-weights_manifest.json'),
// faceapi.nets.faceRecognitionNet.loadFromUri(modelsUrl + 'face_recognition_model-weights_manifest.json'),
// faceapi.nets.faceLandmark68Net.loadFromUri(modelsUrl + 'face_landmark_68_model-weights_manifest.json')
await Promise.all([
//api
// faceapi.nets.ssdMobilenetv1.loadFromUri(modelsUrl + 'ssd_mobilenetv1_model-weights_manifest.json'),
// faceapi.nets.faceRecognitionNet.loadFromUri(modelsUrl + 'face_recognition_model-weights_manifest.json'),
// faceapi.nets.faceLandmark68Net.loadFromUri(modelsUrl + 'face_landmark_68_model-weights_manifest.json')
//local source
faceapi.nets.ssdMobilenetv1.loadFromUri("\\weights\\"),
faceapi.nets.faceRecognitionNet.loadFromUri("\\weights\\"),
faceapi.nets.faceLandmark68Net.loadFromUri("\\weights\\")
//local source
faceapi.nets.ssdMobilenetv1.loadFromUri("\\weights\\"),
faceapi.nets.faceRecognitionNet.loadFromUri("\\weights\\"),
faceapi.nets.faceLandmark68Net.loadFromUri("\\weights\\")
// faceapi.nets.ssdMobilenetv1.loadFromDisk(modelPath),
// faceapi.nets.faceRecognitionNet.loadFromDisk(modelPath),
// faceapi.nets.faceLandmark68Net.loadFromDisk(modelPath)
]).then(startWebcam);
}
run();
// faceapi.nets.ssdMobilenetv1.loadFromDisk(modelPath),
// faceapi.nets.faceRecognitionNet.loadFromDisk(modelPath),
// faceapi.nets.faceLandmark68Net.loadFromDisk(modelPath)
]).then(startWebcam);
};
run();
function startWebcam() {
function startWebcam() {
navigator.mediaDevices
.getUserMedia({
video: true,
audio: false,
})
.then((stream) => {
video.srcObject = stream;
waiting.style.display = "block";
})
.catch((error) => {
console.error(error);
});
}
navigator.mediaDevices
.getUserMedia({
video: true,
audio: false,
})
.then((stream) => {
video.srcObject = stream;
waiting.style.display = "block";
})
.catch((error) => {
console.error(error);
});
}
var stop = false;
var stop = false;
function getLabeledFaceDescriptions() {
function getLabeledFaceDescriptions() {
// const labels = ["صادق فرخی", "میلاد مصباح", "وفا پورتوکلی", "صفا پور توکلی"];
const labels = ["2008", "9200", "7371", "9201", "3056", "7164", "1", "41289", "7317", "41604", "42202"];
const workshopId = "11";
return Promise.all(
labels.map(async (label) => {
let descriptions = [];
for (let i = 1; i <= 2; i++) {
var a = `\\Faces\\${workshopId}\\${label}\\${i}.jpg`;
// const labels = ["صادق فرخی", "میلاد مصباح", "وفا پورتوکلی", "صفا پور توکلی"];
const labels = ["2008", "9200", "7371", "9201", "3056", "7164", "1", "41289", "7317", "41604", "42202"];
const workshopId = "11";
return Promise.all(
labels.map(async (label) => {
const descriptions = [];
for (let i = 1; i <= 2; i++) {
const a = `\\Faces\\${workshopId}\\${label}\\${i}.jpg`;
// console.log(a);
let img = await faceapi.fetchImage(a);
const detections = await faceapi.detectSingleFace(img).withFaceLandmarks().withFaceDescriptor();
// console.log(a);
const img = await faceapi.fetchImage(a);
const detections = await faceapi.detectSingleFace(img).withFaceLandmarks().withFaceDescriptor();
descriptions.push(detections.descriptor);
descriptions.push(detections.descriptor);
}
return new faceapi.LabeledFaceDescriptors(label, descriptions);
})
);
}
}
return new faceapi.LabeledFaceDescriptors(label, descriptions);
})
);
}
var cacheName = [];
var unknown = [];
var endOfRecognition = true;
let display = document.getElementById("display");
var reloadActionControl = false;
// //شناسایی مجدد
// function reset() {
// let oldName = document.getElementById("btnName");
// if (oldName != null) {
// oldName.remove(); // حذف نام قبلی
// }
var cacheName = [];
var unknown = [];
var endOfRecognition = true;
let display = document.getElementById("display");
var reloadActionControl = false;
// //شناسایی مجدد
// function reset() {
// let oldName = document.getElementById("btnName");
// if (oldName != null) {
// oldName.remove(); // حذف نام قبلی
// }
// endOfRecognition = false; // خاموشی پایان شناسایی
// stop = false; //خاموشی استاپ شناسایی
// recognizing.style.display = "block"; // نمایش آیکون درحال شناسایی
// reloadRec.style.display = "none"; // مخفی شدن دکمه شناسایی مجدد
// cacheName = []; // خالی کردن لیست شناسایی شده ها
// endOfRecognition = false; // خاموشی پایان شناسایی
// stop = false; //خاموشی استاپ شناسایی
// recognizing.style.display = "block"; // نمایش آیکون درحال شناسایی
// reloadRec.style.display = "none"; // مخفی شدن دکمه شناسایی مجدد
// cacheName = []; // خالی کردن لیست شناسایی شده ها
// }
// }
reloadRec.addEventListener("click",
function() {
// let oldName = document.getElementById("btnName");
// if (oldName != null) {
// oldName.remove(); // حذف نام قبلی
// }
$('#users').html('');
$('#testDistance').html('');
endOfRecognition = false; // خاموشی پایان شناسایی
stop = false; //خاموشی استاپ شناسایی
recognizing.style.display = "block"; // نمایش آیکون درحال شناسایی
reloadActionControl = true;
reloadRec.style.display = "none"; // مخفی شدن دکمه شناسایی
notFound.style.display = "none"; // مخفی شدن دکمه شناسایی
cacheName = []; // خالی کردن لیست شناسایی شده ها
unknown = [];
reloadRec.addEventListener("click",
function() {
// let oldName = document.getElementById("btnName");
// if (oldName != null) {
// oldName.remove(); // حذف نام قبلی
// }
$('#users').html('');
$('#testDistance').html('');
endOfRecognition = false; // خاموشی پایان شناسایی
stop = false; //خاموشی استاپ شناسایی
recognizing.style.display = "block"; // نمایش آیکون درحال شناسایی
reloadActionControl = true;
reloadRec.style.display = "none"; // مخفی شدن دکمه شناسایی
notFound.style.display = "none"; // مخفی شدن دکمه شناسایی
cacheName = []; // خالی کردن لیست شناسایی شده ها
unknown = [];
});
var interId;
});
var interId;
video.addEventListener("play",
async () => {
const labeledFaceDescriptors = await getLabeledFaceDescriptions();
const faceMatcher = new faceapi.FaceMatcher(labeledFaceDescriptors);
video.addEventListener("play",
async () => {
const labeledFaceDescriptors = await getLabeledFaceDescriptions();
const faceMatcher = new faceapi.FaceMatcher(labeledFaceDescriptors);
const canvas = faceapi.createCanvasFromMedia(video);
display.append(canvas);
const canvas = faceapi.createCanvasFromMedia(video);
display.append(canvas);
const displaySize = { width: video.width, height: video.height };
faceapi.matchDimensions(canvas, displaySize);
const displaySize = { width: video.width, height: video.height };
faceapi.matchDimensions(canvas, displaySize);
interId = setInterval(async () => {
if (!stop) {
waiting.style.display = "none";
if (!reloadActionControl) {
reloadRec.style.display = "block";
}
if (endOfRecognition === false) {
waiting.style.display = "none";
reloadActionControl = true;
recognizing.style.display = "block";
const detections = await faceapi
.detectAllFaces(video)
.withFaceLandmarks()
.withFaceDescriptors();
const resizedDetections = faceapi.resizeResults(detections, displaySize);
canvas.getContext("2d").clearRect(0, 0, canvas.width, canvas.height);
const results = resizedDetections.map((d) => {
return faceMatcher.findBestMatch(d.descriptor);
});
results.forEach((result, i) => {
// reloadRec.style.display = "none";
const box = resizedDetections[i].detection.box;
const drawBox = new faceapi.draw.DrawBox(box,
{
label: "آنالیز چهره",
});
drawBox.draw(canvas);
let userId = result.label;
let userDistance = result.distance;
// console.log(cacheName.length);
if (userId != "unknown" && userDistance <= 0.38) {
cacheName.push(userId);
let res = "[ user : " + result.label + " - distance : " + userDistance + " ]";
let testUser = `<h1 style="color:green;">${res}</h1>`;
$('#testDistance').append(testUser);
} else {
let res2 = "[ user : " + result.label + " - distance : " + userDistance + " ]";
let testUser = `<h1 style="color:red;">${res2}</h1>`;
$('#testDistance').append(testUser);
unknown.push("unknown");
}
// var t = $('#display').find;
// cacheName.push(userId);
if (cacheName.length > 7) {
recognizing.style.display = "none";
reloadRec.style.display = "none";
// t.addClass('.hiddenCanvas');
getPersonel(result.label);
endOfRecognition = true;
stop = true;
} else if (unknown.length > 30) {
recognizing.style.display = "none";
reloadActionControl = false;
reloadRec.style.display = "block";
endOfRecognition = true;
stop = true;
notFound.style.display = "block";
// t.addClass('.hiddenCanvas');
}
});
interId = setInterval(async () => {
if (!stop) {
waiting.style.display = "none";
if (!reloadActionControl) {
reloadRec.style.display = "block";
}
if (endOfRecognition === false) {
waiting.style.display = "none";
reloadActionControl = true;
recognizing.style.display = "block";
const detections = await faceapi
.detectAllFaces(video)
.withFaceLandmarks()
.withFaceDescriptors();
const resizedDetections = faceapi.resizeResults(detections, displaySize);
}
canvas.getContext("2d").clearRect(0, 0, canvas.width, canvas.height);
}
const results = resizedDetections.map((d) => {
return faceMatcher.findBestMatch(d.descriptor);
},
100);
});
});
results.forEach((result, i) => {
function getPersonel(employeeId) {
let workshopId = "11";
let users = document.getElementById("users");
let user1 = $('#users');
$.ajax({
async: false,
// contentType: 'application/json',
// dataType: 'data',
type: 'GET',
url: '@Url.Page("./Index", "EmployeeFlag")',
data: { "employeeId": Number(employeeId), "workshopId": Number(workshopId) },
headers: { "RequestVerificationToken": $('input[name="__RequestVerificationToken"]').val() },
success: function(response) {
if (response.flag > 0) {
// reloadRec.style.display = "none";
const box = resizedDetections[i].detection.box;
const drawBox = new faceapi.draw.DrawBox(box,
{
label: "آنالیز چهره",
});
let e = document.createElement('button');
e.innerHTML = response.employeeName;
e.id = "btnName";
e.className += "btn ";
e.className += "btn-primary";
drawBox.draw(canvas);
user1.html('');
const out = `<button type="button" id="out" class="btn btn-warning btnAction" onclick="out(${response.flag})">ثبت خروج</button>`;
users.append(e);
user1.append(out);
} else {
const userId = result.label;
const userDistance = result.distance;
let e = document.createElement('button');
e.innerHTML = response.employeeName;
e.id = "btnName";
e.className += "btn ";
e.className += "btn-primary";
// console.log(cacheName.length);
const incom = `<button type="button" id="incom" class="btn btn-info btnAction" onclick="inCom(${employeeId})">ثبت ورود</button>`;
user1.html('');
users.appendChild(e);
user1.append(incom);
}
},
failure: function(response) {
console.log(5, response);
}
});
}
if (userId != "unknown" && userDistance <= 0.38) {
cacheName.push(userId);
const res = `[ user : ${result.label} - distance : ${userDistance} ]`;
const testUser = `<h1 style="color:green;">${res}</h1>`;
$('#testDistance').append(testUser);
} else {
const res2 = `[ user : ${result.label} - distance : ${userDistance} ]`;
const testUser = `<h1 style="color:red;">${res2}</h1>`;
$('#testDistance').append(testUser);
unknown.push("unknown");
}
// var t = $('#display').find;
// cacheName.push(userId);
if (cacheName.length > 7) {
function out(flagId) {
recognizing.style.display = "none";
$.ajax({
async: false,
// contentType: 'application/json',
// dataType: 'data',
type: 'GET',
url: '@Url.Page("./Index", "Out")',
data: { "flagId": Number(flagId) },
headers: { "RequestVerificationToken": $('input[name="__RequestVerificationToken"]').val() },
success: function(response) {
if (response.isSuccess) {
$.Notification.autoHideNotify('success', 'top center', 'پیام سیستم ', "خروج شما ثبت شد");
$('#users').html('');
reloadRec.style.display = "block";
reloadActionControl = false;
reloadRec.style.display = "none";
} else {
$.Notification.autoHideNotify('error', 'top center', 'پیام سیستم ', "خطا در ثبت اطلاعات");
}
},
failure: function(response) {
console.log(5, response);
// t.addClass('.hiddenCanvas');
}
});
}
getPersonel(result.label);
endOfRecognition = true;
stop = true;
function inCom(employeeId) {
let workshopId = "11";
$.ajax({
async: false,
// contentType: 'application/json',
// dataType: 'data',
type: 'GET',
url: '@Url.Page("./Index", "InCom")',
data: { "employeeId": Number(employeeId), "workshopId": Number(workshopId) },
headers: { "RequestVerificationToken": $('input[name="__RequestVerificationToken"]').val() },
success: function(response) {
if (response.isSuccess) {
$.Notification.autoHideNotify('success', 'top center', 'پیام سیستم ', "ورود شما ثبت شد");
$('#users').html('');
} else if (unknown.length > 30) {
recognizing.style.display = "none";
reloadActionControl = false;
reloadRec.style.display = "block";
endOfRecognition = true;
stop = true;
notFound.style.display = "block";
// t.addClass('.hiddenCanvas');
reloadRec.style.display = "block";
reloadActionControl = false;
} else {
}
$.Notification.autoHideNotify('error', 'top center', 'پیام سیستم ', "خطا در ثبت اطلاعات");
}
},
failure: function(response) {
console.log(5, response);
});
}
});
}
</script>
}
}
}
},
100);
});
function getPersonel(employeeId) {
const workshopId = "11";
const users = document.getElementById("users");
const user1 = $('#users');
$.ajax({
async: false,
// contentType: 'application/json',
// dataType: 'data',
type: 'GET',
url: '@Url.Page("./Index", "EmployeeFlag")',
data: { "employeeId": Number(employeeId), "workshopId": Number(workshopId) },
headers: { "RequestVerificationToken": $('input[name="__RequestVerificationToken"]').val() },
success: function(response) {
if (response.flag > 0) {
const e = document.createElement('button');
e.innerHTML = response.employeeName;
e.id = "btnName";
e.className += "btn ";
e.className += "btn-primary";
user1.html('');
const out = `<button type="button" id="out" class="btn btn-warning btnAction" onclick="out(${response.flag})">ثبت خروج</button>`;
users.append(e);
user1.append(out);
} else {
const e = document.createElement('button');
e.innerHTML = response.employeeName;
e.id = "btnName";
e.className += "btn ";
e.className += "btn-primary";
const incom = `<button type="button" id="incom" class="btn btn-info btnAction" onclick="inCom(${employeeId})">ثبت ورود</button>`;
user1.html('');
users.appendChild(e);
user1.append(incom);
}
},
failure: function(response) {
console.log(5, response);
}
});
}
function out(flagId) {
$.ajax({
async: false,
// contentType: 'application/json',
// dataType: 'data',
type: 'GET',
url: '@Url.Page("./Index", "Out")',
data: { "flagId": Number(flagId) },
headers: { "RequestVerificationToken": $('input[name="__RequestVerificationToken"]').val() },
success: function(response) {
if (response.isSuccess) {
$.Notification.autoHideNotify('success', 'top center', 'پیام سیستم ', "خروج شما ثبت شد");
$('#users').html('');
reloadRec.style.display = "block";
reloadActionControl = false;
} else {
$.Notification.autoHideNotify('error', 'top center', 'پیام سیستم ', "خطا در ثبت اطلاعات");
}
},
failure: function(response) {
console.log(5, response);
}
});
}
function inCom(employeeId) {
const workshopId = "11";
$.ajax({
async: false,
// contentType: 'application/json',
// dataType: 'data',
type: 'GET',
url: '@Url.Page("./Index", "InCom")',
data: { "employeeId": Number(employeeId), "workshopId": Number(workshopId) },
headers: { "RequestVerificationToken": $('input[name="__RequestVerificationToken"]').val() },
success: function(response) {
if (response.isSuccess) {
$.Notification.autoHideNotify('success', 'top center', 'پیام سیستم ', "ورود شما ثبت شد");
$('#users').html('');
reloadRec.style.display = "block";
reloadActionControl = false;
} else {
$.Notification.autoHideNotify('error', 'top center', 'پیام سیستم ', "خطا در ثبت اطلاعات");
}
},
failure: function(response) {
console.log(5, response);
}
});
}
</script>
}

View File

@@ -1,110 +1,89 @@
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
using System.IO;
using CompanyManagment.App.Contracts.Employee;
using CompanyManagment.App.Contracts.RollCall;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
namespace ServiceHost.Areas.Admin.Pages.Company.FaceRecognition
namespace ServiceHost.Areas.Admin.Pages.Company.FaceRecognition;
public class IndexModel : PageModel
{
public class IndexModel : PageModel
{
private readonly IWebHostEnvironment _webHostEnvironment;
private readonly IConfiguration _configuration;
private readonly IEmployeeApplication _employeeApplication;
private readonly IRollCallApplication _rollCallApplication;
public string filePath="";
public string modelPath = "";
private readonly IConfiguration _configuration;
private readonly IEmployeeApplication _employeeApplication;
private readonly IRollCallApplication _rollCallApplication;
private readonly IWebHostEnvironment _webHostEnvironment;
public string filePath = "";
public string modelPath = "";
public IndexModel(IWebHostEnvironment webHostEnvironment, IConfiguration configuration, IEmployeeApplication employeeApplication, IRollCallApplication rollCallApplication)
{
_webHostEnvironment = webHostEnvironment;
_configuration = configuration;
_employeeApplication = employeeApplication;
_rollCallApplication = rollCallApplication;
}
public IndexModel(IWebHostEnvironment webHostEnvironment, IConfiguration configuration,
IEmployeeApplication employeeApplication, IRollCallApplication rollCallApplication)
{
_webHostEnvironment = webHostEnvironment;
_configuration = configuration;
_employeeApplication = employeeApplication;
_rollCallApplication = rollCallApplication;
}
public void OnGet()
{
var workshopId = 20;
filePath = $"{_webHostEnvironment.ContentRootPath}\\labels\\{workshopId}\\1\\1.png"; ;
modelPath = _configuration["faceModels:Faces"];
}
public IActionResult OnGetEmployeeFlag(long employeeId, long workshopId)
{
var employeeName = _employeeApplication.GetDetails(employeeId).EmployeeFullName;
var flagId = _rollCallApplication.Flag(employeeId, workshopId);
return new JsonResult(new
{
employeeName = employeeName,
flag = flagId
});
public void OnGet()
{
var workshopId = 20;
}
filePath = $"{_webHostEnvironment.ContentRootPath}\\labels\\{workshopId}\\1\\1.png";
;
modelPath = _configuration["faceModels:Faces"];
}
public IActionResult OnGetOut(long flagId)
{
var res = _rollCallApplication.Edit(flagId);
if (res.IsSuccedded)
{
return new JsonResult(new
{
isSuccess = true,
});
}
else
{
return new JsonResult(new
{
isSuccess = false,
});
}
}
public IActionResult OnGetEmployeeFlag(long employeeId, long workshopId)
{
var employeeName = _employeeApplication.GetDetails(employeeId).EmployeeFullName;
var flagId = _rollCallApplication.Flag(employeeId, workshopId);
public IActionResult OnGetInCom(long employeeId, long workshopId)
{
var now = DateTime.Now;
var command = new CreateRollCall()
{
WorkshopId = workshopId,
EmployeeId = employeeId,
StartDate = now,
return new JsonResult(new
{
employeeName,
flag = flagId
});
}
};
var res = _rollCallApplication.Create(command);
if (res.IsSuccedded)
{
return new JsonResult(new
{
isSuccess = true,
});
}
else
{
return new JsonResult(new
{
isSuccess = false,
});
}
}
public IActionResult OnGetOut(long flagId)
{
var res = _rollCallApplication.Edit(flagId);
if (res.IsSuccedded)
return new JsonResult(new
{
isSuccess = true
});
return new JsonResult(new
{
isSuccess = false
});
}
}
public class ImagesModel
{
public string FullPath { get; set; }
public string FileName { get; set; }
}
public IActionResult OnGetInCom(long employeeId, long workshopId)
{
var now = DateTime.Now;
var command = new CreateRollCall
{
WorkshopId = workshopId,
EmployeeId = employeeId,
StartDate = now
};
var res = _rollCallApplication.Create(command);
if (res.IsSuccedded)
return new JsonResult(new
{
isSuccess = true
});
return new JsonResult(new
{
isSuccess = false
});
}
}
public class ImagesModel
{
public string FullPath { get; set; }
public string FileName { get; set; }
}

View File

@@ -1 +1,175 @@
[{"weights":[{"name":"dense0/conv0/filters","shape":[3,3,3,32],"dtype":"float32","quantization":{"dtype":"uint8","scale":0.008194216092427571,"min":-0.9423348506291708}},{"name":"dense0/conv0/bias","shape":[32],"dtype":"float32","quantization":{"dtype":"uint8","scale":0.006839508168837603,"min":-0.8412595047670252}},{"name":"dense0/conv1/depthwise_filter","shape":[3,3,32,1],"dtype":"float32","quantization":{"dtype":"uint8","scale":0.009194007106855804,"min":-1.2779669878529567}},{"name":"dense0/conv1/pointwise_filter","shape":[1,1,32,32],"dtype":"float32","quantization":{"dtype":"uint8","scale":0.0036026100317637128,"min":-0.3170296827952067}},{"name":"dense0/conv1/bias","shape":[32],"dtype":"float32","quantization":{"dtype":"uint8","scale":0.000740380117706224,"min":-0.06367269012273527}},{"name":"dense0/conv2/depthwise_filter","shape":[3,3,32,1],"dtype":"float32","quantization":{"dtype":"uint8","scale":1,"min":0}},{"name":"dense0/conv2/pointwise_filter","shape":[1,1,32,32],"dtype":"float32","quantization":{"dtype":"uint8","scale":1,"min":0}},{"name":"dense0/conv2/bias","shape":[32],"dtype":"float32","quantization":{"dtype":"uint8","scale":0.0037702228508743585,"min":-0.6220867703942692}},{"name":"dense1/conv0/depthwise_filter","shape":[3,3,32,1],"dtype":"float32","quantization":{"dtype":"uint8","scale":0.0033707996209462483,"min":-0.421349952618281}},{"name":"dense1/conv0/pointwise_filter","shape":[1,1,32,64],"dtype":"float32","quantization":{"dtype":"uint8","scale":0.014611541991140328,"min":-1.8556658328748217}},{"name":"dense1/conv0/bias","shape":[64],"dtype":"float32","quantization":{"dtype":"uint8","scale":0.002832523046755323,"min":-0.30307996600281956}},{"name":"dense1/conv1/depthwise_filter","shape":[3,3,64,1],"dtype":"float32","quantization":{"dtype":"uint8","scale":0.006593170586754294,"min":-0.6329443763284123}},{"name":"dense1/conv1/pointwise_filter","shape":[1,1,64,64],"dtype":"float32","quantization":{"dtype":"uint8","scale":0.012215249211180444,"min":-1.6001976466646382}},{"name":"dense1/conv1/bias","shape":[64],"dtype":"float32","quantization":{"dtype":"uint8","scale":0.002384825547536214,"min":-0.3028728445370992}},{"name":"dense1/conv2/depthwise_filter","shape":[3,3,64,1],"dtype":"float32","quantization":{"dtype":"uint8","scale":0.005859645441466687,"min":-0.7617539073906693}},{"name":"dense1/conv2/pointwise_filter","shape":[1,1,64,64],"dtype":"float32","quantization":{"dtype":"uint8","scale":0.013121426806730382,"min":-1.7845140457153321}},{"name":"dense1/conv2/bias","shape":[64],"dtype":"float32","quantization":{"dtype":"uint8","scale":0.0032247188044529336,"min":-0.46435950784122243}},{"name":"dense2/conv0/depthwise_filter","shape":[3,3,64,1],"dtype":"float32","quantization":{"dtype":"uint8","scale":0.002659512618008782,"min":-0.32977956463308894}},{"name":"dense2/conv0/pointwise_filter","shape":[1,1,64,128],"dtype":"float32","quantization":{"dtype":"uint8","scale":0.015499923743453681,"min":-1.9839902391620712}},{"name":"dense2/conv0/bias","shape":[128],"dtype":"float32","quantization":{"dtype":"uint8","scale":0.0032450980999890497,"min":-0.522460794098237}},{"name":"dense2/conv1/depthwise_filter","shape":[3,3,128,1],"dtype":"float32","quantization":{"dtype":"uint8","scale":0.005911862382701799,"min":-0.792189559282041}},{"name":"dense2/conv1/pointwise_filter","shape":[1,1,128,128],"dtype":"float32","quantization":{"dtype":"uint8","scale":0.021025861478319356,"min":-2.2077154552235325}},{"name":"dense2/conv1/bias","shape":[128],"dtype":"float32","quantization":{"dtype":"uint8","scale":0.00349616945958605,"min":-0.46149436866535865}},{"name":"dense2/conv2/depthwise_filter","shape":[3,3,128,1],"dtype":"float32","quantization":{"dtype":"uint8","scale":0.008104994250278847,"min":-1.013124281284856}},{"name":"dense2/conv2/pointwise_filter","shape":[1,1,128,128],"dtype":"float32","quantization":{"dtype":"uint8","scale":0.029337059282789044,"min":-3.5791212325002633}},{"name":"dense2/conv2/bias","shape":[128],"dtype":"float32","quantization":{"dtype":"uint8","scale":0.0038808938334969913,"min":-0.4230174278511721}},{"name":"fc/weights","shape":[128,136],"dtype":"float32","quantization":{"dtype":"uint8","scale":0.014016061670639936,"min":-1.8921683255363912}},{"name":"fc/bias","shape":[136],"dtype":"float32","quantization":{"dtype":"uint8","scale":0.0029505149698724935,"min":0.088760145008564}}],"paths":["face_landmark_68_tiny_model-shard1"]}]
[
{
"weights": [
{
"name": "dense0/conv0/filters",
"shape": [3, 3, 3, 32],
"dtype": "float32",
"quantization": { "dtype": "uint8", "scale": 0.008194216092427571, "min": -0.9423348506291708 }
},
{
"name": "dense0/conv0/bias",
"shape": [32],
"dtype": "float32",
"quantization": { "dtype": "uint8", "scale": 0.006839508168837603, "min": -0.8412595047670252 }
},
{
"name": "dense0/conv1/depthwise_filter",
"shape": [3, 3, 32, 1],
"dtype": "float32",
"quantization": { "dtype": "uint8", "scale": 0.009194007106855804, "min": -1.2779669878529567 }
},
{
"name": "dense0/conv1/pointwise_filter",
"shape": [1, 1, 32, 32],
"dtype": "float32",
"quantization": { "dtype": "uint8", "scale": 0.0036026100317637128, "min": -0.3170296827952067 }
},
{
"name": "dense0/conv1/bias",
"shape": [32],
"dtype": "float32",
"quantization": { "dtype": "uint8", "scale": 0.000740380117706224, "min": -0.06367269012273527 }
},
{
"name": "dense0/conv2/depthwise_filter",
"shape": [3, 3, 32, 1],
"dtype": "float32",
"quantization": { "dtype": "uint8", "scale": 1, "min": 0 }
},
{
"name": "dense0/conv2/pointwise_filter",
"shape": [1, 1, 32, 32],
"dtype": "float32",
"quantization": { "dtype": "uint8", "scale": 1, "min": 0 }
},
{
"name": "dense0/conv2/bias",
"shape": [32],
"dtype": "float32",
"quantization": { "dtype": "uint8", "scale": 0.0037702228508743585, "min": -0.6220867703942692 }
},
{
"name": "dense1/conv0/depthwise_filter",
"shape": [3, 3, 32, 1],
"dtype": "float32",
"quantization": { "dtype": "uint8", "scale": 0.0033707996209462483, "min": -0.421349952618281 }
},
{
"name": "dense1/conv0/pointwise_filter",
"shape": [1, 1, 32, 64],
"dtype": "float32",
"quantization": { "dtype": "uint8", "scale": 0.014611541991140328, "min": -1.8556658328748217 }
},
{
"name": "dense1/conv0/bias",
"shape": [64],
"dtype": "float32",
"quantization": { "dtype": "uint8", "scale": 0.002832523046755323, "min": -0.30307996600281956 }
},
{
"name": "dense1/conv1/depthwise_filter",
"shape": [3, 3, 64, 1],
"dtype": "float32",
"quantization": { "dtype": "uint8", "scale": 0.006593170586754294, "min": -0.6329443763284123 }
},
{
"name": "dense1/conv1/pointwise_filter",
"shape": [1, 1, 64, 64],
"dtype": "float32",
"quantization": { "dtype": "uint8", "scale": 0.012215249211180444, "min": -1.6001976466646382 }
},
{
"name": "dense1/conv1/bias",
"shape": [64],
"dtype": "float32",
"quantization": { "dtype": "uint8", "scale": 0.002384825547536214, "min": -0.3028728445370992 }
},
{
"name": "dense1/conv2/depthwise_filter",
"shape": [3, 3, 64, 1],
"dtype": "float32",
"quantization": { "dtype": "uint8", "scale": 0.005859645441466687, "min": -0.7617539073906693 }
},
{
"name": "dense1/conv2/pointwise_filter",
"shape": [1, 1, 64, 64],
"dtype": "float32",
"quantization": { "dtype": "uint8", "scale": 0.013121426806730382, "min": -1.7845140457153321 }
},
{
"name": "dense1/conv2/bias",
"shape": [64],
"dtype": "float32",
"quantization": { "dtype": "uint8", "scale": 0.0032247188044529336, "min": -0.46435950784122243 }
},
{
"name": "dense2/conv0/depthwise_filter",
"shape": [3, 3, 64, 1],
"dtype": "float32",
"quantization": { "dtype": "uint8", "scale": 0.002659512618008782, "min": -0.32977956463308894 }
},
{
"name": "dense2/conv0/pointwise_filter",
"shape": [1, 1, 64, 128],
"dtype": "float32",
"quantization": { "dtype": "uint8", "scale": 0.015499923743453681, "min": -1.9839902391620712 }
},
{
"name": "dense2/conv0/bias",
"shape": [128],
"dtype": "float32",
"quantization": { "dtype": "uint8", "scale": 0.0032450980999890497, "min": -0.522460794098237 }
},
{
"name": "dense2/conv1/depthwise_filter",
"shape": [3, 3, 128, 1],
"dtype": "float32",
"quantization": { "dtype": "uint8", "scale": 0.005911862382701799, "min": -0.792189559282041 }
},
{
"name": "dense2/conv1/pointwise_filter",
"shape": [1, 1, 128, 128],
"dtype": "float32",
"quantization": { "dtype": "uint8", "scale": 0.021025861478319356, "min": -2.2077154552235325 }
},
{
"name": "dense2/conv1/bias",
"shape": [128],
"dtype": "float32",
"quantization": { "dtype": "uint8", "scale": 0.00349616945958605, "min": -0.46149436866535865 }
},
{
"name": "dense2/conv2/depthwise_filter",
"shape": [3, 3, 128, 1],
"dtype": "float32",
"quantization": { "dtype": "uint8", "scale": 0.008104994250278847, "min": -1.013124281284856 }
},
{
"name": "dense2/conv2/pointwise_filter",
"shape": [1, 1, 128, 128],
"dtype": "float32",
"quantization": { "dtype": "uint8", "scale": 0.029337059282789044, "min": -3.5791212325002633 }
},
{
"name": "dense2/conv2/bias",
"shape": [128],
"dtype": "float32",
"quantization": { "dtype": "uint8", "scale": 0.0038808938334969913, "min": -0.4230174278511721 }
},
{
"name": "fc/weights",
"shape": [128, 136],
"dtype": "float32",
"quantization": { "dtype": "uint8", "scale": 0.014016061670639936, "min": -1.8921683255363912 }
},
{
"name": "fc/bias",
"shape": [136],
"dtype": "float32",
"quantization": { "dtype": "uint8", "scale": 0.0029505149698724935, "min": 0.088760145008564 }
}
],
"paths": ["face_landmark_68_tiny_model-shard1"]
}
]

View File

@@ -1 +1,57 @@
[{"paths":["mtcnn_model-shard1"],"weights":[{"dtype":"float32","name":"pnet/conv1/weights","shape":[3,3,3,10]},{"dtype":"float32","name":"pnet/conv1/bias","shape":[10]},{"dtype":"float32","name":"pnet/prelu1_alpha","shape":[10]},{"dtype":"float32","name":"pnet/conv2/weights","shape":[3,3,10,16]},{"dtype":"float32","name":"pnet/conv2/bias","shape":[16]},{"dtype":"float32","name":"pnet/prelu2_alpha","shape":[16]},{"dtype":"float32","name":"pnet/conv3/weights","shape":[3,3,16,32]},{"dtype":"float32","name":"pnet/conv3/bias","shape":[32]},{"dtype":"float32","name":"pnet/prelu3_alpha","shape":[32]},{"dtype":"float32","name":"pnet/conv4_1/weights","shape":[1,1,32,2]},{"dtype":"float32","name":"pnet/conv4_1/bias","shape":[2]},{"dtype":"float32","name":"pnet/conv4_2/weights","shape":[1,1,32,4]},{"dtype":"float32","name":"pnet/conv4_2/bias","shape":[4]},{"dtype":"float32","name":"rnet/conv1/weights","shape":[3,3,3,28]},{"dtype":"float32","name":"rnet/conv1/bias","shape":[28]},{"dtype":"float32","name":"rnet/prelu1_alpha","shape":[28]},{"dtype":"float32","name":"rnet/conv2/weights","shape":[3,3,28,48]},{"dtype":"float32","name":"rnet/conv2/bias","shape":[48]},{"dtype":"float32","name":"rnet/prelu2_alpha","shape":[48]},{"dtype":"float32","name":"rnet/conv3/weights","shape":[2,2,48,64]},{"dtype":"float32","name":"rnet/conv3/bias","shape":[64]},{"dtype":"float32","name":"rnet/prelu3_alpha","shape":[64]},{"dtype":"float32","name":"rnet/fc1/weights","shape":[576,128]},{"dtype":"float32","name":"rnet/fc1/bias","shape":[128]},{"dtype":"float32","name":"rnet/prelu4_alpha","shape":[128]},{"dtype":"float32","name":"rnet/fc2_1/weights","shape":[128,2]},{"dtype":"float32","name":"rnet/fc2_1/bias","shape":[2]},{"dtype":"float32","name":"rnet/fc2_2/weights","shape":[128,4]},{"dtype":"float32","name":"rnet/fc2_2/bias","shape":[4]},{"dtype":"float32","name":"onet/conv1/weights","shape":[3,3,3,32]},{"dtype":"float32","name":"onet/conv1/bias","shape":[32]},{"dtype":"float32","name":"onet/prelu1_alpha","shape":[32]},{"dtype":"float32","name":"onet/conv2/weights","shape":[3,3,32,64]},{"dtype":"float32","name":"onet/conv2/bias","shape":[64]},{"dtype":"float32","name":"onet/prelu2_alpha","shape":[64]},{"dtype":"float32","name":"onet/conv3/weights","shape":[3,3,64,64]},{"dtype":"float32","name":"onet/conv3/bias","shape":[64]},{"dtype":"float32","name":"onet/prelu3_alpha","shape":[64]},{"dtype":"float32","name":"onet/conv4/weights","shape":[2,2,64,128]},{"dtype":"float32","name":"onet/conv4/bias","shape":[128]},{"dtype":"float32","name":"onet/prelu4_alpha","shape":[128]},{"dtype":"float32","name":"onet/fc1/weights","shape":[1152,256]},{"dtype":"float32","name":"onet/fc1/bias","shape":[256]},{"dtype":"float32","name":"onet/prelu5_alpha","shape":[256]},{"dtype":"float32","name":"onet/fc2_1/weights","shape":[256,2]},{"dtype":"float32","name":"onet/fc2_1/bias","shape":[2]},{"dtype":"float32","name":"onet/fc2_2/weights","shape":[256,4]},{"dtype":"float32","name":"onet/fc2_2/bias","shape":[4]},{"dtype":"float32","name":"onet/fc2_3/weights","shape":[256,10]},{"dtype":"float32","name":"onet/fc2_3/bias","shape":[10]}]}]
[
{
"paths": ["mtcnn_model-shard1"],
"weights": [
{ "dtype": "float32", "name": "pnet/conv1/weights", "shape": [3, 3, 3, 10] },
{ "dtype": "float32", "name": "pnet/conv1/bias", "shape": [10] },
{ "dtype": "float32", "name": "pnet/prelu1_alpha", "shape": [10] },
{ "dtype": "float32", "name": "pnet/conv2/weights", "shape": [3, 3, 10, 16] },
{ "dtype": "float32", "name": "pnet/conv2/bias", "shape": [16] },
{ "dtype": "float32", "name": "pnet/prelu2_alpha", "shape": [16] },
{ "dtype": "float32", "name": "pnet/conv3/weights", "shape": [3, 3, 16, 32] },
{ "dtype": "float32", "name": "pnet/conv3/bias", "shape": [32] },
{ "dtype": "float32", "name": "pnet/prelu3_alpha", "shape": [32] },
{ "dtype": "float32", "name": "pnet/conv4_1/weights", "shape": [1, 1, 32, 2] },
{ "dtype": "float32", "name": "pnet/conv4_1/bias", "shape": [2] },
{ "dtype": "float32", "name": "pnet/conv4_2/weights", "shape": [1, 1, 32, 4] },
{ "dtype": "float32", "name": "pnet/conv4_2/bias", "shape": [4] },
{ "dtype": "float32", "name": "rnet/conv1/weights", "shape": [3, 3, 3, 28] },
{ "dtype": "float32", "name": "rnet/conv1/bias", "shape": [28] },
{ "dtype": "float32", "name": "rnet/prelu1_alpha", "shape": [28] },
{ "dtype": "float32", "name": "rnet/conv2/weights", "shape": [3, 3, 28, 48] },
{ "dtype": "float32", "name": "rnet/conv2/bias", "shape": [48] },
{ "dtype": "float32", "name": "rnet/prelu2_alpha", "shape": [48] },
{ "dtype": "float32", "name": "rnet/conv3/weights", "shape": [2, 2, 48, 64] },
{ "dtype": "float32", "name": "rnet/conv3/bias", "shape": [64] },
{ "dtype": "float32", "name": "rnet/prelu3_alpha", "shape": [64] },
{ "dtype": "float32", "name": "rnet/fc1/weights", "shape": [576, 128] },
{ "dtype": "float32", "name": "rnet/fc1/bias", "shape": [128] },
{ "dtype": "float32", "name": "rnet/prelu4_alpha", "shape": [128] },
{ "dtype": "float32", "name": "rnet/fc2_1/weights", "shape": [128, 2] },
{ "dtype": "float32", "name": "rnet/fc2_1/bias", "shape": [2] },
{ "dtype": "float32", "name": "rnet/fc2_2/weights", "shape": [128, 4] },
{ "dtype": "float32", "name": "rnet/fc2_2/bias", "shape": [4] },
{ "dtype": "float32", "name": "onet/conv1/weights", "shape": [3, 3, 3, 32] },
{ "dtype": "float32", "name": "onet/conv1/bias", "shape": [32] },
{ "dtype": "float32", "name": "onet/prelu1_alpha", "shape": [32] },
{ "dtype": "float32", "name": "onet/conv2/weights", "shape": [3, 3, 32, 64] },
{ "dtype": "float32", "name": "onet/conv2/bias", "shape": [64] },
{ "dtype": "float32", "name": "onet/prelu2_alpha", "shape": [64] },
{ "dtype": "float32", "name": "onet/conv3/weights", "shape": [3, 3, 64, 64] },
{ "dtype": "float32", "name": "onet/conv3/bias", "shape": [64] },
{ "dtype": "float32", "name": "onet/prelu3_alpha", "shape": [64] },
{ "dtype": "float32", "name": "onet/conv4/weights", "shape": [2, 2, 64, 128] },
{ "dtype": "float32", "name": "onet/conv4/bias", "shape": [128] },
{ "dtype": "float32", "name": "onet/prelu4_alpha", "shape": [128] },
{ "dtype": "float32", "name": "onet/fc1/weights", "shape": [1152, 256] },
{ "dtype": "float32", "name": "onet/fc1/bias", "shape": [256] },
{ "dtype": "float32", "name": "onet/prelu5_alpha", "shape": [256] },
{ "dtype": "float32", "name": "onet/fc2_1/weights", "shape": [256, 2] },
{ "dtype": "float32", "name": "onet/fc2_1/bias", "shape": [2] },
{ "dtype": "float32", "name": "onet/fc2_2/weights", "shape": [256, 4] },
{ "dtype": "float32", "name": "onet/fc2_2/bias", "shape": [4] },
{ "dtype": "float32", "name": "onet/fc2_3/weights", "shape": [256, 10] },
{ "dtype": "float32", "name": "onet/fc2_3/bias", "shape": [10] }
]
}
]

Some files were not shown because too many files have changed in this diff Show More