using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace C2P_Data
{
///
/// utility generali applicazione
///
public class utils
{
protected utils()
{
// avvio componente, nulla da fare...
}
///
/// Calcola css dato valore prezzo offerto vs importi full cost e min price
///
///
///
///
///
///
///
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;
}
///
/// singleton gestione utility
///
public static utils man = new utils();
}
}