institutionContract bug 0 fixed add new date coler for expiered
This commit is contained in:
@@ -25,7 +25,7 @@ public interface IInstitutionContractRepository : IRepository<long, InstitutionC
|
||||
|
||||
double GetcontractAmount(int countPerson);
|
||||
|
||||
string ExpColor(DateTime contractEndGr, double contractAmount,
|
||||
(string result, string isExpier) ExpColor(DateTime contractEndGr, double contractAmount,
|
||||
string isActiveString);
|
||||
|
||||
TotalbalancViewModel TotalBalance(long contractingPartyId);
|
||||
|
||||
@@ -69,4 +69,5 @@ public class InstitutionContractViewModel
|
||||
public double ValueAddedTax { get; set; }
|
||||
public int LeftWorkEmployeeCount { get; set; }
|
||||
public int InsuranceLeftWorkEmployeeCount { get; set; }
|
||||
public string IsExpier { get; set; }
|
||||
}
|
||||
@@ -397,7 +397,9 @@ public class InstitutionContractRepository : RepositoryBase<long, InstitutionCon
|
||||
TypeOfContract = x.TypeOfContract,
|
||||
Signature = x.Signature,
|
||||
ExpireColor = ExpColor(x.ContractEndGr, x.SearchAmount,
|
||||
x.IsActiveString),
|
||||
x.IsActiveString).result,
|
||||
IsExpier = ExpColor(x.ContractEndGr, x.SearchAmount,
|
||||
x.IsActiveString).isExpier,
|
||||
BalanceDouble = TotalBalance(x.ContractingPartyId).TotalBalanceDbl,
|
||||
BalanceStr = TotalBalance(x.ContractingPartyId).TotalBalanceStr,
|
||||
EmployerViewModels = x.EmployerViewModels,
|
||||
@@ -441,6 +443,7 @@ public class InstitutionContractRepository : RepositoryBase<long, InstitutionCon
|
||||
TypeOfContract = x.TypeOfContract,
|
||||
Signature = x.Signature,
|
||||
ExpireColor = x.ExpireColor,
|
||||
IsExpier = x.IsExpier,
|
||||
BalanceDouble = x.BalanceDouble,
|
||||
BalanceStr = x.BalanceStr,
|
||||
EmployerViewModels = x.EmployerViewModels,
|
||||
@@ -458,7 +461,7 @@ public class InstitutionContractRepository : RepositoryBase<long, InstitutionCon
|
||||
|
||||
}).OrderBy(x => x.WorkshopCount != "0" && string.IsNullOrWhiteSpace(x.ExpireColor))
|
||||
.ThenBy(x => x.WorkshopCount == "0" && string.IsNullOrWhiteSpace(x.ExpireColor))
|
||||
.ThenBy(x => x.ExpireColor == "red")
|
||||
.ThenBy(x => x.IsExpier == "true")
|
||||
.ThenBy(x => x.ExpireColor == "purple")
|
||||
.ThenBy(x => x.ExpireColor == "black").ToList();
|
||||
Console.WriteLine("test >>> " + timer.Elapsed);
|
||||
@@ -577,7 +580,7 @@ public class InstitutionContractRepository : RepositoryBase<long, InstitutionCon
|
||||
return res;
|
||||
}
|
||||
|
||||
public string ExpColor(DateTime contractEndGr, double contractAmount,
|
||||
public (string result, string isExpier) ExpColor(DateTime contractEndGr, double contractAmount,
|
||||
string isActiveString)
|
||||
{
|
||||
var now = DateTime.Now;
|
||||
@@ -585,16 +588,35 @@ public class InstitutionContractRepository : RepositoryBase<long, InstitutionCon
|
||||
var endFa = nowFa.FindeEndOfMonth();
|
||||
var endThisMontGr = endFa.ToGeorgianDateTime();
|
||||
string result = "";
|
||||
|
||||
string isExpier = "false";
|
||||
if (contractEndGr < now)
|
||||
{
|
||||
result = "black";
|
||||
isExpier = "true";
|
||||
}
|
||||
|
||||
if (contractEndGr >= now && contractEndGr <= endThisMontGr)
|
||||
{
|
||||
result = "red";
|
||||
isExpier = "true";
|
||||
}
|
||||
|
||||
if (contractAmount == 0)
|
||||
{
|
||||
result = "purple";
|
||||
if ((contractEndGr >= now && contractEndGr <= endThisMontGr) || (contractEndGr < now))
|
||||
{
|
||||
isExpier = "true";
|
||||
}
|
||||
}
|
||||
|
||||
if (isActiveString == "blue")
|
||||
{
|
||||
result = "blue";
|
||||
return result;
|
||||
isExpier = "false";
|
||||
}
|
||||
|
||||
return (result, isExpier);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1108,10 +1108,10 @@
|
||||
<td class="hidden-xs" style="font-family: 'IranText' !important; font-size: 12px !important; text-align: center; width: 30px">
|
||||
@item.EmployeeCount
|
||||
</td>
|
||||
<td class="hidden-xs" style="font-family: 'IranSans' !important; font-size: 12px !important; text-align: center;width: 50px">
|
||||
<td class="hidden-xs @(item.IsExpier == "true" ? "bgRed" : "")" style="font-family: 'IranSans' !important; font-size: 12px !important; text-align: center;width: 50px">
|
||||
@item.ContractStartFa
|
||||
</td>
|
||||
<td class="hidden-xs" style="font-family: 'IranSans' !important; font-size: 12px !important; text-align: center;width: 50px">
|
||||
<td class="hidden-xs @(item.IsExpier == "true" ? "bgRed" : "")" style="font-family: 'IranSans' !important; font-size: 12px !important; text-align: center;width: 50px">
|
||||
@item.ContractEndFa
|
||||
</td>
|
||||
<td class="hidden-xs" style="font-family: 'IranSans' !important; font-size: 12px !important; text-align: center;width: 50px">
|
||||
|
||||
@@ -91,7 +91,7 @@ public class IndexModel : PageModel
|
||||
new SelectList(_representativeApplication.GetRepresentatives(), "Id", "FullName");
|
||||
|
||||
InstitutionContracts = _institutionContract.NewSearch(searchModel)
|
||||
.OrderByDescending(x => x.IsActiveString == "blue").ThenByDescending(x => x.IsContractingPartyBlock)
|
||||
.OrderByDescending(x => x.IsActiveString == "blue").ThenByDescending(x => x.IsContractingPartyBlock == "true" && x.IsExpier == "false")
|
||||
.ToList();
|
||||
|
||||
var totalAmounts = InstitutionContracts.Where(x => x.IsActiveString == "true").Sum(x => x.SearchAmount);
|
||||
|
||||
@@ -239,7 +239,7 @@
|
||||
|
||||
|
||||
}
|
||||
if (start.length == 10 && end.length == 10 && amount.length > 1) {
|
||||
if (start.length == 10 && end.length == 10 && amount.length >= 1) {
|
||||
$.ajax({
|
||||
/* contentType: 'charset=utf-8',*/
|
||||
async: false,
|
||||
|
||||
@@ -209,7 +209,7 @@
|
||||
|
||||
|
||||
}
|
||||
if (start.length == 10 && end.length == 10 && amount.length > 1) {
|
||||
if (start.length == 10 && end.length == 10 && amount.length >= 1) {
|
||||
$.ajax({
|
||||
/* contentType: 'charset=utf-8',*/
|
||||
async: false,
|
||||
|
||||
@@ -199,7 +199,7 @@ function calculateTotalAmount() {
|
||||
|
||||
}
|
||||
console.log($('#officialStatus').val());
|
||||
if (start.length == 10 && end.length == 10 && amount.length > 1) {
|
||||
if (start.length == 10 && end.length == 10 && amount.length >= 1) {
|
||||
$.ajax({
|
||||
/* contentType: 'charset=utf-8',*/
|
||||
async: false,
|
||||
|
||||
Reference in New Issue
Block a user