Ejemplo n.º 1
0
 public void AddAttachement(Attachement.Item item)
 {
     _settingsStorage.AddAttachement(item);
 }
Ejemplo n.º 2
0
 public void DeleteAttachement(Attachement.Item item)
 {
     _settingsStorage.DeleteAttachement(item);
 }
Ejemplo n.º 3
0
 public List<Attachement.Item> GetAttachements(string gcCode)
 {
     List<Attachement.Item> result = new List<Attachement.Item>();
     lock (this)
     {
         if (_dbcon != null)
         {
             DbDataReader dr;
             if (string.IsNullOrEmpty(gcCode))
             {
                 dr = _dbcon.ExecuteReader("select gccode, filename, comments from attachm");
             }
             else
             {
                 dr = _dbcon.ExecuteReader(string.Format("select gccode, filename, comments from attachm where gccode='{0}'", gcCode));
             }
             while (dr.Read())
             {
                 Attachement.Item it = new Attachement.Item();
                 it.GeocacheCode = dr["gccode"] as string;
                 it.FileName = dr["filename"] as string;
                 it.Comment = dr["comments"] as string;
                 result.Add(it);
             }
         }
     }
     return result;
 }