public static bool Delete(ProjectVersion Pversion) { return ExecuteDB(Pversion, DBQueryType.Delete); }
private static bool ExecuteDB(ProjectVersion Pversion, DBQueryType queryType) { using (spiffaiwebEntities db = LoadDB()) { switch (queryType) { case DBQueryType.Add: db.ProjectVersions.Add(Pversion); break; case DBQueryType.Update: db.ProjectVersions.Attach(Pversion); db.Entry(Pversion).State = System.Data.Entity.EntityState.Modified; break; case DBQueryType.Delete: db.ProjectVersions.Remove(Pversion); break; default: break; } db.SaveChanges(); } return true; }
public static bool Add(ProjectVersion Pversion) { return ExecuteDB(Pversion, DBQueryType.Add); }