コード例 #1
0
ファイル: AddressRepository.cs プロジェクト: ArsalanWahid/ACM
        public IEnumerable<address> RetrieveByCustomerId(int customerId)
        {
            // Code that retrieves the defined addresses
            // for the customer.

            // Temporary hard coded values to return
            // a set of addresses for a customer
            var addressList = new List<address>();
            address address = new address(1)
            {
                addressType = 1,
                streetLine1 = "zulfiqar",
                streetLine2 = "12",
                city = "karachi",
                state = "sindh",
                country = "pakistan",
                postalCode = "75500"
            };
            addressList.Add(address);

            address = new address(2)
            {
                addressType = 1,
                streetLine1 = "valencia",
                streetLine2 = "c-block",
                city = "lahore",
                state = "punjab",
                country = "pakistan",
                postalCode = "755"
            };
            addressList.Add(address);

            return addressList;
        }
コード例 #2
0
ファイル: AddressRepository.cs プロジェクト: ArsalanWahid/ACM
        /// <summary>
        /// Retrieve one address.
        /// </summary>
        public address Retrieve(int addressId)
        {
            // Create the instance of the Address class
            // Pass in the requested Id
            address address = new address(addressId);

            // Code that retrieves the defined address

            // Temporary hard coded values to return
            // a populated address
            if (addressId == 1)
            {
                address.addressType = 1;
                address.streetLine1 = "Bag End";
                address.streetLine2 = "Bagshot row";
                address.city = "Hobbiton";
                address.state = "Shire";
                address.country = "Middle Earth";
                address.postalCode = "144";

            }
            return address;
        }
コード例 #3
0
ファイル: AddressRepository.cs プロジェクト: ArsalanWahid/ACM
        /// <summary>
        /// Saves the current address.
        /// </summary>
        /// <returns></returns>
        public bool Save(address address)
        {
            // Code that saves the defined address

            return true;
        }