public bool deleteTimeDetail(int id, out string msg) { bool isOk = true; if (id == 0) { msg = "data is empty "; return(false); } try { timedb.Open(); int result = timedb.deleteTimeTableDetail(id); msg = "delete complete"; } catch { msg = "error occurs when deleting data to ST_TIMETABLEDETAIL table"; return(false); } finally { timedb.Close(); } return(isOk); }