예제 #1
0
        public int SaveCarDiamention(CarDiamention model)
        {
            using (IDbConnection connection = OpenConnection(dataConnection))
            {
                string sql = @"INSERT INTO CarDiamention(
                carId
                ,Length
                ,Width
                ,Height
                ,WheelBase
                ,GroundClerance
                ,FrontTrack
                ,RearTrack
                ,FuelTank)
                VALUES(
                @carId
                ,@Length
                ,@Width
                ,@Height
                ,@WheelBase
                ,@GroundClerance
                ,@FrontTrack
                ,@RearTrack
                ,@FuelTank)";

                int rowsAffected = connection.Execute(sql, model);
                return(rowsAffected);
            }
        }
예제 #2
0
 public ActionResult Create(CarDiamention model)
 {
     if (ModelState.IsValid)
     {
         MasterRepository repo = new MasterRepository();
         repo.SaveCarDiamention(model);
         return(RedirectToAction("Create"));
     }
     else
     {
         return(View(model));
     }
 }
예제 #3
0
        public ActionResult Create()
        {
            CarDiamention model = new CarDiamention();

            return(View(model));
        }