public IActionResult PayPlatAdd() { if (Mid < 1) { return(WriteErr("未指定支付平台")); } M_PayPlat info = platBll.SelReturnModel(Mid); M_PayPlat.Plat plat = (M_PayPlat.Plat)info.PayClass; switch (plat)//是否转到有单独配置的页 { case M_PayPlat.Plat.WXPay: Response.Redirect("PayWeiXin"); break; case M_PayPlat.Plat.PayPal: Response.Redirect("PaypalManage"); break; case M_PayPlat.Plat.Alipay_Bank: Response.Redirect("AlipayBank"); break; } return(View(info)); }
/// <summary> /// 选定支付方式后更新平台信息 /// </summary> public bool UpdatePlat(int id, M_PayPlat.Plat plat, string platInfo = "") { List <SqlParameter> sp = new List <SqlParameter>() { new SqlParameter("platInfo", platInfo) }; DBCenter.UpdateSQL(TbName, "PayPlatID=" + (int)plat + ",PlatFormInfo=@platInfo", PK + "=" + id, sp); return(true); }
/// <summary> /// 选定支付方式后更新平台信息 /// </summary> public bool UpdatePlat(int id, M_PayPlat.Plat plat, string platInfo = "") { M_PayPlat platMod = new B_PayPlat().SelModelByClass(plat); List <SqlParameter> sp = new List <SqlParameter>() { new SqlParameter("platInfo", platInfo) }; DBCenter.UpdateSQL(TbName, "PayPlatID=" + platMod.PayPlatID + ",PlatFormInfo=@platInfo", PK + "=" + id, sp); return(true); }
public M_PayPlat SelModelByClass(M_PayPlat.Plat type) { using (SqlDataReader reader = Sql.SelReturnReader(strTableName, " WHERE PayClass=" + (int)type)) { if (reader.Read()) { return(initMod.GetModelFromReader(reader)); } else { return(null); } } }