예제 #1
0
파일: HYDal.cs 프로젝트: aceleesh/zypPay
        public DataTable GetUnSendTradeinfo()
        {
            DataTable dt = null;

            string sql = @"select localorderno, tradetime , amount,serverflowno,tradestatus,tradetype ,
porderno,createtime,updatetime,  oprid,serverresponse,paycode,channel,
customerid,customername,clientid ,TID,ErrorCode,OldLocalOrderNo,OldServerFlowNo  
from tradeinfo where sendflag is null";

            // if (DBHelper == null) DBHelper = new SQLiteHelper(DBSource);
            dt = DBHelper.ExecuteDataTable(sql);

            return(dt);
        }
예제 #2
0
        /// <summary>
        /// 检查操作员编号密码商户号是否正确
        /// </summary>
        /// <param name="userID">操作员编号</param>
        /// <param name="pwd">密码</param>
        /// <param name="clientID">商户号</param>
        /// <returns></returns>
        public OprInfoEntiy CheckLoginUsr(string userID, string pwd, string clientID)
        {
            //int res = -1;

            string         sql   = "select * from oprinfo where OprId=?OprID and OprPWD=?OprPWD and ClientID=?ClientID";
            MySqlParameter para1 = new MySqlParameter();

            para1.Direction     = ParameterDirection.Input;
            para1.Value         = userID;
            para1.ParameterName = "?OprID";

            MySqlParameter para2 = new MySqlParameter();

            para2.Direction     = ParameterDirection.Input;
            para2.Value         = CryptographyHelper.MD5Encrypt(pwd);
            para2.ParameterName = "?OprPWD";

            MySqlParameter para3 = new MySqlParameter();

            para3.Direction     = ParameterDirection.Input;
            para3.Value         = clientID;
            para3.ParameterName = "?ClientID";
            //MySqlHelper .cr
            List <MySqlParameter> paras = new List <MySqlParameter> ();

            paras.Add(para1);
            paras.Add(para2);
            paras.Add(para3);

            DataTable            dt   = DbHelper.ExecuteDataTable(sql, paras.ToArray());
            IList <OprInfoEntiy> oprs = dt.ConvertToList <OprInfoEntiy>();

            if (oprs != null && oprs.Count > 0)
            {
                return(oprs[0]);
            }
            else
            {
                return(null);
            }


            // return res;
        }
예제 #3
0
        public DataTable GetTradeInfoPager(WebTradeCondition queryCondition, int pageSize, int pageIndex)
        {
            DataTable dt = null;


            string sql = "select  * from  tradeinfo where 1=1 ";
            List <MySqlParameter> paras = new List <MySqlParameter>();

            if (!string.IsNullOrEmpty(queryCondition.ClientID))
            {
                sql += " and ClientID=?ClientID";
                MySqlParameter para = new MySqlParameter();
                para.ParameterName = "?ClientID";
                para.Value         = queryCondition.ClientID;
                para.Direction     = ParameterDirection.Input;
                paras.Add(para);
            }

            if (!string.IsNullOrEmpty(queryCondition.OprID))
            {
                sql += " and OprID=?OprID";
                MySqlParameter para = new MySqlParameter();
                para.ParameterName = "?OprID";
                para.Value         = queryCondition.OprID;
                para.Direction     = ParameterDirection.Input;
                paras.Add(para);
            }


            if (!string.IsNullOrEmpty(queryCondition.LocalFlowNo))
            {
                sql += " and LocalOrderNo=?LocalOrderNo";
                MySqlParameter para = new MySqlParameter();
                para.ParameterName = "?LocalOrderNo";
                para.Value         = queryCondition.LocalFlowNo;
                para.Direction     = ParameterDirection.Input;
                paras.Add(para);
            }


            if (!string.IsNullOrEmpty(queryCondition.ServerFlowNo))
            {
                sql += " and ServerFlowNo=?ServerFlowNo";
                MySqlParameter para = new MySqlParameter();
                para.ParameterName = "?ServerFlowNo";
                para.Value         = queryCondition.ServerFlowNo;
                para.Direction     = ParameterDirection.Input;
                paras.Add(para);
            }

            if (queryCondition.StartDate != null)
            {
                sql += " and TradeTime>=?StartDate";
                MySqlParameter para = new MySqlParameter();
                para.ParameterName = "?StartDate";
                para.Value         = queryCondition.StartDate;
                para.Direction     = ParameterDirection.Input;
                para.DbType        = DbType.DateTime;
                paras.Add(para);
            }

            if (queryCondition.EndDate != null)
            {
                sql += " and TradeTime<?EndDate";
                MySqlParameter para = new MySqlParameter();
                para.ParameterName = "?EndDate";
                para.Value         = queryCondition.EndDate;
                para.Direction     = ParameterDirection.Input;
                para.DbType        = DbType.DateTime;
                paras.Add(para);
            }
            int startIndex = pageSize * pageIndex;

            sql += " limit " + startIndex.ToString() + " ," + pageSize.ToString();;


            dt = DbHelper.ExecuteDataTable(sql, paras.ToArray());
            return(dt);
        }