Beispiel #1
0
 public void DeleteProperty(Guid id)
 {
     using (var db = new BL.ShopDataContext())
     {
         var prop = db.ShopProperties.FirstOrDefault(p => p.ID == id);
         if (prop == null)
             return;
         db.ShopProperties.DeleteOnSubmit(prop);
         db.SubmitChanges();
     }
 }
Beispiel #2
0
 public void UpdateProperty(Guid id, string key, string value)
 {
     using (var db = new BL.ShopDataContext())
     {
         var prop = db.ShopProperties.FirstOrDefault(p => p.ID == id);
         if (prop == null)
             return;
         prop.Key = key;
         prop.Value = value;
         db.SubmitChanges();
     }
 }
Beispiel #3
0
 public BL.ShopProperties AddProperty(string key, string value)
 {
     using (var db = new BL.ShopDataContext())
     {
         var prop =new BL.ShopProperties()
         {
             ID= Guid.NewGuid(),
             Key = key,
             Value = value
         };
         db.ShopProperties.InsertOnSubmit(prop);
         db.SubmitChanges();
         return prop;
     }
 }