private ITypeScan GetTypeScan(string type) { ITypeScan typeScan = null; switch (type) { case "Coupe": { typeScan = new CoupeCar(); break; } case "Suv": { typeScan = new SuvCar(); break; } case "PickUp": { typeScan = new PickedUpCar(); break; } case "Sedan": { typeScan = new SedanCar(); break; } case "Sportbike": { typeScan = new SportMotorcycle(); break; } case "Touringmotorcycle": { typeScan = new TouringMotorcycle(); break; } case "Cruisemotorcycle": { typeScan = new MotorcycleСruising(); break; } case "Tricycle": { typeScan = new TricycleMotorcycle(); break; } } return(typeScan); }
public async Task SavePhotoInspection(string idVe, string photoInspectionJson) { PhotoInspection photoInspection = JsonConvert.DeserializeObject <PhotoInspection>(photoInspectionJson); VehiclwInformation vehiclwInformation = await sqlCommandApiMobile.SavePhotoInspectionInDb(idVe, photoInspection); Task.Run(async() => { ITypeScan typeScan = GetTypeScan(vehiclwInformation.Ask.TypeVehicle.Replace(" ", "")); await typeScan.SetDamage(photoInspection, vehiclwInformation.Ask.TypeVehicle.Replace(" ", ""), vehiclwInformation.Scan.path); }); }
public async Task SaveDamageForUser(string idVech, string idShiping, string damageForUserJson) { List <DamageForUser> damageForUsers = JsonConvert.DeserializeObject <List <DamageForUser> >(damageForUserJson); Task.Run(async() => { VehiclwInformation vehiclwInformation = await sqlCommandApiMobile.GetVehiclwInformationAndSaveDamageForUser(idVech, idShiping, damageForUsers); ITypeScan typeScan = GetTypeScan(vehiclwInformation.Ask.TypeVehicle); await typeScan.SetDamage(damageForUsers, vehiclwInformation.Ask.TypeVehicle, vehiclwInformation.Scan.path); }); }