public string FindAirConditioner(string manufacturer, string model) { AirConditioner airConditioner = this.GetAirConditionerByManufacturerAndModel(manufacturer, model); //AirConditionerDTO airConditionerDTO = this.GetAirConditionerDTOFromModel(airConditioner); AirConditionerDTO airConditionerDTO = Mapper.Map <AirConditionerDTO>(airConditioner); return(airConditionerDTO.ToString()); }
public string TestAirConditioner(string manufacturer, string model) { AirConditioner airConditioner = this.GetAirConditionerByManufacturerAndModel(manufacturer, model); //AirConditionerDTO airConditionerDTO = this.GetAirConditionerDTOFromModel(airConditioner); AirConditionerDTO airConditionerDTO = Mapper.Map <AirConditionerDTO>(airConditioner); var mark = airConditionerDTO.Test() ? Mark.Passed : Mark.Failed; this.Database.ReportRepo.Add( new Report() { Manufacturer = manufacturer, Model = model, Mark = mark }); this.Database.Save(); return(string.Format(Constants.TestAirConditioner, model, manufacturer)); }