| | |
| | | { |
| | | var lst = new List<string>(); |
| | | lst = ee.StringList; |
| | | var _obj = lst; |
| | | var strReturn = UtilityHelper.HttpPost("", _webServiceName + "SelectFormTo", JsonConvert.SerializeObject(_obj)); |
| | | var dt = UtilityHelper.ReturnToList(strReturn); |
| | | string strReturn = ""; |
| | | ReturnModel<DataTable> dt; |
| | | #region 这是Srm来的单子 |
| | | if (lst == null) |
| | | { |
| | | string strSrmNo = ""; |
| | | List<dynamic> lstSrm = new List<dynamic>(); |
| | | lstSrm = ee.DynamicList; |
| | | strSrmNo = lstSrm[0].guid; |
| | | txt_paperBillNo.Text = strSrmNo; |
| | | var _obj = new |
| | | { |
| | | inShdh = strSrmNo, |
| | | inP1 = "", |
| | | inP2 = "" |
| | | }; |
| | | strReturn = UtilityHelper.HttpPost("", _webServiceName + "SelectSrmTo", JsonConvert.SerializeObject(_obj)); |
| | | dt = UtilityHelper.ReturnToList(strReturn); |
| | | //禁止修改数量 |
| | | gvMx1quantity.OptionsColumn.ReadOnly = true; |
| | | txt_paperBillNo.ReadOnly = true; |
| | | txt_isSrm.Checked = true; |
| | | } |
| | | #endregion |
| | | #region 这是普通的单 |
| | | else |
| | | { |
| | | txt_paperBillNo.Text = ""; |
| | | var _obj = lst; |
| | | strReturn = UtilityHelper.HttpPost("", _webServiceName + "SelectFormTo", JsonConvert.SerializeObject(_obj)); |
| | | dt = UtilityHelper.ReturnToList(strReturn); |
| | | //修改数量 |
| | | gvMx1quantity.OptionsColumn.ReadOnly = false; |
| | | txt_paperBillNo.ReadOnly = false; |
| | | txt_isSrm.Checked = false; |
| | | } |
| | | #endregion |
| | | |
| | | DataTable _newTable = dt.rtnData; |
| | | DataTable _oldTable = (DataTable)gcMx1.DataSource; |
| | | DataRow[] sourceRows = _newTable.Select(); |
| | |
| | | }; |
| | | frm.ShowDialog(); |
| | | }; |
| | | //选择srm明细 |
| | | txt_paperBillNo.ButtonClick += (s, e) => |
| | | { |
| | | string strSrmNo = ""; |
| | | SelectSrm frm = new SelectSrm(); |
| | | frm.UpdateParent += (ss, ee) => |
| | | { |
| | | var lst = new List<dynamic>(); |
| | | lst = ee.DynamicList; |
| | | strSrmNo = lst[0].guid; |
| | | txt_paperBillNo.Text = strSrmNo; |
| | | txt_receiveOrgId.SetIdOrCode(lst[0].receiveOrgId); |
| | | txt_suppId.SetIdOrCode(lst[0].suppId); |
| | | var _obj = new |
| | | { |
| | | inShdh = strSrmNo, |
| | | inP1 = "", |
| | | inP2 = "" |
| | | }; |
| | | var strReturn = UtilityHelper.HttpPost("", _webServiceName + "SelectSrmTo", JsonConvert.SerializeObject(_obj)); |
| | | var dt = UtilityHelper.ReturnToList(strReturn); |
| | | DataTable _newTable = dt.rtnData; |
| | | DataTable _oldTable = (DataTable)gcMx1.DataSource; |
| | | DataRow[] sourceRows = _newTable.Select(); |
| | | for (int i = 0; i < sourceRows.Length; i++) |
| | | { |
| | | _oldTable.ImportRow(sourceRows[i]); |
| | | } |
| | | gcMx1.BindingContext = new BindingContext(); |
| | | gcMx1.DataSource = _oldTable; |
| | | gcMx1.ForceInitialize(); |
| | | gvMx1.PostEditor(); |
| | | gvMx1.UpdateCurrentRow(); |
| | | }; |
| | | frm.ShowDialog(); |
| | | }; |
| | | |
| | | } |
| | | |
| | | |
| | |
| | | gridViews.Add(gvMx1); |
| | | UtilityHelper.CleanValueByControl(this.layoutMx1.Controls, true, gridViews); |
| | | Gs.DevApp.ToolBox.UtilityHelper.SetDefaultTable(gcMx1, gvMx1); |
| | | //增加时,默认组织 |
| | | string deftOrg = UtilityHelper.GetFirstOrg(txt_receiveOrgId); |
| | | setSrm(false); |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | string _gysId = txt_suppId.GetId(); //供应商编号 |
| | | if (string.IsNullOrEmpty(_orgId)) |
| | | { |
| | | MsgHelper.Warning("请选择收料组织!"); |
| | | MsgHelper.ShowError("请选择收料组织!"); |
| | | txt_receiveOrgId.Focus(); |
| | | return; |
| | | } |
| | | if (string.IsNullOrEmpty(_gysId)) |
| | | { |
| | | MsgHelper.Warning("请选择供应商!"); |
| | | MsgHelper.ShowError("请选择供应商!"); |
| | | txt_suppId.Focus(); |
| | | return; |
| | | } |
| | |
| | | Remark = txt_remark.Text.Trim(), //备注 |
| | | SuppId = _gysId, //供应商 |
| | | OrgId = _orgId, |
| | | IsSrm = (txt_isSrm.Checked ? 1 : 0), |
| | | list = new List<dynamic>(), |
| | | }; |
| | | gvMx1.CloseEditor(); |
| | |
| | | _webServiceName + "EditModel", |
| | | JsonConvert.SerializeObject(_obj)); |
| | | var _rtn = UtilityHelper.ReturnToDynamic(strJson); |
| | | MsgHelper.Warning("提示:" + _rtn.rtnMsg); |
| | | if (_rtn.rtnCode > 0) |
| | | { |
| | | MsgHelper.ShowInformation("提示:" + _rtn.rtnMsg); |
| | | lbGuid.Text = _rtn.rtnData.outGuid; |
| | | txt_billNo.Text = _rtn.rtnData.outNo; |
| | | toolBarMenu1.isSetBtn = true; |
| | |
| | | toolBarMenu1.currentAction = ""; |
| | | Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 6); |
| | | } |
| | | else |
| | | MsgHelper.ShowError("提示:" + _rtn.rtnMsg); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | MsgHelper.Warning("提示:" + ex.Message); |
| | | MsgHelper.ShowError("提示:" + ex.Message); |
| | | } |
| | | } |
| | | |
| | |
| | | else |
| | | { |
| | | UtilityHelper.SetDefaultTable(gcMx1, gvMx1); |
| | | } |
| | | //如果是srm,禁用 |
| | | if (txt_isSrm.Checked) |
| | | { |
| | | setSrm(true); |
| | | } |
| | | else { |
| | | setSrm(false); |
| | | } |
| | | } |
| | | else |
| | |
| | | frm.ShowDialog(); |
| | | } |
| | | |
| | | private void setSrm(bool isSrm) { |
| | | if (isSrm == true) |
| | | { |
| | | gvMx1quantity.OptionsColumn.ReadOnly = true; |
| | | txt_paperBillNo.ReadOnly = true; |
| | | txt_isSrm.Checked = true; |
| | | txt_receiveOrgId.Enabled = false; |
| | | txt_suppId.Enabled = false; |
| | | btnSelect.Enabled = false; |
| | | } |
| | | else { |
| | | gvMx1quantity.OptionsColumn.ReadOnly = false; |
| | | txt_paperBillNo.ReadOnly = false; |
| | | txt_isSrm.Checked = false; |
| | | txt_receiveOrgId.Enabled = true; |
| | | txt_suppId.Enabled = true; |
| | | btnSelect.Enabled = true; |
| | | } |
| | | } |
| | | } |
| | | } |