Exemplo n.º 1
0
        public ActionResult Index()
        {
            IPaperFacade paperFacade     = FacadeFactory.Instance.Create <IPaperFacade>();
            var          paperDTOsResult = paperFacade.GetAllPapers();

            if (paperDTOsResult.IsValid())
            {
                return(View(paperDTOsResult.Data));
            }
            else
            {
                return(new RedirectResult("Error/"));
            }
        }
        public static List <SelectListItem> PaperCodeList()
        {
            List <SelectListItem> list        = new List <SelectListItem>();
            IPaperFacade          paperFacade = FacadeFactory.Instance.Create <IPaperFacade>();
            var paperDTOsResult = paperFacade.GetAllPapers();

            if (paperDTOsResult.IsValid())
            {
                foreach (var paperDTO in paperDTOsResult.Data)
                {
                    list.Add(new SelectListItem {
                        Text = paperDTO.Name, Value = paperDTO.PaperId.ToString()
                    });
                }
            }
            return(list);
        }