Exemple #1
0
        public async Task <ActionResult> EditOwner(int?id)
        {
            if (id is null)
            {
                return(HttpNotFound());
            }
            var owner = await ownerRepository.Get((int)id);

            var sexList        = new SelectList(this.InitSexList(), owner.Gender);
            var documentList   = typeDocumentRepository.GetAll();
            var editOwnerModel = new EditOwnerViewModel()
            {
                Id             = owner.Id,
                BirthDay       = owner.BirthDay,
                DocumentNumber = owner.DocumentNumber,
                DocumentSerial = owner.DocumentSerial,
                Name           = owner.Name,
                Surname        = owner.Surname,
                MiddleName     = owner.MiddleName,
                Gender         = sexList,
                DocumentType   = new SelectList(documentList, "Id", "Name", owner.DocumentId)
            };

            return(View(editOwnerModel));
        }
        /// <summary>
        /// Индексная страница со списком Районов
        /// </summary>
        /// <returns></returns>
        public ActionResult Index(int?page)
        {
            int pageNumber = (page ?? 1);
            var listTypes  = typeDocumentRepository.GetAll().ToList().ToPagedList(pageNumber, _pageSize);

            return(View(listTypes));
        }