public IActionResult Add(RentedCarsRecord record)
        {
            if (ModelState.IsValid)
            {
                var addedRecord = _rentedCarsRecordService.GetById(record.Id);

                if (addedRecord != null)
                {
                    TempData["message"] = "This record already added to database !";
                    return(RedirectToAction("Index", "RentedCarRecord"));
                }

                _rentedCarsRecordService.Add(record);

                TempData["message"] = "Record added to database succesfully !";
                return(RedirectToAction("Index", "RentedCarsRecord"));
            }

            return(View());
        }
예제 #2
0
 public void Delete(RentedCarsRecord rentedCarsRecord)
 {
     _rentedCarsRecordDal.Delete(rentedCarsRecord);
 }
예제 #3
0
 public void Update(RentedCarsRecord rentedCarsRecord)
 {
     _rentedCarsRecordDal.Update(rentedCarsRecord);
 }
예제 #4
0
 public void Add(RentedCarsRecord rentedCarsRecord)
 {
     _rentedCarsRecordDal.Add(rentedCarsRecord);
 }