/// <summary> /// Add the specified model. /// </summary> /// <param name="model">Model.</param> public bool Add(OrderInfo model) { model.CreateDate = DateTime.Now; CommandStruct command = new CommandStruct("OrderInfo", CommandMode.Insert); command.AddParameter("OrderNO", SqlDbType.VarChar, model.OrderNO); command.AddParameter("MerchandiseName", SqlDbType.VarChar, model.MerchandiseName); command.AddParameter("PayType", SqlDbType.VarChar, model.PayType); command.AddParameter("Amount", SqlDbType.Decimal, model.Amount); command.AddParameter("Currency", SqlDbType.VarChar, model.Currency); command.AddParameter("Expand", SqlDbType.VarChar, model.Expand); command.AddParameter("SerialNumber", SqlDbType.VarChar, model.SerialNumber); command.AddParameter("PassportID", SqlDbType.VarChar, model.PassportID); command.AddParameter("ServerID", SqlDbType.Int, model.ServerID); command.AddParameter("GameID", SqlDbType.Int, model.GameID); command.AddParameter("gameName", SqlDbType.VarChar, model.GameName); command.AddParameter("ServerName", SqlDbType.VarChar, model.ServerName); command.AddParameter("PayStatus", SqlDbType.Int, model.PayStatus); command.AddParameter("Signature", SqlDbType.VarChar, model.Signature); command.AddParameter("Remarks", SqlDbType.Text, model.Remarks); command.AddParameter("GameCoins", SqlDbType.Int, model.GameCoins); command.AddParameter("SendState", SqlDbType.Int, model.SendState); command.AddParameter("RetailID", SqlDbType.VarChar, model.RetailID);//添加渠道商ID 孙德尧 2012/4/1 9:24 command.AddParameter("DeviceID", SqlDbType.VarChar, model.DeviceID == null ? string.Empty : model.DeviceID); if (model.SendDate > DateTime.MinValue) { command.AddParameter("SendDate", SqlDbType.DateTime, model.SendDate); } command.AddParameter("CreateDate", SqlDbType.DateTime, model.CreateDate); command.Parser(); int rows = SqlHelper.ExecuteNonQuery(ConfigManger.connectionString, CommandType.Text, command.Sql, command.SqlParameters); if (rows > 0) return true; return false; }
/// <summary> /// 生成Sql语句 /// </summary> /// <param name="identityId">消息队列负载标识ID</param> /// <param name="command">命令对象</param> /// <returns></returns> public abstract SqlStatement GenerateSql(int identityId, CommandStruct command);
/// <summary> /// 执行返回影响行数的Sql语句(增,删,改) /// </summary> /// <param name="command"></param> /// <returns></returns> public int ExecuteQuery(CommandStruct command) { command.Parser(); return(ExecuteQuery(command.CommandType, command.Sql, command.Parameters)); }
/// <summary> /// 执行只返回第一行第一列值的sql语句 /// </summary> /// <param name="command"></param> /// <returns></returns> public object ExecuteScalar(CommandStruct command) { command.Parser(); return(ExecuteScalar(command.CommandType, command.Sql, command.Parameters)); }
/// <summary> /// 执行Sql语句 /// </summary> /// <param name="command"></param> /// <returns></returns> public IDataReader ExecuteReader(CommandStruct command) { command.Parser(); return(ExecuteReader(command.CommandType, command.Sql, command.Parameters)); }
/// <summary> /// /// </summary> /// <param name="info"></param> public bool PostFeedBack(FeedbackInfo info) { CommandStruct command = new CommandStruct("GMFeedBack", CommandMode.Insert); command.AddParameter("UId", SqlDbType.Int, info.Uid); command.AddParameter("GameID", SqlDbType.Int, info.GameID); command.AddParameter("ServerID", SqlDbType.Int, info.ServerID); command.AddParameter("GMType", SqlDbType.Int, info.Type); command.AddParameter("content", SqlDbType.VarChar, info.Content); command.AddParameter("Pid", SqlDbType.VarChar, info.Pid); command.AddParameter("NickName", SqlDbType.VarChar, info.NickName); command.AddParameter("SubmittedTime", SqlDbType.DateTime, info.CreateDate); command.Parser(); return SqlHelper.ExecuteNonQuery(ConfigManger.connectionString, CommandType.Text, command.Sql, command.SqlParameters) > 0; }
/// <summary> /// /// </summary> /// <param name="feedbackId"></param> /// <param name="replyContent"></param> /// <param name="replyId">回复者</param> /// <returns></returns> public bool ReplyToFeedBack(int feedbackId, string replyContent, int replyId) { CommandStruct command = new CommandStruct("GMFeedBack", CommandMode.Modify); command.AddParameter("RContent", SqlDbType.VarChar, replyContent); command.AddParameter("ReplyID", SqlDbType.VarChar, replyId); command.AddParameter("ReplyTime", SqlDbType.DateTime, DateTime.Now); command.Filter = new CommandFilter(); command.Filter.Condition = "GMId=@GMId"; command.Filter.AddParam("@GMId", SqlDbType.Int, 0, feedbackId); command.Parser(); return SqlHelper.ExecuteNonQuery(ConfigManger.connectionString, CommandType.Text, command.Sql, command.SqlParameters) > 0; }
internal bool PaySuccess(string orderNo, OrderInfo orderInfo) { CommandStruct command = new CommandStruct("OrderInfo", CommandMode.Modify); orderInfo.PayStatus = 2; command.AddParameter("PayStatus", SqlDbType.Int, orderInfo.PayStatus); if (!string.IsNullOrEmpty(orderInfo.PayType)) { command.AddParameter("PayType", SqlDbType.VarChar, orderInfo.PayType); } if (orderInfo.Amount > 0 && orderInfo.GameCoins > 0) { command.AddParameter("Amount", SqlDbType.Decimal, orderInfo.Amount); command.AddParameter("GameCoins", SqlDbType.Int, orderInfo.GameCoins); } command.Filter = new CommandFilter(); command.Filter.Condition = "OrderNO=@OrderNO"; command.Filter.AddParam("@OrderNO", SqlDbType.VarChar, 0, orderNo); command.Parser(); int rows = SqlHelper.ExecuteNonQuery(ConfigManger.connectionString, CommandType.Text, command.Sql, command.SqlParameters); return rows > 0; }
/// <summary> /// Updatestr the specified OrderNo. /// </summary> /// <param name="OrderNo">Order no.</param> public bool Updatestr(string OrderNo) { CommandStruct command = new CommandStruct("OrderInfo", CommandMode.Modify); command.AddParameter("SendState", 2); command.AddParameter("SendDate", SqlDbType.DateTime, DateTime.Now); command.Filter = new CommandFilter(); command.Filter.Condition = "OrderNO=@OrderNO"; command.Filter.AddParam("@OrderNO", SqlDbType.VarChar, 0, OrderNo); command.Parser(); int rows = SqlHelper.ExecuteNonQuery(ConfigManger.connectionString, CommandType.Text, command.Sql, command.SqlParameters); { if (rows > 0) { return true; } else { return false; } } }
/// <summary> /// Updates the by91. /// </summary> /// <returns><c>true</c>, if by91 was updated, <c>false</c> otherwise.</returns> /// <param name="model">Model.</param> /// <param name="callback">If set to <c>true</c> callback.</param> public bool UpdateBy91(OrderInfo model, bool callback) { CommandStruct command = new CommandStruct("OrderInfo", CommandMode.Modify); if (callback) { command.AddParameter("MerchandiseName", SqlDbType.VarChar, model.MerchandiseName); command.AddParameter("PayType", SqlDbType.VarChar, model.PayType); command.AddParameter("Amount", SqlDbType.Decimal, model.Amount); command.AddParameter("SendState", SqlDbType.Int, model.SendState); command.AddParameter("PayStatus", SqlDbType.Int, model.PayStatus); command.AddParameter("GameCoins", SqlDbType.Int, model.GameCoins); command.AddParameter("Signature", SqlDbType.VarChar, model.Signature); } else { command.AddParameter("ServerID", SqlDbType.Int, model.ServerID); command.AddParameter("PassportID", SqlDbType.VarChar, model.PassportID); command.AddParameter("GameID", SqlDbType.Int, model.GameID); command.AddParameter("RetailID", SqlDbType.VarChar, model.RetailID);//20 //修改了服务器名称为空写库的BUG panx 2012-11-26 if (!string.IsNullOrEmpty(model.ServerName)) { command.AddParameter("ServerName", SqlDbType.VarChar, model.ServerName); } //修改了游戏名称为空写库的BUG panx 2012-11-26 if (!string.IsNullOrEmpty(model.GameName)) { command.AddParameter("gameName", SqlDbType.VarChar, model.GameName); } } command.Filter = new CommandFilter(); command.Filter.Condition = "OrderNO=@OrderNO"; command.Filter.AddParam("@OrderNO", SqlDbType.VarChar, 0, model.OrderNO); command.Parser(); int rows = SqlHelper.ExecuteNonQuery(ConfigManger.connectionString, CommandType.Text, command.Sql, command.SqlParameters); return rows > 0; }
/// <summary> /// 修改状态 /// </summary> /// <param name="model"></param> /// <returns></returns> public bool Update(OrderInfo model) { CommandStruct command = new CommandStruct("OrderInfo", CommandMode.Modify); command.AddParameter("SerialNumber", SqlDbType.VarChar, model.SerialNumber); command.AddParameter("PayStatus", SqlDbType.Int, model.PayStatus); command.AddParameter("@Signature", SqlDbType.VarChar, 0, model.Signature); command.Filter = new CommandFilter(); command.Filter.Condition = "OrderNO=@OrderNO"; command.Filter.AddParam("@OrderNO", SqlDbType.VarChar, 0, model.OrderNO); command.Parser(); int rows = SqlHelper.ExecuteNonQuery(ConfigManger.connectionString, CommandType.Text, command.Sql, command.SqlParameters); return rows > 0; }