/// <summary> /// 根据订单的id查询该订单的总金额和数量 /// </summary> /// <param name="orderId"></param> /// <returns></returns> public R_OrderInfo_Product GetMoneyAndCount(int orderId) { string sql = "select count(*),sum(ProPrice*UnitCount) from R_OrderInfo_Product inner join ProductInfo on ProductInfo.ProId= R_OrderInfo_Product.ProId where R_OrderInfo_Product.DelFlag=0 and OrderId=" + orderId; R_OrderInfo_Product rop = null; using (SQLiteDataReader reader = Sqlitehelper.ExecuteReader(sql)) { if (reader.HasRows) { while (reader.Read()) { rop = new R_OrderInfo_Product(); rop.CT = Convert.ToInt32(reader[0]); if (DBNull.Value == reader[1]) { rop.MONEY = 0; } else { rop.MONEY = Convert.ToDecimal(reader[1]); } } } } return(rop); }