Exemplo n.º 1
0
        public IContract GetItem <T>(IContract lookupItem) where T : IContract
        {
            var item = ((Branch)lookupItem);

            var branchItem = db.ExecuteSprocAccessor(DBRoutine.SELECTBRANCH,
                                                     MapBuilder <Branch>
                                                     .MapAllProperties()
                                                     .DoNotMap(b => b.BranchAddress)
                                                     .Build()
                                                     ,
                                                     item.BranchCode).FirstOrDefault();


            if (branchItem == null)
            {
                return(null);
            }
            var contactItem = new NetStock.Contract.Address
            {
                AddressLinkID = branchItem.BranchCode,
                AddressType   = "Branch"
            };

            branchItem.BranchAddress = new AddressDAL().GetContactsByCustomer(contactItem).FirstOrDefault();
            return(branchItem);
        }
Exemplo n.º 2
0
        public Address GetCustomerAddress(Customer companyItem)
        {
            var contactItem = new NetStock.Contract.Address
            {
                AddressLinkID = companyItem.CustomerCode,
                AddressType   = companyItem.CustomerType
            };

            var currentAddress = new AddressDAL().GetContactsByCustomer(contactItem).FirstOrDefault();

            return(currentAddress);
        }
Exemplo n.º 3
0
        public Address GetCompanyAddress(Company companyItem)
        {
            var contactItem = new NetStock.Contract.Address
            {
                AddressLinkID = companyItem.CompanyCode,
                AddressType   = "Company"
            };

            var currentAddress = new AddressDAL().GetContactsByCustomer(contactItem).FirstOrDefault();


            //companyItem.ContactItem =  new ContactDAL().GetItem(contactItem);

            return(currentAddress);
        }
Exemplo n.º 4
0
        public Address GetDebtorAddress(Debtor debtorItem)
        {
            var contactitem = new NetStock.Contract.Address
            {
                AddressLinkID = debtorItem.DebtorCode,
                AddressType   = "Debtor"
            };

            var currentAddress = new AddressDAL().GetContactsByCustomer(contactitem).FirstOrDefault();


            //companyItem.ContactItem =  new ContactDAL().GetItem(contactItem);

            return(currentAddress);
        }