Commit 70984a35 LN

上传的数据可排序和删除

1 个父辈 d297a789
...@@ -181,7 +181,7 @@ ...@@ -181,7 +181,7 @@
</dependentAssembly> </dependentAssembly>
<dependentAssembly> <dependentAssembly>
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> <assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-5.0.0.0" newVersion="5.0.0.0" /> <bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
</dependentAssembly> </dependentAssembly>
<dependentAssembly> <dependentAssembly>
<assemblyIdentity name="System.Memory" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" /> <assemblyIdentity name="System.Memory" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
...@@ -195,6 +195,10 @@ ...@@ -195,6 +195,10 @@
<assemblyIdentity name="System.Buffers" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" /> <assemblyIdentity name="System.Buffers" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.3.0" newVersion="4.0.3.0" /> <bindingRedirect oldVersion="0.0.0.0-4.0.3.0" newVersion="4.0.3.0" />
</dependentAssembly> </dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Text.Encoding.CodePages" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-8.0.0.0" newVersion="8.0.0.0" />
</dependentAssembly>
</assemblyBinding> </assemblyBinding>
<!--<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> <!--<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly> <dependentAssembly>
......
...@@ -118,7 +118,7 @@ namespace TSA_V ...@@ -118,7 +118,7 @@ namespace TSA_V
string time = GetVersion(true); string time = GetVersion(true);
System.Reflection.AssemblyName assemblyName = System.Reflection.Assembly.GetExecutingAssembly().GetName(); System.Reflection.AssemblyName assemblyName = System.Reflection.Assembly.GetExecutingAssembly().GetName();
lblVersion.Text = "V" + assemblyName.Version.ToString(); lblVersion.Text = "V" + assemblyName.Version.ToString();
lblVersion.Text = "V4.0"; lblVersion.Text = "V5.0";
//lblVersion.Text = "V" + assemblyName.Version.ToString() + "(" + time + ")"; //lblVersion.Text = "V" + assemblyName.Version.ToString() + "(" + time + ")";
LblUserName.Text = FormManager.UserInfo.Name + "/" + FormManager.UserInfo.Limit; LblUserName.Text = FormManager.UserInfo.Name + "/" + FormManager.UserInfo.Limit;
......
...@@ -2660,9 +2660,9 @@ ...@@ -2660,9 +2660,9 @@
<data name = "Type_None" xml:space = "preserve"> <value> None </value> </data> <data name = "Type_None" xml:space = "preserve"> <value> None </value> </data>
<data name = "FrmPointInfo_lblPolarities_Text" xml:space = "preserve"> <value> Polarity </value> </data> <data name = "FrmPointInfo_lblPolarities_Text" xml:space = "preserve"> <value> Polarity </value> </data>
<data name = "FrmAddBoard_linkDataViewer_Text" xml:space = "preserve"> <value> Data Preview </value> </data> <data name = "FrmAddBoard_linkDataViewer_Text" xml:space = "preserve"> <value> Data Preview </value> </data>
<data name = "FrmAddBoard_linkBomUpload_Text" xml:space = "preserve"> <value> BOM sheet upload </value> </data> <data name = "FrmAddBoard_linkBomUpload_Text" xml:space = "preserve"> <value> data sheet upload </value> </data>
<data name = "FrmAddBoard_lblPolarities_Text" xml:space = "preserve"> <value> polarities </value> </data> <data name = "FrmAddBoard_lblPolarities_Text" xml:space = "preserve"> <value> polarities </value> </data>
<data name = "FrmBomUpload_Text" xml:space = "preserve"> <value> BOM sheet upload </value> </data> <data name = "FrmBomUpload_Text" xml:space = "preserve"> <value> data sheet upload </value> </data>
<data name = "FrmBomUpload_groupBox3_Text" xml:space = "preserve"> <value> Other settings </value> </data> <data name = "FrmBomUpload_groupBox3_Text" xml:space = "preserve"> <value> Other settings </value> </data>
<data name = "FrmBomUpload_chbAutoPos_Text" xml:space = "preserve"> <value> Automatic consolidation of libraries </value> </data> <data name = "FrmBomUpload_chbAutoPos_Text" xml:space = "preserve"> <value> Automatic consolidation of libraries </value> </data>
<data name = "FrmBomUpload_label3_Text" xml:space = "preserve"> <value> Default number of components: </value> </data> <data name = "FrmBomUpload_label3_Text" xml:space = "preserve"> <value> Default number of components: </value> </data>
......
...@@ -2659,9 +2659,9 @@ ...@@ -2659,9 +2659,9 @@
<data name = "Type_None" xml:space = "preserve"> <value> 无 </value> </data> <data name = "Type_None" xml:space = "preserve"> <value> 无 </value> </data>
<data name = "FrmPointInfo_lblPolarities_Text" xml:space = "preserve"> <value> 极性 </value> </data> <data name = "FrmPointInfo_lblPolarities_Text" xml:space = "preserve"> <value> 极性 </value> </data>
<data name = "FrmAddBoard_linkDataViewer_Text" xml:space = "preserve"> <value> 数据预览 </value> </data> <data name = "FrmAddBoard_linkDataViewer_Text" xml:space = "preserve"> <value> 数据预览 </value> </data>
<data name = "FrmAddBoard_linkBomUpload_Text" xml:space = "preserve"> <value> BOM表上传 </value> </data> <data name = "FrmAddBoard_linkBomUpload_Text" xml:space = "preserve"> <value> 数据表上传 </value> </data>
<data name = "FrmAddBoard_lblPolarities_Text" xml:space = "preserve"> <value> 极性 </value> </data> <data name = "FrmAddBoard_lblPolarities_Text" xml:space = "preserve"> <value> 极性 </value> </data>
<data name = "FrmBomUpload_Text" xml:space = "preserve"> <value> BOM表上传 </value> </data> <data name = "FrmBomUpload_Text" xml:space = "preserve"> <value> 数据表上传 </value> </data>
<data name = "FrmBomUpload_groupBox3_Text" xml:space = "preserve"> <value> 其他设置 </value> </data> <data name = "FrmBomUpload_groupBox3_Text" xml:space = "preserve"> <value> 其他设置 </value> </data>
<data name = "FrmBomUpload_chbAutoPos_Text" xml:space = "preserve"> <value> 同物料自动合并库位 </value> </data> <data name = "FrmBomUpload_chbAutoPos_Text" xml:space = "preserve"> <value> 同物料自动合并库位 </value> </data>
<data name = "FrmBomUpload_label3_Text" xml:space = "preserve"> <value> 元器件默认数量: </value> </data> <data name = "FrmBomUpload_label3_Text" xml:space = "preserve"> <value> 元器件默认数量: </value> </data>
......
...@@ -194,6 +194,12 @@ ...@@ -194,6 +194,12 @@
<Compile Include="frmBoard\FrmCalibrate.Designer.cs"> <Compile Include="frmBoard\FrmCalibrate.Designer.cs">
<DependentUpon>FrmCalibrate.cs</DependentUpon> <DependentUpon>FrmCalibrate.cs</DependentUpon>
</Compile> </Compile>
<Compile Include="frmBoard\FrmBomViewer.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="frmBoard\FrmBomViewer.Designer.cs">
<DependentUpon>FrmBomViewer.cs</DependentUpon>
</Compile>
<Compile Include="frmBoard\FrmListViewer.cs"> <Compile Include="frmBoard\FrmListViewer.cs">
<SubType>Form</SubType> <SubType>Form</SubType>
</Compile> </Compile>
...@@ -442,6 +448,9 @@ ...@@ -442,6 +448,9 @@
<EmbeddedResource Include="frmBoard\FrmCalibrate.resx"> <EmbeddedResource Include="frmBoard\FrmCalibrate.resx">
<DependentUpon>FrmCalibrate.cs</DependentUpon> <DependentUpon>FrmCalibrate.cs</DependentUpon>
</EmbeddedResource> </EmbeddedResource>
<EmbeddedResource Include="frmBoard\FrmBomViewer.resx">
<DependentUpon>FrmBomViewer.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="frmBoard\FrmListViewer.resx"> <EmbeddedResource Include="frmBoard\FrmListViewer.resx">
<DependentUpon>FrmListViewer.cs</DependentUpon> <DependentUpon>FrmListViewer.cs</DependentUpon>
</EmbeddedResource> </EmbeddedResource>
......
...@@ -375,10 +375,10 @@ ...@@ -375,10 +375,10 @@
this.linkBomUpload.AutoSize = true; this.linkBomUpload.AutoSize = true;
this.linkBomUpload.Location = new System.Drawing.Point(148, 122); this.linkBomUpload.Location = new System.Drawing.Point(148, 122);
this.linkBomUpload.Name = "linkBomUpload"; this.linkBomUpload.Name = "linkBomUpload";
this.linkBomUpload.Size = new System.Drawing.Size(74, 17); this.linkBomUpload.Size = new System.Drawing.Size(68, 17);
this.linkBomUpload.TabIndex = 302; this.linkBomUpload.TabIndex = 302;
this.linkBomUpload.TabStop = true; this.linkBomUpload.TabStop = true;
this.linkBomUpload.Text = "BOM表上传"; this.linkBomUpload.Text = "数据表上传";
this.linkBomUpload.Visible = false; this.linkBomUpload.Visible = false;
this.linkBomUpload.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkBomUpload_LinkClicked); this.linkBomUpload.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkBomUpload_LinkClicked);
// //
......
...@@ -472,7 +472,7 @@ namespace TSA_V ...@@ -472,7 +472,7 @@ namespace TSA_V
bool proResult= ProcessComData(uploadPointList); bool proResult= ProcessComData(uploadPointList);
if (proResult) if (proResult)
{ {
FrmListViewer< ComponetInfo> frmViewer = new FrmListViewer<ComponetInfo>(uploadPointList); FrmBomViewer frmViewer = new FrmBomViewer(uploadPointList);
DialogResult sureresult = frmViewer.ShowDialog(); DialogResult sureresult = frmViewer.ShowDialog();
if (sureresult.Equals(DialogResult.Cancel)) if (sureresult.Equals(DialogResult.Cancel))
{ {
...@@ -672,7 +672,7 @@ namespace TSA_V ...@@ -672,7 +672,7 @@ namespace TSA_V
{ {
if (uploadPointList.Count>0) if (uploadPointList.Count>0)
{ {
FrmListViewer<ComponetInfo> frmViewer = new FrmListViewer<ComponetInfo>(uploadPointList); FrmBomViewer frmViewer = new FrmBomViewer(uploadPointList);
DialogResult sureresult = frmViewer.ShowDialog(); DialogResult sureresult = frmViewer.ShowDialog();
if (sureresult.Equals(DialogResult.Cancel)) if (sureresult.Equals(DialogResult.Cancel))
{ {
......
...@@ -860,6 +860,13 @@ namespace TSA_V ...@@ -860,6 +860,13 @@ namespace TSA_V
int index = dgvList.FirstDisplayedScrollingRowIndex; int index = dgvList.FirstDisplayedScrollingRowIndex;
DataGridViewRow row = dgvList.Rows[rowIndex]; DataGridViewRow row = dgvList.Rows[rowIndex];
SMTPointInfo smtInfo = getRowPointInfo(row); SMTPointInfo smtInfo = getRowPointInfo(row);
panBoard.AutoScrollPosition = new Point((int)(smtInfo.PositionX*display.imageXiShu-panBoard.Width/2),(int) (smtInfo.PositionY * display.imageXiShu-panBoard.Height/2));
// panBoard.AutoScrollPosition = new Point((int)picBoard.Width, (int)picBoard.Height);
if (isFinishLoad && this.txtBoardW.Text.Trim() != "" && this.txtBoardL.Text.Trim() != "")
{
loadPictureBoxSize();
}
if (smtInfo == null) if (smtInfo == null)
{ {
MessageBox.Show(ResourceCulture.GetString(ResourceCulture.NoZZh, "未找到组装信息信息!")); MessageBox.Show(ResourceCulture.GetString(ResourceCulture.NoZZh, "未找到组装信息信息!"));
...@@ -1532,6 +1539,9 @@ namespace TSA_V ...@@ -1532,6 +1539,9 @@ namespace TSA_V
private void btnCalibrate_Click(object sender, EventArgs e) private void btnCalibrate_Click(object sender, EventArgs e)
{ {
FrmCalibrate frm = new FrmCalibrate(updateBoardInfo); FrmCalibrate frm = new FrmCalibrate(updateBoardInfo);
DialogResult dialog = frm.ShowDialog(); DialogResult dialog = frm.ShowDialog();
if (dialog.Equals(DialogResult.OK)) if (dialog.Equals(DialogResult.OK))
......
...@@ -334,7 +334,7 @@ namespace TSA_V.frmBoard ...@@ -334,7 +334,7 @@ namespace TSA_V.frmBoard
LogUtil.error("出错:" + ex.ToString()); LogUtil.error("出错:" + ex.ToString());
} }
} }
FrmListViewer<ComponetInfo> frmViewer = new FrmListViewer<ComponetInfo>(componetInfos); FrmBomViewer frmViewer = new FrmBomViewer(componetInfos);
DialogResult sureresult = frmViewer.ShowDialog(); DialogResult sureresult = frmViewer.ShowDialog();
if (sureresult.Equals(DialogResult.Cancel)) if (sureresult.Equals(DialogResult.Cancel))
{ {
......
namespace TSA_V
{
partial class FrmBomViewer
{
/// <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 Windows Form 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.panel1 = new System.Windows.Forms.Panel();
this.dgvData = new System.Windows.Forms.DataGridView();
this.Column_ID = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Column_TagNo = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Column_PN = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Column_PositionNum = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Column_ComCount = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Column_PositionX = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Column_PositionY = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Column_Notes = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Column_CompontentDes = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Column_del = new System.Windows.Forms.DataGridViewLinkColumn();
this.btnOK = new System.Windows.Forms.Button();
this.btnCancel = new System.Windows.Forms.Button();
this.panel1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.dgvData)).BeginInit();
this.SuspendLayout();
//
// panel1
//
this.panel1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.panel1.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom;
this.panel1.Controls.Add(this.dgvData);
this.panel1.Location = new System.Drawing.Point(5, 5);
this.panel1.Name = "panel1";
this.panel1.Size = new System.Drawing.Size(995, 562);
this.panel1.TabIndex = 0;
//
// dgvData
//
this.dgvData.AllowUserToAddRows = false;
this.dgvData.AllowUserToDeleteRows = false;
this.dgvData.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.dgvData.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
this.Column_ID,
this.Column_TagNo,
this.Column_PN,
this.Column_PositionNum,
this.Column_ComCount,
this.Column_PositionX,
this.Column_PositionY,
this.Column_Notes,
this.Column_CompontentDes,
this.Column_del});
this.dgvData.Dock = System.Windows.Forms.DockStyle.Fill;
this.dgvData.Location = new System.Drawing.Point(0, 0);
this.dgvData.MultiSelect = false;
this.dgvData.Name = "dgvData";
this.dgvData.RowTemplate.Height = 23;
this.dgvData.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
this.dgvData.Size = new System.Drawing.Size(995, 562);
this.dgvData.TabIndex = 0;
this.dgvData.CellContentClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dgvData_CellContentClick);
//
// Column_ID
//
this.Column_ID.DataPropertyName = "Id";
this.Column_ID.HeaderText = "ID";
this.Column_ID.Name = "Column_ID";
this.Column_ID.Visible = false;
//
// Column_TagNo
//
this.Column_TagNo.HeaderText = "位号";
this.Column_TagNo.Name = "Column_TagNo";
//
// Column_PN
//
this.Column_PN.HeaderText = "物料编码";
this.Column_PN.Name = "Column_PN";
//
// Column_PositionNum
//
this.Column_PositionNum.HeaderText = "料盘位置";
this.Column_PositionNum.Name = "Column_PositionNum";
//
// Column_ComCount
//
this.Column_ComCount.HeaderText = "数量";
this.Column_ComCount.Name = "Column_ComCount";
//
// Column_PositionX
//
this.Column_PositionX.HeaderText = "X";
this.Column_PositionX.Name = "Column_PositionX";
//
// Column_PositionY
//
this.Column_PositionY.HeaderText = "Y";
this.Column_PositionY.Name = "Column_PositionY";
//
// Column_Notes
//
this.Column_Notes.HeaderText = "注意事项";
this.Column_Notes.Name = "Column_Notes";
//
// Column_CompontentDes
//
this.Column_CompontentDes.HeaderText = "描述";
this.Column_CompontentDes.Name = "Column_CompontentDes";
//
// Column_del
//
this.Column_del.HeaderText = "删除";
this.Column_del.Name = "Column_del";
this.Column_del.Text = "删除";
//
// btnOK
//
this.btnOK.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.btnOK.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnOK.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnOK.Location = new System.Drawing.Point(749, 577);
this.btnOK.Name = "btnOK";
this.btnOK.Size = new System.Drawing.Size(120, 45);
this.btnOK.TabIndex = 284;
this.btnOK.Text = "确认";
this.btnOK.UseVisualStyleBackColor = true;
this.btnOK.Click += new System.EventHandler(this.btnOK_Click);
//
// btnCancel
//
this.btnCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.btnCancel.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnCancel.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnCancel.Location = new System.Drawing.Point(875, 577);
this.btnCancel.Name = "btnCancel";
this.btnCancel.Size = new System.Drawing.Size(120, 45);
this.btnCancel.TabIndex = 285;
this.btnCancel.Text = "取消";
this.btnCancel.UseVisualStyleBackColor = true;
this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click);
//
// FrmBomViewer
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(1007, 634);
this.Controls.Add(this.btnCancel);
this.Controls.Add(this.btnOK);
this.Controls.Add(this.panel1);
this.MaximizeBox = true;
this.MinimizeBox = true;
this.Name = "FrmBomViewer";
this.Text = "图片预览";
this.TopMost = true;
this.Load += new System.EventHandler(this.FrmImageViewer_Load);
this.panel1.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.dgvData)).EndInit();
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.Panel panel1;
private System.Windows.Forms.Button btnOK;
private System.Windows.Forms.Button btnCancel;
private System.Windows.Forms.DataGridView dgvData;
private System.Windows.Forms.DataGridViewTextBoxColumn Column_ID;
private System.Windows.Forms.DataGridViewTextBoxColumn Column_TagNo;
private System.Windows.Forms.DataGridViewTextBoxColumn Column_PN;
private System.Windows.Forms.DataGridViewTextBoxColumn Column_PositionNum;
private System.Windows.Forms.DataGridViewTextBoxColumn Column_ComCount;
private System.Windows.Forms.DataGridViewTextBoxColumn Column_PositionX;
private System.Windows.Forms.DataGridViewTextBoxColumn Column_PositionY;
private System.Windows.Forms.DataGridViewTextBoxColumn Column_Notes;
private System.Windows.Forms.DataGridViewTextBoxColumn Column_CompontentDes;
private System.Windows.Forms.DataGridViewLinkColumn Column_del;
}
}
\ No newline at end of file \ No newline at end of file
using log4net.Repository.Hierarchy;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using TSA_V.Common;
using TSA_V.DeviceLibrary;
using TSA_V.LoadCSVLibrary;
namespace TSA_V
{
public partial class FrmBomViewer : FrmBase
{
public List<ComponetInfo> dataList = new List<ComponetInfo>();
private int viewType = 0;
public FrmBomViewer(List<ComponetInfo> dataList,int viewType=0)
{
InitializeComponent();
this.dataList = dataList;
this.viewType = viewType;
}
private void FrmImageViewer_Load(object sender, EventArgs e)
{
LoadData();
this.WindowState = FormWindowState.Maximized;
}
private void addData (ComponetInfo obj)
{
DataGridViewRow row = new DataGridViewRow();
row.CreateCells(dgvData);
row.Cells[0].Value = obj.Id;
row.Cells[Column_TagNo.Index].Value = obj.TagNo;
row.Cells[Column_PN.Index].Value = obj.PN;
row.Cells[Column_PositionNum.Index].Value = obj.PositionNum;
row.Cells[Column_ComCount.Index].Value = obj.ComCount;
row.Cells[Column_PositionX.Index].Value = obj.PositionX;
row.Cells[Column_PositionY.Index].Value = obj.PositionY;
row.Cells[Column_Notes.Index].Value = obj.Notes;
row.Cells[Column_CompontentDes.Index].Value = obj.ComponentDes;
row.Cells[Column_del.Index].Value = ResourceCulture.GetString(ResourceCulture.ItemText_Delete, "删除");
dgvData.Rows.Add(row);
}
private void LoadData()
{
//dgvData.DataSource = dataList;
if (viewType == 0)
{
dgvData.Columns[0].Visible = false;
dgvData.Columns[Column_TagNo.Index].HeaderText = ResourceCulture.GetString(ResourceCulture.Col_Num, "位号");
dgvData.Columns[Column_PN.Index].HeaderText = ResourceCulture.GetString(ResourceCulture.Col_Name, "物料编码");
dgvData.Columns[Column_PositionNum.Index].HeaderText = ResourceCulture.GetString(ResourceCulture.Col_Position, "料盘位置");
dgvData.Columns[Column_ComCount.Index].HeaderText = ResourceCulture.GetString(ResourceCulture.Col_Count, "数量");
dgvData.Columns[Column_PositionX.Index].HeaderText = "X";
dgvData.Columns[Column_PositionY.Index].HeaderText = "Y";
dgvData.Columns[Column_Notes.Index].HeaderText = ResourceCulture.GetString(ResourceCulture.Col_Notes, "注意事项");
dgvData.Columns[Column_CompontentDes.Index].HeaderText = ResourceCulture.GetString(ResourceCulture.Col_Del, "描述");
dgvData.Columns[Column_del.Index].HeaderText = ResourceCulture.GetString(ResourceCulture.ItemText_Delete, "删除");
dgvData.AllowUserToDeleteRows = true;
dgvData.AllowUserToOrderColumns = true;
for(int i =0;i<dgvData.Columns.Count;i++)
{
dgvData.Columns[i].SortMode = DataGridViewColumnSortMode.Automatic;
}
foreach(ComponetInfo obj in dataList)
{
addData(obj);
}
}
else if (viewType == 1)
{
if (dgvData.Columns.Count >= 6)
{
dgvData.Columns[0].Visible = false;
dgvData.Columns[1].HeaderText = ResourceCulture.GetString(ResourceCulture.Col_Num, "位号");
dgvData.Columns[2].HeaderText = ResourceCulture.GetString(ResourceCulture.Col_Name, "物料编码");
dgvData.Columns[3].HeaderText = ResourceCulture.GetString(ResourceCulture.Col_Position, "料盘位置");
dgvData.Columns[4].HeaderText = ResourceCulture.GetString(ResourceCulture.Col_Count, "数量");
dgvData.Columns[5].HeaderText = ResourceCulture.GetString("Col_Count_N", "修改后数量");
dgvData.Columns[1].ReadOnly = true;
dgvData.Columns[2].ReadOnly = true;
dgvData.Columns[3].ReadOnly = true;
dgvData.Columns[4].ReadOnly = true;
}
}
if (dataList.Count <= 0)
{
btnOK.Visible = false;
btnCancel.Visible = true;
}
this.Text = ResourceCulture.GetString("FrmListViewer_Text", "数据预览");
btnCancel.Text = ResourceCulture.GetString("FrmListViewer_btnCancel_Text", "取消");
btnOK.Text = ResourceCulture.GetString("FrmListViewer_btnOK_Text", "确定");
}
private void GetList()
{
List<ComponetInfo> pointList = new List<ComponetInfo>();
foreach (DataGridViewRow row in dgvData.Rows)
{
if (row != null)
{
ComponetInfo point = getRowPointInfo(row);
if (point != null)
{
pointList.Add(point);
}
}
}
this.dataList = new List<ComponetInfo>(pointList);
}
private ComponetInfo getRowPointInfo(DataGridViewRow row)
{
ComponetInfo point = new ComponetInfo();
try
{
if (row.Cells[Column_TagNo.Name].Value == null)
{
return null;
}
point.Id = Convert.ToInt32( row.Cells[Column_ID.Name].Value.ToString());
point.PN = row.Cells[this.Column_PN.Name].Value.ToString();
point.TagNo = row.Cells[this.Column_TagNo.Name].Value.ToString();
point.PositionX = Math.Round(Convert.ToDouble(row.Cells[this.Column_PositionX.Name].Value.ToString()), 3);
point.PositionY = Math.Round(Convert.ToDouble(row.Cells[this.Column_PositionY.Name].Value.ToString()), 3);
point.PositionNum = row.Cells[this.Column_PositionNum.Name].Value.ToString();
point.ComCount = row.Cells[this.Column_ComCount.Name].Value.ToString();
point.ComponentDes = row.Cells[this.Column_CompontentDes.Name].Value.ToString();
point.Notes = row.Cells[this.Column_Notes.Name].Value.ToString();
}
catch (Exception ex)
{
LogUtil.error( "保存数据出错:" + ex.ToString());
return null;
}
return point;
}
private void btnOK_Click(object sender, EventArgs e)
{
GetList();
this.DialogResult = DialogResult.OK;
this.Close();
}
private void btnCancel_Click(object sender, EventArgs e)
{
if(dataList.Count <= 0)
{
this.DialogResult = DialogResult.Cancel;
this.Close();
}
DialogResult resul = MessageBox.Show(ResourceCulture.GetString("SureCancelData","确认取消数据上传?"), "", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
if (resul == DialogResult.Yes)
{
this.DialogResult = DialogResult.Cancel;
this.Close();
}
}
private void dgvData_CellContentClick(object sender, DataGridViewCellEventArgs e)
{
if (e.RowIndex != -1 && e.ColumnIndex >= 0)
{
string name = this.dgvData.Columns[e.ColumnIndex].Name;
if (name.Equals(this.Column_del.Name))
{
if (MessageBox.Show(ResourceCulture.GetString(ResourceCulture.SureDelete, "确认要删除该行数据吗?"),
ResourceCulture.GetString(ResourceCulture.MsgTitle, "提示?"),
MessageBoxButtons.OKCancel,
MessageBoxIcon.Question) != DialogResult.OK)
{
return;
}
else
{
this.dgvData.Rows.RemoveAt(e.RowIndex);
}
}
}
}
}
}
<?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>
<metadata name="Column_ID.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="Column_TagNo.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="Column_PN.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="Column_PositionNum.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="Column_ComCount.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="Column_PositionX.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="Column_PositionY.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="Column_Notes.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="Column_CompontentDes.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="Column_del.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
</root>
\ No newline at end of file \ No newline at end of file
...@@ -29,6 +29,7 @@ ...@@ -29,6 +29,7 @@
8.元器件库批量导入数量。 8.元器件库批量导入数量。
9.投影文字不能超出投影范围。 9.投影文字不能超出投影范围。
10.未修改过的点位使用上个点位的形状。 10.未修改过的点位使用上个点位的形状。
11.增加提示音。
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!