public void Delete() { try { var contact = parseDomain(); ElibriumEntities db = new ElibriumEntities(); { Contact temp = db.Contact.Find(contact.Id); db.Entry(temp).State = System.Data.Entity.EntityState.Deleted; db.SaveChanges(); } } catch { } }
public void Delete() { try { var offer = parseDomain(); ElibriumEntities db = new ElibriumEntities(); { Offer temp = db.Offer.Find(offer.Id); db.Entry(temp).State = System.Data.Entity.EntityState.Deleted; db.SaveChanges(); } } catch { } }
public void Delete() { PositionType PositionType = parseDomain(); ElibriumEntities db = new ElibriumEntities(); { try { PositionType temp = db.PositionType.Find(PositionType.Id); db.Entry(temp).State = System.Data.Entity.EntityState.Deleted; db.SaveChanges(); } catch { } } }
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 static void AddEmail() { using (ElibriumEntities db = new ElibriumEntities()) { ContactType temp = db.ContactType.Find(1); if (temp != null) { temp.Name = "Email"; db.Entry(temp).State = System.Data.Entity.EntityState.Modified; } else { //run the script here } db.SaveChanges(); } }
public void Delete() { try { var client = parseDomain(); ElibriumEntities db = new ElibriumEntities(); { Person temp = db.Person.Find(client.Id); db.Entry(temp).State = System.Data.Entity.EntityState.Deleted; List <Contact> temp2 = db.Contact.Where(i => Id == temp.Id).ToList(); foreach (Contact item in temp2) { } db.SaveChanges(); } }catch { } }
public void AddOrUpdate() { var contactType = parseDomain(); using (ElibriumEntities db = new ElibriumEntities()) { if (_isNew) { db.ContactType.Add(contactType); } else { ContactType temp = db.ContactType.Find(contactType.Id); temp.Name = contactType.Name; db.Entry(temp).State = System.Data.Entity.EntityState.Modified; } db.SaveChanges(); } }
public void AddOrUpdate() { var client = parseDomain(); using (ElibriumEntities db = new ElibriumEntities()) { if (_isNew) { db.Client.Add(client); } else { Client temp = db.Client.Find(client.Id); temp.Name = client.Name; temp.BusinessNo = client.BusinessNo; db.Entry(temp).State = System.Data.Entity.EntityState.Modified; } db.SaveChanges(); } }
public void AddOrUpdate() { var contact = parseDomain(); using (ElibriumEntities db = new ElibriumEntities()) { if (_isNew) { db.Contact.Add(contact); } else { Contact temp = db.Contact.Find(contact.Id); temp.Value = contact.Value; temp.PersonId = contact.PersonId; temp.ContactTypeId = contact.ContactTypeId; db.Entry(temp).State = System.Data.Entity.EntityState.Modified; } db.SaveChanges(); } }
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(); } }
public void AddOrUpdate() { var Offer = parseDomain(); using (ElibriumEntities db = new ElibriumEntities()) { if (_isNew) { db.Offer.Add(Offer); } else { Offer temp = db.Offer.Find(Offer.Id); temp.Title = Offer.Title; temp.Description = Offer.Description; temp.DateFrom = Offer.DateFrom; temp.DateTo = Offer.DateTo; db.Entry(temp).State = System.Data.Entity.EntityState.Modified; } db.SaveChanges(); } }
public void AddOrUpdate() { var Person = parseDomain(); using (ElibriumEntities db = new ElibriumEntities()) { if (_isNew) { db.Person.Add(Person); } else { Person temp = db.Person.Find(Person.Id); temp.FirstName = Person.FirstName; temp.LastName = Person.LastName; temp.DBO = Person.DBO; temp.ClientId = Person.ClientId; temp.PositionTypeId = Person.PositionTypeId; db.Entry(temp).State = System.Data.Entity.EntityState.Modified; } db.SaveChanges(); } }