| | |
| | | using System.Drawing; |
| | | using System.Text; |
| | | using System.Windows.Forms; |
| | | using DevExpress.DataAccess.DataFederation; |
| | | using DevExpress.XtraEditors; |
| | | using DevExpress.XtraEditors.Controls; |
| | | using DevExpress.XtraGrid.Views.Base.ViewInfo; |
| | | using DevExpress.XtraGrid.Views.Grid; |
| | | using Gs.DevApp.Entity; |
| | | using Gs.DevApp.ToolBox; |
| | |
| | | e.Bounds.Top + 45, e.Bounds.Right - 5, e.Bounds.Height - 5); |
| | | e.Graphics.DrawString(str, f, Brushes.Gray, r); |
| | | }; |
| | | this.txt_depotsCode.KeyFile = "depotCode"; |
| | | this.txt_suppNo.KeyFile = "suppNo"; |
| | | //设置仓库选择 |
| | | this.txt_depotsId.KeyFile = "depotId"; |
| | | this.txt_depotsId.EditChanged += (s, e) => |
| | | { |
| | | txtDepotsId.Text = this.txt_depotsId.GetId(); |
| | | }; |
| | | //设置供应商选择 |
| | | this.txt_suppId.KeyFile = "id"; |
| | | this.txt_suppId.EditChanged += (s, e) => |
| | | { |
| | | txtSupplierId.Text = this.txt_suppId.GetId(); |
| | | }; |
| | | //选择需要入库的明细 |
| | | btnSelect.Click += (s, e) => |
| | | { |
| | | if (string.IsNullOrEmpty(this.txt_suppNo.GetId())) |
| | | if (string.IsNullOrEmpty(this.txt_suppId.GetId())) |
| | | { |
| | | Gs.DevApp.ToolBox.MsgHelper.ShowError("请先选择供应商,才能选择来料明细!"); |
| | | return; |
| | | } |
| | | System.Text.StringBuilder sbWhere = new StringBuilder(); |
| | | sbWhere.Append(" and A.SUPPLIER=" + this.txt_suppNo.GetId()); |
| | | var frm = new SelectCgMx(this.txt_suppNo.GetCode(), sbWhere.ToString()); |
| | | var frm = new SelectCgMx(this.txt_suppId.GetId()); |
| | | //赋值给明细表 |
| | | frm.UpdateParent += (ss, ee) => |
| | | { |
| | | var lst = new List<string>(); |
| | |
| | | frm.ShowDialog(); |
| | | }; |
| | | } |
| | | |
| | | private void ToolBarMenu1_btnLogClick(object sender, EventArgs e) |
| | | { |
| | | toolBarMenu1.guidKey = ""; |
| | | string rowGuid, rowName; |
| | | (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1, |
| | | lbGuid, txt_billNo, gridView1); |
| | | toolBarMenu1.guidKey = rowGuid; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 反检验 |
| | | /// </summary> |
| | | /// <param name="sender"></param> |
| | | /// <param name="e"></param> |
| | | /// <exception cref="NotImplementedException"></exception> |
| | | private void ToolBarMenu1_btnFjianYanClick(object sender, EventArgs e) |
| | | { |
| | | toolBarMenu1.guidKey = ""; |
| | | string rowGuid, rowName; |
| | | (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1, |
| | | lbGuid, txt_billNo, gridView1); |
| | | toolBarMenu1.guidKey = rowGuid; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 检验 |
| | | /// </summary> |
| | | /// <param name="sender"></param> |
| | | /// <param name="e"></param> |
| | | /// <exception cref="NotImplementedException"></exception> |
| | | private void ToolBarMenu1_btnJianYanClick(object sender, EventArgs e) |
| | | { |
| | | toolBarMenu1.guidKey = ""; |
| | | string rowGuid, rowName; |
| | | (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1, |
| | | lbGuid, txt_billNo, gridView1); |
| | | toolBarMenu1.guidKey = rowGuid; |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// 双击事件 |
| | |
| | | _filterList = e.FilterList; |
| | | getPageList(1, pageBar1.RowsCount); |
| | | } |
| | | /// <summary> |
| | | /// 日志 |
| | | /// </summary> |
| | | /// <param name="sender"></param> |
| | | /// <param name="e"></param> |
| | | private void ToolBarMenu1_btnLogClick(object sender, EventArgs e) |
| | | { |
| | | toolBarMenu1.guidKey = ""; |
| | | string rowGuid, rowName; |
| | | (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1, |
| | | lbGuid, txt_billNo, gridView1); |
| | | toolBarMenu1.guidKey = rowGuid; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 反检验 |
| | | /// </summary> |
| | | /// <param name="sender"></param> |
| | | /// <param name="e"></param> |
| | | /// <exception cref="NotImplementedException"></exception> |
| | | private void ToolBarMenu1_btnFjianYanClick(object sender, EventArgs e) |
| | | { |
| | | toolBarMenu1.guidKey = ""; |
| | | string rowGuid, rowName; |
| | | (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1, |
| | | lbGuid, txt_billNo, gridView1); |
| | | toolBarMenu1.guidKey = rowGuid; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 检验 |
| | | /// </summary> |
| | | /// <param name="sender"></param> |
| | | /// <param name="e"></param> |
| | | /// <exception cref="NotImplementedException"></exception> |
| | | private void ToolBarMenu1_btnJianYanClick(object sender, EventArgs e) |
| | | { |
| | | toolBarMenu1.guidKey = ""; |
| | | string rowGuid, rowName; |
| | | (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1, |
| | | lbGuid, txt_billNo, gridView1); |
| | | toolBarMenu1.guidKey = rowGuid; |
| | | } |
| | | /// <summary> |
| | | /// 取消事件 |
| | | /// </summary> |
| | |
| | | private void ToolBarMenu1_btnSaveClick(object sender, EventArgs e) |
| | | { |
| | | toolBarMenu1.isSetBtn = false; |
| | | var _ckCode = txt_depotsCode.GetCode(); //仓库编号 depots_code |
| | | var _gysCode = txt_suppNo.GetCode(); //供应商编号 |
| | | if (string.IsNullOrEmpty(_gysCode)) |
| | | var _ckId = txt_depotsId.GetId(); //仓库编号 depots_code |
| | | var _gysId = txt_suppId.GetId(); //供应商编号 |
| | | if (string.IsNullOrEmpty(_gysId)) |
| | | { |
| | | MsgHelper.Warning("请选择供应商!"); |
| | | txt_suppNo.Focus(); |
| | | txt_suppId.Focus(); |
| | | return; |
| | | } |
| | | |
| | | if (string.IsNullOrEmpty(_ckCode)) |
| | | if (string.IsNullOrEmpty(_ckId)) |
| | | { |
| | | MsgHelper.Warning("请选择仓库!"); |
| | | txt_depotsCode.Focus(); |
| | | txt_depotsId.Focus(); |
| | | return; |
| | | } |
| | | var _obj = new MesInvItemArn(); |
| | | _obj.Guid = Gs.DevApp.ToolBox.UtilityHelper.ToGuid(lbGuid.Text.Trim()); //到货单主键 |
| | | _obj.PaperBillNo = txt_paperBillNo.Text.Trim(); //送货单号; |
| | | _obj.Remark = txt_remark.Text.Trim(); //备注 |
| | | _obj.SuppNo = _gysCode; //供应商编号 |
| | | _obj.DepotsCode = _ckCode; //仓库编号 depots_code |
| | | _obj.FType = txt_fType.Checked; //0=采购,1=委外 |
| | | _obj.UrgentFlag = txt_urgentFlag.Checked;//0=不急,1=急 |
| | | _obj.list = new List<MesInvItemArnDetail>(); |
| | | var _obj = new MesInvItemArn() |
| | | { |
| | | Guid = Gs.DevApp.ToolBox.UtilityHelper.ToGuid(lbGuid.Text.Trim()), //到货单主键 |
| | | PaperBillNo = txt_paperBillNo.Text.Trim(), //送货单号; |
| | | Remark = txt_remark.Text.Trim(), //备注 |
| | | SuppId = _gysId, //供应商 |
| | | DepotsId = _ckId,//仓库 |
| | | FType = txt_fType.Checked,//0=采购,1=委外 |
| | | UrgentFlag = txt_urgentFlag.Checked,//0=不急,1=急 |
| | | list = new List<MesInvItemArnDetail>(), |
| | | }; |
| | | gvMx1.CloseEditor(); |
| | | gvMx1.UpdateCurrentRow(); |
| | | if (gvMx1.DataRowCount <= 0) |
| | |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 明细删除 |
| | | /// </summary> |
| | | /// <param name="sender"></param> |
| | | /// <param name="e"></param> |
| | | private void repositoryItemButtonEdit1_ButtonClick(object sender, |
| | | ButtonPressedEventArgs e) |
| | | { |