當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。