コード例 #1
0
 private void detach_RelatedFamilies2(RelatedFamily entity)
 {
     this.SendPropertyChanging();
     entity.RelatedFamily2 = null;
 }
コード例 #2
0
 private void attach_RelatedFamilies1(RelatedFamily entity)
 {
     this.SendPropertyChanging();
     entity.RelatedFamily1 = this;
 }
コード例 #3
0
ファイル: Family.cs プロジェクト: stevesloka/bvcms
		private void detach_RelatedFamilies2(RelatedFamily entity)
		{
			this.SendPropertyChanging();
			entity.RelatedFamily2 = null;
		}
コード例 #4
0
ファイル: Family.cs プロジェクト: stevesloka/bvcms
		private void attach_RelatedFamilies1(RelatedFamily entity)
		{
			this.SendPropertyChanging();
			entity.RelatedFamily1 = this;
		}
コード例 #5
0
ファイル: Person.cs プロジェクト: alexserdyuk/bvcms
 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;
 }
コード例 #6
0
ファイル: SearchAddModel.cs プロジェクト: hkouns/bvcms
 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);
 }
コード例 #7
0
ファイル: SearchModel.cs プロジェクト: rossspoon/bvcms
 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();
     }
 }