Ejemplo n.º 1
0
 public static OutcomeDC OutcomeBEConvertirOutcomeDC(OutcomeEntity oOutcomeBE)
 {
     try
     {
         OutcomeDC oOutcomeDC = new OutcomeDC();
         oOutcomeDC.OutcomeId = oOutcomeBE.OutcomeId;
         oOutcomeDC.OutcomeNombre = oOutcomeBE.OutcomeNombre;
         oOutcomeDC.OutcomeDescripcion = oOutcomeBE.OutcomeDescripcion;
         return oOutcomeDC;
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Ejemplo n.º 2
0
        public static OutcomeEntity OutcomeDCConvertirOutcomeBE(OutcomeDC oOutcomeDC)
        {
            try
            {
                OutcomeEntity oOutcomeBE = new OutcomeEntity();
                oOutcomeBE.OutcomeId = oOutcomeDC.OutcomeId;
                oOutcomeBE.OutcomeNombre = oOutcomeDC.OutcomeNombre;

                return oOutcomeBE;
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Ejemplo n.º 3
0
        public List<OutcomeEntity> ListarOutcomePorCarreraId(int CarreraId)
        {
            List<OutcomeEntity> lista = new List<OutcomeEntity>();
            SqlConnection cn = new SqlConnection(ConfigurationManager.ConnectionStrings["SSIA2013"].ToString());
            SqlCommand cmd = cn.CreateCommand();
            cmd.CommandText = "[SIGERCOV].[uspListarOutcomePorCarreraId]";
            cmd.CommandType = CommandType.StoredProcedure;

            OutcomeEntity item = null;

            SQLHelper.AddParam(ref cmd, "@CarreraId", ParameterDirection.Input, SqlDbType.Int, CarreraId);

            try
            {
                cn.Open();
                SqlDataReader dr = cmd.ExecuteReader(CommandBehavior.CloseConnection);
                while (dr.Read())
                {
                    item = new OutcomeEntity();

                    item.OutcomeId = dr.GetInt32(dr.GetOrdinal("OutcomeId"));
                    item.OutcomeNombre = dr.GetString(dr.GetOrdinal("OutcomeNombre")).ToString();
                    item.OutcomeDescripcion = dr.GetString(dr.GetOrdinal("OutcomeDescripcion")).ToString();
                    lista.Add(item);
                }
                dr.Close();
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                if (cn.State == ConnectionState.Open)
                {
                    cn.Close();
                }
                cn.Dispose();
                cmd.Dispose();
                cn = null;
                cmd = null;

            }
            return lista;
        }