示例#1
0
        // GET: Requisicao/Create
        public ActionResult Create()
        {
            TempData["ListaProdutosReq"] = new List <ProdutoQtdViewModel>();

            var userManager = new UserManager <ApplicationUser>(new UserStore <ApplicationUser>(new ApplicationDbContext()));

            var viewModel = new RequisicaoViewModel();

            viewModel.Usuario     = userManager.FindById(User.Identity.GetUserId());
            viewModel.NomeUsuario = viewModel.Usuario.UserName.Substring(0, viewModel.Usuario.UserName.IndexOf("@"));

            ViewBag.ProdutoId = new SelectList(ProdutoService.GetAllProdutos(), "ProdutoId", "Nome");

            return(View(viewModel));
        }
        public ActionResult KeyValue(RequisicaoViewModel requisicao)
        {
            savieadService.PreInvoke();

            savieadService.AddParameter(requisicao.chave1, requisicao.valor1);
            savieadService.AddParameter(requisicao.chave2, requisicao.valor2);
            savieadService.AddParameter(requisicao.chave3, requisicao.valor3);
            savieadService.AddParameter(requisicao.chave4, requisicao.valor4);
            savieadService.AddParameter(requisicao.chave5, requisicao.valor5);
            savieadService.AddParameter(requisicao.chave6, requisicao.valor6);
            savieadService.AddParameter(requisicao.chave7, requisicao.valor7);
            savieadService.AddParameter(requisicao.chave8, requisicao.valor8);

            try
            {
                savieadService.Invoke("insertUser");
            }
            finally { savieadService.PosInvoke(); }

            return(JsonNetResult(new { status = new { codigo = "ok", msg = savieadService.ResultString } }));
        }
示例#3
0
 public Requisicao()
 {
     InitializeComponent();
     viewModel        = new RequisicaoViewModel();
     this.DataContext = viewModel;
 }