コード例 #1
0
ファイル: ExchangeType.cs プロジェクト: cafc79/SIA
        public ExchangeTypeCompositeType GetExchangeTypeById(int iIdExchangeType)
        {
            ExchangeTypeCompositeType et = new ExchangeTypeCompositeType();

            //try
            //{
            param          = new SqlParameter[1];
            param[0]       = new SqlParameter("@fiid_Exchange_type", SqlDbType.Int);
            param[0].Value = iIdExchangeType;


            DataTable dt = objDB.ExecStore("sp_getExchangeTypeById", param);


            et.iIdExchangeType = int.Parse(dt.Rows[0].ItemArray[0].ToString());
            et.sDescription    = dt.Rows[0].ItemArray[1].ToString();
            et.bStatus         = bool.Parse(dt.Rows[0].ItemArray[2].ToString());
            et.sInitial        = dt.Rows[0].ItemArray[3].ToString();

            return(et);
            //}
            //catch (Exception ex)
            //{
            //    throw ex.Message();
            //}
        }
コード例 #2
0
ファイル: ExchangeType.cs プロジェクト: cafc79/SIA
        /// <summary>
        /// Obtiene todos los Tipos de Cambio
        /// </summary>
        /// <returns></returns>
        public List <ExchangeTypeCompositeType> getAll()
        {
            List <ExchangeTypeCompositeType> lst = new List <ExchangeTypeCompositeType>();


            //try
            //{

            DataTable dt = objDB.Consult("sp_selectExchangeType");


            foreach (DataRow dr in dt.Rows)
            {
                ExchangeTypeCompositeType et = new ExchangeTypeCompositeType();
                et.iIdExchangeType = int.Parse(dr.ItemArray[0].ToString());
                et.sDescription    = dr.ItemArray[1].ToString();
                et.bStatus         = bool.Parse(dr.ItemArray[2].ToString());
                et.sInitial        = dr.ItemArray[3].ToString();

                lst.Add(et);
            }
            return(lst);
            //}
            //catch (Exception ex)
            //{
            //    throw ex.Message();
            //}
        }