Exemple #1
0
        /// <summary>
        /// Gets the distinct years in which site visits have been conducted.
        /// </summary>
        /// <returns></returns>
        public static SortedSet <int> GetAvailableYears()
        {
            List <QueryParameter> parameters = new List <QueryParameter>();
            Database  iba = null;
            DbCommand cmd = null;

            BaseMapper.CreateDatabaseCommand("Results_AvailableYears", parameters, out iba, out cmd);
            SortedSet <int> set = new SortedSet <int>();

            using (IDataReader reader = iba.ExecuteReader(cmd))
            {
                while (reader.Read())
                {
                    set.Add(reader.GetInt32(0));
                }
            }

            return(set);
        }
 private static void save(Person person)
 {
     BaseMapper.SaveObject(person, new List <QueryParameter>()
     {
         new QueryParameter("EmailAddress", person.EmailAddress),
         new QueryParameter("FirstName", person.FirstName),
         new QueryParameter("LastName", person.LastName),
         new QueryParameter("Id", person.Id),
         new QueryParameter("OpenId", person.OpenId),
         new QueryParameter("PhoneNumber", person.PhoneNumber),
         new QueryParameter("Address1", person.Address1),
         new QueryParameter("Address2", person.Address2),
         new QueryParameter("City", person.City),
         new QueryParameter("State", person.State),
         new QueryParameter("ZipCode", person.ZipCode),
         new QueryParameter("Country", person.Country),
         new QueryParameter("HasBeenTrained", person.HasBeenTrained),
         new QueryParameter("HasClipboard", person.HasClipboard),
         new QueryParameter("PersonStatus", (short)Enum.Parse(typeof(Status), person.PersonStatus.ToString())),
         new QueryParameter("PersonRole", (short)Enum.Parse(typeof(Role), person.PersonRole.ToString()))
     });
 }
Exemple #3
0
 public static void Delete(FiftyMeterPointSurvey survey)
 {
     BaseMapper.DeleteObject(survey, TABLE_NAME);
 }
Exemple #4
0
 /// <summary>
 /// Retrieves a specific <see cref="Observation"/> object by its unique identifier.
 /// </summary>
 /// <typeparam name="T">An leaf of Observation</typeparam>
 /// <param name="observationId">The observation id.</param>
 /// <returns>Instance of <see cref="Observation"/></returns>
 public static T Select <T>(int observationId) where T : Observation
 {
     return(BaseMapper.LoadSingleObjectByIntegerId <T>(Load <T>, SELECT_STORED_PROC, observationId));
 }
Exemple #5
0
        public static Species Select(Guid id)
        {
            guidGuardClause(id, "Select");

            return(BaseMapper.LoadSingleObjectById <Species>(Load, SELECT_STORED_PROC, id));
        }
Exemple #6
0
 public static List <Species> SelectAll()
 {
     return(BaseMapper.LoadAll <Species>(Load, SELECT_STORED_PROC));
 }
Exemple #7
0
 public static void Delete(Species species)
 {
     BaseMapper.DeleteObject(species);
 }
Exemple #8
0
 /// <summary>
 /// Retrieves a specific <see cref="SamplingPoint"/> object by its unique identifier.
 /// </summary>
 /// <param name="pointId">The point id.</param>
 /// <returns>Instance of <see cref="SamplingPoint"/></returns>
 public static SamplingPoint Select(Guid pointId)
 {
     return(BaseMapper.LoadSingleObjectById <SamplingPoint>(Load, SELECT_STORED_PROC, pointId));
 }
Exemple #9
0
 public static void Delete(SamplingPoint point)
 {
     BaseMapper.DeleteObject(point);
 }
 public static List <Person> SelectAll()
 {
     return(BaseMapper.LoadAll <Person>(Load, SELECT_STORED_PROC));
 }
 public static void Delete(Person person)
 {
     BaseMapper.DeleteObject(person);
 }
        public static Person Select(string openId)
        {
            openIdGuardClause(openId, "Select");

            return(BaseMapper.LoadSingleObjectById <Person>(Load, SELECT_STORED_PROC, "OpenId", openId));
        }
 public static void Delete(Site site)
 {
     BaseMapper.DeleteObject(site);
 }
Exemple #14
0
        public static FiftyMeterPointSurvey Select(Guid id)
        {
            guidGuardClause(id, "Select");

            return(BaseMapper.LoadSingleObjectById <FiftyMeterPointSurvey>(Load, SELECT_STORED_PROC, id));
        }
Exemple #15
0
 public static List <SamplingPoint> SelectAll()
 {
     return(BaseMapper.LoadAll(Load, SELECT_STORED_PROC));
 }
 public static void Delete(SiteCondition conditions)
 {
     BaseMapper.DeleteObject(conditions);
 }
 public static void Delete(SiteVisit siteVisit)
 {
     BaseMapper.DeleteObject(siteVisit);
 }