コード例 #1
0
        public async System.Threading.Tasks.Task <ActionResult> AddEditEntryExitProduct()
        {
            var vm = new AddEditEntryExitProductViewModel();
            await vm.FillAdd(CargarDatosContext());

            return(View(vm));
        }
コード例 #2
0
        public async System.Threading.Tasks.Task <ActionResult> AddEditEntryExitProduct(AddEditEntryExitProductViewModel model)
        {
            try
            {
                model.UserId = Session.GetUserId();
                var postResult = ConstantHelpers.PostUrlAsync(Baseurl, "SAV/entryexitproducts", model).Result;
                if (postResult.Message.Equals("Success"))
                {
                    return(RedirectToAction("ListStockProduct", "EntryExitProduct"));
                }
                await model.FillAdd(CargarDatosContext());

                return(View(model));
            }
            catch (Exception e)
            {
                return(View(model));
            }
        }