Esempio n. 1
0
 private void detach_contactees(Contactee entity)
 {
     this.SendPropertyChanging();
     entity.contact = null;
 }
Esempio n. 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};
 }
Esempio n. 3
0
 private void attach_contactees(Contactee entity)
 {
     this.SendPropertyChanging();
     entity.contact = this;
 }
Esempio n. 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" });
 }
Esempio n. 5
0
		private void detach_contactsHad(Contactee entity)
		{
			this.SendPropertyChanging();
			entity.person = null;
		}
Esempio n. 6
0
 private void detach_contactees(Contactee entity)
 {
     this.SendPropertyChanging();
     entity.contact = null;
 }
Esempio n. 7
0
 private void attach_contactees(Contactee entity)
 {
     this.SendPropertyChanging();
     entity.contact = this;
 }
Esempio n. 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);
        }