Ejemplo n.º 1
0
        public List <C_Productor> GetProductors()
        {
            var entities = new List <C_Productor>();

            using (var rdr = SqlHelper.ExecuteReader(this._databaseConnectionString, CommandType.Text, SqlCommands_Rs.Sql_C_Productor_Repository_GetProductors, null)) {
                while (rdr.Read())
                {
                    var entity = new C_Productor();
                    entity.Id         = SqlTypeConverter.DBNullStringHandler(rdr["Id"]);
                    entity.Name       = SqlTypeConverter.DBNullStringHandler(rdr["Name"]);
                    entity.EngName    = SqlTypeConverter.DBNullStringHandler(rdr["EngName"]);
                    entity.Phone      = SqlTypeConverter.DBNullStringHandler(rdr["Phone"]);
                    entity.Fax        = SqlTypeConverter.DBNullStringHandler(rdr["Fax"]);
                    entity.Address    = SqlTypeConverter.DBNullStringHandler(rdr["Address"]);
                    entity.PostalCode = SqlTypeConverter.DBNullStringHandler(rdr["PostalCode"]);
                    entity.Comment    = SqlTypeConverter.DBNullStringHandler(rdr["Desc"]);
                    entity.Enabled    = SqlTypeConverter.DBNullBooleanHandler(rdr["Enabled"]);
                    entities.Add(entity);
                }
            }
            return(entities);
        }
Ejemplo n.º 2
0
        public C_Productor GetProductor(string id)
        {
            SqlParameter[] parms = { new SqlParameter("@Id", SqlDbType.VarChar, 100) };
            parms[0].Value = SqlTypeConverter.DBNullStringChecker(id);

            C_Productor entity = null;

            using (var rdr = SqlHelper.ExecuteReader(this._databaseConnectionString, CommandType.Text, SqlCommands_Rs.Sql_C_Productor_Repository_GetProductor, parms)) {
                if (rdr.Read())
                {
                    entity            = new C_Productor();
                    entity.Id         = SqlTypeConverter.DBNullStringHandler(rdr["Id"]);
                    entity.Name       = SqlTypeConverter.DBNullStringHandler(rdr["Name"]);
                    entity.EngName    = SqlTypeConverter.DBNullStringHandler(rdr["EngName"]);
                    entity.Phone      = SqlTypeConverter.DBNullStringHandler(rdr["Phone"]);
                    entity.Fax        = SqlTypeConverter.DBNullStringHandler(rdr["Fax"]);
                    entity.Address    = SqlTypeConverter.DBNullStringHandler(rdr["Address"]);
                    entity.PostalCode = SqlTypeConverter.DBNullStringHandler(rdr["PostalCode"]);
                    entity.Comment    = SqlTypeConverter.DBNullStringHandler(rdr["Desc"]);
                    entity.Enabled    = SqlTypeConverter.DBNullBooleanHandler(rdr["Enabled"]);
                }
            }
            return(entity);
        }