using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using CY.BLL; using CY.Model; using CY.BLL.Sys; using CY.Config; namespace CY.WebForm.Pages.membermanage { public partial class Renewal : MainPage { EC_MemberBasicBLL _EC_MemberBasicBLL = new EC_MemberBasicBLL(); public Guid MemberId { get { return Request.Params["MemberId"] != null ? Guid.Parse(Request.Params["MemberId"].ToString()) : Guid.Empty; } } protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { BindPage(); } } private void BindPage() { EC_MemberBasic memberBaic = _EC_MemberBasicBLL.GetMemberByMemberId(MemberId); if (memberBaic!=null) { string statusName = string.Empty; Sys_DictionaryBLL _sys_DictionaryBLL = new Sys_DictionaryBLL(); statusName = _sys_DictionaryBLL.GetNameByMeanValue(memberBaic.UseState, "会员帐号状态"); this.lblMemberName.Text = memberBaic.Name; this.lblStatusName.Text = statusName; this.lblEneTime.Text = memberBaic.ExpirationTime.Value.ToString("yyyy-MM-dd hh:mm"); decimal payMoney = 0; if (memberBaic.MemberType == "印刷厂商") { payMoney = WebInfo.Instance.RegisterWebPayByFirm; } else if (memberBaic.MemberType == "个人网店") { payMoney = WebInfo.Instance.RegisterWebPayByShop; } this.hidPayMoney.Value = payMoney.ToString(); } } protected void btnSave_Click(object sender, EventArgs e) { EC_PaymentRecordBLL _EC_PaymentRecordBLL = new EC_PaymentRecordBLL(); EC_MemberBasic memberBaic = _EC_MemberBasicBLL.GetMemberByMemberId(MemberId); int renewalTime = int.Parse(ddlRenewalTime.SelectedValue.ToString()); DateTime endTime = DateTime.Now.AddYears(renewalTime); decimal payMoney = decimal.Parse(this.hidPayMoney.Value); decimal payAllMoney = payMoney * renewalTime; string payType = "印刷厂商续费"; EC_PaymentRecord m_EC_PaymentRecord = new EC_PaymentRecord(); m_EC_PaymentRecord.BusinessManagerId = 0; m_EC_PaymentRecord.AccountManagerId = 0; m_EC_PaymentRecord.PayStartTime = DateTime.Now; m_EC_PaymentRecord.PayEndTime = endTime; m_EC_PaymentRecord.LastUpdateTime = DateTime.Now; m_EC_PaymentRecord.AdForum = ""; m_EC_PaymentRecord.AdImg = ""; m_EC_PaymentRecord.AdInstallments = ""; m_EC_PaymentRecord.AdLocation = ""; m_EC_PaymentRecord.AdSize = ""; m_EC_PaymentRecord.CompanyPhone = memberBaic.EC_MemberExtendMode.PhoneNum; m_EC_PaymentRecord.Contact = string.IsNullOrEmpty(memberBaic.EC_MemberExtendMode.BusinessContacts) ? string.Empty : memberBaic.EC_MemberExtendMode.BusinessContacts; m_EC_PaymentRecord.Email = memberBaic.EC_MemberExtendMode.Email; m_EC_PaymentRecord.MemberId = memberBaic.MemberId; m_EC_PaymentRecord.MemberName = memberBaic.Name; m_EC_PaymentRecord.Operator = memberBaic.Operator; m_EC_PaymentRecord.PayAllMoney = payAllMoney; m_EC_PaymentRecord.PayMoney = 0; m_EC_PaymentRecord.PayRole = memberBaic.MemberType; m_EC_PaymentRecord.PayType = payType; m_EC_PaymentRecord.QQ = memberBaic.EC_MemberExtendMode.QQ; m_EC_PaymentRecord.Remark = _EC_PaymentRecordBLL.GetNewOrderId(); ; m_EC_PaymentRecord.SoftwarePermissions = string.Empty; if (_EC_PaymentRecordBLL.InsertModel(m_EC_PaymentRecord)) { JavaScript.MessageBoxCloseAndRefreshFirst("操作成功",this); } else { JavaScript.MessageBox("操作失败", this); } } } }