Пример #1
0
    public static Order GetAnnounedOrderByOrderId(int orderid)
    {
        string          sql = "select * from cloudorder where id=?id";
        MySqlConnection con = new MySqlConnection(Config_MySql.sqlUrl);

        con.Open();
        MySqlCommand comm = new MySqlCommand(sql, con);

        comm.Parameters.Add(new MySqlParameter("?id", orderid));
        MySqlDataReader rdr   = comm.ExecuteReader();
        Order           order = new Order();

        while (rdr.Read())
        {
            order.Id        = rdr.GetInt32("id");
            order.UserId    = rdr.GetInt32("userid");
            order.CloudCode = rdr.GetString("cloudcode");
            order.Addtime   = rdr.GetString("addtime");
            order.OrderId   = rdr.GetString("orderid");
            order.GoodId    = rdr.GetInt32("goodid");
            order.good      = GoodService.GetAnnouncedGoodMsg(order.GoodId);
        }
        comm.Clone();
        con.Close();
        return(order);
    }