Exemple #1
0
        // GET: Store/Edit/5
        public ActionResult EditStore(int id)
        {
            Store          store    = storeService.GetByID(id);
            var            address  = addressService.GetAddressBystoreId(id).SingleOrDefault();
            StoreViewModel dropdown = new StoreViewModel
            {
                StoreId             = store.StoreId,
                StoreName           = store.StoreName,
                Contact             = store.Contact,
                CompanyId           = store.Company.CompanyId,
                UserId              = store.UserId,
                IdentificationImage = store.IdentificationImage,
                City    = address.City,
                Country = address.Country,
                Street  = address.Street
            };

            dropdown.CompanyList = companyService.GetAll().
                                   Select(p => new CompanyViewModel {
                CompanyId = p.CompanyId, CompanyName = p.CompanyName
            }).
                                   ToList();

            return(View(dropdown));
        }