lu
2025-03-21 5572195c2d91b1145a3360f0e3651aa67ea425db
查询
已修改4个文件
294 ■■■■ 文件已修改
DevApp/Gs.DevApp/App.config 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
DevApp/Gs.DevApp/Properties/licenses.licx 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
DevApp/Gs.DevApp/UserControl/ShowFilter.Designer.cs 120 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
DevApp/Gs.DevApp/UserControl/ShowFilter.cs 169 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
DevApp/Gs.DevApp/App.config
@@ -28,8 +28,8 @@
        </assemblyBinding>
    </runtime>
    <appSettings>
         <add key="WebApiUrl" value="http://localhost:5263/" />
        <!--<add key="WebApiUrl" value="http://192.168.1.145:81/" />-->
         <!--<add key="WebApiUrl" value="http://localhost:5263/" />-->
        <add key="WebApiUrl" value="http://192.168.1.145:81/" />
        <add key="LogPath" value="logs" />
        <add key="ProductName" value="广深科技 G-MES V2.0" />
        <add key="PageSize" value="50" />
DevApp/Gs.DevApp/Properties/licenses.licx
@@ -4,6 +4,7 @@
DevExpress.XtraEditors.Repository.RepositoryItemButtonEdit, DevExpress.XtraEditors.v22.2, Version=22.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
DevExpress.XtraEditors.ComboBoxEdit, DevExpress.XtraEditors.v22.2, Version=22.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
DevExpress.XtraBars.Ribbon.RibbonControl, DevExpress.XtraBars.v22.2, Version=22.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
DevExpress.XtraEditors.Repository.RepositoryItemGridLookUpEdit, DevExpress.XtraGrid.v22.2, Version=22.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
DevExpress.XtraEditors.Repository.RepositoryItemComboBox, DevExpress.XtraEditors.v22.2, Version=22.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
DevExpress.XtraEditors.SearchLookUpEdit, DevExpress.XtraGrid.v22.2, Version=22.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
DevExpress.XtraLayout.LayoutControl, DevExpress.XtraLayout.v22.2, Version=22.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
DevApp/Gs.DevApp/UserControl/ShowFilter.Designer.cs
@@ -34,6 +34,16 @@
            DevExpress.Utils.SerializableAppearanceObject serializableAppearanceObject2 = new DevExpress.Utils.SerializableAppearanceObject();
            DevExpress.Utils.SerializableAppearanceObject serializableAppearanceObject3 = new DevExpress.Utils.SerializableAppearanceObject();
            DevExpress.Utils.SerializableAppearanceObject serializableAppearanceObject4 = new DevExpress.Utils.SerializableAppearanceObject();
            DevExpress.XtraEditors.Controls.EditorButtonImageOptions editorButtonImageOptions2 = new DevExpress.XtraEditors.Controls.EditorButtonImageOptions();
            DevExpress.Utils.SerializableAppearanceObject serializableAppearanceObject5 = new DevExpress.Utils.SerializableAppearanceObject();
            DevExpress.Utils.SerializableAppearanceObject serializableAppearanceObject6 = new DevExpress.Utils.SerializableAppearanceObject();
            DevExpress.Utils.SerializableAppearanceObject serializableAppearanceObject7 = new DevExpress.Utils.SerializableAppearanceObject();
            DevExpress.Utils.SerializableAppearanceObject serializableAppearanceObject8 = new DevExpress.Utils.SerializableAppearanceObject();
            DevExpress.XtraEditors.Controls.EditorButtonImageOptions editorButtonImageOptions3 = new DevExpress.XtraEditors.Controls.EditorButtonImageOptions();
            DevExpress.Utils.SerializableAppearanceObject serializableAppearanceObject9 = new DevExpress.Utils.SerializableAppearanceObject();
            DevExpress.Utils.SerializableAppearanceObject serializableAppearanceObject10 = new DevExpress.Utils.SerializableAppearanceObject();
            DevExpress.Utils.SerializableAppearanceObject serializableAppearanceObject11 = new DevExpress.Utils.SerializableAppearanceObject();
            DevExpress.Utils.SerializableAppearanceObject serializableAppearanceObject12 = new DevExpress.Utils.SerializableAppearanceObject();
            this.repositoryItemButtonEdit1 = new DevExpress.XtraEditors.Repository.RepositoryItemButtonEdit();
            this.panel1 = new System.Windows.Forms.Panel();
            this.btnEsc = new DevExpress.XtraEditors.SimpleButton();
@@ -53,8 +63,15 @@
            this.gcTable = new DevExpress.XtraGrid.GridControl();
            this.gvTable = new DevExpress.XtraGrid.Views.Grid.GridView();
            this.gridColumn10 = new DevExpress.XtraGrid.Columns.GridColumn();
            this.repositoryItemSearchLookUpEdit1 = new DevExpress.XtraEditors.Repository.RepositoryItemSearchLookUpEdit();
            this.repositoryItemSearchLookUpEdit1View = new DevExpress.XtraGrid.Views.Grid.GridView();
            this.gridColumn15 = new DevExpress.XtraGrid.Columns.GridColumn();
            this.gridColumn16 = new DevExpress.XtraGrid.Columns.GridColumn();
            this.gridColumn13 = new DevExpress.XtraGrid.Columns.GridColumn();
            this.gridColumn11 = new DevExpress.XtraGrid.Columns.GridColumn();
            this.gridColumn12 = new DevExpress.XtraGrid.Columns.GridColumn();
            this.gridColumn14 = new DevExpress.XtraGrid.Columns.GridColumn();
            this.repositoryItemButtonEdit2 = new DevExpress.XtraEditors.Repository.RepositoryItemButtonEdit();
            this.panQueryTable = new System.Windows.Forms.Panel();
            this.btnSqlTable = new DevExpress.XtraEditors.SimpleButton();
            this.gcQuery = new DevExpress.XtraGrid.GridControl();
@@ -86,6 +103,9 @@
            this.splitContainerControl1.SuspendLayout();
            ((System.ComponentModel.ISupportInitialize)(this.gcTable)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.gvTable)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.repositoryItemSearchLookUpEdit1)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.repositoryItemSearchLookUpEdit1View)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.repositoryItemButtonEdit2)).BeginInit();
            this.panQueryTable.SuspendLayout();
            ((System.ComponentModel.ISupportInitialize)(this.gcQuery)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.gvQuery)).BeginInit();
@@ -266,6 +286,9 @@
            this.gcTable.Location = new System.Drawing.Point(0, 0);
            this.gcTable.MainView = this.gvTable;
            this.gcTable.Name = "gcTable";
            this.gcTable.RepositoryItems.AddRange(new DevExpress.XtraEditors.Repository.RepositoryItem[] {
            this.repositoryItemSearchLookUpEdit1,
            this.repositoryItemButtonEdit2});
            this.gcTable.Size = new System.Drawing.Size(734, 196);
            this.gcTable.TabIndex = 4;
            this.gcTable.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] {
@@ -275,39 +298,118 @@
            // 
            this.gvTable.Columns.AddRange(new DevExpress.XtraGrid.Columns.GridColumn[] {
            this.gridColumn10,
            this.gridColumn13,
            this.gridColumn11,
            this.gridColumn12});
            this.gridColumn12,
            this.gridColumn14});
            this.gvTable.GridControl = this.gcTable;
            this.gvTable.Name = "gvTable";
            this.gvTable.OptionsView.NewItemRowPosition = DevExpress.XtraGrid.Views.Grid.NewItemRowPosition.Bottom;
            // 
            // gridColumn10
            // 
            this.gridColumn10.Caption = "表名";
            this.gridColumn10.AppearanceCell.ForeColor = System.Drawing.Color.Blue;
            this.gridColumn10.AppearanceCell.Options.UseForeColor = true;
            this.gridColumn10.AppearanceHeader.ForeColor = System.Drawing.Color.Blue;
            this.gridColumn10.AppearanceHeader.Options.UseForeColor = true;
            this.gridColumn10.Caption = "请选择";
            this.gridColumn10.ColumnEdit = this.repositoryItemSearchLookUpEdit1;
            this.gridColumn10.MinWidth = 25;
            this.gridColumn10.Name = "gridColumn10";
            this.gridColumn10.Visible = true;
            this.gridColumn10.VisibleIndex = 0;
            this.gridColumn10.Width = 94;
            // 
            // repositoryItemSearchLookUpEdit1
            //
            this.repositoryItemSearchLookUpEdit1.AutoHeight = false;
            this.repositoryItemSearchLookUpEdit1.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
            new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo, "请选择", -1, true, true, false, editorButtonImageOptions2, new DevExpress.Utils.KeyShortcut(System.Windows.Forms.Keys.None), serializableAppearanceObject5, serializableAppearanceObject6, serializableAppearanceObject7, serializableAppearanceObject8, "", null, null, DevExpress.Utils.ToolTipAnchor.Default)});
            this.repositoryItemSearchLookUpEdit1.Name = "repositoryItemSearchLookUpEdit1";
            this.repositoryItemSearchLookUpEdit1.NullText = "请选择";
            this.repositoryItemSearchLookUpEdit1.PopupView = this.repositoryItemSearchLookUpEdit1View;
            this.repositoryItemSearchLookUpEdit1.EditValueChanged += new System.EventHandler(this.repositoryItemSearchLookUpEdit1_EditValueChanged);
            //
            // repositoryItemSearchLookUpEdit1View
            //
            this.repositoryItemSearchLookUpEdit1View.Columns.AddRange(new DevExpress.XtraGrid.Columns.GridColumn[] {
            this.gridColumn15,
            this.gridColumn16});
            this.repositoryItemSearchLookUpEdit1View.FocusRectStyle = DevExpress.XtraGrid.Views.Grid.DrawFocusRectStyle.RowFocus;
            this.repositoryItemSearchLookUpEdit1View.Name = "repositoryItemSearchLookUpEdit1View";
            this.repositoryItemSearchLookUpEdit1View.OptionsSelection.EnableAppearanceFocusedCell = false;
            this.repositoryItemSearchLookUpEdit1View.OptionsView.ShowGroupPanel = false;
            //
            // gridColumn15
            //
            this.gridColumn15.Caption = "表名";
            this.gridColumn15.FieldName = "tableName";
            this.gridColumn15.Name = "gridColumn15";
            this.gridColumn15.Visible = true;
            this.gridColumn15.VisibleIndex = 0;
            //
            // gridColumn16
            //
            this.gridColumn16.Caption = "表备注";
            this.gridColumn16.FieldName = "tableCap";
            this.gridColumn16.Name = "gridColumn16";
            this.gridColumn16.Visible = true;
            this.gridColumn16.VisibleIndex = 1;
            //
            // gridColumn13
            //
            this.gridColumn13.Caption = "表名";
            this.gridColumn13.FieldName = "tableName";
            this.gridColumn13.MinWidth = 25;
            this.gridColumn13.Name = "gridColumn13";
            this.gridColumn13.OptionsColumn.ReadOnly = true;
            this.gridColumn13.Visible = true;
            this.gridColumn13.VisibleIndex = 1;
            this.gridColumn13.Width = 94;
            //
            // gridColumn11
            // 
            this.gridColumn11.Caption = "表备注";
            this.gridColumn11.FieldName = "tableCap";
            this.gridColumn11.MinWidth = 25;
            this.gridColumn11.Name = "gridColumn11";
            this.gridColumn11.OptionsColumn.ReadOnly = true;
            this.gridColumn11.Visible = true;
            this.gridColumn11.VisibleIndex = 1;
            this.gridColumn11.VisibleIndex = 2;
            this.gridColumn11.Width = 94;
            // 
            // gridColumn12
            // 
            this.gridColumn12.AppearanceHeader.ForeColor = System.Drawing.Color.Blue;
            this.gridColumn12.AppearanceHeader.Options.UseForeColor = true;
            this.gridColumn12.Caption = "别名";
            this.gridColumn12.FieldName = "tableOtherName";
            this.gridColumn12.MinWidth = 25;
            this.gridColumn12.Name = "gridColumn12";
            this.gridColumn12.Visible = true;
            this.gridColumn12.VisibleIndex = 2;
            this.gridColumn12.VisibleIndex = 3;
            this.gridColumn12.Width = 94;
            //
            // gridColumn14
            //
            this.gridColumn14.Caption = "移出";
            this.gridColumn14.ColumnEdit = this.repositoryItemButtonEdit2;
            this.gridColumn14.MinWidth = 25;
            this.gridColumn14.Name = "gridColumn14";
            this.gridColumn14.Visible = true;
            this.gridColumn14.VisibleIndex = 4;
            this.gridColumn14.Width = 94;
            //
            // repositoryItemButtonEdit2
            //
            this.repositoryItemButtonEdit2.AutoHeight = false;
            editorButtonImageOptions3.Image = global::Gs.DevApp.Properties.Resources.removegroupfooter_16x16;
            editorButtonImageOptions3.ImageToTextAlignment = DevExpress.XtraEditors.ImageAlignToText.LeftCenter;
            this.repositoryItemButtonEdit2.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
            new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Glyph, "移出", -1, true, true, false, editorButtonImageOptions3, new DevExpress.Utils.KeyShortcut(System.Windows.Forms.Keys.None), serializableAppearanceObject9, serializableAppearanceObject10, serializableAppearanceObject11, serializableAppearanceObject12, "", null, null, DevExpress.Utils.ToolTipAnchor.Default)});
            this.repositoryItemButtonEdit2.Name = "repositoryItemButtonEdit2";
            this.repositoryItemButtonEdit2.TextEditStyle = DevExpress.XtraEditors.Controls.TextEditStyles.HideTextEditor;
            this.repositoryItemButtonEdit2.ButtonClick += new DevExpress.XtraEditors.Controls.ButtonPressedEventHandler(this.repositoryItemButtonEdit2_ButtonClick);
            // 
            // panQueryTable
            // 
@@ -466,6 +568,9 @@
            this.splitContainerControl1.ResumeLayout(false);
            ((System.ComponentModel.ISupportInitialize)(this.gcTable)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.gvTable)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.repositoryItemSearchLookUpEdit1)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.repositoryItemSearchLookUpEdit1View)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.repositoryItemButtonEdit2)).EndInit();
            this.panQueryTable.ResumeLayout(false);
            ((System.ComponentModel.ISupportInitialize)(this.gcQuery)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.gvQuery)).EndInit();
@@ -510,5 +615,12 @@
        private DevExpress.XtraEditors.SimpleButton btnQueryEsc;
        private DevExpress.XtraEditors.SimpleButton btnQuerySave;
        private DevExpress.XtraGrid.Columns.GridColumn gridColumn12;
        private DevExpress.XtraGrid.Columns.GridColumn gridColumn13;
        private DevExpress.XtraGrid.Columns.GridColumn gridColumn14;
        private DevExpress.XtraEditors.Repository.RepositoryItemSearchLookUpEdit repositoryItemSearchLookUpEdit1;
        private DevExpress.XtraGrid.Views.Grid.GridView repositoryItemSearchLookUpEdit1View;
        private DevExpress.XtraGrid.Columns.GridColumn gridColumn15;
        private DevExpress.XtraGrid.Columns.GridColumn gridColumn16;
        private DevExpress.XtraEditors.Repository.RepositoryItemButtonEdit repositoryItemButtonEdit2;
    }
}
DevApp/Gs.DevApp/UserControl/ShowFilter.cs
@@ -240,51 +240,55 @@
        }
        private void BtnSqlTable_Click(object sender, EventArgs e)
        {
            //System.Text.StringBuilder sb = new System.Text.StringBuilder();
            //var list = txt_table.Properties.Items.GetCheckedValues();
            //foreach (var obj in list)
            //{
            //    if (sb.Length > 0)
            //        sb.Append(",");
            //    sb.Append(_getTableName(obj.ToString()));
            //}
            //if (sb.Length < 0)
            //{
            //    Gs.DevApp.ToolBox.MsgHelper.Warning("请选择关联表!");
            //    txt_table.Focus();
            //    return;
            //}
            //var _obj = new
            //{
            //    guid = UtilityHelper.ToGuid(lbGuid.Text.Trim()), //主建
            //    djlx = djlx,//单据类型
            //    salesId = _sqGuid,//销售单号
            //    inRemark = FNote.Trim(),//备注
            //    list = new List<dynamic>(),
            //};
            //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.layoutMx1.Controls, false, gvList);
            //        toolBarMenu1.currentAction = "";
            //    }
            //}
            //catch (Exception ex)
            //{
            //    ToolBox.MsgHelper.Warning("提示:" + ex.Message);
            //}
            if (string.IsNullOrEmpty(_fullName))
            {
                Gs.DevApp.ToolBox.MsgHelper.Warning("请选择页面!");
                return;
            }
            var _obj = new
            {
                formPath = _fullName,
                list = new List<dynamic>(),
            };
            gvTable.CloseEditor();
            gvTable.UpdateCurrentRow();
            if (gvTable.DataRowCount <= 0)
            {
                MsgHelper.ShowError("明细不能为空,请选择你的明细!");
                return;
            }
            for (var i = 0; i < gvTable.DataRowCount; i++)
            {
                var row = gvTable.GetDataRow(i);
                if (row != null)
                {
                    string _msl = row["tableOtherName"].ToString();
                    if (string.IsNullOrEmpty(_msl))
                    {
                        MsgHelper.ShowError("别名不能为空!");
                        return;
                    }
                    _obj.list.Add(new
                    {
                        tableName = (row["tableName"].ToString()),
                        tableOtherName = row["tableOtherName"].ToString(),
                    });
                }
            }
            try
            {
                string strJson = UtilityHelper.HttpPost("", "Fm/EditQuery", JsonConvert.SerializeObject(_obj));
                ReturnModel<dynamic> _rtn = ToolBox.UtilityHelper.ReturnToDynamic(strJson);
                ToolBox.MsgHelper.Warning("提示:" + _rtn.rtnMsg);
                if (_rtn.rtnCode > 0)
                {
                    getPageListQuery();
                }
            }
            catch (Exception ex)
            {
                ToolBox.MsgHelper.Warning("提示:" + ex.Message);
            }
        }
        private void getPageListQuery()
@@ -312,6 +316,14 @@
                    "Fm/GetQuery", JsonConvert.SerializeObject(_obj));
                ReturnModel<dynamic> _rtn = ToolBox.UtilityHelper.ReturnToDynamic(strJson);
                JObject _job = JObject.Parse(strJson);
                //读前选择
                JArray array00 = new JArray();
                foreach (var a in _job["rtnData"]["list3"])
                {
                    array00.Add(a);
                }
                DataTable dt00 = JsonConvert.DeserializeObject<DataTable>(array00.ToString());
                this.repositoryItemSearchLookUpEdit1.DataSource = dt00;
                ////////////
                JArray array = new JArray();
                foreach (var a in _job["rtnData"]["list"])
@@ -319,9 +331,17 @@
                    array.Add(a);
                }
                DataTable dt = JsonConvert.DeserializeObject<DataTable>(array.ToString());
                gcTable.BindingContext = new BindingContext();
                gcTable.DataSource = dt;
                gcTable.ForceInitialize();
                if (dt.Rows.Count > 0)
                {
                    gcTable.BindingContext = new BindingContext();
                    gcTable.DataSource = dt;
                    gcTable.ForceInitialize();
                    gvTable.BestFitColumns();
                }
                else
                {
                    Gs.DevApp.ToolBox.UtilityHelper.SetDefaultTable(gcTable, gvTable);
                }
                ////////////
                JArray array2 = new JArray();
                foreach (var a in _job["rtnData"]["list2"])
@@ -332,12 +352,65 @@
                gcQuery.BindingContext = new BindingContext();
                gcQuery.DataSource = dt2;
                gcQuery.ForceInitialize();
                gvQuery.BestFitColumns();
            }
            catch (Exception ex)
            {
                MsgHelper.Warning("提示:" + ex.Message);
            }
        }
        private void repositoryItemSearchLookUpEdit1_EditValueChanged(object sender, EventArgs e)
        {
            SearchLookUpEdit LookupEdit = sender as SearchLookUpEdit;
            DataRowView SelectedDataRow = (DataRowView)LookupEdit.GetSelectedDataRow();
            gvTable.SetFocusedRowCellValue("tableName", SelectedDataRow["tableName"].ToString());
            gvTable.SetFocusedRowCellValue("tableCap", SelectedDataRow["tableCap"].ToString());
            gvTable.CloseEditor();
            gvTable.PostEditor();
            gvTable.UpdateCurrentRow();
        }
        private void repositoryItemButtonEdit2_ButtonClick(object sender, ButtonPressedEventArgs e)
        {
            var rowhandle = gvTable.FocusedRowHandle;
            if (rowhandle < 0)
                return;
            if (e.Button.Index == 0)
            {
                var dr = gvTable.GetDataRow(rowhandle);
                var mxGuid = dr["guid"].ToString();
                if (!MsgHelper.AskQuestion("你选择了1条数据,确定删除吗?"))
                    return;
                if (string.IsNullOrEmpty(mxGuid))
                {
                    gvTable.DeleteRow(rowhandle);
                    return;
                }
                var _obj = new
                {
                    guid = mxGuid,
                };
                try
                {
                    var strJson = UtilityHelper.HttpPost("",
                        "Fm/DeleteQuery",
                        JsonConvert.SerializeObject(_obj));
                    var _rtn = UtilityHelper.ReturnToDynamic(strJson);
                    if (_rtn.rtnCode > 0)
                    {
                        if (_rtn.rtnCode > 0) getPageListQuery();
                    }
                    MsgHelper.Warning("提示:" + _rtn.rtnMsg);
                }
                catch (Exception ex)
                {
                    MsgHelper.Warning("提示:" + ex.Message);
                }
            }
        }
        #endregion
    }
}