当前位置: 首页>>代码示例>>C#>>正文


C# System.Decimal类代码示例

本文整理汇总了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;
            
        }
开发者ID:cthaeh,项目名称:NINIRODIE-HOTEL,代码行数:29,代码来源:RepositorioCliente.cs

示例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;
        }
开发者ID:andreibaptista,项目名称:DEF_PUB_DEFNET_PORTAL,代码行数:26,代码来源:PERIODOXSETORDo.cs

示例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);
        }
开发者ID:cthaeh,项目名称:NINIRODIE-HOTEL,代码行数:7,代码来源:RepositorioEscoit.cs

示例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);
        }
开发者ID:nicombrana,项目名称:NINIRODIE-GestionDeDatos2014,代码行数:7,代码来源:RepositorioUsuario.cs

示例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;
 }
开发者ID:kzfabi,项目名称:EntitiesToDTOs,代码行数:7,代码来源:DTOs.cs

示例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;
        }
开发者ID:davidxiao93,项目名称:ScenarioWeek4,代码行数:28,代码来源:MainWindow.xaml.cs

示例7: SaveToDecimalTestCase1

        public void SaveToDecimalTestCase1()
        {
            var expected = new Decimal( RandomValueEx.GetRandomInt32() );
            var actual = "InvalidValue".SaveToDecimal( expected );

            Assert.AreEqual( expected, actual );
        }
开发者ID:MannusEtten,项目名称:Extend,代码行数:7,代码来源:String.SaveToDecimal.Test.cs

示例8: AddItem

 public virtual void AddItem(string IDOP, Decimal Cantidad)
 {
     ItemGuiaRemision Item = new ItemGuiaRemision();
     Item.IDOrdenProduccion = IDOP;
     Item.Cantidad = Cantidad;
     Items.Add(Item);
 }
开发者ID:eldersontc,项目名称:soft-erp,代码行数:7,代码来源:GuiaRemision.cs

示例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");
     }
 }
开发者ID:andymuncey,项目名称:ValidationMissing,代码行数:7,代码来源:DataProcessor.cs

示例10: GetTweet

 public Tweet GetTweet(Decimal id)
 {
     Tweet tweet = (from t in _entity.Tweets
                    where t.ID == id
                    select t).FirstOrDefault();
     return tweet;
 }
开发者ID:fantattitude,项目名称:Tweetasse,代码行数:7,代码来源:TweetEntity.cs

示例11: edtRaiDecimal_ValueChanged

 private void edtRaiDecimal_ValueChanged(object sender, EventArgs e)
 {
     if (!mChanging)
     {
         Area = edtRaiDecimal.Value * SquareKilometerToRai;
     }
 }
开发者ID:PaulCharlton,项目名称:tambon,代码行数:7,代码来源:UnitConverterForm.cs

示例12: WalkingData

 public WalkingData(Decimal probability, int steps, int x, int y)
 {
     this.Probability = probability;
     this.Steps = steps;
     this.X = x;
     this.Y = y;
 }
开发者ID:bloodysnowx,项目名称:ProgramContest,代码行数:7,代码来源:CrazyBotSolver2.cs

示例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;
        }
开发者ID:jquirogadesarrollador,项目名称:Varu,代码行数:32,代码来源:ControlContratos.cs

示例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);
        }
开发者ID:FlyingPie,项目名称:BeatsByBauk,代码行数:27,代码来源:Formatting.cs

示例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;
        }
开发者ID:VydorScope,项目名称:CashRegister,代码行数:26,代码来源:TransactionClass.cs


注:本文中的System.Decimal类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。