Esempio n. 1
0
 public IActionResult TestFindAdr(DeliveryAreaAddressTestVM model)
 {
     model = service.DeliveryAreaAddressFindTest(model);
     SetViewBagPersonAddress();
     ModelState.Clear();
     return(View(nameof(TestFindAdr), model));
 }
Esempio n. 2
0
        public IActionResult TestFindAdr()
        {
            DeliveryAreaAddressTestVM model = new DeliveryAreaAddressTestVM();

            model.Address          = new Address();
            model.Address.CityCode = "12259";
            SetViewBagPersonAddress();
            return(View(nameof(TestFindAdr), model));
        }
Esempio n. 3
0
        public DeliveryAreaAddressTestVM DeliveryAreaAddressFindTest(DeliveryAreaAddressTestVM model)
        {
            var deliveryAreaFindVM = DeliveryAreaAddressFind(model.Address);
            var deliveryAddr       = deliveryAreaFindVM.DeliveryAreaAddressList.FirstOrDefault() ?? new DeliveryAreaAddress();

            model.AreaName = deliveryAddr.DeliveryArea?.Description;
            int?lawUnitId = deliveryAddr.DeliveryArea?.LawUnitId;

            model.LawUnitName = repo.AllReadonly <LawUnit>()
                                .Where(x => x.Id == lawUnitId)
                                .Select(x => x.FullName)
                                .FirstOrDefault();
            model.City            = repo.AllReadonly <EkEkatte>().Where(c => c.Ekatte == deliveryAddr.CityCode).Select(EkatteCityName()).FirstOrDefault();
            model.Street          = repo.AllReadonly <EkStreet>().Where(s => s.Code == deliveryAddr.StreetCode && s.Ekatte == deliveryAddr.CityCode).Select(c => c.Name).FirstOrDefault();
            model.ResidentionArea = repo.AllReadonly <EkStreet>().Where(s => s.Code == deliveryAddr.ResidentionAreaCode && s.Ekatte == deliveryAddr.CityCode).Select(c => c.Name).FirstOrDefault();
            model.NumberType      = repo.AllReadonly <DeliveryNumberType>().Where(n => n.Id == deliveryAddr.NumberType).Select(c => c.Label).FirstOrDefault();
            model.NumberFrom      = deliveryAddr.NumberFrom?.ToString();
            model.NumberTo        = deliveryAddr.NumberTo?.ToString();

            return(model);
        }