private void savePushID(int peopleID, int device, string pushID) { if (pushID == null || pushID.Length == 0 || peopleID == 0) return; var registration = (from e in DbUtil.Db.MobileAppPushRegistrations where e.RegistrationId == pushID select e).FirstOrDefault(); if (registration == null) { MobileAppPushRegistration register = new MobileAppPushRegistration(); register.Enabled = true; register.PeopleId = peopleID; register.Type = device; register.RegistrationId = pushID; DbUtil.Db.MobileAppPushRegistrations.InsertOnSubmit(register); } else { registration.PeopleId = peopleID; } DbUtil.Db.SubmitChanges(); }
private void detach_MobileAppPushRegistrations(MobileAppPushRegistration entity) { this.SendPropertyChanging(); entity.Person = null; }