Exemplo n.º 1
0
        public ValoresEvaluacionBE ValoresEvaluacionGetIdByDesc(string connstring, string Descripcion, string Tipo)
        {
            DBHelper            _oDBHelper          = new DBHelper(connstring, Providers.SqlServer);
            ValoresEvaluacionBE ValoresEvaluacionBE = EvaluacionDA.Instanse.ValoresEvaluacionGetIdByDesc(_oDBHelper, Descripcion, Tipo);

            return(ValoresEvaluacionBE);
        }
Exemplo n.º 2
0
        public List <ValoresEvaluacionBE> ValoresEvaluacionGetAllByTipo(DBHelper pDBHelper, string Tipo)
        {
            List <ValoresEvaluacionBE> lst = null;
            ValoresEvaluacionBE        obj = null;

            DBHelper.Parameters[] colParameters = null;
            lst = new List <ValoresEvaluacionBE>();
            try
            {
                // Parámetros
                colParameters = new DBHelper.Parameters[] {
                    new DBHelper.Parameters("Tipo", string.IsNullOrEmpty(Tipo) ? (object)DBNull.Value : Tipo),
                };

                pDBHelper.ClearParameter();
                pDBHelper.CreateDBParameters(colParameters);

                using (IDataReader dr = pDBHelper.ExecuteReader(pDBHelper.concatOwner("ValoresEvaluacionGetAllByTipo"), CommandType.StoredProcedure, Utility.ConnectionState.CloseOnExit))
                {
                    // Leyendo reader
                    while (dr.Read())
                    {
                        obj = new ValoresEvaluacionBE();

                        obj.Id    = Convert.ToInt32(dr["IdValoresEvaluacion"].ToString());
                        obj.Valor = dr["Valor"].ToString();

                        lst.Add(obj);
                    }
                }
                return(lst);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                colParameters = null;
                if (pDBHelper != null && pDBHelper.Command.Transaction == null)
                {
                    pDBHelper.Dispose();
                }
            }
        }
Exemplo n.º 3
0
        public ValoresEvaluacionBE ValoresEvaluacionGetIdByDesc(DBHelper pDBHelper, string Descripcion, string Tipo)
        {
            ValoresEvaluacionBE ValoresEvaluacionBE = new ValoresEvaluacionBE();

            DBHelper.Parameters[] colParameters = null;
            try
            {
                // Parámetros
                colParameters = new DBHelper.Parameters[] {
                    new DBHelper.Parameters("descripcion", string.IsNullOrEmpty(Descripcion) ? (object)DBNull.Value :Descripcion),
                    new DBHelper.Parameters("Tipo", string.IsNullOrEmpty(Tipo) ? (object)DBNull.Value : Tipo),
                };

                pDBHelper.ClearParameter();
                pDBHelper.CreateDBParameters(colParameters);

                using (IDataReader dataReader = pDBHelper.ExecuteReader(pDBHelper.concatOwner("ValoresEvaluacionGetIdByDesc"), CommandType.StoredProcedure, Utility.ConnectionState.CloseOnExit))
                {
                    // Leyendo reader
                    if (dataReader.Read())
                    {
                        ValoresEvaluacionBE.Id    = Convert.ToInt32(dataReader["IdValoresEvaluacion"]);
                        ValoresEvaluacionBE.Valor = dataReader["Valor"].ToString();
                        ValoresEvaluacionBE.Tipo  = dataReader["Tipo"].ToString();
                    }
                }
                return(ValoresEvaluacionBE);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                colParameters = null;
                if (pDBHelper != null && pDBHelper.Command.Transaction == null)
                {
                    pDBHelper.Dispose();
                }
            }
        }