private void btnSyncCar_Click(object sender, EventArgs e) { try { LH_OUTBOUNDORDERModel[] row = BillGrid.DataSource as LH_OUTBOUNDORDERModel[]; int[] RowNum = BillGrid.GetSelectedRows(); if (RowNum.Length == 0) { MessageBox.Show("请选择要同步的数据!"); return; } List <string> LHODONO = new List <string>(); foreach (var item in RowNum) { LHODONO.Add(row[item].LHODONO); } if (_service.obOrderUpload(LHODONO.ToArray())) { MessageBox.Show("同步成功!"); } else { MessageBox.Show("同步失败!"); } } catch (Exception exception) { MessageBox.Show(exception.Message); LogHelper.Error(exception); } }
private void btnBatchUpdate_Click(object sender, EventArgs e) { try { var indexs = BillGrid.GetSelectedRows(); if (indexs != null && indexs.Length > 0) { var lhodonos = new List <string>(); foreach (var i in indexs) { var no = BillGrid.GetRowCellValue(i, "LHODONO"); lhodonos.Add($"{no}"); } var megBills = _service.GetMergeBills(lhodonos.ToArray()); if (megBills.Length > 1) { MsgHelper.ShowInformation("已选单据不在同一分货单中,不能批量修改"); } FrmBatchOutBoundOrder frm = new FrmBatchOutBoundOrder(); frm.Result = megBills.SingleOrDefault(); frm.LHOBODNOS = lhodonos; if (frm.ShowDialog() == DialogResult.OK) { } } } catch (Exception exception) { MsgHelper.ShowException(exception); } }