예제 #1
0
		private void detach_application_settings(application_setting entity)
		{
			this.SendPropertyChanging();
			entity.person = null;
		}
예제 #2
0
 partial void Deleteapplication_setting(application_setting instance);
예제 #3
0
 partial void Updateapplication_setting(application_setting instance);
예제 #4
0
 partial void Insertapplication_setting(application_setting instance);
예제 #5
0
		private void attach_application_settings(application_setting entity)
		{
			this.SendPropertyChanging();
			entity.application = this;
		}
예제 #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;
 }