コード例 #1
0
        public int DeleteCarType(string type)
        {
            int i = 0;

            using (MySqlCommand command = new MySqlCommand())
            {
                i = ExecuteNonQuery(CarTypeStringsMySql.DeleteCarTypeByType(type));
            }
            return(i);
        }
コード例 #2
0
        public int DeleteCarType(int carTypeId)
        {
            int i = 0;

            using (MySqlCommand command = new MySqlCommand())
            {
                i = ExecuteNonQuery(CarTypeStringsMySql.DeleteCarTypeById(carTypeId));
            }
            return(i);
        }
コード例 #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);
        }
コード例 #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);
        }
コード例 #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);
        }