public AddEditCalibrationEngineeringUnitModel() { mCalibrationEngineeringUnit = new CalibrationEngineeringUnit(); OkButtonCommand = new DelegateCommand<object>(OkButtonHander, CanExecuteOkButtonHandler); CancelButtonCommand = new DelegateCommand<object>(CancelButtonHander, CanExecuteOkButtonHandler); }
public AddEditCalibrationEngineeringUnitModel(int attachmentTypeId) { CmsWebServiceClient cmsWebServiceClient = new CmsWebServiceClient(Utils.WcfBinding, Utils.WcfEndPoint); cmsWebServiceClient.GetCalibrationEngineeringUnitCompleted += (s, e) => { mCalibrationEngineeringUnit = e.Result; if (DataSourceLoaded!=null) { DataSourceLoaded(); } }; cmsWebServiceClient.GetCalibrationEngineeringUnitAsync(attachmentTypeId); OkButtonCommand = new DelegateCommand<object>(OkButtonHander, CanExecuteOkButtonHandler); CancelButtonCommand = new DelegateCommand<object>(CancelButtonHander, CanExecuteOkButtonHandler); }
private CalibrationPropertyDto ParsePropertyStringToDto(string dataIn, int rowNumber) { RowNumber = rowNumber; CalibrationPropertyDto dto = new CalibrationPropertyDto(); try { string[] parts = dataIn.Split('{', '}'); if (parts.Any() && parts.Count() >= 2) { dto.PropertyName = parts[0].Trim(); CalibrationEngineeringUnit newUnit = new CalibrationEngineeringUnit(); newUnit.Name = parts[1].Trim(); newUnit.Ordinal = 0; dto.NewUnit = newUnit; } else { dto.PropertyName = dataIn; } } catch (Exception ex) { ErrorMessages.Add(string.Format("Tag '{0}', ComponentName '{1}', row {2}. Exception caught trying to ParsePropertyStringToDto: '{3}' Exception: {4}.", Tag, CalibrationName, rowNumber, dataIn, ex.Message)); } return dto; }