public override PersonSite GetPersonSiteByPersonAndSite(Person person, Site site, bool isAssigned) { using (var transaction = new TransactionScope(_configuration)) { var ds = new PersonSiteDataStore(transaction); return(ds.FindByPersonAndSite(person.Id, site.Id, isAssigned).FirstOrDefault()); } }
public override void DeletePersonFromSite(string personId, string siteId) { // Delete a record in the PersonSite table. using (var transaction = new TransactionScope(_configuration)) { var psDS = new PersonSiteDataStore(transaction); IList <PersonSite> pss = psDS.FindByPersonAndSite(personId, siteId, false); foreach (PersonSite item in pss) { item.Deleted = true; psDS.Update(item); } transaction.Commit(); } }