/// <summary> /// Загрузка данных в контрол. /// </summary> /// <param name="data">Обновляемые данные.</param> public bool LoadData(RawVehicleInfo data) { try { vehicleOwnerTextBox.Text = data.VehicleOwner.Value; vehicleCountryTextBox.Text = data.VehicleCountry.Value; vehicleSubjectCodeTextBox.Text = data.VehicleSubjectCode.Value; carriageTypeTextBox.Text = data.CarriageType.Value; vehicleRouteTextBox.Text = data.VehicleRoute.Value; federalHighwaysDistanceTextBox.Text = data.FederalHighwaysDistance.Value; vehicleShipperTextBox.Text = data.VehicleShipper.Value; return(true); } catch (Exception e) { _console.AddException(e); return(false); } }
/// <summary> /// Получение данных из контрола после редактирования. /// </summary> /// <returns>Обновляемые данные.</returns> public bool UpdateData(RawVehicleInfo data) { try { data.VehicleOwner = vehicleOwnerTextBox.UpdateData(); data.VehicleCountry = vehicleCountryTextBox.UpdateData(); data.VehicleSubjectCode = vehicleSubjectCodeTextBox.UpdateData(); data.CarriageType = carriageTypeTextBox.UpdateData(); data.VehicleRoute = vehicleRouteTextBox.UpdateData(); data.FederalHighwaysDistance = federalHighwaysDistanceTextBox.UpdateData(); data.VehicleShipper = vehicleShipperTextBox.UpdateData(); return(true); } catch (Exception e) { _console.AddException(e); return(false); } }