예제 #1
0
        //BE_ReqTipodeCambio Request)
        //---------------------------------
        //Get_TipodeCambio (compra -  venta)
        //---------------------------------
        public DataTable Get_TipodeCambio(long nMonCodigo, string nFlag, string dFechaSys, long anno, long mes)
        {
            //Recuperando registros
            DataTable dt = new DataTable();

            BE_ReqTipodeCambio ReqTC = new BE_ReqTipodeCambio();
            DA_Sistema daTC = new DA_Sistema();

            //--------------
            //Tipo de cambio
            //--------------
            ReqTC.nMonCodigo = nMonCodigo; // Convert.ToInt32(row["nMonCodigo"]); // nMonCodigo;
            ReqTC.nAnno = anno;
            ReqTC.nMes = mes;
            ReqTC.nFlag = nFlag;  //"TCD";
            ReqTC.cFecha = String.Format("{0:dd/MM/yyyy}", dFechaSys);

            return daTC.Get_TipodeCambio(ReqTC);
        }
예제 #2
0
        //----------------------------------------
        //Obtener Tipo de cambio (Compra - venta)
        //----------------------------------------
        public DataTable Get_TipodeCambio(BE_ReqTipodeCambio Request)
        {
            DataTable dt = new DataTable();
            try
            {
                clsConection Obj = new clsConection();
                string Cadena = Obj.GetConexionString("Naylamp");

                using (SqlConnection cn = new SqlConnection(Cadena))
                {
                    cn.Open();

                    using (SqlCommand cm = new SqlCommand())
                    {
                        cm.CommandText = "[usp_Get_TipodeCambio]";
                        cm.CommandType = CommandType.StoredProcedure;
                        cm.Parameters.AddWithValue("nMonCodigo", Request.nMonCodigo);
                        cm.Parameters.AddWithValue("nAnno ", Request.nAnno);
                        cm.Parameters.AddWithValue("nMes", Request.nMes);

                        cm.Parameters.AddWithValue("nFlag", Request.nFlag);
                        cm.Parameters.AddWithValue("cFecha", Request.cFecha);
                        cm.Connection = cn;

                        using (SqlDataReader dr = cm.ExecuteReader())
                            dt.Load(dr);
                    }
                }

            }
            catch (Exception)
            {
                throw;
            }
            return dt;
        }