cc34d00fc5
fix colori x newProduct e quote detail e elenco (cambioa verde/giallo/rosso con pari criteri), aggiunto componente in utils x calcolo css
71 lines
2.0 KiB
C#
71 lines
2.0 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
|
|
namespace C2P_Data
|
|
{
|
|
/// <summary>
|
|
/// utility generali applicazione
|
|
/// </summary>
|
|
public class utils
|
|
{
|
|
|
|
protected utils()
|
|
{
|
|
// avvio componente, nulla da fare...
|
|
}
|
|
/// <summary>
|
|
/// Calcola css dato valore prezzo offerto vs importi full cost e min price
|
|
/// </summary>
|
|
/// <param name="QuoteType"></param>
|
|
/// <param name="FullCost"></param>
|
|
/// <param name="MinPrice"></param>
|
|
/// <param name="MinPrice_sim"></param>
|
|
/// <param name="PriceOff"></param>
|
|
/// <returns></returns>
|
|
public static string priceVsCost(object _quoteType, object _FullCost, object _MinPrice, object _MinPrice_sim, object _PriceOff)
|
|
{
|
|
string answ = "";
|
|
string QType = "";
|
|
double FullCost = 0;
|
|
double MinPrice = 0;
|
|
double PriceOff = 0;
|
|
try
|
|
{
|
|
QType = _quoteType.ToString();
|
|
FullCost = Convert.ToDouble(_FullCost);
|
|
if (QType == "S")
|
|
{
|
|
MinPrice = Convert.ToDouble(_MinPrice_sim);
|
|
}
|
|
else
|
|
{
|
|
MinPrice = Convert.ToDouble(_MinPrice);
|
|
}
|
|
PriceOff = Convert.ToDouble(_PriceOff);
|
|
}
|
|
catch
|
|
{ }
|
|
if (PriceOff > MinPrice && (FullCost > 0 && MinPrice > 0))
|
|
{
|
|
answ = "allOk";
|
|
}
|
|
else if (PriceOff > FullCost && (FullCost > 0 && MinPrice > 0))
|
|
{
|
|
answ = "warnOrange";
|
|
}
|
|
else
|
|
{
|
|
answ = "warnRed";
|
|
}
|
|
return answ;
|
|
}
|
|
|
|
/// <summary>
|
|
/// singleton gestione utility
|
|
/// </summary>
|
|
public static utils man = new utils();
|
|
}
|
|
}
|