示例#1
0
 public ActionResult Create(LoteViewModel model)
 {
     try
     {
         var service = new FabricacionServices.LotesServiceClient();
         service.InsertarLote(model.NroLote, 1);
         return RedirectToAction("Index", new {creado = true});
     }
     catch
     {
         return View();
     }
 }
示例#2
0
        //
        // GET: /Lote/
        public ActionResult Index(bool? creado)
        {
            var service = new FabricacionServices.LotesServiceClient();
            var dtos = service.ListaLotes();

            Mapper.CreateMap<LoteDto, LoteViewModel>();
            var model = Mapper.Map<List<LoteViewModel>>(dtos);

            if (creado.HasValue && creado.GetValueOrDefault())
                ViewBag.MensajeConfirmacion = "El lote se insertó correctamente";

            return View(model);
        }
示例#3
0
 public ActionResult Edit(LoteViewModel model)
 {
     try
     {
         var service = new FabricacionServices.LotesServiceClient();
         service.EditarLote(model.Id, model.NroLote);
         return Index(true);
     }
     catch
     {
         return View();
     }
 }