本文整理汇总了C#中System.Decimal类的典型用法代码示例。如果您正苦于以下问题:C# Decimal类的具体用法?C# Decimal怎么用?C# Decimal使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Decimal类属于System命名空间,在下文中一共展示了Decimal类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: BuscarClienteD
//-----------------------------------
public List<Cliente> BuscarClienteD(String apellido, String nombre, String mail, Decimal documento)
{
var query = String.Format(@"Select * FROM LA_REVANCHA.CLIENTE WHERE 1 = 1 ");
if (apellido != "")
{
query = query + "AND CLI_APELLIDO = '" + apellido + "' ";
}
if (nombre != "")
{
query = query + "AND CLI_NOMBRE = '" + nombre + "' ";
}
if (documento != 0)
{
query = query + "AND CLI_NUMERO_IDENTIFICACION = " + documento;
}
if (mail != "")
{
query = query + "AND CLI_MAIL = '" + mail + "' ";
}
DataRowCollection dataRow = SQLUtils.EjecutarConsultaSimple(query, "LA_REVANCHA.CLIENTE");
var clientes = dataRow.ToList<Cliente>(this.DataRowToCliente);
return clientes;
}
示例2: GetAllPERIODOXSETORNOME
public static DataTable GetAllPERIODOXSETORNOME(
ConnectionInfo pInfo, Decimal pSET_ID
)
{
string lQuery = "";
DataTable lTable = new DataTable();
// lQuery = PERIODOXSETORQD.qPERIODOXSETORList;
// lQuery += @" WHERE PERQ_STATUS='A'
// AND S.SET_ID = P.SET_ID
// AND S.SET_STATUS='A'
// AND P.PERQ_DIAINICIO <= SYSDATE
// AND P.PERQ_DATAFIM >= SYSDATE
// AND S.SET_ID = " + pSET_ID;
lQuery += @" SELECT S.*,P.*
from PERIODOXSETOR P , SETOR S WHERE PERQ_STATUS='A'
AND S.SET_ID = P.SET_ID
AND S.SET_STATUS='A'
AND S.SET_ID = " + pSET_ID;
SelectCommand lSelect = new SelectCommand(lQuery);
lTable = lSelect.ReturnData(Instance.CreateDatabase(pInfo));
return lTable;
}
示例3: ActualizarEscoit
public void ActualizarEscoit(Decimal cod_estadia, Decimal cod_consumible, Decimal cod_item)
{
var query = String.Format(@"UPDATE LA_REVANCHA.ESTADIA_CONSUMIBLE_ITEM SET ESCOIT_COD_ITEM = '{0}' WHERE ESCOIT_COD_ESTADIA = '{1}' AND ESCOIT_COD_CONSUMIBLE = '{2}'",
cod_item, cod_estadia, cod_consumible);
SQLUtils.EjecutarConsultaConEfectoDeLado(query);
}
示例4: BajarCliente
public void BajarCliente(Decimal codigo, int habilitado)
{
var query = String.Format(@"UPDATE NINIRODIE.USUARIO SET USU_HABILITADO = " +
"'{0}' WHERE USU_CODIGO = '{1}'", habilitado, codigo);
SQLUtils.EjecutarConsultaConEfectoDeLado(query);
}
示例5: AccountDTO
public AccountDTO(Int32 accountID, Decimal balance, CurrencyType currency, Int32 client_ClientID)
{
this.AccountID = accountID;
this.Balance = balance;
this.Currency = currency;
this.Client_ClientID = client_ClientID;
}
示例6: GetIncrements
public static List<Decimal> GetIncrements(Decimal lowerBound, Decimal upperBound)
{
if (lowerBound >= upperBound)
{
return null;
}
Decimal range = upperBound - lowerBound;
int magnitude = (int)Math.Floor(Math.Log10((double)range));
if (range < 1)
{
magnitude++;
}
Decimal step = (Decimal)Math.Pow(10, magnitude) / 10;
Decimal value = (step * (Decimal)Math.Floor((double)(lowerBound / step)));
if (value < lowerBound)
{
value += step;
}
List<Decimal> returnList = new List<Decimal>();
while (value < upperBound + step)
{
returnList.Add((Decimal)Math.Round((double)value, 2));
value += step;
}
return returnList;
}
示例7: SaveToDecimalTestCase1
public void SaveToDecimalTestCase1()
{
var expected = new Decimal( RandomValueEx.GetRandomInt32() );
var actual = "InvalidValue".SaveToDecimal( expected );
Assert.AreEqual( expected, actual );
}
示例8: AddItem
public virtual void AddItem(string IDOP, Decimal Cantidad)
{
ItemGuiaRemision Item = new ItemGuiaRemision();
Item.IDOrdenProduccion = IDOP;
Item.Cantidad = Cantidad;
Items.Add(Item);
}
示例9: SetMPG
public void SetMPG(Decimal urban, Decimal combined, Decimal extraUrban)
{
if (!(urban < combined && combined < extraUrban))
{
throw new Exception("Invalid MPG values detected, maybe you have a Volkswagen");
}
}
示例10: GetTweet
public Tweet GetTweet(Decimal id)
{
Tweet tweet = (from t in _entity.Tweets
where t.ID == id
select t).FirstOrDefault();
return tweet;
}
示例11: edtRaiDecimal_ValueChanged
private void edtRaiDecimal_ValueChanged(object sender, EventArgs e)
{
if (!mChanging)
{
Area = edtRaiDecimal.Value * SquareKilometerToRai;
}
}
示例12: WalkingData
public WalkingData(Decimal probability, int steps, int x, int y)
{
this.Probability = probability;
this.Steps = steps;
this.X = x;
this.Y = y;
}
示例13: ObtenerInformacionParaSemaforoPrincipal
public DataTable ObtenerInformacionParaSemaforoPrincipal(Decimal ID_EMPRESA)
{
Conexion conexion = new Conexion(Empresa);
DataSet _dataSet = new DataSet();
DataView _dataView = new DataView();
DataTable _dataTable = new DataTable();
String sql = null;
Boolean ejecutar = true;
sql = "usp_nom_empleados_obtenerSemaforoPrincipalGestionHumana ";
sql += ID_EMPRESA.ToString();
if (ejecutar)
{
try
{
_dataSet = conexion.ExecuteReader(sql);
_dataView = _dataSet.Tables[0].DefaultView;
_dataTable = _dataView.Table;
}
catch (Exception e)
{
MensajeError = e.Message;
}
finally
{
conexion.Desconectar();
}
}
return _dataTable;
}
示例14: FormatSeconds
public static string FormatSeconds(long seconds)
{
Decimal time = new Decimal(seconds);
string suffix;
if (time > OneDay)
{
time /= OneDay;
suffix = " days";
}
else if (time > OneHour)
{
time /= OneHour;
suffix = " hours";
}
else if (time > OneMinute)
{
time /= OneMinute;
suffix = " minutes";
}
else
{
suffix = " seconds";
}
return String.Format("{0}{1}", Math.Round(time), suffix);
}
示例15: makeChange
private List<ChangeClass> makeChange(Decimal change,List<CurrencyClass> currencyList)
{
List<ChangeClass> results = new List<ChangeClass>();
foreach (CurrencyClass currency in currencyList)
{
//since the list is sorted, we can just start at the top and work down
int units = 0;
if (currency.Value > change)
{
continue; //nothing to do for this amount
}
else
{
//do the math as integers to capture the whole numbers
int changeInt = Convert.ToInt32(Decimal.Round(change*100));
int valueInt = Convert.ToInt32(Decimal.Round(currency.Value*100));
units = changeInt / valueInt;
results.Add(new ChangeClass(units,currency));
change = change - units * currency.Value;
}
}
return results;
}