| | |
| | | private void ToolBarMenu1_btnSaveClick(object sender, EventArgs e) |
| | | { |
| | | toolBarMenu1.isSetBtn = false; |
| | | //string djlx = txt_fBillTypeID.Text.ToString(); |
| | | //string ywlx = txt_fBusinessType.Text.ToString(); |
| | | //string dbfx = txt_fTransferDirect.Text.ToString(); |
| | | //string sqOrg = txt_fapporgid.GetId(); |
| | | //string dblx = txt_ftranstype.Text.ToString(); |
| | | //string dchzlx = txt_fOwnerTypeIdHead.Text.ToString(); |
| | | //string drhzlx = txt_fOwnerTypeInIdHead.Text.ToString(); |
| | | //if (txt_fBillTypeID.SelectedIndex <= 0) |
| | | //{ |
| | | // Gs.DevApp.ToolBox.MsgHelper.Warning("请选择单据类型!"); |
| | | // txt_fBillTypeID.Focus(); |
| | | // return; |
| | | //} |
| | | //if (txt_fTransferDirect.SelectedIndex <= 0) |
| | | //{ |
| | | // Gs.DevApp.ToolBox.MsgHelper.Warning("请选择调拨方向!"); |
| | | // txt_fTransferDirect.Focus(); |
| | | // return; |
| | | //} |
| | | //if (string.IsNullOrEmpty(sqOrg)) |
| | | //{ |
| | | // Gs.DevApp.ToolBox.MsgHelper.Warning("请选择申请组织!"); |
| | | // txt_fapporgid.Focus(); |
| | | // return; |
| | | //} |
| | | //if (txt_fOwnerTypeIdHead.SelectedIndex <= 0) |
| | | //{ |
| | | // Gs.DevApp.ToolBox.MsgHelper.Warning("请选择调出货主类型!"); |
| | | // txt_fOwnerTypeIdHead.Focus(); |
| | | // return; |
| | | //} |
| | | //if (txt_fOwnerTypeInIdHead.SelectedIndex <= 0) |
| | | //{ |
| | | // Gs.DevApp.ToolBox.MsgHelper.Warning("请选择调入货主类型!"); |
| | | // txt_fOwnerTypeInIdHead.Focus(); |
| | | // return; |
| | | //} |
| | | //var _obj = new |
| | | //{ |
| | | // guid = UtilityHelper.ToGuid(lbGuid.Text.Trim()), //主建 |
| | | // djlx = djlx,//单据类型 |
| | | // ywlx = ywlx,//业务类型 |
| | | // dbfx = dbfx,//调拨方向 |
| | | // sqOrg = sqOrg,//审请组织 |
| | | // dblx = dblx,//调拨类型 |
| | | // dchzlx = dchzlx,//调出货主类型 |
| | | // drhzlx = drhzlx,//调入货主类型 |
| | | // inRemark = txt_fRemarks.Text.Trim(),//备注 |
| | | // list = new List<dynamic>(), |
| | | //}; |
| | | string djlx = txt_fBillTypeID.Text.ToString(); |
| | | string FNote = txt_fNote.Text.ToString(); |
| | | string _sqGuid = txt_salesId.GetId(); |
| | | if (txt_fBillTypeID.SelectedIndex < 0) |
| | | { |
| | | Gs.DevApp.ToolBox.MsgHelper.Warning("请选择单据类型!"); |
| | | txt_fBillTypeID.Focus(); |
| | | return; |
| | | } |
| | | if (string.IsNullOrEmpty(_sqGuid)) |
| | | { |
| | | Gs.DevApp.ToolBox.MsgHelper.Warning("请选择申请组织!"); |
| | | txt_salesId.Focus(); |
| | | return; |
| | | } |
| | | var _obj = new |
| | | { |
| | | guid = UtilityHelper.ToGuid(lbGuid.Text.Trim()), //主建 |
| | | djlx = djlx,//单据类型 |
| | | salesId = _sqGuid,//销售单号 |
| | | inRemark = FNote.Trim(),//备注 |
| | | list = new List<dynamic>(), |
| | | }; |
| | | gvMx1.CloseEditor(); |
| | | gvMx1.UpdateCurrentRow(); |
| | | if (gvMx1.DataRowCount <= 0) |
| | |
| | | if (row != null) |
| | | { |
| | | Guid? _guid = UtilityHelper.ToGuid(row["id"].ToString()); |
| | | string _msl = row["shNum"].ToString(); |
| | | string _msl = row["fMustQty"].ToString(); |
| | | if (string.IsNullOrEmpty(_msl)) |
| | | { |
| | | MsgHelper.ShowError("数量不能为空!"); |
| | | return; |
| | | } |
| | | //_obj.list.Add(new |
| | | //{ |
| | | // Guid = _guid, |
| | | // ItemId = (row["itemId"].ToString()), |
| | | // Sqsl = (row["shNum"].ToString()), |
| | | // Bz = (row["remark"].ToString()), |
| | | // dczz = (row["dcOrgGuid"].ToString()), |
| | | // dcck = (row["dcCkGuid"].ToString()), |
| | | // drzz = (row["drOrgGuid"].ToString()), |
| | | // drck = (row["drCkGuid"].ToString()), |
| | | // dchz = (row["dcHzGuid"].ToString()), |
| | | // drhz = (row["drHzGuid"].ToString()), |
| | | //}); |
| | | _obj.list.Add(new |
| | | { |
| | | Guid = _guid, |
| | | SalesDetailId = (row["salesDetailId"].ToString()), |
| | | Sqsl = (row["fMustQty"].ToString()), |
| | | Bz = (row["fEntrynote"].ToString()), |
| | | }); |
| | | } |
| | | } |
| | | try |
| | | { |
| | | //string strJson = UtilityHelper.HttpPost("", _webServiceName + "EditModel", JsonConvert.SerializeObject(_obj)); |
| | | //ReturnModel<dynamic> _rtn = ToolBox.UtilityHelper.ReturnToDynamic(strJson); |
| | | //ToolBox.MsgHelper.Warning("提示:" + _rtn.rtnMsg); |
| | | //if (_rtn.rtnCode > 0) |
| | | //{ |
| | | // lbGuid.Text = _rtn.rtnData.outGuid; |
| | | // txt_billNo.Text = _rtn.rtnData.outNo; |
| | | // toolBarMenu1.isSetBtn = true; |
| | | // List<DevExpress.XtraGrid.Views.Grid.GridView> gvList = new List<DevExpress.XtraGrid.Views.Grid.GridView>(); |
| | | // gvList.Add(gvMx1); |
| | | // UtilityHelper.ChangeEnableByControl(this.panel1.Controls, false, gvList); |
| | | // toolBarMenu1.currentAction = ""; |
| | | //} |
| | | string strJson = UtilityHelper.HttpPost("", _webServiceName + "EditModel", JsonConvert.SerializeObject(_obj)); |
| | | ReturnModel<dynamic> _rtn = ToolBox.UtilityHelper.ReturnToDynamic(strJson); |
| | | ToolBox.MsgHelper.Warning("提示:" + _rtn.rtnMsg); |
| | | if (_rtn.rtnCode > 0) |
| | | { |
| | | lbGuid.Text = _rtn.rtnData.outGuid; |
| | | txt_billNo.Text = _rtn.rtnData.outNo; |
| | | toolBarMenu1.isSetBtn = true; |
| | | List<DevExpress.XtraGrid.Views.Grid.GridView> gvList = new List<DevExpress.XtraGrid.Views.Grid.GridView>(); |
| | | gvList.Add(gvMx1); |
| | | UtilityHelper.ChangeEnableByControl(this.panel1.Controls, false, gvList); |
| | | toolBarMenu1.currentAction = ""; |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | |
| | | { |
| | | SearchLookUpEdit LookupEdit = sender as SearchLookUpEdit; |
| | | DataRowView SelectedDataRow = (DataRowView)LookupEdit.GetSelectedDataRow(); |
| | | gvMx1.SetFocusedRowCellValue("itemNo", SelectedDataRow["itemNo"].ToString()); |
| | | gvMx1.SetFocusedRowCellValue("itemName", SelectedDataRow["itemName"].ToString()); |
| | | gvMx1.SetFocusedRowCellValue("itemModel", SelectedDataRow["itemModel"].ToString()); |
| | | gvMx1.SetFocusedRowCellValue("itemId", SelectedDataRow["id"].ToString()); |
| | | gvMx1.SetFocusedRowCellValue("itemUnit", SelectedDataRow["dwName"].ToString()); |
| | | //gvMx1.SetFocusedRowCellValue("itemNo", SelectedDataRow["itemNo"].ToString()); |
| | | //gvMx1.SetFocusedRowCellValue("itemName", SelectedDataRow["itemName"].ToString()); |
| | | //gvMx1.SetFocusedRowCellValue("itemModel", SelectedDataRow["itemModel"].ToString()); |
| | | //gvMx1.SetFocusedRowCellValue("itemId", SelectedDataRow["id"].ToString()); |
| | | //gvMx1.SetFocusedRowCellValue("itemUnit", SelectedDataRow["dwName"].ToString()); |
| | | gvMx1.SetFocusedRowCellValue("salesDetailId", SelectedDataRow["id"].ToString()); |
| | | gvMx1.CloseEditor(); |
| | | gvMx1.UpdateCurrentRow(); |
| | | } |