示例#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 POSAccount.Contract.Address
            {
                AddressLinkID = branchItem.BranchCode,
                AddressType   = "Branch"
            };

            branchItem.BranchAddress = new AddressDAL().GetContactsByCustomer(contactItem).FirstOrDefault();



            return(branchItem);
        }
示例#2
0
        public IContract GetItem <T>(IContract lookupItem) where T : IContract
        {
            var item = ((Customer)lookupItem);

            var customerItem = db.ExecuteSprocAccessor(DBRoutine.SELECTCUSTOMER,
                                                       MapBuilder <Customer>
                                                       .MapAllProperties()
                                                       .DoNotMap(c => c.CustomerAddress)
                                                       .Build(),
                                                       ((Customer)lookupItem).CustomerCode).FirstOrDefault();

            if (customerItem == null)
            {
                return(null);
            }
            var contactItem = new POSAccount.Contract.Address
            {
                AddressLinkID = customerItem.CustomerCode,
                AddressType   = "Customer"
            };

            customerItem.CustomerAddress = new AddressDAL().GetContactsByCustomer(contactItem).FirstOrDefault();



            return(customerItem);
        }
示例#3
0
        public Address GetBankAddress(Bank bankItem)
        {
            var contactItem = new POSAccount.Contract.Address
            {
                AddressLinkID = bankItem.BankCode,
                AddressType   = "Bank"
            };

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


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

            return(currentAddress);
        }
示例#4
0
        public Address GetDebtorAddress(Debtor debtorItem)
        {
            var contactitem = new POSAccount.Contract.Address
            {
                AddressLinkID = debtorItem.DebtorCode,
                AddressType   = "Debtor"
            };

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


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

            return(currentAddress);
        }