Пример #1
0
 public IHttpActionResult updateTaskTitle(upTitle t)
 {
     try
     {
         DataManager.updateTaskTitle(t);
         return(Ok());
     }
     catch (Exception)
     {
         return(InternalServerError());
     }
 }
Пример #2
0
        public static void updateTaskTitle(upTitle t)
        {
            string query = "updateTaskTitle";

            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", t.id);
                    cmd.Parameters.AddWithValue("tsid", t.tsid);
                    cmd.Parameters.AddWithValue("tit", t.tit);
                    cmd.Parameters.AddWithValue("img", t.img);;

                    conn.Open();
                    cmd.ExecuteNonQuery();
                    conn.Close();
                }
            }
        }