private void textBoxSearch_TextChanged(object sender, EventArgs e) { CoreWebService.BillOfLadingListResponse waybillTemplates = client.listBillOfLading(textBoxSearch.Text); if (waybillTemplates.Status == 0) { listBoxWaybillTemplates.DisplayMember = "displayText"; listBoxWaybillTemplates.ValueMember = "ID"; listBoxWaybillTemplates.DataSource = waybillTemplates.Data; } }
private void buttonUpdate_Click(object sender, EventArgs e) { int nextWaybillID = 0; if (comboBoxNextWaybill.SelectedValue != null) { nextWaybillID = (int)comboBoxNextWaybill.SelectedValue; } string displayText = comboBoxShipper.Text + " -> " + comboBoxConsignee.Text + " - " + textBoxDescOfArticles.Text.Trim(); CoreWebService.BillOfLadingResponse response = client.updateBillOfLading((int)listBoxBillOfLading.SelectedValue, (int)comboBoxConsignee.SelectedValue, (int)comboBoxShipper.SelectedValue, (int)comboBoxRequestedCarType.SelectedValue, (int)numericUpDownRequestedLength.Value, (int)numericUpDownCapacityTons.Value, textBoxNoPkgs.Text, textBoxDescOfArticles.Text, checkBoxIsPerishable.Checked, checkBoxPreIce.Checked, checkBoxInitialIce.Checked, 0, false, checkBoxIsLiveStock.Checked, checkBoxReverseRoute.Checked, checkBoxReturnEmpty.Checked, checkBoxNextWaybill.Checked, nextWaybillID, (decimal)numericUpDownCarsPerDay.Value, (int)numericUpDownUnloadTime.Value, (int)numericUpDownLoadTime.Value, displayText, true); if (response.Status == 0) { CoreWebService.BillOfLadingPathResponse path = new CoreWebService.BillOfLadingPathResponse(); client.deleteBillOfLadingPath(response.Data.ID); for (int i = 0; i < listBoxPath.Items.Count; i++) { if (i == 0) { CoreWebService.Location item = (CoreWebService.Location)listBoxLocations.Items[i]; path = client.addBillOfLadingPath(response.Data.ID, item.ID, 0, true); } else { CoreWebService.Location item = (CoreWebService.Location)listBoxLocations.Items[i]; int previousPathID = path.Data.ID; path = client.addBillOfLadingPath(response.Data.ID, item.ID, 0, false); client.updateBillOfLadingPath(previousPathID, response.Data.ID, path.Data.ID); } } client.deleteBillOfLadingCartypeAttribute((int)listBoxBillOfLading.SelectedValue); foreach (var i in listBoxCarTypeAttributes.SelectedIndices) { CoreWebService.CarTypeAttribute item = (CoreWebService.CarTypeAttribute)listBoxCarTypeAttributes.Items[(int)i]; CoreWebService.BillOfLadingCarTypeAttributesResponse rsResponse = client.addBillOfLadingCartypeAttribute(response.Data.ID, item.ID); } CoreWebService.BillOfLadingListResponse waybillTemplates = client.listBillOfLading(textBoxSearch.Text); if (waybillTemplates.Status == 0) { listBoxBillOfLading.DisplayMember = "displayText"; listBoxBillOfLading.ValueMember = "ID"; listBoxBillOfLading.DataSource = waybillTemplates.Data; } listBoxBillOfLading.SelectedValue = response.Data.ID; } }
private void BillOfLadings_Load(object sender, EventArgs e) { CoreWebService.BillOfLadingListResponse waybillTemplates = client.listBillOfLading(textBoxSearch.Text); if (waybillTemplates.Status == 0) { listBoxBillOfLading.DisplayMember = "displayText"; listBoxBillOfLading.ValueMember = "ID"; listBoxBillOfLading.DataSource = waybillTemplates.Data; } CoreWebService.LocationListResponse locations = client.listLocations(""); if (locations.Status == 0) { listBoxLocations.DisplayMember = "name"; listBoxLocations.DataSource = locations.Data; } CoreWebService.ConsigneeShipperListResponse consignee = client.listConsigneeShipper(""); if (consignee.Status == 0) { comboBoxConsignee.DisplayMember = "name"; comboBoxConsignee.ValueMember = "ID"; comboBoxConsignee.DataSource = consignee.Data; } CoreWebService.ConsigneeShipperListResponse shipper = client.listConsigneeShipper(""); if (shipper.Status == 0) { comboBoxShipper.DisplayMember = "name"; comboBoxShipper.ValueMember = "ID"; comboBoxShipper.DataSource = shipper.Data; } CoreWebService.CarTypeListResponse carType = client.listCarTypes(); if (carType.Status == 0) { comboBoxRequestedCarType.DisplayMember = "shortName"; comboBoxRequestedCarType.ValueMember = "ID"; comboBoxRequestedCarType.DataSource = carType.Data; } listBoxPath.DisplayMember = "name"; listBoxPath.ValueMember = "ID"; }