Exemplo n.º 1
0
 private void detach_RelatedFamilies2(RelatedFamily entity)
 {
     this.SendPropertyChanging();
     entity.RelatedFamily2 = null;
 }
Exemplo n.º 2
0
 private void attach_RelatedFamilies1(RelatedFamily entity)
 {
     this.SendPropertyChanging();
     entity.RelatedFamily1 = this;
 }
Exemplo n.º 3
0
		private void detach_RelatedFamilies2(RelatedFamily entity)
		{
			this.SendPropertyChanging();
			entity.RelatedFamily2 = null;
		}
Exemplo n.º 4
0
		private void attach_RelatedFamilies1(RelatedFamily entity)
		{
			this.SendPropertyChanging();
			entity.RelatedFamily1 = this;
		}
Exemplo n.º 5
0
 public RelatedFamily AddRelated(CMSDataContext db, int pid)
 {
     var p2 = db.LoadPersonById(pid);
     var rf = db.RelatedFamilies.SingleOrDefault(r =>
         (r.FamilyId == FamilyId && r.RelatedFamilyId == p2.FamilyId)
         || (r.FamilyId == p2.FamilyId && r.RelatedFamilyId == FamilyId)
         );
     if (rf == null)
     {
         rf = new RelatedFamily
         {
             FamilyId = FamilyId,
             RelatedFamilyId = p2.FamilyId,
             FamilyRelationshipDesc = "",
             CreatedBy = Util.UserId1,
             CreatedDate = Util.Now,
         };
         db.RelatedFamilies.InsertOnSubmit(rf);
         db.SubmitChanges();
     }
     return rf;
 }
Exemplo n.º 6
0
 public static string AddRelatedFamily(int peopleid, int relatedPersonId)
 {
     var p = DbUtil.Db.LoadPersonById(peopleid);
     var p2 = DbUtil.Db.LoadPersonById(relatedPersonId);
     var rf = DbUtil.Db.RelatedFamilies.SingleOrDefault(r =>
         (r.FamilyId == p.FamilyId && r.RelatedFamilyId == p2.FamilyId)
         || (r.FamilyId == p2.FamilyId && r.RelatedFamilyId == p.FamilyId)
         );
     if (rf == null)
     {
         rf = new RelatedFamily
         {
             FamilyId = p.FamilyId,
             RelatedFamilyId = p2.FamilyId,
             FamilyRelationshipDesc = "",
             CreatedBy = Util.UserId1,
             CreatedDate = Util.Now,
         };
         DbUtil.Db.RelatedFamilies.InsertOnSubmit(rf);
         DbUtil.Db.SubmitChanges();
     }
     return "#rf-{0}-{1}".Fmt(rf.FamilyId, rf.RelatedFamilyId);
 }
Exemplo n.º 7
0
 public static void AddRelatedFamily(int familyId, int relatedPersonId)
 {
     var p = DbUtil.Db.LoadPersonById(relatedPersonId);
     var rf = DbUtil.Db.RelatedFamilies.SingleOrDefault(r =>
         (r.FamilyId == familyId && r.RelatedFamilyId == p.FamilyId)
         || (r.FamilyId == p.FamilyId && r.RelatedFamilyId == familyId)
         );
     if (rf == null)
     {
         rf = new RelatedFamily
         {
             FamilyId = familyId,
             RelatedFamilyId = p.FamilyId,
             FamilyRelationshipDesc = "Add Description",
             CreatedBy = Util.UserId1,
             CreatedDate = Util.Now,
         };
         DbUtil.Db.RelatedFamilies.InsertOnSubmit(rf);
         DbUtil.Db.SubmitChanges();
     }
 }