コード例 #1
0
 public ADDRESSINFO(ADDRESS Address)
 {
     this.ID = Address.ID;
     this.Name = Address.Name;
     this.Address = Address.Address1;
     this.City = Address.City;
     this.Type = Address.TypeID;
     this.Location = Address.Location;
     this.PostCode = Address.PostCode;
     this.Telephone = Address.Telephone;
 }
コード例 #2
0
 public ADDRESSINFO(ADDRESS Address)
 {
     this.ID        = Address.ID;
     this.Name      = Address.Name;
     this.Address   = Address.Address1;
     this.City      = Address.City;
     this.Type      = Address.TypeID;
     this.Location  = Address.Location;
     this.PostCode  = Address.PostCode;
     this.Telephone = Address.Telephone;
 }
コード例 #3
0
 public void DeleteAddressById(int id)
 {
     var obj = new ADDRESS() { ID = id };
     DeleteAddress(obj);
 }
コード例 #4
0
 public void DeleteAddress(ADDRESS Address)
 {
     Context.ADDRESS.Attach(Address);
     Context.ADDRESS.DeleteObject(Address);
 }
コード例 #5
0
 public void InsertAddress(ADDRESS address)
 {
     Context.ADDRESS.AddObject(address);
 }
コード例 #6
0
 public void UpdateAddress(ADDRESS address)
 {
     Context.ADDRESS.AddObject(address);
     Context.ObjectStateManager.ChangeObjectState(address, EntityState.Modified);
 }
コード例 #7
0
        public void ReloadControl(bool PageLoad)
        {
            ADDRESS addr = null;
            if (AddrID != 0)
            {
                if (!DisableOriginal)
                {
                    addr = ApplicationContext.Current.Customers.GetAddressById(AddrID);
                }
                else
                {
                    ADDRESSINFO a = ApplicationContext.Current.Orders.GetAddress(AddrID);
                    addr = new ADDRESS(a);
                }

                loadAddress(addr);
                if (!InOrder)
                {
                    lnkDelAddr.Visible = true;
                    imgDelete.Visible = true;
                    imgSeparator.Visible = true;
                }
            }

            if (PageLoad)
            {
                // viewstate of dropdown is enabled, so there is no need to reload it on every postback
                LoadDDLs(addr == null ? null : addr.City, addr == null ? null : addr.TypeID);
            }
            else
            {
                // ddl already loaded, the values must be re-set
                if (addr != null && addr.City.HasValue)
                {
                    ddlCities.SelectedValue = addr.City.Value.ToString();
                }

                if (addr != null && addr.TypeID.HasValue)
                {
                    ddlAddrType.SelectedValue = addr.TypeID.Value.ToString();
                }
            }
        }
コード例 #8
0
        private void loadAddress(ADDRESS addr)
        {
            txtAddress.Text = addr.Address1;
            txtLocation.Text = addr.Location;
            txtName.Text = addr.Name;
            txtPostal.Text = addr.PostCode;
            txtTel.Text = addr.Telephone;

            litName.Text = addr.Name;
            if (!String.IsNullOrWhiteSpace(addr.Telephone))
            {
                litTel.Text = "<tr><td>Tel: " + addr.Telephone + "</td></tr>";
            }
            litAddress.Text = addr.Address1;
            litOther.Text = addr.Location + ", " + (addr.CityName == null ? ddlCities.SelectedItem.Text : addr.CityName) + ", " + addr.PostCode;
        }
コード例 #9
0
        public ADDRESS GetAddress()
        {
            ADDRESS addr = new ADDRESS();
            addr.Address1 = txtAddress.Text;
            addr.Name = txtName.Text;
            addr.Location = txtLocation.Text;
            addr.PostCode = txtPostal.Text;
            addr.Telephone = txtTel.Text;

            if (ddlAddrType.SelectedValue != "-1")
            {
                addr.TypeID = Int32.Parse(ddlAddrType.SelectedValue);
            }

            if (ddlCities.SelectedValue != "-1")
            {
                addr.City = Int32.Parse(ddlCities.SelectedValue);
                addr.CityName = ddlCities.SelectedItem.Text;
            }

            addr.CustomerID = CurrentCustomer.Id;

            return addr;
        }
コード例 #10
0
        /// <summary>
        /// Writes the address.
        /// </summary>
        /// <param name="orderDettId">The order dett id.</param>
        /// <param name="phOrd">The ph ord.</param>
        /// <param name="miniTitlesFontStyleIns">The mini titles font style ins.</param>
        private static void WriteAddress(int? orderDettId, ref Phrase phOrd, Font miniTitlesFontStyleIns)
        {
            if (orderDettId.HasValue)
            {
                var addressShipp = new ADDRESS(ApplicationContext.Current.Orders.GetAddress(orderDettId.Value));
                {
                    string addSh = string.Format(
@"{0}
{1}
{2}
{3}
{4}
{5}", addressShipp.Name,
    addressShipp.Address1,
    addressShipp.Location,
    addressShipp.PostCode,
    addressShipp.StateName,
    addressShipp.Telephone);
                    phOrd = new Phrase(addSh, miniTitlesFontStyleIns);
                }
            }
            else
            {
                phOrd = new Phrase(" ", miniTitlesFontStyleIns);
            }
        }
コード例 #11
0
 public void DeleteAddress(ADDRESS Address)
 {
     _customerDAO.DeleteAddress(Address);
     Context.SaveChanges();
 }
コード例 #12
0
 public void InsertAddress(ADDRESS address)
 {
     _customerDAO.InsertAddress(address);
     Context.SaveChanges();
 }
コード例 #13
0
 public void UpdateAddress(ADDRESS address)
 {
     _customerDAO.UpdateAddress(address);
     Context.SaveChanges();
 }