Beispiel #1
0
        public CarTypeModel UpdateCarType(CarTypeModel carTypeModelSql)
        {
            DataTable dt = new DataTable();

            using (MySqlCommand command = new MySqlCommand())
            {
                dt = GetMultipleQuery(CarTypeStringsMySql.UpdateCarType(carTypeModelSql));
            }
            foreach (DataRow ms in dt.Rows)
            {
                carTypeModelSql = CarTypeModel.ToObject(ms);
            }

            return(carTypeModelSql);
        }
Beispiel #2
0
        public List <CarTypeModel> GetAllCarTypes()
        {
            DataTable           dt          = new DataTable();
            List <CarTypeModel> arrCarTypes = new List <CarTypeModel>();

            using (MySqlCommand command = new MySqlCommand())
            {
                dt = GetMultipleQuery(CarTypeStringsMySql.GetAllCarTypes());
            }
            foreach (DataRow ms in dt.Rows)
            {
                arrCarTypes.Add(CarTypeModel.ToObject(ms));
            }

            return(arrCarTypes);
        }
Beispiel #3
0
        public CarTypeModel GetOneCarType(int typeId)
        {
            if (typeId < 0)
            {
                throw new ArgumentOutOfRangeException();
            }
            DataTable    dt = new DataTable();
            CarTypeModel carTypeModelSql = new CarTypeModel();

            using (MySqlCommand command = new MySqlCommand())
            {
                dt = GetMultipleQuery(CarTypeStringsMySql.GetOneCarType(typeId));
            }
            foreach (DataRow ms in dt.Rows)
            {
                carTypeModelSql = CarTypeModel.ToObject(ms);
            }

            return(carTypeModelSql);
        }