public void SaveSite(IObservationsSite s) { string sql = ""; sql = string.Format("select * from Sites where SiteID={0}", s.ID); if (ODMDB.Exists(sql)) { sql = string.Format("update Sites set SiteName='{1}', SiteCode='{2}', SiteType='{3}',Longitude={4},Latitude={5},Elevation_m={6}," + "State='{7}',Country='{8}',MonitorType={9},Comments='{10}' where SiteID={0}", s.ID, s.Name, s.Code, s.SiteType, s.Longitude, s.Latitude, s.Elevation, s.State, s.Country, s.MonitorType, s.Comments ); } else { sql = string.Format("insert into Sites (SiteID, SiteName,SiteCode,SiteType,Longitude,Latitude,Elevation_m,State,Country,MonitorType,Comments)" + "values ({0}, '{1}', '{2}','{3}', {4}, {5},{6}, '{7}', '{8}','{9}', '{10}')", s.ID, s.Name, s.Code, s.SiteType, s.Longitude, s.Latitude, s.Elevation, s.State, s.Country, s.MonitorType, s.Comments); } ODMDB.CreateNonQueryCommand(sql); }
public DataSeries(IObservationsSite site, IVariable variable) { Site = site; Variable = variable; }