コード例 #1
0
        public ActionResult Index()
        {
            ParametrosFinanceiroViewModel model = new ParametrosFinanceiroViewModel();

            model.Parametros = parametrosAppService.Obter() ?? new ParametrosFinanceiroDTO();
            model.PodeSalvar = parametrosAppService.EhPermitidoSalvar();
            //CarregarCombos(model);
            return(View(model));
        }
コード例 #2
0
        public ActionResult Index(ParametrosFinanceiroViewModel model)
        {
            if (ModelState.IsValid)
            {
                if (model.IconeRelatorio != null)
                {
                    using (Stream inputStream = model.IconeRelatorio.InputStream)
                    {
                        MemoryStream memoryStream = inputStream as MemoryStream;
                        if (memoryStream == null)
                        {
                            memoryStream = new MemoryStream();
                            inputStream.CopyTo(memoryStream);
                        }
                        model.Parametros.IconeRelatorio = memoryStream.ToArray();
                    }
                }
                parametrosAppService.Salvar(model.Parametros);
            }

            return(PartialView("_NotificationMessagesPartial"));
        }