Beispiel #1
0
		private void detach_application_settings(application_setting entity)
		{
			this.SendPropertyChanging();
			entity.person = null;
		}
Beispiel #2
0
 partial void Deleteapplication_setting(application_setting instance);
Beispiel #3
0
 partial void Updateapplication_setting(application_setting instance);
Beispiel #4
0
 partial void Insertapplication_setting(application_setting instance);
Beispiel #5
0
		private void attach_application_settings(application_setting entity)
		{
			this.SendPropertyChanging();
			entity.application = this;
		}
Beispiel #6
0
 public bool SetAppData(string personId, string key, string value, string appId) 
 {
     if (string.IsNullOrEmpty(value))
     {
         // empty key kind of became to mean "delete data" (was an old orkut hack that became part of the spec spec)
         var ret = new application_setting
                       {
                           application_id = int.Parse(appId),
                           person_id = int.Parse(personId),
                           name = key
                       };
         db.application_settings.DeleteOnSubmit(ret);
         db.SubmitChanges();
         if (db.GetChangeSet().Deletes.Count != 0)
             return false;
     } 
     else 
     {
         var ret = db.application_settings
             .Where(x => x.application_id.ToString() == appId && x.person_id.ToString() == personId && x.name == key).SingleOrDefault();
         if (ret == null)
         {
             ret = new application_setting
                       {
                           application_id = int.Parse(appId),
                           person_id = int.Parse(personId),
                           name = key,
                           value = value
                       };
             db.application_settings.InsertOnSubmit(ret);
             db.SubmitChanges();
             if (db.GetChangeSet().Inserts.Count != 0)
                 return false;
         }
         else
         {
             ret.value = value;
             db.SubmitChanges();
             if (db.GetChangeSet().Updates.Count != 0)
                 return false;
         }
     }
     return true;
 }