Ejemplo n.º 1
0
        public int DeleteCarType(string type)
        {
            int i = 0;

            using (MySqlCommand command = new MySqlCommand())
            {
                i = ExecuteNonQuery(CarTypeStringsMySql.DeleteCarTypeByType(type));
            }
            return(i);
        }
Ejemplo n.º 2
0
        public int DeleteCarType(int carTypeId)
        {
            int i = 0;

            using (MySqlCommand command = new MySqlCommand())
            {
                i = ExecuteNonQuery(CarTypeStringsMySql.DeleteCarTypeById(carTypeId));
            }
            return(i);
        }
Ejemplo n.º 3
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);
        }
Ejemplo n.º 4
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);
        }
Ejemplo n.º 5
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);
        }