Compare commits
1 Commits
Feature/fi
...
Feature/In
| Author | SHA1 | Date | |
|---|---|---|---|
| cae82ed702 |
@@ -1,17 +1,10 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Diagnostics;
|
|
||||||
using System.Drawing;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using _0_Framework.Application;
|
using _0_Framework.Application;
|
||||||
using _0_Framework.Application.Sms;
|
using _0_Framework.Application.Sms;
|
||||||
using CompanyManagment.App.Contracts.Checkout;
|
|
||||||
using CompanyManagment.App.Contracts.Law;
|
using CompanyManagment.App.Contracts.Law;
|
||||||
using CompanyManagment.App.Contracts.TemporaryClientRegistration;
|
using CompanyManagment.App.Contracts.TemporaryClientRegistration;
|
||||||
using CompanyManagment.App.Contracts.Workshop;
|
|
||||||
using CompanyManagment.App.Contracts.WorkshopPlan;
|
|
||||||
using Microsoft.AspNetCore.Mvc;
|
|
||||||
|
|
||||||
namespace CompanyManagment.App.Contracts.InstitutionContract;
|
namespace CompanyManagment.App.Contracts.InstitutionContract;
|
||||||
|
|
||||||
@@ -80,11 +73,6 @@ public interface IInstitutionContractApplication
|
|||||||
|
|
||||||
|
|
||||||
[Obsolete("استفاده نشود، از متد غیرهمزمان استفاده شود")]
|
[Obsolete("استفاده نشود، از متد غیرهمزمان استفاده شود")]
|
||||||
/// <summary>
|
|
||||||
/// چاپ یک قرارداد
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="id">شناسه قرارداد</param>
|
|
||||||
/// <returns>اطلاعات قرارداد برای چاپ</returns>
|
|
||||||
InstitutionContractViewModel PrintOne(long id);
|
InstitutionContractViewModel PrintOne(long id);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -164,6 +152,14 @@ public interface IInstitutionContractApplication
|
|||||||
|
|
||||||
#region Api
|
#region Api
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// غیر فعال کردن قرارداد - اگر بدهی داشته باشد حالت آبی میشود.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="id"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task DeActiveAsync(long id);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// لیست قرارداد های مالی
|
/// لیست قرارداد های مالی
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -917,6 +917,26 @@ public class InstitutionContractApplication : IInstitutionContractApplication
|
|||||||
return _institutionContractRepository.GetcontractAmount(countPerson);
|
return _institutionContractRepository.GetcontractAmount(countPerson);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public async Task DeActiveAsync(long id)
|
||||||
|
{
|
||||||
|
var institutionContract = _institutionContractRepository.Get(id);
|
||||||
|
if (institutionContract == null)
|
||||||
|
{
|
||||||
|
throw new NotFoundException("رکورد مورد نظر یافت نشد");
|
||||||
|
}
|
||||||
|
|
||||||
|
var financialStatement =await _financialStatmentRepository.GetByContractingPartyId(id);
|
||||||
|
var balanceAmount =await _financialStatmentRepository.GetBalanceAmount(financialStatement.id);
|
||||||
|
if (balanceAmount.Amount>0)
|
||||||
|
{
|
||||||
|
institutionContract.DeActiveBlue();
|
||||||
|
}else
|
||||||
|
{
|
||||||
|
institutionContract.DeActive();
|
||||||
|
}
|
||||||
|
await _institutionContractRepository.SaveChangesAsync();
|
||||||
|
}
|
||||||
|
|
||||||
public async Task<PagedResult<GetInstitutionContractListItemsViewModel>> GetList(
|
public async Task<PagedResult<GetInstitutionContractListItemsViewModel>> GetList(
|
||||||
InstitutionContractListSearchModel searchModel)
|
InstitutionContractListSearchModel searchModel)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -166,11 +166,9 @@ public class RollCallEmployeeApplication : IRollCallEmployeeApplication
|
|||||||
return false;
|
return false;
|
||||||
var now = DateTime.Now;
|
var now = DateTime.Now;
|
||||||
return _rollCallEmployeeStatusRepository.Exists(x => x.RollCallEmployeeId == rollCallEmployee.Id && x.StartDate < now && x.EndDate > now);
|
return _rollCallEmployeeStatusRepository.Exists(x => x.RollCallEmployeeId == rollCallEmployee.Id && x.StartDate < now && x.EndDate > now);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<RollCallEmployeeViewModel> GetEmployeeRollCalls(long workshopId)
|
public List<RollCallEmployeeViewModel> GetEmployeeRollCalls(long workshopId)
|
||||||
{
|
{
|
||||||
return _rollCallEmployeeRepository.GetEmployeeRollCalls(workshopId);
|
return _rollCallEmployeeRepository.GetEmployeeRollCalls(workshopId);
|
||||||
|
|||||||
@@ -413,6 +413,7 @@ public class FinancialStatmentRepository : RepositoryBase<long, FinancialStatmen
|
|||||||
|
|
||||||
public async Task<FinancialStatment> GetByContractingPartyId(long contractingPartyId)
|
public async Task<FinancialStatment> GetByContractingPartyId(long contractingPartyId)
|
||||||
{
|
{
|
||||||
return await _context.FinancialStatments.FirstOrDefaultAsync(x => x.ContractingPartyId == contractingPartyId);
|
return await _context.FinancialStatments
|
||||||
|
.FirstOrDefaultAsync(x => x.ContractingPartyId == contractingPartyId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -210,37 +210,24 @@ public class institutionContractController : AdminBaseController
|
|||||||
return new JsonResult(result);
|
return new JsonResult(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
// /// <summary>
|
||||||
/// حذف قرارداد مالی
|
// /// حذف قرارداد مالی
|
||||||
/// </summary>
|
// /// </summary>
|
||||||
/// <param name="id"></param>
|
// /// <param name="id"></param>
|
||||||
/// <returns></returns>
|
// /// <returns></returns>
|
||||||
[HttpDelete("{id}")]
|
// [HttpDelete("{id}")]
|
||||||
public async Task<ActionResult<OperationResult>> Remove(long id)
|
// public async Task<ActionResult<OperationResult>> Remove(long id)
|
||||||
{
|
// {
|
||||||
_institutionContractApplication.RemoveContract(id);
|
// _institutionContractApplication.RemoveContract(id);
|
||||||
return new OperationResult().Succcedded();
|
// return new OperationResult().Succcedded();
|
||||||
|
//
|
||||||
}
|
// }
|
||||||
|
|
||||||
[HttpPost("deActive/{id}")]
|
[HttpPost("deActive/{id}")]
|
||||||
public ActionResult<OperationResult> DeActive(long id, string balance)
|
public async Task<ActionResult> DeActive(long id)
|
||||||
{
|
{
|
||||||
var result = new OperationResult();
|
await _institutionContractApplication.DeActiveAsync(id);
|
||||||
if (balance == "0")
|
return Ok();
|
||||||
{
|
|
||||||
result = _institutionContractApplication.DeActive(id);
|
|
||||||
if (result.IsSuccedded) result = _institutionContractApplication.DeActiveAllConnections(id);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
result = _institutionContractApplication.DeActiveBlue(id);
|
|
||||||
if (result.IsSuccedded)
|
|
||||||
result = _institutionContractApplication.DeActiveAllConnections(id);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
return result;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
Reference in New Issue
Block a user