예제 #1
0
 public PersonOfferBO(PersonOffer a)
 {
     _id       = a.Id;
     _offerId  = a.OfferId;
     _personId = a.PersonId;
     _status   = a.Status;
 }
예제 #2
0
 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
     {
     }
 }
예제 #3
0
        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();
            }
        }