public IHttpActionResult updateTask(upTask u) { try { DataManager.updateTask(u); return(Ok()); } catch (Exception) { return(InternalServerError()); } }
public static void updateTask(upTask u) { string query = "updateTask"; using (MySqlConnection conn = new MySqlConnection(CONN_STRING)) { using (MySqlCommand cmd = new MySqlCommand(query, conn)) { cmd.CommandType = CommandType.StoredProcedure; MySqlDataAdapter da = new MySqlDataAdapter(cmd); cmd.Parameters.AddWithValue("id", u.id); cmd.Parameters.AddWithValue("tsid", u.tsid);; conn.Open(); cmd.ExecuteNonQuery(); conn.Close(); } } }