public List <CarForRentModel> GetAllCarsForRent()
        {
            DataTable dt = new DataTable();
            List <CarForRentModel> arrCarsForRent = new List <CarForRentModel>();

            using (MySqlCommand command = new MySqlCommand())
            {
                dt = GetMultipleQuery(CarForRentStringsMySql.GetAllCarsForRent());
            }

            foreach (DataRow ms in dt.Rows)
            {
                arrCarsForRent.Add(CarForRentModel.ToObject(ms));
            }

            return(arrCarsForRent);
        }
        public CarForRentModel AddCarForRent(CarForRentModel carForRentModel)
        {
            string id = HttpContext.Current.User.Identity.Name;

            carForRentModel.userID = id;
            DataTable       dt = new DataTable();
            CarForRentModel carForRentModelSql = new CarForRentModel();

            using (MySqlCommand command = new MySqlCommand())
            {
                dt = GetMultipleQuery(CarForRentStringsMySql.AddCarForRent(carForRentModel));
            }

            foreach (DataRow ms in dt.Rows)
            {
                carForRentModelSql = CarForRentModel.ToObject(ms);
            }

            return(carForRentModelSql);
        }
        public CarForRentModel GetOneCarForRentByRentNumber(int rentNumber)
        {
            if (rentNumber < 0)
            {
                throw new ArgumentOutOfRangeException();
            }
            DataTable       dt = new DataTable();
            CarForRentModel carForRentModelSql = new CarForRentModel();

            using (MySqlCommand command = new MySqlCommand())
            {
                dt = GetMultipleQuery(CarForRentStringsMySql.GetOneCarForRentByRentNumber(rentNumber));
            }

            foreach (DataRow ms in dt.Rows)
            {
                carForRentModelSql = CarForRentModel.ToObject(ms);
            }

            return(carForRentModelSql);
        }
        public List <CarForRentModel> GetCarsForRentByCarNumber(string carNumber)
        {
            if (carNumber.Equals(""))
            {
                throw new ArgumentOutOfRangeException();
            }
            DataTable dt = new DataTable();
            List <CarForRentModel> arrCarsForRent = new List <CarForRentModel>();

            using (MySqlCommand command = new MySqlCommand())
            {
                dt = GetMultipleQuery(CarForRentStringsMySql.GetAllCarsForRentByCarNumber(carNumber));
            }

            foreach (DataRow ms in dt.Rows)
            {
                arrCarsForRent.Add(CarForRentModel.ToObject(ms));
            }

            return(arrCarsForRent);
        }