private void listBoxCars_SelectedIndexChanged(object sender, EventArgs e) { CoreWebService.RollingStockResponse rollingStock = client.getRollingStock((int)listBoxCars.SelectedValue); if (rollingStock.Status == 0) { comboBoxArrCode.SelectedValue = rollingStock.Data.arrCodeID; comboBoxCarType.SelectedValue = rollingStock.Data.carTypeID; textBoxRoadNumber.Text = rollingStock.Data.roadNumber; numericUpDownLength.Value = (decimal)rollingStock.Data.length; numericUpDownCapacityTons.Value = (decimal)rollingStock.Data.capacityTonnage; textBoxTrain.Text = rollingStock.Data.trainID.ToString(); if (rollingStock.Data.locationID != null) { CoreWebService.LocationResponse location = client.getLocation((int)rollingStock.Data.locationID); if (location.Status == 0) { textBoxLocation.Text = location.Data.name; } } if (rollingStock.Data.nextRS != null) { CoreWebService.RollingStockResponse nextCar = client.getRollingStock((int)rollingStock.Data.nextRS); if (nextCar.Status == 0) { textBoxNextCar.Text = nextCar.Data.displayText; } } textBoxRFID.Text = rollingStock.Data.RFID; if (rollingStock.Data.isFirst != null) { checkBoxIsFirstCar.Checked = (bool)rollingStock.Data.isFirst; } if (rollingStock.Data.isLast != null) { checkBoxIsLastCar.Checked = (bool)rollingStock.Data.isLast; } } comboBoxCarType_SelectedIndexChanged(this, null); }
private void buttonUpdate_Click(object sender, EventArgs e) { CoreWebService.LocationResponse repsonse = client.updateLocation(location[listBoxLocation.SelectedIndex].ID, textBoxName.Text, textBoxShortName.Text, textBoxRFIDLocation.Text, numericUpDownScannerHead.Value.ToString(), checkBoxIsRFID.Checked); refreshListBox(); }
private void buttonAdd_Click(object sender, EventArgs e) { CoreWebService.LocationResponse repsonse = client.addLocation(textBoxName.Text, textBoxShortName.Text, textBoxRFIDLocation.Text, numericUpDownScannerHead.Value.ToString(), checkBoxIsRFID.Checked); refreshListBox(); }