public PersonOfferBO(PersonOffer a) { _id = a.Id; _offerId = a.OfferId; _personId = a.PersonId; _status = a.Status; }
public void Delete() { try { var personOffer = parseDomain(); using (ElibriumEntities db = new ElibriumEntities()) { PersonOffer temp = db.PersonOffer.Find(personOffer.Id); db.Entry(temp).State = System.Data.Entity.EntityState.Deleted; db.SaveChanges(); } } catch { } }
public void AddOrUpdate() { var personHasOffer = parseDomain(); using (ElibriumEntities db = new ElibriumEntities()) { if (_isNew) { db.PersonOffer.Add(personHasOffer); } else { PersonOffer temp = db.PersonOffer.Find(personHasOffer.Id); temp.OfferId = personHasOffer.OfferId; temp.PersonId = personHasOffer.PersonId; temp.Status = personHasOffer.Status; db.Entry(temp).State = System.Data.Entity.EntityState.Modified; } db.SaveChanges(); } }