public IHttpActionResult updateTask(upTask u)
 {
     try
     {
         DataManager.updateTask(u);
         return(Ok());
     }
     catch (Exception)
     {
         return(InternalServerError());
     }
 }
Example #2
0
        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();
                }
            }
        }