| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Data; |
| | | using System.Linq; |
| | | using System.Threading.Tasks; |
| | | using System.Windows.Forms; |
| | | |
| | |
| | | txt_bl014.Text = txt_aboutGuid.GetPrdName(); |
| | | txt_bl015.Text = txt_aboutGuid.GetPrdModel(); |
| | | txt_dptName.Text = txt_aboutGuid.GetWorkName(); |
| | | txt_bl012.Text = txt_aboutGuid.GetWorkXb(); |
| | | txt_lineName.Text = txt_aboutGuid.GetWorkXb(); |
| | | txt_bl013.Text = txt_aboutGuid.GetRwd(); |
| | | txt_tldh.Text = txt_aboutGuid.GetTldh(); |
| | | }; |
| | | |
| | | //选择需要入库的明细 |
| | | btnSelect.Click += (s, e) => |
| | | { |
| | | if (string.IsNullOrEmpty(this.txt_orgId.GetId())) |
| | | { |
| | | MsgHelper.Warning("请选择生产组织!"); |
| | | MsgHelper.ShowError("请选择生产组织!"); |
| | | txt_orgId.Focus(); |
| | | return; |
| | | } |
| | |
| | | return; |
| | | } |
| | | var frm = new UcBlclSelect(txt_aboutGuid.GetId(), this.txt_orgId.GetId()); |
| | | |
| | | if (txt_bl017.Text.Trim() == "生产补料") |
| | | { |
| | | frm = new UcBlclSelect(txt_aboutGuid.GetId(), this.txt_orgId.GetId(), txt_bl017.Text.Trim()); |
| | | } |
| | | else |
| | | { |
| | | frm = new UcBlclSelect(txt_aboutGuid.GetId(), this.txt_orgId.GetId()); |
| | | |
| | | } |
| | | //赋值给明细表 |
| | | frm.UpdateParent += (ss, ee) => |
| | | { |
| | |
| | | _row["bld002"] = dym.itemNo;//物料编号 |
| | | _row["bld003"] = dym.itemName;//物料名称 |
| | | _row["bld004"] = dym.itemModel;//规格型号 |
| | | _row["kbsl"] = dym.kbsl; |
| | | _row["dwName"] = dym.dwName; |
| | | _row["dabGuid"] = dym.dabGuid; |
| | | _row["bld013"] = idx.ToString();//项次 |
| | |
| | | lbGuid, txt_blNo, gridView1, "blNo"); |
| | | if (string.IsNullOrEmpty(rowGuid)) |
| | | { |
| | | MsgHelper.Warning("请先选择你要操作的行!"); |
| | | MsgHelper.ShowError("请先选择你要操作的行!"); |
| | | return; |
| | | } |
| | | if (!MsgHelper.AskQuestion("你选择了【" + rowName + "】,确定删除吗?")) |
| | |
| | | Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 2); |
| | | getPageList(this.pageBar1.CurrentPage); |
| | | } |
| | | MsgHelper.Warning("提示:" + _rtn.rtnMsg); |
| | | MsgHelper.ShowError("提示:" + _rtn.rtnMsg); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | MsgHelper.Warning("提示:" + ex.Message); |
| | | MsgHelper.ShowError("提示:" + ex.Message); |
| | | } |
| | | |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | gvList.Add(gvMx1); |
| | | UtilityHelper.ChangeEnableByControl(this.layoutMx1.Controls, true, gvList); |
| | | } |
| | | //2025/07/12加上修改状态下不能修改 |
| | | txt_orgId.IsReadly = true; |
| | | txt_aboutGuid.IsReadly = true; |
| | | } |
| | | /// <summary> |
| | | /// 新增事件 |
| | |
| | | string inGdId = txt_aboutGuid.GetId();//工单号 |
| | | if (string.IsNullOrEmpty(inGdId)) |
| | | { |
| | | Gs.DevApp.ToolBox.MsgHelper.Warning("请选择工单!"); |
| | | Gs.DevApp.ToolBox.MsgHelper.ShowError("请选择工单!"); |
| | | txt_aboutGuid.Focus(); |
| | | return; |
| | | } |
| | | if (string.IsNullOrEmpty(inGdId)) |
| | | { |
| | | Gs.DevApp.ToolBox.MsgHelper.Warning("请选择工单!"); |
| | | Gs.DevApp.ToolBox.MsgHelper.ShowError("请选择工单!"); |
| | | txt_aboutGuid.Focus(); |
| | | return; |
| | | } |
| | | if (string.IsNullOrEmpty(txt_bl017.Text.Trim())) |
| | | { |
| | | Gs.DevApp.ToolBox.MsgHelper.Warning("请选择单据类型!"); |
| | | Gs.DevApp.ToolBox.MsgHelper.ShowError("请选择单据类型!"); |
| | | txt_bl017.Focus(); |
| | | return; |
| | | } |
| | |
| | | { |
| | | Guid? _guid = UtilityHelper.ToGuid(row["guid"].ToString()); |
| | | string _msl = row["bld007"].ToString(); |
| | | string _kbsl = row["kbsl"].ToString(); |
| | | if (string.IsNullOrEmpty(_msl)) |
| | | { |
| | | MsgHelper.ShowError("数量不能为空!"); |
| | | return; |
| | | } |
| | | |
| | | if (txt_bl017.Text.Trim()=="生产补料") |
| | | { |
| | | if (decimal.TryParse(row["bld007"].ToString(), out decimal msl) && |
| | | decimal.TryParse(row["kbsl"].ToString(), out decimal kbsl)) |
| | | { |
| | | if (msl > kbsl) |
| | | { |
| | | MsgHelper.ShowError("" + |
| | | "申请数量不能大于可补数量!"); |
| | | return; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | // 解析失败的处理 |
| | | MsgHelper.ShowError("" + |
| | | "输入的不是有效数字!"); |
| | | return; |
| | | } |
| | | } |
| | | |
| | | _obj.list.Add(new |
| | | { |
| | | Guid = _guid, |
| | |
| | | { |
| | | 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) |
| | | { |
| | | ToolBox.MsgHelper.ShowInformation("提示:" + _rtn.rtnMsg); |
| | | lbGuid.Text = _rtn.rtnData.outGuid; |
| | | txt_blNo.Text = _rtn.rtnData.outNo; |
| | | toolBarMenu1.isSetBtn = true; |
| | |
| | | toolBarMenu1.currentAction = ""; |
| | | Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 6); |
| | | } |
| | | else |
| | | ToolBox.MsgHelper.ShowError("提示:" + _rtn.rtnMsg); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | ToolBox.MsgHelper.Warning("提示:" + ex.Message); |
| | | ToolBox.MsgHelper.ShowError("提示:" + ex.Message); |
| | | } |
| | | } |
| | | |
| | |
| | | /// <param name="pageSize">每页几条</param> |
| | | private void getPageList(int curPage) |
| | | { |
| | | gcMain1.DataSource = null;var _sbSqlWhere = UtilityHelper.GetSearchWhere(_filterList); |
| | | _sbSqlWhere += " and a.bl008='" + strType + "'"; |
| | | gcMain1.DataSource = null; |
| | | System.Text.StringBuilder _sbSqlWhere = new System.Text.StringBuilder(); |
| | | _sbSqlWhere.Append(" and a.bl008='" + strType + "'"); |
| | | _sbSqlWhere.Append(" and a.org_id in"); |
| | | _sbSqlWhere.Append(ToolBox.UtilityHelper.GetOrgWhere()); |
| | | _sbSqlWhere.Append(UtilityHelper.GetSearchWhere(_filterList)); |
| | | PageQueryModel pgq = new PageQueryModel(curPage, this.pageBar1.RowsCount, "create_date", "asc", "", _sbSqlWhere.ToString()); |
| | | string json = JsonConvert.SerializeObject(pgq); |
| | | try |
| | |
| | | case 0: |
| | | strMsg = "反审核"; |
| | | break; |
| | | }; |
| | | } |
| | | ; |
| | | toolBarMenu1.guidKey = ""; |
| | | string rowGuid, rowName; |
| | | (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1, lbGuid, txt_blNo, gridView1, "blNo"); |
| | | if (string.IsNullOrEmpty(rowGuid)) |
| | | { |
| | | MsgHelper.Warning("请先选择你要操作的行!"); |
| | | MsgHelper.ShowError("请先选择你要操作的行!"); |
| | | return; |
| | | } |
| | | if (!MsgHelper.AskQuestion("你选择了【" + rowName + "】,确定" + strMsg + "吗?")) |
| | |
| | | _webServiceName + "EditModelSubmit", |
| | | JsonConvert.SerializeObject(_obj)); |
| | | var _rtn = UtilityHelper.ReturnToDynamic(strJson); |
| | | MsgHelper.Warning(_rtn.rtnData.outMsg.ToString()); |
| | | |
| | | if (_rtn.rtnCode > 0 && _rtn.rtnData.outSum * 1 > 0) |
| | | { |
| | | MsgHelper.ShowInformation(_rtn.rtnData.outMsg.ToString()); |
| | | if (xtraTabControl1.SelectedTabPageIndex == 1) |
| | | { |
| | | getModel(lbGuid.Text.Trim()); |
| | |
| | | Form parentForm = this.FindForm(); |
| | | UtilityHelper.SetCheckIco(gridView1, "bl018", "bl016", "bl006", picCheckBox, parentForm, _inFieldValue.ToString()); |
| | | } |
| | | else |
| | | MsgHelper.ShowError(_rtn.rtnData.outMsg.ToString()); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | MsgHelper.Warning("提示:" + ex.Message); |
| | | MsgHelper.ShowError("提示:" + ex.Message); |
| | | } |
| | | } |
| | | private void repositoryItemButtonEdit1_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e) |
| | |
| | | var _rtn = UtilityHelper.ReturnToDynamic(strJson); |
| | | if (_rtn.rtnCode > 0) |
| | | { |
| | | if (_rtn.rtnCode > 0) getModel(lbGuid.Text); |
| | | MsgHelper.ShowInformation("提示:" + _rtn.rtnMsg); |
| | | getModel(lbGuid.Text); |
| | | } |
| | | MsgHelper.Warning("提示:" + _rtn.rtnMsg); |
| | | else |
| | | MsgHelper.ShowError("提示:" + _rtn.rtnMsg); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | MsgHelper.Warning("提示:" + ex.Message); |
| | | MsgHelper.ShowError("提示:" + ex.Message); |
| | | } |
| | | } |
| | | } |