Example #1
0
        public CarModel UpdateCar(CarModel carModel)
        {
            DataTable dt          = new DataTable();
            CarModel  carModelSql = new CarModel();

            using (SqlCommand command = new SqlCommand())
            {
                dt = GetMultipleQuery(CarStringsSql.UpdateCar(carModel));
            }
            foreach (DataRow ms in dt.Rows)
            {
                carModelSql = CarModel.ToObject(ms);
            }

            return(carModelSql);
        }
Example #2
0
        public CarModel UploadCarImage(string carNumber, string img)
        {
            DataTable dt          = new DataTable();
            CarModel  carModel    = GetOneCar(carNumber);
            CarModel  carModelSql = new CarModel();

            if (carModel == null)
            {
                return(carModel);
            }
            carModel.carPicture = img;

            using (SqlCommand command = new SqlCommand())
            {
                dt = GetMultipleQuery(CarStringsSql.UpdateCar(carModel));
            }
            foreach (DataRow ms in dt.Rows)
            {
                carModelSql = CarModel.ToObject(ms);
            }

            return(carModelSql);
        }