📄 payment.cs
字号:
namespace PowerEasy.WebSite.Shop
{
using PowerEasy.Accessories;
using PowerEasy.Common;
using PowerEasy.Components;
using PowerEasy.Controls;
using PowerEasy.Crm;
using PowerEasy.Enumerations;
using PowerEasy.Model.Accessories;
using PowerEasy.Model.Crm;
using PowerEasy.Model.Shop;
using PowerEasy.Model.UserManage;
using PowerEasy.Shop;
using PowerEasy.UserManage;
using PowerEasy.Web.UI;
using PowerEasy.WebSite.Controls;
using PowerEasy.WebSite.Controls.Shop;
using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
public class Payment : DynamicPage
{
protected AddressPicker AddressPick;
protected Button BtnGotoPreview;
protected Button BtnReturn;
protected CheckBox ChkNeedInvoice;
protected DropDownList DropDeliverType;
protected DropDownList DropPaymentType;
protected HtmlForm form1;
protected Label LblDeliverTypeIntro;
protected Label LblPaymentTypeIntro;
protected LinkButton LBtnAddress;
private string m_CartId;
private bool m_UserLogin;
protected RadioButtonList RadlOutOfStockProject;
protected RadioButtonList RadlPayPlatform;
protected SelectAgent SelectAgent1;
protected PowerEasy.WebSite.Controls.ShoppingCartUI ShoppingCart1;
protected ScriptManager SmgePayment;
protected TextBox TxtContacterName;
protected TextBox TxtEmail;
protected TextBox TxtInvoiceContent;
protected TextBox TxtMobile;
protected TextBox TxtPhone;
protected TextBox TxtRemark;
protected TextBox TxtZipCode;
protected System.Web.UI.UpdatePanel UpnlDeliverType;
protected System.Web.UI.UpdatePanel UpnlPaymentType;
protected System.Web.UI.UpdatePanel UpnlZipCode;
protected PowerEasy.Controls.RequiredFieldValidator ValfEmail;
protected System.Web.UI.WebControls.RequiredFieldValidator ValfPaymentType;
protected PowerEasy.Controls.RequiredFieldValidator ValrContacterName;
protected PowerEasy.Controls.RequiredFieldValidator ValrZipCode;
protected CustomValidator ValxPhone;
protected EmailValidator VmailEmail;
protected MobileValidator VmblMobile;
protected TelephoneValidator VtelPhone;
protected ZipCodeValidator VzipZipCode;
private void AddressListPostBack(string eventArgument)
{
string[] strArray = eventArgument.Split(new string[] { "$$$" }, StringSplitOptions.None);
if (strArray.Length == 7)
{
this.AddressPick.SelectRegion(strArray[0], strArray[1], strArray[2], strArray[3]);
this.TxtZipCode.Text = strArray[4];
this.AddressPick.Address = DataSecurity.HtmlDecode(strArray[5]);
this.TxtContacterName.Text = DataSecurity.HtmlDecode(strArray[6]);
}
}
private void AddressPick_AddressChanged(object sender, EventArgs e)
{
this.TxtZipCode.Text = this.AddressPick.ZipCode;
}
protected void BtnGotoPreview_Click(object sender, EventArgs e)
{
OrderFlowInfo flowInfo = this.FlowInfo;
flowInfo.ShoppingCartId = this.m_CartId;
flowInfo.ZipCode = this.TxtZipCode.Text;
flowInfo.PaymentType = DataConverter.CLng(this.DropPaymentType.Text);
flowInfo.DeliverType = DataConverter.CLng(this.DropDeliverType.Text);
flowInfo.NeedInvoice = this.ChkNeedInvoice.Checked;
flowInfo.ConsigneeName = this.TxtContacterName.Text;
flowInfo.Address = this.AddressPick.Address;
flowInfo.Email = this.TxtEmail.Text;
flowInfo.Mobile = this.TxtMobile.Text;
flowInfo.AgentName = this.SelectAgent1.AgentName;
flowInfo.NeedInvoice = this.ChkNeedInvoice.Checked;
flowInfo.HomePhone = this.TxtPhone.Text;
flowInfo.InvoiceContent = this.TxtInvoiceContent.Text;
flowInfo.Remark = this.TxtRemark.Text;
flowInfo.Country = this.AddressPick.Country;
flowInfo.Province = this.AddressPick.Province;
flowInfo.City = this.AddressPick.City;
flowInfo.Area = this.AddressPick.Area;
flowInfo.PresentId = DataConverter.CLng(base.Request.Form["RdbPresentId"]);
flowInfo.OutOfStockProject = (OutOfStockProject) DataConverter.CLng(this.RadlOutOfStockProject.SelectedValue);
}
protected void BtnReturn_Click(object sender, EventArgs e)
{
base.Response.Redirect("ShoppingCart.aspx");
}
protected void DropDeliverType_SelectedIndexChanged(object sender, EventArgs e)
{
DeliverTypeInfo deliverTypeById = new DeliverTypeInfo();
deliverTypeById = DeliverType.GetDeliverTypeById(DataConverter.CLng(this.DropDeliverType.SelectedValue));
if (!deliverTypeById.IsNull)
{
this.LblDeliverTypeIntro.Text = deliverTypeById.Intro;
}
}
protected void DropPaymentType_SelectedIndexChanged(object sender, EventArgs e)
{
PaymentTypeInfo paymentTypeById = PaymentType.GetPaymentTypeById(DataConverter.CLng(this.DropPaymentType.SelectedValue));
this.LblPaymentTypeIntro.Text = paymentTypeById.Intro;
if (paymentTypeById.Category == 1)
{
this.RadlPayPlatform.Visible = true;
IList<PayPlatformInfo> listOfEnabled = PayPlatform.GetListOfEnabled();
this.RadlPayPlatform.DataSource = listOfEnabled;
this.RadlPayPlatform.DataBind();
this.RadlPayPlatform.SelectedIndex = 0;
}
else
{
this.RadlPayPlatform.Visible = false;
}
}
private void InitializeDeliverType(int deliverTypeId)
{
IList<DeliverTypeInfo> enableDeliverTypeList = new List<DeliverTypeInfo>();
enableDeliverTypeList = DeliverType.GetEnableDeliverTypeList();
this.DropDeliverType.DataSource = enableDeliverTypeList;
this.DropDeliverType.DataBind();
int typeId = 0;
string intro = "";
foreach (DeliverTypeInfo info in enableDeliverTypeList)
{
if (deliverTypeId > 0)
{
if (info.TypeId != deliverTypeId)
{
continue;
}
typeId = info.TypeId;
intro = info.Intro;
break;
}
if (info.IsDefault)
{
typeId = info.TypeId;
intro = info.Intro;
break;
}
}
this.DropDeliverType.SelectedValue = typeId.ToString();
this.LblDeliverTypeIntro.Text = intro;
}
private void InitializePaymentType(int paymentTypeId, int payPlatformId)
{
IList<PaymentTypeInfo> paymentTypeListByEnabled = PaymentType.GetPaymentTypeListByEnabled();
int typeId = 0;
int category = 0;
IList<PaymentTypeInfo> list2 = new List<PaymentTypeInfo>();
foreach (PaymentTypeInfo info in paymentTypeListByEnabled)
{
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -