public bool commitDelete(int _id) { jobsDataContext objJobDC = new jobsDataContext(); using (objJobDC) { var objDelJob = objJobDC.jobs.Single(x => x.Id == _id); objJobDC.jobs.DeleteOnSubmit(objDelJob); objJobDC.SubmitChanges(); return true; } }
public bool commitUpdate(int _id, string _title, string _desc, DateTime _date) { jobsDataContext objJobDC = new jobsDataContext(); using (objJobDC) { var objUpJob = objJobDC.jobs.Single(x => x.Id == _id); objUpJob.title = _title; objUpJob.description = _desc; objUpJob.last_date_apply = _date; objJobDC.SubmitChanges(); return true; } }
public bool commitInsert(string _title, string _desc, DateTime _date) { jobsDataContext objJobDC = new jobsDataContext(); using (objJobDC) { job objNewJob = new job(); objNewJob.title = _title; objNewJob.description = _desc; objNewJob.last_date_apply = _date; objJobDC.jobs.InsertOnSubmit(objNewJob); objJobDC.SubmitChanges(); return true; } }