Exemplo n.º 1
0
        public List <Addresses> GetAddresses()
        {
            List <Addresses> retVal = new List <Addresses>();

            try
            {
                AddressesBL addresses = new AddressesBL(_connString);
                tblAddresses = addresses.GetAddresses();

                if (tblAddresses != null && tblAddresses.Rows.Count > 0)
                {
                    foreach (DataRow row in tblAddresses.Rows)
                    {
                        Addresses address = new Addresses(_connString, Utils.DBNullToGuid(row["Address_ID"]));
                        retVal.Add(address);
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return(retVal);
        }
Exemplo n.º 2
0
        public bool Update_Address(Guid address_ID, Guid user_ID)
        {
            bool retVal = false;

            try
            {
                AddressesBL addresses = new AddressesBL(_connString);
                retVal = addresses.Update_Address(address_ID, _address_1, _address_2, _address_Town, _address_City, _address_County, _address_Postcode, _deleteAddress, user_ID);
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return(retVal);
        }
Exemplo n.º 3
0
        public Guid?Insert_Address(Guid user_ID)
        {
            Guid?retVal = null;

            try
            {
                AddressesBL addresses = new AddressesBL(_connString);
                retVal = addresses.Insert_Address(_address_1, _address_2, _address_Town, _address_City, _address_County, _address_Postcode, user_ID);
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return(retVal);
        }
Exemplo n.º 4
0
        public Addresses(Guid address_ID)
        {
            AddressesBL addresses = new AddressesBL();
            tblAddresses = addresses.GetAddressByAddress_ID(address_ID);

            Address_ID = address_ID;
            Address_1 = tblAddresses[0].Address_1;
            if (!tblAddresses[0].IsAddress_2Null())
                Address_2 = tblAddresses[0].Address_2;
            if (!tblAddresses[0].IsAddress_TownNull())
                Address_Town = tblAddresses[0].Address_Town;
            if (!tblAddresses[0].IsAddress_CityNull())
                Address_City = tblAddresses[0].Address_City;
            if (!tblAddresses[0].IsAddress_CountyNull())
                Address_County = tblAddresses[0].Address_County;
            if (!tblAddresses[0].IsAddress_PostcodeNull())
                Address_Postcode = tblAddresses[0].Address_Postcode;
        }
Exemplo n.º 5
0
        public Addresses(string connString, Guid address_ID)
        {
            _connString = connString;

            try
            {
                AddressesBL addresses = new AddressesBL(_connString);
                tblAddresses = addresses.GetAddressByAddress_ID(address_ID);
                DataRow row = tblAddresses.Rows[0];

                _address_ID       = address_ID;
                _address_1        = Utils.DBNullToString(row["Address_1"]);
                _address_2        = Utils.DBNullToString(row["Address_2"]);
                _address_Town     = Utils.DBNullToString(row["Address_Town"]);
                _address_City     = Utils.DBNullToString(row["Address_City"]);
                _address_County   = Utils.DBNullToString(row["Address_County"]);
                _address_Postcode = Utils.DBNullToString(row["Address_Postcode"]);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Exemplo n.º 6
0
        public bool Update_Address(Guid address_ID, Guid user_ID)
        {
            bool success = false;

            AddressesBL addresses = new AddressesBL();
            success = addresses.Update_Address(address_ID, Address_1, Address_2, Address_Town, Address_City, Address_County,
                Address_Postcode, DeleteAddress, user_ID);

            return success;
        }
Exemplo n.º 7
0
        public Guid? Insert_Address(Guid user_ID)
        {
            AddressesBL addresses = new AddressesBL();
            Guid? newID = (Guid?)addresses.Insert_Address(Address_1, Address_2, Address_Town,
                Address_City, Address_County, Address_Postcode, user_ID);

            return newID;
        }
Exemplo n.º 8
0
        public List<Addresses> GetAddressesLikeAddress_Town(string address_Town)
        {
            List<Addresses> addressList = new List<Addresses>();
            AddressesBL addresses = new AddressesBL();
            tblAddresses = addresses.GetAddressesLikeAddress_Town(address_Town);

            if (tblAddresses != null && tblAddresses.Count > 0)
            {
                foreach (sss.tblAddressesRow row in tblAddresses)
                {
                    Addresses address = new Addresses(row.Address_ID);
                    addressList.Add(address);
                }
            }

            return addressList;
        }