| | |
| | | using DevExpress.Utils.MVVM.Services; |
| | | using Gs.DevApp.Entity; |
| | | using Gs.DevApp.ToolBox; |
| | | using Gs.DevApp.UserControl; |
| | |
| | | using System.Collections.Generic; |
| | | using System.Data; |
| | | using System.Threading.Tasks; |
| | | using System.Windows.Controls; |
| | | using System.Windows.Forms; |
| | | |
| | | namespace Gs.DevApp.DevFrm |
| | |
| | | InitializeComponent(); |
| | | this.toolBarMenu1.btnLoadClick += ToolBarMenu1_btnLoadClick; |
| | | this.toolBarMenu1.btnQueryClick += ToolBarMenu1_btnQueryClick; |
| | | //toolBarMenu1.btnReportClick += ToolBarMenu1_btnReportClick; |
| | | //toolBarMenu1.btnDesignClick += ToolBarMenu1_btnDesignClick; |
| | | Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameterMx(gvMx1); |
| | | Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameterMx(gvMx2); |
| | | Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameter(gridView1, null, null, "", "", (value) => |
| | |
| | | //设置仓库选择 |
| | | this.txt_depotsId.EditChanged += (s, e) => |
| | | { |
| | | txtDepotsId.Text = this.txt_depotsId.GetId(); |
| | | txtDepotsId.Text = this.txt_depotsId.GetCode(); |
| | | }; |
| | | //设置供应商选择 |
| | | this.txt_suppId.EditChanged += (s, e) => |
| | | { |
| | | txtSupplierId.Text = this.txt_suppId.GetId(); |
| | | txtSupplierId.Text = this.txt_suppId.GetCode(); |
| | | }; |
| | | gcMx1.MouseClick += GcMx1_MouseClick; |
| | | |
| | | this.ucBtnPrint1.btnDesignClick += (s, e) => |
| | | { |
| | | ucBtnPrint1.rptParameter = "rpt_Arrival{}"; |
| | | }; |
| | | this.ucBtnPrint1.btnReportClick += (s, e) => |
| | | { |
| | | ucBtnPrint1.guidKey = ""; |
| | | string rowGuid = lbMxGuid.Text.Trim(); |
| | | ucBtnPrint1.guidKey = rowGuid; |
| | | if (string.IsNullOrEmpty(txt_iCount_1.Text.Trim())) |
| | |
| | | + "," + txt_psnQty_1.Text.Trim() |
| | | + "}"; |
| | | }; |
| | | gvMx1.FocusedRowChanged += GvMx1_FocusedRowChanged; |
| | | } |
| | | private void GridView1_ColumnFilterChanged(object sender, EventArgs e) |
| | | { |
| | |
| | | Task.Delay(100); |
| | | getPageList(1); |
| | | } |
| | | private void GcMx1_MouseClick(object sender, MouseEventArgs e) |
| | | private void GvMx1_FocusedRowChanged(object sender, DevExpress.XtraGrid.Views.Base.FocusedRowChangedEventArgs e) |
| | | { |
| | | string rowGuid = Gs.DevApp.ToolBox.UtilityHelper.GetCurrentDoubleRow(gvMx1, e, "guid"); |
| | | if (string.IsNullOrEmpty(rowGuid)) |
| | | return; |
| | | lbMxGuid.Text = rowGuid; |
| | | toolBarMenu1.guidKey = rowGuid; |
| | | var info = gvMx1.CalcHitInfo(e.Location); |
| | | var view = info.View; |
| | | var row = view.GetDataRow(info.RowHandle); |
| | | txtWlid.Text = row["itemId"].ToString(); |
| | | txtWlgg.Text = row["itemModel"].ToString(); |
| | | txtWlmc.Text = row["itemName"].ToString(); |
| | | txtQuantity.Text = row["Quantity"].ToString(); |
| | | kyPrtQty.Text = row["kyPrtQty"].ToString(); |
| | | if (e.FocusedRowHandle >= 0) |
| | | { |
| | | DataRow row = gvMx1.GetDataRow(e.FocusedRowHandle); |
| | | lbMxGuid.Text = row["guid"].ToString(); |
| | | txtWlid.Text = row["itemNo"].ToString(); |
| | | txtWlgg.Text = row["itemModel"].ToString(); |
| | | txtWlmc.Text = row["itemName"].ToString(); |
| | | txtQuantity.Text = row["quantity"].ToString();//本次收货总量 |
| | | txtYdy.Text = row["yQty"].ToString();//已打印总量 |
| | | txtKdy.Text = row["kQty"].ToString(); //可打印总量 |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 分页事件 |
| | | /// </summary> |
| | |
| | | { |
| | | _filterList = e.FilterList; |
| | | getPageList(1); |
| | | } |
| | | private void ToolBarMenu1_btnDesignClick(object sender, EventArgs e) |
| | | { |
| | | toolBarMenu1.guidKey = ""; |
| | | string rowGuid, rowName; |
| | | (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1, |
| | | lbGuid, txt_billNo, gridView1); |
| | | toolBarMenu1.guidKey = rowGuid; |
| | | toolBarMenu1.rptParameter = "rpt_Arrival{}"; |
| | | } |
| | | private void ToolBarMenu1_btnReportClick(object sender, EventArgs e) |
| | | { |
| | | _print(); |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | } |
| | | private void getModel(string strGuid) |
| | | { |
| | | gcMx1.DataSource = null; |
| | | bool isEdit = false; |
| | | if (toolBarMenu1.currentAction == "add") return; |
| | | if (toolBarMenu1.currentAction == "edit") isEdit = true; |
| | |
| | | { |
| | | array1.Add(a); |
| | | } |
| | | |
| | | DataTable dt1 = JsonConvert.DeserializeObject<DataTable>(array1.ToString()); |
| | | if (dt1.Rows.Count > 0) |
| | | { |
| | |
| | | { |
| | | ToolBox.MsgHelper.Warning("提示:" + ex.Message); |
| | | } |
| | | } |
| | | private void _print() |
| | | { |
| | | toolBarMenu1.guidKey = ""; |
| | | string rowGuid, rowName; |
| | | (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1, |
| | | lbGuid, txt_billNo, gridView1); |
| | | toolBarMenu1.guidKey = rowGuid; |
| | | if (xtraTabControl1.SelectedTabPageIndex == 0) |
| | | { |
| | | Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 5); |
| | | this.toolBarMenu1.rptParameter = "return false"; |
| | | return; |
| | | } |
| | | if (lbMxGuid.Text.Trim().Length < 36) |
| | | { |
| | | Gs.DevApp.ToolBox.MsgHelper.ShowError("请选择你要打印的行!"); |
| | | this.toolBarMenu1.rptParameter = "return false"; |
| | | return; |
| | | } |
| | | if (string.IsNullOrEmpty(txt_iCount_1.Text.Trim())) |
| | | { |
| | | Gs.DevApp.ToolBox.MsgHelper.ShowError("请选择打印条码张数!"); |
| | | txt_iCount_1.Focus(); |
| | | this.toolBarMenu1.rptParameter = "return false"; |
| | | return; |
| | | } |
| | | if (string.IsNullOrEmpty(txt_psnQty_1.Text.Trim())) |
| | | { |
| | | Gs.DevApp.ToolBox.MsgHelper.ShowError("请选择打印条码数量!"); |
| | | txt_psnQty_1.Focus(); |
| | | this.toolBarMenu1.rptParameter = "return false"; |
| | | return; |
| | | } |
| | | toolBarMenu1.guidKey = lbMxGuid.Text; |
| | | this.toolBarMenu1.rptParameter = "rpt_Arrival{" + "" |
| | | + "," + "" |
| | | + "," + "" |
| | | + "," + txt_iCount_1.Text.Trim() |
| | | + "," + txt_psnQty_1.Text.Trim() |
| | | + "}"; |
| | | } |
| | | } |
| | | } |