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.Infrastructure.Query; using CY.Infrastructure.Common; using CY.BLL.Sys; namespace CY.WebForm.Pages.member { //吴辉 //收货地址 public partial class MemberAcceptAddress : BasePage { EC_MemberBasicBLL bll_EC_MemberBasicBLL = null; Sys_DictionaryBLL bll_Sys_DictionaryBLL = null; public Guid targetid = Guid.Empty; //初始化 public MemberAcceptAddress() { bll_EC_MemberBasicBLL = new EC_MemberBasicBLL(); bll_Sys_DictionaryBLL = new Sys_DictionaryBLL(); } //页面加载 protected void Page_Load(object sender, EventArgs e) { targetid = CurrentUser.MemberId; } //提交事件 protected void btn_submit_info(object sender, EventArgs e) { try { #region 初始会员收货信息 EC_AcceptWayBySeller m_EC_AcceptWayBySeller = bll_EC_MemberBasicBLL.GetEC_AcceptWayBySellerByMemberId(CurrentUser.MemberId); if (m_EC_AcceptWayBySeller == null) m_EC_AcceptWayBySeller = new EC_AcceptWayBySeller(); m_EC_AcceptWayBySeller.AcceptTypeId = Request["AcceptTypeId"].ToInt32(); m_EC_AcceptWayBySeller.InvoiceDemand = Request["InvoiceId"].ToString2(); m_EC_AcceptWayBySeller.Remark = Request["Remark"].ToString2(); m_EC_AcceptWayBySeller.LastUpdateTime = DateTime.Now; m_EC_AcceptWayBySeller.Operator = CurrentUser.ShortName; m_EC_AcceptWayBySeller.SellerId = CurrentUser.MemberId; m_EC_AcceptWayBySeller.City = ""; m_EC_AcceptWayBySeller.Accepter = ""; m_EC_AcceptWayBySeller.AccepterPhone = ""; m_EC_AcceptWayBySeller.AppointCourierCompany = ""; m_EC_AcceptWayBySeller.AccepterAddress = CurrentUser.Province + CurrentUser.City + CurrentUser.County + CurrentMemberExtend.DetailedAddress; m_EC_AcceptWayBySeller.AccepterPhoneNum = ""; m_EC_AcceptWayBySeller.AcceptContacts = ""; m_EC_AcceptWayBySeller.FetchAddress = ""; m_EC_AcceptWayBySeller.FetchPhoneNum = ""; m_EC_AcceptWayBySeller.FetchContacts = ""; m_EC_AcceptWayBySeller.AppointCourierCompany = ""; string ReceiptType = bll_Sys_DictionaryBLL.GetModelByKeyid(Request["AcceptTypeId"].ToInt32()); switch (ReceiptType) { case "自提": break; case "代发货运": m_EC_AcceptWayBySeller.City = Request["City_OnBehalfOfCargo"].ToString2(); m_EC_AcceptWayBySeller.Accepter = Request["Accepter_OnBehalfOfCargo"].ToString2(); m_EC_AcceptWayBySeller.AccepterPhone = Request["AccepterPhone_OnBehalfOfCargo"].ToString2(); break; case "送货上门": m_EC_AcceptWayBySeller.City = Request["City_HomeDelivery"].ToString2(); m_EC_AcceptWayBySeller.Accepter = Request["Accepter_HomeDelivery"].ToString2(); m_EC_AcceptWayBySeller.AccepterPhone = Request["AccepterPhone_HomeDelivery"].ToString2(); m_EC_AcceptWayBySeller.AccepterAddress = Request["AccepterAddress_HomeDelivery"].ToString2(); break; case "指定货运公司": m_EC_AcceptWayBySeller.City = Request["City_OfficialFreightForwarder"].ToString2(); m_EC_AcceptWayBySeller.Accepter = Request["Accepter_OfficialFreightForwarder"].ToString2(); m_EC_AcceptWayBySeller.AccepterPhone = Request["AccepterPhone_OfficialFreightForwarder"].ToString2(); m_EC_AcceptWayBySeller.AppointCourierCompany = Request["AppointCourierCompany"].ToString2(); m_EC_AcceptWayBySeller.AccepterAddress = Request["AccepterAddress"].ToString2(); m_EC_AcceptWayBySeller.AccepterPhoneNum = Request["AccepterPhoneNum"].ToString2(); m_EC_AcceptWayBySeller.AcceptContacts = Request["AcceptContacts"].ToString2(); m_EC_AcceptWayBySeller.FetchAddress = Request["FetchAddress"].ToString2(); m_EC_AcceptWayBySeller.FetchPhoneNum = Request["FetchPhoneNum"].ToString2(); m_EC_AcceptWayBySeller.FetchContacts = Request["FetchContacts"].ToString2(); m_EC_AcceptWayBySeller.AppointCourierCompany = Request["AppointCourierCompany"].ToString2(); break; default: break; } #endregion if (m_EC_AcceptWayBySeller.Keyid > 0) { if (bll_EC_MemberBasicBLL.UpdateModelMemberExtend(m_EC_AcceptWayBySeller)) { JavaScript.MessageBox("更新成功", this); } else JavaScript.MessageBox("操作失败", this); } else { if (bll_EC_MemberBasicBLL.InsertModelEC_AcceptWayBySeller(m_EC_AcceptWayBySeller)) { JavaScript.MessageBox("更新成功", this); } else JavaScript.MessageBox("操作失败", this); } } catch (Exception ex) { PAGEHandleException(ex); JavaScript.MessageBox("操作失败", this); } } } }