/// <summary> /// 保存节点到本地数据库 /// </summary> private void SaveNode() { bool result = false; string exceptionStr = string.Empty; string content = string.Empty; string number = txtOrderNumber.Text.Trim(); DateTime dtNow = DateTime.Now; try { if (ucConsignors1._SelectConSignor.ConsignorId == -1) { try { ucConsignors1.AutoMatchConsignors(ref number); } catch (Exception ex) { exceptionStr = ex.Message; MessageBox.Show(exceptionStr, "请选择供应商", MessageBoxButtons.OK, MessageBoxIcon.Hand, MessageBoxDefaultButton.Button1); return; } if (cboStorageScan.SelectedValue.ToString() == "0") { exceptionStr = "请选择上一个冷藏载体"; MessageBox.Show(exceptionStr, "请选择冷藏载体", MessageBoxButtons.OK, MessageBoxIcon.Hand, MessageBoxDefaultButton.Button1); return; } //exceptionStr = "请选择供应商"; //MessageBox.Show("请选择是自运单还是第三方单", "请选择供应商", MessageBoxButtons.OK, MessageBoxIcon.Hand, MessageBoxDefaultButton.Button1); //return; } FrmParent.ParentForm.CheckNumber(number, false); int parentStorageId = Convert.ToInt32(cboStorageScan.SelectedValue); dtNow = WaybillServer.AddNode(number, _StorageInfo.Id, _StorageInfo.storageName, lblContent.Text.Trim(), chbIsArrive.Checked, ucConsignors1._SelectConSignor.ConsignorId, parentStorageId, ref content); result = true; _SaveOkCount++; FrmParent.ParentForm.AddSaveOKNumber(_SaveOkCount); FrmParent.ParentForm.EndSleep(); } catch (Exception ex) { exceptionStr = "保存失败"; if (ex.Message.Contains("重复扫描")) { exceptionStr = ex.Message; } } finally { if (result) { FrmParent.ParentForm.AddScanNum(number, false); } ShowResult(result, true, exceptionStr); Common.SaveOptRecord(exceptionStr == string.Empty ? "保存中间节点成功[" + cboStorageScan.Text + "]" : ("保存中间节点失败[" + cboStorageScan.Text + "]," + exceptionStr), content, dtNow, number, ucConsignors1._SelectConSignor.ConsignorId); ucConsignors1.SelectedConsignors(); } }
/// <summary> /// 保存节点到本地数据库 /// </summary> private void SaveNode() { bool result = false; string exceptionStr = string.Empty; try { WaybillServer.AddNode(txtOrderNumber.Text.Trim(), _StorageInfo.Id, _StorageInfo.storageName, lblContent.Text.Trim(), chbIsArrive.Checked); result = true; } catch (Exception ex) { exceptionStr = "保存数据出错:[" + ex.Message + "]"; } ShowResult(result, true, exceptionStr); }