Ejemplo n.º 1
0
 public IHttpActionResult updateTask(upTask u)
 {
     try
     {
         DataManager.updateTask(u);
         return(Ok());
     }
     catch (Exception)
     {
         return(InternalServerError());
     }
 }
Ejemplo n.º 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();
                }
            }
        }