Beispiel #1
0
        public bool OrderIsPay(string orderID, int status)
        {
            string sql = "SELECT 1 FROM TD_Order_WeiXinPay WHERE OrderID=@OrderID and Status=@Status";

            MySqlParameter[] parameters =
            {
                new MySqlParameter("@OrderID", orderID),
                new MySqlParameter("@Status",  status)
            };
            object result = MySqlHelperUtil.ExecuteScalar(sql, parameters);

            return(result != null);
        }
Beispiel #2
0
        public bool Exists(Guid DonationID, string tranID)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("select 1 from TD_Donation_Info");
            strSql.Append(" where ");
            strSql.Append(" DonationID = @DonationID ");
            MySqlParameter[] parameters =
            {
                new MySqlParameter("@DonationID", DonationID)
            };
            object result = MySqlHelperUtil.ExecuteScalar(tranID, strSql.ToString(), parameters);

            return(result != null);
        }
        public bool Exists(string OrderID)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("select 1 from TD_Order_Consignee");
            strSql.Append(" where ");
            strSql.Append(" OrderID = @OrderID ");
            MySqlParameter[] parameters =
            {
                new MySqlParameter("@OrderID", OrderID)
            };
            object result = MySqlHelperUtil.ExecuteScalar(strSql.ToString(), parameters);

            return(result != null);
        }
Beispiel #4
0
        public bool Exists(string OrderID, string NonceStr, string tranID)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("select 1 from TD_Order_WeiXinPay");
            strSql.Append(" where ");
            strSql.Append(" OrderID = @OrderID and  "); strSql.Append(" NonceStr = @NonceStr ");
            MySqlParameter[] parameters =
            {
                new MySqlParameter("@OrderID", OrderID), new MySqlParameter("@NonceStr", NonceStr)
            };
            object result = MySqlHelperUtil.ExecuteScalar(tranID, strSql.ToString(), parameters);

            return(result != null);
        }
Beispiel #5
0
        /// <summary>
        /// 获取记录条数
        /// </summary>
        public int GetRecordCount(string strWhere, IDictionary <string, object> dictParams)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("select count(1) from TD_Donation_Info");
            if (!string.IsNullOrEmpty(strWhere))
            {
                strSql.Append(" where " + strWhere);
            }
            List <MySqlParameter> parameters = new List <MySqlParameter>();

            if (dictParams != null)
            {
                foreach (var pair in dictParams)
                {
                    MySqlParameter parameter = new MySqlParameter("@" + pair.Key, pair.Value);
                    parameters.Add(parameter);
                }
            }
            object result = MySqlHelperUtil.ExecuteScalar(strSql.ToString(), parameters.ToArray());

            parameters.Clear();
            return(int.Parse(result.ToString()));
        }