public static void Delete(int bugId) { DataClassesBugTrackingSystemDataContext db = new DataClassesBugTrackingSystemDataContext(); Bug bugToDelete = db.Bugs.Single(t => t.BugId == bugId); bugToDelete.Status = Status.Deleted.ToString(); db.SubmitChanges(); }
public static void Delete(int bugId) { DataClassesBugTrackingSystemDataContext db = new DataClassesBugTrackingSystemDataContext(); Bug bugToDelete = db.Bugs.Single(t => t.BugId == bugId); bugToDelete.Status = Status.Deleted.ToString(); db.SubmitChanges(); }
public static int Insert(Project project) { DataClassesBugTrackingSystemDataContext db = new DataClassesBugTrackingSystemDataContext(); db.Projects.InsertOnSubmit(project); db.SubmitChanges(); return(project.ProjectId); }
public static int Insert(Tester tester) { DataClassesBugTrackingSystemDataContext db = new DataClassesBugTrackingSystemDataContext(); db.Testers.InsertOnSubmit(tester); db.SubmitChanges(); return(tester.TesterId); }
public static int Insert(Bug bug) { DataClassesBugTrackingSystemDataContext db = new DataClassesBugTrackingSystemDataContext(); db.Bugs.InsertOnSubmit(bug); db.SubmitChanges(); return bug.BugId; }
public static void Update(Project project) { DataClassesBugTrackingSystemDataContext db = new DataClassesBugTrackingSystemDataContext(); Project projectToUpdate = db.Projects.Single(t => t.ProjectId == project.ProjectId); projectToUpdate.Name = project.Name; projectToUpdate.Description = project.Description; db.SubmitChanges(); }
public static void Update(Bug bug) { DataClassesBugTrackingSystemDataContext db = new DataClassesBugTrackingSystemDataContext(); Bug bugToUpdate = db.Bugs.Single(t => t.BugId == bug.BugId); bugToUpdate.Description = bug.Description; bugToUpdate.Priority = bug.Priority; bugToUpdate.Status = bug.Status; db.SubmitChanges(); }
public static void Delete(int testerId) { DataClassesBugTrackingSystemDataContext db = new DataClassesBugTrackingSystemDataContext(); // all testers bugs must leave without author foreach (Bug bug in db.Bugs.Where( p=> p.TesterId == testerId)) { bug.TesterId = null; } Tester testerToDelete = db.Testers.Single(t => t.TesterId == testerId); db.Testers.DeleteOnSubmit(testerToDelete); db.SubmitChanges(); }
public static void Update(Tester tester) { DataClassesBugTrackingSystemDataContext db = new DataClassesBugTrackingSystemDataContext(); Tester testerToUpdate = db.Testers.Single(t => t.TesterId == tester.TesterId); testerToUpdate.Password = tester.Password; testerToUpdate.Name = tester.Name; testerToUpdate.Surname = tester.Surname; testerToUpdate.Phone = tester.Phone; testerToUpdate.Email = tester.Email; testerToUpdate.LastAction = tester.LastAction; db.SubmitChanges(); }
public static void Delete(int projectId) { DataClassesBugTrackingSystemDataContext db = new DataClassesBugTrackingSystemDataContext(); // delete all project bugs foreach (Bug bug in db.Bugs.Where(p => p.ProjectId == projectId)) { db.Bugs.DeleteOnSubmit(bug); } Project ProjectToDelete = db.Projects.Single(t => t.ProjectId == projectId); db.Projects.DeleteOnSubmit(ProjectToDelete); db.SubmitChanges(); }
public static void Delete(int testerId) { DataClassesBugTrackingSystemDataContext db = new DataClassesBugTrackingSystemDataContext(); // all testers bugs must leave without author foreach (Bug bug in db.Bugs.Where(p => p.TesterId == testerId)) { bug.TesterId = null; } Tester testerToDelete = db.Testers.Single(t => t.TesterId == testerId); db.Testers.DeleteOnSubmit(testerToDelete); db.SubmitChanges(); }
public static void Delete(int projectId) { DataClassesBugTrackingSystemDataContext db = new DataClassesBugTrackingSystemDataContext(); // delete all project bugs foreach (Bug bug in db.Bugs.Where(p => p.ProjectId == projectId)) { db.Bugs.DeleteOnSubmit(bug); } Project ProjectToDelete = db.Projects.Single(t => t.ProjectId == projectId); db.Projects.DeleteOnSubmit(ProjectToDelete); db.SubmitChanges(); }
public static void Update(Tester tester) { DataClassesBugTrackingSystemDataContext db = new DataClassesBugTrackingSystemDataContext(); Tester testerToUpdate = db.Testers.Single(t => t.TesterId == tester.TesterId); testerToUpdate.Password = tester.Password; testerToUpdate.Name = tester.Name; testerToUpdate.Surname = tester.Surname; testerToUpdate.Phone = tester.Phone; testerToUpdate.Email = tester.Email; testerToUpdate.LastAction = tester.LastAction; db.SubmitChanges(); }
public static int Insert(Bug bug) { DataClassesBugTrackingSystemDataContext db = new DataClassesBugTrackingSystemDataContext(); db.Bugs.InsertOnSubmit(bug); db.SubmitChanges(); return bug.BugId; }
public static void Update(Bug bug) { DataClassesBugTrackingSystemDataContext db = new DataClassesBugTrackingSystemDataContext(); Bug bugToUpdate = db.Bugs.Single(t => t.BugId == bug.BugId); bugToUpdate.Description = bug.Description; bugToUpdate.Priority = bug.Priority; bugToUpdate.Status = bug.Status; db.SubmitChanges(); }
public static int Insert(Project project) { DataClassesBugTrackingSystemDataContext db = new DataClassesBugTrackingSystemDataContext(); db.Projects.InsertOnSubmit(project); db.SubmitChanges(); return project.ProjectId; }
public static int Insert(Tester tester) { DataClassesBugTrackingSystemDataContext db = new DataClassesBugTrackingSystemDataContext(); db.Testers.InsertOnSubmit(tester); db.SubmitChanges(); return tester.TesterId; }
public static void Update(Project project) { DataClassesBugTrackingSystemDataContext db = new DataClassesBugTrackingSystemDataContext(); Project projectToUpdate = db.Projects.Single(t => t.ProjectId == project.ProjectId); projectToUpdate.Name = project.Name; projectToUpdate.Description = project.Description; db.SubmitChanges(); }