Exemple #1
0
 protected void Zip_Changed(object sender, EventArgs e)
 {
     if (txtzip5.Text.Length == 5)
     {
         //***EAC HITT 7460
         drpcity.Items.Clear();
         txtstate.Text = "";
         try
         {
             foreach (KVPair city in Zipcode.GetCities(Convert.ToInt32(txtzip5.Text)))
             {
                 drpcity.Items.Add(new ListItem(city.Key, city.Key));
                 txtstate.Text = city.Val; //doesn't hurt to do this n times
             }
             txtcity.Visible = true;       //**just in case the line below throws an error
             drpcity.Visible = false;      //**just in case the line below throws an error
             txtcity.Text    = drpcity.Items[0].Text;
             if (drpcity.Items.Count <= 1)
             {
                 txtcity.Visible = true;
                 drpcity.Visible = false;
                 lbltxtcity.AssociatedControlID = "txtcity";
             }
             else
             {
                 txtcity.Visible = false;
                 drpcity.Visible = true;
                 lbltxtcity.AssociatedControlID = "drpcity";
             }
             BindTotals(txtstate.Text);
         }
         catch { }
     }
 }
Exemple #2
0
 private void BindBillingInfo()
 {
     if (billto != null)
     {
         //EAC use a try-catch because the billto object may be non-existent at this point
         try
         {
             txt2zip5.Text  = billto.Zip5;
             txt2zip4.Text  = billto.Zip4;
             txt2city.Text  = billto.City;
             txt2state.Text = billto.State;
             foreach (KVPair city in Zipcode.GetCities(Convert.ToInt32(billto.Zip5)))
             {
                 drpcity2.Items.Add(new ListItem(city.Key, city.Key));
             }
             drpcity2.SelectedValue    = billto.City;
             txt2name.Text             = billto.Fullname;
             txt2org.Text              = billto.Organization;
             txt2addr1.Text            = billto.Addr1;
             txt2addr2.Text            = billto.Addr2;
             txt2phone.Text            = billto.Phone;
             txt2email.Text            = billto.Email;
             drp2Country.SelectedValue = billto.Country;
         }
         catch (Exception)
         {
         }
     }
 }
Exemple #3
0
        private void BindBillingInfo(Person p)
        {
            txt2name.Text  = p.Fullname;
            txt2org.Text   = p.Organization;
            txt2addr1.Text = p.Addr1;
            txt2addr2.Text = p.Addr2;
            txt2phone.Text = p.Phone;
            txt2email.Text = p.Email;

            txt2zip5.Text  = p.Zip5;
            txt2zip4.Text  = p.Zip4;
            txt2city.Text  = p.City;
            txt2state.Text = p.State;
            foreach (KVPair city in Zipcode.GetCities(Convert.ToInt32(p.Zip5)))
            {
                drpcity2.Items.Add(new ListItem(city.Key, city.Key));
            }
            drpcity2.SelectedValue = p.City;
        }
Exemple #4
0
        private void BindShippingInfo(Person p)
        {
            txtname.Text  = p.Fullname;
            txtorg.Text   = p.Organization;
            txtaddr1.Text = p.Addr1;
            txtaddr2.Text = p.Addr2;
            txtphone.Text = p.Phone;
            txtemail.Text = p.Email;

            txtzip5.Text  = p.Zip5;
            txtzip4.Text  = p.Zip4;
            txtcity.Text  = p.City;
            txtstate.Text = p.State;
            foreach (KVPair city in Zipcode.GetCities(Convert.ToInt32(p.Zip5)))
            {
                drpcity2.Items.Add(new ListItem(city.Key, city.Key));
            }
            drpcity2.SelectedValue = billto.City;
            //txtcity.Visible = true;
            //drpcity.Visible = false;
        }
Exemple #5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Utils.ValidateRedirect().Length > 0) //Important check
            {
                Response.Redirect(Utils.ValidateRedirect(), true);
            }

            if (this.shoppingcart == null || this.shoppingcart.Count < 1)
            {  //***EAC I need a shopping cart at this point
                ResetSessions();
                Response.Redirect("home.aspx?missingcart=true", true);
            }

            IsOrderIntl = Utils.IsOrderInternational(); //NCIPLex - International or domestic

            if (!IsPostBack)
            {
                steps1.Activate("cell3");

                this.shoppingcartV2 = VirtualizedCart(this.shoppingcart);
                if (this.cc == null)
                {
                    this.cc = new CreditCard();
                }
                this.cc.Cost = this.shoppingcartV2.Cost;      //assume cart exists...if not error handler will take care of it

                for (int i = DateTime.Now.Year; i < DateTime.Now.Year + 9; i++)
                {
                    drpyr.Items.Add(new ListItem(i.ToString(), i.ToString().Substring(2)));
                }

                ddlIntlCountry.DataSource    = NCIPLex.DAL.SQLDataAccess.GetKVPairStr("SP_NCIPLex_GetCountry");
                ddlIntlCountry.DataTextField = "Val";
                //ddlIntlCountry.DataValueField = "Key";
                ddlIntlCountry.DataValueField = "Val";
                ddlIntlCountry.DataBind();
                ddlIntlCountry.Items.Insert(0, new ListItem("[Select from the list]", ""));

                if (this.shipto != null)
                {
                    #region Restore ship vals
                    try
                    {
                        txtzip5.Text  = shipto.Zip5;
                        txtzip4.Text  = shipto.Zip4;
                        txtcity.Text  = shipto.City;
                        txtstate.Text = shipto.State;
                        //foreach (KVPair city in Zipcode.GetCities(Convert.ToInt32(shipto.Zip5)))
                        //    drpcity.Items.Add(new ListItem(city.Key, city.Key));
                        //drpcity.SelectedValue = shipto.City;
                        txtcity.Text    = shipto.City;
                        txtcity.Visible = true;
                        drpcity.Visible = false;
                        txtname.Text    = shipto.Fullname;
                        txtorg.Text     = shipto.Organization;
                        txtaddr1.Text   = shipto.Addr1;
                        txtaddr2.Text   = shipto.Addr2;
                        txtphone.Text   = shipto.Phone;
                        txtemail.Text   = shipto.Email;

                        if (IsOrderIntl)
                        {
                            txtIntlZip.Text   = shipto.Zip5;
                            txtIntlState.Text = shipto.State;
                            //txtIntlCountry.Text = shipto.Country;
                            ddlIntlCountry.SelectedValue = shipto.Country;
                        }
                    }
                    catch (Exception)
                    {
                    }

                    #endregion
                }

                if (this.billto != null)
                {
                    #region Restore bill vals
                    try
                    {
                        txt2zip5.Text  = billto.Zip5;
                        txt2zip4.Text  = billto.Zip4;
                        txt2city.Text  = billto.City;
                        txt2state.Text = billto.State;
                        foreach (KVPair city in Zipcode.GetCities(Convert.ToInt32(billto.Zip5)))
                        {
                            drpcity2.Items.Add(new ListItem(city.Key, city.Key));
                        }
                        drpcity2.SelectedValue = billto.City;
                        txt2name.Text          = billto.Fullname;
                        txt2org.Text           = billto.Organization;
                        txt2addr1.Text         = billto.Addr1;
                        txt2addr2.Text         = billto.Addr2;
                        txt2phone.Text         = billto.Phone;
                        txt2email.Text         = billto.Email;
                    }
                    catch (Exception)
                    {
                    }
                    #endregion
                }

                //JPJ 03-10-11 NCIPLex does not accept credit card orders
                //if (this.cc != null && this.cc.Cost > 0.0)
                //{
                //    Label1.Text = "Shipping & Payment";
                //    pnlPaymentInfo.Visible = true;
                //    #region Restor CC field values
                //    drpcard.SelectedValue = cc.Company;
                //    txtccnum.Text = cc.CCnum;
                //    txtcvv2.Text = cc.CVV2;
                //    drpmonth.SelectedValue = cc.ExpMon;
                //    drpyr.SelectedValue = cc.ExpYr;
                //    lblCost.Text = this.cc.Cost.ToString("c");
                //    #endregion
                //}
                //else
                //{
                Label1.Text            = "Shipping";
                pnlPaymentInfo.Visible = false;
                pnlBIllingInfo.Visible = false;
                chkSameaddress.Visible = false;
                lblBill.Visible        = false;
                lblShip.Visible        = false;
                rowIntlCountry.Visible = false;
                //}

                if (IsOrderIntl)
                {
                    lbltxtzip5.Visible  = false;
                    txtzip5.Visible     = false;
                    lbltxtzip4.Visible  = false;
                    txtzip4.Visible     = false;
                    lbltxtstate.Visible = false;
                    txtstate.Visible    = false;

                    txtphone.ToolTip = "";

                    RegularExpressionValidator3.Visible = false;
                    RegularExpressionValidator6.Visible = false;
                    RequiredFieldValidator13.Visible    = false;
                    RegularExpressionValidator5.Visible = false;
                    RequiredFieldValidator6.Visible     = false;


                    lblIntltxtzip.Visible     = true;
                    txtIntlZip.Visible        = true;
                    lbltxtIntlState.Visible   = true;
                    txtIntlState.Visible      = true;
                    rowIntlCountry.Visible    = true;
                    divlblCountry.Visible     = true;
                    lbltxtIntlCountry.Visible = true;
                    divtxtCountry.Visible     = true;
                    //txtIntlCountry.Visible = true;
                    ddlIntlCountry.Visible           = true;
                    RequiredFieldIntlZip.Visible     = true;
                    RequiredFieldIntlCountry.Visible = true;
                }
            }

            //Display the master page tabs
            GlobalUtils.Utils UtilMethod = new GlobalUtils.Utils();
            if (Session["NCIPLEX_Pubs"] != null)
            {
                Master.LiteralText = UtilMethod.GetTabHtmlMarkUp(Session["NCIPLEX_Qtys"].ToString(), "");
            }
            else
            {
                Master.LiteralText = UtilMethod.GetTabHtmlMarkUp("", "");
            }
            UtilMethod = null;
        }