//点击出库按钮 private void BaseButton_Inbound_Click(object sender, EventArgs e) { try { ScrapCostume item = this.Build(); if (item == null || item.OutboundOrder.TotalCount == 0 || item.OutboundDetails.Count == 0) { GlobalMessageBox.Show("报损单为空,不能报损!"); return; } if (GlobalMessageBox.Show("确定报损吗?", "警告", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) != DialogResult.Yes) { return; } if (GlobalUtil.EngineUnconnectioned(this)) { return; } InteractResult result = GlobalCache.ServerProxy.Scrap(item); switch (result.ExeResult) { case ExeResult.Success: GlobalMessageBox.Show("报损成功!"); if (skinCheckBoxPrint.Checked) { ScrapOrderPrinter.Print(item.ScrapOrder, dataGridView2, 2); } ResetAll(); break; case ExeResult.Error: GlobalMessageBox.Show(result.Msg); break; default: break; } } catch (Exception ex) { GlobalUtil.ShowError(ex); } finally { GlobalUtil.UnLockPage(this); } }
/// <summary> /// 报损 /// </summary> /// <param name="para"></param> /// <returns></returns> public InsertResult Scrap(ScrapCostume para) { byte[] response = this.engine.CustomizeOutter.Query(ManageInformationTypes.Scrap, SerializeHelper.ResultToSerialize(para)); return((InsertResult)SerializeHelper.ByteArrayToInt(response));; }