public void AddDept(deptModels dept) { try { string query = string.Format("" + "INSERT INTO mDept(IdDept,NamaDept)" + "VALUES('" + dept.IdDept + "'," + "'" + dept.NamaDept + "')"); dbAccess.strConn = conn; dbAccess.ExecQuery(query); } catch (Exception) { throw; } }
public bool AddAction(string Name, string Desc) { bool result = false; try { string Query = @"INSERT INTO tbl_action (Name, Description) VALUES ('" + Name + "', '" + Desc + "')"; dbAccess.strConn = conn; int res = dbAccess.ExecQuery(Query); if (res != -1) { result = true; } else { result = false; } } catch (Exception) { result = false; throw; } return(result); }