public int Add(Model.TD_WeiXin_Member model) { StringBuilder strSql = new StringBuilder(); strSql.Append("insert into TD_WeiXin_Member("); strSql.Append("MemberID,NickName,HeaderImage,OpenID,CreateTime,IsFocused,FocusTime,UnFocusTime,Sex,Country,Province,City,OrgID"); strSql.Append(") values ("); strSql.Append("@MemberID,@NickName,@HeaderImage,@OpenID,@CreateTime,@IsFocused,@FocusTime,@UnFocusTime,@Sex,@Country,@Province,@City,@OrgID"); strSql.Append(") "); MySqlParameter[] parameters = { new MySqlParameter("@MemberID", model.MemberID), new MySqlParameter("@NickName", model.NickName), new MySqlParameter("@HeaderImage", model.HeaderImage), new MySqlParameter("@OpenID", model.OpenID), new MySqlParameter("@CreateTime", model.CreateTime), new MySqlParameter("@IsFocused", model.IsFocused), new MySqlParameter("@FocusTime", model.FocusTime), new MySqlParameter("@UnFocusTime", model.UnFocusTime), new MySqlParameter("@Sex", model.Sex), new MySqlParameter("@Country", model.Country), new MySqlParameter("@Province", model.Province), new MySqlParameter("@City", model.City), new MySqlParameter("@OrgID", model.OrgID) }; return(MySqlHelperUtil.ExecuteNonQuery(strSql.ToString(), parameters)); }
/// <summary> /// 增加一条数据 /// </summary> public int Add(ShiMiao.Model.TD_Donation_Info model, string tranID) { StringBuilder strSql = new StringBuilder(); strSql.Append("insert into TD_Donation_Info("); strSql.Append("DonationID,Title,ImageURL,Content,ReadCount,IsImage,IsDeleted,CreateTime,CreatorID,CreatorName,UpdateTime,UpdaterID,UpdaterName,PublishOrgID,PublishOrgName"); strSql.Append(") values ("); strSql.Append("@DonationID,@Title,@ImageURL,@Content,@ReadCount,@IsImage,@IsDeleted,@CreateTime,@CreatorID,@CreatorName,@UpdateTime,@UpdaterID,@UpdaterName,@PublishOrgID,@PublishOrgName"); strSql.Append(") "); MySqlParameter[] parameters = { new MySqlParameter("@DonationID", model.DonationID), new MySqlParameter("@Title", model.Title), new MySqlParameter("@ImageURL", model.ImageURL), new MySqlParameter("@Content", model.Content), new MySqlParameter("@ReadCount", model.ReadCount), new MySqlParameter("@IsImage", model.IsImage), new MySqlParameter("@IsDeleted", model.IsDeleted), new MySqlParameter("@CreateTime", model.CreateTime), new MySqlParameter("@CreatorID", model.CreatorID), new MySqlParameter("@CreatorName", model.CreatorName), new MySqlParameter("@UpdateTime", model.UpdateTime), new MySqlParameter("@UpdaterID", model.UpdaterID), new MySqlParameter("@UpdaterName", model.UpdaterName), new MySqlParameter("@PublishOrgID", model.PublishOrgID), new MySqlParameter("@PublishOrgName", model.PublishOrgName) }; return(MySqlHelperUtil.ExecuteNonQuery(tranID, strSql.ToString(), parameters)); }
/// <summary> /// 增加一条数据 /// </summary> public int Add(ShiMiao.Model.TD_Shop_Order model, string tranID) { StringBuilder strSql = new StringBuilder(); strSql.Append("insert into TD_Shop_Order("); strSql.Append("OrderID,PayNo,OrgID,OriPrice,RealPrice,Status,MemberID,NickName,HeaderImage,Mobile,OrderType,PayType,IsPay,IsMemberDeleted,OrderTime,PayTime,CompleteTime,Message,ExtraPrice"); strSql.Append(") values ("); strSql.Append("@OrderID,@PayNo,@OrgID,@OriPrice,@RealPrice,@Status,@MemberID,@NickName,@HeaderImage,@Mobile,@OrderType,@PayType,@IsPay,@IsMemberDeleted,@OrderTime,@PayTime,@CompleteTime,@Message,@ExtraPrice"); strSql.Append(") "); MySqlParameter[] parameters = { new MySqlParameter("@OrderID", model.OrderID), new MySqlParameter("@PayNo", model.PayNo), new MySqlParameter("@OrgID", model.OrgID), new MySqlParameter("@OriPrice", model.OriPrice), new MySqlParameter("@RealPrice", model.RealPrice), new MySqlParameter("@Status", model.Status), new MySqlParameter("@MemberID", model.MemberID), new MySqlParameter("@NickName", model.NickName), new MySqlParameter("@HeaderImage", model.HeaderImage), new MySqlParameter("@Mobile", model.Mobile), new MySqlParameter("@OrderType", model.OrderType), new MySqlParameter("@PayType", model.PayType), new MySqlParameter("@IsPay", model.IsPay), new MySqlParameter("@IsMemberDeleted", model.IsMemberDeleted), new MySqlParameter("@OrderTime", model.OrderTime), new MySqlParameter("@PayTime", model.PayTime), new MySqlParameter("@CompleteTime", model.CompleteTime), new MySqlParameter("@Message", model.Message), new MySqlParameter("@ExtraPrice", model.ExtraPrice) }; return(MySqlHelperUtil.ExecuteNonQuery(tranID, strSql.ToString(), parameters)); }
/// <summary> /// 增加一条数据 /// </summary> public int Add(ShiMiao.Model.TD_Donation_Order model, string tranID) { StringBuilder strSql = new StringBuilder(); strSql.Append("insert into TD_Donation_Order("); strSql.Append("OrderID,PayNo,DonationID,OpenID,Name,Mobile,NickName,HeaderImage,OrderTime,Fee,IsPay,PayType,PayTime,DonationType,MemberID,OrgID,Message,IsAnonymous"); strSql.Append(") values ("); strSql.Append("@OrderID,@PayNo,@DonationID,@OpenID,@Name,@Mobile,@NickName,@HeaderImage,@OrderTime,@Fee,@IsPay,@PayType,@PayTime,@DonationType,@MemberID,@OrgID,@Message,@IsAnonymous"); strSql.Append(") "); MySqlParameter[] parameters = { new MySqlParameter("@OrderID", model.OrderID), new MySqlParameter("@PayNo", model.PayNo), new MySqlParameter("@DonationID", model.DonationID), new MySqlParameter("@OpenID", model.OpenID), new MySqlParameter("@Name", model.Name), new MySqlParameter("@Mobile", model.Mobile), new MySqlParameter("@NickName", model.NickName), new MySqlParameter("@HeaderImage", model.HeaderImage), new MySqlParameter("@OrderTime", model.OrderTime), new MySqlParameter("@Fee", model.Fee), new MySqlParameter("@IsPay", model.IsPay), new MySqlParameter("@PayType", model.PayType), new MySqlParameter("@PayTime", model.PayTime), new MySqlParameter("@DonationType", model.DonationType), new MySqlParameter("@MemberID", model.MemberID), new MySqlParameter("@OrgID", model.OrgID), new MySqlParameter("@Message", model.Message), new MySqlParameter("@IsAnonymous", model.IsAnonymous) }; return(MySqlHelperUtil.ExecuteNonQuery(tranID, strSql.ToString(), parameters)); }
public int Update(Model.TD_WeiXin_Member model) { StringBuilder strSql = new StringBuilder(); List <string> fields = new List <string>(); IList <MySqlParameter> parameters = new List <MySqlParameter>(); strSql.Append("update TD_WeiXin_Member set "); if (model.FocusTime.HasValue) { fields.Add("FocusTime=@FocusTime"); parameters.Add(new MySqlParameter("@FocusTime", model.FocusTime)); } if (!string.IsNullOrEmpty(model.IsFocused)) { fields.Add("IsFocused=@IsFocused"); parameters.Add(new MySqlParameter("@IsFocused", model.IsFocused)); } if (model.UnFocusTime.HasValue) { fields.Add("UnFocusTime=@UnFocusTime"); parameters.Add(new MySqlParameter("@UnFocusTime", model.UnFocusTime)); } strSql.Append(string.Join(",", fields)); strSql.Append(" where MemberID=@MemberID "); parameters.Add(new MySqlParameter("@MemberID", model.MemberID)); return(MySqlHelperUtil.ExecuteNonQuery(strSql.ToString(), parameters.ToArray())); }
/// <summary> /// 增加一条数据 /// </summary> public int Add(ShiMiao.Model.TD_Order_WeiXinPay model, string tranID) { StringBuilder strSql = new StringBuilder(); strSql.Append("insert into TD_Order_WeiXinPay("); strSql.Append("OrderID,NonceStr,Timestamp,OrgID,WeiXinOrderID,OrderFee,CashFee,Package,Status,PayTime,CallBackTime"); strSql.Append(") values ("); strSql.Append("@OrderID,@NonceStr,@Timestamp,@OrgID,@WeiXinOrderID,@OrderFee,@CashFee,@Package,@Status,@PayTime,@CallBackTime"); strSql.Append(") "); MySqlParameter[] parameters = { new MySqlParameter("@OrderID", model.OrderID), new MySqlParameter("@NonceStr", model.NonceStr), new MySqlParameter("@Timestamp", model.Timestamp), new MySqlParameter("@OrgID", model.OrgID), new MySqlParameter("@WeiXinOrderID", model.WeiXinOrderID), new MySqlParameter("@OrderFee", model.OrderFee), new MySqlParameter("@CashFee", model.CashFee), new MySqlParameter("@Package", model.Package), new MySqlParameter("@Status", model.Status), new MySqlParameter("@PayTime", model.PayTime), new MySqlParameter("@CallBackTime", model.CallBackTime) }; return(MySqlHelperUtil.ExecuteNonQuery(tranID, strSql.ToString(), parameters)); }
/// <summary> /// 增加阅读数 /// </summary> public int AddReadCount(Guid id) { string sql = "UPDATE TD_Donation_Info SET ReadCount=ReadCount+1 WHERE DonationID=@ID"; MySqlParameter[] parameters = { new MySqlParameter("@ID", id) }; return(MySqlHelperUtil.ExecuteNonQuery(sql, parameters)); }
public int Frozen(string goodsID, int amount, string tranID) { string sql = "UPDATE TD_Shop_Goods SET Balance=Balance-@Amount,Frozen=Frozen+@Amount WHERE GoodsID=@GoodsID and Balance>@Amount"; MySqlParameter[] parameters = { new MySqlParameter("@GoodsID", goodsID), new MySqlParameter("@Amount", amount) }; return(MySqlHelperUtil.ExecuteNonQuery(tranID, sql, parameters)); }
public int PayOrder(string goodsID, int amount, string tranID) { string sql = "UPDATE td_sel_goods SET Frozen=Frozen-@Amount WHERE GoodsID=@GoodsID"; MySqlParameter[] parameters = { new MySqlParameter("@GoodsID", goodsID), new MySqlParameter("@Amount", amount) }; return(MySqlHelperUtil.ExecuteNonQuery(tranID, sql, parameters)); }
public int PayOrder(Model.TD_Shop_Order model, string tranID) { string sql = "UPDATE TD_Shop_Order SET PayTime=@PayTime,IsPay=@IsPay WHERE OrderID=@OrderID"; MySqlParameter[] parameters = { new MySqlParameter("@PayTime", model.PayTime), new MySqlParameter("@IsPay", model.IsPay), new MySqlParameter("@OrderID", model.OrderID) }; return(MySqlHelperUtil.ExecuteNonQuery(tranID, sql, parameters)); }
/// <summary> /// 软删除一条数据 /// </summary> public int DeleteLogic(Guid DonationID, string tranID) { StringBuilder strSql = new StringBuilder(); strSql.Append("update TD_Donation_Info set IsDeleted='1'"); strSql.Append(" where DonationID=@DonationID "); MySqlParameter[] parameters = { new MySqlParameter("@DonationID", DonationID) }; return(MySqlHelperUtil.ExecuteNonQuery(tranID, strSql.ToString(), parameters)); }
/// <summary> /// 删除一条数据 /// </summary> public int Delete(Guid DonationID) { StringBuilder strSql = new StringBuilder(); strSql.Append("delete from TD_Donation_Info "); strSql.Append(" where DonationID=@DonationID "); MySqlParameter[] parameters = { new MySqlParameter("@DonationID", DonationID) }; return(MySqlHelperUtil.ExecuteNonQuery(strSql.ToString(), parameters)); }
/// <summary> /// 删除一条数据 /// </summary> public int Delete(Guid OrderID, string tranID) { StringBuilder strSql = new StringBuilder(); strSql.Append("delete from TD_Donation_Order "); strSql.Append(" where OrderID=@OrderID "); MySqlParameter[] parameters = { new MySqlParameter("@OrderID", OrderID) }; return(MySqlHelperUtil.ExecuteNonQuery(tranID, strSql.ToString(), parameters)); }
public int ClearFrozenGoods(DateTime time, int orderStatus) { string sql = @"UPDATE td_shop_order as orders inner join td_shop_ordergoods as ordergoods on orders.OrderID=ordergoods.OrderID inner join td_shop_goods as goods on ordergoods.GoodsID=goods.goodsid set orders.Status=@OrderStatus, goods.balance=goods.balance+ordergoods.Amount,goods.frozen=goods.frozen-ordergoods.Amount where orders.IsPay='0' and orders.OrderTime<@time and goods.frozen>ordergoods.Amount"; MySqlParameter[] parameters = { new MySqlParameter("@Time", time), new MySqlParameter("@OrderStatus", orderStatus) }; return(MySqlHelperUtil.ExecuteNonQuery(sql, parameters)); }
public int Sync(Model.TD_Order_WeiXinPay model, string tranID) { string sql = "UPDATE TD_Order_WeiXinPay SET Status=@Status,OrderFee=@OrderFee,CashFee=@CashFee,CallBackTime=@CallBackTime WHERE OrderID=@OrderID and NonceStr=@NonceStr and Status=0"; MySqlParameter[] parameters = { new MySqlParameter("@Status", model.Status), new MySqlParameter("@OrderFee", model.OrderFee), new MySqlParameter("@CashFee", model.CashFee), new MySqlParameter("@CallBackTime", model.CallBackTime), new MySqlParameter("@OrderID", model.OrderID), new MySqlParameter("@NonceStr", model.NonceStr) }; return(MySqlHelperUtil.ExecuteNonQuery(tranID, sql, parameters)); }
/// <summary> /// 软删除一条数据 /// </summary> public int DeleteLogic(string OrderID, string NonceStr, string tranID) { StringBuilder strSql = new StringBuilder(); strSql.Append("update TD_Order_WeiXinPay set IsDeleted='1'"); strSql.Append(" where OrderID=@OrderID and NonceStr=@NonceStr "); MySqlParameter[] parameters = { new MySqlParameter("@OrderID", OrderID), new MySqlParameter("@NonceStr", NonceStr) }; return(MySqlHelperUtil.ExecuteNonQuery(tranID, strSql.ToString(), parameters)); }
/// <summary> /// 删除一条数据 /// </summary> public int Delete(string OrderID, string NonceStr) { StringBuilder strSql = new StringBuilder(); strSql.Append("delete from TD_Order_WeiXinPay "); strSql.Append(" where OrderID=@OrderID and NonceStr=@NonceStr "); MySqlParameter[] parameters = { new MySqlParameter("@OrderID", OrderID), new MySqlParameter("@NonceStr", NonceStr) }; return(MySqlHelperUtil.ExecuteNonQuery(strSql.ToString(), parameters)); }
/// <summary> /// 更新一条数据 /// </summary> public int Update(ShiMiao.Model.TD_Donation_Info model, string tranID) { StringBuilder strSql = new StringBuilder(); strSql.Append("update TD_Donation_Info set "); strSql.Append(" DonationID = @DonationID , "); strSql.Append(" Title = @Title , "); strSql.Append(" ImageURL = @ImageURL , "); strSql.Append(" Content = @Content , "); strSql.Append(" ReadCount = @ReadCount , "); strSql.Append(" IsImage = @IsImage , "); strSql.Append(" IsDeleted = @IsDeleted , "); strSql.Append(" CreateTime = @CreateTime , "); strSql.Append(" CreatorID = @CreatorID , "); strSql.Append(" CreatorName = @CreatorName , "); strSql.Append(" UpdateTime = @UpdateTime , "); strSql.Append(" UpdaterID = @UpdaterID , "); strSql.Append(" UpdaterName = @UpdaterName , "); strSql.Append(" PublishOrgID = @PublishOrgID , "); strSql.Append(" PublishOrgName = @PublishOrgName "); strSql.Append(" where DonationID=@DonationID "); MySqlParameter[] parameters = { new MySqlParameter("@DonationID", model.DonationID), new MySqlParameter("@Title", model.Title), new MySqlParameter("@ImageURL", model.ImageURL), new MySqlParameter("@Content", model.Content), new MySqlParameter("@ReadCount", model.ReadCount), new MySqlParameter("@IsImage", model.IsImage), new MySqlParameter("@IsDeleted", model.IsDeleted), new MySqlParameter("@CreateTime", model.CreateTime), new MySqlParameter("@CreatorID", model.CreatorID), new MySqlParameter("@CreatorName", model.CreatorName), new MySqlParameter("@UpdateTime", model.UpdateTime), new MySqlParameter("@UpdaterID", model.UpdaterID), new MySqlParameter("@UpdaterName", model.UpdaterName), new MySqlParameter("@PublishOrgID", model.PublishOrgID), new MySqlParameter("@PublishOrgName", model.PublishOrgName) }; return(MySqlHelperUtil.ExecuteNonQuery(tranID, strSql.ToString(), parameters)); }
/// <summary> /// 增加一条数据 /// </summary> public int Add(ShiMiao.Model.TD_Shop_Order_Consignee model, string tranID) { StringBuilder strSql = new StringBuilder(); strSql.Append("insert into TD_Order_Consignee("); strSql.Append("OrderID,Name,Phone,Address,Identification"); strSql.Append(") values ("); strSql.Append("@OrderID,@Name,@Phone,@Address,@Identification"); strSql.Append(") "); MySqlParameter[] parameters = { new MySqlParameter("@OrderID", model.OrderID), new MySqlParameter("@Name", model.Name), new MySqlParameter("@Phone", model.Phone), new MySqlParameter("@Address", model.Address), new MySqlParameter("@Identification", model.Identification) }; return(MySqlHelperUtil.ExecuteNonQuery(tranID, strSql.ToString(), parameters)); }
public bool updateBillDZZTByID(string _recordid, int dzzt, string _transid = null) { StringBuilder strSql = new StringBuilder(); strSql.Append("update TD_Order_WeiXinPay_dz set "); strSql.Append(" dzzt = @dzzt "); strSql.Append(" where RecordID=@RecordID "); MySqlParameter[] parameters = { new MySqlParameter("@RecordID", _recordid), new MySqlParameter("@dzzt", dzzt) }; if (string.IsNullOrEmpty(_transid)) { return(MySqlHelperUtil.ExecuteNonQuery(strSql.ToString(), parameters) == 1); } else { return(MySqlHelperUtil.ExecuteNonQuery(_transid, strSql.ToString(), parameters) == 1); } }
public int Add(Model.TD_Donation_LeaveMsg model) { StringBuilder strSql = new StringBuilder(); strSql.Append("insert into TD_Donation_LeaveMsg("); strSql.Append("LeaveMsgID,DonationID,MemberID,NickName,HeaderImage,Message,CreateTime"); strSql.Append(") values ("); strSql.Append("@LeaveMsgID,@DonationID,@MemberID,@NickName,@HeaderImage,@Message,@CreateTime"); strSql.Append(") "); MySqlParameter[] parameters = { new MySqlParameter("@LeaveMsgID", model.LeaveMsgID), new MySqlParameter("@DonationID", model.DonationID), new MySqlParameter("@MemberID", model.MemberID), new MySqlParameter("@NickName", model.NickName), new MySqlParameter("@HeaderImage", model.HeaderImage), new MySqlParameter("@Message", model.Message), new MySqlParameter("@CreateTime", model.CreateTime) }; return(MySqlHelperUtil.ExecuteNonQuery(strSql.ToString(), parameters)); }
/// <summary> /// 更新一条数据 /// </summary> public int Update(ShiMiao.Model.TD_Donation_Order model, string tranID) { StringBuilder strSql = new StringBuilder(); strSql.Append("update TD_Donation_Order set "); strSql.Append(" OrderID = @OrderID , "); strSql.Append(" DonationID = @DonationID , "); strSql.Append(" OpenID = @OpenID , "); strSql.Append(" Name = @Name , "); strSql.Append(" Mobile = @Mobile , "); strSql.Append(" NickName = @NickName , "); strSql.Append(" HeaderImage = @HeaderImage , "); strSql.Append(" OrderTime = @OrderTime , "); strSql.Append(" Fee = @Fee , "); strSql.Append(" IsPay = @IsPay , "); strSql.Append(" PayType = @PayType , "); strSql.Append(" PayTime = @PayTime "); strSql.Append(" where OrderID=@OrderID "); MySqlParameter[] parameters = { new MySqlParameter("@OrderID", model.OrderID), new MySqlParameter("@DonationID", model.DonationID), new MySqlParameter("@OpenID", model.OpenID), new MySqlParameter("@Name", model.Name), new MySqlParameter("@Mobile", model.Mobile), new MySqlParameter("@NickName", model.NickName), new MySqlParameter("@HeaderImage", model.HeaderImage), new MySqlParameter("@OrderTime", model.OrderTime), new MySqlParameter("@Fee", model.Fee), new MySqlParameter("@IsPay", model.IsPay), new MySqlParameter("@PayType", model.PayType), new MySqlParameter("@PayTime", model.PayTime) }; return(MySqlHelperUtil.ExecuteNonQuery(tranID, strSql.ToString(), parameters)); }
public int Add(ShiMiao.Model.TD_Shop_OrderGoods model, string tranID) { StringBuilder strSql = new StringBuilder(); strSql.Append("insert into TD_Shop_OrderGoods("); strSql.Append("OrderGoodsID,OrderID,GoodsID,Title,Amount,OrgID,OriPrice,RealPrice,OrderTime"); strSql.Append(") values ("); strSql.Append("@OrderGoodsID,@OrderID,@GoodsID,@Title,@Amount,@OrgID,@OriPrice,@RealPrice,@OrderTime"); strSql.Append(") "); MySqlParameter[] parameters = { new MySqlParameter("@OrderGoodsID", model.OrderGoodsID), new MySqlParameter("@OrderID", model.OrderID), new MySqlParameter("@GoodsID", model.GoodsID), new MySqlParameter("@Title", model.Title), new MySqlParameter("@Amount", model.Amount), new MySqlParameter("@OrgID", model.OrgID), new MySqlParameter("@OriPrice", model.OriPrice), new MySqlParameter("@RealPrice", model.RealPrice), new MySqlParameter("@OrderTime", model.OrderTime) }; return(MySqlHelperUtil.ExecuteNonQuery(tranID, strSql.ToString(), parameters)); }
/// <summary> /// 更新一条数据 /// </summary> public int Update(ShiMiao.Model.TD_Order_WeiXinPay model, string tranID) { StringBuilder strSql = new StringBuilder(); strSql.Append("update TD_Order_WeiXinPay set "); strSql.Append(" OrderID = @OrderID , "); strSql.Append(" NonceStr = @NonceStr , "); strSql.Append(" Timestamp = @Timestamp , "); strSql.Append(" OrgID = @OrgID , "); strSql.Append(" WeiXinOrderID = @WeiXinOrderID , "); strSql.Append(" OrderFee = @OrderFee , "); strSql.Append(" CashFee = @CashFee , "); strSql.Append(" Package = @Package , "); strSql.Append(" Status = @Status , "); strSql.Append(" PayTime = @PayTime , "); strSql.Append(" CallBackTime = @CallBackTime "); strSql.Append(" where OrderID=@OrderID and NonceStr=@NonceStr "); MySqlParameter[] parameters = { new MySqlParameter("@OrderID", model.OrderID), new MySqlParameter("@NonceStr", model.NonceStr), new MySqlParameter("@Timestamp", model.Timestamp), new MySqlParameter("@OrgID", model.OrgID), new MySqlParameter("@WeiXinOrderID", model.WeiXinOrderID), new MySqlParameter("@OrderFee", model.OrderFee), new MySqlParameter("@CashFee", model.CashFee), new MySqlParameter("@Package", model.Package), new MySqlParameter("@Status", model.Status), new MySqlParameter("@PayTime", model.PayTime), new MySqlParameter("@CallBackTime", model.CallBackTime) }; return(MySqlHelperUtil.ExecuteNonQuery(tranID, strSql.ToString(), parameters)); }
/// <summary> /// 批量删除一批数据 /// </summary> public int SetDisabled(IList <Guid> list) { StringBuilder sql = new StringBuilder(); sql.AppendLine("CREATE TABLE #TEMP(id uniqueidentifier primary key)"); for (int i = 0; i < list.Count; i++) { sql.AppendFormat(" INSERT INTO #TEMP VALUES(@Parameter{0})", i); sql.AppendLine(); } sql.Append(" UPDATE TD_Donation_Info SET IsEnabled='0' FROM TD_Donation_Info t1 INNER JOIN #TEMP t2 ON t1.DonationID=t2.id"); sql.Append(" drop table #TEMP"); List <MySqlParameter> parameters = new List <MySqlParameter>(); for (int i = 0; i < list.Count; i++) { MySqlParameter parameter = new MySqlParameter("@Parameter" + i.ToString(), list[i]); parameters.Add(parameter); } int result = MySqlHelperUtil.ExecuteNonQuery(sql.ToString(), parameters.ToArray()); parameters.Clear(); return(result); }
public bool insertBills(List <WXBill> _BillList) { bool ret = false; string transid = MySqlHelperUtil.BeginTran(); try { foreach (WXBill _bill in _BillList) { //通过商户订单号查找记录 WXBill oldOne = selectOneBillBySHDDH(_bill); if (null != oldOne) { if (!oldOne.Equals(_bill)) {//若存在记录且数据不一直 更新 ret = updateBillByID(oldOne.RecordID, _bill, transid); if (false == ret) { break; } } else { ret = true; } } else {//不存在记录 插入 StringBuilder strSql = new StringBuilder(); strSql.Append("insert into TD_Order_WeiXinPay_dz("); strSql.Append("RecordID, TranDate, AppID, MCHID, SubMCHID, DeviceID, TransactionID, OutTradeNo, UserInfo, TranType , TranSta, PayBank , Currency , Cost , EnterpriseLuckyMoney , RefundID , OutRefundNo , RefundMoney , EnterpriseRefundLuckyMoney, RefundType , RefundSta , GoodsName , MerchantData , ExFee , Rates"); strSql.Append(") values ("); strSql.Append("@RecordID, @TranDate,@AppID, @MCHID, @SubMCHID, @DeviceID, @TransactionID, @OutTradeNo, @UserInfo, @TranType , @TranSta, @PayBank , @Currency , @Cost , @EnterpriseLuckyMoney , @RefundID , @OutRefundNo , @RefundMoney , @EnterpriseRefundLuckyMoney, @RefundType , @RefundSta , @GoodsName , @MerchantData , @ExFee , @Rates"); strSql.Append(") "); MySqlParameter[] parameters = { new MySqlParameter("@RecordID", Guid.NewGuid().ToString()), new MySqlParameter("@TranDate", _bill.TranDate), new MySqlParameter("@AppID", _bill.AppID), new MySqlParameter("@MCHID", _bill.MCHID), new MySqlParameter("@SubMCHID", _bill.SubMCHID), new MySqlParameter("@DeviceID", _bill.DeviceID), new MySqlParameter("@TransactionID", _bill.TransactionID), new MySqlParameter("@OutTradeNo", _bill.OutTradeNo), new MySqlParameter("@UserInfo", _bill.UserInfo), new MySqlParameter("@TranType", _bill.TranType), new MySqlParameter("@TranSta", _bill.TranSta), new MySqlParameter("@PayBank", _bill.PayBank), new MySqlParameter("@Currency", _bill.Currency), new MySqlParameter("@Cost", _bill.Cost), new MySqlParameter("@EnterpriseLuckyMoney", _bill.EnterpriseLuckyMoney), new MySqlParameter("@RefundID", _bill.RefundID), new MySqlParameter("@OutRefundNo", _bill.OutRefundNo), new MySqlParameter("@RefundMoney", _bill.RefundMoney), new MySqlParameter("@EnterpriseRefundLuckyMoney", _bill.EnterpriseRefundLuckyMoney), new MySqlParameter("@RefundType", _bill.RefundType), new MySqlParameter("@RefundSta", _bill.RefundSta), new MySqlParameter("@GoodsName", _bill.GoodsName), new MySqlParameter("@MerchantData", _bill.MerchantData), new MySqlParameter("@ExFee", _bill.ExFee), new MySqlParameter("@Rates", _bill.Rates) }; if (MySqlHelperUtil.ExecuteNonQuery(transid, strSql.ToString(), parameters) != 1) { MySqlHelperUtil.RollbackTran(transid); ret = false; break; } else { ret = true; } } } } catch (Exception ex) { MySqlHelperUtil.RollbackTran(transid); throw ex; } if (!ret) { MySqlHelperUtil.RollbackTran(transid); } else { MySqlHelperUtil.CommitTran(transid); } return(ret); }
public bool updateBillByID(string _recordid, WXBill _bill, string _transid = null) { StringBuilder strSql = new StringBuilder(); strSql.Append("update TD_Order_WeiXinPay_dz set "); strSql.Append(" TranDate = @TranDate , "); strSql.Append("AppID = @AppID , "); strSql.Append(" MCHID = @MCHID , "); strSql.Append("SubMCHID= @SubMCHID , "); strSql.Append(" DeviceID = @DeviceID , "); strSql.Append(" TransactionID = @TransactionID , "); strSql.Append(" OutTradeNo = @OutTradeNo , "); strSql.Append(" UserInfo = @UserInfo , "); strSql.Append(" TranType = @TranType , "); strSql.Append(" TranSta = @TranSta , "); strSql.Append(" PayBank = @PayBank , "); strSql.Append(" Currency = @Currency , "); strSql.Append(" Cost = @Cost , "); strSql.Append(" EnterpriseLuckyMoney = @EnterpriseLuckyMoney , "); strSql.Append(" RefundID = @RefundID , "); strSql.Append(" OutRefundNo = @OutRefundNo , "); strSql.Append(" RefundMoney = @RefundMoney , "); strSql.Append(" EnterpriseRefundLuckyMoney = @EnterpriseRefundLuckyMoney , "); strSql.Append(" RefundType = @RefundType , "); strSql.Append(" RefundSta = @RefundSta , "); strSql.Append(" GoodsName = @GoodsName , "); strSql.Append(" MerchantData = @MerchantData , "); strSql.Append(" ExFee = @ExFee , "); strSql.Append(" Rates = @Rates ,dzzt=0 "); strSql.Append(" where RecordID=@RecordID "); MySqlParameter[] parameters = { new MySqlParameter("@RecordID", _recordid), new MySqlParameter("@TranDate", _bill.TranDate), new MySqlParameter("@AppID", _bill.AppID), new MySqlParameter("@MCHID", _bill.MCHID), new MySqlParameter("@SubMCHID", _bill.SubMCHID), new MySqlParameter("@DeviceID", _bill.DeviceID), new MySqlParameter("@TransactionID", _bill.TransactionID), new MySqlParameter("@OutTradeNo", _bill.OutTradeNo), new MySqlParameter("@UserInfo", _bill.UserInfo), new MySqlParameter("@TranType", _bill.TranType), new MySqlParameter("@TranSta", _bill.TranSta), new MySqlParameter("@PayBank", _bill.PayBank), new MySqlParameter("@Currency", _bill.Currency), new MySqlParameter("@Cost", _bill.Cost), new MySqlParameter("@EnterpriseLuckyMoney", _bill.EnterpriseLuckyMoney), new MySqlParameter("@RefundID", _bill.RefundID), new MySqlParameter("@OutRefundNo", _bill.OutRefundNo), new MySqlParameter("@RefundMoney", _bill.RefundMoney), new MySqlParameter("@EnterpriseRefundLuckyMoney", _bill.EnterpriseRefundLuckyMoney), new MySqlParameter("@RefundType", _bill.RefundType), new MySqlParameter("@RefundSta", _bill.RefundSta), new MySqlParameter("@GoodsName", _bill.GoodsName), new MySqlParameter("@MerchantData", _bill.MerchantData), new MySqlParameter("@ExFee", _bill.ExFee), new MySqlParameter("@Rates", _bill.Rates) }; if (string.IsNullOrEmpty(_transid)) { return(MySqlHelperUtil.ExecuteNonQuery(strSql.ToString(), parameters) == 1); } else { return(MySqlHelperUtil.ExecuteNonQuery(_transid, strSql.ToString(), parameters) == 1); } }