Example #1
0
 private static object MapToGridModel(appBuses o)
 {
     return
         new
         {
             o.Id,
             o.nombre,
             o.descrip,
             o.placa,
             o.pasajeros
         };
 }
Example #2
0
        public ActionResult Create(appBusInput input)
        {
            if (!ModelState.IsValid) return PartialView(input);

            var entity = new appBuses
            {
                nombre = input.nombre,
                descrip = input.descrip,
                placa = input.placa,
                pasajeros = input.pasajeros
            };

            UnitOfWork.AppBusRepository.Insert(entity);
            UnitOfWork.Save();

            return Json(MapToGridModel(entity)); // returning grid model, used in grid.api.renderRow
        }