/// <summary> /// 删除对象 /// </summary> /// <param name="ids">1,2,3,4</param> /// <returns></returns> public bool DeleteSiteEmail(string ids, SqlTranEx.SqlTranExtensions _SqlTranExtensions) { bool result = false; string[] _ids = ids.Split(','); try { bool isDo = false; if (_SqlTranExtensions == null) { _SqlTranExtensions = new SqlTranEx.SqlTranExtensions(); isDo = true; } for (int i = 0; i < _ids.Length; i++) { DealMvc.Orm.EntityCore <Model.SiteEmail> .Delete(_ids[i].ToInt32(), _SqlTranExtensions); } if (isDo) { _SqlTranExtensions.ExecuteSqlTran(); } result = true; } catch (Exception ce) { ExceptionEx.MyExceptionLog.AddLogError(ce.Message); result = false; } return(result); }
//[Role("恢复帐号权限", Description = "恢复帐号权限", IsAuthorize = true)] public ContentResult ReQX(string ids) { string output = "0"; try { SqlTranEx.SqlTranExtensions _SqlTranExtensions = new SqlTranEx.SqlTranExtensions(); if (IsPost) { string[] _ids = ids.Split(','); for (int i = 0; i < _ids.Length; i++) { int id = _ids[i].ToInt32(); Model.Admin m_Admin = Orm.EntityCore <Model.Admin> .GetModel(id); if (m_Admin.IsNull) { output = "0"; break; } m_Admin.AdminPowerValues = m_Admin.AdminSort.AdminSortPowerValues; Orm.EntityCore <Model.Admin> .Update(m_Admin, _SqlTranExtensions); } } _SqlTranExtensions.ExecuteSqlTran(); output = "1"; } catch { } return(Content(output)); }
public ContentResult DeleteAdminSort(string ids) { string result = ""; string[] _ids = ids.Split(','); try { DealMvc.SqlTranEx.SqlTranExtensions _SqlTranExtensions = new SqlTranEx.SqlTranExtensions(); for (int i = 0; i < _ids.Length; i++) { DealMvc.Orm.EntityCore <Model.AdminSort> .Delete(int.Parse(_ids[i].ToString()), _SqlTranExtensions); } _SqlTranExtensions.ExecuteSqlTran(); result = "true"; } catch (Exception ce) { ExceptionEx.MyExceptionLog.WriteLog(this, ce); result = "false"; } return(Content(result)); }
/// <summary> /// 即刻回调函数 /// </summary> /// <returns></returns> public ActionResult CBPayMen_Return() { bool isSuccess = false; // MD5密钥要跟订单提交页相同,如Send.asp里的 key = "test" ,修改""号内 test 为您的密钥 string key = "klfd235d6s8922fd2s3afsa"; // 如果您还没有设置MD5密钥请登陆我们为您提供商户后台,地址:https://merchant3.chinabank.com.cn/ // 登陆后在上面的导航栏里可能找到“资料管理”,在资料管理的二级导航栏里有“MD5密钥设置” // 建议您设置一个16位以上的密钥或更高,密钥最多64位,但设置16位已经足够了 v_oid = Request["v_oid"]; v_pstatus = Request["v_pstatus"]; v_pstring = Request["v_pstring"]; v_pmode = Request["v_pmode"]; v_md5str = Request["v_md5str"]; v_amount = Request["v_amount"]; v_moneytype = Request["v_moneytype"]; remark1 = Request["remark1"]; remark2 = Request["remark2"]; string str = v_oid + v_pstatus + v_amount + v_moneytype + key; str = System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(str, "md5").ToUpper(); if (str == v_md5str) { if (v_pstatus.Equals("20")) { #region 支付成功 try { string[] OrderListUID = v_oid.Split(new string[] { "," }, StringSplitOptions.RemoveEmptyEntries); SqlTranEx.SqlTranExtensions _STE = new SqlTranEx.SqlTranExtensions(); lock (this) { //for (int i = 0; i < OrderListUID.Length; i++) //{ // Orders m_now_orders = Orders.GetModel(t => t.O_UID == OrderListUID[i].ToString2()); // if (!m_now_orders.IsNull && m_now_orders.O_IsPay == false) // { // #region 更改订单信息 // m_now_orders.O_IsPay = true; // m_now_orders.O_Status = CommonEnumHelper.OrderStatus.已付款.ToString2(); // m_now_orders.O_PayTime = DateTime.Now; // m_now_orders.Update(_STE); // #endregion // #region 增加会员账户消费记录信息 // MemberAccountLog m_mal = new MemberAccountLog(); //表名:MemberAccountLog 备注:会员账户消费记录 // m_mal.M_UID = m_now_orders.Member_UID; //M_UID[Type=string] - 会员唯一编号 // m_mal.MA_UID = Common.Globals.CreateNewUniqueID(); // m_mal.M_Cate = CommonEnumHelper.AccountCate.现金.ToString2(); //M_Cate[Type=string] - 分类(积分/现金) // m_mal.M_PayCate = CommonEnumHelper.AccountLogCate.支出.ToString2(); //M_PayCate[Type=string] - 收入/支出类型 // m_mal.M_ObjectMoney = m_now_orders.O_PayMoney; //M_ObjectMoney[Type=double?] - 操作金额 // //m_mal.M_BalanceMoney = m_member_account.M_AvailableBalance; //M_BalanceMoney[Type=double?] - 账户余额 // m_mal.M_Remark = "支付订单(订单编号:" + m_now_orders.O_UID + ")"; //M_Remark[Type=string] - 备注 // m_mal.M_Status = ""; //M_Status[Type=string] - 当前状态 // m_mal.M_Time = DateTime.Now; //M_Time[Type=DateTime?] - 时间 // m_mal.Add(_STE); // #endregion // isSuccess = _STE.ExecuteSqlTran(); // } //} } } catch { return(Content("err-003失败:该流水号不存在")); } #endregion if (isSuccess) { return(RedirectToAction("OrderPaySuccess", "Order")); } else { return(RedirectToAction("OrderPayFailure", "Order", new { msg = "订单支付失败,请重新核对订单信息及支付信息后重新支付" })); } } } else { return(Content("校验失败,数据可疑")); } return(Content("error")); }
/// <summary> /// 即刻回调函数 /// </summary> /// <returns></returns> public ActionResult CBPayMen_Return() { bool isSuccess = false; string AcitonCate = string.Empty; // MD5密钥要跟订单提交页相同,如Send.asp里的 key = "test" ,修改""号内 test 为您的密钥 string key = "klfd235d6s8922fd2s3afsa"; // 如果您还没有设置MD5密钥请登陆我们为您提供商户后台,地址:https://merchant3.chinabank.com.cn/ // 登陆后在上面的导航栏里可能找到“资料管理”,在资料管理的二级导航栏里有“MD5密钥设置” // 建议您设置一个16位以上的密钥或更高,密钥最多64位,但设置16位已经足够了 v_oid = Request["v_oid"]; v_pstatus = Request["v_pstatus"]; v_pstring = Request["v_pstring"]; v_pmode = Request["v_pmode"]; v_md5str = Request["v_md5str"]; v_amount = Request["v_amount"]; v_moneytype = Request["v_moneytype"]; remark1 = Request["remark1"]; remark2 = Request["remark2"]; string str = v_oid + v_pstatus + v_amount + v_moneytype + key; str = System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(str, "md5").ToUpper(); if (str == v_md5str) { if (v_pstatus.Equals("20")) { //支付成功 //在这里商户可以写上自己的业务逻辑 //################################################# try { SqlTranEx.SqlTranExtensions _STE = new SqlTranEx.SqlTranExtensions(); #region 付款成功之后的操作 switch (remark2) { } #endregion isSuccess = _STE.ExecuteSqlTran(); } catch { return(Content("Error")); } if (isSuccess) { if (AcitonCate == "充值") { return(RedirectToAction("MemberAccountInfo", "MSComm")); } else if (AcitonCate == "活动付款") { return(RedirectToAction("SignUpSuccess", "Home")); } else if (AcitonCate == "会员卡") { return(RedirectToAction("MemberCardLog", "MSComm")); } return(RedirectToAction("MemberAccountInfo", "MSComm")); } else { if (AcitonCate == "充值") { return(RedirectToAction("MemberAccountInfo", "MSComm")); } else if (AcitonCate == "活动付款") { return(RedirectToAction("SignUpFailed", "Home", new { msg = "支付失败,请重新核对支付信息后重新支付" })); } else if (AcitonCate == "会员卡") { return(RedirectToAction("MemberCardLog", "MSComm")); } return(RedirectToAction("SignUpFailed", "Home", new { msg = "支付失败,请重新核对支付信息后重新支付" })); } } } else { return(RedirectToAction("Order_Status3", "Order", new { msg = "校验失败,数据可疑" })); } return(RedirectToAction("Order_Status3", "Order", new { msg = "error" })); }
/// <summary> /// 定时回调函数 /// </summary> /// <returns></returns> public ActionResult Alipay_Notify() { bool isSuccess = false; string o = ""; try { SortedDictionary <string, string> sArrary = GetRequestGet(); ///////////////////////以下参数是需要设置的相关配置参数,设置后不会更改的////////////////////// AlipayConfig con = new AlipayConfig(); string partner = con.Partner; string key = con.Key; string input_charset = con.Input_charset; string sign_type = con.Sign_type; string transport = con.Transport; 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"]; if (Request.Form["trade_status"] == "TRADE_FINISHED" || Request.Form["trade_status"] == "TRADE_SUCCESS") { string[] OrderListUID = trade_no.Split(new string[] { "," }, StringSplitOptions.RemoveEmptyEntries); SqlTranEx.SqlTranExtensions _STE = new SqlTranEx.SqlTranExtensions(); lock (this) { //for (int i = 0; i < OrderListUID.Length; i++) //{ // Orders m_now_orders = Orders.GetModel(t => t.O_UID == OrderListUID[i].ToString2()); // if (!m_now_orders.IsNull && m_now_orders.O_IsPay == false) // { // #region 更改订单信息 // m_now_orders.O_IsPay = true; // m_now_orders.O_Status = CommonEnumHelper.OrderStatus.已付款.ToString2(); // m_now_orders.O_PayTime = DateTime.Now; // m_now_orders.Update(_STE); // #endregion // #region 增加会员账户消费记录信息 // MemberAccountLog m_mal = new MemberAccountLog(); //表名:MemberAccountLog 备注:会员账户消费记录 // m_mal.M_UID = m_now_orders.Member_UID; //M_UID[Type=string] - 会员唯一编号 // m_mal.MA_UID = Common.Globals.CreateNewUniqueID(); // m_mal.M_Cate = CommonEnumHelper.AccountCate.现金.ToString2(); //M_Cate[Type=string] - 分类(积分/现金) // m_mal.M_PayCate = CommonEnumHelper.AccountLogCate.支出.ToString2(); //M_PayCate[Type=string] - 收入/支出类型 // m_mal.M_ObjectMoney = m_now_orders.O_PayMoney; //M_ObjectMoney[Type=double?] - 操作金额 // //m_mal.M_BalanceMoney = m_member_account.M_AvailableBalance; //M_BalanceMoney[Type=double?] - 账户余额 // m_mal.M_Remark = "支付订单(订单编号:" + m_now_orders.O_UID + ")"; //M_Remark[Type=string] - 备注 // m_mal.M_Status = ""; //M_Status[Type=string] - 当前状态 // m_mal.M_Time = DateTime.Now; //M_Time[Type=DateTime?] - 时间 // m_mal.Add(_STE); // #endregion // isSuccess = _STE.ExecuteSqlTran(); // } //} } } else { } Response.Write("success"); //请不要修改或删除 ///////////////////////////////////////////////////////////////////////////////////////////////////////////// } else//验证失败 { Response.Write("fail"); } } else { Response.Write("无通知参数"); } } catch (Exception ex) { } if (isSuccess) { return(RedirectToAction("OrderPaySuccess", "Order")); } else { return(RedirectToAction("OrderPayFailure", "Order", new { msg = "订单支付失败,请重新核对订单信息及支付信息后重新支付" })); } }
/// <summary> /// 定时回调函数 /// </summary> /// <returns></returns> public ActionResult Alipay_Notify() { SortedDictionary <string, string> sArrary = GetRequestPost(); ///////////////////////以下参数是需要设置的相关配置参数,设置后不会更改的////////////////////// AlipayConfig con = new AlipayConfig(); string partner = con.Partner; string key = con.Key; string input_charset = con.Input_charset; string sign_type = con.Sign_type; string transport = con.Transport; ////////////////////////////////////////////////////////////////////////////////////////////// if (sArrary.Count > 0)//判断是否有带返回参数 { AlipayNotify aliNotify = new AlipayNotify(sArrary, Request.Form["notify_id"], partner, key, input_charset, sign_type, transport); string responseTxt = aliNotify.ResponseTxt; //获取远程服务器ATN结果,验证是否是支付宝服务器发来的请求 string sign = Request.Form["sign"]; //获取支付宝反馈回来的sign结果 string mysign = aliNotify.Mysign; //获取通知返回后计算后(验证)的签名结果 //写日志记录(若要调试,请取消下面两行注释) //string sWord = "responseTxt=" + responseTxt + "\n notify_url_log:sign=" + Request.Form["sign"] + "&mysign=" + mysign + "\n notify回来的参数:" + aliNotify.PreSignStr; //AlipayFunction.log_result(Server.MapPath("log/" + DateTime.Now.ToString().Replace(":", "")) + ".txt", sWord); //判断responsetTxt是否为ture,生成的签名结果mysign与获得的签名结果sign是否一致 //responsetTxt的结果不是true,与服务器设置问题、合作身份者ID、notify_id一分钟失效有关 //mysign与sign不等,与安全校验码、请求时的参数格式(如:带自定义参数等)、编码格式有关 if (responseTxt == "true" && sign == mysign)//验证成功 { ///////////////////////////////////////////////////////////////////////////////////////////////////////////// //请在这里加上商户的业务逻辑程序代码 string trade_no = Request.Form["trade_no"]; //支付宝交易号 string order_no = Request.Form["out_trade_no"]; //订单号 string total_fee = Request.Form["total_fee"]; //金额 string strTradeStatus = Request.Form["trade_status"]; //订单状态 //} if (Request.QueryString["trade_status"] == "TRADE_FINISHED" || Request.QueryString["trade_status"] == "TRADE_SUCCESS") { //################################################# try { string[] OrderListUID = order_no.Split(new string[] { "," }, StringSplitOptions.RemoveEmptyEntries); SqlTranEx.SqlTranExtensions _STE = new SqlTranEx.SqlTranExtensions(); lock (this) { //for (int i = 0; i < OrderListUID.Length; i++) //{ // Orders m_now_orders = Orders.GetModel(t => t.O_UID == OrderListUID[i].ToString2()); // if (!m_now_orders.IsNull && m_now_orders.O_IsPay == false) // { // #region 更改订单信息 // m_now_orders.O_IsPay = true; // m_now_orders.O_Status = CommonEnumHelper.OrderStatus.已付款.ToString2(); // m_now_orders.O_PayTime = DateTime.Now; // m_now_orders.Update(_STE); // #endregion // #region 增加会员账户消费记录信息 // MemberAccountLog m_mal = new MemberAccountLog(); //表名:MemberAccountLog 备注:会员账户消费记录 // m_mal.M_UID = m_now_orders.Member_UID; //M_UID[Type=string] - 会员唯一编号 // m_mal.MA_UID = Common.Globals.CreateNewUniqueID(); // m_mal.M_Cate = CommonEnumHelper.AccountCate.现金.ToString2(); //M_Cate[Type=string] - 分类(积分/现金) // m_mal.M_PayCate = CommonEnumHelper.AccountLogCate.支出.ToString2(); //M_PayCate[Type=string] - 收入/支出类型 // m_mal.M_ObjectMoney = m_now_orders.O_PayMoney; //M_ObjectMoney[Type=double?] - 操作金额 // //m_mal.M_BalanceMoney = m_member_account.M_AvailableBalance; //M_BalanceMoney[Type=double?] - 账户余额 // m_mal.M_Remark = "支付订单(订单编号:" + m_now_orders.O_UID + ")"; //M_Remark[Type=string] - 备注 // m_mal.M_Status = ""; //M_Status[Type=string] - 当前状态 // m_mal.M_Time = DateTime.Now; //M_Time[Type=DateTime?] - 时间 // m_mal.Add(_STE); // #endregion // _STE.ExecuteSqlTran(); // } //} } } catch { return(Content("Error")); } //################################################# } else { Response.Write("trade_status=" + Request.QueryString["trade_status"]); } return(Content("success")); } else {//验证失败 return(Content("fail")); } } else { return(Content("无通知参数")); } }
/// <summary> /// 定时回调函数 /// </summary> /// <returns></returns> public ActionResult Alipay_Notify() { SortedDictionary <string, string> sArrary = GetRequestPost(); ///////////////////////以下参数是需要设置的相关配置参数,设置后不会更改的////////////////////// AlipayConfig con = new AlipayConfig(); string partner = con.Partner; string key = con.Key; string input_charset = con.Input_charset; string sign_type = con.Sign_type; string transport = con.Transport; ////////////////////////////////////////////////////////////////////////////////////////////// if (sArrary.Count > 0)//判断是否有带返回参数 { AlipayNotify aliNotify = new AlipayNotify(sArrary, Request.Form["notify_id"], partner, key, input_charset, sign_type, transport); string responseTxt = aliNotify.ResponseTxt; //获取远程服务器ATN结果,验证是否是支付宝服务器发来的请求 string sign = Request.Form["sign"]; //获取支付宝反馈回来的sign结果 string mysign = aliNotify.Mysign; //获取通知返回后计算后(验证)的签名结果 //写日志记录(若要调试,请取消下面两行注释) //string sWord = "responseTxt=" + responseTxt + "\n notify_url_log:sign=" + Request.Form["sign"] + "&mysign=" + mysign + "\n notify回来的参数:" + aliNotify.PreSignStr; //AlipayFunction.log_result(Server.MapPath("log/" + DateTime.Now.ToString().Replace(":", "")) + ".txt", sWord); //判断responsetTxt是否为ture,生成的签名结果mysign与获得的签名结果sign是否一致 //responsetTxt的结果不是true,与服务器设置问题、合作身份者ID、notify_id一分钟失效有关 //mysign与sign不等,与安全校验码、请求时的参数格式(如:带自定义参数等)、编码格式有关 if (responseTxt == "true" && sign == mysign)//验证成功 { ///////////////////////////////////////////////////////////////////////////////////////////////////////////// //请在这里加上商户的业务逻辑程序代码 string trade_no = Request.QueryString["trade_no"]; //支付宝交易号 string order_no = Request.QueryString["out_trade_no"]; //订单号 string total_fee = Request.QueryString["total_fee"]; //金额 string strTradeStatus = Request.QueryString["trade_status"]; //订单状态 string body = Request.QueryString["body"]; //商品描述、订单备注、描述 //} if (Request.QueryString["trade_status"] == "TRADE_FINISHED" || Request.QueryString["trade_status"] == "TRADE_SUCCESS") { //################################################# try { SqlTranEx.SqlTranExtensions _STE = new SqlTranEx.SqlTranExtensions(); #region 付款成功之后的操作 switch (body) { } #endregion _STE.ExecuteSqlTran(); } catch { return(Content("Error")); } //################################################# } else { Response.Write("trade_status=" + Request.QueryString["trade_status"]); } return(Content("success")); } else {//验证失败 return(Content("fail")); } } else { return(Content("无通知参数")); } }
/// <summary> /// 即刻回调函数 /// </summary> /// <returns></returns> public ActionResult Alipay_Return() { bool isSuccess = false; string AcitonCate = string.Empty; try { SortedDictionary <string, string> sArrary = GetRequestGet(); ///////////////////////以下参数是需要设置的相关配置参数,设置后不会更改的////////////////////// AlipayConfig con = new AlipayConfig(); string partner = con.Partner; string key = con.Key; string input_charset = con.Input_charset; string sign_type = con.Sign_type; string transport = con.Transport; ////////////////////////////////////////////////////////////////////////////////////////////// if (sArrary.Count > 0)//判断是否有带返回参数 { AlipayNotify aliNotify = new AlipayNotify(sArrary, Request.QueryString["notify_id"], partner, key, input_charset, sign_type, transport); string responseTxt = aliNotify.ResponseTxt; //获取远程服务器ATN结果,验证是否是支付宝服务器发来的请求 string sign = Request.QueryString["sign"]; //获取支付宝反馈回来的sign结果 string mysign = aliNotify.Mysign; //获取通知返回后计算后(验证)的签名结果 //写日志记录(若要调试,请取消下面两行注释) //string sWord = "responseTxt=" + responseTxt + "\n return_url_log:sign=" + Request.QueryString["sign"] + "&mysign=" + mysign + "\n return回来的参数:" + aliNotify.PreSignStr; //AlipayFunction.log_result(Server.MapPath("log/" + DateTime.Now.ToString().Replace(":", "")) + ".txt",sWord); //判断responsetTxt是否为ture,生成的签名结果mysign与获得的签名结果sign是否一致 //responsetTxt的结果不是true,与服务器设置问题、合作身份者ID、notify_id一分钟失效有关 //mysign与sign不等,与安全校验码、请求时的参数格式(如:带自定义参数等)、编码格式有关 if (responseTxt == "true" && sign == mysign)//验证成功 { ///////////////////////////////////////////////////////////////////////////////////////////////////////////// //——请根据您的业务逻辑来编写程序(以下代码仅作参考)—— //获取支付宝的通知返回参数,可参考技术文档中页面跳转同步通知参数列表 string trade_no = Request.QueryString["trade_no"]; //支付宝交易号 string order_no = Request.QueryString["out_trade_no"]; //获取订单号 string total_fee = Request.QueryString["total_fee"]; //获取总金额 string subject = Request.QueryString["subject"]; //商品名称、订单名称 string body = Request.QueryString["body"]; //商品描述、订单备注、描述 string buyer_email = Request.QueryString["buyer_email"]; //买家支付宝账号 string trade_status = Request.QueryString["trade_status"]; //交易状态 string extra_common_param = Request.QueryString["trade_status"]; //会员唯一编号 ////打印页面 if (Request.QueryString["trade_status"] == "TRADE_FINISHED" || Request.QueryString["trade_status"] == "TRADE_SUCCESS") { //################################################# try { SqlTranEx.SqlTranExtensions _STE = new SqlTranEx.SqlTranExtensions(); #region 付款成功之后的操作 switch (body) { } #endregion isSuccess = _STE.ExecuteSqlTran(); //return Content("失败:该流水号不存在"); } catch { return(Content("Error")); } //################################################# } else { Response.Write("trade_status=" + Request.QueryString["trade_status"]); } ////——请根据您的业务逻辑来编写程序(以上代码仅作参考)—— } else { //验证失败 } } else { return(Content("无返回参数")); } } catch (Exception ex) { } if (isSuccess) { if (AcitonCate == "充值") { return(RedirectToAction("MemberAccountInfo", "MSComm")); } else if (AcitonCate == "活动付款") { return(RedirectToAction("SignUpSuccess", "Home")); } else if (AcitonCate == "会员卡") { return(RedirectToAction("MemberCardLog", "MSComm")); } return(RedirectToAction("MemberAccountInfo", "MSComm")); } else { if (AcitonCate == "充值") { return(RedirectToAction("MemberAccountInfo", "MSComm")); } else if (AcitonCate == "活动付款") { return(RedirectToAction("SignUpFailed", "Home", new { msg = "支付失败,请重新核对支付信息后重新支付" })); } else if (AcitonCate == "会员卡") { return(RedirectToAction("MemberCardLog", "MSComm")); } return(RedirectToAction("SignUpFailed", "Home", new { msg = "支付失败,请重新核对支付信息后重新支付" })); } }
/// <summary> /// Delete /// </summary> /// <param name="_SqlTranExtensions">事物对象</param> public void Delete(SqlTranEx.SqlTranExtensions _SqlTranExtensions) { Delete(((T)this).id, _SqlTranExtensions); }
/// <summary> /// Delete /// </summary> /// <param name="primaryKeyValue">主键</param> /// <param name="_SqlTranExtensions">事物对象</param> public static void Delete(int?primaryKeyValue, SqlTranEx.SqlTranExtensions _SqlTranExtensions) { Orm.EntityCore <T> .Delete(primaryKeyValue, _SqlTranExtensions); }
/// <summary> /// Add /// </summary> /// <param name="_SqlTranExtensions">事物对象</param> /// <returns></returns> public int Add(SqlTranEx.SqlTranExtensions _SqlTranExtensions) { return(Add(this as T, _SqlTranExtensions)); }
/// <summary> /// Add /// </summary> /// <param name="model">当前实例</param> /// <param name="_SqlTranExtensions">事物对象</param> /// <returns></returns> public static int Add(T model, SqlTranEx.SqlTranExtensions _SqlTranExtensions) { return(Orm.EntityCore <T> .Add(model, _SqlTranExtensions)); }
/// <summary> /// 回调方法 /// </summary> /// <returns></returns> public ActionResult Tenpay_Return() { bool isSuccess = false; string AcitonCate = string.Empty; try { /* * attach=&bargainor_id=1208389301&cmdno=1&date=20120111&fee_type=1&pay_info=OK&pay_result=0&pay_time=1326291710&sign=0925C26EA436BAC80010E7F3F6C9FAE3&sp_billno=2220091839&total_fee=1&transaction_id=1208389301201201112220091839&ver=1 */ PayResponseHandler resHandler = new PayResponseHandler(System.Web.HttpContext.Current); SitePayAPI m_entity = SitePayAPI.GetModel(t => t.ApiType == "财付通"); resHandler.setKey(m_entity.AppKey); //判断签名 if (resHandler.isTenpaySign()) { string orderid = resHandler.getParameter("attach"); string cate = resHandler.getParameter("desc"); string total_fee = resHandler.getParameter("total_fee"); SqlTranEx.SqlTranExtensions _STE = new SqlTranEx.SqlTranExtensions(); #region 付款成功之后的操作 switch (cate) { } #endregion isSuccess = _STE.ExecuteSqlTran(); } } catch (Exception ex) { return(Content("error-4" + ex.Message.ToString())); } if (isSuccess) { if (AcitonCate == "充值") { return(RedirectToAction("MemberAccountInfo", "MSComm")); } else if (AcitonCate == "活动付款") { return(RedirectToAction("SignUpSuccess", "Home")); } else if (AcitonCate == "会员卡") { return(RedirectToAction("MemberCardLog", "MSComm")); } return(RedirectToAction("MemberAccountInfo", "MSComm")); } else { if (AcitonCate == "充值") { return(RedirectToAction("MemberAccountInfo", "MSComm")); } else if (AcitonCate == "活动付款") { return(RedirectToAction("SignUpFailed", "Home", new { msg = "支付失败,请重新核对支付信息后重新支付" })); } else if (AcitonCate == "会员卡") { return(RedirectToAction("MemberCardLog", "MSComm")); } return(RedirectToAction("SignUpFailed", "Home", new { msg = "支付失败,请重新核对支付信息后重新支付" })); } }
/// <summary> /// 回调地址 /// </summary> /// <returns></returns> public ActionResult Tenpay_Return() { bool isSuccess = false; try { /* * attach=&bargainor_id=1208389301&cmdno=1&date=20120111&fee_type=1&pay_info=OK&pay_result=0&pay_time=1326291710&sign=0925C26EA436BAC80010E7F3F6C9FAE3&sp_billno=2220091839&total_fee=1&transaction_id=1208389301201201112220091839&ver=1 */ PayResponseHandler resHandler = new PayResponseHandler(System.Web.HttpContext.Current); SitePayAPI m_entity = SitePayAPI.GetModel(t => t.ApiType == "财付通"); resHandler.setKey(m_entity.AppKey); //判断签名 if (resHandler.isTenpaySign()) { //交易单号---时间:2012-03-29 21:11 已更新 //string transaction_id = resHandler.getParameter("transaction_id"); // reqHandler.setParameter("attach", orderid); //订单ID string orderid = resHandler.getParameter("attach"); //金额金额,以分为单位 string total_fee = resHandler.getParameter("total_fee"); //支付结果 string pay_result = resHandler.getParameter("pay_result"); if (string.IsNullOrEmpty(orderid)) { return(Content("error-7")); } if (!"0".Equals(pay_result)) { return(Content("error-8")); } lock (this) { string[] OrderListUID = orderid.Split(new string[] { "," }, StringSplitOptions.RemoveEmptyEntries); SqlTranEx.SqlTranExtensions _STE = new SqlTranEx.SqlTranExtensions(); //for (int i = 0; i < OrderListUID.Length; i++) //{ // Orders m_now_orders = Orders.GetModel(t => t.O_UID == OrderListUID[i].ToString2()); // if (!m_now_orders.IsNull && m_now_orders.O_IsPay == false) // { // #region 更改订单信息 // m_now_orders.O_IsPay = true; // m_now_orders.O_Status = CommonEnumHelper.OrderStatus.已付款.ToString2(); // m_now_orders.O_PayTime = DateTime.Now; // m_now_orders.Update(_STE); // #endregion // #region 更改商家帐户信息 // MemberAccount m_store_account = MemberAccount.GetModel(t => t.M_UID == m_now_orders.Store_UID); // if (m_store_account.IsNull) // return Content("Error"); // else // { // m_store_account.M_LockBalance += m_now_orders.O_StoreGetMoney; // m_store_account.Update(_STE); // } // #endregion // #region 更改会员经验值 // MemberAccount m_member_account = MemberAccount.GetModel(t => t.M_UID == m_now_orders.Member_UID); // #endregion // #region 增加会员账户消费记录信息 // MemberAccountLog m_mal = new MemberAccountLog(); //表名:MemberAccountLog 备注:会员账户消费记录 // m_mal.M_UID = m_now_orders.Member_UID; //M_UID[Type=string] - 会员唯一编号 // m_mal.MA_UID = Common.Globals.CreateNewUniqueID(); // m_mal.M_Cate = CommonEnumHelper.AccountCate.现金.ToString2(); //M_Cate[Type=string] - 分类(积分/现金) // m_mal.M_PayCate = CommonEnumHelper.AccountLogCate.支出.ToString2(); //M_PayCate[Type=string] - 收入/支出类型 // m_mal.M_ObjectMoney = m_now_orders.O_PayMoney; //M_ObjectMoney[Type=double?] - 操作金额 // m_mal.M_BalanceMoney = m_member_account.M_AvailableBalance; //M_BalanceMoney[Type=double?] - 账户余额 // m_mal.M_Remark = "支付订单(订单编号:" + m_now_orders.O_UID + ")"; //M_Remark[Type=string] - 备注 // m_mal.M_Status = ""; //M_Status[Type=string] - 当前状态 // m_mal.M_Time = DateTime.Now; //M_Time[Type=DateTime?] - 时间 // m_mal.Add(_STE); // #endregion // #region 增加商家账户消费记录信息 // MemberAccountLog m_mal_s = new MemberAccountLog(); //表名:MemberAccountLog 备注:会员账户消费记录 // m_mal_s.M_UID = m_now_orders.Store_UID; //M_UID[Type=string] - 会员唯一编号 // m_mal_s.MA_UID = Common.Globals.CreateNewUniqueID(); // m_mal_s.M_Cate = CommonEnumHelper.AccountCate.现金.ToString2(); //M_Cate[Type=string] - 分类(积分/现金) // m_mal_s.M_PayCate = CommonEnumHelper.AccountLogCate.收入.ToString2(); //M_PayCate[Type=string] - 收入/支出类型 // m_mal_s.M_ObjectMoney = m_now_orders.O_StoreGetMoney; //M_ObjectMoney[Type=double?] - 操作金额 // m_mal_s.M_BalanceMoney = m_store_account.M_AvailableBalance; //M_BalanceMoney[Type=double?] - 账户余额 // m_mal_s.M_Remark = "订单收款(订单编号:" + m_now_orders.O_UID + "),所得金额现为锁定状态,需等买家确认收货/消费后自动解锁"; //M_Remark[Type=string] - 备注 // m_mal_s.M_Status = ""; //M_Status[Type=string] - 当前状态 // m_mal_s.M_Time = DateTime.Now; //M_Time[Type=DateTime?] - 时间 // m_mal_s.Add(_STE); // #endregion // isSuccess = _STE.ExecuteSqlTran(); // } //} } } } catch (Exception ex) { return(Content(ex.ToString())); } if (isSuccess) { return(RedirectToAction("OrderPaySuccess", "Order")); } else { return(RedirectToAction("OrderPayFailure", "Order", new { msg = "订单支付失败,请重新核对订单信息及支付信息后重新支付" })); } }