public List <Accessorial> GetNonCommercialAccessorials()
 {
     using (ISession session = SessionFactory.Create())
     {
         List <AccessorialModel> accessorialModels = RepositoriyFactory.GetRepo <IAccessorialRepository>(session).GetNonSpecificAccessorials();
         return(AccessorialMapper.MapToAccessorials(accessorialModels));
     }
 }
 public List <GeneralType> GetPackageType()
 {
     using (ISession session = SessionFactory.Create())
     {
         List <PackageTypeModel> packageTypeModel = RepositoriyFactory.GetRepo <IPackageTypeRepository>(session).GetPackageTypes().Where(x => x.IsHandlingUnitOnly == true).ToList();
         return(GeneralTypeMapper.MapPackageToGeneralTypes(packageTypeModel));
     }
 }
 public List <Accessorial> GetDestinationSiteAccessorials()
 {
     using (ISession session = SessionFactory.Create())
     {
         List <AccessorialModel> accessorialModels = RepositoriyFactory.GetRepo <IAccessorialRepository>(session).GetDestinationSiteAccessorials();
         return(AccessorialMapper.MapToAccessorials(accessorialModels));
     }
 }
 public List <GeneralType> GetFreightClass()
 {
     using (ISession session = SessionFactory.Create())
     {
         List <FreightClassModel> freightClasses = RepositoriyFactory.GetRepo <IFreightClassRepository>(session).FreightClasses();
         return(GeneralTypeMapper.MapFreightClassesToGeneralTypes(freightClasses));
     }
 }
 public List <DisabledDate> GetDisabledDates()
 {
     using (ISession session = SessionFactory.Create())
     {
         List <HolidayModel> holidays = RepositoriyFactory.GetRepo <IHolidayRepository>(session).GetHolidays();
         return(HolidayMapper.MapToDisabledDates(holidays));
     }
 }
 public CustomerInfo GetCustomerInfo(String email)
 {
     using (ISession session = SessionFactory.Create())
     {
         UserPersonalInfoModel userPersonalInfoModel = RepositoriyFactory.GetRepo <IUserPersonalInfoRepositoriy>(session).GetUserPersonalInfo(email);
         CustomerUserModel     customerUser          = RepositoriyFactory.GetRepo <ICustomerUserRepository>(session).GetCustomerUser(userPersonalInfoModel.UserPersonalInfoId);
         CustomerModel         customer = RepositoriyFactory.GetRepo <ICustomerRepository>(session).GetCustomer(customerUser.CustomerId);
         return(CustomerMapper.MapToCustomerInfo(customer));
     }
 }
        public Address GetBillingAddress(String email)
        {
            using (ISession session = SessionFactory.Create())
            {
                UserPersonalInfoModel userPersonalInfoModel = RepositoriyFactory.GetRepo <IUserPersonalInfoRepositoriy>(session).GetUserPersonalInfo(email);
                CustomerUserModel     customerUser          = RepositoriyFactory.GetRepo <ICustomerUserRepository>(session).GetCustomerUser(userPersonalInfoModel.UserPersonalInfoId);
                CustomerModel         customer         = RepositoriyFactory.GetRepo <ICustomerRepository>(session).GetCustomer(customerUser.CustomerId);
                AddressModel          billingAddress   = RepositoriyFactory.GetRepo <IAddressRepositoriy>(session).GetBilllingAddress("CustomerId", customerUser.CustomerId);
                AddressModel          dedicatedAddress = RepositoriyFactory.GetRepo <IAddressRepositoriy>(session).GetDedicatedAddress(customerUser.CustomerId);

                AddressModel address = (customer.IsThirdPartyBillingEnabled == true) ? dedicatedAddress : billingAddress;

                LocationModel       location = RepositoriyFactory.GetRepo <ILocationRepository>(session).GetLocation(address.AddressId);
                AddressContactModel contact  = RepositoriyFactory.GetRepo <IAddressContactRepositoriy>(session).GetContactPerson(address.AddressId);
                return(BillingAddressMapper.GetBillingAddress(location, contact, address));
            }
        }