예제 #1
0
파일: Contact.cs 프로젝트: pwgoertz/bvcms
 private void detach_contactees(Contactee entity)
 {
     this.SendPropertyChanging();
     entity.contact = null;
 }
예제 #2
0
 private ReturnResult AddContactees(int id, int origin)
 {
     var c = DbUtil.Db.Contacts.SingleOrDefault(ct => ct.ContactId == id);
     if (c != null)
     {
         foreach (var p in PendingList)
         {
             AddPerson(p, PendingList, OriginCode.Visit, EntryPointId);
             var ctee = c.contactees.SingleOrDefault(ct =>
                 ct.ContactId == id && ct.PeopleId == p.Person.PeopleId);
             if (ctee == null)
             {
                 ctee = new Contactee
                 {
                     ContactId = id,
                     PeopleId = p.Person.PeopleId
                 };
                 c.contactees.Add(ctee);
                 DbUtil.LogActivity("AddContactee " + id, peopleid: p.PeopleId);
             }
         }
         DbUtil.Db.SubmitChanges();
     }
     return new ReturnResult {close = true, from = AddContext, cid = id};
 }
예제 #3
0
파일: Contact.cs 프로젝트: pwgoertz/bvcms
 private void attach_contactees(Contactee entity)
 {
     this.SendPropertyChanging();
     entity.contact = this;
 }
예제 #4
0
 private JsonResult AddContactees(int id, SearchModel m, int origin)
 {
     if (id > 0)
     {
         var c = DbUtil.Db.Contacts.Single(ct => ct.ContactId == id);
         foreach (var p in m.List)
         {
             AddPerson(p, m.List, OriginCode.Visit, m.EntryPointId);
             var ctee = c.contactees.SingleOrDefault(ct =>
                 ct.ContactId == id && ct.PeopleId == p.person.PeopleId);
             if (ctee == null)
             {
                 ctee = new Contactee
                 {
                     ContactId = id,
                     PeopleId = p.person.PeopleId,
                 };
                 c.contactees.Add(ctee);
             }
         }
         DbUtil.Db.SubmitChanges();
     }
     return Json(new { close = true, how = "addselected" });
 }
예제 #5
0
파일: Person.cs 프로젝트: GSBCfamily/bvcms
		private void detach_contactsHad(Contactee entity)
		{
			this.SendPropertyChanging();
			entity.person = null;
		}
예제 #6
0
파일: Contact.cs 프로젝트: hkouns/bvcms
 private void detach_contactees(Contactee entity)
 {
     this.SendPropertyChanging();
     entity.contact = null;
 }
예제 #7
0
파일: Contact.cs 프로젝트: hkouns/bvcms
 private void attach_contactees(Contactee entity)
 {
     this.SendPropertyChanging();
     entity.contact = this;
 }
예제 #8
0
        public ActionResult AddContactReceived(int id)
        {
            var p = DbUtil.Db.LoadPersonById(id);
            DbUtil.LogActivity("Adding contact to: {0}".Fmt(p.Name));
            var c = new CmsData.Contact
            {
                CreatedDate = Util.Now,
                CreatedBy = Util.UserId1,
                ContactDate = Util.Now.Date,
                ContactTypeId = 99,
                ContactReasonId = 99,
            };

            DbUtil.Db.Contacts.InsertOnSubmit(c);
            DbUtil.Db.SubmitChanges();

            var pc = new Contactee
            {
                PeopleId = p.PeopleId,
                ContactId = c.ContactId
            };

            DbUtil.Db.Contactees.InsertOnSubmit(pc);
            DbUtil.Db.SubmitChanges();

            return Content("/Contact.aspx?id=" + c.ContactId);
        }