public void InsertGoverningPolicy(IdNameViewModel ovm) { GoverningPolicy newRecord = new GoverningPolicy { GPO_Id = ovm.Id, GPO_Name = ovm.Name }; context.GoverningPolicies.Add(newRecord); context.SaveChanges(); }
public void UpdateGoverningPolicy(IdNameViewModel ovm) { GoverningPolicy newRecord = new GoverningPolicy { GPO_Id = ovm.Id, GPO_Name = ovm.Name }; context.GoverningPolicies.Attach(newRecord); context.Entry(newRecord).State = EntityState.Modified; context.SaveChanges(); }
public void DeleteGoverningPolicy(IdNameViewModel ovm) { GoverningPolicy newRecord = new GoverningPolicy { GPO_Id = ovm.Id, GPO_Name = ovm.Name }; context.GoverningPolicies.Attach(newRecord); context.GoverningPolicies.Remove(newRecord); context.SaveChanges(); }