Пример #1
0
        //
        // GET: /Directory/
        public ActionResult List()
        {
            var srv = CompositionRoot.Resolve <IFileStatusService>();
            List <FileStatusModel> items = new List <FileStatusModel>();

            foreach (var item in srv.GetAllStatuses())
            {
                items.Add(FileStatusModelConverter.ToModel(item));
            }

            return(View(items));
        }
Пример #2
0
        public ActionResult Edit(Int64 id)
        {
            var srv  = CompositionRoot.Resolve <IFileStatusService>();
            var type = srv.GetStatusById(id);

            if (type == null)
            {
                ModelState.AddModelError("", "Статус не найден");
                return(RedirectToAction("List"));
            }

            var model = FileStatusModelConverter.ToModel(type);

            return(View(model));
        }