public JsonResult GetAddressForAutoComplete()
        {
            var addressList = _addressLogic.GetList();
            var cities      = _cityLogic.GetList();
            var provinces   = _provinceLogic.GetList();
            var countries   = _countryLogic.GetList();

            List <ViewModel_AddressForAutoComplete> addressesForAutoComplete = new List <ViewModel_AddressForAutoComplete>();

            if (addressList.Count > 0)
            {
                foreach (var address in addressList)
                {
                    ViewModel_AddressForAutoComplete addressForAutoComplete = new ViewModel_AddressForAutoComplete();
                    addressForAutoComplete.AddressId   = address.Id;
                    addressForAutoComplete.AddressLine = (address.UnitNumber == null ? "" : address.UnitNumber + ", ") + address.AddressLine + "  (" + address.Id + ")";

                    string addressLine = "";
                    addressLine += address.UnitNumber;
                    addressLine += !string.IsNullOrEmpty(address.UnitNumber) ? ", " + address.AddressLine : address.AddressLine;
                    addressLine += !string.IsNullOrEmpty(address.AddressLine) ? ", " + cities.Find(c => c.Id == address.CityId).CityName : cities.Find(c => c.Id == address.CityId).CityName;
                    addressLine += !string.IsNullOrEmpty(address.CityId.ToString()) ? ", " + provinces.Find(c => c.Id == address.ProvinceId).ShortCode : provinces.Find(c => c.Id == address.ProvinceId).ShortCode;
                    addressLine += !string.IsNullOrEmpty(address.ProvinceId.ToString()) ? ", " + countries.Find(c => c.Id == address.CountryId).CountryName : countries.Find(c => c.Id == address.CountryId).CountryName;
                    addressLine += !string.IsNullOrEmpty(address.CountryId.ToString()) ? ", " + address.PostCode : address.PostCode;
                    addressForAutoComplete.AddressLine = addressLine.ToUpper();

                    addressesForAutoComplete.Add(addressForAutoComplete);
                }
            }

            return(Json(JsonConvert.SerializeObject(addressesForAutoComplete)));
        }
        public IActionResult Index()
        {
            ValidateSession();

            _cityLogic     = new App_CityLogic(_cache, new EntityFrameworkGenericRepository <App_CityPoco>(_dbContext));
            _provinceLogic = new App_ProvinceLogic(_cache, new EntityFrameworkGenericRepository <App_ProvincePoco>(_dbContext));
            _countryLogic  = new App_CountryLogic(_cache, new EntityFrameworkGenericRepository <App_CountryPoco>(_dbContext));
            _employeeLogic = new Lms_EmployeeLogic(_cache, new EntityFrameworkGenericRepository <Lms_EmployeePoco>(_dbContext));

            ViewBag.UserGroups = Enum.GetValues(typeof(Enum_UserGroup)).Cast <Enum_UserGroup>();
            ViewBag.Cities     = _cityLogic.GetList().Select(c => new App_CityPoco {
                Id = c.Id, CityName = c.CityName
            }).ToList();
            ViewBag.Provinces = _provinceLogic.GetList().Select(c => new App_ProvincePoco {
                Id = c.Id, ShortCode = c.ShortCode, IsDefault = c.IsDefault
            }).ToList();
            ViewBag.Countries = _countryLogic.GetList().Select(c => new App_CountryPoco {
                Id = c.Id, CountryName = c.CountryName, IsDefault = c.IsDefault
            }).ToList();
            ViewBag.Employees = _employeeLogic.GetList().Select(c => new Lms_EmployeePoco {
                Id = c.Id, FirstName = c.FirstName, LastName = c.LastName, EmailAddress = c.EmailAddress
            }).ToList();

            return(View(GetUserData()));
        }
Exemple #3
0
        private List <ViewModel_CustomerAddress> GetCustomerAddressData(int id)
        {
            List <ViewModel_CustomerAddress> customerAddressViewModel = new List <ViewModel_CustomerAddress>();

            _customerAddressLogic = new Lms_CustomerAddressMappingLogic(_cache, new EntityFrameworkGenericRepository <Lms_CustomerAddressMappingPoco>(_dbContext));
            var customerAddresses = _customerAddressLogic.GetList().Where(c => c.CustomerId == id).ToList();

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

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

            _countryLogic = new App_CountryLogic(_cache, new EntityFrameworkGenericRepository <App_CountryPoco>(_dbContext));
            var countries = _countryLogic.GetList();

            _addressLogic = new Lms_AddressLogic(_cache, new EntityFrameworkGenericRepository <Lms_AddressPoco>(_dbContext));
            var addresses = _addressLogic.GetList();

            foreach (var custAddress in customerAddresses)
            {
                ViewModel_CustomerAddress customerAddress = new ViewModel_CustomerAddress();

                var address = addresses.Where(c => c.Id == custAddress.AddressId).FirstOrDefault();
                customerAddress.CustomerId      = custAddress.CustomerId;
                customerAddress.AddressId       = custAddress.AddressId;
                customerAddress.AddressTypeId   = custAddress.AddressTypeId;
                customerAddress.AddressTypeName = customerAddress.AddressTypeId == 1 ? "Billing" : customerAddress.AddressTypeId == 2 ? "Shipping" : customerAddress.AddressTypeId == 4 ? "Warehouse" : "";

                customerAddress.IsDefault = custAddress.IsDefault;

                customerAddress.UnitNumber   = address.UnitNumber;
                customerAddress.HouseNumber  = address.HouseNumber;
                customerAddress.AddressLine  = address.AddressLine;
                customerAddress.CityId       = address.CityId;
                customerAddress.CityName     = cities.Where(c => c.Id == address.CityId).FirstOrDefault().CityName;
                customerAddress.ProvinceId   = address.ProvinceId;
                customerAddress.ProvinceName = provinces.Where(c => c.Id == address.ProvinceId).FirstOrDefault().ShortCode;
                customerAddress.CountryId    = address.CountryId;
                customerAddress.CountryName  = countries.Where(c => c.Id == address.CountryId).FirstOrDefault().CountryName;
                customerAddress.PostCode     = address.PostCode;

                customerAddress.MergedAddressLine  = !string.IsNullOrEmpty(customerAddress.UnitNumber) ? customerAddress.UnitNumber + ", " : customerAddress.UnitNumber;
                customerAddress.MergedAddressLine += !string.IsNullOrEmpty(customerAddress.AddressLine) ? customerAddress.AddressLine + ", " : customerAddress.AddressLine;
                customerAddress.MergedAddressLine += customerAddress.CityName + ", " + customerAddress.ProvinceName + ", " + customerAddress.CountryName;
                customerAddress.MergedAddressLine += !string.IsNullOrEmpty(customerAddress.PostCode) ? ", " + customerAddress.PostCode : customerAddress.PostCode;

                customerAddress.Email         = address.EmailAddress1;
                customerAddress.Phone         = address.PrimaryPhoneNumber;
                customerAddress.Fax           = address.Fax;
                customerAddress.ContactPerson = address.ContactPersonName;

                customerAddressViewModel.Add(customerAddress);
            }


            return(customerAddressViewModel);
        }
        public IActionResult Index()
        {
            var provinceList = _provinceLogic.GetList();
            var countryList  = _countryLogic.GetList();
            ViewModel_Province viewModel_Prov = new ViewModel_Province();

            viewModel_Prov.Provinces = provinceList;
            viewModel_Prov.Countries = countryList;
            return(View(viewModel_Prov));
        }
        public IActionResult Index()
        {
            var            cityList       = _cityLogic.GetList();
            var            provinceList   = _provinceLogic.GetList();
            var            countryList    = _countryLogic.GetList();
            ViewModel_City viewModel_City = new ViewModel_City();

            viewModel_City.Cities    = cityList;
            viewModel_City.Provinces = provinceList;
            viewModel_City.Countries = countryList;
            return(View(viewModel_City));
        }
        public IActionResult Index()
        {
            ValidateSession();
            _configurationLogic          = new Lms_ConfigurationLogic(_cache, new EntityFrameworkGenericRepository <Lms_ConfigurationPoco>(_dbContext));
            ViewBag.DefaultFuelSurcharge = _configurationLogic.GetSingleById(1).DefaultFuelSurcharge;

            _cityLogic        = new App_CityLogic(_cache, new EntityFrameworkGenericRepository <App_CityPoco>(_dbContext));
            ViewBag.Cities    = _cityLogic.GetList();
            _provinceLogic    = new App_ProvinceLogic(_cache, new EntityFrameworkGenericRepository <App_ProvincePoco>(_dbContext));
            ViewBag.Provinces = _provinceLogic.GetList();
            _countryLogic     = new App_CountryLogic(_cache, new EntityFrameworkGenericRepository <App_CountryPoco>(_dbContext));
            ViewBag.Countries = _countryLogic.GetList();

            return(View(GetCustomerData(0)));
        }
        private ViewModel_Employee GetEmployeeData()
        {
            ViewModel_Employee employeeViewModel = new ViewModel_Employee();

            employeeViewModel.Employees = _employeeLogic.GetList();

            _cityLogic     = new App_CityLogic(_cache, new EntityFrameworkGenericRepository <App_CityPoco>(_dbContext));
            _provinceLogic = new App_ProvinceLogic(_cache, new EntityFrameworkGenericRepository <App_ProvincePoco>(_dbContext));
            _countryLogic  = new App_CountryLogic(_cache, new EntityFrameworkGenericRepository <App_CountryPoco>(_dbContext));

            employeeViewModel.Cities    = _cityLogic.GetList();
            employeeViewModel.Provinces = _provinceLogic.GetList();
            employeeViewModel.Countries = _countryLogic.GetList();

            return(employeeViewModel);
        }
        private List <ViewModel_SearchResult_Order> GetOrdersByQuery(string filteredData)
        {
            List <ViewModel_SearchResult_Order> searchResults = new List <ViewModel_SearchResult_Order>();

            JObject queryData = new JObject();
            string  fromDate = "", toDate = "", optionForWaybill = "", waybillNumber = "", optionForBillTo = "", billToCustomerName = "", optionForShipper = "",
                    shipperCustomerName = "", optionForCctn = "", cctnRef = "", optionForActn = "", actnRef = "", optionForConsignee = "",
                    consigneeCustomerName = "", optionForDelRef = "", delRef = "", optionForPuRef = "", puRef = "", optionForOrderBy = "",
                    orderBy = "", optionForBolRef = "", bolRef = "", optionForProRef = "", proRef = "", optionForCustomerRef = "", customerRef = "";

            if (filteredData != string.Empty)
            {
                queryData           = JObject.Parse(filteredData);
                fromDate            = queryData.SelectToken("fromDate").ToString();
                toDate              = queryData.SelectToken("toDate").ToString();
                optionForWaybill    = queryData.SelectToken("optionForWaybill").ToString();
                waybillNumber       = queryData.SelectToken("waybillNumber").ToString();
                optionForBillTo     = queryData.SelectToken("optionForBillTo").ToString();
                billToCustomerName  = queryData.SelectToken("billToCustomerName").ToString();
                optionForShipper    = queryData.SelectToken("optionForShipper").ToString();
                shipperCustomerName = queryData.SelectToken("shipperCustomerName").ToString();
                optionForCctn       = queryData.SelectToken("optionForCctn").ToString();
                cctnRef             = queryData.SelectToken("cctnRef").ToString();

                optionForActn         = queryData.SelectToken("optionForActn").ToString();
                actnRef               = queryData.SelectToken("actnRef").ToString();
                optionForConsignee    = queryData.SelectToken("optionForConsignee").ToString();
                consigneeCustomerName = queryData.SelectToken("consigneeCustomerName").ToString();
                optionForDelRef       = queryData.SelectToken("optionForDelRef").ToString();
                delRef           = queryData.SelectToken("delRef").ToString();
                optionForPuRef   = queryData.SelectToken("optionForPuRef").ToString();
                puRef            = queryData.SelectToken("puRef").ToString();
                optionForOrderBy = queryData.SelectToken("optionForOrderBy").ToString();
                orderBy          = queryData.SelectToken("orderBy").ToString();
                optionForBolRef  = queryData.SelectToken("optionForBolRef").ToString();
                bolRef           = queryData.SelectToken("bolRef").ToString();

                optionForProRef = queryData.SelectToken("optionForProRef").ToString();
                proRef          = queryData.SelectToken("proRef").ToString();

                optionForCustomerRef = queryData.SelectToken("optionForCustomerRef").ToString();
                customerRef          = queryData.SelectToken("customerRef").ToString();
            }

            var orders = _orderLogic.GetList().Where(c => c.OrderTypeId == 1 && (c.TotalOrderCost + c.TotalAdditionalServiceCost) > 0).ToList();

            List <Lms_CustomerPoco> customers = new List <Lms_CustomerPoco>();

            customers = _customerLogic.GetList();

            if (fromDate != "" && toDate != "")
            {
                orders = orders.Where(c => c.ScheduledPickupDate >= Convert.ToDateTime(fromDate) && c.ScheduledPickupDate <= Convert.ToDateTime(toDate)).ToList();
            }

            if (waybillNumber.Trim() != "")
            {
                if (optionForWaybill == "1")
                {
                    orders = orders.Where(c => c.WayBillNumber.Equals(waybillNumber.Trim())).ToList();
                }
                else if (optionForWaybill == "2")
                {
                    orders = orders.Where(c => c.WayBillNumber.Contains(waybillNumber.Trim())).ToList();
                }
            }
            if (customerRef.Trim() != "")
            {
                if (optionForCustomerRef == "1")
                {
                    orders = orders.Where(c => c.ReferenceNumber != null && c.ReferenceNumber.ToUpper().Equals(customerRef.ToUpper())).ToList();
                }
                else if (optionForCustomerRef == "2")
                {
                    orders = orders.Where(c => c.ReferenceNumber != null && c.ReferenceNumber.ToUpper().Contains(customerRef.ToUpper())).ToList();
                }
            }
            if (billToCustomerName.Trim() != "")
            {
                if (optionForBillTo == "1")
                {
                    customers = new List <Lms_CustomerPoco>();
                    customers = _customerLogic.GetList().Where(c => c.CustomerName.Equals(billToCustomerName.ToUpper())).OrderBy(c => c.Id).ToList();
                    orders    = orders.Where(c => customers.Any(d => d.Id == c.BillToCustomerId)).ToList();
                }
                else if (optionForBillTo == "2")
                {
                    customers = new List <Lms_CustomerPoco>();
                    customers = _customerLogic.GetList().Where(c => c.CustomerName.ToUpper().Contains(billToCustomerName.ToUpper())).OrderBy(c => c.Id).ToList();
                    orders    = orders.Where(c => customers.Any(d => d.Id == c.BillToCustomerId)).ToList();
                }
            }
            if (shipperCustomerName.Trim() != "")
            {
                if (optionForShipper == "1")
                {
                    customers = new List <Lms_CustomerPoco>();
                    customers = _customerLogic.GetList().Where(c => c.CustomerName.ToUpper().Equals(shipperCustomerName.ToUpper())).OrderBy(c => c.Id).ToList();
                    orders    = orders.Where(c => customers.Any(d => c.ShipperCustomerId != null && d.Id == c.ShipperCustomerId)).ToList();
                }
                else if (optionForShipper == "2")
                {
                    customers = new List <Lms_CustomerPoco>();
                    customers = _customerLogic.GetList().Where(c => c.CustomerName.ToUpper().Contains(shipperCustomerName.ToUpper())).OrderBy(c => c.Id).ToList();
                    orders    = orders.Where(c => customers.Any(d => c.ShipperCustomerId != null && d.Id == c.ShipperCustomerId)).ToList();
                }
            }
            if (consigneeCustomerName.Trim() != "")
            {
                if (optionForConsignee == "1")
                {
                    customers = new List <Lms_CustomerPoco>();
                    customers = _customerLogic.GetList().Where(c => c.CustomerName.ToUpper().Equals(consigneeCustomerName.ToUpper())).OrderBy(c => c.Id).ToList();
                    orders    = orders.Where(c => customers.Any(d => c.ConsigneeCustomerId != null && d.Id == c.ConsigneeCustomerId)).ToList();
                }
                else if (optionForConsignee == "2")
                {
                    customers = new List <Lms_CustomerPoco>();
                    customers = _customerLogic.GetList().Where(c => c.CustomerName.ToUpper().Contains(consigneeCustomerName.ToUpper())).OrderBy(c => c.Id).ToList();
                    orders    = orders.Where(c => customers.Any(d => c.ConsigneeCustomerId != null && d.Id == c.ConsigneeCustomerId)).ToList();
                }
            }
            if (cctnRef.Trim() != "")
            {
                if (optionForCctn == "1")
                {
                    orders = orders.Where(c => c.CargoCtlNumber != null && c.CargoCtlNumber.ToUpper().Equals(cctnRef.ToUpper())).ToList();
                }
                else if (optionForCctn == "2")
                {
                    orders = orders.Where(c => c.CargoCtlNumber != null && c.CargoCtlNumber.ToUpper().Contains(cctnRef.ToUpper())).ToList();
                }
            }
            if (actnRef.Trim() != "")
            {
                if (optionForActn == "1")
                {
                    orders = orders.Where(c => c.AwbCtnNumber != null && c.AwbCtnNumber.ToUpper().Equals(actnRef.ToUpper())).ToList();
                }
                else if (optionForActn == "2")
                {
                    orders = orders.Where(c => c.AwbCtnNumber != null && c.AwbCtnNumber.ToUpper().Contains(actnRef.ToUpper())).ToList();
                }
            }
            if (delRef.Trim() != "")
            {
                if (optionForDelRef == "1")
                {
                    orders = orders.Where(c => c.DeliveryReferenceNumber != null && c.DeliveryReferenceNumber.ToUpper().Equals(delRef.ToUpper())).ToList();
                }
                else if (optionForDelRef == "2")
                {
                    orders = orders.Where(c => c.DeliveryReferenceNumber != null && c.DeliveryReferenceNumber.ToUpper().Contains(delRef.ToUpper())).ToList();
                }
            }
            if (puRef.Trim() != "")
            {
                if (optionForPuRef == "1")
                {
                    orders = orders.Where(c => c.PickupReferenceNumber != null && c.PickupReferenceNumber.ToUpper().Equals(puRef.ToUpper())).ToList();
                }
                else if (optionForPuRef == "2")
                {
                    orders = orders.Where(c => c.PickupReferenceNumber != null && c.PickupReferenceNumber.ToUpper().Contains(puRef.ToUpper())).ToList();
                }
            }
            if (orderBy.Trim() != "")
            {
                if (orderBy == "1")
                {
                    orders = orders.Where(c => c.OrderedBy != null && c.OrderedBy.ToUpper().Equals(orderBy.ToUpper())).ToList();
                }
                else if (orderBy == "2")
                {
                    orders = orders.Where(c => c.OrderedBy != null && c.OrderedBy.ToUpper().Contains(orderBy.ToUpper())).ToList();
                }
            }
            if (bolRef.Trim() != "")
            {
                if (orderBy == "1")
                {
                    orders = orders.Where(c => c.BolReferenceNumber != null && c.BolReferenceNumber.ToUpper().Equals(bolRef.ToUpper())).ToList();
                }
                else if (orderBy == "2")
                {
                    orders = orders.Where(c => c.BolReferenceNumber != null && c.BolReferenceNumber.ToUpper().Contains(bolRef.ToUpper())).ToList();
                }
            }
            if (proRef.Trim() != "")
            {
                if (orderBy == "1")
                {
                    orders = orders.Where(c => c.ProReferenceNumber != null && c.ProReferenceNumber.ToUpper().Equals(proRef.ToUpper())).ToList();
                }
                else if (orderBy == "2")
                {
                    orders = orders.Where(c => c.ProReferenceNumber != null && c.ProReferenceNumber.ToUpper().Contains(proRef.ToUpper())).ToList();
                }
            }

            customers = _customerLogic.GetList();
            var employees = _employeeLogic.GetList();
            var addresses = _addressLogic.GetList();

            var unitTypes      = _unitTypeLogic.GetList();
            var weightScales   = _weightScaleLogic.GetList();
            var deliveyOptions = _deliveryOptionLogic.GetList();
            var vehicleTypes   = _vehicleTypeScaleLogic.GetList();

            var cities    = _cityLogic.GetList();
            var provinces = _provinceLogic.GetList();
            var countries = _countryLogic.GetList();

            foreach (var order in orders)
            {
                var resultModel = new ViewModel_SearchResult_Order();
                resultModel.OrderId     = order.Id;
                resultModel.OrderTypeId = order.OrderTypeId;

                resultModel.OrderId                 = order.OrderTypeId;
                resultModel.OrderTypeId             = order.OrderTypeId;
                resultModel.WayBillNumber           = order.WayBillNumber;
                resultModel.ReferenceNumber         = order.ReferenceNumber;
                resultModel.CargoCtlNumber          = order.CargoCtlNumber;
                resultModel.AwbCtnNumber            = order.AwbCtnNumber;
                resultModel.PickupReferenceNumber   = order.PickupReferenceNumber;
                resultModel.DeliveryReferenceNumber = order.DeliveryReferenceNumber;

                resultModel.ShipperCustomerId = order.ShipperCustomerId;
                if (resultModel.ShipperCustomerId != null && resultModel.ShipperCustomerId > 0)
                {
                    resultModel.ShipperCustomerName = customers.Where(c => c.Id == resultModel.ShipperCustomerId).FirstOrDefault().CustomerName;
                }


                resultModel.ShipperAddressId = order.ShipperAddressId;
                if (resultModel.ShipperAddressId != null && resultModel.ShipperAddressId > 0)
                {
                    var address = addresses.Where(c => c.Id == resultModel.ShipperAddressId).FirstOrDefault();
                    resultModel.ShipperUnitNumber  = address.UnitNumber;
                    resultModel.ShipperAddressLine = address.AddressLine;
                    if (address.CityId > 0)
                    {
                        resultModel.ShipperCityName = cities.Where(c => c.Id == address.CityId).FirstOrDefault().CityName;
                    }

                    if (address.ProvinceId > 0)
                    {
                        resultModel.ShipperProvinceName = provinces.Where(c => c.Id == address.ProvinceId).FirstOrDefault().ShortCode;
                    }

                    if (address.CountryId > 0)
                    {
                        resultModel.ShipperCountryName = countries.Where(c => c.Id == address.CountryId).FirstOrDefault().Alpha3CountryCode;
                    }

                    resultModel.ShipperPostCode = address.PostCode;
                }


                resultModel.ConsigneeCustomerId = order.ConsigneeCustomerId;
                if (resultModel.ConsigneeCustomerId != null && resultModel.ConsigneeCustomerId > 0)
                {
                    resultModel.ConsigneeCustomerName = customers.Where(c => c.Id == resultModel.ConsigneeCustomerId).FirstOrDefault().CustomerName;
                }

                resultModel.ConsigneeAddressId = order.ConsigneeAddressId;
                if (resultModel.ConsigneeAddressId != null && resultModel.ConsigneeAddressId > 0)
                {
                    var address = addresses.Where(c => c.Id == resultModel.ConsigneeAddressId).FirstOrDefault();
                    resultModel.ConsigneeUnitNumber  = address.UnitNumber;
                    resultModel.ConsigneeAddressLine = address.AddressLine;
                    if (address.CityId > 0)
                    {
                        resultModel.ConsigneeCityName = cities.Where(c => c.Id == address.CityId).FirstOrDefault().CityName;
                    }

                    if (address.ProvinceId > 0)
                    {
                        resultModel.ConsigneeProvinceName = provinces.Where(c => c.Id == address.ProvinceId).FirstOrDefault().ShortCode;
                    }

                    if (address.CountryId > 0)
                    {
                        resultModel.ConsigneeCountryName = countries.Where(c => c.Id == address.CountryId).FirstOrDefault().Alpha3CountryCode;
                    }

                    resultModel.ConsigneePostCode = address.PostCode;
                }

                resultModel.BillToCustomerId = order.BillToCustomerId;
                if (resultModel.BillToCustomerId > 0)
                {
                    resultModel.BillToCustomerName = customers.Where(c => c.Id == resultModel.BillToCustomerId).FirstOrDefault().CustomerName;
                }

                resultModel.ServiceProviderEmployeeId = order.ServiceProviderEmployeeId;
                if (resultModel.ServiceProviderEmployeeId > 0)
                {
                    var emp = employees.Where(c => c.Id == resultModel.ServiceProviderEmployeeId).FirstOrDefault();
                    resultModel.ServiceProviderEmployeeName = emp.FirstName + " " + emp.LastName;
                }


                resultModel.ScheduledPickupDate  = order.ScheduledPickupDate;
                resultModel.ExpectedDeliveryDate = order.ExpectedDeliveryDate;
                resultModel.CityId = order.CityId;
                if (resultModel.CityId > 0)
                {
                    resultModel.CityName = cities.Where(c => c.Id == resultModel.CityId).FirstOrDefault().CityName;
                }

                resultModel.DeliveryOptionId = order.DeliveryOptionId;
                if (resultModel.DeliveryOptionId > 0)
                {
                    resultModel.DeliveryOptionName = deliveyOptions.Where(c => c.Id == resultModel.DeliveryOptionId).FirstOrDefault().ShortCode;
                }

                resultModel.VehicleTypeId = order.VehicleTypeId;
                if (resultModel.VehicleTypeId > 0)
                {
                    resultModel.VehicleTypeName = vehicleTypes.Where(c => c.Id == resultModel.VehicleTypeId).FirstOrDefault().TypeName;
                }

                resultModel.UnitTypeId = order.UnitTypeId;
                if (resultModel.UnitTypeId > 0)
                {
                    resultModel.UnitTypeName = unitTypes.Where(c => c.Id == resultModel.UnitTypeId).FirstOrDefault().TypeName;
                }

                resultModel.WeightScaleId = order.WeightScaleId;
                if (resultModel.WeightScaleId > 0)
                {
                    resultModel.WeightScaleName = weightScales.Where(c => c.Id == resultModel.WeightScaleId).FirstOrDefault().ShortCode;
                }

                resultModel.WeightTotal  = order.WeightTotal;
                resultModel.UnitQuantity = order.UnitQuantity;
                resultModel.SkidQuantity = order.SkidQuantity;
                resultModel.TotalPiece   = order.TotalPiece;

                resultModel.OrderBasicCost             = order.OrderBasicCost;
                resultModel.BasicCostOverriden         = order.BasicCostOverriden;
                resultModel.FuelSurchargePercentage    = order.FuelSurchargePercentage;
                resultModel.DiscountPercentOnOrderCost = order.DiscountPercentOnOrderCost;
                resultModel.ApplicableGstPercent       = order.ApplicableGstPercent;
                resultModel.TotalOrderCost             = order.TotalOrderCost;
                resultModel.TotalAdditionalServiceCost = order.TotalAdditionalServiceCost;

                resultModel.OrderedBy   = order.OrderedBy;
                resultModel.DeliveredBy = order.DeliveredBy;

                resultModel.BolReferenceNumber = order.BolReferenceNumber;
                resultModel.ProReferenceNumber = order.ProReferenceNumber;
                resultModel.ShipperName        = order.ShipperName;
                resultModel.ShipperAddress     = order.ShipperAddress;
                resultModel.OrderShareAmount   = order.OrderShareAmount;
                resultModel.IsSharingOnPercent = order.IsSharingOnPercent;

                resultModel.IsInvoiced         = order.IsInvoiced;
                resultModel.CommentsForWayBill = order.CommentsForWayBill;
                resultModel.IsPrintedOnWayBill = order.IsPrintedOnWayBill;
                resultModel.CommentsForInvoice = order.CommentsForInvoice;
                resultModel.IsPrintedOnInvoice = order.IsPrintedOnInvoice;

                resultModel.IsPrePrinted    = order.IsPrePrinted;
                resultModel.Remarks         = order.Remarks;
                resultModel.OrderDateString = order.CreateDate.ToString("dd-MMM-yyyy");

                searchResults.Add(resultModel);
            }

            return(searchResults);
        }
Exemple #9
0
        public IActionResult Index()
        {
            var customerList = _countryLogic.GetList();

            return(View());
        }