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

            return(View(truckForm));
        }
Beispiel #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"));
        }
        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");
        }
Beispiel #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"));
        }
        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");
        }
Beispiel #6
0
        public ActionResult Create()
        {
            var truckForm = new TruckForm();

            return(View(truckForm));
        }
 public ActionResult Create()
 {
     var truckForm = new TruckForm();
     return View(truckForm);
 }
Beispiel #8
0
        private void btnNewTruck_ItemClick(object sender, ItemClickEventArgs e)
        {
            TruckForm tf = new TruckForm(null);

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