示例#1
0
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }

            var adapter = _repo.GetById((int)id);

            if (adapter == null)
            {
                return(HttpNotFound());
            }

            //Alternative to populate dropdownlist, see "Edit View"
            //SetAdapterType2();

            var adapterViewModel = new AdapterBasicViewModel()
            {
                Id               = adapter.Id,
                AdapterName      = adapter.AdapterName,
                AdapterTypeId    = adapter.AdapterTypeId,
                IsActive         = adapter.IsActive,
                ModifiedDate     = adapter.ModifiedDate,
                RegistrationDate = adapter.RegistrationDate,

                AdapterTypeList = GetAdapterTypes()
            };

            return(View(adapterViewModel));
        }
示例#2
0
        public ActionResult Details(int id)
        {
            var adapterType = _adapterTypesRepo.GetById(id);
            AdapterTypeViewModel adapterTypeViewModel = new AdapterTypeViewModel()
            {
                AdapterType = adapterType.AdapterType,
                Id          = adapterType.Id
            };

            return(View(adapterTypeViewModel));
        }
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }

            var adapter = _repo.GetById((int)id);

            if (adapter == null)
            {
                return(HttpNotFound());
            }

            //SetAdapterType();
            SetAdapterType2();
            return(View(adapter));
        }