private bool DoEdit(int _id) { bool flag = false; Rain.BLL.payment payment = new Rain.BLL.payment(); Rain.Model.payment model = payment.GetModel(_id); model.title = this.txtTitle.Text.Trim(); model.is_lock = !this.cbIsLock.Checked ? 1 : 0; model.sort_id = int.Parse(this.txtSortId.Text.Trim()); model.poundage_type = int.Parse(this.rblPoundageType.SelectedValue); model.poundage_amount = Decimal.Parse(this.txtPoundageAmount.Text.Trim()); model.img_url = this.txtImgUrl.Text.Trim(); model.remark = this.txtRemark.Text; if (model.api_path.ToLower() == "alipaypc") { string mapPath = Utils.GetMapPath(this.siteConfig.webpath + "xmlconfig/alipaypc.config"); XmlHelper.UpdateNodeInnerText(mapPath, "Root/partner", this.txtAlipayPartner.Text); XmlHelper.UpdateNodeInnerText(mapPath, "Root/key", this.txtAlipayKey.Text); XmlHelper.UpdateNodeInnerText(mapPath, "Root/email", this.txtAlipaySellerEmail.Text); XmlHelper.UpdateNodeInnerText(mapPath, "Root/type", this.rblAlipayType.SelectedValue); } else if (model.api_path.ToLower() == "tenpaypc") { string mapPath = Utils.GetMapPath(this.siteConfig.webpath + "xmlconfig/tenpaypc.config"); XmlHelper.UpdateNodeInnerText(mapPath, "Root/partner", this.txtTenpayBargainorId.Text); XmlHelper.UpdateNodeInnerText(mapPath, "Root/key", this.txtTenpayKey.Text); XmlHelper.UpdateNodeInnerText(mapPath, "Root/type", this.rblTenpayType.SelectedValue); } if (payment.Update(model)) { this.AddAdminLog(DTEnums.ActionEnum.Edit.ToString(), "修改支付方式:" + model.title); flag = true; } return(flag); }
protected bool get_order_payment_status(int order_id) { Rain.Model.orders model1 = new Rain.BLL.orders().GetModel(order_id); if (model1 == null || model1.status != 1) { return(false); } Rain.Model.payment model2 = new Rain.BLL.payment().GetModel(model1.payment_id); return(model2 != null && (model2.type == 1 && model1.payment_status == 1)); }
private void TreeBind(string strWhere) { DataTable table = new Rain.BLL.payment().GetList(0, strWhere, "sort_id asc,id asc").Tables[0]; this.ddlPaymentId.Items.Clear(); this.ddlPaymentId.Items.Add(new ListItem("请选择支付方式", "")); foreach (DataRow row in (InternalDataCollectionBase)table.Rows) { this.ddlPaymentId.Items.Add(new ListItem(row["title"].ToString(), row["id"].ToString())); } }
protected Decimal get_payment_poundage_amount(int payment_id, Decimal total_amount) { Rain.Model.payment model = new Rain.BLL.payment().GetModel(payment_id); if (model == null) { return(new Decimal(0)); } Decimal num = model.poundage_amount; if (model.poundage_type == 1) { num = num * total_amount / new Decimal(100); } return(num); }