public void UpdateDefect(Defect defect) { DispositionDataContext dispositionDb = new DispositionDataContext(); var updateDefect = (from s in dispositionDb.Defects where s.DefectID == defect.DefectID select s).Single(); updateDefect.Code = defect.Code; updateDefect.Description = defect.Description; updateDefect.Obsolete = defect.Obsolete; dispositionDb.SubmitChanges(); }
public void CreateDefect(Defect defect) { DispositionDataContext dispositionDb = new DispositionDataContext(); dispositionDb.Defects.InsertOnSubmit(defect); dispositionDb.SubmitChanges(); }
public Defect GetDefectById(int id) { DispositionDataContext dispositionDb = new DispositionDataContext(); var defect = (from s in dispositionDb.Defects where s.DefectID == id select s).Single(); var result = new Defect { Code = defect.Code, DefectID = defect.DefectID, Description = defect.Description, Obsolete = defect.Obsolete }; return result; }
partial void DeleteDefect(Defect instance);
partial void UpdateDefect(Defect instance);
partial void InsertDefect(Defect instance);