public bool DeleteOrgOtherFunders(int id) { bool result = true; try { BOTADataContext db = new BOTADataContext(connectString); //using (BOTADataContext db) { OtherFunder item = (from o in db.OtherFunders where o.OtherFundID == id select o).FirstOrDefault(); if (item != null) { db.OtherFunders.DeleteOnSubmit(item); db.SubmitChanges(); } } } catch (Exception ex) { //Log4Net uses its dll, bin/Log4Net.config -> has C:/Logs/errors2.txt Log.EnsureInitialized(); Log.Error(typeof(OrganizationRepository), "----------------------------------------------", ex); result = false; } return(result); }
public bool InsertNewOrgOtherFunders(int id) { BOTADataContext db = new BOTADataContext(connectString); try { OtherFunder o = new OtherFunder(); o.OrgID = id; db.OtherFunders.InsertOnSubmit(o); db.SubmitChanges(); return(true); } catch (Exception ex) { Log.EnsureInitialized(); Log.Error(typeof(OrganizationRepository), "----------------------------------------------", ex); return(false); } }