UpdateMemo.cs 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Windows.Forms;
  5. using Core.Mes.Client.Comm.Format;
  6. using Core.Mes.Client.Comm.Tool;
  7. using CoreFS.CA06;
  8. namespace Core.StlMes.Client.LgResMgt.库存位置
  9. {
  10. public partial class UpdateMemo : FrmBase
  11. {
  12. private List<MatInfo> _matInfo;
  13. public UpdateMemo(OpeBase _ob, List<MatInfo> matInfo)
  14. {
  15. InitializeComponent();
  16. this.ob = _ob;
  17. _matInfo = EntityHelper.CopyEntitys<MatInfo>(matInfo);
  18. editNum.Value = _matInfo.Select(p=>p.ActCount).Sum();
  19. editNum.MaxValue = editNum.Value;
  20. uteMemo.Text = _matInfo[0].Memo;
  21. editNum.ReadOnly = matInfo.Count > 1;
  22. }
  23. private void ubtOK_Click(object sender, EventArgs e)
  24. {
  25. if (editNum.Value == null)
  26. {
  27. MessageBox.Show("请输入需要修改的支数");
  28. return;
  29. }
  30. if (_matInfo.Count == 1)
  31. {
  32. _matInfo[0].ActCount = decimal.Parse(editNum.Value.ToString3());
  33. }
  34. var ccp = new CoreClientParam
  35. {
  36. ServerName = "Core.LgMes.Server.LgDeviceManager.StorageManage",
  37. MethodName = "UpdateMemo",
  38. ServerParams = new object[]
  39. {
  40. _matInfo.Select(JSONFormat.Format).ToList(),
  41. uteMemo.Text
  42. }
  43. };
  44. ccp = ExecuteNonQuery(ccp, CoreInvokeType.Internal);
  45. MessageUtil.ShowTips(ccp.ReturnInfo);
  46. if (ccp.ReturnInfo.ToString2().Contains("成功"))
  47. {
  48. this.DialogResult = DialogResult.OK;
  49. }
  50. }
  51. private void uteProjectName_KeyPress(object sender, KeyPressEventArgs e)
  52. {
  53. if (e.KeyChar == 13)
  54. {
  55. ubtOK_Click(null, null);
  56. }
  57. }
  58. }
  59. }