Exemplo n.º 1
0
        public ActionResult Edit(Guid id)
        {
            var truck     = _truckService.GetById(id);
            var truckForm = TruckForm.FromTruck(truck);

            return(View(truckForm));
        }
Exemplo n.º 2
0
        public ActionResult Edit(Guid id, TruckForm truckForm)
        {
            if (!ModelState.IsValid)
            {
                return(View(truckForm));
            }

            _truckService.Edit(truckForm.ToTruck());

            return(RedirectToAction("Index", new TruckListFiltersModel().GetRouteValues()).WithSuccess("Camion Editado"));
        }
Exemplo n.º 3
0
        public ActionResult Edit(Guid id, TruckForm truckForm)
        {
            if (!ModelState.IsValid)
            {
                return View(truckForm);
            }

            _truckService.Edit(truckForm.ToTruck());

            return RedirectToAction("Index", new TruckListFiltersModel().GetRouteValues()).WithSuccess("Camion Editado");
        }
Exemplo n.º 4
0
        public ActionResult Create(TruckForm truckForm)
        {
            if (!ModelState.IsValid)
            {
                return(View(truckForm));
            }

            var truck = truckForm.ToTruck();

            _truckService.Create(truck);

            return(RedirectToAction("Index", new TruckListFiltersModel().GetRouteValues()).WithSuccess("Camion Creado"));
        }
Exemplo n.º 5
0
        public ActionResult Create(TruckForm truckForm)
        {
            if (!ModelState.IsValid)
            {
                return View(truckForm);
            }

            var truck = truckForm.ToTruck();

            _truckService.Create(truck);

            return RedirectToAction("Index", new TruckListFiltersModel().GetRouteValues()).WithSuccess("Camion Creado");
        }
Exemplo n.º 6
0
        public ActionResult Create()
        {
            var truckForm = new TruckForm();

            return(View(truckForm));
        }
Exemplo n.º 7
0
 public ActionResult Create()
 {
     var truckForm = new TruckForm();
     return View(truckForm);
 }
Exemplo n.º 8
0
        private void btnNewTruck_ItemClick(object sender, ItemClickEventArgs e)
        {
            TruckForm tf = new TruckForm(null);

            AddTab(tf, "Novo Caminhão", false);
        }