public Boolean DeleteLocation(IQueryable<LocationTable> QryDelLocation, AgeasDriverDetails context) { Boolean result = false; try { context.tblLocation.DeleteAllOnSubmit(QryDelLocation); context.SubmitChanges(); //context.Dispose(); result = true; } catch (Exception ex) { result = false; } return result; }
public Boolean InsertLocation(LocationTable LocationDtls) { Boolean result = false; try { using (var context = new AgeasDriverDetails(DBConnectionString)) { if (context.DatabaseExists()) { context.tblLocation.InsertOnSubmit(LocationDtls); context.SubmitChanges(); result = true; } context.Dispose(); } } catch { result = false; } return result; }