public void Insert(Domain.AutoPay.AutoPay pay) { AddParameter("OrderId", pay.OrderId); AddParameter("PayAccountNo", pay.PayAccountNo); AddParameter("PayType", pay.PayType); AddParameter("OrderType", pay.OrderType); AddParameter("Time", pay.Time); AddParameter("Success", pay.Success); AddParameter("ProcessState", pay.ProcessState); ExecuteNonQuery("INSERT INTO [dbo].[T_AutoPay]([OrderId],[PayAccountNo],[PayType],[OrderType],[Time],[Success],[ProcessState])VALUES (@OrderId ,@PayAccountNo ,@PayType ,@OrderType,@Time ,@Success ,@ProcessState);"); }
public Domain.AutoPay.AutoPay Query(decimal orderId) { using (var reader = ExecuteReader("SELECT OrderId,PayAccountNo,PayType,Time,Success,ProcessState,OrderType FROM T_AutoPay WHERE ProcessState=0 AND OrderId = " + orderId)) { Domain.AutoPay.AutoPay auto = null; if (reader.Read()) { auto = new Domain.AutoPay.AutoPay(); auto.OrderId = reader.GetDecimal(0); auto.PayAccountNo = reader.GetString(1); auto.PayType = (WithholdingAccountType)reader.GetByte(2); auto.Time = reader.GetDateTime(3); auto.Success = reader.GetBoolean(4); auto.ProcessState = reader.GetBoolean(5); auto.OrderType = (OrderType)reader.GetByte(6); } return(auto); } }
public List <Domain.AutoPay.AutoPay> QueryNoPorcess() { string sql = "SELECT OrderId,PayAccountNo,PayType,Time,Success,ProcessState,OrderType FROM T_AutoPay WHERE ProcessState = 0 ORDER BY Time"; using (var reader = ExecuteReader(sql)) { List <Domain.AutoPay.AutoPay> list = new List <Domain.AutoPay.AutoPay>(); while (reader.Read()) { Domain.AutoPay.AutoPay auto = new Domain.AutoPay.AutoPay(); auto.OrderId = reader.GetDecimal(0); auto.PayAccountNo = reader.GetString(1); auto.PayType = (WithholdingAccountType)reader.GetByte(2); auto.Time = reader.GetDateTime(3); auto.Success = reader.GetBoolean(4); auto.ProcessState = reader.GetBoolean(5); auto.OrderType = (OrderType)reader.GetByte(6); list.Add(auto); } return(list); } }
public void Update(Domain.AutoPay.AutoPay pay) { throw new NotImplementedException(); }