DevApp/Gs.DevApp/DevFrm/QC/Frm_MesQaItemsDetect01Check.Designer.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
DevApp/Gs.DevApp/DevFrm/QC/Frm_MesQaItemsDetect01Check.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
DevApp/Gs.DevApp/DevFrm/QC/Frm_MesQaItemsDetect01Check.resx | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
DevApp/Gs.DevApp/Gs.DevApp.csproj | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
DevApp/Gs.DevApp/UserControl/UCUpFile.Designer.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
DevApp/Gs.DevApp/UserControl/UCUpFile.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
DevApp/Gs.DevApp/UserControl/UCUpFile.resx | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
DevApp/Gs.DevApp/DevFrm/QC/Frm_MesQaItemsDetect01Check.Designer.cs
@@ -29,6 +29,17 @@ /// </summary> private void InitializeComponent() { DevExpress.XtraEditors.Controls.EditorButtonImageOptions editorButtonImageOptions3 = new DevExpress.XtraEditors.Controls.EditorButtonImageOptions(); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Frm_MesQaItemsDetect01Check)); 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(); DevExpress.XtraEditors.Controls.EditorButtonImageOptions editorButtonImageOptions4 = new DevExpress.XtraEditors.Controls.EditorButtonImageOptions(); DevExpress.Utils.SerializableAppearanceObject serializableAppearanceObject13 = new DevExpress.Utils.SerializableAppearanceObject(); DevExpress.Utils.SerializableAppearanceObject serializableAppearanceObject14 = new DevExpress.Utils.SerializableAppearanceObject(); DevExpress.Utils.SerializableAppearanceObject serializableAppearanceObject15 = new DevExpress.Utils.SerializableAppearanceObject(); DevExpress.Utils.SerializableAppearanceObject serializableAppearanceObject16 = new DevExpress.Utils.SerializableAppearanceObject(); this.tabMxPage1 = new DevExpress.XtraTab.XtraTabPage(); this.splitContainerControl1 = new DevExpress.XtraEditors.SplitContainerControl(); this.gcMx1 = new DevExpress.XtraGrid.GridControl(); @@ -112,12 +123,19 @@ this.pageBar1 = new UserControls.Data.UcPageBar(); this.xtraTabPage2 = new DevExpress.XtraTab.XtraTabPage(); this.xtraTabControl2 = new DevExpress.XtraTab.XtraTabControl(); this.xtraTabPage3 = new DevExpress.XtraTab.XtraTabPage(); this.panelControl1 = new DevExpress.XtraEditors.PanelControl(); this.btnUp = new DevExpress.XtraEditors.SimpleButton(); this.btnUpSelect = new System.Windows.Forms.Button(); this.txtUpUrl = new System.Windows.Forms.TextBox(); this.label7 = new System.Windows.Forms.Label(); this.tabMxPage3 = new DevExpress.XtraTab.XtraTabPage(); this.gcMx3 = new DevExpress.XtraGrid.GridControl(); this.gvMx3 = new DevExpress.XtraGrid.Views.Grid.GridView(); this.gridColumn4 = new DevExpress.XtraGrid.Columns.GridColumn(); this.gridColumn5 = new DevExpress.XtraGrid.Columns.GridColumn(); this.gridColumn6 = new DevExpress.XtraGrid.Columns.GridColumn(); this.gridColumn7 = new DevExpress.XtraGrid.Columns.GridColumn(); this.gridColumn8 = new DevExpress.XtraGrid.Columns.GridColumn(); this.gridColumn10 = new DevExpress.XtraGrid.Columns.GridColumn(); this.repositoryItemButtonEdit2 = new DevExpress.XtraEditors.Repository.RepositoryItemButtonEdit(); this.gridColumn9 = new DevExpress.XtraGrid.Columns.GridColumn(); this.repositoryItemButtonEdit1 = new DevExpress.XtraEditors.Repository.RepositoryItemButtonEdit(); this.ucUpFile1 = new Gs.DevApp.UserControl.UCUpFile(); this.panel1 = new System.Windows.Forms.Panel(); this.txt_itemModel = new DevExpress.XtraEditors.MemoEdit(); this.txt_itemId = new Gs.DevApp.UserControl.UcLookItems(); @@ -133,6 +151,7 @@ this.txt_modify1Flag = new DevExpress.XtraEditors.TextEdit(); this.lb_lotNo = new DevExpress.XtraEditors.LabelControl(); this.txt_lotNo = new DevExpress.XtraEditors.TextEdit(); this.gridColumn11 = new DevExpress.XtraGrid.Columns.GridColumn(); this.tabMxPage1.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.splitContainerControl1)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.splitContainerControl1.Panel1)).BeginInit(); @@ -165,9 +184,11 @@ this.xtraTabPage2.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.xtraTabControl2)).BeginInit(); this.xtraTabControl2.SuspendLayout(); this.xtraTabPage3.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.panelControl1)).BeginInit(); this.panelControl1.SuspendLayout(); this.tabMxPage3.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.gcMx3)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.gvMx3)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.repositoryItemButtonEdit2)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.repositoryItemButtonEdit1)).BeginInit(); this.panel1.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.txt_itemModel.Properties)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.txt_itemNo.Properties)).BeginInit(); @@ -1213,61 +1234,147 @@ this.xtraTabControl2.TabIndex = 2; this.xtraTabControl2.TabPages.AddRange(new DevExpress.XtraTab.XtraTabPage[] { this.tabMxPage1, this.xtraTabPage3}); this.tabMxPage3}); // // xtraTabPage3 // tabMxPage3 // this.xtraTabPage3.Controls.Add(this.panelControl1); this.xtraTabPage3.Name = "xtraTabPage3"; this.xtraTabPage3.Size = new System.Drawing.Size(1340, 448); this.xtraTabPage3.Text = "éä»¶ä¿¡æ¯"; this.tabMxPage3.Controls.Add(this.gcMx3); this.tabMxPage3.Controls.Add(this.ucUpFile1); this.tabMxPage3.Name = "tabMxPage3"; this.tabMxPage3.Size = new System.Drawing.Size(1340, 448); this.tabMxPage3.Text = "éä»¶ä¿¡æ¯"; // // panelControl1 // gcMx3 // this.panelControl1.Controls.Add(this.btnUp); this.panelControl1.Controls.Add(this.btnUpSelect); this.panelControl1.Controls.Add(this.txtUpUrl); this.panelControl1.Controls.Add(this.label7); this.panelControl1.Location = new System.Drawing.Point(297, 11); this.panelControl1.Name = "panelControl1"; this.panelControl1.Size = new System.Drawing.Size(609, 151); this.panelControl1.TabIndex = 1; this.gcMx3.Dock = System.Windows.Forms.DockStyle.Fill; this.gcMx3.Location = new System.Drawing.Point(0, 57); this.gcMx3.MainView = this.gvMx3; this.gcMx3.Name = "gcMx3"; this.gcMx3.RepositoryItems.AddRange(new DevExpress.XtraEditors.Repository.RepositoryItem[] { this.repositoryItemButtonEdit1, this.repositoryItemButtonEdit2}); this.gcMx3.Size = new System.Drawing.Size(1340, 391); this.gcMx3.TabIndex = 1; this.gcMx3.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] { this.gvMx3}); // // btnUp // gvMx3 // this.btnUp.Location = new System.Drawing.Point(157, 81); this.btnUp.Name = "btnUp"; this.btnUp.Size = new System.Drawing.Size(94, 29); this.btnUp.TabIndex = 270; this.btnUp.Text = "ç¡®å®ä¸ä¼ "; this.gvMx3.Columns.AddRange(new DevExpress.XtraGrid.Columns.GridColumn[] { this.gridColumn4, this.gridColumn5, this.gridColumn11, this.gridColumn6, this.gridColumn7, this.gridColumn8, this.gridColumn10, this.gridColumn9}); this.gvMx3.GridControl = this.gcMx3; this.gvMx3.Name = "gvMx3"; // // btnUpSelect // gridColumn4 // this.btnUpSelect.Location = new System.Drawing.Point(452, 48); this.btnUpSelect.Margin = new System.Windows.Forms.Padding(4); this.btnUpSelect.Name = "btnUpSelect"; this.btnUpSelect.Size = new System.Drawing.Size(79, 26); this.btnUpSelect.TabIndex = 269; this.btnUpSelect.Text = "éæ©è·¯å¾"; this.btnUpSelect.UseVisualStyleBackColor = true; this.gridColumn4.Caption = "guidä¸è½å é¤"; this.gridColumn4.FieldName = "guid"; this.gridColumn4.MinWidth = 25; this.gridColumn4.Name = "gridColumn4"; this.gridColumn4.OptionsColumn.ReadOnly = true; this.gridColumn4.Width = 94; // // txtUpUrl // gridColumn5 // this.txtUpUrl.Location = new System.Drawing.Point(125, 48); this.txtUpUrl.Margin = new System.Windows.Forms.Padding(4); this.txtUpUrl.Name = "txtUpUrl"; this.txtUpUrl.Size = new System.Drawing.Size(307, 26); this.txtUpUrl.TabIndex = 268; this.gridColumn5.Caption = "éä»¶åç§°"; this.gridColumn5.FieldName = "fileTitle"; this.gridColumn5.MinWidth = 100; this.gridColumn5.Name = "gridColumn5"; this.gridColumn5.OptionsColumn.ReadOnly = true; this.gridColumn5.Visible = true; this.gridColumn5.VisibleIndex = 0; this.gridColumn5.Width = 100; // // label7 // gridColumn6 // this.label7.AutoSize = true; this.label7.Location = new System.Drawing.Point(12, 52); this.label7.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label7.Name = "label7"; this.label7.Size = new System.Drawing.Size(83, 18); this.label7.TabIndex = 267; this.label7.Text = "éæ©æä»¶ï¼"; this.gridColumn6.Caption = "æµè§å°å"; this.gridColumn6.FieldName = "urlPath"; this.gridColumn6.MinWidth = 200; this.gridColumn6.Name = "gridColumn6"; this.gridColumn6.OptionsColumn.ReadOnly = true; this.gridColumn6.Visible = true; this.gridColumn6.VisibleIndex = 2; this.gridColumn6.Width = 200; // // gridColumn7 // this.gridColumn7.Caption = "ä¸ä¼ è "; this.gridColumn7.FieldName = "createBy"; this.gridColumn7.MinWidth = 25; this.gridColumn7.Name = "gridColumn7"; this.gridColumn7.OptionsColumn.ReadOnly = true; this.gridColumn7.Visible = true; this.gridColumn7.VisibleIndex = 3; this.gridColumn7.Width = 94; // // gridColumn8 // this.gridColumn8.Caption = "ä¸ä¼ æ¶é´"; this.gridColumn8.FieldName = "createDate"; this.gridColumn8.MinWidth = 25; this.gridColumn8.Name = "gridColumn8"; this.gridColumn8.OptionsColumn.ReadOnly = true; this.gridColumn8.Visible = true; this.gridColumn8.VisibleIndex = 4; this.gridColumn8.Width = 94; // // gridColumn10 // this.gridColumn10.Caption = "æµè§"; this.gridColumn10.ColumnEdit = this.repositoryItemButtonEdit2; this.gridColumn10.MinWidth = 25; this.gridColumn10.Name = "gridColumn10"; this.gridColumn10.Visible = true; this.gridColumn10.VisibleIndex = 5; this.gridColumn10.Width = 94; // // repositoryItemButtonEdit2 // this.repositoryItemButtonEdit2.AutoHeight = false; editorButtonImageOptions3.Image = ((System.Drawing.Image)(resources.GetObject("editorButtonImageOptions3.Image"))); 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); // // gridColumn9 // this.gridColumn9.Caption = "ç§»åº"; this.gridColumn9.ColumnEdit = this.repositoryItemButtonEdit1; this.gridColumn9.MinWidth = 25; this.gridColumn9.Name = "gridColumn9"; this.gridColumn9.Visible = true; this.gridColumn9.VisibleIndex = 6; this.gridColumn9.Width = 94; // // repositoryItemButtonEdit1 // this.repositoryItemButtonEdit1.AutoHeight = false; editorButtonImageOptions4.Image = global::Gs.DevApp.Properties.Resources.removegroupfooter_16x16; editorButtonImageOptions4.ImageToTextAlignment = DevExpress.XtraEditors.ImageAlignToText.LeftCenter; this.repositoryItemButtonEdit1.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] { new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Glyph, "å é¤", -1, true, true, false, editorButtonImageOptions4, new DevExpress.Utils.KeyShortcut(System.Windows.Forms.Keys.None), serializableAppearanceObject13, serializableAppearanceObject14, serializableAppearanceObject15, serializableAppearanceObject16, "", null, null, DevExpress.Utils.ToolTipAnchor.Default)}); this.repositoryItemButtonEdit1.Name = "repositoryItemButtonEdit1"; this.repositoryItemButtonEdit1.TextEditStyle = DevExpress.XtraEditors.Controls.TextEditStyles.HideTextEditor; this.repositoryItemButtonEdit1.ButtonClick += new DevExpress.XtraEditors.Controls.ButtonPressedEventHandler(this.repositoryItemButtonEdit1_ButtonClick); // // ucUpFile1 // this.ucUpFile1.Dock = System.Windows.Forms.DockStyle.Top; this.ucUpFile1.Location = new System.Drawing.Point(0, 0); this.ucUpFile1.Name = "ucUpFile1"; this.ucUpFile1.parentGuid = null; this.ucUpFile1.Size = new System.Drawing.Size(1340, 57); this.ucUpFile1.TabIndex = 0; // // panel1 // @@ -1446,6 +1553,16 @@ this.txt_lotNo.Size = new System.Drawing.Size(150, 28); this.txt_lotNo.TabIndex = 262; // // gridColumn11 // this.gridColumn11.Caption = "éä»¶ç±»å"; this.gridColumn11.FieldName = "fileType"; this.gridColumn11.MinWidth = 25; this.gridColumn11.Name = "gridColumn11"; this.gridColumn11.Visible = true; this.gridColumn11.VisibleIndex = 1; this.gridColumn11.Width = 94; // // Frm_MesQaItemsDetect01Check // this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 18F); @@ -1486,10 +1603,11 @@ this.xtraTabPage2.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)(this.xtraTabControl2)).EndInit(); this.xtraTabControl2.ResumeLayout(false); this.xtraTabPage3.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)(this.panelControl1)).EndInit(); this.panelControl1.ResumeLayout(false); this.panelControl1.PerformLayout(); this.tabMxPage3.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)(this.gcMx3)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.gvMx3)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.repositoryItemButtonEdit2)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.repositoryItemButtonEdit1)).EndInit(); this.panel1.ResumeLayout(false); this.panel1.PerformLayout(); ((System.ComponentModel.ISupportInitialize)(this.txt_itemModel.Properties)).EndInit(); @@ -1572,12 +1690,7 @@ private DevExpress.XtraEditors.LabelControl lb_releaseNo; private DevExpress.XtraEditors.TextEdit txt_releaseNo; private DevExpress.XtraGrid.Columns.GridColumn gv_releaseNo; private DevExpress.XtraTab.XtraTabPage xtraTabPage3; private DevExpress.XtraEditors.PanelControl panelControl1; private DevExpress.XtraEditors.SimpleButton btnUp; private System.Windows.Forms.Button btnUpSelect; private System.Windows.Forms.TextBox txtUpUrl; private System.Windows.Forms.Label label7; private DevExpress.XtraTab.XtraTabPage tabMxPage3; private DevExpress.XtraEditors.MemoEdit txt_itemModel; private UserControl.UcLookItems txt_itemId; private DevExpress.XtraEditors.LabelControl lb_itemModel; @@ -1615,5 +1728,18 @@ private DevExpress.XtraGrid.Columns.GridColumn gridColumn2; private DevExpress.XtraGrid.Columns.GridColumn gridColumn1; private DevExpress.XtraGrid.Columns.GridColumn gridColumn3; private UserControl.UCUpFile ucUpFile1; private DevExpress.XtraGrid.GridControl gcMx3; private DevExpress.XtraGrid.Views.Grid.GridView gvMx3; private DevExpress.XtraGrid.Columns.GridColumn gridColumn4; private DevExpress.XtraGrid.Columns.GridColumn gridColumn5; private DevExpress.XtraGrid.Columns.GridColumn gridColumn6; private DevExpress.XtraGrid.Columns.GridColumn gridColumn7; private DevExpress.XtraGrid.Columns.GridColumn gridColumn8; private DevExpress.XtraGrid.Columns.GridColumn gridColumn9; private DevExpress.XtraEditors.Repository.RepositoryItemButtonEdit repositoryItemButtonEdit1; private DevExpress.XtraGrid.Columns.GridColumn gridColumn10; private DevExpress.XtraEditors.Repository.RepositoryItemButtonEdit repositoryItemButtonEdit2; private DevExpress.XtraGrid.Columns.GridColumn gridColumn11; } } DevApp/Gs.DevApp/DevFrm/QC/Frm_MesQaItemsDetect01Check.cs
@@ -5,12 +5,8 @@ using Newtonsoft.Json.Linq; using System; using System.Collections.Generic; using System.Configuration; using System.Data; using System.Drawing; using System.IO; using System.Net.Http; using System.Threading.Tasks; using System.Windows.Forms; namespace Gs.DevApp.DevFrm.QC @@ -28,6 +24,7 @@ this.toolBarMenu1.btnZhiLiangFchkClick += ToolBarMenu1_btnZhiLiangFchkClick; this.toolBarMenu1.btnCaiGouChkClick += ToolBarMenu1_btnCaiGouChkClick; this.toolBarMenu1.btnCaiGouFchkClick += ToolBarMenu1_btnCaiGouFchkClick; this.toolBarMenu1.btnBoHuiClick += ToolBarMenu1_btnBoHuiClick; toolBarMenu1.btnLogClick += ToolBarMenu1_btnLogClick; gcMain.MouseDoubleClick += GcMain_MouseDoubleClick; gvMx1.FocusedRowChanged += GvMx1_FocusedRowChanged; @@ -47,15 +44,15 @@ Rectangle r = new Rectangle(gridView1.GridControl.Width / 2 - 100, e.Bounds.Top + 45, e.Bounds.Right - 5, e.Bounds.Height - 5); e.Graphics.DrawString(str, f, Brushes.Gray, r); }; //ä¸ä¼ éä»¶ btnUpSelect.Click += BtnUpSelect_Click; btnUp.Click += BtnUp_Click; //åå§åç©æéæ©ååç§ä¸æ gvMx2.OptionsFind.ShowSearchNavButtons = false; gvMx2.OptionsView.ShowGroupPanel = false; gvMx3.OptionsFind.ShowSearchNavButtons = false; gvMx3.OptionsView.ShowGroupPanel = false; _setIno(); ucUpFile1.UpChanged += UcUpFile1_UpChanged; xtraTabControl2.SelectedPageChanged += XtraTabControl2_SelectedPageChanged; } /// <summary> /// åå»äºä»¶ @@ -99,6 +96,14 @@ getPageList(1, pageBar1.RowsCount); } private void ToolBarMenu1_btnLogClick(object sender, EventArgs e) { toolBarMenu1.guidKey = ""; string rowGuid, rowName; (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1, lbGuid, txt_releaseNo, gridView1); toolBarMenu1.guidKey = rowGuid; } private void ToolBarMenu1_btnBoHuiClick(object sender, EventArgs e) { toolBarMenu1.guidKey = ""; string rowGuid, rowName; @@ -231,6 +236,7 @@ gcMx1.BindingContext = new BindingContext(); gcMx1.DataSource = dt; gcMx1.ForceInitialize(); ucUpFile1.parentGuid = lbGuid.Text.Trim(); } else { @@ -245,82 +251,62 @@ ToolBox.MsgHelper.Warning("æç¤ºï¼" + ex.Message); } } #region æä»¶ä¸ä¼ /// <summary> /// éæ©ä¸ä¼ æä»¶ /// é项å¡åæ¢ /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void BtnUpSelect_Click(object sender, EventArgs e) private void XtraTabControl2_SelectedPageChanged(object sender, DevExpress.XtraTab.TabPageChangedEventArgs e) { var openFileDialog = new OpenFileDialog(); // 设置åå§ç®å½ openFileDialog.InitialDirectory = "c:\\"; // 设置æä»¶è¿æ»¤é项ï¼å¦ï¼"ææ¬æä»¶ (*.txt)|*.txt|æææä»¶ (*.*)|*.*" openFileDialog.Filter = "ææ¬æä»¶ (*.txt)|*.txt|æææä»¶ (*.*)|*.*"; // 设置æ é¢ openFileDialog.Title = "éæ©æä»¶"; // æ¾ç¤ºå¯¹è¯æ¡ var result = openFileDialog.ShowDialog(); // ç¡®è®¤ç¨æ·æ²¡æåæ¶æä½ if (result == DialogResult.OK) if (e.Page.Name == "tabMxPage3") { // è·åéä¸çæä»¶è·¯å¾ var filePath = openFileDialog.FileName; Console.WriteLine($"éä¸çæä»¶: {filePath}"); txtUpUrl.Text = filePath; getFileList(); } } /// <summary> /// ç¡®å®ä¸ä¼ /// ä¸ä¼ åå·æ°æä»¶å表 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private async void BtnUp_Click(object sender, EventArgs e) private void UcUpFile1_UpChanged(object sender, EventArgs e) { var WebApiUrl = ConfigurationSettings.AppSettings.Get("WebApiUrl"); var address = WebApiUrl + "Upload/UploadFile"; var filePath = txtUpUrl.Text.Trim(); var apiUrl = address; // æ¿æ¢ä¸ºä½ çAPIå°å await UploadFileAsync(apiUrl, filePath); getFileList(); } private async Task UploadFileAsync(string url, string filePath) private void getFileList() { UcLoading _loading = new UcLoading(); using (var httpClient = new HttpClient()) using (var form = new MultipartFormDataContent()) System.Text.StringBuilder _sbSqlWhere = new System.Text.StringBuilder(); _sbSqlWhere.Append(" and parent_Guid='" + lbGuid.Text.Trim() + "'"); PageQueryModel pgq = new PageQueryModel(1, 100, "create_date", "asc", "", _sbSqlWhere.ToString()); string json = JsonConvert.SerializeObject(pgq); try { httpClient.DefaultRequestHeaders.Add("token", UtilityHelper.GetBasicAuthTicket()); using (var fs = File.OpenRead(filePath)) using (var streamContent = new StreamContent(fs)) string strReturn = UtilityHelper.HttpPost("", "MesFile/GetListPage", json); ReturnModel<PageListModel> dd = UtilityHelper.ReturnToTablePage(strReturn); if (dd.rtnCode > 0) { form.Add(streamContent, "file", Path.GetFileName(filePath)); var response = await httpClient.PostAsync(url, form); var responseString = await response.Content.ReadAsStringAsync(); MessageBox.Show(responseString); DataTable dt = dd.rtnData.list; gcMx3.BindingContext = new BindingContext(); gcMx3.DataSource = dt; gcMx3.ForceInitialize(); } else { ToolBox.MsgHelper.ShowError("æç¤ºï¼" + dd.rtnMsg); } } _loading.Close(); catch (Exception ex) { ToolBox.MsgHelper.Warning("æç¤ºï¼" + ex.Message); } #endregion } private void _setIno() { txt_itemId.KeyFile = "id"; txt_itemId.EditChanged += (s, e) => { txt_itemModel.Text = this.txt_itemId.GetModel(); txt_itemNo.Text = this.txt_itemId.GetCode(); }; //txt_itemId.EditChanged += (s, e) => //{ // txt_itemModel.Text = this.txt_itemId.GetModel(); // txt_itemNo.Text = this.txt_itemId.GetCode(); //}; } /// <summary> /// è¯»åæ£éªç»æ @@ -352,6 +338,43 @@ MsgHelper.Warning("æç¤ºï¼" + ex.Message); } } private void repositoryItemButtonEdit1_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e) { var rowhandle = gvMx3.FocusedRowHandle; if (rowhandle < 0) return; if (e.Button.Index == 0) { var dr = gvMx3.GetDataRow(rowhandle); var mxGuid = dr["guid"].ToString(); if (!MsgHelper.AskQuestion("ä½ éæ©äº1æ¡æ°æ®ï¼ç¡®å®å é¤åï¼")) return; var strJson = ""; var lst = new List<string>(); lst.Add(mxGuid); try { strJson = UtilityHelper.HttpPost("", "MesFile/DeleteModel", JsonConvert.SerializeObject(lst)); var _rtn = UtilityHelper.ReturnToDynamic(strJson); if (_rtn.rtnCode > 0) gvMx3.DeleteRow(rowhandle); MsgHelper.Warning("æç¤ºï¼" + _rtn.rtnMsg); } catch (Exception ex) { MsgHelper.Warning("æç¤ºï¼" + ex.Message); } } } private void repositoryItemButtonEdit2_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e) { var rowhandle = gvMx3.FocusedRowHandle; if (rowhandle < 0) return; if (e.Button.Index == 0) { MsgHelper.Warning("æç¤ºï¼" + "å¼åä¸"); } } } } DevApp/Gs.DevApp/DevFrm/QC/Frm_MesQaItemsDetect01Check.resx
@@ -117,4 +117,26 @@ <resheader name="writer"> <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> </resheader> <assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /> <data name="editorButtonImageOptions3.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> <value> iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAABN0RVh0VGl0 bGUAV2ViO1dvcmxkO0V5ZQdEODoAAAONSURBVDhPVZJtTNNXFIcvoHOyLhMTt2Qsm4oMI5luEE3jZlsR lDGrVWBzo7oBRibyYgWmWYtQoams4gAHghawaMABAgGZIg1CacUWKxUISqG8jBUrMJaVFFwz99v9M4fx JE/uh3POc8/NPUSpMxAAhIarXLXNr/A6v1ZWEW09XdsNeY1pXFZlrD2YKfWnebdyjZwU03qam+953kdc dkYluQtPHpGeqRI49cM/oGukHdPOZxidcaJcdwPppaHOM1cDT/n4v/0qU59Z1fWSYNHnx+OKxFfq8fMd Baaf9mLgcQ+ezP0NG+WR1QR13zmobocjVs67QOsXSy7rXwj2JHgFHUjdgWy1GlrzfRgtOvRa+zFkd84z MD0L/XA3SlrjIL64HQHC0B1U4vpCcNTrmrzyMxy/JIbRNgfTxBx6Jp+iZ+o/NA876JMaoRlLhFIdBt5X W2uo4JUFQdBB38eKmt04ppSiyWJH+5gDut8oY7PQjEzimrYSV1ou4WpnDEravkBQJNtGBe4Lgi0RUc79 p2IgrtOiQD+Fhn47Gs12VNxRo/hGISo6tMjX2xBfkApFbSg4wo1OKmB9zM8h7JCzhIQkqGyHL3QiVtWD 9OZxnNVOoMT4O1RNlzE40YIuSxtM5ge4/6iX0oeK67ccVPAGxWVTcDYh3hxuPT/uAMIzC/B1vgGiygHc HvwT3UMWVN9sR1bRLxAr6hErqUNSRh3iU6tm+RFZCSyPVa9TiRtZyX5z96Z9K/GtIhx80TfIrW6A1jSG 9Dw1SquNaDcM4nt5GfZGZ8yfrR1m/HixDRu3y4dWfyBcSyWE5cXzrORFeiMx91O03DMiq7AVpr5x2B1/ IUmqRKftD6Skn0NimhKHUnJhm5pBQ/MDrOekaRmBm/vypW+t+uSdIp+A4Ge39ANIljVictoB65MZBISm QCTJYVYOYfuPgCM4BsuvUzCYhrGem+EgEZITjMSVwlq+2jcku+SmWRhf9k+zph/9IxOIEmXP3/xl5FHE fJeLsEgJjL2jKKu+i3WbxTqyJjiTvMeJZiQulMWUZe/6BLN5gpxRUVoNfiptBn9fMrw+3IWd9MwrbkJM cjk2cKUjnu8LfBd2mmFr2HnC3ZvPyNxWePp7bOCeSPAPlN31C5RZ/badpiNLx9dtlhjWfHQ4ieXhvYLW LXpJwKHNWwR5hFkSGv9P9BplGcXjOcz3LaG4rmWfJP8CiUU9Vuoq7pwAAAAASUVORK5CYII= </value> </data> </root> DevApp/Gs.DevApp/Gs.DevApp.csproj
@@ -501,6 +501,12 @@ <Compile Include="UserControl\UcToolBarMenu.Designer.cs"> <DependentUpon>UcToolBarMenu.cs</DependentUpon> </Compile> <Compile Include="UserControl\UCUpFile.cs"> <SubType>UserControl</SubType> </Compile> <Compile Include="UserControl\UCUpFile.Designer.cs"> <DependentUpon>UCUpFile.cs</DependentUpon> </Compile> <Compile Include="UserControl\XtraUserControl1.cs"> <SubType>UserControl</SubType> </Compile> @@ -664,6 +670,9 @@ <EmbeddedResource Include="UserControl\UcToolBarMenu.resx"> <DependentUpon>UcToolBarMenu.cs</DependentUpon> </EmbeddedResource> <EmbeddedResource Include="UserControl\UCUpFile.resx"> <DependentUpon>UCUpFile.cs</DependentUpon> </EmbeddedResource> <EmbeddedResource Include="UserControl\XtraUserControl1.resx"> <DependentUpon>XtraUserControl1.cs</DependentUpon> </EmbeddedResource> DevApp/Gs.DevApp/UserControl/UCUpFile.Designer.cs
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,110 @@ namespace Gs.DevApp.UserControl { partial class UCUpFile { /// <summary> /// Required designer variable. /// </summary> private System.ComponentModel.IContainer components = null; /// <summary> /// Clean up any resources being used. /// </summary> /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> protected override void Dispose(bool disposing) { if (disposing && (components != null)) { components.Dispose(); } base.Dispose(disposing); } #region Component Designer generated code /// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { this.panelControl1 = new DevExpress.XtraEditors.PanelControl(); this.btnUp = new DevExpress.XtraEditors.SimpleButton(); this.btnUpSelect = new System.Windows.Forms.Button(); this.txtUpUrl = new System.Windows.Forms.TextBox(); this.label7 = new System.Windows.Forms.Label(); ((System.ComponentModel.ISupportInitialize)(this.panelControl1)).BeginInit(); this.panelControl1.SuspendLayout(); this.SuspendLayout(); // // panelControl1 // this.panelControl1.Controls.Add(this.btnUp); this.panelControl1.Controls.Add(this.btnUpSelect); this.panelControl1.Controls.Add(this.txtUpUrl); this.panelControl1.Controls.Add(this.label7); this.panelControl1.Dock = System.Windows.Forms.DockStyle.Fill; this.panelControl1.Location = new System.Drawing.Point(0, 0); this.panelControl1.Name = "panelControl1"; this.panelControl1.Size = new System.Drawing.Size(618, 59); this.panelControl1.TabIndex = 2; // // btnUp // this.btnUp.Location = new System.Drawing.Point(509, 17); this.btnUp.Name = "btnUp"; this.btnUp.Size = new System.Drawing.Size(94, 29); this.btnUp.TabIndex = 270; this.btnUp.Text = "ç¡®å®ä¸ä¼ "; // // btnUpSelect // this.btnUpSelect.Location = new System.Drawing.Point(411, 18); this.btnUpSelect.Margin = new System.Windows.Forms.Padding(4); this.btnUpSelect.Name = "btnUpSelect"; this.btnUpSelect.Size = new System.Drawing.Size(79, 26); this.btnUpSelect.TabIndex = 269; this.btnUpSelect.Text = "éæ©è·¯å¾"; this.btnUpSelect.UseVisualStyleBackColor = true; // // txtUpUrl // this.txtUpUrl.Location = new System.Drawing.Point(96, 18); this.txtUpUrl.Margin = new System.Windows.Forms.Padding(4); this.txtUpUrl.Name = "txtUpUrl"; this.txtUpUrl.Size = new System.Drawing.Size(307, 26); this.txtUpUrl.TabIndex = 268; // // label7 // this.label7.AutoSize = true; this.label7.Location = new System.Drawing.Point(11, 22); this.label7.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label7.Name = "label7"; this.label7.Size = new System.Drawing.Size(83, 18); this.label7.TabIndex = 267; this.label7.Text = "éæ©æä»¶ï¼"; // // UCUpFile // this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 18F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.Controls.Add(this.panelControl1); this.Name = "UCUpFile"; this.Size = new System.Drawing.Size(618, 59); ((System.ComponentModel.ISupportInitialize)(this.panelControl1)).EndInit(); this.panelControl1.ResumeLayout(false); this.panelControl1.PerformLayout(); this.ResumeLayout(false); } #endregion private DevExpress.XtraEditors.PanelControl panelControl1; private DevExpress.XtraEditors.SimpleButton btnUp; private System.Windows.Forms.Button btnUpSelect; private System.Windows.Forms.TextBox txtUpUrl; private System.Windows.Forms.Label label7; } } DevApp/Gs.DevApp/UserControl/UCUpFile.cs
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,111 @@ using DevExpress.Utils.DirectXPaint; using DevExpress.XtraEditors; using Gs.DevApp.ToolBox; using System; using System.Collections.Generic; using System.ComponentModel; using System.Configuration; using System.Data; using System.Drawing; using System.IO; using System.Linq; using System.Net.Http; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; namespace Gs.DevApp.UserControl { public partial class UCUpFile : DevExpress.XtraEditors.XtraUserControl { public UCUpFile() { InitializeComponent(); //ä¸ä¼ éä»¶ btnUpSelect.Click += BtnUpSelect_Click; btnUp.Click += BtnUp_Click; } public string parentGuid { get; set; } /// <summary> /// æ¹åäºä»¶ /// </summary> public event EventHandler UpChanged; #region æä»¶ä¸ä¼ /// <summary> /// éæ©ä¸ä¼ æä»¶ /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void BtnUpSelect_Click(object sender, EventArgs e) { var openFileDialog = new OpenFileDialog(); // 设置åå§ç®å½ openFileDialog.InitialDirectory = "c:\\"; // 设置æä»¶è¿æ»¤é项ï¼å¦ï¼"ææ¬æä»¶ (*.txt)|*.txt|æææä»¶ (*.*)|*.*" openFileDialog.Filter = "ææ¬æä»¶ (*.txt)|*.txt|æææä»¶ (*.*)|*.*"; // 设置æ é¢ openFileDialog.Title = "éæ©æä»¶"; // æ¾ç¤ºå¯¹è¯æ¡ var result = openFileDialog.ShowDialog(); // ç¡®è®¤ç¨æ·æ²¡æåæ¶æä½ if (result == DialogResult.OK) { // è·åéä¸çæä»¶è·¯å¾ var filePath = openFileDialog.FileName; Console.WriteLine($"éä¸çæä»¶: {filePath}"); txtUpUrl.Text = filePath; } } /// <summary> /// ç¡®å®ä¸ä¼ /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private async void BtnUp_Click(object sender, EventArgs e) { var WebApiUrl = ConfigurationSettings.AppSettings.Get("WebApiUrl"); var address = WebApiUrl + "MesFile/UploadFile"; var filePath = txtUpUrl.Text.Trim(); if (string.IsNullOrEmpty(filePath)) { Gs.DevApp.ToolBox.MsgHelper.ShowError("è¯·éæ©ä½ éè¦ä¸ä¼ çæä»¶ï¼"); return; } var apiUrl = address; // æ¿æ¢ä¸ºä½ çAPIå°å await UploadFileAsync(apiUrl, filePath); if (UpChanged != null) UpChanged(this, e); } private async Task UploadFileAsync(string url, string filePath) { UcLoading _loading = new UcLoading(); string _parentGuid = parentGuid; using (var httpClient = new HttpClient()) using (var form = new MultipartFormDataContent()) { httpClient.DefaultRequestHeaders.Add("token", UtilityHelper.GetBasicAuthTicket()); using (var fs = File.OpenRead(filePath)) using (var streamContent = new StreamContent(fs)) { form.Add(streamContent, "file", _parentGuid + "~" + Path.GetFileName(filePath)); var response = await httpClient.PostAsync(url, form); var responseString = await response.Content.ReadAsStringAsync(); // MessageBox.Show(responseString); txtUpUrl.Text = ""; } } _loading.Close(); } #endregion } } DevApp/Gs.DevApp/UserControl/UCUpFile.resx
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,120 @@ <?xml version="1.0" encoding="utf-8"?> <root> <!-- Microsoft ResX Schema Version 2.0 The primary goals of this format is to allow a simple XML format that is mostly human readable. The generation and parsing of the various data types are done through the TypeConverter classes associated with the data types. Example: ... ado.net/XML headers & schema ... <resheader name="resmimetype">text/microsoft-resx</resheader> <resheader name="version">2.0</resheader> <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data> <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> <value>[base64 mime encoded serialized .NET Framework object]</value> </data> <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> <comment>This is a comment</comment> </data> There are any number of "resheader" rows that contain simple name/value pairs. Each data row contains a name, and value. The row also contains a type or mimetype. Type corresponds to a .NET class that support text/value conversion through the TypeConverter architecture. Classes that don't support this are serialized and stored with the mimetype set. The mimetype is used for serialized objects, and tells the ResXResourceReader how to depersist the object. This is currently not extensible. For a given mimetype the value must be set accordingly: Note - application/x-microsoft.net.object.binary.base64 is the format that the ResXResourceWriter will generate, however the reader can read any of the formats listed below. mimetype: application/x-microsoft.net.object.binary.base64 value : The object must be serialized with : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter : and then encoded with base64 encoding. mimetype: application/x-microsoft.net.object.soap.base64 value : The object must be serialized with : System.Runtime.Serialization.Formatters.Soap.SoapFormatter : and then encoded with base64 encoding. mimetype: application/x-microsoft.net.object.bytearray.base64 value : The object must be serialized into a byte array : using a System.ComponentModel.TypeConverter : and then encoded with base64 encoding. --> <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> <xsd:import namespace="http://www.w3.org/XML/1998/namespace" /> <xsd:element name="root" msdata:IsDataSet="true"> <xsd:complexType> <xsd:choice maxOccurs="unbounded"> <xsd:element name="metadata"> <xsd:complexType> <xsd:sequence> <xsd:element name="value" type="xsd:string" minOccurs="0" /> </xsd:sequence> <xsd:attribute name="name" use="required" type="xsd:string" /> <xsd:attribute name="type" type="xsd:string" /> <xsd:attribute name="mimetype" type="xsd:string" /> <xsd:attribute ref="xml:space" /> </xsd:complexType> </xsd:element> <xsd:element name="assembly"> <xsd:complexType> <xsd:attribute name="alias" type="xsd:string" /> <xsd:attribute name="name" type="xsd:string" /> </xsd:complexType> </xsd:element> <xsd:element name="data"> <xsd:complexType> <xsd:sequence> <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> </xsd:sequence> <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" /> <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> <xsd:attribute ref="xml:space" /> </xsd:complexType> </xsd:element> <xsd:element name="resheader"> <xsd:complexType> <xsd:sequence> <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> </xsd:sequence> <xsd:attribute name="name" type="xsd:string" use="required" /> </xsd:complexType> </xsd:element> </xsd:choice> </xsd:complexType> </xsd:element> </xsd:schema> <resheader name="resmimetype"> <value>text/microsoft-resx</value> </resheader> <resheader name="version"> <value>2.0</value> </resheader> <resheader name="reader"> <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> </resheader> <resheader name="writer"> <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> </resheader> </root>