private void LoadAddresses() { using (SqlConnection con = DB.NewSqlConnection()) { con.Open(); using (IDataReader reader = DB.GetRSFormat(con, string.Format("exec EcommerceGetAddressList @CustomerCode = {0}, @AddressType = {1}, @ContactCode = {2} ", DB.SQuote(ThisCustomer.CustomerCode), (int)AddressType, DB.SQuote(ThisCustomer.ContactCode)))) { AddressList.DataSource = reader; AddressList.DataBind(); reader.Close(); btnReturn.Text = AppLogic.GetString("account.aspx.25", SkinID, ThisCustomer.LocaleSetting, true); btnReturn.OnClientClick = "self.location='account.aspx?checkout=" + checkOutMode.ToString() + "';return false"; btnCheckOut.Visible = checkOutMode; btnCheckOut.Text = AppLogic.GetString("account.aspx.24", SkinID, ThisCustomer.LocaleSetting); string redirecTo = (checkOutMode && ReturnURL.IsNullOrEmpty()) ? "checkoutshipping.aspx" : ReturnURL; if (checkOutMode && AppLogic.AppConfigBool("Checkout.UseOnePageCheckout")) { redirecTo = "checkout1.aspx"; } btnCheckOut.OnClientClick = String.Format("self.location='{0}';return false;", redirecTo); if (ThisCustomer.IsInEditingMode()) { AppLogic.EnableButtonCaptionEditing(btnReturn, "account.aspx.25"); AppLogic.EnableButtonCaptionEditing(btnCheckOut, "account.aspx.24"); } } } }
/// <summary> /// Binds the data. /// </summary> private void BindData() { // No support for saving addresses for anonymous user if (Profile.IsAnonymous) { rbShipToNewAddress.Checked = true; trShippingAddresses.Visible = false; return; } CustomerAddressCollection addresses = null; if (Profile.Account != null) { addresses = Profile.Account.Addresses; } if (addresses != null && addresses.Count > 0) { AddressList.DataSource = addresses; AddressList.DataBind(); } else { trShippingAddresses.Visible = false; } rbShipToNewAddress.Checked = true; }
protected void BindAddressBook() { // bind billing address User user = AbleContext.Current.User; if (user.PrimaryAddress.IsValid) { PrimaryAddress.Text = user.PrimaryAddress.ToString(true); } // bind shipping addresses, sorted by last name if (user.Addresses.Count > 1) { List <Address> shippingAddresses = new List <Address>(); shippingAddresses.AddRange(user.Addresses); int billingIndex = shippingAddresses.IndexOf(user.PrimaryAddressId); if (billingIndex > -1) { shippingAddresses.RemoveAt(billingIndex); } shippingAddresses.Sort("LastName"); AddressList.DataSource = shippingAddresses; AddressList.DataBind(); } else { AddressList.Visible = false; } }
private void LoadUser() { CustomerAccount u; u = MTApp.MembershipServices.Customers.Find(this.BvinField.Value); if (u != null) { if (u.Bvin != string.Empty) { this.EmailField.Text = u.Email; this.FirstNameField.Text = u.FirstName; this.LastNameField.Text = u.LastName; this.chkTaxExempt.Checked = u.TaxExempt; this.PasswordField.Text = "********"; this.CommentField.Text = u.Notes; this.LockedField.Checked = u.Locked; this.LockedField.Text = " until " + TimeZoneInfo.ConvertTimeFromUtc(u.LockedUntilUtc, MTApp.CurrentStore.Settings.TimeZone).ToString() + " (" + u.FailedLoginCount + " failed attempts)"; this.PricingGroupDropDownList.SelectedValue = u.PricingGroupId; //this.CustomQuestionAnswerTextBox.Text = u.CustomQuestionAnswers; } } if (!Page.IsPostBack) { AddressList.DataSource = u.Addresses; AddressList.DataBind(); } }
/// <summary> /// Binds the addresses. /// </summary> private void BindAddresses() { if (_order != null && _order.OrderAddresses.Count > 0) { AddressList.DataSource = GetAddressesDataSource(); AddressList.DataBind(); } }
private void LoadAddresses() { CustomerAccount u; u = MTApp.MembershipServices.Customers.Find(this.BvinField.Value); if (u != null) { AddressList.DataSource = u.Addresses; AddressList.DataBind(); } u = null; }
private void InitializePageContent() { pnlCheckoutImage.Visible = Checkout; CheckoutImage.ImageUrl = AppLogic.LocateImageURL("App_Themes/skin_" + SkinID.ToString() + "/images/step_2.gif"); pnlAddressList.Visible = (custAddresses.Count > 0 || CommonLogic.QueryStringCanBeDangerousContent("add").Length != 0); tblAddressList.Attributes.Add("style", "border-style: solid; border-width: 0px; border-color: #" + AppLogic.AppConfig("HeaderBGColor")); tblAddressListBox.Attributes.Add("style", AppLogic.AppConfig("BoxFrameStyle")); lnkAddAddress.Text = AppLogic.GetString("selectaddress.aspx.6", SkinID, ThisCustomer.LocaleSetting); lnkAddAddress.NavigateUrl = "selectaddress.aspx?add=true&checkout=" + Checkout.ToString() + "&addressType=" + AddressType.ToString() + "&returnURL=" + Server.UrlEncode(ReturnURL); lnkAddAddress.Visible = (CommonLogic.QueryStringCanBeDangerousContent("add").Length == 0); if (CommonLogic.QueryStringCanBeDangerousContent("add").Length != 0) { pnlNewAddress.Visible = true; Address newAddress = new Address(); newAddress.AddressType = AddressType; litNewAddressForm.Text = newAddress.InputHTML(); litNewAddressForm.Visible = true; btnNewAddress.Text = AppLogic.GetString("selectaddress.aspx.5", SkinID, ThisCustomer.LocaleSetting); AppLogic.GetButtonDisable(btnNewAddress); } addressbook_gif.ImageUrl = AppLogic.LocateImageURL("App_Themes/skin_" + SkinID.ToString() + "/images/addressbook.gif", ThisCustomer.LocaleSetting); string sql = String.Empty; if (AddressType == AddressTypes.Shipping) { sql = "select a.*, isnull(City + ', ', '') + isnull(State,'') + isnull(' ' + ZIP, '') CityStateZip, case when c.customerid is null then 0 else 1 end PrimaryAddress from Address a left join Customer c on a.AddressID = c.ShippingAddressID where a.customerid = " + ThisCustomer.CustomerID.ToString(); } else { sql = "select a.*, isnull(City + ', ', '') + isnull(State,'') + isnull(' ' + ZIP, '') CityStateZip, case when c.customerid is null then 0 else 1 end PrimaryAddress from Address a left join Customer c on a.AddressID = c.BillingAddressID where a.customerid = " + ThisCustomer.CustomerID.ToString(); } using (SqlConnection dbconn = new SqlConnection(DB.GetDBConn())) { dbconn.Open(); using (IDataReader dr = DB.GetRS(sql, dbconn)) { AddressList.DataSource = dr; AddressList.DataBind(); } } btnReturn.Text = AppLogic.GetString("account.aspx.61", SkinID, ThisCustomer.LocaleSetting); btnReturn.OnClientClick = "self.location='account.aspx?checkout=" + Checkout.ToString() + "';return false"; btnCheckOut.Visible = Checkout; btnCheckOut.Text = AppLogic.GetString("account.aspx.60", SkinID, ThisCustomer.LocaleSetting); btnCheckOut.OnClientClick = "self.location='checkoutshipping.aspx';return false;"; }
protected void Page_Load(object sender, EventArgs e) { hMailServerNetRemote.IApplication app = RemoteActivation.GetAuthenticatedRemotehMailServerApplication(); if (app == null) { Response.End(); } string[] sp = Request.QueryString["Address"].Split(new Char[] { '@' }); if (sp.Length != 2) { Response.StatusCode = 404; Response.End(); } hMailServerNetRemote.IDomain domain = app.Domains.ItemByName(sp[1]); if (domain == null) { Response.StatusCode = 404; Response.End(); } hMailServerNetRemote.IDistributionList ds = domain.DistributionLists.ItemByAddress(Request.QueryString["Address"]); if (ds == null) { Response.StatusCode = 404; Response.End(); } hMailServerNetRemote.IDistributionListRecipients re = ds.Recipients; if (!IsPostBack) { DistributionListName.Text = ds.Address; List <hMailServerNetRemote.IDistributionListRecipient> addys = new List <hMailServerNetRemote.IDistributionListRecipient>(); int c = re.Count; for (int i = 0; i < c; i++) { addys.Add(re[i]); } AddressList.DataSource = addys; AddressList.DataBind(); } }
private void LoadAddresses() { using (SqlConnection con = DB.NewSqlConnection()) { con.Open(); using (IDataReader reader = DB.GetRSFormat(con, string.Format("exec EcommerceGetAddressList @CustomerCode = {0}, @AddressType = {1}, @ContactCode = {2} ", DB.SQuote(ThisCustomer.CustomerCode), (int)AddressType, DB.SQuote(ThisCustomer.ContactCode)))) { AddressList.DataSource = reader; AddressList.DataBind(); reader.Close(); btnReturn.Text = AppLogic.GetString("account.aspx.25", SkinID, ThisCustomer.LocaleSetting); btnReturn.OnClientClick = "self.location='account.aspx?checkout=" + checkOutMode.ToString() + "';return false"; btnCheckOut.Visible = checkOutMode; btnCheckOut.Text = AppLogic.GetString("account.aspx.24", SkinID, ThisCustomer.LocaleSetting); btnCheckOut.OnClientClick = "self.location='checkoutshipping.aspx';return false;"; } } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { DataTable dt = Session["UserTable"] as DataTable; EnOrder en = Session["OrderInfo"] as EnOrder; if (dt == null || en == null) { return; } this.UserName.Text = dt.Rows[0]["UserName"].ToString(); OrderNumber.Text = en.orderNumber.ToString(); OrderTime.Text = en.placeOrderTime.ToString(); Coments.Text = ""; List <EnDoc> docslist = en.docs; Repeater1.DataSource = docslist; Repeater1.DataBind(); string Sql = "select * from Address where UserRecID='" + dt.Rows[0]["UserRecID"].ToString() + "'"; DataSet ST = DataBase.RunDataSet(Sql); DataTable S = ST.Tables[0]; AddressList.DataSource = S; AddressList.DataValueField = "AddressRecID"; AddressList.DataTextField = "AddressName"; AddressList.DataBind(); string mySql = "select * from OrderType"; DataSet st = DataBase.RunDataSet(mySql); DataTable s = st.Tables[0]; SendMothedList.DataSource = s; SendMothedList.DataValueField = "OrderTypeID"; SendMothedList.DataTextField = "OrderTypeName"; SendMothedList.DataBind(); this.SendMothedList.SelectedIndex = 0; double addmoney = Convert.ToSingle(s.Rows[0]["SendPrice"].ToString()) * 1.0; this.AddMoney.Text = addmoney.ToString(); float All = Convert.ToSingle(en.toalPrice.ToString()) + Convert.ToSingle(s.Rows[0]["SendPrice"].ToString()); Money.Text = All.ToString(); } }
/// <summary> /// Called when [need rebind]. /// </summary> /// <param name="sender">The sender.</param> /// <param name="oArgs">The <see cref="System.EventArgs"/> instance containing the event data.</param> public void OnNeedRebind(object sender, System.EventArgs oArgs) { AddressList.DataBind(); }
/// <summary> /// Binds the form. /// </summary> /// <param name="reset">if set to <c>true</c> [reset].</param> private void BindForm(bool reset) { ShippingMethodList.DataSource = ShippingManager.GetShippingMethods(null); ShippingMethodList.DataBind(); if (_order != null) { AddressList.DataSource = _order.OrderAddresses; AddressList.DataBind(); if (String.IsNullOrEmpty(SelectedAddressField.Value)) { SelectedAddressField.Value = AddressList.SelectedValue; } if (String.IsNullOrEmpty(SelectedShippingMethodField.Value)) { SelectedShippingMethodField.Value = ShippingMethodList.SelectedValue; } if (SelectedShipment != null) { String formatString = "#0.00"; if (reset) { ManagementHelper.SelectListItem(ShippingMethodList, SelectedShipment.ShippingMethodId); ManagementHelper.SelectListItem(AddressList, SelectedShipment.ShippingAddressId); SelectedAddressField.Value = AddressList.SelectedValue; SelectedShippingMethodField.Value = ShippingMethodList.SelectedValue; MethodName.Text = SelectedShipment.ShippingMethodName; TrackingNumber.Text = SelectedShipment.ShipmentTrackingNumber; ShipmentTotal.Text = SelectedShipment.ShipmentTotal.ToString(formatString); DiscountAmount.Text = SelectedShipment.ShippingDiscountAmount.ToString(formatString); Status.Text = SelectedShipment.Status; //lblItemsToShip.Text = Shipment.GetShipmentLineItemsString(SelectedShipment, 3, "<br />"); LoadShipmentLineItems(); } MetaDataTab.ObjectId = SelectedShipment.ShipmentId; } else if (reset) { MethodName.Text = String.Empty; TrackingNumber.Text = String.Empty; ShipmentTotal.Text = "0"; DiscountAmount.Text = "0"; Status.Text = String.Empty; LoadShipmentLineItems(); } // Bind Meta classes // Bind Meta Form BindMetaForm(); } }