protected void AddUserToGroup(int groupId, string userIds) { StarTech.DBUtility.AdoHelper ado = StarTech.DBUtility.AdoHelper.CreateHelper("DB_Instance"); ado.ExecuteSqlNonQuery("delete IACenter_UserInGroup where groupId=" + groupId + ""); if (userIds == "") { return; } string[] userIdsArr = userIds.Split(','); foreach (string id in userIdsArr) { ado.ExecuteSqlNonQuery("insert into IACenter_UserInGroup(userId,groupId) values(" + id + "," + groupId + ")"); } }
public static void PayLogWrite(string paylogId, string memberId, string orderId, string payStatu, string payType, decimal paymoney, DateTime payTime, string payContext, string remark, DateTime payOutTime) { StringBuilder strSql = new StringBuilder(); strSql.Append("insert into T_Order_PayLog("); strSql.Append("paylogId,memberId,orderId,payStatu,payType,paymoney,payTime,payContext,remark,payOutTime)"); strSql.Append(" values ("); strSql.Append("@paylogId,@memberId,@orderId,@payStatu,@payType,@paymoney,@payTime,@payContext,@remark,@payOutTime)"); SqlParameter[] parameters = { new SqlParameter("@paylogId", SqlDbType.VarChar, 50), new SqlParameter("@memberId", SqlDbType.VarChar, 50), new SqlParameter("@orderId", SqlDbType.VarChar, 50), new SqlParameter("@payStatu", SqlDbType.VarChar, 50), new SqlParameter("@payType", SqlDbType.VarChar, 50), new SqlParameter("@paymoney", SqlDbType.Decimal, 9), new SqlParameter("@payTime", SqlDbType.DateTime), new SqlParameter("@payContext", SqlDbType.VarChar, 500), new SqlParameter("@remark", SqlDbType.VarChar, 1000), new SqlParameter("@payOutTime", SqlDbType.DateTime) }; parameters[0].Value = paylogId; parameters[1].Value = memberId; parameters[2].Value = orderId; parameters[3].Value = payStatu; parameters[4].Value = payType; parameters[5].Value = paymoney; parameters[6].Value = payTime; parameters[7].Value = payContext; parameters[8].Value = remark; parameters[9].Value = payOutTime; StarTech.DBUtility.AdoHelper adoHelper = StarTech.DBUtility.AdoHelper.CreateHelper("DB_Instance"); adoHelper.ExecuteSqlNonQuery(strSql.ToString(), parameters); }
protected void btnSave_Click(object sender, ImageClickEventArgs e) { if (this.txtTitle.Value == "") { ClientScript.RegisterStartupScript(this.GetType(), "close", "<script>alert('请输入用户组名称');</script>"); return; } StarTech.DBUtility.AdoHelper ado = StarTech.DBUtility.AdoHelper.CreateHelper("DB_Instance"); if (this.id == "") { string sql = "insert into IACenter_Group(groupName) values('" + this.txtTitle.Value.Trim() + "');select @@IDENTITY"; object obj = ado.ExecuteSqlScalar(sql); if (obj != null) { int groupId = Int32.Parse(obj.ToString()); AddUserToGroup(groupId, this.SelectPanel1.Value); ClientScript.RegisterStartupScript(this.GetType(), "close", "<script>alert('添加成功');layer_close_refresh();</script>"); } } else { string sql = "update IACenter_Group set groupName='" + this.txtTitle.Value.Trim() + "' where uniqueId=" + this.id + ""; if (ado.ExecuteSqlNonQuery(sql) > 0) { AddUserToGroup(Int32.Parse(this.id), this.SelectPanel1.Value); ClientScript.RegisterStartupScript(this.GetType(), "close", "<script>alert('修改成功');layer_close_refresh();</script>"); } } }
protected void Page_Load(object sender, EventArgs e) { SortedDictionary <string, string> sPara = GetRequestPost(); if (sPara.Count > 0)//判断是否有带返回参数 { Notify aliNotify = new Notify(); bool verifyResult = aliNotify.Verify(sPara, Request.Form["notify_id"], Request.Form["sign"]); if (verifyResult)//验证成功 { ///////////////////////////////////////////////////////////////////////////////////////////////////////////// //请在这里加上商户的业务逻辑程序代码 //——请根据您的业务逻辑来编写程序(以下代码仅作参考)—— //获取支付宝的通知返回参数,可参考技术文档中服务器异步通知参数列表 //商户订单号 string out_trade_no = Request.Form["out_trade_no"]; //支付宝交易号 string trade_no = Request.Form["trade_no"]; //交易状态 string trade_status = Request.Form["trade_status"]; string remarks = "【支付宝服务器异步通知】[return_url.aspx]支付宝返回值(out_trade_no=" + Request.Form["out_trade_no"] + ",trade_no=" + Request.Form["trade_no"] + ",trade_status=" + Request.Form["trade_status"] + ")"; StarTech.DBUtility.AdoHelper adoHelper = StarTech.DBUtility.AdoHelper.CreateHelper("DB_Instance"); if (Request.Form["trade_status"] == "TRADE_FINISHED") { //判断该笔订单是否在商户网站中已经做过处理 //如果没有做过处理,根据订单号(out_trade_no)在商户网站的订单系统中查到该笔订单的详细,并执行商户的业务程序 //请务必判断请求时的total_fee、seller_id与通知时获取的total_fee、seller_id为一致的 //如果有做过处理,不执行商户的业务程序 //注意: //退款日期超过可退款期限后(如三个月可退款),支付宝系统发送该交易状态通知 object objMoney = adoHelper.ExecuteSqlScalar(" select top 1 paymoney from T_Order_PayLog where payStatu='paysend' and orderId='" + out_trade_no + "' order by payTime desc"); if (objMoney != null) { adoHelper.ExecuteSqlNonQuery("update T_Order_Info set isPay=1 , payTime=getdate() where isPay=0 and orderId='" + out_trade_no + "'"); PayLog.PayLogWrite(Guid.NewGuid().ToString(), "0", out_trade_no, "pay", "zfb", decimal.Parse(objMoney.ToString()), DateTime.Now, trade_no, remarks, DateTime.Now); } } else if (Request.Form["trade_status"] == "TRADE_SUCCESS") { //判断该笔订单是否在商户网站中已经做过处理 //如果没有做过处理,根据订单号(out_trade_no)在商户网站的订单系统中查到该笔订单的详细,并执行商户的业务程序 //请务必判断请求时的total_fee、seller_id与通知时获取的total_fee、seller_id为一致的 //如果有做过处理,不执行商户的业务程序 //注意: //付款完成后,支付宝系统发送该交易状态通知 object objMoney = adoHelper.ExecuteSqlScalar(" select top 1 paymoney from T_Order_PayLog where payStatu='paysend' and orderId='" + out_trade_no + "' order by payTime desc"); if (objMoney != null) { adoHelper.ExecuteSqlNonQuery("update T_Order_Info set isPay=1 , payTime=getdate() where isPay=0 and orderId='" + out_trade_no + "'"); adoHelper.ExecuteSqlNonQuery("update T_Goods_Info set JobStatus='进行中' where goodsId=(select goodsId from T_Order_InfoDetail where orderId='" + out_trade_no + "')"); PayLog.PayLogWrite(Guid.NewGuid().ToString(), "0", out_trade_no, "pay", "zfb", decimal.Parse(objMoney.ToString()), DateTime.Now, trade_no, remarks, DateTime.Now); } } else { PayLog.PayLogWrite(Guid.NewGuid().ToString(), "0", out_trade_no, "other", "zfb", 0, DateTime.Now, trade_no, remarks, DateTime.Now); } //——请根据您的业务逻辑来编写程序(以上代码仅作参考)—— Response.Write("success"); //请不要修改或删除 ///////////////////////////////////////////////////////////////////////////////////////////////////////////// } else//验证失败 { Response.Write("fail"); } } else { Response.Write("无通知参数"); } }
protected void btnCheck_Click(object sender, EventArgs e) { adoHelper.ExecuteSqlNonQuery("update T_Member_Pic set ifPass=1 where applyType='auth' and memberId='" + memberId + "'"); GetMember(memberId); AddLogMsg(memberId, "实名审核", "你的实名审核已经通过"); }