示例#1
0
        public IActionResult Index()
        {
            var serviceList = _additionalServiceLogic.GetList();

            return(View(serviceList));
        }
        public IActionResult Index()
        {
            var customerList = _additionalServiceLogic.GetList();

            return(View());
        }
示例#3
0
        private ViewModel_MiscellaneousOrder GetMiscellaneousOrders()
        {
            ViewModel_MiscellaneousOrder miscOrderViewModel = new ViewModel_MiscellaneousOrder();

            _cityLogic = new App_CityLogic(_cache, new EntityFrameworkGenericRepository <App_CityPoco>(_dbContext));
            miscOrderViewModel.Cities = _cityLogic.GetList();

            _provinceLogic = new App_ProvinceLogic(_cache, new EntityFrameworkGenericRepository <App_ProvincePoco>(_dbContext));
            miscOrderViewModel.Provinces = _provinceLogic.GetList();

            _configurationLogic = new Lms_ConfigurationLogic(_cache, new EntityFrameworkGenericRepository <Lms_ConfigurationPoco>(_dbContext));
            miscOrderViewModel.Configuration = _configurationLogic.GetList().FirstOrDefault();

            _customerLogic = new Lms_CustomerLogic(_cache, new EntityFrameworkGenericRepository <Lms_CustomerPoco>(_dbContext));
            miscOrderViewModel.Customers = _customerLogic.GetList();

            _deliveryOptionLogic = new Lms_DeliveryOptionLogic(_cache, new EntityFrameworkGenericRepository <Lms_DeliveryOptionPoco>(_dbContext));
            miscOrderViewModel.DeliveryOptions = _deliveryOptionLogic.GetList();

            _unitTypeLogic = new Lms_UnitTypeLogic(_cache, new EntityFrameworkGenericRepository <Lms_UnitTypePoco>(_dbContext));
            miscOrderViewModel.UnitTypes = _unitTypeLogic.GetList();

            _weightScaleLogic = new Lms_WeightScaleLogic(_cache, new EntityFrameworkGenericRepository <Lms_WeightScalePoco>(_dbContext));
            miscOrderViewModel.WeightScales = _weightScaleLogic.GetList();

            _additionalServiceLogic = new Lms_AdditionalServiceLogic(_cache, new EntityFrameworkGenericRepository <Lms_AdditionalServicePoco>(_dbContext));
            miscOrderViewModel.AdditionalServices = _additionalServiceLogic.GetList();

            _employeeLogic = new Lms_EmployeeLogic(_cache, new EntityFrameworkGenericRepository <Lms_EmployeePoco>(_dbContext));
            miscOrderViewModel.Employees = _employeeLogic.GetList().Where(c => c.EmployeeTypeId == 5).ToList(); // Load employees 'Broker'

            var orders = _orderLogic.GetList().Where(c => c.OrderTypeId == 3).ToList();                         // Load only misc. orders

            List <ViewModel_OrderDispatched> viewModelOrders = new List <ViewModel_OrderDispatched>();

            foreach (var item in orders)
            {
                ViewModel_OrderDispatched viewModelOrder = new ViewModel_OrderDispatched();
                viewModelOrder.OrderId                   = item.Id;
                viewModelOrder.OrderTypeId               = item.OrderTypeId;
                viewModelOrder.OrderTypeFlag             = "Misc.";
                viewModelOrder.ServiceProviderEmployeeId = item.ServiceProviderEmployeeId;
                if (item.ServiceProviderEmployeeId != null && item.ServiceProviderEmployeeId > 0)
                {
                    viewModelOrder.ServiceProviderEmployeeName = (miscOrderViewModel.Employees.Where(c => c.Id == item.ServiceProviderEmployeeId).FirstOrDefault()).FirstName;
                }
                viewModelOrder.WayBillNumber   = item.WayBillNumber;
                viewModelOrder.OrderDateString = item.CreateDate.ToString("dd-MMM-yy");

                viewModelOrder.CustomerRefNumber = item.ReferenceNumber;
                viewModelOrder.UnitTypeId        = item.UnitTypeId;
                if (item.UnitTypeId > 0)
                {
                    viewModelOrder.UnitTypeName = miscOrderViewModel.UnitTypes.Where(c => c.Id == viewModelOrder.UnitTypeId).FirstOrDefault().ShortCode;
                }
                viewModelOrder.UnitQuantity     = item.UnitQuantity;
                viewModelOrder.SkidQuantity     = item.SkidQuantity;
                viewModelOrder.TotalPiece       = item.TotalPiece;
                viewModelOrder.SpcIns           = "";
                viewModelOrder.BillerCustomerId = item.BillToCustomerId;
                if (item.BillToCustomerId > 0)
                {
                    viewModelOrder.BillerCustomerName = miscOrderViewModel.Customers.Where(c => c.Id == viewModelOrder.BillerCustomerId).FirstOrDefault().CustomerName;
                }

                viewModelOrders.Add(viewModelOrder);
            }

            miscOrderViewModel.MiscellaneousOrders = viewModelOrders;

            return(miscOrderViewModel);
        }