Exemplo n.º 1
0
        public async Task <ResponseCRUDMessage> Update(Cars car)
        {
            var response = new ResponseCRUDMessage(false, "");
            var carExist = carsRepository.FindById(car.Id);

            if (carExist == null)
            {
                response.message = "The car not exist!";
                return(response);
            }
            carExist = car;
            try
            {
                response.status = await carsRepository.Update(carExist);

                if (response.status)
                {
                    response.message = "The car was updated!";
                }
                else
                {
                    return(null);
                }
            }
            catch (Exception ex)
            {
                response.message = ex.Message;
            }
            return(response);
        }
        // GET: MobileBrandController/Details/5
        public ActionResult Details(int id)
        {
            var data = _brand.FindById(id);

            return(View(data));
        }
Exemplo n.º 3
0
 // GET: ProductDetailsController/Details/5
 public ActionResult Details(int id)
 {
     return(View(_product.FindById(id)));
 }