基线:全量源码首提(D1 版本控制落地,含第一轮优化 B1-B4/A1/A4/缩放修复)

This commit is contained in:
dqb-dev
2026-10-01 22:15:22 +08:00
commit 1e65792b09
499 changed files with 204579 additions and 0 deletions
+609
View File
@@ -0,0 +1,609 @@
namespace 成套报价软件
{
public partial class 修改项目 : System.Windows.Forms.Form
{
/// <summary>必需的设计器变量。</summary>
private System.ComponentModel.IContainer components = null;
/// <summary>清理正在使用的资源。</summary>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows 窗体设计器生成的代码
private void InitializeComponent()
{
this.lbl项目编号 = new System.Windows.Forms.Label();
this.txt项目编号 = new System.Windows.Forms.TextBox();
this.lbl项目日期 = new System.Windows.Forms.Label();
this.txt项目日期 = new System.Windows.Forms.TextBox();
this.lbl项目名称 = new System.Windows.Forms.Label();
this.txt项目名称 = new System.Windows.Forms.TextBox();
this.lbl客户名称 = new System.Windows.Forms.Label();
this.txt客户名称 = new System.Windows.Forms.TextBox();
this.btn选择客户 = new System.Windows.Forms.Button();
this.lbl客户地址 = new System.Windows.Forms.Label();
this.txt客户地址 = new System.Windows.Forms.TextBox();
this.lbl联系人 = new System.Windows.Forms.Label();
this.txt联系人 = new System.Windows.Forms.TextBox();
this.lbl联系电话 = new System.Windows.Forms.Label();
this.txt联系电话 = new System.Windows.Forms.TextBox();
this.lbl成套厂名称 = new System.Windows.Forms.Label();
this.txt成套厂名称 = new System.Windows.Forms.TextBox();
this.lbl成套厂地址 = new System.Windows.Forms.Label();
this.txt成套厂地址 = new System.Windows.Forms.TextBox();
this.lbl成套厂联系人 = new System.Windows.Forms.Label();
this.txt成套厂联系人 = new System.Windows.Forms.TextBox();
this.lbl成套厂联系电话 = new System.Windows.Forms.Label();
this.txt成套厂联系电话 = new System.Windows.Forms.TextBox();
this.lbl报出方式 = new System.Windows.Forms.Label();
this.cmb报出方式 = new System.Windows.Forms.ComboBox();
this.lbl箱柜模板 = new System.Windows.Forms.Label();
this.cmb箱柜模板 = new System.Windows.Forms.ComboBox();
this.lbl备注 = new System.Windows.Forms.Label();
this.txt备注 = new System.Windows.Forms.TextBox();
this.btn确定 = new System.Windows.Forms.Button();
this.btn取消 = new System.Windows.Forms.Button();
this.lbl单台价格 = new System.Windows.Forms.Label();
this.cmb单台价格 = new System.Windows.Forms.ComboBox();
this.lbl项目总价 = new System.Windows.Forms.Label();
this.comboBox1 = new System.Windows.Forms.ComboBox();
this.label1 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.comboBox2 = new System.Windows.Forms.ComboBox();
this.cmb项目总价 = new System.Windows.Forms.ComboBox();
this.SuspendLayout();
//
// lbl项目编号
//
this.lbl项目编号.BackColor = System.Drawing.Color.White;
this.lbl项目编号.Font = new System.Drawing.Font("宋体", 9F);
this.lbl项目编号.ForeColor = System.Drawing.SystemColors.ControlText;
this.lbl项目编号.Location = new System.Drawing.Point(20, 25);
this.lbl项目编号.Name = "lbl项目编号";
this.lbl项目编号.Size = new System.Drawing.Size(70, 23);
this.lbl项目编号.TabIndex = 0;
this.lbl项目编号.Text = "项目编号:";
this.lbl项目编号.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// txt项目编号
//
this.txt项目编号.BackColor = System.Drawing.SystemColors.Window;
this.txt项目编号.Font = new System.Drawing.Font("宋体", 9F);
this.txt项目编号.ForeColor = System.Drawing.SystemColors.WindowText;
this.txt项目编号.Location = new System.Drawing.Point(95, 25);
this.txt项目编号.Name = "txt项目编号";
this.txt项目编号.Size = new System.Drawing.Size(220, 21);
this.txt项目编号.TabIndex = 0;
//
// lbl项目日期
//
this.lbl项目日期.BackColor = System.Drawing.Color.White;
this.lbl项目日期.Font = new System.Drawing.Font("宋体", 9F);
this.lbl项目日期.ForeColor = System.Drawing.SystemColors.ControlText;
this.lbl项目日期.Location = new System.Drawing.Point(380, 28);
this.lbl项目日期.Name = "lbl项目日期";
this.lbl项目日期.Size = new System.Drawing.Size(70, 18);
this.lbl项目日期.TabIndex = 1;
this.lbl项目日期.Text = "项目日期:";
//
// txt项目日期
//
this.txt项目日期.BackColor = System.Drawing.SystemColors.Window;
this.txt项目日期.Font = new System.Drawing.Font("宋体", 9F);
this.txt项目日期.ForeColor = System.Drawing.SystemColors.WindowText;
this.txt项目日期.Location = new System.Drawing.Point(455, 25);
this.txt项目日期.Name = "txt项目日期";
this.txt项目日期.Size = new System.Drawing.Size(210, 21);
this.txt项目日期.TabIndex = 1;
//
// lbl项目名称
//
this.lbl项目名称.BackColor = System.Drawing.Color.White;
this.lbl项目名称.Font = new System.Drawing.Font("宋体", 9F);
this.lbl项目名称.ForeColor = System.Drawing.SystemColors.ControlText;
this.lbl项目名称.Location = new System.Drawing.Point(20, 55);
this.lbl项目名称.Name = "lbl项目名称";
this.lbl项目名称.Size = new System.Drawing.Size(70, 23);
this.lbl项目名称.TabIndex = 2;
this.lbl项目名称.Text = "项目名称:";
this.lbl项目名称.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// txt项目名称
//
this.txt项目名称.BackColor = System.Drawing.SystemColors.Window;
this.txt项目名称.Font = new System.Drawing.Font("宋体", 9F);
this.txt项目名称.ForeColor = System.Drawing.SystemColors.WindowText;
this.txt项目名称.Location = new System.Drawing.Point(95, 55);
this.txt项目名称.Name = "txt项目名称";
this.txt项目名称.Size = new System.Drawing.Size(570, 21);
this.txt项目名称.TabIndex = 2;
//
// lbl客户名称
//
this.lbl客户名称.BackColor = System.Drawing.Color.White;
this.lbl客户名称.Font = new System.Drawing.Font("宋体", 9F);
this.lbl客户名称.ForeColor = System.Drawing.SystemColors.ControlText;
this.lbl客户名称.Location = new System.Drawing.Point(20, 85);
this.lbl客户名称.Name = "lbl客户名称";
this.lbl客户名称.Size = new System.Drawing.Size(70, 23);
this.lbl客户名称.TabIndex = 3;
this.lbl客户名称.Text = "客户名称:";
this.lbl客户名称.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// txt客户名称
//
this.txt客户名称.BackColor = System.Drawing.SystemColors.Window;
this.txt客户名称.Font = new System.Drawing.Font("宋体", 9F);
this.txt客户名称.ForeColor = System.Drawing.SystemColors.WindowText;
this.txt客户名称.Location = new System.Drawing.Point(95, 85);
this.txt客户名称.Name = "txt客户名称";
this.txt客户名称.Size = new System.Drawing.Size(479, 21);
this.txt客户名称.TabIndex = 3;
//
// btn选择客户
//
this.btn选择客户.BackColor = System.Drawing.SystemColors.Control;
this.btn选择客户.Font = new System.Drawing.Font("宋体", 9F);
this.btn选择客户.ForeColor = System.Drawing.SystemColors.ControlText;
this.btn选择客户.Location = new System.Drawing.Point(580, 85);
this.btn选择客户.Name = "btn选择客户";
this.btn选择客户.Size = new System.Drawing.Size(85, 23);
this.btn选择客户.TabIndex = 4;
this.btn选择客户.Text = "选择客户";
this.btn选择客户.UseVisualStyleBackColor = true;
//
// lbl客户地址
//
this.lbl客户地址.BackColor = System.Drawing.Color.White;
this.lbl客户地址.Font = new System.Drawing.Font("宋体", 9F);
this.lbl客户地址.ForeColor = System.Drawing.SystemColors.ControlText;
this.lbl客户地址.Location = new System.Drawing.Point(20, 115);
this.lbl客户地址.Name = "lbl客户地址";
this.lbl客户地址.Size = new System.Drawing.Size(70, 23);
this.lbl客户地址.TabIndex = 5;
this.lbl客户地址.Text = "客户地址:";
this.lbl客户地址.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// txt客户地址
//
this.txt客户地址.BackColor = System.Drawing.SystemColors.Window;
this.txt客户地址.Font = new System.Drawing.Font("宋体", 9F);
this.txt客户地址.ForeColor = System.Drawing.SystemColors.WindowText;
this.txt客户地址.Location = new System.Drawing.Point(95, 115);
this.txt客户地址.Name = "txt客户地址";
this.txt客户地址.Size = new System.Drawing.Size(570, 21);
this.txt客户地址.TabIndex = 5;
//
// lbl联系人
//
this.lbl联系人.BackColor = System.Drawing.Color.White;
this.lbl联系人.Font = new System.Drawing.Font("宋体", 9F);
this.lbl联系人.ForeColor = System.Drawing.SystemColors.ControlText;
this.lbl联系人.Location = new System.Drawing.Point(30, 145);
this.lbl联系人.Name = "lbl联系人";
this.lbl联系人.Size = new System.Drawing.Size(60, 23);
this.lbl联系人.TabIndex = 6;
this.lbl联系人.Text = "联系人:";
this.lbl联系人.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// txt联系人
//
this.txt联系人.BackColor = System.Drawing.SystemColors.Window;
this.txt联系人.Font = new System.Drawing.Font("宋体", 9F);
this.txt联系人.ForeColor = System.Drawing.SystemColors.WindowText;
this.txt联系人.Location = new System.Drawing.Point(95, 145);
this.txt联系人.Name = "txt联系人";
this.txt联系人.Size = new System.Drawing.Size(220, 21);
this.txt联系人.TabIndex = 6;
//
// lbl联系电话
//
this.lbl联系电话.BackColor = System.Drawing.Color.White;
this.lbl联系电话.Font = new System.Drawing.Font("宋体", 9F);
this.lbl联系电话.ForeColor = System.Drawing.SystemColors.ControlText;
this.lbl联系电话.Location = new System.Drawing.Point(380, 145);
this.lbl联系电话.Name = "lbl联系电话";
this.lbl联系电话.Size = new System.Drawing.Size(70, 21);
this.lbl联系电话.TabIndex = 7;
this.lbl联系电话.Text = "联系电话:";
//
// txt联系电话
//
this.txt联系电话.BackColor = System.Drawing.SystemColors.Window;
this.txt联系电话.Font = new System.Drawing.Font("宋体", 9F);
this.txt联系电话.ForeColor = System.Drawing.SystemColors.WindowText;
this.txt联系电话.Location = new System.Drawing.Point(455, 145);
this.txt联系电话.Name = "txt联系电话";
this.txt联系电话.Size = new System.Drawing.Size(210, 21);
this.txt联系电话.TabIndex = 7;
//
// lbl成套厂名称
//
this.lbl成套厂名称.BackColor = System.Drawing.Color.White;
this.lbl成套厂名称.Font = new System.Drawing.Font("宋体", 9F);
this.lbl成套厂名称.ForeColor = System.Drawing.SystemColors.ControlText;
this.lbl成套厂名称.Location = new System.Drawing.Point(10, 175);
this.lbl成套厂名称.Name = "lbl成套厂名称";
this.lbl成套厂名称.Size = new System.Drawing.Size(80, 23);
this.lbl成套厂名称.TabIndex = 8;
this.lbl成套厂名称.Text = "成套厂名称:";
this.lbl成套厂名称.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// txt成套厂名称
//
this.txt成套厂名称.BackColor = System.Drawing.SystemColors.Window;
this.txt成套厂名称.Font = new System.Drawing.Font("宋体", 9F);
this.txt成套厂名称.ForeColor = System.Drawing.SystemColors.WindowText;
this.txt成套厂名称.Location = new System.Drawing.Point(95, 175);
this.txt成套厂名称.Name = "txt成套厂名称";
this.txt成套厂名称.Size = new System.Drawing.Size(570, 21);
this.txt成套厂名称.TabIndex = 8;
//
// lbl成套厂地址
//
this.lbl成套厂地址.BackColor = System.Drawing.Color.White;
this.lbl成套厂地址.Font = new System.Drawing.Font("宋体", 9F);
this.lbl成套厂地址.ForeColor = System.Drawing.SystemColors.ControlText;
this.lbl成套厂地址.Location = new System.Drawing.Point(10, 205);
this.lbl成套厂地址.Name = "lbl成套厂地址";
this.lbl成套厂地址.Size = new System.Drawing.Size(80, 23);
this.lbl成套厂地址.TabIndex = 9;
this.lbl成套厂地址.Text = "成套厂地址:";
this.lbl成套厂地址.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// txt成套厂地址
//
this.txt成套厂地址.BackColor = System.Drawing.SystemColors.Window;
this.txt成套厂地址.Font = new System.Drawing.Font("宋体", 9F);
this.txt成套厂地址.ForeColor = System.Drawing.SystemColors.WindowText;
this.txt成套厂地址.Location = new System.Drawing.Point(95, 205);
this.txt成套厂地址.Name = "txt成套厂地址";
this.txt成套厂地址.Size = new System.Drawing.Size(570, 21);
this.txt成套厂地址.TabIndex = 9;
//
// lbl成套厂联系人
//
this.lbl成套厂联系人.BackColor = System.Drawing.Color.White;
this.lbl成套厂联系人.Font = new System.Drawing.Font("宋体", 9F);
this.lbl成套厂联系人.ForeColor = System.Drawing.SystemColors.ControlText;
this.lbl成套厂联系人.Location = new System.Drawing.Point(30, 235);
this.lbl成套厂联系人.Name = "lbl成套厂联系人";
this.lbl成套厂联系人.Size = new System.Drawing.Size(60, 23);
this.lbl成套厂联系人.TabIndex = 10;
this.lbl成套厂联系人.Text = "联系人:";
this.lbl成套厂联系人.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// txt成套厂联系人
//
this.txt成套厂联系人.BackColor = System.Drawing.SystemColors.Window;
this.txt成套厂联系人.Font = new System.Drawing.Font("宋体", 9F);
this.txt成套厂联系人.ForeColor = System.Drawing.SystemColors.WindowText;
this.txt成套厂联系人.Location = new System.Drawing.Point(95, 235);
this.txt成套厂联系人.Name = "txt成套厂联系人";
this.txt成套厂联系人.Size = new System.Drawing.Size(220, 21);
this.txt成套厂联系人.TabIndex = 10;
//
// lbl成套厂联系电话
//
this.lbl成套厂联系电话.BackColor = System.Drawing.Color.White;
this.lbl成套厂联系电话.Font = new System.Drawing.Font("宋体", 9F);
this.lbl成套厂联系电话.ForeColor = System.Drawing.SystemColors.ControlText;
this.lbl成套厂联系电话.Location = new System.Drawing.Point(380, 235);
this.lbl成套厂联系电话.Name = "lbl成套厂联系电话";
this.lbl成套厂联系电话.Size = new System.Drawing.Size(70, 21);
this.lbl成套厂联系电话.TabIndex = 11;
this.lbl成套厂联系电话.Text = "联系电话:";
//
// txt成套厂联系电话
//
this.txt成套厂联系电话.BackColor = System.Drawing.SystemColors.Window;
this.txt成套厂联系电话.Font = new System.Drawing.Font("宋体", 9F);
this.txt成套厂联系电话.ForeColor = System.Drawing.SystemColors.WindowText;
this.txt成套厂联系电话.Location = new System.Drawing.Point(455, 235);
this.txt成套厂联系电话.Name = "txt成套厂联系电话";
this.txt成套厂联系电话.Size = new System.Drawing.Size(210, 21);
this.txt成套厂联系电话.TabIndex = 11;
//
// lbl报出方式
//
this.lbl报出方式.BackColor = System.Drawing.Color.White;
this.lbl报出方式.Font = new System.Drawing.Font("宋体", 9F);
this.lbl报出方式.ForeColor = System.Drawing.SystemColors.ControlText;
this.lbl报出方式.Location = new System.Drawing.Point(20, 265);
this.lbl报出方式.Name = "lbl报出方式";
this.lbl报出方式.Size = new System.Drawing.Size(70, 23);
this.lbl报出方式.TabIndex = 12;
this.lbl报出方式.Text = "报出方式:";
this.lbl报出方式.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// cmb报出方式
//
this.cmb报出方式.BackColor = System.Drawing.SystemColors.Window;
this.cmb报出方式.DropDownWidth = 200;
this.cmb报出方式.Font = new System.Drawing.Font("宋体", 9F);
this.cmb报出方式.ForeColor = System.Drawing.SystemColors.WindowText;
this.cmb报出方式.ItemHeight = 12;
this.cmb报出方式.Location = new System.Drawing.Point(95, 265);
this.cmb报出方式.Name = "cmb报出方式";
this.cmb报出方式.Size = new System.Drawing.Size(220, 20);
this.cmb报出方式.TabIndex = 12;
this.cmb报出方式.Text = "报出价=表价*采购系数*报出系数";
//
// lbl箱柜模板
//
this.lbl箱柜模板.BackColor = System.Drawing.Color.White;
this.lbl箱柜模板.Font = new System.Drawing.Font("宋体", 9F);
this.lbl箱柜模板.ForeColor = System.Drawing.SystemColors.ControlText;
this.lbl箱柜模板.Location = new System.Drawing.Point(380, 265);
this.lbl箱柜模板.Name = "lbl箱柜模板";
this.lbl箱柜模板.Size = new System.Drawing.Size(70, 20);
this.lbl箱柜模板.TabIndex = 13;
this.lbl箱柜模板.Text = "箱柜模板:";
//
// cmb箱柜模板
//
this.cmb箱柜模板.BackColor = System.Drawing.SystemColors.Window;
this.cmb箱柜模板.DropDownWidth = 200;
this.cmb箱柜模板.Font = new System.Drawing.Font("宋体", 9F);
this.cmb箱柜模板.ForeColor = System.Drawing.SystemColors.WindowText;
this.cmb箱柜模板.ItemHeight = 12;
this.cmb箱柜模板.Location = new System.Drawing.Point(455, 265);
this.cmb箱柜模板.Name = "cmb箱柜模板";
this.cmb箱柜模板.Size = new System.Drawing.Size(210, 20);
this.cmb箱柜模板.TabIndex = 13;
//
// lbl备注
//
this.lbl备注.BackColor = System.Drawing.Color.White;
this.lbl备注.Font = new System.Drawing.Font("宋体", 9F);
this.lbl备注.ForeColor = System.Drawing.SystemColors.ControlText;
this.lbl备注.Location = new System.Drawing.Point(44, 352);
this.lbl备注.Name = "lbl备注";
this.lbl备注.Size = new System.Drawing.Size(46, 23);
this.lbl备注.TabIndex = 16;
this.lbl备注.Text = "备注:";
this.lbl备注.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// txt备注
//
this.txt备注.BackColor = System.Drawing.SystemColors.Window;
this.txt备注.Font = new System.Drawing.Font("宋体", 9F);
this.txt备注.ForeColor = System.Drawing.SystemColors.WindowText;
this.txt备注.Location = new System.Drawing.Point(95, 352);
this.txt备注.Multiline = true;
this.txt备注.Name = "txt备注";
this.txt备注.Size = new System.Drawing.Size(570, 80);
this.txt备注.TabIndex = 16;
//
// btn确定
//
this.btn确定.BackColor = System.Drawing.SystemColors.Control;
this.btn确定.DialogResult = System.Windows.Forms.DialogResult.OK;
this.btn确定.Font = new System.Drawing.Font("宋体", 9F);
this.btn确定.ForeColor = System.Drawing.SystemColors.ControlText;
this.btn确定.Location = new System.Drawing.Point(455, 449);
this.btn确定.Name = "btn确定";
this.btn确定.Size = new System.Drawing.Size(100, 28);
this.btn确定.TabIndex = 17;
this.btn确定.Text = "确定";
this.btn确定.UseVisualStyleBackColor = true;
//
// btn取消
//
this.btn取消.BackColor = System.Drawing.SystemColors.Control;
this.btn取消.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.btn取消.Font = new System.Drawing.Font("宋体", 9F);
this.btn取消.ForeColor = System.Drawing.SystemColors.ControlText;
this.btn取消.Location = new System.Drawing.Point(565, 449);
this.btn取消.Name = "btn取消";
this.btn取消.Size = new System.Drawing.Size(100, 28);
this.btn取消.TabIndex = 18;
this.btn取消.Text = "取消";
this.btn取消.UseVisualStyleBackColor = true;
//
// lbl单台价格
//
this.lbl单台价格.BackColor = System.Drawing.Color.White;
this.lbl单台价格.Font = new System.Drawing.Font("宋体", 9F);
this.lbl单台价格.ForeColor = System.Drawing.SystemColors.ControlText;
this.lbl单台价格.Location = new System.Drawing.Point(20, 289);
this.lbl单台价格.Name = "lbl单台价格";
this.lbl单台价格.Size = new System.Drawing.Size(70, 23);
this.lbl单台价格.TabIndex = 14;
this.lbl单台价格.Text = "单台价格:";
this.lbl单台价格.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// cmb单台价格
//
this.cmb单台价格.BackColor = System.Drawing.SystemColors.Window;
this.cmb单台价格.DropDownWidth = 200;
this.cmb单台价格.Font = new System.Drawing.Font("宋体", 9F);
this.cmb单台价格.ForeColor = System.Drawing.SystemColors.WindowText;
this.cmb单台价格.ItemHeight = 12;
this.cmb单台价格.Location = new System.Drawing.Point(95, 291);
this.cmb单台价格.Name = "cmb单台价格";
this.cmb单台价格.Size = new System.Drawing.Size(220, 20);
this.cmb单台价格.TabIndex = 14;
this.cmb单台价格.Text = "保留整数";
//
// lbl项目总价
//
this.lbl项目总价.BackColor = System.Drawing.Color.White;
this.lbl项目总价.Font = new System.Drawing.Font("宋体", 9F);
this.lbl项目总价.ForeColor = System.Drawing.SystemColors.ControlText;
this.lbl项目总价.Location = new System.Drawing.Point(379, 293);
this.lbl项目总价.Name = "lbl项目总价";
this.lbl项目总价.Size = new System.Drawing.Size(70, 20);
this.lbl项目总价.TabIndex = 15;
this.lbl项目总价.Text = "项目总价:";
//
// comboBox1
//
this.comboBox1.BackColor = System.Drawing.SystemColors.Window;
this.comboBox1.DropDownWidth = 210;
this.comboBox1.Font = new System.Drawing.Font("宋体", 9F);
this.comboBox1.ForeColor = System.Drawing.SystemColors.WindowText;
this.comboBox1.ItemHeight = 12;
this.comboBox1.Location = new System.Drawing.Point(455, 322);
this.comboBox1.Name = "comboBox1";
this.comboBox1.Size = new System.Drawing.Size(210, 20);
this.comboBox1.TabIndex = 14;
this.comboBox1.Text = "四舍五入";
//
// label1
//
this.label1.BackColor = System.Drawing.Color.White;
this.label1.Font = new System.Drawing.Font("宋体", 9F);
this.label1.ForeColor = System.Drawing.SystemColors.ControlText;
this.label1.Location = new System.Drawing.Point(19, 318);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(70, 23);
this.label1.TabIndex = 14;
this.label1.Text = "单台取整:";
this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// label2
//
this.label2.BackColor = System.Drawing.Color.White;
this.label2.Font = new System.Drawing.Font("宋体", 9F);
this.label2.ForeColor = System.Drawing.SystemColors.ControlText;
this.label2.Location = new System.Drawing.Point(379, 324);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(70, 20);
this.label2.TabIndex = 15;
this.label2.Text = "项目取整:";
//
// comboBox2
//
this.comboBox2.BackColor = System.Drawing.SystemColors.Window;
this.comboBox2.DropDownWidth = 220;
this.comboBox2.Font = new System.Drawing.Font("宋体", 9F);
this.comboBox2.ForeColor = System.Drawing.SystemColors.WindowText;
this.comboBox2.ItemHeight = 12;
this.comboBox2.Location = new System.Drawing.Point(95, 322);
this.comboBox2.Name = "comboBox2";
this.comboBox2.Size = new System.Drawing.Size(220, 20);
this.comboBox2.TabIndex = 14;
this.comboBox2.Text = "四舍五入";
//
// cmb项目总价
//
this.cmb项目总价.BackColor = System.Drawing.SystemColors.Window;
this.cmb项目总价.DropDownWidth = 200;
this.cmb项目总价.Font = new System.Drawing.Font("宋体", 9F);
this.cmb项目总价.ForeColor = System.Drawing.SystemColors.WindowText;
this.cmb项目总价.ItemHeight = 12;
this.cmb项目总价.Location = new System.Drawing.Point(455, 290);
this.cmb项目总价.Name = "cmb项目总价";
this.cmb项目总价.Size = new System.Drawing.Size(210, 20);
this.cmb项目总价.TabIndex = 14;
this.cmb项目总价.Text = "保留整数";
//
// 修改项目
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
this.AutoValidate = System.Windows.Forms.AutoValidate.EnablePreventFocusChange;
this.BackColor = System.Drawing.Color.White;
this.ClientSize = new System.Drawing.Size(684, 499);
this.Controls.Add(this.lbl项目编号);
this.Controls.Add(this.txt项目编号);
this.Controls.Add(this.lbl项目日期);
this.Controls.Add(this.txt项目日期);
this.Controls.Add(this.lbl项目名称);
this.Controls.Add(this.txt项目名称);
this.Controls.Add(this.lbl客户名称);
this.Controls.Add(this.txt客户名称);
this.Controls.Add(this.btn选择客户);
this.Controls.Add(this.lbl客户地址);
this.Controls.Add(this.txt客户地址);
this.Controls.Add(this.lbl联系人);
this.Controls.Add(this.txt联系人);
this.Controls.Add(this.lbl联系电话);
this.Controls.Add(this.txt联系电话);
this.Controls.Add(this.lbl成套厂名称);
this.Controls.Add(this.txt成套厂名称);
this.Controls.Add(this.lbl成套厂地址);
this.Controls.Add(this.txt成套厂地址);
this.Controls.Add(this.lbl成套厂联系人);
this.Controls.Add(this.txt成套厂联系人);
this.Controls.Add(this.lbl成套厂联系电话);
this.Controls.Add(this.txt成套厂联系电话);
this.Controls.Add(this.lbl报出方式);
this.Controls.Add(this.cmb报出方式);
this.Controls.Add(this.lbl箱柜模板);
this.Controls.Add(this.cmb箱柜模板);
this.Controls.Add(this.lbl备注);
this.Controls.Add(this.txt备注);
this.Controls.Add(this.btn确定);
this.Controls.Add(this.btn取消);
this.Controls.Add(this.lbl单台价格);
this.Controls.Add(this.cmb单台价格);
this.Controls.Add(this.lbl项目总价);
this.Controls.Add(this.comboBox1);
this.Controls.Add(this.label1);
this.Controls.Add(this.label2);
this.Controls.Add(this.comboBox2);
this.Controls.Add(this.cmb项目总价);
this.Font = new System.Drawing.Font("宋体", 9F);
this.ForeColor = System.Drawing.SystemColors.ControlText;
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "修改项目";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "修改项目";
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Label lbl项目编号;
private System.Windows.Forms.TextBox txt项目编号;
private System.Windows.Forms.Label lbl项目日期;
private System.Windows.Forms.TextBox txt项目日期;
private System.Windows.Forms.Label lbl项目名称;
private System.Windows.Forms.TextBox txt项目名称;
private System.Windows.Forms.Label lbl客户名称;
private System.Windows.Forms.TextBox txt客户名称;
private System.Windows.Forms.Button btn选择客户;
private System.Windows.Forms.Label lbl客户地址;
private System.Windows.Forms.TextBox txt客户地址;
private System.Windows.Forms.Label lbl联系人;
private System.Windows.Forms.TextBox txt联系人;
private System.Windows.Forms.Label lbl联系电话;
private System.Windows.Forms.TextBox txt联系电话;
private System.Windows.Forms.Label lbl成套厂名称;
private System.Windows.Forms.TextBox txt成套厂名称;
private System.Windows.Forms.Label lbl成套厂地址;
private System.Windows.Forms.TextBox txt成套厂地址;
private System.Windows.Forms.Label lbl成套厂联系人;
private System.Windows.Forms.TextBox txt成套厂联系人;
private System.Windows.Forms.Label lbl成套厂联系电话;
private System.Windows.Forms.TextBox txt成套厂联系电话;
private System.Windows.Forms.Label lbl报出方式;
private System.Windows.Forms.ComboBox cmb报出方式;
private System.Windows.Forms.Label lbl箱柜模板;
private System.Windows.Forms.ComboBox cmb箱柜模板;
private System.Windows.Forms.Label lbl备注;
private System.Windows.Forms.TextBox txt备注;
private System.Windows.Forms.Button btn确定;
private System.Windows.Forms.Button btn取消;
private System.Windows.Forms.Label lbl单台价格;
private System.Windows.Forms.ComboBox cmb单台价格;
private System.Windows.Forms.Label lbl项目总价;
private System.Windows.Forms.ComboBox comboBox1;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.ComboBox comboBox2;
private System.Windows.Forms.ComboBox cmb项目总价;
}
}
+252
View File
@@ -0,0 +1,252 @@
using System;
using System.Collections.Generic;
using System.Windows.Forms;
namespace 成套报价软件
{
/// <summary>
/// 修改项目 的交互逻辑(事件处理)。
/// UI 布局定义见 修改项目.ui.cs。
/// 本窗体作为 MainForm 的对话框使用,故不含独立的 Main 入口点。
/// </summary>
public partial class 修改项目 : Form
{
/// <summary>项目数据库文件绝对路径(与 MainForm 保持一致)。</summary>
private readonly string _dbPath;
/// <summary>项目数据表名。</summary>
private readonly string _tableName;
/// <summary>当前要修改的项目编号(主键)。</summary>
private readonly string _projectId;
/// <summary>
/// 默认构造函数(无参保留,以便独立测试时仍可创建)。
/// 不做任何自动填充。
/// </summary>
public 修改项目()
{
InitializeComponent();
InitPriceFormatCombos();
}
/// <summary>
/// 带数据库路径与现有项目数据的构造函数(主窗口调用此版本)。
/// 传入后对话框在 Load 时会把现有字段值填到各输入框里。
/// </summary>
/// <param name="dbPath">SQLite 数据库绝对路径。</param>
/// <param name="tableName">项目数据表名。</param>
/// <param name="projectId">要修改的项目编号(用于 WHERE 条件)。</param>
/// <param name="existing">现有字段值(键=列名,值=字符串);为空则从数据库读取。</param>
public 修改项目(string dbPath, string tableName,
string projectId, Dictionary<string, string> existing)
{
InitializeComponent();
InitPriceFormatCombos();
_dbPath = dbPath;
_tableName = tableName;
_projectId = projectId;
_existingValues = existing;
// 加载完成后(已显示)填充已有字段。
this.Load += 修改项目_Load;
}
/// <summary>
/// 预置“单台价格/项目总价/单台取整/项目取整”4 个下拉框的“候选选项列表”。
/// 注意:只填充 Items,不改动 SelectedIndex/Text —— 默认值由设计器 XML 决定,
/// 加载已有项目时由 FillFields 根据数据库内容覆盖。
///
/// 控件布局对应(UI 里 label 文字决定语义):
/// 单台价格行 → cmb单台价格(单台层小数位)
/// 项目总价行 → cmb项目总价(项目层小数位)
/// 单台取整行 → comboBox1 (单台层取整方式)
/// 项目取整行 → comboBox2 (项目层取整方式)
/// </summary>
private void InitPriceFormatCombos()
{
// 小数位选项:cmb单台价格(单台层) + cmb项目总价(项目层)
this.cmb单台价格.Items.Clear();
this.cmb单台价格.Items.AddRange(价格格式化.小数位选项);
this.cmb项目总价.Items.Clear();
this.cmb项目总价.Items.AddRange(价格格式化.小数位选项);
// 取整方式选项:comboBox1(单台层) + comboBox2(项目层)
this.comboBox1.Items.Clear();
this.comboBox1.Items.AddRange(价格格式化.取整方式选项);
this.comboBox2.Items.Clear();
this.comboBox2.Items.AddRange(价格格式化.取整方式选项);
}
private readonly Dictionary<string, string> _existingValues;
/// <summary>对话框首次加载:把已有项目数据填入各输入框。</summary>
private void 修改项目_Load(object sender, EventArgs e)
{
// 若未传入 existing,则按 projectId 从数据库读取
Dictionary<string, string> data = _existingValues;
if (data == null || data.Count == 0)
{
data = LoadProjectFromDatabase();
}
FillFields(data);
// 项目编号为主键,不允许修改
this.txt项目编号.ReadOnly = true;
this.txt项目编号.TabStop = false;
this.txt项目编号.BackColor = System.Drawing.SystemColors.Control;
}
/// <summary>
/// 从数据库读取当前 projectId 的项目记录(单行)。
/// 找不到则返回空字典。
/// </summary>
private Dictionary<string, string> LoadProjectFromDatabase()
{
var dict = new Dictionary<string, string>();
if (string.IsNullOrEmpty(_dbPath) ||
string.IsNullOrEmpty(_tableName) ||
string.IsNullOrEmpty(_projectId) ||
!System.IO.File.Exists(_dbPath))
{
return dict;
}
try
{
string connStr = "Data Source=" + _dbPath + ";Version=3;";
using (var conn = new System.Data.SQLite.SQLiteConnection(connStr))
{
conn.Open();
string sql = "SELECT * FROM " + _tableName +
" WHERE 项目编号 = @id LIMIT 1;";
using (var cmd = new System.Data.SQLite.SQLiteCommand(sql, conn))
{
cmd.Parameters.AddWithValue("@id", _projectId);
using (var reader = cmd.ExecuteReader())
{
if (reader.Read())
{
for (int i = 0; i < reader.FieldCount; i++)
{
string col = reader.GetName(i);
object v = reader.IsDBNull(i) ? "" : reader.GetValue(i);
dict[col] = v == null ? "" : v.ToString();
}
}
}
}
}
}
catch
{
// 读取失败不阻断 UI,只是字段为空
}
return dict;
}
/// <summary>把字段字典按列名填到对应的输入框。</summary>
private void FillFields(Dictionary<string, string> data)
{
if (data == null || data.Count == 0)
{
return;
}
this.txt项目编号.Text = GetOrNull(data, "项目编号");
this.txt项目日期.Text = GetOrNull(data, "项目日期");
this.txt项目名称.Text = GetOrNull(data, "项目名称");
this.txt客户名称.Text = GetOrNull(data, "客户名称");
this.txt客户地址.Text = GetOrNull(data, "客户地址");
this.txt联系人.Text = GetOrNull(data, "联系人");
this.txt联系电话.Text = GetOrNull(data, "联系电话");
this.txt成套厂名称.Text = GetOrNull(data, "成套厂名称");
this.txt成套厂地址.Text = GetOrNull(data, "成套厂地址");
this.txt成套厂联系人.Text = GetOrNull(data, "成套厂联系人");
this.txt成套厂联系电话.Text = GetOrNull(data, "成套厂联系电话");
this.txt备注.Text = GetOrNull(data, "备注");
// 下拉框:只有在数据库里有值时才覆盖,避免清空设计器默认项
string v;
if ((v = GetOrNull(data, "报出方式")) != null) this.cmb报出方式.Text = v;
if ((v = GetOrNull(data, "箱柜模板")) != null) this.cmb箱柜模板.Text = v;
// 价格显示格式化(4 个字段):从「项目信息」表读出后回填到对应控件
// 控件对应:cmb单台价格=单台小数位 / cmb项目总价=项目小数位 /
// comboBox1=单台取整方式 / comboBox2=项目取整方式
if ((v = GetOrNull(data, "单台小数位")) != null)
{
this.cmb单台价格.Text = v; // 单台层小数位
if (this.cmb单台价格.SelectedIndex < 0) this.cmb单台价格.Text = "保留整数";
}
if ((v = GetOrNull(data, "项目小数位")) != null)
{
this.cmb项目总价.Text = v; // 项目层小数位
if (this.cmb项目总价.SelectedIndex < 0) this.cmb项目总价.Text = "保留整数";
}
if ((v = GetOrNull(data, "单台取整方式")) != null)
{
this.comboBox1.Text = v; // 单台层取整方式
if (this.comboBox1.SelectedIndex < 0) this.comboBox1.Text = "四舍五入";
}
if ((v = GetOrNull(data, "项目取整方式")) != null)
{
this.comboBox2.Text = v; // 项目层取整方式
if (this.comboBox2.SelectedIndex < 0) this.comboBox2.Text = "四舍五入";
}
}
private static string GetOrNull(Dictionary<string, string> dict, string key)
{
string v;
return dict.TryGetValue(key, out v) ? v : null;
}
/// <summary>
/// 收集对话框中已填写的字段,以"字段名"为键返回。
/// 返回的字典包含所有可能存在的字段(含空值,供 UPDATE 用)。
/// 调用方按列名匹配。
/// </summary>
public Dictionary<string, string> GetInputValues()
{
var values = new Dictionary<string, string>();
// 以下字段会进入数据库 UPDATE;字段名与MainForm advancedDataGridView6 列名一致。
values["项目名称"] = Safe(this.txt项目名称.Text);
values["客户名称"] = Safe(this.txt客户名称.Text);
values["客户地址"] = Safe(this.txt客户地址.Text);
values["联系人"] = Safe(this.txt联系人.Text);
values["联系电话"] = Safe(this.txt联系电话.Text);
values["项目日期"] = Safe(this.txt项目日期.Text);
values["备注"] = Safe(this.txt备注.Text);
// 成套厂信息(4 个字段):新建项目时从企业信息带入,这里随项目一起 UPDATE 回写
values["成套厂名称"] = Safe(this.txt成套厂名称.Text);
values["成套厂地址"] = Safe(this.txt成套厂地址.Text);
values["成套厂联系人"] = Safe(this.txt成套厂联系人.Text);
values["成套厂联系电话"] = Safe(this.txt成套厂联系电话.Text);
// 价格显示格式化(4 个字段):控制报价页价格单元格的“小数位 + 取整方式”
// 控件对应:cmb单台价格=单台小数位 / cmb项目总价=项目小数位 /
// comboBox1=单台取整方式 / comboBox2=项目取整方式
values["单台小数位"] = (this.cmb单台价格.SelectedItem ?? this.cmb单台价格.Text ?? "保留整数").ToString();
values["项目小数位"] = (this.cmb项目总价.SelectedItem ?? this.cmb项目总价.Text ?? "保留整数").ToString();
values["单台取整方式"] = (this.comboBox1.SelectedItem ?? this.comboBox1.Text ?? "四舍五入").ToString();
values["项目取整方式"] = (this.comboBox2.SelectedItem ?? this.comboBox2.Text ?? "四舍五入").ToString();
return values;
}
private static string Safe(string s)
{
return s == null ? "" : s.Trim();
}
// 提示:在设计器的属性窗口(事件页)双击事件名,
// 会自动在此生成事件处理方法骨架。
}
}
@@ -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>
+247
View File
@@ -0,0 +1,247 @@
namespace 成套报价软件
{
public partial class 元件排序 : System.Windows.Forms.Form
{
/// <summary>必需的设计器变量。</summary>
private System.ComponentModel.IContainer components = null;
/// <summary>清理正在使用的资源。</summary>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows 窗体设计器生成的代码
private void InitializeComponent()
{
this.tabControl1 = new System.Windows.Forms.TabControl();
this.tabPage1 = new System.Windows.Forms.TabPage();
this.label1 = new System.Windows.Forms.Label();
this.listBoxXianghao = new System.Windows.Forms.ListBox();
this.btnMoveTop = new System.Windows.Forms.Button();
this.btnMoveUp = new System.Windows.Forms.Button();
this.btnMoveDown = new System.Windows.Forms.Button();
this.btnMoveBottom = new System.Windows.Forms.Button();
this.label2 = new System.Windows.Forms.Label();
this.listBoxYuanjian = new System.Windows.Forms.ListBox();
this.btnOK = new System.Windows.Forms.Button();
this.btnCancel = new System.Windows.Forms.Button();
this.panel1 = new System.Windows.Forms.Panel();
this.tabControl1.SuspendLayout();
this.tabPage1.SuspendLayout();
this.panel1.SuspendLayout();
this.SuspendLayout();
//
// tabControl1
//
this.tabControl1.Controls.Add(this.tabPage1);
this.tabControl1.Dock = System.Windows.Forms.DockStyle.Fill;
this.tabControl1.Font = new System.Drawing.Font("宋体", 9F);
this.tabControl1.ItemSize = new System.Drawing.Size(79, 22);
this.tabControl1.Location = new System.Drawing.Point(0, 0);
this.tabControl1.Name = "tabControl1";
this.tabControl1.SelectedIndex = 0;
this.tabControl1.Size = new System.Drawing.Size(582, 403);
this.tabControl1.TabIndex = 0;
//
// tabPage1
//
this.tabPage1.BackColor = System.Drawing.Color.Transparent;
this.tabPage1.Controls.Add(this.label1);
this.tabPage1.Controls.Add(this.listBoxXianghao);
this.tabPage1.Controls.Add(this.btnMoveTop);
this.tabPage1.Controls.Add(this.btnMoveUp);
this.tabPage1.Controls.Add(this.btnMoveDown);
this.tabPage1.Controls.Add(this.btnMoveBottom);
this.tabPage1.Controls.Add(this.label2);
this.tabPage1.Controls.Add(this.listBoxYuanjian);
this.tabPage1.Font = new System.Drawing.Font("宋体", 9F);
this.tabPage1.ForeColor = System.Drawing.SystemColors.ControlText;
this.tabPage1.Location = new System.Drawing.Point(4, 26);
this.tabPage1.Name = "tabPage1";
this.tabPage1.Padding = new System.Windows.Forms.Padding(3);
this.tabPage1.Size = new System.Drawing.Size(574, 373);
this.tabPage1.TabIndex = 0;
this.tabPage1.Text = "排序1(手动)";
this.tabPage1.UseVisualStyleBackColor = true;
//
// label1
//
this.label1.BackColor = System.Drawing.Color.White;
this.label1.Font = new System.Drawing.Font("宋体", 9F);
this.label1.ForeColor = System.Drawing.SystemColors.ControlText;
this.label1.Location = new System.Drawing.Point(12, 8);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(170, 16);
this.label1.TabIndex = 0;
this.label1.Text = "箱号(点击加载元件):";
//
// listBoxXianghao
//
this.listBoxXianghao.BackColor = System.Drawing.SystemColors.Window;
this.listBoxXianghao.Font = new System.Drawing.Font("宋体", 9F);
this.listBoxXianghao.ForeColor = System.Drawing.SystemColors.WindowText;
this.listBoxXianghao.HorizontalScrollbar = true;
this.listBoxXianghao.ItemHeight = 12;
this.listBoxXianghao.Location = new System.Drawing.Point(12, 27);
this.listBoxXianghao.Name = "listBoxXianghao";
this.listBoxXianghao.Size = new System.Drawing.Size(185, 280);
this.listBoxXianghao.TabIndex = 1;
//
// btnMoveTop
//
this.btnMoveTop.BackColor = System.Drawing.SystemColors.Control;
this.btnMoveTop.Font = new System.Drawing.Font("宋体", 9F);
this.btnMoveTop.ForeColor = System.Drawing.SystemColors.ControlText;
this.btnMoveTop.Location = new System.Drawing.Point(207, 60);
this.btnMoveTop.Name = "btnMoveTop";
this.btnMoveTop.Size = new System.Drawing.Size(48, 30);
this.btnMoveTop.TabIndex = 2;
this.btnMoveTop.Text = "置顶";
this.btnMoveTop.UseVisualStyleBackColor = true;
//
// btnMoveUp
//
this.btnMoveUp.BackColor = System.Drawing.SystemColors.Control;
this.btnMoveUp.Font = new System.Drawing.Font("宋体", 9F);
this.btnMoveUp.ForeColor = System.Drawing.SystemColors.ControlText;
this.btnMoveUp.Location = new System.Drawing.Point(207, 105);
this.btnMoveUp.Name = "btnMoveUp";
this.btnMoveUp.Size = new System.Drawing.Size(48, 30);
this.btnMoveUp.TabIndex = 3;
this.btnMoveUp.Text = "上移";
this.btnMoveUp.UseVisualStyleBackColor = true;
//
// btnMoveDown
//
this.btnMoveDown.BackColor = System.Drawing.SystemColors.Control;
this.btnMoveDown.Font = new System.Drawing.Font("宋体", 9F);
this.btnMoveDown.ForeColor = System.Drawing.SystemColors.ControlText;
this.btnMoveDown.Location = new System.Drawing.Point(207, 150);
this.btnMoveDown.Name = "btnMoveDown";
this.btnMoveDown.Size = new System.Drawing.Size(48, 30);
this.btnMoveDown.TabIndex = 4;
this.btnMoveDown.Text = "下移";
this.btnMoveDown.UseVisualStyleBackColor = true;
//
// btnMoveBottom
//
this.btnMoveBottom.BackColor = System.Drawing.SystemColors.Control;
this.btnMoveBottom.Font = new System.Drawing.Font("宋体", 9F);
this.btnMoveBottom.ForeColor = System.Drawing.SystemColors.ControlText;
this.btnMoveBottom.Location = new System.Drawing.Point(207, 195);
this.btnMoveBottom.Name = "btnMoveBottom";
this.btnMoveBottom.Size = new System.Drawing.Size(48, 30);
this.btnMoveBottom.TabIndex = 5;
this.btnMoveBottom.Text = "置底";
this.btnMoveBottom.UseVisualStyleBackColor = true;
//
// label2
//
this.label2.BackColor = System.Drawing.Color.White;
this.label2.Font = new System.Drawing.Font("宋体", 9F);
this.label2.ForeColor = System.Drawing.SystemColors.ControlText;
this.label2.Location = new System.Drawing.Point(262, 8);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(250, 16);
this.label2.TabIndex = 6;
this.label2.Text = "元件(选中一行后用中间按钮移动):";
//
// listBoxYuanjian
//
this.listBoxYuanjian.BackColor = System.Drawing.SystemColors.Window;
this.listBoxYuanjian.Font = new System.Drawing.Font("宋体", 9F);
this.listBoxYuanjian.ForeColor = System.Drawing.SystemColors.WindowText;
this.listBoxYuanjian.HorizontalScrollbar = true;
this.listBoxYuanjian.ItemHeight = 12;
this.listBoxYuanjian.Location = new System.Drawing.Point(262, 27);
this.listBoxYuanjian.Name = "listBoxYuanjian";
this.listBoxYuanjian.Size = new System.Drawing.Size(258, 280);
this.listBoxYuanjian.TabIndex = 7;
//
// btnOK
//
this.btnOK.BackColor = System.Drawing.SystemColors.Control;
this.btnOK.DialogResult = System.Windows.Forms.DialogResult.OK;
this.btnOK.Font = new System.Drawing.Font("宋体", 9F);
this.btnOK.ForeColor = System.Drawing.SystemColors.ControlText;
this.btnOK.Location = new System.Drawing.Point(404, 12);
this.btnOK.Name = "btnOK";
this.btnOK.Size = new System.Drawing.Size(80, 30);
this.btnOK.TabIndex = 1;
this.btnOK.Text = "确定";
this.btnOK.UseVisualStyleBackColor = true;
//
// btnCancel
//
this.btnCancel.BackColor = System.Drawing.SystemColors.Control;
this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.btnCancel.Font = new System.Drawing.Font("宋体", 9F);
this.btnCancel.ForeColor = System.Drawing.SystemColors.ControlText;
this.btnCancel.Location = new System.Drawing.Point(490, 12);
this.btnCancel.Name = "btnCancel";
this.btnCancel.Size = new System.Drawing.Size(80, 30);
this.btnCancel.TabIndex = 2;
this.btnCancel.Text = "取消";
this.btnCancel.UseVisualStyleBackColor = true;
//
// panel1
//
this.panel1.BackColor = System.Drawing.SystemColors.Control;
this.panel1.Controls.Add(this.btnOK);
this.panel1.Controls.Add(this.btnCancel);
this.panel1.Dock = System.Windows.Forms.DockStyle.Bottom;
this.panel1.Font = new System.Drawing.Font("宋体", 9F);
this.panel1.ForeColor = System.Drawing.SystemColors.ControlText;
this.panel1.Location = new System.Drawing.Point(0, 403);
this.panel1.Name = "panel1";
this.panel1.Size = new System.Drawing.Size(582, 54);
this.panel1.TabIndex = 3;
//
// 元件排序
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
this.AutoValidate = System.Windows.Forms.AutoValidate.EnablePreventFocusChange;
this.BackColor = System.Drawing.Color.White;
this.ClientSize = new System.Drawing.Size(582, 457);
this.Controls.Add(this.tabControl1);
this.Controls.Add(this.panel1);
this.Font = new System.Drawing.Font("宋体", 9F);
this.ForeColor = System.Drawing.SystemColors.ControlText;
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "元件排序";
this.ShowInTaskbar = false;
this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide;
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "元件排序";
this.tabControl1.ResumeLayout(false);
this.tabPage1.ResumeLayout(false);
this.panel1.ResumeLayout(false);
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.TabControl tabControl1;
private System.Windows.Forms.TabPage tabPage1;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.ListBox listBoxXianghao;
private System.Windows.Forms.Button btnMoveTop;
private System.Windows.Forms.Button btnMoveUp;
private System.Windows.Forms.Button btnMoveDown;
private System.Windows.Forms.Button btnMoveBottom;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.ListBox listBoxYuanjian;
private System.Windows.Forms.Button btnOK;
private System.Windows.Forms.Button btnCancel;
private System.Windows.Forms.Panel panel1;
}
}
+447
View File
@@ -0,0 +1,447 @@
using System;
using System.Collections.Generic;
using System.Data;
using System.Windows.Forms;
namespace 成套报价软件
{
/// <summary>
/// 元件排序 的交互逻辑(事件处理)。
/// UI 布局定义见 元件排序.ui.cs。
///
/// 用法:MainForm button33「元件排序」传入(项目编号,当前图号,当前箱号)弹出。
/// 左侧点箱号 → 右侧加载该箱号元件;选中行用 置顶/上移/下移/置底 调整;
/// 点「确定」把右侧列表顺序重排序号写回数据库;「取消」不保存。
/// </summary>
public partial class 元件排序
{
// ===== 主窗口传入的上下文 =====
/// <summary>当前项目编号。</summary>
private string _projectId = "";
/// <summary>打开时的当前图号(用于默认选中箱号)。</summary>
private string _initTuhao = "";
/// <summary>打开时的当前箱号(用于默认选中)。</summary>
private string _initXianghao = "";
// ===== 左侧箱号列表数据 =====
/// <summary>箱号列表数据:Key="图号内部ID\n箱号内部ID", Value="图号 / 箱号"(显示)。</summary>
private List<KeyValuePair<string, string>> _boxList = new List<KeyValuePair<string, string>>();
// ===== 右侧元件列表数据 =====
/// <summary>当前箱号的元件行(独立 DataTable,不动主窗口内存缓存)。</summary>
private List<DataRow> _rows = new List<DataRow>();
/// <summary>按元件名称分组后的组列表:每组=同名称的连续行(保持库内相对顺序)。
/// 右侧列表只显示每组一个名称(带数量),移动按钮按组整体移动。</summary>
private List<List<DataRow>> _groups = new List<List<DataRow>>();
/// <summary>_rows 所属的 DataTable(TableName=真实元件表名 yj_N,保存时用)。</summary>
private DataTable _table = null;
/// <summary>构造函数:初始化 UI 并绑定事件。</summary>
public 元件排序()
{
InitializeComponent();
BindEvents();
}
/// <summary>主窗口调用:传入项目上下文并默认选中当前箱号。</summary>
public 元件排序(string projectId, string currentTuhao, string currentXianghao)
: this()
{
_projectId = projectId ?? "";
_initTuhao = currentTuhao ?? "";
_initXianghao = currentXianghao ?? "";
}
/// <summary>绑定事件 + 初始状态。</summary>
private void BindEvents()
{
// 左侧箱号 → 加载元件
this.listBoxXianghao.SelectedIndexChanged += listBoxXianghao_SelectedIndexChanged;
// 移动按钮
this.btnMoveTop.Click += (s, e) => MoveSelected(-int.MaxValue);
this.btnMoveUp.Click += (s, e) => MoveSelected(-1);
this.btnMoveDown.Click += (s, e) => MoveSelected(1);
this.btnMoveBottom.Click += (s, e) => MoveSelected(int.MaxValue);
// 确定按钮:DialogResult=OK 会直接关窗,在 Closing 前拦截保存
this.btnOK.Click += btnOK_Click;
}
/// <summary>窗体加载:装载箱号列表并默认选中当前箱号。</summary>
protected override void OnLoad(EventArgs e)
{
base.OnLoad(e);
try
{
LoadBoxList();
// 默认选中当前箱号(显示名含 "图号 / 箱号",按箱号内部ID 匹配)
int sel = -1;
if (!string.IsNullOrEmpty(_initXianghao))
{
for (int i = 0; i < _boxList.Count; i++)
{
if (_boxList[i].Key.EndsWith("\n" + _initXianghao))
{
sel = i;
break;
}
}
}
if (sel < 0 && _boxList.Count > 0) sel = 0;
if (sel >= 0) this.listBoxXianghao.SelectedIndex = sel;
}
catch (Exception ex)
{
MessageBox.Show(this, "加载箱号失败:\n" + ex.Message, "元件排序",
MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
// ============================================================
// 数据装载
// ============================================================
/// <summary>报价库路径(与MainForm GetQuoteDbPath 同规则)。</summary>
private string QuoteDbPath
{
get
{
string safe = _projectId;
foreach (char c in System.IO.Path.GetInvalidFileNameChars()) safe = safe.Replace(c, '_');
return System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory,
@"sjk\bjb\项目" + safe + ".db");
}
}
private static string ConnStr(string dbPath) { return "Data Source=" + dbPath + ";Version=3;"; }
/// <summary>读取当前项目所有图号下的箱号,填充左侧列表。</summary>
private void LoadBoxList()
{
_boxList.Clear();
this.listBoxXianghao.Items.Clear();
string dbPath = QuoteDbPath;
if (!System.IO.File.Exists(dbPath)) return;
using (var conn = new System.Data.SQLite.SQLiteConnection(ConnStr(dbPath)))
{
conn.Open();
// 图号表:内部ID + 图号
var tuhaos = new List<KeyValuePair<string, string>>();
using (var cmd = new System.Data.SQLite.SQLiteCommand(
"SELECT 内部ID, 图号 FROM advancedDataGridView9Table ORDER BY rowid;", conn))
using (var rd = cmd.ExecuteReader())
{
while (rd.Read())
{
string id = rd.IsDBNull(0) ? "" : rd.GetString(0);
string nm = rd.IsDBNull(1) ? "" : rd.GetString(1);
if (!string.IsNullOrEmpty(id))
tuhaos.Add(new KeyValuePair<string, string>(id, nm));
}
}
// 每个图号 → 查表索引拿箱号表 → 读箱号
foreach (var th in tuhaos)
{
string xhTbl = GetXianghaoTable(conn, th.Key);
if (string.IsNullOrEmpty(xhTbl)) continue;
try
{
using (var cmd = new System.Data.SQLite.SQLiteCommand(
"SELECT 内部ID, 箱号 FROM \"" + xhTbl + "\" ORDER BY rowid;", conn))
using (var rd = cmd.ExecuteReader())
{
while (rd.Read())
{
string xid = rd.IsDBNull(0) ? "" : rd.GetString(0);
string xnm = rd.IsDBNull(1) ? "" : rd.GetString(1);
if (string.IsNullOrEmpty(xid)) continue;
_boxList.Add(new KeyValuePair<string, string>(
th.Key + "\n" + xid, th.Value + " / " + xnm));
}
}
}
catch { }
}
}
foreach (var kv in _boxList) this.listBoxXianghao.Items.Add(kv.Value);
}
/// <summary>查图号的箱号真实表名(xh_N),无则返回空。</summary>
private static string GetXianghaoTable(System.Data.SQLite.SQLiteConnection conn, string tuhaoId)
{
using (var cmd = new System.Data.SQLite.SQLiteCommand(
"SELECT 实际表名 FROM 表索引 WHERE 类型='箱号' AND 图号=@th LIMIT 1;", conn))
{
cmd.Parameters.AddWithValue("@th", tuhaoId);
object o = cmd.ExecuteScalar();
return (o == null || o == DBNull.Value) ? "" : o.ToString();
}
}
/// <summary>查箱号的元件真实表名(yj_N),无则返回空。</summary>
private static string GetYuanjianTable(System.Data.SQLite.SQLiteConnection conn,
string tuhaoId, string xianghaoId)
{
using (var cmd = new System.Data.SQLite.SQLiteCommand(
"SELECT 实际表名 FROM 表索引 WHERE 类型='元件' AND 图号=@th AND 箱号=@xh LIMIT 1;", conn))
{
cmd.Parameters.AddWithValue("@th", tuhaoId);
cmd.Parameters.AddWithValue("@xh", xianghaoId);
object o = cmd.ExecuteScalar();
return (o == null || o == DBNull.Value) ? "" : o.ToString();
}
}
// ============================================================
// 左侧箱号 → 右侧元件
// ============================================================
/// <summary>点左侧箱号:加载该箱号的元件到右侧列表。</summary>
private void listBoxXianghao_SelectedIndexChanged(object sender, EventArgs e)
{
int idx = this.listBoxXianghao.SelectedIndex;
if (idx < 0 || idx >= _boxList.Count) return;
// 切箱号前,如果当前箱号有未保存的顺序改动 → 先保存
if (_table != null && _dirty) SaveCurrentOrder(false);
string[] parts = _boxList[idx].Key.Split('\n');
if (parts.Length != 2) return;
string yjTbl;
using (var conn = new System.Data.SQLite.SQLiteConnection(ConnStr(QuoteDbPath)))
{
conn.Open();
yjTbl = GetYuanjianTable(conn, parts[0], parts[1]);
}
_rows.Clear();
_groups.Clear();
_table = null;
this.listBoxYuanjian.Items.Clear();
if (string.IsNullOrEmpty(yjTbl))
{
// 该箱号还没有元件表
this.listBoxYuanjian.Items.Add("(此箱号暂无元件)");
return;
}
// 读成独立 DataTable(按 rowid = 原始顺序)
var t = new DataTable();
t.TableName = yjTbl;
using (var conn = new System.Data.SQLite.SQLiteConnection(ConnStr(QuoteDbPath)))
{
conn.Open();
using (var cmd = new System.Data.SQLite.SQLiteCommand(
"SELECT * FROM \"" + yjTbl + "\" ORDER BY rowid;", conn))
using (var adp = new System.Data.SQLite.SQLiteDataAdapter(cmd))
{
adp.Fill(t);
}
}
_table = t;
foreach (DataRow r in t.Rows) _rows.Add(r);
BuildGroups();
RefreshYuanjianList(-1);
}
/// <summary>右侧列表是否有未保存的顺序改动。</summary>
private bool _dirty = false;
/// <summary>
/// 把 _rows 按「元件名称」分组到 _groups:
/// 同名称的行归为一组(组内保持库内相对顺序),右侧列表每组只显示一行。
/// </summary>
private void BuildGroups()
{
_groups.Clear();
if (_rows.Count == 0) return;
// 名称 → 组
var map = new Dictionary<string, List<DataRow>>();
var order = new List<string>(); // 首次出现顺序
foreach (DataRow r in _rows)
{
string name = _table.Columns.Contains("元件名称") ? (r["元件名称"] ?? "").ToString() : "";
if (string.IsNullOrWhiteSpace(name)) name = "(未命名)";
List<DataRow> g;
if (!map.TryGetValue(name, out g))
{
g = new List<DataRow>();
map[name] = g;
order.Add(name);
}
g.Add(r);
}
foreach (string nm in order) _groups.Add(map[nm]);
}
/// <summary>刷新右侧元件列表:每组一行,只显示元件名称(同名多行带 ×N)。</summary>
private void RefreshYuanjianList(int keepIndex)
{
this.listBoxYuanjian.Items.Clear();
for (int i = 0; i < _groups.Count; i++)
{
string name = _table.Columns.Contains("元件名称")
? (_groups[i][0]["元件名称"] ?? "").ToString() : "";
if (string.IsNullOrWhiteSpace(name)) name = "(未命名)";
string text = (i + 1).ToString() + ". " + name;
if (_groups[i].Count > 1) text += " ×" + _groups[i].Count;
this.listBoxYuanjian.Items.Add(text);
}
if (this.listBoxYuanjian.Items.Count > 0)
{
int sel = keepIndex >= 0 && keepIndex < this.listBoxYuanjian.Items.Count ? keepIndex : 0;
this.listBoxYuanjian.SelectedIndex = sel;
}
}
// ============================================================
// 上移/下移/置顶/置底(按组整体移动)
// ============================================================
/// <summary>移动右侧选中的组:delta=-1上移/+1下移/±int.MaxValue置顶置底。</summary>
private void MoveSelected(int delta)
{
if (_groups.Count < 2) return;
int idx = this.listBoxYuanjian.SelectedIndex;
if (idx < 0) return;
int target;
if (delta == -int.MaxValue) target = 0;
else if (delta == int.MaxValue) target = _groups.Count - 1;
else target = idx + delta;
if (target < 0 || target >= _groups.Count || target == idx) return;
List<DataRow> moved = _groups[idx];
_groups.RemoveAt(idx);
_groups.Insert(target, moved);
_dirty = true;
RefreshYuanjianList(target);
}
// ============================================================
// 保存
// ============================================================
/// <summary>确定:把当前箱号顺序写库,然后关窗。</summary>
private void btnOK_Click(object sender, EventArgs e)
{
try
{
if (_table != null && _dirty)
{
SaveCurrentOrder(true);
}
// DialogResult 已由按钮属性设为 OK,直接关窗
}
catch (Exception ex)
{
// 保存失败则不关窗,让用户决定
MessageBox.Show(this, "保存排序失败:\n" + ex.Message, "元件排序",
MessageBoxButtons.OK, MessageBoxIcon.Error);
this.DialogResult = DialogResult.None;
}
}
/// <summary>
/// 按 _groups 顺序展开成新 _rows,重排序号并整表写回库。
/// 组内保持库内原相对顺序;主窗口关闭窗体后会清缓存重载,报价页自动看到新顺序。
/// </summary>
private void SaveCurrentOrder(bool showMessage)
{
if (_table == null || _groups.Count == 0) return;
// 按组顺序展开成新的行顺序
_rows.Clear();
foreach (List<DataRow> g in _groups) _rows.AddRange(g);
// 重排序号 1..N
if (_table.Columns.Contains("序号"))
{
for (int i = 0; i < _rows.Count; i++)
_rows[i]["序号"] = (i + 1).ToString();
}
// 按新顺序重建表
var ordered = _table.Clone();
ordered.TableName = _table.TableName;
foreach (DataRow r in _rows) ordered.ImportRow(r);
string dbPath = QuoteDbPath;
using (var conn = new System.Data.SQLite.SQLiteConnection(ConnStr(dbPath)))
{
conn.Open();
using (var tx = conn.BeginTransaction())
{
try
{
// 删旧 + 按新顺序插回
using (var del = new System.Data.SQLite.SQLiteCommand(
"DELETE FROM \"" + _table.TableName + "\";", conn, tx))
{
del.ExecuteNonQuery();
}
// 用参数化 INSERT(列以表实际列为准)
var cols = new List<string>();
foreach (DataColumn c in ordered.Columns) cols.Add(c.ColumnName);
var colParts = new List<string>();
var valParts = new List<string>();
for (int ci = 0; ci < cols.Count; ci++)
{
colParts.Add("\"" + cols[ci] + "\"");
valParts.Add("@p" + ci);
}
string sql = "INSERT INTO \"" + _table.TableName + "\" (" +
string.Join(",", colParts.ToArray()) +
") VALUES (" + string.Join(",", valParts.ToArray()) + ");";
using (var ins = new System.Data.SQLite.SQLiteCommand(sql, conn, tx))
{
for (int ci = 0; ci < cols.Count; ci++)
ins.Parameters.Add("@p" + ci, System.Data.DbType.String);
foreach (DataRow r in ordered.Rows)
{
for (int i = 0; i < ordered.Columns.Count; i++)
ins.Parameters[i].Value = (r[i] == null || r[i] == DBNull.Value)
? (object)"" : r[i].ToString();
ins.ExecuteNonQuery();
}
}
tx.Commit();
}
catch
{
try { tx.Rollback(); } catch { }
throw;
}
}
}
_dirty = false;
if (showMessage)
{
MessageBox.Show(this, "排序已保存!\n\n共 " + ordered.Rows.Count + " 行元件已按新顺序写入。",
"元件排序", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
}
}
}
@@ -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>
+811
View File
@@ -0,0 +1,811 @@
namespace 成套报价软件
{
public partial class 导入报价 : System.Windows.Forms.Form
{
/// <summary>必需的设计器变量。</summary>
private System.ComponentModel.IContainer components = null;
/// <summary>清理正在使用的资源。</summary>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows 窗体设计器生成的代码
private void InitializeComponent()
{
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle4 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle5 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle6 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle7 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle8 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle9 = new System.Windows.Forms.DataGridViewCellStyle();
this.tabControl2 = new System.Windows.Forms.TabControl();
this.tabPage4 = new System.Windows.Forms.TabPage();
this.splitContainer2 = new System.Windows.Forms.SplitContainer();
this.enhancedDataGridView1 = new Smart.CustomComponents.EnhancedDataGridView();
this.dataGridViewTextBoxColumn1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.dataGridViewTextBoxColumn2 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.dataGridViewTextBoxColumn3 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.dataGridViewTextBoxColumn4 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.dataGridViewTextBoxColumn5 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.dataGridViewTextBoxColumn6 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.dataGridViewTextBoxColumn7 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.dataGridViewTextBoxColumn8 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.dataGridViewTextBoxColumn9 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.dataGridViewTextBoxColumn10 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.splitContainer3 = new System.Windows.Forms.SplitContainer();
this.enhancedDataGridView2 = new Smart.CustomComponents.EnhancedDataGridView();
this.enhancedDataGridView3 = new Smart.CustomComponents.EnhancedDataGridView();
this.dataGridViewTextBoxColumn27 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.dataGridViewTextBoxColumn28 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.dataGridViewTextBoxColumn29 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.dataGridViewTextBoxColumn30 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.dataGridViewTextBoxColumn31 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.dataGridViewTextBoxColumn32 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.dataGridViewTextBoxColumn33 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.dataGridViewTextBoxColumn34 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.dataGridViewTextBoxColumn35 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.dataGridViewTextBoxColumn36 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.dataGridViewTextBoxColumn37 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.dataGridViewTextBoxColumn38 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.dataGridViewTextBoxColumn39 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.dataGridViewTextBoxColumn40 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.dataGridViewTextBoxColumn41 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.dataGridViewTextBoxColumn42 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.dataGridViewTextBoxColumn43 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.tabPage1 = new System.Windows.Forms.TabPage();
this.roundedButton1 = new Smart.CustomComponents.RoundedButton();
this.resizableComboBox1 = new Smart.CustomComponents.ResizableComboBox();
this.panel1 = new System.Windows.Forms.Panel();
this.button1 = new System.Windows.Forms.Button();
this.dataGridViewTextBoxColumn11 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.dataGridViewTextBoxColumn12 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.箱名 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.dataGridViewTextBoxColumn13 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.dataGridViewTextBoxColumn14 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.dataGridViewTextBoxColumn15 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.dataGridViewTextBoxColumn16 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.dataGridViewTextBoxColumn17 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.dataGridViewTextBoxColumn18 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.dataGridViewTextBoxColumn19 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.dataGridViewTextBoxColumn20 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.dataGridViewTextBoxColumn21 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.dataGridViewTextBoxColumn22 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.dataGridViewTextBoxColumn23 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.dataGridViewTextBoxColumn24 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.dataGridViewTextBoxColumn25 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.dataGridViewTextBoxColumn26 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.tabControl2.SuspendLayout();
this.tabPage4.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.splitContainer2)).BeginInit();
this.splitContainer2.Panel1.SuspendLayout();
this.splitContainer2.Panel2.SuspendLayout();
this.splitContainer2.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.enhancedDataGridView1)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.splitContainer3)).BeginInit();
this.splitContainer3.Panel1.SuspendLayout();
this.splitContainer3.Panel2.SuspendLayout();
this.splitContainer3.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.enhancedDataGridView2)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.enhancedDataGridView3)).BeginInit();
this.tabPage1.SuspendLayout();
this.panel1.SuspendLayout();
this.SuspendLayout();
//
// tabControl2
//
this.tabControl2.Controls.Add(this.tabPage4);
this.tabControl2.Controls.Add(this.tabPage1);
this.tabControl2.Dock = System.Windows.Forms.DockStyle.Fill;
this.tabControl2.Font = new System.Drawing.Font("宋体", 9F);
this.tabControl2.ItemSize = new System.Drawing.Size(60, 21);
this.tabControl2.Location = new System.Drawing.Point(0, 38);
this.tabControl2.Name = "tabControl2";
this.tabControl2.SelectedIndex = 0;
this.tabControl2.Size = new System.Drawing.Size(1227, 774);
this.tabControl2.SizeMode = System.Windows.Forms.TabSizeMode.Fixed;
this.tabControl2.TabIndex = 0;
//
// tabPage4
//
this.tabPage4.BackColor = System.Drawing.Color.Transparent;
this.tabPage4.Controls.Add(this.splitContainer2);
this.tabPage4.Font = new System.Drawing.Font("宋体", 9F);
this.tabPage4.ForeColor = System.Drawing.SystemColors.ControlText;
this.tabPage4.Location = new System.Drawing.Point(4, 25);
this.tabPage4.Name = "tabPage4";
this.tabPage4.Padding = new System.Windows.Forms.Padding(3);
this.tabPage4.Size = new System.Drawing.Size(1219, 745);
this.tabPage4.TabIndex = 0;
this.tabPage4.Text = "报价";
this.tabPage4.UseVisualStyleBackColor = true;
//
// splitContainer2
//
this.splitContainer2.BackColor = System.Drawing.Color.Transparent;
this.splitContainer2.Dock = System.Windows.Forms.DockStyle.Fill;
this.splitContainer2.Font = new System.Drawing.Font("宋体", 9F);
this.splitContainer2.ForeColor = System.Drawing.SystemColors.ControlText;
this.splitContainer2.Location = new System.Drawing.Point(3, 3);
this.splitContainer2.Name = "splitContainer2";
//
// splitContainer2.Panel1
//
this.splitContainer2.Panel1.Controls.Add(this.enhancedDataGridView1);
//
// splitContainer2.Panel2
//
this.splitContainer2.Panel2.Controls.Add(this.splitContainer3);
this.splitContainer2.Size = new System.Drawing.Size(1213, 739);
this.splitContainer2.SplitterDistance = 226;
this.splitContainer2.SplitterWidth = 6;
this.splitContainer2.TabIndex = 0;
//
// enhancedDataGridView1
//
this.enhancedDataGridView1.AllowUserToAddRows = false;
dataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
dataGridViewCellStyle1.BackColor = System.Drawing.SystemColors.Control;
dataGridViewCellStyle1.Font = new System.Drawing.Font("宋体", 9F);
dataGridViewCellStyle1.ForeColor = System.Drawing.SystemColors.WindowText;
dataGridViewCellStyle1.SelectionBackColor = System.Drawing.SystemColors.Control;
dataGridViewCellStyle1.SelectionForeColor = System.Drawing.SystemColors.WindowText;
dataGridViewCellStyle1.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.enhancedDataGridView1.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle1;
this.enhancedDataGridView1.ColumnHeadersHeight = 35;
this.enhancedDataGridView1.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
this.dataGridViewTextBoxColumn1,
this.dataGridViewTextBoxColumn2,
this.dataGridViewTextBoxColumn3,
this.dataGridViewTextBoxColumn4,
this.dataGridViewTextBoxColumn5,
this.dataGridViewTextBoxColumn6,
this.dataGridViewTextBoxColumn7,
this.dataGridViewTextBoxColumn8,
this.dataGridViewTextBoxColumn9,
this.dataGridViewTextBoxColumn10});
dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
dataGridViewCellStyle2.BackColor = System.Drawing.SystemColors.Window;
dataGridViewCellStyle2.Font = new System.Drawing.Font("宋体", 9F);
dataGridViewCellStyle2.ForeColor = System.Drawing.SystemColors.ControlText;
dataGridViewCellStyle2.SelectionBackColor = System.Drawing.SystemColors.Window;
dataGridViewCellStyle2.SelectionForeColor = System.Drawing.SystemColors.ControlText;
dataGridViewCellStyle2.WrapMode = System.Windows.Forms.DataGridViewTriState.False;
this.enhancedDataGridView1.DefaultCellStyle = dataGridViewCellStyle2;
this.enhancedDataGridView1.Dock = System.Windows.Forms.DockStyle.Fill;
this.enhancedDataGridView1.EnableHeadersVisualStyles = false;
this.enhancedDataGridView1.Location = new System.Drawing.Point(0, 0);
this.enhancedDataGridView1.Name = "enhancedDataGridView1";
this.enhancedDataGridView1.RightToLeft = System.Windows.Forms.RightToLeft.No;
dataGridViewCellStyle3.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
dataGridViewCellStyle3.BackColor = System.Drawing.SystemColors.Control;
dataGridViewCellStyle3.Font = new System.Drawing.Font("宋体", 9F);
dataGridViewCellStyle3.ForeColor = System.Drawing.SystemColors.WindowText;
dataGridViewCellStyle3.SelectionBackColor = System.Drawing.SystemColors.Control;
dataGridViewCellStyle3.SelectionForeColor = System.Drawing.SystemColors.WindowText;
dataGridViewCellStyle3.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.enhancedDataGridView1.RowHeadersDefaultCellStyle = dataGridViewCellStyle3;
this.enhancedDataGridView1.RowTemplate.Height = 23;
this.enhancedDataGridView1.Size = new System.Drawing.Size(226, 739);
this.enhancedDataGridView1.TabIndex = 0;
//
// dataGridViewTextBoxColumn1
//
this.dataGridViewTextBoxColumn1.DataPropertyName = "序号";
this.dataGridViewTextBoxColumn1.HeaderText = "序号";
this.dataGridViewTextBoxColumn1.Name = "dataGridViewTextBoxColumn1";
this.dataGridViewTextBoxColumn1.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
this.dataGridViewTextBoxColumn1.Width = 35;
//
// dataGridViewTextBoxColumn2
//
this.dataGridViewTextBoxColumn2.DataPropertyName = "图号";
this.dataGridViewTextBoxColumn2.HeaderText = "图号";
this.dataGridViewTextBoxColumn2.Name = "dataGridViewTextBoxColumn2";
this.dataGridViewTextBoxColumn2.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
//
// dataGridViewTextBoxColumn3
//
this.dataGridViewTextBoxColumn3.DataPropertyName = "图名";
this.dataGridViewTextBoxColumn3.HeaderText = "图名";
this.dataGridViewTextBoxColumn3.Name = "dataGridViewTextBoxColumn3";
this.dataGridViewTextBoxColumn3.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
//
// dataGridViewTextBoxColumn4
//
this.dataGridViewTextBoxColumn4.DataPropertyName = "台数";
this.dataGridViewTextBoxColumn4.HeaderText = "台数";
this.dataGridViewTextBoxColumn4.Name = "dataGridViewTextBoxColumn4";
this.dataGridViewTextBoxColumn4.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
this.dataGridViewTextBoxColumn4.Width = 35;
//
// dataGridViewTextBoxColumn5
//
this.dataGridViewTextBoxColumn5.DataPropertyName = "箱柜数量";
this.dataGridViewTextBoxColumn5.HeaderText = "箱柜数量";
this.dataGridViewTextBoxColumn5.Name = "dataGridViewTextBoxColumn5";
this.dataGridViewTextBoxColumn5.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
this.dataGridViewTextBoxColumn5.Width = 35;
//
// dataGridViewTextBoxColumn6
//
this.dataGridViewTextBoxColumn6.DataPropertyName = "单价";
this.dataGridViewTextBoxColumn6.HeaderText = "单价";
this.dataGridViewTextBoxColumn6.Name = "dataGridViewTextBoxColumn6";
this.dataGridViewTextBoxColumn6.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
//
// dataGridViewTextBoxColumn7
//
this.dataGridViewTextBoxColumn7.DataPropertyName = "总价";
this.dataGridViewTextBoxColumn7.HeaderText = "总价";
this.dataGridViewTextBoxColumn7.Name = "dataGridViewTextBoxColumn7";
this.dataGridViewTextBoxColumn7.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
//
// dataGridViewTextBoxColumn8
//
this.dataGridViewTextBoxColumn8.DataPropertyName = "成本总价";
this.dataGridViewTextBoxColumn8.HeaderText = "成本总价";
this.dataGridViewTextBoxColumn8.Name = "dataGridViewTextBoxColumn8";
this.dataGridViewTextBoxColumn8.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
//
// dataGridViewTextBoxColumn9
//
this.dataGridViewTextBoxColumn9.DataPropertyName = "毛利";
this.dataGridViewTextBoxColumn9.HeaderText = "毛利";
this.dataGridViewTextBoxColumn9.Name = "dataGridViewTextBoxColumn9";
this.dataGridViewTextBoxColumn9.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
//
// dataGridViewTextBoxColumn10
//
this.dataGridViewTextBoxColumn10.DataPropertyName = "毛利率";
this.dataGridViewTextBoxColumn10.HeaderText = "毛利率";
this.dataGridViewTextBoxColumn10.Name = "dataGridViewTextBoxColumn10";
this.dataGridViewTextBoxColumn10.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
//
// splitContainer3
//
this.splitContainer3.BackColor = System.Drawing.Color.Transparent;
this.splitContainer3.Dock = System.Windows.Forms.DockStyle.Fill;
this.splitContainer3.Font = new System.Drawing.Font("宋体", 9F);
this.splitContainer3.ForeColor = System.Drawing.SystemColors.ControlText;
this.splitContainer3.Location = new System.Drawing.Point(0, 0);
this.splitContainer3.Name = "splitContainer3";
this.splitContainer3.Orientation = System.Windows.Forms.Orientation.Horizontal;
//
// splitContainer3.Panel1
//
this.splitContainer3.Panel1.Controls.Add(this.enhancedDataGridView2);
//
// splitContainer3.Panel2
//
this.splitContainer3.Panel2.Controls.Add(this.enhancedDataGridView3);
this.splitContainer3.Size = new System.Drawing.Size(981, 739);
this.splitContainer3.SplitterDistance = 483;
this.splitContainer3.SplitterWidth = 6;
this.splitContainer3.TabIndex = 0;
//
// enhancedDataGridView2
//
this.enhancedDataGridView2.AllowUserToAddRows = false;
dataGridViewCellStyle4.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
dataGridViewCellStyle4.BackColor = System.Drawing.SystemColors.Control;
dataGridViewCellStyle4.Font = new System.Drawing.Font("宋体", 9F);
dataGridViewCellStyle4.ForeColor = System.Drawing.SystemColors.WindowText;
dataGridViewCellStyle4.SelectionBackColor = System.Drawing.SystemColors.Control;
dataGridViewCellStyle4.SelectionForeColor = System.Drawing.SystemColors.WindowText;
dataGridViewCellStyle4.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.enhancedDataGridView2.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle4;
this.enhancedDataGridView2.ColumnHeadersHeight = 35;
this.enhancedDataGridView2.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
this.dataGridViewTextBoxColumn11,
this.dataGridViewTextBoxColumn12,
this.箱名,
this.dataGridViewTextBoxColumn13,
this.dataGridViewTextBoxColumn14,
this.dataGridViewTextBoxColumn15,
this.dataGridViewTextBoxColumn16,
this.dataGridViewTextBoxColumn17,
this.dataGridViewTextBoxColumn18,
this.dataGridViewTextBoxColumn19,
this.dataGridViewTextBoxColumn20,
this.dataGridViewTextBoxColumn21,
this.dataGridViewTextBoxColumn22,
this.dataGridViewTextBoxColumn23,
this.dataGridViewTextBoxColumn24,
this.dataGridViewTextBoxColumn25,
this.dataGridViewTextBoxColumn26});
dataGridViewCellStyle5.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
dataGridViewCellStyle5.BackColor = System.Drawing.SystemColors.Window;
dataGridViewCellStyle5.Font = new System.Drawing.Font("宋体", 9F);
dataGridViewCellStyle5.ForeColor = System.Drawing.SystemColors.ControlText;
dataGridViewCellStyle5.SelectionBackColor = System.Drawing.SystemColors.Window;
dataGridViewCellStyle5.SelectionForeColor = System.Drawing.SystemColors.ControlText;
dataGridViewCellStyle5.WrapMode = System.Windows.Forms.DataGridViewTriState.False;
this.enhancedDataGridView2.DefaultCellStyle = dataGridViewCellStyle5;
this.enhancedDataGridView2.Dock = System.Windows.Forms.DockStyle.Fill;
this.enhancedDataGridView2.EnableHeadersVisualStyles = false;
this.enhancedDataGridView2.Location = new System.Drawing.Point(0, 0);
this.enhancedDataGridView2.Name = "enhancedDataGridView2";
this.enhancedDataGridView2.RightToLeft = System.Windows.Forms.RightToLeft.No;
dataGridViewCellStyle6.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
dataGridViewCellStyle6.BackColor = System.Drawing.SystemColors.Control;
dataGridViewCellStyle6.Font = new System.Drawing.Font("宋体", 9F);
dataGridViewCellStyle6.ForeColor = System.Drawing.SystemColors.WindowText;
dataGridViewCellStyle6.SelectionBackColor = System.Drawing.SystemColors.Control;
dataGridViewCellStyle6.SelectionForeColor = System.Drawing.SystemColors.WindowText;
dataGridViewCellStyle6.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.enhancedDataGridView2.RowHeadersDefaultCellStyle = dataGridViewCellStyle6;
this.enhancedDataGridView2.RowTemplate.Height = 23;
this.enhancedDataGridView2.Size = new System.Drawing.Size(981, 483);
this.enhancedDataGridView2.TabIndex = 0;
//
// enhancedDataGridView3
//
this.enhancedDataGridView3.AllowUserToAddRows = false;
dataGridViewCellStyle7.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
dataGridViewCellStyle7.BackColor = System.Drawing.SystemColors.Control;
dataGridViewCellStyle7.Font = new System.Drawing.Font("宋体", 9F);
dataGridViewCellStyle7.ForeColor = System.Drawing.SystemColors.WindowText;
dataGridViewCellStyle7.SelectionBackColor = System.Drawing.SystemColors.Control;
dataGridViewCellStyle7.SelectionForeColor = System.Drawing.SystemColors.WindowText;
dataGridViewCellStyle7.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.enhancedDataGridView3.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle7;
this.enhancedDataGridView3.ColumnHeadersHeight = 35;
this.enhancedDataGridView3.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
this.dataGridViewTextBoxColumn27,
this.dataGridViewTextBoxColumn28,
this.dataGridViewTextBoxColumn29,
this.dataGridViewTextBoxColumn30,
this.dataGridViewTextBoxColumn31,
this.dataGridViewTextBoxColumn32,
this.dataGridViewTextBoxColumn33,
this.dataGridViewTextBoxColumn34,
this.dataGridViewTextBoxColumn35,
this.dataGridViewTextBoxColumn36,
this.dataGridViewTextBoxColumn37,
this.dataGridViewTextBoxColumn38,
this.dataGridViewTextBoxColumn39,
this.dataGridViewTextBoxColumn40,
this.dataGridViewTextBoxColumn41,
this.dataGridViewTextBoxColumn42,
this.dataGridViewTextBoxColumn43});
dataGridViewCellStyle8.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
dataGridViewCellStyle8.BackColor = System.Drawing.SystemColors.Window;
dataGridViewCellStyle8.Font = new System.Drawing.Font("宋体", 9F);
dataGridViewCellStyle8.ForeColor = System.Drawing.SystemColors.ControlText;
dataGridViewCellStyle8.SelectionBackColor = System.Drawing.SystemColors.Window;
dataGridViewCellStyle8.SelectionForeColor = System.Drawing.SystemColors.ControlText;
dataGridViewCellStyle8.WrapMode = System.Windows.Forms.DataGridViewTriState.False;
this.enhancedDataGridView3.DefaultCellStyle = dataGridViewCellStyle8;
this.enhancedDataGridView3.Dock = System.Windows.Forms.DockStyle.Fill;
this.enhancedDataGridView3.EnableHeadersVisualStyles = false;
this.enhancedDataGridView3.Location = new System.Drawing.Point(0, 0);
this.enhancedDataGridView3.Name = "enhancedDataGridView3";
this.enhancedDataGridView3.RightToLeft = System.Windows.Forms.RightToLeft.No;
dataGridViewCellStyle9.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
dataGridViewCellStyle9.BackColor = System.Drawing.SystemColors.Control;
dataGridViewCellStyle9.Font = new System.Drawing.Font("宋体", 9F);
dataGridViewCellStyle9.ForeColor = System.Drawing.SystemColors.WindowText;
dataGridViewCellStyle9.SelectionBackColor = System.Drawing.SystemColors.Control;
dataGridViewCellStyle9.SelectionForeColor = System.Drawing.SystemColors.WindowText;
dataGridViewCellStyle9.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.enhancedDataGridView3.RowHeadersDefaultCellStyle = dataGridViewCellStyle9;
this.enhancedDataGridView3.RowTemplate.Height = 23;
this.enhancedDataGridView3.Size = new System.Drawing.Size(981, 250);
this.enhancedDataGridView3.TabIndex = 0;
//
// dataGridViewTextBoxColumn27
//
this.dataGridViewTextBoxColumn27.DataPropertyName = "序号";
this.dataGridViewTextBoxColumn27.HeaderText = "序号";
this.dataGridViewTextBoxColumn27.Name = "dataGridViewTextBoxColumn27";
this.dataGridViewTextBoxColumn27.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
this.dataGridViewTextBoxColumn27.Width = 35;
//
// dataGridViewTextBoxColumn28
//
this.dataGridViewTextBoxColumn28.DataPropertyName = "元件名称";
this.dataGridViewTextBoxColumn28.HeaderText = "元件名称";
this.dataGridViewTextBoxColumn28.Name = "dataGridViewTextBoxColumn28";
this.dataGridViewTextBoxColumn28.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
this.dataGridViewTextBoxColumn28.Width = 150;
//
// dataGridViewTextBoxColumn29
//
this.dataGridViewTextBoxColumn29.DataPropertyName = "规格";
this.dataGridViewTextBoxColumn29.HeaderText = "规格";
this.dataGridViewTextBoxColumn29.Name = "dataGridViewTextBoxColumn29";
this.dataGridViewTextBoxColumn29.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
this.dataGridViewTextBoxColumn29.Width = 150;
//
// dataGridViewTextBoxColumn30
//
this.dataGridViewTextBoxColumn30.DataPropertyName = "单位";
this.dataGridViewTextBoxColumn30.HeaderText = "单位";
this.dataGridViewTextBoxColumn30.Name = "dataGridViewTextBoxColumn30";
this.dataGridViewTextBoxColumn30.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
this.dataGridViewTextBoxColumn30.Width = 35;
//
// dataGridViewTextBoxColumn31
//
this.dataGridViewTextBoxColumn31.DataPropertyName = "数量";
this.dataGridViewTextBoxColumn31.HeaderText = "数量";
this.dataGridViewTextBoxColumn31.Name = "dataGridViewTextBoxColumn31";
this.dataGridViewTextBoxColumn31.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
this.dataGridViewTextBoxColumn31.Width = 40;
//
// dataGridViewTextBoxColumn32
//
this.dataGridViewTextBoxColumn32.DataPropertyName = "表价";
this.dataGridViewTextBoxColumn32.HeaderText = "表价";
this.dataGridViewTextBoxColumn32.Name = "dataGridViewTextBoxColumn32";
this.dataGridViewTextBoxColumn32.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
//
// dataGridViewTextBoxColumn33
//
this.dataGridViewTextBoxColumn33.DataPropertyName = "采购单价";
this.dataGridViewTextBoxColumn33.HeaderText = "采购单价";
this.dataGridViewTextBoxColumn33.Name = "dataGridViewTextBoxColumn33";
this.dataGridViewTextBoxColumn33.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
//
// dataGridViewTextBoxColumn34
//
this.dataGridViewTextBoxColumn34.DataPropertyName = "采购系数";
this.dataGridViewTextBoxColumn34.HeaderText = "采购系数";
this.dataGridViewTextBoxColumn34.Name = "dataGridViewTextBoxColumn34";
this.dataGridViewTextBoxColumn34.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
//
// dataGridViewTextBoxColumn35
//
this.dataGridViewTextBoxColumn35.DataPropertyName = "采购价";
this.dataGridViewTextBoxColumn35.HeaderText = "采购价";
this.dataGridViewTextBoxColumn35.Name = "dataGridViewTextBoxColumn35";
this.dataGridViewTextBoxColumn35.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
//
// dataGridViewTextBoxColumn36
//
this.dataGridViewTextBoxColumn36.DataPropertyName = "报出单价";
this.dataGridViewTextBoxColumn36.HeaderText = "报出单价";
this.dataGridViewTextBoxColumn36.Name = "dataGridViewTextBoxColumn36";
this.dataGridViewTextBoxColumn36.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
//
// dataGridViewTextBoxColumn37
//
this.dataGridViewTextBoxColumn37.DataPropertyName = "报出系数";
this.dataGridViewTextBoxColumn37.HeaderText = "报出系数";
this.dataGridViewTextBoxColumn37.Name = "dataGridViewTextBoxColumn37";
this.dataGridViewTextBoxColumn37.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
//
// dataGridViewTextBoxColumn38
//
this.dataGridViewTextBoxColumn38.DataPropertyName = "报出价";
this.dataGridViewTextBoxColumn38.HeaderText = "报出价";
this.dataGridViewTextBoxColumn38.Name = "dataGridViewTextBoxColumn38";
this.dataGridViewTextBoxColumn38.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
//
// dataGridViewTextBoxColumn39
//
this.dataGridViewTextBoxColumn39.DataPropertyName = "图纸规格";
this.dataGridViewTextBoxColumn39.HeaderText = "图纸规格";
this.dataGridViewTextBoxColumn39.Name = "dataGridViewTextBoxColumn39";
this.dataGridViewTextBoxColumn39.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
//
// dataGridViewTextBoxColumn40
//
this.dataGridViewTextBoxColumn40.DataPropertyName = "品牌";
this.dataGridViewTextBoxColumn40.HeaderText = "品牌";
this.dataGridViewTextBoxColumn40.Name = "dataGridViewTextBoxColumn40";
this.dataGridViewTextBoxColumn40.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
//
// dataGridViewTextBoxColumn41
//
this.dataGridViewTextBoxColumn41.DataPropertyName = "系列";
this.dataGridViewTextBoxColumn41.HeaderText = "系列";
this.dataGridViewTextBoxColumn41.Name = "dataGridViewTextBoxColumn41";
this.dataGridViewTextBoxColumn41.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
//
// dataGridViewTextBoxColumn42
//
this.dataGridViewTextBoxColumn42.DataPropertyName = "类型";
this.dataGridViewTextBoxColumn42.HeaderText = "类型";
this.dataGridViewTextBoxColumn42.Name = "dataGridViewTextBoxColumn42";
this.dataGridViewTextBoxColumn42.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
//
// dataGridViewTextBoxColumn43
//
this.dataGridViewTextBoxColumn43.DataPropertyName = "备注";
this.dataGridViewTextBoxColumn43.HeaderText = "备注";
this.dataGridViewTextBoxColumn43.Name = "dataGridViewTextBoxColumn43";
this.dataGridViewTextBoxColumn43.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
//
// tabPage1
//
this.tabPage1.BackColor = System.Drawing.Color.Transparent;
this.tabPage1.Controls.Add(this.roundedButton1);
this.tabPage1.Controls.Add(this.resizableComboBox1);
this.tabPage1.Font = new System.Drawing.Font("宋体", 9F);
this.tabPage1.ForeColor = System.Drawing.SystemColors.ControlText;
this.tabPage1.Location = new System.Drawing.Point(4, 25);
this.tabPage1.Name = "tabPage1";
this.tabPage1.Size = new System.Drawing.Size(1219, 745);
this.tabPage1.TabIndex = 1;
this.tabPage1.Text = "设置";
this.tabPage1.UseVisualStyleBackColor = true;
//
// roundedButton1
//
this.roundedButton1.BackColor = System.Drawing.Color.Transparent;
this.roundedButton1.Cursor = System.Windows.Forms.Cursors.Hand;
this.roundedButton1.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F);
this.roundedButton1.ForeColor = System.Drawing.Color.White;
this.roundedButton1.Location = new System.Drawing.Point(797, 14);
this.roundedButton1.Name = "roundedButton1";
this.roundedButton1.Size = new System.Drawing.Size(100, 32);
this.roundedButton1.TabIndex = 1;
this.roundedButton1.Text = "选择...";
//
// resizableComboBox1
//
this.resizableComboBox1.ArrowColor = System.Drawing.Color.FromArgb(((int)(((byte)(96)))), ((int)(((byte)(98)))), ((int)(((byte)(102)))));
this.resizableComboBox1.ArrowHoverColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(158)))), ((int)(((byte)(255)))));
this.resizableComboBox1.BackColor = System.Drawing.Color.White;
this.resizableComboBox1.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(173)))), ((int)(((byte)(178)))), ((int)(((byte)(184)))));
this.resizableComboBox1.Cursor = System.Windows.Forms.Cursors.Hand;
this.resizableComboBox1.Font = new System.Drawing.Font("微软雅黑", 9F);
this.resizableComboBox1.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(48)))), ((int)(((byte)(49)))), ((int)(((byte)(51)))));
this.resizableComboBox1.HoverBorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(158)))), ((int)(((byte)(255)))));
this.resizableComboBox1.Location = new System.Drawing.Point(26, 14);
this.resizableComboBox1.Name = "resizableComboBox1";
this.resizableComboBox1.SelectedItem = null;
this.resizableComboBox1.Size = new System.Drawing.Size(751, 32);
this.resizableComboBox1.TabIndex = 0;
//
// panel1
//
this.panel1.BackColor = System.Drawing.SystemColors.Control;
this.panel1.Controls.Add(this.button1);
this.panel1.Dock = System.Windows.Forms.DockStyle.Top;
this.panel1.Font = new System.Drawing.Font("宋体", 9F);
this.panel1.ForeColor = System.Drawing.SystemColors.ControlText;
this.panel1.Location = new System.Drawing.Point(0, 0);
this.panel1.Name = "panel1";
this.panel1.Size = new System.Drawing.Size(1227, 38);
this.panel1.TabIndex = 1;
//
// button1
//
this.button1.BackColor = System.Drawing.SystemColors.Control;
this.button1.Font = new System.Drawing.Font("宋体", 9F);
this.button1.ForeColor = System.Drawing.SystemColors.ControlText;
this.button1.Location = new System.Drawing.Point(12, 8);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(75, 23);
this.button1.TabIndex = 0;
this.button1.Text = "导入报价表";
this.button1.UseVisualStyleBackColor = true;
//
// dataGridViewTextBoxColumn11
//
this.dataGridViewTextBoxColumn11.DataPropertyName = "序号";
this.dataGridViewTextBoxColumn11.HeaderText = "序号";
this.dataGridViewTextBoxColumn11.Name = "dataGridViewTextBoxColumn11";
this.dataGridViewTextBoxColumn11.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
this.dataGridViewTextBoxColumn11.Width = 35;
//
// dataGridViewTextBoxColumn12
//
this.dataGridViewTextBoxColumn12.DataPropertyName = "箱号";
this.dataGridViewTextBoxColumn12.HeaderText = "箱号";
this.dataGridViewTextBoxColumn12.Name = "dataGridViewTextBoxColumn12";
this.dataGridViewTextBoxColumn12.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
this.dataGridViewTextBoxColumn12.Width = 150;
//
// 箱名
//
this.箱名.DataPropertyName = "箱名";
this.箱名.HeaderText = "箱名";
this.箱名.Name = "箱名";
this.箱名.Width = 150;
//
// dataGridViewTextBoxColumn13
//
this.dataGridViewTextBoxColumn13.DataPropertyName = "型号";
this.dataGridViewTextBoxColumn13.HeaderText = "型号";
this.dataGridViewTextBoxColumn13.Name = "dataGridViewTextBoxColumn13";
this.dataGridViewTextBoxColumn13.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
this.dataGridViewTextBoxColumn13.Width = 150;
//
// dataGridViewTextBoxColumn14
//
this.dataGridViewTextBoxColumn14.DataPropertyName = "规格";
this.dataGridViewTextBoxColumn14.HeaderText = "规格";
this.dataGridViewTextBoxColumn14.Name = "dataGridViewTextBoxColumn14";
this.dataGridViewTextBoxColumn14.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
this.dataGridViewTextBoxColumn14.Width = 150;
//
// dataGridViewTextBoxColumn15
//
this.dataGridViewTextBoxColumn15.DataPropertyName = "单位";
this.dataGridViewTextBoxColumn15.HeaderText = "单位";
this.dataGridViewTextBoxColumn15.Name = "dataGridViewTextBoxColumn15";
this.dataGridViewTextBoxColumn15.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
this.dataGridViewTextBoxColumn15.Width = 35;
//
// dataGridViewTextBoxColumn16
//
this.dataGridViewTextBoxColumn16.DataPropertyName = "数量";
this.dataGridViewTextBoxColumn16.HeaderText = "数量";
this.dataGridViewTextBoxColumn16.Name = "dataGridViewTextBoxColumn16";
this.dataGridViewTextBoxColumn16.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
this.dataGridViewTextBoxColumn16.Width = 45;
//
// dataGridViewTextBoxColumn17
//
this.dataGridViewTextBoxColumn17.DataPropertyName = "单台成本";
this.dataGridViewTextBoxColumn17.HeaderText = "单台成本";
this.dataGridViewTextBoxColumn17.Name = "dataGridViewTextBoxColumn17";
this.dataGridViewTextBoxColumn17.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
//
// dataGridViewTextBoxColumn18
//
this.dataGridViewTextBoxColumn18.DataPropertyName = "成本价";
this.dataGridViewTextBoxColumn18.HeaderText = "成本价";
this.dataGridViewTextBoxColumn18.Name = "dataGridViewTextBoxColumn18";
this.dataGridViewTextBoxColumn18.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
//
// dataGridViewTextBoxColumn19
//
this.dataGridViewTextBoxColumn19.DataPropertyName = "单台报出";
this.dataGridViewTextBoxColumn19.HeaderText = "单台报出";
this.dataGridViewTextBoxColumn19.Name = "dataGridViewTextBoxColumn19";
this.dataGridViewTextBoxColumn19.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
//
// dataGridViewTextBoxColumn20
//
this.dataGridViewTextBoxColumn20.DataPropertyName = "报出价";
this.dataGridViewTextBoxColumn20.HeaderText = "报出价";
this.dataGridViewTextBoxColumn20.Name = "dataGridViewTextBoxColumn20";
this.dataGridViewTextBoxColumn20.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
//
// dataGridViewTextBoxColumn21
//
this.dataGridViewTextBoxColumn21.DataPropertyName = "利润";
this.dataGridViewTextBoxColumn21.HeaderText = "利润";
this.dataGridViewTextBoxColumn21.Name = "dataGridViewTextBoxColumn21";
this.dataGridViewTextBoxColumn21.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
//
// dataGridViewTextBoxColumn22
//
this.dataGridViewTextBoxColumn22.DataPropertyName = "利润率";
this.dataGridViewTextBoxColumn22.HeaderText = "利润率";
this.dataGridViewTextBoxColumn22.Name = "dataGridViewTextBoxColumn22";
this.dataGridViewTextBoxColumn22.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
//
// dataGridViewTextBoxColumn23
//
this.dataGridViewTextBoxColumn23.DataPropertyName = "毛利率";
this.dataGridViewTextBoxColumn23.HeaderText = "毛利率";
this.dataGridViewTextBoxColumn23.Name = "dataGridViewTextBoxColumn23";
this.dataGridViewTextBoxColumn23.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
//
// dataGridViewTextBoxColumn24
//
this.dataGridViewTextBoxColumn24.DataPropertyName = "箱柜类型";
this.dataGridViewTextBoxColumn24.HeaderText = "箱柜类型";
this.dataGridViewTextBoxColumn24.Name = "dataGridViewTextBoxColumn24";
this.dataGridViewTextBoxColumn24.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
//
// dataGridViewTextBoxColumn25
//
this.dataGridViewTextBoxColumn25.DataPropertyName = "备注";
this.dataGridViewTextBoxColumn25.HeaderText = "备注";
this.dataGridViewTextBoxColumn25.Name = "dataGridViewTextBoxColumn25";
this.dataGridViewTextBoxColumn25.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
//
// dataGridViewTextBoxColumn26
//
this.dataGridViewTextBoxColumn26.DataPropertyName = "图纸";
this.dataGridViewTextBoxColumn26.HeaderText = "图纸";
this.dataGridViewTextBoxColumn26.Name = "dataGridViewTextBoxColumn26";
this.dataGridViewTextBoxColumn26.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
//
// 导入报价
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
this.AutoValidate = System.Windows.Forms.AutoValidate.EnablePreventFocusChange;
this.BackColor = System.Drawing.Color.White;
this.ClientSize = new System.Drawing.Size(1227, 812);
this.Controls.Add(this.tabControl2);
this.Controls.Add(this.panel1);
this.Font = new System.Drawing.Font("宋体", 9F);
this.ForeColor = System.Drawing.SystemColors.ControlText;
this.Name = "导入报价";
this.Text = "导入报价";
this.tabControl2.ResumeLayout(false);
this.tabPage4.ResumeLayout(false);
this.splitContainer2.Panel1.ResumeLayout(false);
this.splitContainer2.Panel2.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.splitContainer2)).EndInit();
this.splitContainer2.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.enhancedDataGridView1)).EndInit();
this.splitContainer3.Panel1.ResumeLayout(false);
this.splitContainer3.Panel2.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.splitContainer3)).EndInit();
this.splitContainer3.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.enhancedDataGridView2)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.enhancedDataGridView3)).EndInit();
this.tabPage1.ResumeLayout(false);
this.panel1.ResumeLayout(false);
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.TabControl tabControl2;
private System.Windows.Forms.TabPage tabPage4;
private System.Windows.Forms.SplitContainer splitContainer2;
private System.Windows.Forms.SplitContainer splitContainer3;
private System.Windows.Forms.TabPage tabPage1;
private Smart.CustomComponents.ResizableComboBox resizableComboBox1;
private Smart.CustomComponents.RoundedButton roundedButton1;
private System.Windows.Forms.Panel panel1;
private System.Windows.Forms.Button button1;
private Smart.CustomComponents.EnhancedDataGridView enhancedDataGridView1;
private Smart.CustomComponents.EnhancedDataGridView enhancedDataGridView2;
private Smart.CustomComponents.EnhancedDataGridView enhancedDataGridView3;
private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn1;
private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn2;
private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn3;
private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn4;
private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn5;
private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn6;
private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn7;
private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn8;
private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn9;
private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn10;
private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn11;
private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn12;
private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn13;
private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn14;
private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn15;
private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn16;
private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn17;
private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn18;
private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn19;
private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn20;
private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn21;
private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn22;
private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn23;
private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn24;
private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn25;
private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn26;
private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn27;
private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn28;
private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn29;
private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn30;
private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn31;
private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn32;
private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn33;
private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn34;
private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn35;
private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn36;
private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn37;
private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn38;
private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn39;
private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn40;
private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn41;
private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn42;
private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn43;
private System.Windows.Forms.DataGridViewTextBoxColumn 箱名;
}
}
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,123 @@
<?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="箱名.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
</root>
+110
View File
@@ -0,0 +1,110 @@
namespace 成套报价软件
{
/// <summary>
/// 批量插入询问 对话框的设计器布局文件。
/// ★ 可用 SharpDevelop 设计器打开微调布局(2026-10-01)。
/// 控件:lbl消息(消息文本)/chk不再询问(记忆复选框)/
/// btn全部插入(Yes)/btn取消(Cancel)。
/// ("仅当前行"按钮已按用户要求删除,2026-10-01)
/// 消息文本运行时由 批量插入询问.cs 按内容自适应高度。
/// </summary>
public partial class 批量插入询问 : System.Windows.Forms.Form
{
/// <summary>必需的设计器变量。</summary>
private System.ComponentModel.IContainer components = null;
/// <summary>清理正在使用的资源。</summary>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows 窗体设计器生成的代码
/// <summary>设计器支持所需的方法。</summary>
private void InitializeComponent()
{
this.lbl消息 = new System.Windows.Forms.Label();
this.chk不再询问 = new System.Windows.Forms.CheckBox();
this.btn取消 = new System.Windows.Forms.Button();
this.btn全部插入 = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// lbl消息
//
this.lbl消息.AutoSize = true;
this.lbl消息.Location = new System.Drawing.Point(14, 14);
this.lbl消息.MaximumSize = new System.Drawing.Size(460, 0);
this.lbl消息.Name = "lbl消息";
this.lbl消息.Size = new System.Drawing.Size(185, 60);
this.lbl消息.TabIndex = 0;
this.lbl消息.Text = "当前选中 N 个箱号:\r\n箱号列表\r\n\r\n[全部插入] 插入到全部 N 个箱号";
//
// chk不再询问
//
this.chk不再询问.AutoSize = true;
this.chk不再询问.Location = new System.Drawing.Point(14, 95);
this.chk不再询问.Name = "chk不再询问";
this.chk不再询问.Size = new System.Drawing.Size(204, 16);
this.chk不再询问.TabIndex = 1;
this.chk不再询问.Text = "以后不再询问,一直沿用本次选择";
this.chk不再询问.UseVisualStyleBackColor = true;
//
// btn取消
//
this.btn取消.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.btn取消.Location = new System.Drawing.Point(224, 156);
this.btn取消.Name = "btn取消";
this.btn取消.Size = new System.Drawing.Size(96, 32);
this.btn取消.TabIndex = 2;
this.btn取消.Text = "取消";
this.btn取消.UseVisualStyleBackColor = true;
//
// btn全部插入
//
this.btn全部插入.DialogResult = System.Windows.Forms.DialogResult.Yes;
this.btn全部插入.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btn全部插入.Location = new System.Drawing.Point(122, 156);
this.btn全部插入.Name = "btn全部插入";
this.btn全部插入.Size = new System.Drawing.Size(96, 32);
this.btn全部插入.TabIndex = 4;
this.btn全部插入.Text = "全部插入";
this.btn全部插入.UseVisualStyleBackColor = true;
//
// 批量插入询问
//
this.AcceptButton = this.btn全部插入;
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.CancelButton = this.btn取消;
this.ClientSize = new System.Drawing.Size(336, 200);
this.Controls.Add(this.btn全部插入);
this.Controls.Add(this.btn取消);
this.Controls.Add(this.chk不再询问);
this.Controls.Add(this.lbl消息);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
this.MaximizeBox = false;
this.MaximumSize = new System.Drawing.Size(352, 239);
this.MinimizeBox = false;
this.MinimumSize = new System.Drawing.Size(352, 239);
this.Name = "批量插入询问";
this.ShowInTaskbar = false;
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "批量插入元件";
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Label lbl消息;
private System.Windows.Forms.CheckBox chk不再询问;
private System.Windows.Forms.Button btn取消;
private System.Windows.Forms.Button btn全部插入;
}
}
@@ -0,0 +1,69 @@
using System;
using System.Drawing;
using System.Windows.Forms;
namespace 成套报价软件
{
/// <summary>
/// 批量插入询问 的交互逻辑(2026-10-01):
/// 多选箱号插入元件时的确认框(用户已删"仅当前行"按钮,2026-10-01)。
/// 返回 DialogResult:Yes=全部插入 / Cancel=取消
/// 勾选状态读 属性 不再询问(勾选且点了 Yes 才会被调用方记忆)
/// 用法:using (var f = new 批量插入询问 { 消息 = "..." }) { f.ShowDialog(父窗体); ... }
/// 布局在 批量插入询问.Designer.cs,可用 SD 设计器打开微调。
/// </summary>
public partial class 批量插入询问
{
/// <summary>构造函数:必须调用 InitializeComponent 初始化设计器控件
/// ★ 修复(2026-10-01):此前漏写构造函数,控件全为 null,设置消息时抛
/// NullReferenceException——这就是"点了新建元件没反应不弹窗"的根因。</summary>
public 批量插入询问()
{
InitializeComponent();
}
/// <summary>消息文本(设置后按内容自适应标签与窗体高度)。</summary>
public string 消息
{
get { return lbl消息.Text; }
set
{
lbl消息.Text = value ?? "";
自适应高度();
}
}
/// <summary>"以后不再询问"复选框勾选状态。</summary>
public bool 不再询问
{
get { return chk不再询问.Checked; }
}
/// <summary>
/// 按消息文本实际高度自适应:标签变高/变矮时,复选框与按钮行跟着移动,
/// 窗体高度同步调整(设计器基准布局,运行时只纵向平移,不动横向布局)。
/// </summary>
private void 自适应高度()
{
try
{
lbl消息.AutoSize = false;
int textH = TextRenderer.MeasureText(lbl消息.Text, lbl消息.Font,
new Size(lbl消息.MaximumSize.Width, 0),
TextFormatFlags.WordBreak | TextFormatFlags.TextBoxControl).Height;
int delta = textH - lbl消息.Height;
if (delta == 0) return;
lbl消息.Height = textH;
chk不再询问.Top += delta;
btn取消.Top += delta;
btn全部插入.Top += delta;
// 解除设计器设的最大/最小尺寸限制后调整窗体高度
this.MaximumSize = new Size(0, 0);
this.MinimumSize = new Size(0, 0);
this.Height += delta;
}
catch { }
}
}
}
@@ -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>
+609
View File
@@ -0,0 +1,609 @@
namespace 成套报价软件
{
public partial class 新建项目 : System.Windows.Forms.Form
{
/// <summary>必需的设计器变量。</summary>
private System.ComponentModel.IContainer components = null;
/// <summary>清理正在使用的资源。</summary>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows 窗体设计器生成的代码
private void InitializeComponent()
{
this.lbl项目编号 = new System.Windows.Forms.Label();
this.txt项目编号 = new System.Windows.Forms.TextBox();
this.lbl项目日期 = new System.Windows.Forms.Label();
this.txt项目日期 = new System.Windows.Forms.TextBox();
this.lbl项目名称 = new System.Windows.Forms.Label();
this.txt项目名称 = new System.Windows.Forms.TextBox();
this.lbl客户名称 = new System.Windows.Forms.Label();
this.txt客户名称 = new System.Windows.Forms.TextBox();
this.btn选择客户 = new System.Windows.Forms.Button();
this.lbl客户地址 = new System.Windows.Forms.Label();
this.txt客户地址 = new System.Windows.Forms.TextBox();
this.lbl联系人 = new System.Windows.Forms.Label();
this.txt联系人 = new System.Windows.Forms.TextBox();
this.lbl联系电话 = new System.Windows.Forms.Label();
this.txt联系电话 = new System.Windows.Forms.TextBox();
this.lbl成套厂名称 = new System.Windows.Forms.Label();
this.txt成套厂名称 = new System.Windows.Forms.TextBox();
this.lbl成套厂地址 = new System.Windows.Forms.Label();
this.txt成套厂地址 = new System.Windows.Forms.TextBox();
this.lbl成套厂联系人 = new System.Windows.Forms.Label();
this.txt成套厂联系人 = new System.Windows.Forms.TextBox();
this.lbl成套厂联系电话 = new System.Windows.Forms.Label();
this.txt成套厂联系电话 = new System.Windows.Forms.TextBox();
this.lbl报出方式 = new System.Windows.Forms.Label();
this.cmb报出方式 = new System.Windows.Forms.ComboBox();
this.lbl箱柜模板 = new System.Windows.Forms.Label();
this.cmb箱柜模板 = new System.Windows.Forms.ComboBox();
this.lbl单台价格 = new System.Windows.Forms.Label();
this.cmb单台价格 = new System.Windows.Forms.ComboBox();
this.lbl项目总价 = new System.Windows.Forms.Label();
this.lbl备注 = new System.Windows.Forms.Label();
this.txt备注 = new System.Windows.Forms.TextBox();
this.btn确定 = new System.Windows.Forms.Button();
this.btn取消 = new System.Windows.Forms.Button();
this.comboBox1 = new System.Windows.Forms.ComboBox();
this.label1 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.comboBox2 = new System.Windows.Forms.ComboBox();
this.cmb项目总价 = new System.Windows.Forms.ComboBox();
this.SuspendLayout();
//
// lbl项目编号
//
this.lbl项目编号.BackColor = System.Drawing.Color.White;
this.lbl项目编号.Font = new System.Drawing.Font("宋体", 9F);
this.lbl项目编号.ForeColor = System.Drawing.SystemColors.ControlText;
this.lbl项目编号.Location = new System.Drawing.Point(20, 25);
this.lbl项目编号.Name = "lbl项目编号";
this.lbl项目编号.Size = new System.Drawing.Size(70, 23);
this.lbl项目编号.TabIndex = 0;
this.lbl项目编号.Text = "项目编号:";
this.lbl项目编号.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// txt项目编号
//
this.txt项目编号.BackColor = System.Drawing.SystemColors.Window;
this.txt项目编号.Font = new System.Drawing.Font("宋体", 9F);
this.txt项目编号.ForeColor = System.Drawing.SystemColors.WindowText;
this.txt项目编号.Location = new System.Drawing.Point(95, 25);
this.txt项目编号.Name = "txt项目编号";
this.txt项目编号.Size = new System.Drawing.Size(220, 21);
this.txt项目编号.TabIndex = 0;
//
// lbl项目日期
//
this.lbl项目日期.BackColor = System.Drawing.Color.White;
this.lbl项目日期.Font = new System.Drawing.Font("宋体", 9F);
this.lbl项目日期.ForeColor = System.Drawing.SystemColors.ControlText;
this.lbl项目日期.Location = new System.Drawing.Point(380, 28);
this.lbl项目日期.Name = "lbl项目日期";
this.lbl项目日期.Size = new System.Drawing.Size(70, 18);
this.lbl项目日期.TabIndex = 1;
this.lbl项目日期.Text = "项目日期:";
//
// txt项目日期
//
this.txt项目日期.BackColor = System.Drawing.SystemColors.Window;
this.txt项目日期.Font = new System.Drawing.Font("宋体", 9F);
this.txt项目日期.ForeColor = System.Drawing.SystemColors.WindowText;
this.txt项目日期.Location = new System.Drawing.Point(455, 25);
this.txt项目日期.Name = "txt项目日期";
this.txt项目日期.Size = new System.Drawing.Size(210, 21);
this.txt项目日期.TabIndex = 1;
//
// lbl项目名称
//
this.lbl项目名称.BackColor = System.Drawing.Color.White;
this.lbl项目名称.Font = new System.Drawing.Font("宋体", 9F);
this.lbl项目名称.ForeColor = System.Drawing.SystemColors.ControlText;
this.lbl项目名称.Location = new System.Drawing.Point(20, 55);
this.lbl项目名称.Name = "lbl项目名称";
this.lbl项目名称.Size = new System.Drawing.Size(70, 23);
this.lbl项目名称.TabIndex = 2;
this.lbl项目名称.Text = "项目名称:";
this.lbl项目名称.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// txt项目名称
//
this.txt项目名称.BackColor = System.Drawing.SystemColors.Window;
this.txt项目名称.Font = new System.Drawing.Font("宋体", 9F);
this.txt项目名称.ForeColor = System.Drawing.SystemColors.WindowText;
this.txt项目名称.Location = new System.Drawing.Point(95, 55);
this.txt项目名称.Name = "txt项目名称";
this.txt项目名称.Size = new System.Drawing.Size(570, 21);
this.txt项目名称.TabIndex = 2;
//
// lbl客户名称
//
this.lbl客户名称.BackColor = System.Drawing.Color.White;
this.lbl客户名称.Font = new System.Drawing.Font("宋体", 9F);
this.lbl客户名称.ForeColor = System.Drawing.SystemColors.ControlText;
this.lbl客户名称.Location = new System.Drawing.Point(20, 85);
this.lbl客户名称.Name = "lbl客户名称";
this.lbl客户名称.Size = new System.Drawing.Size(70, 23);
this.lbl客户名称.TabIndex = 3;
this.lbl客户名称.Text = "客户名称:";
this.lbl客户名称.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// txt客户名称
//
this.txt客户名称.BackColor = System.Drawing.SystemColors.Window;
this.txt客户名称.Font = new System.Drawing.Font("宋体", 9F);
this.txt客户名称.ForeColor = System.Drawing.SystemColors.WindowText;
this.txt客户名称.Location = new System.Drawing.Point(95, 85);
this.txt客户名称.Name = "txt客户名称";
this.txt客户名称.Size = new System.Drawing.Size(479, 21);
this.txt客户名称.TabIndex = 3;
//
// btn选择客户
//
this.btn选择客户.BackColor = System.Drawing.SystemColors.Control;
this.btn选择客户.Font = new System.Drawing.Font("宋体", 9F);
this.btn选择客户.ForeColor = System.Drawing.SystemColors.ControlText;
this.btn选择客户.Location = new System.Drawing.Point(580, 85);
this.btn选择客户.Name = "btn选择客户";
this.btn选择客户.Size = new System.Drawing.Size(85, 23);
this.btn选择客户.TabIndex = 4;
this.btn选择客户.Text = "选择客户";
this.btn选择客户.UseVisualStyleBackColor = true;
//
// lbl客户地址
//
this.lbl客户地址.BackColor = System.Drawing.Color.White;
this.lbl客户地址.Font = new System.Drawing.Font("宋体", 9F);
this.lbl客户地址.ForeColor = System.Drawing.SystemColors.ControlText;
this.lbl客户地址.Location = new System.Drawing.Point(20, 115);
this.lbl客户地址.Name = "lbl客户地址";
this.lbl客户地址.Size = new System.Drawing.Size(70, 23);
this.lbl客户地址.TabIndex = 5;
this.lbl客户地址.Text = "客户地址:";
this.lbl客户地址.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// txt客户地址
//
this.txt客户地址.BackColor = System.Drawing.SystemColors.Window;
this.txt客户地址.Font = new System.Drawing.Font("宋体", 9F);
this.txt客户地址.ForeColor = System.Drawing.SystemColors.WindowText;
this.txt客户地址.Location = new System.Drawing.Point(95, 115);
this.txt客户地址.Name = "txt客户地址";
this.txt客户地址.Size = new System.Drawing.Size(570, 21);
this.txt客户地址.TabIndex = 5;
//
// lbl联系人
//
this.lbl联系人.BackColor = System.Drawing.Color.White;
this.lbl联系人.Font = new System.Drawing.Font("宋体", 9F);
this.lbl联系人.ForeColor = System.Drawing.SystemColors.ControlText;
this.lbl联系人.Location = new System.Drawing.Point(30, 145);
this.lbl联系人.Name = "lbl联系人";
this.lbl联系人.Size = new System.Drawing.Size(60, 23);
this.lbl联系人.TabIndex = 6;
this.lbl联系人.Text = "联系人:";
this.lbl联系人.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// txt联系人
//
this.txt联系人.BackColor = System.Drawing.SystemColors.Window;
this.txt联系人.Font = new System.Drawing.Font("宋体", 9F);
this.txt联系人.ForeColor = System.Drawing.SystemColors.WindowText;
this.txt联系人.Location = new System.Drawing.Point(95, 145);
this.txt联系人.Name = "txt联系人";
this.txt联系人.Size = new System.Drawing.Size(220, 21);
this.txt联系人.TabIndex = 6;
//
// lbl联系电话
//
this.lbl联系电话.BackColor = System.Drawing.Color.White;
this.lbl联系电话.Font = new System.Drawing.Font("宋体", 9F);
this.lbl联系电话.ForeColor = System.Drawing.SystemColors.ControlText;
this.lbl联系电话.Location = new System.Drawing.Point(380, 145);
this.lbl联系电话.Name = "lbl联系电话";
this.lbl联系电话.Size = new System.Drawing.Size(70, 21);
this.lbl联系电话.TabIndex = 7;
this.lbl联系电话.Text = "联系电话:";
//
// txt联系电话
//
this.txt联系电话.BackColor = System.Drawing.SystemColors.Window;
this.txt联系电话.Font = new System.Drawing.Font("宋体", 9F);
this.txt联系电话.ForeColor = System.Drawing.SystemColors.WindowText;
this.txt联系电话.Location = new System.Drawing.Point(455, 145);
this.txt联系电话.Name = "txt联系电话";
this.txt联系电话.Size = new System.Drawing.Size(210, 21);
this.txt联系电话.TabIndex = 7;
//
// lbl成套厂名称
//
this.lbl成套厂名称.BackColor = System.Drawing.Color.White;
this.lbl成套厂名称.Font = new System.Drawing.Font("宋体", 9F);
this.lbl成套厂名称.ForeColor = System.Drawing.SystemColors.ControlText;
this.lbl成套厂名称.Location = new System.Drawing.Point(10, 175);
this.lbl成套厂名称.Name = "lbl成套厂名称";
this.lbl成套厂名称.Size = new System.Drawing.Size(80, 23);
this.lbl成套厂名称.TabIndex = 8;
this.lbl成套厂名称.Text = "成套厂名称:";
this.lbl成套厂名称.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// txt成套厂名称
//
this.txt成套厂名称.BackColor = System.Drawing.SystemColors.Window;
this.txt成套厂名称.Font = new System.Drawing.Font("宋体", 9F);
this.txt成套厂名称.ForeColor = System.Drawing.SystemColors.WindowText;
this.txt成套厂名称.Location = new System.Drawing.Point(95, 175);
this.txt成套厂名称.Name = "txt成套厂名称";
this.txt成套厂名称.Size = new System.Drawing.Size(570, 21);
this.txt成套厂名称.TabIndex = 8;
//
// lbl成套厂地址
//
this.lbl成套厂地址.BackColor = System.Drawing.Color.White;
this.lbl成套厂地址.Font = new System.Drawing.Font("宋体", 9F);
this.lbl成套厂地址.ForeColor = System.Drawing.SystemColors.ControlText;
this.lbl成套厂地址.Location = new System.Drawing.Point(10, 205);
this.lbl成套厂地址.Name = "lbl成套厂地址";
this.lbl成套厂地址.Size = new System.Drawing.Size(80, 23);
this.lbl成套厂地址.TabIndex = 9;
this.lbl成套厂地址.Text = "成套厂地址:";
this.lbl成套厂地址.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// txt成套厂地址
//
this.txt成套厂地址.BackColor = System.Drawing.SystemColors.Window;
this.txt成套厂地址.Font = new System.Drawing.Font("宋体", 9F);
this.txt成套厂地址.ForeColor = System.Drawing.SystemColors.WindowText;
this.txt成套厂地址.Location = new System.Drawing.Point(95, 205);
this.txt成套厂地址.Name = "txt成套厂地址";
this.txt成套厂地址.Size = new System.Drawing.Size(570, 21);
this.txt成套厂地址.TabIndex = 9;
//
// lbl成套厂联系人
//
this.lbl成套厂联系人.BackColor = System.Drawing.Color.White;
this.lbl成套厂联系人.Font = new System.Drawing.Font("宋体", 9F);
this.lbl成套厂联系人.ForeColor = System.Drawing.SystemColors.ControlText;
this.lbl成套厂联系人.Location = new System.Drawing.Point(30, 235);
this.lbl成套厂联系人.Name = "lbl成套厂联系人";
this.lbl成套厂联系人.Size = new System.Drawing.Size(60, 23);
this.lbl成套厂联系人.TabIndex = 10;
this.lbl成套厂联系人.Text = "联系人:";
this.lbl成套厂联系人.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// txt成套厂联系人
//
this.txt成套厂联系人.BackColor = System.Drawing.SystemColors.Window;
this.txt成套厂联系人.Font = new System.Drawing.Font("宋体", 9F);
this.txt成套厂联系人.ForeColor = System.Drawing.SystemColors.WindowText;
this.txt成套厂联系人.Location = new System.Drawing.Point(95, 235);
this.txt成套厂联系人.Name = "txt成套厂联系人";
this.txt成套厂联系人.Size = new System.Drawing.Size(220, 21);
this.txt成套厂联系人.TabIndex = 10;
//
// lbl成套厂联系电话
//
this.lbl成套厂联系电话.BackColor = System.Drawing.Color.White;
this.lbl成套厂联系电话.Font = new System.Drawing.Font("宋体", 9F);
this.lbl成套厂联系电话.ForeColor = System.Drawing.SystemColors.ControlText;
this.lbl成套厂联系电话.Location = new System.Drawing.Point(380, 235);
this.lbl成套厂联系电话.Name = "lbl成套厂联系电话";
this.lbl成套厂联系电话.Size = new System.Drawing.Size(70, 21);
this.lbl成套厂联系电话.TabIndex = 11;
this.lbl成套厂联系电话.Text = "联系电话:";
//
// txt成套厂联系电话
//
this.txt成套厂联系电话.BackColor = System.Drawing.SystemColors.Window;
this.txt成套厂联系电话.Font = new System.Drawing.Font("宋体", 9F);
this.txt成套厂联系电话.ForeColor = System.Drawing.SystemColors.WindowText;
this.txt成套厂联系电话.Location = new System.Drawing.Point(455, 232);
this.txt成套厂联系电话.Name = "txt成套厂联系电话";
this.txt成套厂联系电话.Size = new System.Drawing.Size(210, 21);
this.txt成套厂联系电话.TabIndex = 11;
//
// lbl报出方式
//
this.lbl报出方式.BackColor = System.Drawing.Color.White;
this.lbl报出方式.Font = new System.Drawing.Font("宋体", 9F);
this.lbl报出方式.ForeColor = System.Drawing.SystemColors.ControlText;
this.lbl报出方式.Location = new System.Drawing.Point(20, 265);
this.lbl报出方式.Name = "lbl报出方式";
this.lbl报出方式.Size = new System.Drawing.Size(70, 23);
this.lbl报出方式.TabIndex = 12;
this.lbl报出方式.Text = "报出方式:";
this.lbl报出方式.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// cmb报出方式
//
this.cmb报出方式.BackColor = System.Drawing.SystemColors.Window;
this.cmb报出方式.DropDownWidth = 200;
this.cmb报出方式.Font = new System.Drawing.Font("宋体", 9F);
this.cmb报出方式.ForeColor = System.Drawing.SystemColors.WindowText;
this.cmb报出方式.ItemHeight = 12;
this.cmb报出方式.Location = new System.Drawing.Point(95, 265);
this.cmb报出方式.Name = "cmb报出方式";
this.cmb报出方式.Size = new System.Drawing.Size(220, 20);
this.cmb报出方式.TabIndex = 12;
this.cmb报出方式.Text = "报出价=表价*采购系数*报出系数";
//
// lbl箱柜模板
//
this.lbl箱柜模板.BackColor = System.Drawing.Color.White;
this.lbl箱柜模板.Font = new System.Drawing.Font("宋体", 9F);
this.lbl箱柜模板.ForeColor = System.Drawing.SystemColors.ControlText;
this.lbl箱柜模板.Location = new System.Drawing.Point(380, 265);
this.lbl箱柜模板.Name = "lbl箱柜模板";
this.lbl箱柜模板.Size = new System.Drawing.Size(70, 20);
this.lbl箱柜模板.TabIndex = 13;
this.lbl箱柜模板.Text = "箱柜模板:";
//
// cmb箱柜模板
//
this.cmb箱柜模板.BackColor = System.Drawing.SystemColors.Window;
this.cmb箱柜模板.DropDownWidth = 200;
this.cmb箱柜模板.Font = new System.Drawing.Font("宋体", 9F);
this.cmb箱柜模板.ForeColor = System.Drawing.SystemColors.WindowText;
this.cmb箱柜模板.ItemHeight = 12;
this.cmb箱柜模板.Location = new System.Drawing.Point(455, 262);
this.cmb箱柜模板.Name = "cmb箱柜模板";
this.cmb箱柜模板.Size = new System.Drawing.Size(210, 20);
this.cmb箱柜模板.TabIndex = 13;
//
// lbl单台价格
//
this.lbl单台价格.BackColor = System.Drawing.Color.White;
this.lbl单台价格.Font = new System.Drawing.Font("宋体", 9F);
this.lbl单台价格.ForeColor = System.Drawing.SystemColors.ControlText;
this.lbl单台价格.Location = new System.Drawing.Point(20, 293);
this.lbl单台价格.Name = "lbl单台价格";
this.lbl单台价格.Size = new System.Drawing.Size(70, 23);
this.lbl单台价格.TabIndex = 14;
this.lbl单台价格.Text = "单台价格:";
this.lbl单台价格.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// cmb单台价格
//
this.cmb单台价格.BackColor = System.Drawing.SystemColors.Window;
this.cmb单台价格.DropDownWidth = 200;
this.cmb单台价格.Font = new System.Drawing.Font("宋体", 9F);
this.cmb单台价格.ForeColor = System.Drawing.SystemColors.WindowText;
this.cmb单台价格.ItemHeight = 12;
this.cmb单台价格.Location = new System.Drawing.Point(95, 293);
this.cmb单台价格.Name = "cmb单台价格";
this.cmb单台价格.Size = new System.Drawing.Size(220, 20);
this.cmb单台价格.TabIndex = 14;
this.cmb单台价格.Text = "保留整数";
//
// lbl项目总价
//
this.lbl项目总价.BackColor = System.Drawing.Color.White;
this.lbl项目总价.Font = new System.Drawing.Font("宋体", 9F);
this.lbl项目总价.ForeColor = System.Drawing.SystemColors.ControlText;
this.lbl项目总价.Location = new System.Drawing.Point(379, 293);
this.lbl项目总价.Name = "lbl项目总价";
this.lbl项目总价.Size = new System.Drawing.Size(70, 20);
this.lbl项目总价.TabIndex = 15;
this.lbl项目总价.Text = "项目总价:";
//
// lbl备注
//
this.lbl备注.BackColor = System.Drawing.Color.White;
this.lbl备注.Font = new System.Drawing.Font("宋体", 9F);
this.lbl备注.ForeColor = System.Drawing.SystemColors.ControlText;
this.lbl备注.Location = new System.Drawing.Point(44, 352);
this.lbl备注.Name = "lbl备注";
this.lbl备注.Size = new System.Drawing.Size(46, 23);
this.lbl备注.TabIndex = 16;
this.lbl备注.Text = "备注:";
this.lbl备注.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// txt备注
//
this.txt备注.BackColor = System.Drawing.SystemColors.Window;
this.txt备注.Font = new System.Drawing.Font("宋体", 9F);
this.txt备注.ForeColor = System.Drawing.SystemColors.WindowText;
this.txt备注.Location = new System.Drawing.Point(95, 352);
this.txt备注.Multiline = true;
this.txt备注.Name = "txt备注";
this.txt备注.Size = new System.Drawing.Size(570, 80);
this.txt备注.TabIndex = 16;
//
// btn确定
//
this.btn确定.BackColor = System.Drawing.SystemColors.Control;
this.btn确定.DialogResult = System.Windows.Forms.DialogResult.OK;
this.btn确定.Font = new System.Drawing.Font("宋体", 9F);
this.btn确定.ForeColor = System.Drawing.SystemColors.ControlText;
this.btn确定.Location = new System.Drawing.Point(455, 449);
this.btn确定.Name = "btn确定";
this.btn确定.Size = new System.Drawing.Size(100, 28);
this.btn确定.TabIndex = 17;
this.btn确定.Text = "确定";
this.btn确定.UseVisualStyleBackColor = true;
//
// btn取消
//
this.btn取消.BackColor = System.Drawing.SystemColors.Control;
this.btn取消.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.btn取消.Font = new System.Drawing.Font("宋体", 9F);
this.btn取消.ForeColor = System.Drawing.SystemColors.ControlText;
this.btn取消.Location = new System.Drawing.Point(565, 449);
this.btn取消.Name = "btn取消";
this.btn取消.Size = new System.Drawing.Size(100, 28);
this.btn取消.TabIndex = 18;
this.btn取消.Text = "取消";
this.btn取消.UseVisualStyleBackColor = true;
//
// comboBox1
//
this.comboBox1.BackColor = System.Drawing.SystemColors.Window;
this.comboBox1.DropDownWidth = 210;
this.comboBox1.Font = new System.Drawing.Font("宋体", 9F);
this.comboBox1.ForeColor = System.Drawing.SystemColors.WindowText;
this.comboBox1.ItemHeight = 12;
this.comboBox1.Location = new System.Drawing.Point(455, 322);
this.comboBox1.Name = "comboBox1";
this.comboBox1.Size = new System.Drawing.Size(210, 20);
this.comboBox1.TabIndex = 14;
this.comboBox1.Text = "四舍五入";
//
// label1
//
this.label1.BackColor = System.Drawing.Color.White;
this.label1.Font = new System.Drawing.Font("宋体", 9F);
this.label1.ForeColor = System.Drawing.SystemColors.ControlText;
this.label1.Location = new System.Drawing.Point(19, 320);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(70, 23);
this.label1.TabIndex = 14;
this.label1.Text = "单台取整:";
this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// label2
//
this.label2.BackColor = System.Drawing.Color.White;
this.label2.Font = new System.Drawing.Font("宋体", 9F);
this.label2.ForeColor = System.Drawing.SystemColors.ControlText;
this.label2.Location = new System.Drawing.Point(379, 324);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(70, 20);
this.label2.TabIndex = 15;
this.label2.Text = "项目取整:";
//
// comboBox2
//
this.comboBox2.BackColor = System.Drawing.SystemColors.Window;
this.comboBox2.DropDownWidth = 220;
this.comboBox2.Font = new System.Drawing.Font("宋体", 9F);
this.comboBox2.ForeColor = System.Drawing.SystemColors.WindowText;
this.comboBox2.ItemHeight = 12;
this.comboBox2.Location = new System.Drawing.Point(95, 324);
this.comboBox2.Name = "comboBox2";
this.comboBox2.Size = new System.Drawing.Size(220, 20);
this.comboBox2.TabIndex = 14;
this.comboBox2.Text = "四舍五入";
//
// cmb项目总价
//
this.cmb项目总价.BackColor = System.Drawing.SystemColors.Window;
this.cmb项目总价.DropDownWidth = 200;
this.cmb项目总价.Font = new System.Drawing.Font("宋体", 9F);
this.cmb项目总价.ForeColor = System.Drawing.SystemColors.WindowText;
this.cmb项目总价.ItemHeight = 12;
this.cmb项目总价.Location = new System.Drawing.Point(455, 290);
this.cmb项目总价.Name = "cmb项目总价";
this.cmb项目总价.Size = new System.Drawing.Size(210, 20);
this.cmb项目总价.TabIndex = 14;
this.cmb项目总价.Text = "保留整数";
//
// 新建项目
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
this.AutoValidate = System.Windows.Forms.AutoValidate.EnablePreventFocusChange;
this.BackColor = System.Drawing.Color.White;
this.ClientSize = new System.Drawing.Size(684, 499);
this.Controls.Add(this.lbl项目编号);
this.Controls.Add(this.txt项目编号);
this.Controls.Add(this.lbl项目日期);
this.Controls.Add(this.txt项目日期);
this.Controls.Add(this.lbl项目名称);
this.Controls.Add(this.txt项目名称);
this.Controls.Add(this.lbl客户名称);
this.Controls.Add(this.txt客户名称);
this.Controls.Add(this.btn选择客户);
this.Controls.Add(this.lbl客户地址);
this.Controls.Add(this.txt客户地址);
this.Controls.Add(this.lbl联系人);
this.Controls.Add(this.txt联系人);
this.Controls.Add(this.lbl联系电话);
this.Controls.Add(this.txt联系电话);
this.Controls.Add(this.lbl成套厂名称);
this.Controls.Add(this.txt成套厂名称);
this.Controls.Add(this.lbl成套厂地址);
this.Controls.Add(this.txt成套厂地址);
this.Controls.Add(this.lbl成套厂联系人);
this.Controls.Add(this.txt成套厂联系人);
this.Controls.Add(this.lbl成套厂联系电话);
this.Controls.Add(this.txt成套厂联系电话);
this.Controls.Add(this.lbl报出方式);
this.Controls.Add(this.cmb报出方式);
this.Controls.Add(this.lbl箱柜模板);
this.Controls.Add(this.cmb箱柜模板);
this.Controls.Add(this.lbl单台价格);
this.Controls.Add(this.cmb单台价格);
this.Controls.Add(this.lbl项目总价);
this.Controls.Add(this.lbl备注);
this.Controls.Add(this.txt备注);
this.Controls.Add(this.btn确定);
this.Controls.Add(this.btn取消);
this.Controls.Add(this.comboBox1);
this.Controls.Add(this.label1);
this.Controls.Add(this.label2);
this.Controls.Add(this.comboBox2);
this.Controls.Add(this.cmb项目总价);
this.Font = new System.Drawing.Font("宋体", 9F);
this.ForeColor = System.Drawing.SystemColors.ControlText;
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "新建项目";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "新建项目";
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Label lbl项目编号;
private System.Windows.Forms.TextBox txt项目编号;
private System.Windows.Forms.Label lbl项目日期;
private System.Windows.Forms.TextBox txt项目日期;
private System.Windows.Forms.Label lbl项目名称;
private System.Windows.Forms.TextBox txt项目名称;
private System.Windows.Forms.Label lbl客户名称;
private System.Windows.Forms.TextBox txt客户名称;
private System.Windows.Forms.Button btn选择客户;
private System.Windows.Forms.Label lbl客户地址;
private System.Windows.Forms.TextBox txt客户地址;
private System.Windows.Forms.Label lbl联系人;
private System.Windows.Forms.TextBox txt联系人;
private System.Windows.Forms.Label lbl联系电话;
private System.Windows.Forms.TextBox txt联系电话;
private System.Windows.Forms.Label lbl成套厂名称;
private System.Windows.Forms.TextBox txt成套厂名称;
private System.Windows.Forms.Label lbl成套厂地址;
private System.Windows.Forms.TextBox txt成套厂地址;
private System.Windows.Forms.Label lbl成套厂联系人;
private System.Windows.Forms.TextBox txt成套厂联系人;
private System.Windows.Forms.Label lbl成套厂联系电话;
private System.Windows.Forms.TextBox txt成套厂联系电话;
private System.Windows.Forms.Label lbl报出方式;
private System.Windows.Forms.ComboBox cmb报出方式;
private System.Windows.Forms.Label lbl箱柜模板;
private System.Windows.Forms.ComboBox cmb箱柜模板;
private System.Windows.Forms.Label lbl单台价格;
private System.Windows.Forms.ComboBox cmb单台价格;
private System.Windows.Forms.Label lbl项目总价;
private System.Windows.Forms.Label lbl备注;
private System.Windows.Forms.TextBox txt备注;
private System.Windows.Forms.Button btn确定;
private System.Windows.Forms.Button btn取消;
private System.Windows.Forms.ComboBox comboBox1;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.ComboBox comboBox2;
private System.Windows.Forms.ComboBox cmb项目总价;
}
}
+232
View File
@@ -0,0 +1,232 @@
using System;
using System.Collections.Generic;
using System.Windows.Forms;
namespace 成套报价软件
{
/// <summary>
/// 新建项目 的交互逻辑(事件处理)。
/// UI 布局定义见 新建项目.ui.cs。
/// 本窗体作为 MainForm 的对话框使用,故不含独立的 Main 入口点。
/// </summary>
public partial class 新建项目 : Form
{
/// <summary>项目数据库文件相对路径(与 MainForm 保持一致)。</summary>
private readonly string _dbPath;
/// <summary>项目数据库表名。</summary>
private readonly string _tableName;
/// <summary>构造函数:初始化 UI 并绑定事件。</summary>
public 新建项目()
: this(null, null)
{
// 无参构造保留,以便独立测试时仍可创建。
}
/// <summary>
/// 带数据库路径的构造函数(主窗口调用此版本)。
/// 传入数据库后,对话框会在打开时自动填入“项目日期”和“项目编号”。
/// </summary>
/// <param name="dbPath">SQLite 数据库绝对路径;为 null/不存在则不自动生成编号。</param>
/// <param name="tableName">项目数据表名。</param>
public 新建项目(string dbPath, string tableName)
{
InitializeComponent();
_dbPath = dbPath;
_tableName = tableName;
// 预置价格格式化下拉框选项(小数位 + 取整方式)
InitPriceFormatCombos();
// 加载完成后(已显示)自动填充编号和日期。
// 用 Load 事件确保控件都已创建好。
this.Load += 新建项目_Load;
}
/// <summary>
/// 预置“单台价格/项目总价/单台取整/项目取整”4 个下拉框的“候选选项列表”。
/// 注意:只填充 Items,不改动 SelectedIndex/Text —— 默认选中项由设计器 XML 里的
/// Text 属性决定,不要在代码里覆盖。
///
/// 控件布局对应(UI 里 label 文字决定语义):
/// 单台价格行 → cmb单台价格(单台层小数位)
/// 项目总价行 → cmb项目总价(项目层小数位)
/// 单台取整行 → comboBox1 (单台层取整方式)
/// 项目取整行 → comboBox2 (项目层取整方式)
/// </summary>
private void InitPriceFormatCombos()
{
// 小数位选项:cmb单台价格(单台层) + cmb项目总价(项目层)
this.cmb单台价格.Items.Clear();
this.cmb单台价格.Items.AddRange(价格格式化.小数位选项);
this.cmb项目总价.Items.Clear();
this.cmb项目总价.Items.AddRange(价格格式化.小数位选项);
// 取整方式选项:comboBox1(单台层) + comboBox2(项目层)
this.comboBox1.Items.Clear();
this.comboBox1.Items.AddRange(价格格式化.取整方式选项);
this.comboBox2.Items.Clear();
this.comboBox2.Items.AddRange(价格格式化.取整方式选项);
}
/// <summary>对话框首次加载:自动填项目日期 + 项目编号。</summary>
private void 新建项目_Load(object sender, EventArgs e)
{
FillAutoFields();
}
/// <summary>
/// 自动填充“项目日期”为当天,并按 yyyyMMdd+3位序号
/// 规则生成“项目编号”(序号=数据库当天最大序号+1)。
/// 同时把 txt项目编号 设为只读,用户不能修改。
/// </summary>
private void FillAutoFields()
{
// 1) 项目日期 = 当天 yyyy-MM-dd
DateTime today = DateTime.Today;
this.txt项目日期.Text = today.ToString("yyyy-MM-dd");
// 2) 项目编号 = yyyyMMdd + 3 位序号(001 起,查库取当天最大序号 +1)
string datePart = today.ToString("yyyyMMdd");
int seq = GetNextSeqForDate(datePart); // 找不到就返回 1
this.txt项目编号.Text = datePart + seq.ToString("000");
// 3) 项目编号只读,用户不能改
this.txt项目编号.ReadOnly = true;
this.txt项目编号.TabStop = false;
// 给只读框一个浅灰背景,视觉上提示“不可编辑”
this.txt项目编号.BackColor = System.Drawing.SystemColors.Control;
// 4) 成套厂信息(名称/地址/联系人/联系电话)从「企业信息」配置自动带入,
// 用户可在对话框中临时改写;改写后的值随项目一起保存到项目库。
// 若企业信息未配置,则留空由用户手填。
try
{
var qiye = 企业信息.LoadSettings();
if (qiye != null)
{
// 仅在文本框为空时填入,避免覆盖已有内容(理论上 Load 阶段都是空)
if (string.IsNullOrEmpty(this.txt成套厂名称.Text))
this.txt成套厂名称.Text = qiye["企业名称"];
if (string.IsNullOrEmpty(this.txt成套厂地址.Text))
this.txt成套厂地址.Text = qiye["地址"];
if (string.IsNullOrEmpty(this.txt成套厂联系人.Text))
this.txt成套厂联系人.Text = qiye["联系人"];
if (string.IsNullOrEmpty(this.txt成套厂联系电话.Text))
this.txt成套厂联系电话.Text = qiye["电话"];
}
}
catch
{
// 读不到企业信息不阻断新建项目流程
}
}
/// <summary>
/// 在数据库中查找“指定日期前缀(yyyyMMdd)”的最大序号,
/// 返回“最大序号 + 1”;若无数据或出错则返回 1。
/// 例:库中已有 20260721001、20260721005,返回 6。
/// </summary>
private int GetNextSeqForDate(string datePart)
{
if (string.IsNullOrEmpty(datePart) ||
string.IsNullOrEmpty(_dbPath) ||
string.IsNullOrEmpty(_tableName) ||
!System.IO.File.Exists(_dbPath))
{
return 1;
}
try
{
string connStr = "Data Source=" + _dbPath + ";Version=3;";
using (var conn = new System.Data.SQLite.SQLiteConnection(connStr))
{
conn.Open();
// 取“项目编号”这一列中、前 8 位等于 datePart 的最大值。
// SUBSTR 兼容 SQLite,从 1 开始计数,截取前 8 位。
string sql =
"SELECT MAX(CAST(SUBSTR(项目编号, 9) AS INTEGER)) " +
"FROM " + _tableName + " " +
"WHERE SUBSTR(项目编号, 1, 8) = '" + datePart + "';";
using (var cmd = new System.Data.SQLite.SQLiteCommand(sql, conn))
{
object result = cmd.ExecuteScalar();
if (result == null || result == DBNull.Value)
{
return 1;
}
int maxSeq;
// ExecuteScalar 返回的可能是 long/int
if (int.TryParse(result.ToString(), out maxSeq))
{
return maxSeq + 1;
}
return 1;
}
}
}
catch
{
// 查询失败时不阻断流程,退化为从 001 开始
return 1;
}
}
/// <summary>
/// 收集对话框中已填写的字段,以“去掉 txt 前缀的字段名”为键返回。
/// 仅包含实际存在文本框且文本非空的字段。
/// 调用方只需按列名(Name/DataPropertyName)匹配,匹配不上的字段自动忽略。
/// </summary>
public Dictionary<string, string> GetInputValues()
{
var values = new Dictionary<string, string>();
// (字段名, 对应文本框)。字段名与MainForm advancedDataGridView6 列名一致。
AddIfNotEmpty(values, "项目编号", txt项目编号.Text);
AddIfNotEmpty(values, "项目日期", txt项目日期.Text);
AddIfNotEmpty(values, "项目名称", txt项目名称.Text);
AddIfNotEmpty(values, "客户名称", txt客户名称.Text);
AddIfNotEmpty(values, "客户地址", txt客户地址.Text);
AddIfNotEmpty(values, "联系人", txt联系人.Text);
AddIfNotEmpty(values, "联系电话", txt联系电话.Text);
AddIfNotEmpty(values, "备注", txt备注.Text);
// 成套厂信息(4 个字段):新建项目时从企业信息带入,用户可改写;
// 写入项目库,供项目窗口后续调用。
AddIfNotEmpty(values, "成套厂名称", txt成套厂名称.Text);
AddIfNotEmpty(values, "成套厂地址", txt成套厂地址.Text);
AddIfNotEmpty(values, "成套厂联系人", txt成套厂联系人.Text);
AddIfNotEmpty(values, "成套厂联系电话", txt成套厂联系电话.Text);
// 价格显示格式化(4 个字段):控制报价页价格单元格的“小数位 + 取整方式”。
// 仅影响显示,不改变原始计算值;随项目一起保存到「项目信息」表。
// 控件对应:cmb单台价格=单台小数位 / cmb项目总价=项目小数位 /
// comboBox1=单台取整方式 / comboBox2=项目取整方式
values["单台小数位"] = (cmb单台价格.SelectedItem ?? cmb单台价格.Text ?? "").ToString();
values["项目小数位"] = (cmb项目总价.SelectedItem ?? cmb项目总价.Text ?? "").ToString();
values["单台取整方式"] = (comboBox1.SelectedItem ?? comboBox1.Text ?? "").ToString();
values["项目取整方式"] = (comboBox2.SelectedItem ?? comboBox2.Text ?? "").ToString();
return values;
}
private static void AddIfNotEmpty(Dictionary<string, string> dict, string key, string value)
{
if (!string.IsNullOrWhiteSpace(value))
{
dict[key] = value.Trim();
}
}
// 提示:在设计器的属性窗口(事件页)双击事件名,
// 会自动在此生成事件处理方法骨架。
}
}
@@ -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>
+275
View File
@@ -0,0 +1,275 @@
namespace 成套报价软件
{
public partial class 甲方报表 : System.Windows.Forms.Form
{
/// <summary>必需的设计器变量。</summary>
private System.ComponentModel.IContainer components = null;
/// <summary>清理正在使用的资源。</summary>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows 窗体设计器生成的代码
private void InitializeComponent()
{
this.lbl报表类型 = new System.Windows.Forms.Label();
this.cmb报表类型 = new System.Windows.Forms.ComboBox();
this.lbl报表模板 = new System.Windows.Forms.Label();
this.cmb报表模板 = new System.Windows.Forms.ComboBox();
this.btn打开模板 = new System.Windows.Forms.Button();
this.btn导入模板 = new System.Windows.Forms.Button();
this.lbl导出文件 = new System.Windows.Forms.Label();
this.txt导出文件 = new System.Windows.Forms.TextBox();
this.btn选择文件 = new System.Windows.Forms.Button();
this.chk表格带Excel公式 = new System.Windows.Forms.CheckBox();
this.chk箱柜链接 = new System.Windows.Forms.CheckBox();
this.chk显示费用项目公式 = new System.Windows.Forms.CheckBox();
this.chk显示图纸规格 = new System.Windows.Forms.CheckBox();
this.btn确定 = new System.Windows.Forms.Button();
this.btn关闭 = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// lbl报表类型
//
this.lbl报表类型.BackColor = System.Drawing.Color.White;
this.lbl报表类型.Font = new System.Drawing.Font("宋体", 9F);
this.lbl报表类型.ForeColor = System.Drawing.SystemColors.ControlText;
this.lbl报表类型.Location = new System.Drawing.Point(20, 20);
this.lbl报表类型.Name = "lbl报表类型";
this.lbl报表类型.Size = new System.Drawing.Size(70, 23);
this.lbl报表类型.TabIndex = 0;
this.lbl报表类型.Text = "报表类型:";
this.lbl报表类型.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// cmb报表类型
//
this.cmb报表类型.BackColor = System.Drawing.SystemColors.Window;
this.cmb报表类型.DropDownWidth = 120;
this.cmb报表类型.Font = new System.Drawing.Font("宋体", 9F);
this.cmb报表类型.ForeColor = System.Drawing.SystemColors.WindowText;
this.cmb报表类型.ItemHeight = 12;
this.cmb报表类型.Location = new System.Drawing.Point(95, 20);
this.cmb报表类型.Name = "cmb报表类型";
this.cmb报表类型.Size = new System.Drawing.Size(160, 20);
this.cmb报表类型.TabIndex = 0;
this.cmb报表类型.Text = "按图号";
//
// lbl报表模板
//
this.lbl报表模板.BackColor = System.Drawing.Color.White;
this.lbl报表模板.Font = new System.Drawing.Font("宋体", 9F);
this.lbl报表模板.ForeColor = System.Drawing.SystemColors.ControlText;
this.lbl报表模板.Location = new System.Drawing.Point(20, 50);
this.lbl报表模板.Name = "lbl报表模板";
this.lbl报表模板.Size = new System.Drawing.Size(70, 23);
this.lbl报表模板.TabIndex = 1;
this.lbl报表模板.Text = "报表模板:";
this.lbl报表模板.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// cmb报表模板
//
this.cmb报表模板.BackColor = System.Drawing.SystemColors.Window;
this.cmb报表模板.DropDownWidth = 200;
this.cmb报表模板.Font = new System.Drawing.Font("宋体", 9F);
this.cmb报表模板.ForeColor = System.Drawing.SystemColors.WindowText;
this.cmb报表模板.ItemHeight = 12;
this.cmb报表模板.Location = new System.Drawing.Point(95, 50);
this.cmb报表模板.Name = "cmb报表模板";
this.cmb报表模板.Size = new System.Drawing.Size(319, 20);
this.cmb报表模板.TabIndex = 1;
//
// btn打开模板
//
this.btn打开模板.BackColor = System.Drawing.SystemColors.Control;
this.btn打开模板.Font = new System.Drawing.Font("宋体", 9F);
this.btn打开模板.ForeColor = System.Drawing.SystemColors.ControlText;
this.btn打开模板.Location = new System.Drawing.Point(420, 48);
this.btn打开模板.Name = "btn打开模板";
this.btn打开模板.Size = new System.Drawing.Size(65, 23);
this.btn打开模板.TabIndex = 2;
this.btn打开模板.Text = "打开模板";
this.btn打开模板.UseVisualStyleBackColor = true;
this.btn打开模板.Click += new System.EventHandler(this.Btn打开模板单击);
//
// btn导入模板
//
this.btn导入模板.BackColor = System.Drawing.SystemColors.Control;
this.btn导入模板.Font = new System.Drawing.Font("宋体", 9F);
this.btn导入模板.ForeColor = System.Drawing.SystemColors.ControlText;
this.btn导入模板.Location = new System.Drawing.Point(485, 48);
this.btn导入模板.Name = "btn导入模板";
this.btn导入模板.Size = new System.Drawing.Size(65, 23);
this.btn导入模板.TabIndex = 3;
this.btn导入模板.Text = "导入模板";
this.btn导入模板.UseVisualStyleBackColor = true;
//
// lbl导出文件
//
this.lbl导出文件.BackColor = System.Drawing.Color.White;
this.lbl导出文件.Font = new System.Drawing.Font("宋体", 9F);
this.lbl导出文件.ForeColor = System.Drawing.SystemColors.ControlText;
this.lbl导出文件.Location = new System.Drawing.Point(20, 80);
this.lbl导出文件.Name = "lbl导出文件";
this.lbl导出文件.Size = new System.Drawing.Size(70, 23);
this.lbl导出文件.TabIndex = 4;
this.lbl导出文件.Text = "导出文件:";
this.lbl导出文件.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// txt导出文件
//
this.txt导出文件.BackColor = System.Drawing.SystemColors.Window;
this.txt导出文件.Font = new System.Drawing.Font("宋体", 9F);
this.txt导出文件.ForeColor = System.Drawing.SystemColors.WindowText;
this.txt导出文件.Location = new System.Drawing.Point(95, 80);
this.txt导出文件.Name = "txt导出文件";
this.txt导出文件.Size = new System.Drawing.Size(320, 21);
this.txt导出文件.TabIndex = 4;
//
// btn选择文件
//
this.btn选择文件.BackColor = System.Drawing.SystemColors.Control;
this.btn选择文件.Font = new System.Drawing.Font("宋体", 9F);
this.btn选择文件.ForeColor = System.Drawing.SystemColors.ControlText;
this.btn选择文件.Location = new System.Drawing.Point(420, 79);
this.btn选择文件.Name = "btn选择文件";
this.btn选择文件.Size = new System.Drawing.Size(130, 23);
this.btn选择文件.TabIndex = 5;
this.btn选择文件.Text = "选择";
this.btn选择文件.UseVisualStyleBackColor = true;
//
// chk表格带Excel公式
//
this.chk表格带Excel公式.BackColor = System.Drawing.Color.White;
this.chk表格带Excel公式.Font = new System.Drawing.Font("宋体", 9F);
this.chk表格带Excel公式.ForeColor = System.Drawing.SystemColors.ControlText;
this.chk表格带Excel公式.Location = new System.Drawing.Point(28, 112);
this.chk表格带Excel公式.Name = "chk表格带Excel公式";
this.chk表格带Excel公式.Size = new System.Drawing.Size(130, 22);
this.chk表格带Excel公式.TabIndex = 6;
this.chk表格带Excel公式.Text = "表格带EXCEL公式";
this.chk表格带Excel公式.UseVisualStyleBackColor = false;
this.chk表格带Excel公式.CheckedChanged += new System.EventHandler(this.Chk表格带Excel公式选中状态更改);
//
// chk箱柜链接
//
this.chk箱柜链接.BackColor = System.Drawing.Color.White;
this.chk箱柜链接.Font = new System.Drawing.Font("宋体", 9F);
this.chk箱柜链接.ForeColor = System.Drawing.SystemColors.ControlText;
this.chk箱柜链接.Location = new System.Drawing.Point(180, 112);
this.chk箱柜链接.Name = "chk箱柜链接";
this.chk箱柜链接.Size = new System.Drawing.Size(100, 22);
this.chk箱柜链接.TabIndex = 7;
this.chk箱柜链接.Text = "箱柜链接";
this.chk箱柜链接.UseVisualStyleBackColor = false;
//
// chk显示费用项目公式
//
this.chk显示费用项目公式.BackColor = System.Drawing.Color.White;
this.chk显示费用项目公式.Font = new System.Drawing.Font("宋体", 9F);
this.chk显示费用项目公式.ForeColor = System.Drawing.SystemColors.ControlText;
this.chk显示费用项目公式.Location = new System.Drawing.Point(340, 112);
this.chk显示费用项目公式.Name = "chk显示费用项目公式";
this.chk显示费用项目公式.Size = new System.Drawing.Size(180, 22);
this.chk显示费用项目公式.TabIndex = 8;
this.chk显示费用项目公式.Text = "显示费用项目公式(未实现)";
this.chk显示费用项目公式.UseVisualStyleBackColor = false;
//
// chk显示图纸规格
//
this.chk显示图纸规格.BackColor = System.Drawing.Color.White;
this.chk显示图纸规格.Font = new System.Drawing.Font("宋体", 9F);
this.chk显示图纸规格.ForeColor = System.Drawing.SystemColors.ControlText;
this.chk显示图纸规格.Location = new System.Drawing.Point(340, 140);
this.chk显示图纸规格.Name = "chk显示图纸规格";
this.chk显示图纸规格.Size = new System.Drawing.Size(146, 22);
this.chk显示图纸规格.TabIndex = 9;
this.chk显示图纸规格.Text = "显示图纸规格(未实现)";
this.chk显示图纸规格.UseVisualStyleBackColor = false;
this.chk显示图纸规格.CheckedChanged += new System.EventHandler(this.Chk显示图纸规格选中状态更改);
//
// btn确定
//
this.btn确定.BackColor = System.Drawing.SystemColors.Control;
this.btn确定.DialogResult = System.Windows.Forms.DialogResult.OK;
this.btn确定.Font = new System.Drawing.Font("宋体", 9F);
this.btn确定.ForeColor = System.Drawing.SystemColors.ControlText;
this.btn确定.Location = new System.Drawing.Point(365, 194);
this.btn确定.Name = "btn确定";
this.btn确定.Size = new System.Drawing.Size(85, 28);
this.btn确定.TabIndex = 12;
this.btn确定.Text = "确定";
this.btn确定.UseVisualStyleBackColor = true;
//
// btn关闭
//
this.btn关闭.BackColor = System.Drawing.SystemColors.Control;
this.btn关闭.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.btn关闭.Font = new System.Drawing.Font("宋体", 9F);
this.btn关闭.ForeColor = System.Drawing.SystemColors.ControlText;
this.btn关闭.Location = new System.Drawing.Point(465, 194);
this.btn关闭.Name = "btn关闭";
this.btn关闭.Size = new System.Drawing.Size(85, 28);
this.btn关闭.TabIndex = 13;
this.btn关闭.Text = "关闭";
this.btn关闭.UseVisualStyleBackColor = true;
//
// 甲方报表
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
this.AutoValidate = System.Windows.Forms.AutoValidate.EnablePreventFocusChange;
this.BackColor = System.Drawing.Color.White;
this.ClientSize = new System.Drawing.Size(569, 242);
this.Controls.Add(this.lbl报表类型);
this.Controls.Add(this.cmb报表类型);
this.Controls.Add(this.lbl报表模板);
this.Controls.Add(this.cmb报表模板);
this.Controls.Add(this.btn打开模板);
this.Controls.Add(this.btn导入模板);
this.Controls.Add(this.lbl导出文件);
this.Controls.Add(this.txt导出文件);
this.Controls.Add(this.btn选择文件);
this.Controls.Add(this.chk表格带Excel公式);
this.Controls.Add(this.chk箱柜链接);
this.Controls.Add(this.chk显示费用项目公式);
this.Controls.Add(this.chk显示图纸规格);
this.Controls.Add(this.btn确定);
this.Controls.Add(this.btn关闭);
this.Font = new System.Drawing.Font("宋体", 9F);
this.ForeColor = System.Drawing.SystemColors.ControlText;
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "甲方报表";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "甲方报表";
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Label lbl报表类型;
private System.Windows.Forms.ComboBox cmb报表类型;
private System.Windows.Forms.Label lbl报表模板;
private System.Windows.Forms.ComboBox cmb报表模板;
private System.Windows.Forms.Button btn打开模板;
private System.Windows.Forms.Button btn导入模板;
private System.Windows.Forms.Label lbl导出文件;
private System.Windows.Forms.TextBox txt导出文件;
private System.Windows.Forms.Button btn选择文件;
private System.Windows.Forms.CheckBox chk表格带Excel公式;
private System.Windows.Forms.CheckBox chk箱柜链接;
private System.Windows.Forms.CheckBox chk显示费用项目公式;
private System.Windows.Forms.CheckBox chk显示图纸规格;
private System.Windows.Forms.Button btn确定;
private System.Windows.Forms.Button btn关闭;
}
}
File diff suppressed because it is too large Load Diff
@@ -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>
+677
View File
@@ -0,0 +1,677 @@
namespace 成套报价软件
{
public partial class 调母排 : System.Windows.Forms.Form
{
/// <summary>必需的设计器变量。</summary>
private System.ComponentModel.IContainer components = null;
/// <summary>清理正在使用的资源。</summary>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows 窗体设计器生成的代码
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
this.panel1 = new System.Windows.Forms.Panel();
this.panel2 = new System.Windows.Forms.Panel();
this.checkBox1 = new System.Windows.Forms.CheckBox();
this.checkBox2 = new System.Windows.Forms.CheckBox();
this.label1 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.textBox1当前铜价 = new System.Windows.Forms.TextBox();
this.textBox2当前铝价 = new System.Windows.Forms.TextBox();
this.advancedDataGridView1 = new Smart.CustomComponents.EnhancedDataGridView();
((System.ComponentModel.ISupportInitialize)(this.advancedDataGridView1)).BeginInit();
this.button1 = new System.Windows.Forms.Button();
this.button2 = new System.Windows.Forms.Button();
this.button3 = new System.Windows.Forms.Button();
this.textBox1当前铜价1 = new System.Windows.Forms.TextBox();
this.label5 = new System.Windows.Forms.Label();
this.label6 = new System.Windows.Forms.Label();
this.textBox1加工费1 = new System.Windows.Forms.TextBox();
this.textBox1加工费2 = new System.Windows.Forms.TextBox();
this.label7 = new System.Windows.Forms.Label();
this.SuspendLayout();
//
// panel1
//
this.panel1.Dock = System.Windows.Forms.DockStyle.Top;
this.panel1.AutoSize = false;
this.panel1.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowOnly;
this.panel1.BorderStyle = System.Windows.Forms.BorderStyle.None;
this.panel1.TabStop = false;
this.panel1.AutoScroll = false;
this.panel1.AutoScrollMargin = new System.Drawing.Size(0, 0);
this.panel1.AutoScrollMinSize = new System.Drawing.Size(0, 0);
this.panel1.BackColor = System.Drawing.SystemColors.Control;
this.panel1.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Tile;
this.panel1.Enabled = true;
this.panel1.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
this.panel1.ForeColor = System.Drawing.SystemColors.ControlText;
this.panel1.Margin = new System.Windows.Forms.Padding(3, 3, 3, 3);
this.panel1.TabIndex = 0;
this.panel1.Size = new System.Drawing.Size(712, 91);
this.panel1.Location = new System.Drawing.Point(0, 0);
this.panel1.Name = "panel1";
//
// panel2
//
this.panel2.Dock = System.Windows.Forms.DockStyle.Bottom;
this.panel2.AutoSize = false;
this.panel2.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowOnly;
this.panel2.BorderStyle = System.Windows.Forms.BorderStyle.None;
this.panel2.TabStop = false;
this.panel2.AutoScroll = false;
this.panel2.AutoScrollMargin = new System.Drawing.Size(0, 0);
this.panel2.AutoScrollMinSize = new System.Drawing.Size(0, 0);
this.panel2.BackColor = System.Drawing.SystemColors.Control;
this.panel2.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Tile;
this.panel2.Enabled = true;
this.panel2.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
this.panel2.ForeColor = System.Drawing.SystemColors.ControlText;
this.panel2.Margin = new System.Windows.Forms.Padding(3, 3, 3, 3);
this.panel2.TabIndex = 1;
this.panel2.Size = new System.Drawing.Size(712, 50);
this.panel2.Location = new System.Drawing.Point(0, 390);
this.panel2.Name = "panel2";
//
// checkBox1
//
this.checkBox1.Dock = System.Windows.Forms.DockStyle.None;
this.checkBox1.Appearance = System.Windows.Forms.Appearance.Normal;
this.checkBox1.AutoCheck = true;
this.checkBox1.CheckAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.checkBox1.Checked = true;
this.checkBox1.CheckState = System.Windows.Forms.CheckState.Checked;
this.checkBox1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.checkBox1.ThreeState = false;
this.checkBox1.AutoEllipsis = false;
this.checkBox1.AutoSize = false;
this.checkBox1.BackColor = System.Drawing.SystemColors.Control;
this.checkBox1.FlatStyle = System.Windows.Forms.FlatStyle.Standard;
this.checkBox1.ImageAlign = System.Drawing.ContentAlignment.MiddleCenter;
this.checkBox1.TextImageRelation = System.Windows.Forms.TextImageRelation.Overlay;
this.checkBox1.UseMnemonic = true;
this.checkBox1.UseCompatibleTextRendering = false;
this.checkBox1.UseVisualStyleBackColor = true;
this.checkBox1.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Tile;
this.checkBox1.Enabled = true;
this.checkBox1.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
this.checkBox1.ForeColor = System.Drawing.SystemColors.ControlText;
this.checkBox1.Margin = new System.Windows.Forms.Padding(3, 3, 3, 3);
this.checkBox1.TabIndex = 0;
this.checkBox1.TabStop = true;
this.checkBox1.Size = new System.Drawing.Size(54, 24);
this.checkBox1.Location = new System.Drawing.Point(36, 14);
this.checkBox1.Text = "铜排";
this.checkBox1.Name = "checkBox1";
//
// checkBox2
//
this.checkBox2.Dock = System.Windows.Forms.DockStyle.None;
this.checkBox2.Appearance = System.Windows.Forms.Appearance.Normal;
this.checkBox2.AutoCheck = true;
this.checkBox2.CheckAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.checkBox2.Checked = false;
this.checkBox2.CheckState = System.Windows.Forms.CheckState.Unchecked;
this.checkBox2.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.checkBox2.ThreeState = false;
this.checkBox2.AutoEllipsis = false;
this.checkBox2.AutoSize = false;
this.checkBox2.BackColor = System.Drawing.SystemColors.Control;
this.checkBox2.FlatStyle = System.Windows.Forms.FlatStyle.Standard;
this.checkBox2.ImageAlign = System.Drawing.ContentAlignment.MiddleCenter;
this.checkBox2.TextImageRelation = System.Windows.Forms.TextImageRelation.Overlay;
this.checkBox2.UseMnemonic = true;
this.checkBox2.UseCompatibleTextRendering = false;
this.checkBox2.UseVisualStyleBackColor = true;
this.checkBox2.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Tile;
this.checkBox2.Enabled = true;
this.checkBox2.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
this.checkBox2.ForeColor = System.Drawing.SystemColors.ControlText;
this.checkBox2.Margin = new System.Windows.Forms.Padding(3, 3, 3, 3);
this.checkBox2.TabIndex = 1;
this.checkBox2.TabStop = true;
this.checkBox2.Size = new System.Drawing.Size(54, 24);
this.checkBox2.Location = new System.Drawing.Point(36, 57);
this.checkBox2.Text = "铝排";
this.checkBox2.Name = "checkBox2";
//
// label1
//
this.label1.Dock = System.Windows.Forms.DockStyle.None;
this.label1.AutoSize = false;
this.label1.AutoEllipsis = false;
this.label1.BorderStyle = System.Windows.Forms.BorderStyle.None;
this.label1.FlatStyle = System.Windows.Forms.FlatStyle.Standard;
this.label1.ImageAlign = System.Drawing.ContentAlignment.MiddleCenter;
this.label1.LiveSetting = System.Windows.Forms.Automation.AutomationLiveSetting.Off;
this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
this.label1.UseCompatibleTextRendering = false;
this.label1.UseMnemonic = true;
this.label1.BackColor = System.Drawing.SystemColors.Control;
this.label1.Enabled = true;
this.label1.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
this.label1.ForeColor = System.Drawing.SystemColors.ControlText;
this.label1.Margin = new System.Windows.Forms.Padding(3, 0, 3, 0);
this.label1.TabIndex = 2;
this.label1.Size = new System.Drawing.Size(30, 23);
this.label1.Location = new System.Drawing.Point(96, 14);
this.label1.Text = "铜价";
this.label1.Name = "label1";
//
// label2
//
this.label2.Dock = System.Windows.Forms.DockStyle.None;
this.label2.AutoSize = false;
this.label2.AutoEllipsis = false;
this.label2.BorderStyle = System.Windows.Forms.BorderStyle.None;
this.label2.FlatStyle = System.Windows.Forms.FlatStyle.Standard;
this.label2.ImageAlign = System.Drawing.ContentAlignment.MiddleCenter;
this.label2.LiveSetting = System.Windows.Forms.Automation.AutomationLiveSetting.Off;
this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
this.label2.UseCompatibleTextRendering = false;
this.label2.UseMnemonic = true;
this.label2.BackColor = System.Drawing.SystemColors.Control;
this.label2.Enabled = true;
this.label2.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
this.label2.ForeColor = System.Drawing.SystemColors.ControlText;
this.label2.Margin = new System.Windows.Forms.Padding(3, 0, 3, 0);
this.label2.TabIndex = 3;
this.label2.Size = new System.Drawing.Size(30, 23);
this.label2.Location = new System.Drawing.Point(96, 57);
this.label2.Text = "铝价";
this.label2.Name = "label2";
//
// textBox1当前铜价
//
this.textBox1当前铜价.Dock = System.Windows.Forms.DockStyle.None;
this.textBox1当前铜价.AcceptsReturn = false;
this.textBox1当前铜价.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.None;
this.textBox1当前铜价.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.None;
this.textBox1当前铜价.CharacterCasing = System.Windows.Forms.CharacterCasing.Normal;
this.textBox1当前铜价.Multiline = false;
this.textBox1当前铜价.ScrollBars = System.Windows.Forms.ScrollBars.None;
this.textBox1当前铜价.TextAlign = System.Windows.Forms.HorizontalAlignment.Left;
this.textBox1当前铜价.UseSystemPasswordChar = false;
this.textBox1当前铜价.AcceptsTab = false;
this.textBox1当前铜价.ShortcutsEnabled = true;
this.textBox1当前铜价.BackColor = System.Drawing.SystemColors.Window;
this.textBox1当前铜价.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
this.textBox1当前铜价.ForeColor = System.Drawing.SystemColors.WindowText;
this.textBox1当前铜价.HideSelection = true;
this.textBox1当前铜价.MaxLength = 32767;
this.textBox1当前铜价.ReadOnly = false;
this.textBox1当前铜价.WordWrap = true;
this.textBox1当前铜价.Enabled = true;
this.textBox1当前铜价.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
this.textBox1当前铜价.Margin = new System.Windows.Forms.Padding(3, 3, 3, 3);
this.textBox1当前铜价.TabIndex = 4;
this.textBox1当前铜价.TabStop = true;
this.textBox1当前铜价.Size = new System.Drawing.Size(100, 21);
this.textBox1当前铜价.Location = new System.Drawing.Point(132, 16);
this.textBox1当前铜价.Name = "textBox1当前铜价";
//
// textBox2当前铝价
//
this.textBox2当前铝价.Dock = System.Windows.Forms.DockStyle.None;
this.textBox2当前铝价.AcceptsReturn = false;
this.textBox2当前铝价.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.None;
this.textBox2当前铝价.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.None;
this.textBox2当前铝价.CharacterCasing = System.Windows.Forms.CharacterCasing.Normal;
this.textBox2当前铝价.Multiline = false;
this.textBox2当前铝价.ScrollBars = System.Windows.Forms.ScrollBars.None;
this.textBox2当前铝价.TextAlign = System.Windows.Forms.HorizontalAlignment.Left;
this.textBox2当前铝价.UseSystemPasswordChar = false;
this.textBox2当前铝价.AcceptsTab = false;
this.textBox2当前铝价.ShortcutsEnabled = true;
this.textBox2当前铝价.BackColor = System.Drawing.SystemColors.Window;
this.textBox2当前铝价.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
this.textBox2当前铝价.ForeColor = System.Drawing.SystemColors.WindowText;
this.textBox2当前铝价.HideSelection = true;
this.textBox2当前铝价.MaxLength = 32767;
this.textBox2当前铝价.ReadOnly = false;
this.textBox2当前铝价.WordWrap = true;
this.textBox2当前铝价.Enabled = true;
this.textBox2当前铝价.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
this.textBox2当前铝价.Margin = new System.Windows.Forms.Padding(3, 3, 3, 3);
this.textBox2当前铝价.TabIndex = 5;
this.textBox2当前铝价.TabStop = true;
this.textBox2当前铝价.Size = new System.Drawing.Size(100, 21);
this.textBox2当前铝价.Location = new System.Drawing.Point(132, 59);
this.textBox2当前铝价.Name = "textBox2当前铝价";
//
// advancedDataGridView1
//
this.advancedDataGridView1.ColumnHeadersDefaultCellStyle.BackColor = System.Drawing.Color.FromArgb(255, 240, 240, 240);
this.advancedDataGridView1.ColumnHeadersDefaultCellStyle.ForeColor = System.Drawing.Color.Black;
this.advancedDataGridView1.ColumnHeadersDefaultCellStyle.SelectionBackColor = System.Drawing.Color.FromArgb(255, 240, 240, 240);
this.advancedDataGridView1.ColumnHeadersDefaultCellStyle.SelectionForeColor = System.Drawing.Color.Black;
this.advancedDataGridView1.ColumnHeadersDefaultCellStyle.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 134);
this.advancedDataGridView1.ColumnHeadersDefaultCellStyle.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.advancedDataGridView1.ColumnHeadersDefaultCellStyle.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
this.advancedDataGridView1.DefaultCellStyle.BackColor = System.Drawing.Color.White;
this.advancedDataGridView1.DefaultCellStyle.ForeColor = System.Drawing.Color.Black;
this.advancedDataGridView1.DefaultCellStyle.SelectionBackColor = System.Drawing.Color.White;
this.advancedDataGridView1.DefaultCellStyle.SelectionForeColor = System.Drawing.Color.Black;
this.advancedDataGridView1.DefaultCellStyle.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 134);
this.advancedDataGridView1.DefaultCellStyle.WrapMode = System.Windows.Forms.DataGridViewTriState.False;
this.advancedDataGridView1.DefaultCellStyle.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
this.advancedDataGridView1.RowHeadersDefaultCellStyle.BackColor = System.Drawing.SystemColors.Control;
this.advancedDataGridView1.RowHeadersDefaultCellStyle.ForeColor = System.Drawing.SystemColors.WindowText;
this.advancedDataGridView1.RowHeadersDefaultCellStyle.SelectionBackColor = System.Drawing.SystemColors.Control;
this.advancedDataGridView1.RowHeadersDefaultCellStyle.SelectionForeColor = System.Drawing.SystemColors.WindowText;
this.advancedDataGridView1.RowHeadersDefaultCellStyle.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 134);
this.advancedDataGridView1.RowHeadersDefaultCellStyle.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.advancedDataGridView1.RowHeadersDefaultCellStyle.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
this.advancedDataGridView1.Dock = System.Windows.Forms.DockStyle.Fill;
this.advancedDataGridView1.EnableExcelStyleSelection = true;
this.advancedDataGridView1.EnableCellPaste = false;
this.advancedDataGridView1.AllowUserToAddRows = false;
this.advancedDataGridView1.AllowUserToDeleteRows = true;
this.advancedDataGridView1.AllowUserToOrderColumns = false;
this.advancedDataGridView1.AllowUserToResizeColumns = true;
this.advancedDataGridView1.AllowUserToResizeRows = true;
this.advancedDataGridView1.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.None;
this.advancedDataGridView1.AutoSizeRowsMode = System.Windows.Forms.DataGridViewAutoSizeRowsMode.None;
this.advancedDataGridView1.BackgroundColor = System.Drawing.Color.White;
this.advancedDataGridView1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.advancedDataGridView1.CellBorderStyle = System.Windows.Forms.DataGridViewCellBorderStyle.Single;
this.advancedDataGridView1.ClipboardCopyMode = System.Windows.Forms.DataGridViewClipboardCopyMode.EnableWithAutoHeaderText;
this.advancedDataGridView1.ColumnHeadersBorderStyle = System.Windows.Forms.DataGridViewHeaderBorderStyle.Raised;
this.advancedDataGridView1.ColumnHeadersHeight = 18;
this.advancedDataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.EnableResizing;
this.advancedDataGridView1.ColumnHeadersVisible = true;
this.advancedDataGridView1.EditMode = System.Windows.Forms.DataGridViewEditMode.EditOnKeystrokeOrF2;
this.advancedDataGridView1.EnableHeadersVisualStyles = false;
this.advancedDataGridView1.GridColor = System.Drawing.SystemColors.ControlDark;
this.advancedDataGridView1.ReadOnly = true;
this.advancedDataGridView1.RowHeadersBorderStyle = System.Windows.Forms.DataGridViewHeaderBorderStyle.Raised;
this.advancedDataGridView1.RowHeadersVisible = true;
this.advancedDataGridView1.RowHeadersWidth = 41;
this.advancedDataGridView1.RowHeadersWidthSizeMode = System.Windows.Forms.DataGridViewRowHeadersWidthSizeMode.EnableResizing;
this.advancedDataGridView1.ScrollBars = System.Windows.Forms.ScrollBars.Both;
this.advancedDataGridView1.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.RowHeaderSelect;
this.advancedDataGridView1.ShowCellErrors = true;
this.advancedDataGridView1.ShowCellToolTips = true;
this.advancedDataGridView1.ShowEditingIcon = true;
this.advancedDataGridView1.ShowRowErrors = true;
this.advancedDataGridView1.StandardTab = false;
this.advancedDataGridView1.VirtualMode = false;
this.advancedDataGridView1.Enabled = true;
this.advancedDataGridView1.Margin = new System.Windows.Forms.Padding(3, 3, 3, 3);
this.advancedDataGridView1.TabIndex = 2;
this.advancedDataGridView1.TabStop = true;
this.advancedDataGridView1.Name = "advancedDataGridView1";
this.advancedDataGridView1.Columns.Add(new System.Windows.Forms.DataGridViewTextBoxColumn());
this.advancedDataGridView1.Columns[0].Name = "Column1";
this.advancedDataGridView1.Columns[0].HeaderText = "元件名称";
this.advancedDataGridView1.Columns[0].Width = 100;
this.advancedDataGridView1.Columns[0].Visible = true;
this.advancedDataGridView1.Columns[0].ReadOnly = true;
this.advancedDataGridView1.Columns[0].Frozen = false;
this.advancedDataGridView1.Columns[0].AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.NotSet;
this.advancedDataGridView1.Columns[0].SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
this.advancedDataGridView1.Columns.Add(new System.Windows.Forms.DataGridViewTextBoxColumn());
this.advancedDataGridView1.Columns[1].Name = "Column2";
this.advancedDataGridView1.Columns[1].HeaderText = "规格";
this.advancedDataGridView1.Columns[1].Width = 100;
this.advancedDataGridView1.Columns[1].Visible = true;
this.advancedDataGridView1.Columns[1].ReadOnly = true;
this.advancedDataGridView1.Columns[1].Frozen = false;
this.advancedDataGridView1.Columns[1].AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.NotSet;
this.advancedDataGridView1.Columns[1].SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
this.advancedDataGridView1.Columns.Add(new System.Windows.Forms.DataGridViewTextBoxColumn());
this.advancedDataGridView1.Columns[2].Name = "Column3";
this.advancedDataGridView1.Columns[2].HeaderText = "单位";
this.advancedDataGridView1.Columns[2].Width = 100;
this.advancedDataGridView1.Columns[2].Visible = true;
this.advancedDataGridView1.Columns[2].ReadOnly = true;
this.advancedDataGridView1.Columns[2].Frozen = false;
this.advancedDataGridView1.Columns[2].AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.NotSet;
this.advancedDataGridView1.Columns[2].SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
this.advancedDataGridView1.Columns.Add(new System.Windows.Forms.DataGridViewTextBoxColumn());
this.advancedDataGridView1.Columns[3].Name = "";
this.advancedDataGridView1.Columns[3].HeaderText = "表价(更改前)";
this.advancedDataGridView1.Columns[3].Width = 100;
this.advancedDataGridView1.Columns[3].Visible = true;
this.advancedDataGridView1.Columns[3].ReadOnly = true;
this.advancedDataGridView1.Columns[3].Frozen = false;
this.advancedDataGridView1.Columns[3].AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.NotSet;
this.advancedDataGridView1.Columns[3].SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
this.advancedDataGridView1.Columns.Add(new System.Windows.Forms.DataGridViewTextBoxColumn());
this.advancedDataGridView1.Columns[4].Name = "";
this.advancedDataGridView1.Columns[4].HeaderText = "表价(更改后)";
this.advancedDataGridView1.Columns[4].Width = 100;
this.advancedDataGridView1.Columns[4].Visible = true;
this.advancedDataGridView1.Columns[4].ReadOnly = true;
this.advancedDataGridView1.Columns[4].Frozen = false;
this.advancedDataGridView1.Columns[4].AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.NotSet;
this.advancedDataGridView1.Columns[4].SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
//
// button1
//
this.button1.Dock = System.Windows.Forms.DockStyle.None;
this.button1.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowOnly;
this.button1.DialogResult = System.Windows.Forms.DialogResult.None;
this.button1.AutoEllipsis = false;
this.button1.AutoSize = false;
this.button1.BackColor = System.Drawing.SystemColors.Control;
this.button1.FlatStyle = System.Windows.Forms.FlatStyle.Standard;
this.button1.ImageAlign = System.Drawing.ContentAlignment.MiddleCenter;
this.button1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
this.button1.TextImageRelation = System.Windows.Forms.TextImageRelation.Overlay;
this.button1.UseMnemonic = true;
this.button1.UseCompatibleTextRendering = false;
this.button1.UseVisualStyleBackColor = true;
this.button1.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Tile;
this.button1.Enabled = true;
this.button1.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
this.button1.ForeColor = System.Drawing.SystemColors.ControlText;
this.button1.Margin = new System.Windows.Forms.Padding(3, 3, 3, 3);
this.button1.TabIndex = 8;
this.button1.TabStop = true;
this.button1.Size = new System.Drawing.Size(100, 23);
this.button1.Location = new System.Drawing.Point(409, 59);
this.button1.Text = "计算";
this.button1.Name = "button1";
//
// button2
//
this.button2.Dock = System.Windows.Forms.DockStyle.None;
this.button2.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowOnly;
this.button2.DialogResult = System.Windows.Forms.DialogResult.None;
this.button2.AutoEllipsis = false;
this.button2.AutoSize = false;
this.button2.BackColor = System.Drawing.SystemColors.Control;
this.button2.FlatStyle = System.Windows.Forms.FlatStyle.Standard;
this.button2.ImageAlign = System.Drawing.ContentAlignment.MiddleCenter;
this.button2.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
this.button2.TextImageRelation = System.Windows.Forms.TextImageRelation.Overlay;
this.button2.UseMnemonic = true;
this.button2.UseCompatibleTextRendering = false;
this.button2.UseVisualStyleBackColor = true;
this.button2.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Tile;
this.button2.Enabled = true;
this.button2.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
this.button2.ForeColor = System.Drawing.SystemColors.ControlText;
this.button2.Margin = new System.Windows.Forms.Padding(3, 3, 3, 3);
this.button2.TabIndex = 0;
this.button2.TabStop = true;
this.button2.Size = new System.Drawing.Size(75, 32);
this.button2.Location = new System.Drawing.Point(498, 9);
this.button2.Text = "更新到项目";
this.button2.Name = "button2";
//
// button3
//
this.button3.Dock = System.Windows.Forms.DockStyle.None;
this.button3.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowOnly;
this.button3.DialogResult = System.Windows.Forms.DialogResult.None;
this.button3.AutoEllipsis = false;
this.button3.AutoSize = false;
this.button3.BackColor = System.Drawing.SystemColors.Control;
this.button3.FlatStyle = System.Windows.Forms.FlatStyle.Standard;
this.button3.ImageAlign = System.Drawing.ContentAlignment.MiddleCenter;
this.button3.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
this.button3.TextImageRelation = System.Windows.Forms.TextImageRelation.Overlay;
this.button3.UseMnemonic = true;
this.button3.UseCompatibleTextRendering = false;
this.button3.UseVisualStyleBackColor = true;
this.button3.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Tile;
this.button3.Enabled = true;
this.button3.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
this.button3.ForeColor = System.Drawing.SystemColors.ControlText;
this.button3.Margin = new System.Windows.Forms.Padding(3, 3, 3, 3);
this.button3.TabIndex = 1;
this.button3.TabStop = true;
this.button3.Size = new System.Drawing.Size(75, 32);
this.button3.Location = new System.Drawing.Point(593, 9);
this.button3.Text = "退出";
this.button3.Name = "button3";
//
// textBox1当前铜价1
//
this.textBox1当前铜价1.ShortcutsEnabled = false;
this.textBox1当前铜价1.BorderStyle = System.Windows.Forms.BorderStyle.None;
this.textBox1当前铜价1.HideSelection = false;
this.textBox1当前铜价1.MaxLength = 0;
this.textBox1当前铜价1.WordWrap = false;
this.textBox1当前铜价1.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
this.textBox1当前铜价1.Margin = new System.Windows.Forms.Padding(0, 0, 0, 0);
this.textBox1当前铜价1.TabIndex = 9;
this.textBox1当前铜价1.TabStop = false;
this.textBox1当前铜价1.Size = new System.Drawing.Size(0, 14);
this.textBox1当前铜价1.Name = "textBox1当前铜价1";
//
// label5
//
this.label5.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.label5.UseMnemonic = false;
this.label5.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
this.label5.Margin = new System.Windows.Forms.Padding(0, 0, 0, 0);
this.label5.TabIndex = 9;
this.label5.Size = new System.Drawing.Size(100, 23);
this.label5.Name = "label5";
//
// label6
//
this.label6.Dock = System.Windows.Forms.DockStyle.None;
this.label6.AutoSize = false;
this.label6.AutoEllipsis = false;
this.label6.BorderStyle = System.Windows.Forms.BorderStyle.None;
this.label6.FlatStyle = System.Windows.Forms.FlatStyle.Standard;
this.label6.ImageAlign = System.Drawing.ContentAlignment.MiddleCenter;
this.label6.LiveSetting = System.Windows.Forms.Automation.AutomationLiveSetting.Off;
this.label6.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
this.label6.UseCompatibleTextRendering = false;
this.label6.UseMnemonic = true;
this.label6.BackColor = System.Drawing.SystemColors.Control;
this.label6.Enabled = true;
this.label6.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
this.label6.ForeColor = System.Drawing.SystemColors.ControlText;
this.label6.Margin = new System.Windows.Forms.Padding(3, 0, 3, 0);
this.label6.TabIndex = 2;
this.label6.Size = new System.Drawing.Size(47, 23);
this.label6.Location = new System.Drawing.Point(239, 14);
this.label6.Text = "加工费";
this.label6.Name = "label6";
//
// textBox1加工费1
//
this.textBox1加工费1.Dock = System.Windows.Forms.DockStyle.None;
this.textBox1加工费1.AcceptsReturn = false;
this.textBox1加工费1.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.None;
this.textBox1加工费1.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.None;
this.textBox1加工费1.CharacterCasing = System.Windows.Forms.CharacterCasing.Normal;
this.textBox1加工费1.Multiline = false;
this.textBox1加工费1.ScrollBars = System.Windows.Forms.ScrollBars.None;
this.textBox1加工费1.TextAlign = System.Windows.Forms.HorizontalAlignment.Left;
this.textBox1加工费1.UseSystemPasswordChar = false;
this.textBox1加工费1.AcceptsTab = false;
this.textBox1加工费1.ShortcutsEnabled = true;
this.textBox1加工费1.BackColor = System.Drawing.SystemColors.Window;
this.textBox1加工费1.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
this.textBox1加工费1.ForeColor = System.Drawing.SystemColors.WindowText;
this.textBox1加工费1.HideSelection = true;
this.textBox1加工费1.MaxLength = 32767;
this.textBox1加工费1.ReadOnly = false;
this.textBox1加工费1.WordWrap = true;
this.textBox1加工费1.Enabled = true;
this.textBox1加工费1.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
this.textBox1加工费1.Margin = new System.Windows.Forms.Padding(3, 3, 3, 3);
this.textBox1加工费1.TabIndex = 4;
this.textBox1加工费1.TabStop = true;
this.textBox1加工费1.Size = new System.Drawing.Size(100, 21);
this.textBox1加工费1.Location = new System.Drawing.Point(292, 16);
this.textBox1加工费1.Name = "textBox1加工费1";
//
// textBox1加工费2
//
this.textBox1加工费2.Dock = System.Windows.Forms.DockStyle.None;
this.textBox1加工费2.AcceptsReturn = false;
this.textBox1加工费2.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.None;
this.textBox1加工费2.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.None;
this.textBox1加工费2.CharacterCasing = System.Windows.Forms.CharacterCasing.Normal;
this.textBox1加工费2.Multiline = false;
this.textBox1加工费2.ScrollBars = System.Windows.Forms.ScrollBars.None;
this.textBox1加工费2.TextAlign = System.Windows.Forms.HorizontalAlignment.Left;
this.textBox1加工费2.UseSystemPasswordChar = false;
this.textBox1加工费2.AcceptsTab = false;
this.textBox1加工费2.ShortcutsEnabled = true;
this.textBox1加工费2.BackColor = System.Drawing.SystemColors.Window;
this.textBox1加工费2.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
this.textBox1加工费2.ForeColor = System.Drawing.SystemColors.WindowText;
this.textBox1加工费2.HideSelection = true;
this.textBox1加工费2.MaxLength = 32767;
this.textBox1加工费2.ReadOnly = false;
this.textBox1加工费2.WordWrap = true;
this.textBox1加工费2.Enabled = true;
this.textBox1加工费2.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
this.textBox1加工费2.Margin = new System.Windows.Forms.Padding(3, 3, 3, 3);
this.textBox1加工费2.TabIndex = 4;
this.textBox1加工费2.TabStop = true;
this.textBox1加工费2.Size = new System.Drawing.Size(100, 21);
this.textBox1加工费2.Location = new System.Drawing.Point(292, 57);
this.textBox1加工费2.Name = "textBox1加工费2";
//
// label7
//
this.label7.Dock = System.Windows.Forms.DockStyle.None;
this.label7.AutoSize = false;
this.label7.AutoEllipsis = false;
this.label7.BorderStyle = System.Windows.Forms.BorderStyle.None;
this.label7.FlatStyle = System.Windows.Forms.FlatStyle.Standard;
this.label7.ImageAlign = System.Drawing.ContentAlignment.MiddleCenter;
this.label7.LiveSetting = System.Windows.Forms.Automation.AutomationLiveSetting.Off;
this.label7.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
this.label7.UseCompatibleTextRendering = false;
this.label7.UseMnemonic = true;
this.label7.BackColor = System.Drawing.SystemColors.Control;
this.label7.Enabled = true;
this.label7.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
this.label7.ForeColor = System.Drawing.SystemColors.ControlText;
this.label7.Margin = new System.Windows.Forms.Padding(3, 0, 3, 0);
this.label7.TabIndex = 2;
this.label7.Size = new System.Drawing.Size(47, 23);
this.label7.Location = new System.Drawing.Point(239, 57);
this.label7.Text = "加工费";
this.label7.Name = "label7";
// 调母排
this.Controls.AddRange(new System.Windows.Forms.Control[] {
this.advancedDataGridView1,
this.panel2,
this.panel1,
});
// panel2
this.panel2.Controls.AddRange(new System.Windows.Forms.Control[] {
this.button3,
this.button2,
});
// panel1
this.panel1.Controls.AddRange(new System.Windows.Forms.Control[] {
this.button1,
this.textBox2当前铝价,
this.textBox1当前铜价,
this.label2,
this.label1,
this.checkBox2,
this.checkBox1,
this.label6,
this.textBox1加工费1,
this.textBox1加工费2,
this.label7,
});
//
// 调母排
//
this.Dock = System.Windows.Forms.DockStyle.None;
this.AutoScroll = false;
this.AutoSize = false;
this.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowOnly;
this.AutoValidate = System.Windows.Forms.AutoValidate.EnablePreventFocusChange;
this.BackColor = System.Drawing.Color.White;
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.Sizable;
this.ControlBox = true;
this.HelpButton = false;
this.IsMdiContainer = false;
this.KeyPreview = false;
this.MaximumSize = new System.Drawing.Size(0, 0);
this.MinimumSize = new System.Drawing.Size(0, 0);
this.MaximizeBox = true;
this.MinimizeBox = true;
this.Opacity = 1;
this.RightToLeftLayout = false;
this.ShowInTaskbar = true;
this.ShowIcon = true;
this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Auto;
this.StartPosition = System.Windows.Forms.FormStartPosition.WindowsDefaultLocation;
this.TopMost = false;
this.WindowState = System.Windows.Forms.FormWindowState.Normal;
this.AutoScrollMargin = new System.Drawing.Size(0, 0);
this.AutoScrollMinSize = new System.Drawing.Size(0, 0);
this.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Tile;
this.Enabled = true;
this.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
this.ForeColor = System.Drawing.SystemColors.ControlText;
this.Padding = new System.Windows.Forms.Padding(0, 0, 0, 0);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
this.Size = new System.Drawing.Size(728, 479);
this.Text = "调母排";
this.Name = "调母排";
((System.ComponentModel.ISupportInitialize)(this.advancedDataGridView1)).EndInit();
this.ResumeLayout(false);
this.PerformLayout();
// === DataGridView Excel 风格选中效果 ===
}
#endregion
private System.Windows.Forms.Panel panel1;
private System.Windows.Forms.Panel panel2;
private System.Windows.Forms.CheckBox checkBox1;
private System.Windows.Forms.CheckBox checkBox2;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.TextBox textBox1当前铜价;
private System.Windows.Forms.TextBox textBox2当前铝价;
private Smart.CustomComponents.EnhancedDataGridView advancedDataGridView1;
private System.Windows.Forms.Button button1;
private System.Windows.Forms.Button button2;
private System.Windows.Forms.Button button3;
private System.Windows.Forms.TextBox textBox1当前铜价1;
private System.Windows.Forms.Label label5;
private System.Windows.Forms.Label label6;
private System.Windows.Forms.TextBox textBox1加工费1;
private System.Windows.Forms.TextBox textBox1加工费2;
private System.Windows.Forms.Label label7;
}
}
+667
View File
@@ -0,0 +1,667 @@
using System;
using System.Collections.Generic;
using System.Data;
using System.Windows.Forms;
using Smart.CustomComponents;
namespace 成套报价软件
{
/// <summary>
/// 调母排 的交互逻辑(事件处理)。
/// UI 布局定义见 调母排.ui.cs。
///
/// 用法:主窗口报价页 button15「调母排」传入主窗口引用弹出。
/// 功能:
/// ① 打开时从主窗口母排页带出 当前铜价/当前铝价/铜加工费/铝加工费
/// ② advancedDataGridView1 汇总当前项目所有图号→箱柜→元件里的 铜排/铝排
/// (按规格识别材质:LMY 开头=铝排,其余(TMY 等)=铜排;类型=母排 的行也算)
/// ③ 「计算」:按 新表价 = (铜价或铝价)×每米重量 + 对应加工费 重算表格的
/// "表价(更改后)"列;铜排铝排各自用对应价格与加工费
/// ④ 「更新到项目」:把"表价(更改后)"写回所有元件表(表价+派生列 SQL 重算),
/// 并通知主窗口刷新报价页
/// </summary>
public partial class 调母排
{
// ===== 主窗口引用与上下文 =====
/// <summary>主窗口引用(取母排页价格/加工费,更新后刷新报价页)。</summary>
private MainForm _main = null;
/// <summary>当前项目编号。</summary>
private string _projectId = "";
/// <summary>汇总表内存数据(元件名称/规格/单位/表价更改前/表价更改后)。</summary>
private DataTable _table = null;
/// <summary>每行对应元件表名+行序号,更新到项目时定位用。</summary>
private List<string> _rowKeys = new List<string>();
/// <summary>构造函数(独立运行测试用)。</summary>
public 调母排()
{
InitializeComponent();
// 事件绑定(运行时绑,不动 ui.cs)
this.button1.Click += button1_Click; // 计算
this.button2.Click += button2_Click; // 更新到项目
this.button3.Click += button3_Click; // 退出
// ★ 加工费联动(与 tabPage12 母排页 Recalc铜价PerKg 同规则):
// 价格框显示 = (金属价/吨 + 加工费/吨) / 1000 → 元/kg
// 改加工费时自动把价格框重算成"金属价+加工费"合价
this.textBox1加工费1.TextChanged += (s, e) => Recalc铜价框(false);
this.textBox1加工费2.TextChanged += (s, e) => Recalc铜价框(true);
}
/// <summary>带出价格时记录的"纯金属价(元/kg)"(未含加工费),联动重算用。</summary>
private decimal _纯铜价Kg = 0m;
private decimal _纯铝价Kg = 0m;
/// <summary>
/// 加工费变化 → 重算对应价格框 = 纯金属价(kg) + 加工费(元/吨)/1000。
/// (加工费单位与价格一致:元/吨,除以 1000 变元/kg)
/// 与 tabPage12 的 Recalc铜价PerKg 公式相同。
/// </summary>
private void Recalc铜价框(bool 铝)
{
decimal 纯价 = 铝 ? _纯铝价Kg : _纯铜价Kg;
if (纯价 <= 0m) return; // 还没带出过价格,不动
decimal 费吨 = ParseDec(铝 ? this.textBox1加工费2.Text : this.textBox1加工费1.Text);
decimal 合价 = 纯价 + 费吨 / 1000m;
if (铝) this.textBox2当前铝价.Text = Math.Round(合价, 2).ToString("0.##");
else this.textBox1当前铜价.Text = Math.Round(合价, 2).ToString("0.##");
}
/// <summary>主窗口调用:传主窗口引用,打开时自动带价格并汇总。</summary>
public 调母排(MainForm main) : this()
{
_main = main;
}
/// <summary>窗体加载:先落盘+汇总母排,再自动抓取铜价/铝价填入。</summary>
protected override void OnLoad(EventArgs e)
{
base.OnLoad(e);
try
{
// ① 主窗口内存里未保存的元件编辑先落盘(本窗口直接读库,必须看到最新数据)
if (_main != null) _main.FlushQuoteTablesToDb();
// ② 加工费带出
this.textBox1加工费1.Text = _main != null ? _main.Get母排加工费(false) : "";
this.textBox1加工费2.Text = _main != null ? _main.Get母排加工费(true) : "";
// ③ 汇总整个项目的铜排/铝排
LoadSummary();
// ④ 自动抓取铜价+铝价(异步,抓到自动填入文本框)
FetchMetalPrices();
}
catch (Exception ex)
{
MessageBox.Show(this, "初始化失败:\n" + ex.Message, "调母排",
MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
// ============================================================
// 数据路径与工具
// ============================================================
/// <summary>主窗口实例上的当前项目编号(通过公共方式取,不依赖私有字段)。</summary>
private string ProjectId
{
get
{
if (!string.IsNullOrEmpty(_projectId)) return _projectId;
if (_main != null) _projectId = _main.GetCurrentProjectId();
return _projectId ?? "";
}
}
/// <summary>当前项目报价库路径(与主窗口同规则)。</summary>
private string QuoteDbPath
{
get
{
string safe = ProjectId;
foreach (char c in System.IO.Path.GetInvalidFileNameChars()) safe = safe.Replace(c, '_');
return System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory,
@"sjk\bjb\项目" + safe + ".db");
}
}
private static string ConnStr(string dbPath) { return "Data Source=" + dbPath + ";Version=3;"; }
private static decimal ParseDec(string s)
{
decimal d;
if (decimal.TryParse((s ?? "").Trim(), out d)) return d;
return 0m;
}
// ============================================================
// ① 价格来源:读配置文件缓存(主窗口母排页抓价时写入),不发网络请求
// ============================================================
/// <summary>
/// 从 shezhi\铜排参数.config.xml / 铝排参数.config.xml 读缓存的铜价/铝价(元/吨),
/// 加上加工费后换算成 元/kg 填入文本框(与 tabPage12 母排页口径一致:
/// 价格框显示的就是"金属价+加工费"的合价)。
/// ★ 缓存缺失的品种自动联网补抓(调母排自己抓,不依赖主窗口切换材质刷新过)。
/// </summary>
private void FetchMetalPrices()
{
string[] 铜缓存 = _main != null ? _main.Get母排价格缓存(false) : new string[] { "", "" };
string[] 铝缓存 = _main != null ? _main.Get母排价格缓存(true) : new string[] { "", "" };
decimal 铜吨 = ParseDec(铜缓存[0]);
decimal 铝吨 = ParseDec(铝缓存[0]);
// 缓存缺哪个,退回主窗口当前文本框值(材质对得上才用)
if (铜吨 <= 0m && _main != null && !_main.Get母排是铝排())
铜吨 = ParseDec(_main.Get母排当前价格文本());
if (铝吨 <= 0m && _main != null && _main.Get母排是铝排())
铝吨 = ParseDec(_main.Get母排当前价格文本());
// ★ 还有缺的 → 后台联网补抓(如铝价:主窗口一直在铜排模式,缓存里就没有铝价)
if (铜吨 <= 0m || 铝吨 <= 0m)
{
FetchMetalPricesOnline(铜吨 <= 0m, 铝吨 <= 0m);
}
// ★ 价格框 = (金属价/吨 + 加工费/吨) / 1000 = 金属价kg + 加工费kg
decimal 铜费吨 = ParseDec(this.textBox1加工费1.Text);
decimal 铝费吨 = ParseDec(this.textBox1加工费2.Text);
if (铜吨 > 0m)
{
_纯铜价Kg = Math.Round(铜吨 / 1000m, 2);
this.textBox1当前铜价.Text = Math.Round(_纯铜价Kg + 铜费吨 / 1000m, 2).ToString("0.##");
}
if (铝吨 > 0m)
{
_纯铝价Kg = Math.Round(铝吨 / 1000m, 2);
this.textBox2当前铝价.Text = Math.Round(_纯铝价Kg + 铝费吨 / 1000m, 2).ToString("0.##");
}
// 标题栏标注价格日期(铜/铝各自缓存的)
string 铜日 = 铜缓存[1];
string 铝日 = 铝缓存[1];
List<string> parts = new List<string>();
if (铜吨 > 0m) parts.Add("铜价日期:" + (string.IsNullOrEmpty(铜日) ? "?" : 铜日));
if (铝吨 > 0m) parts.Add("铝价日期:" + (string.IsNullOrEmpty(铝日) ? "?" : 铝日));
this.Text = "调母排" +
(parts.Count > 0 ? "(" + string.Join(" ", parts.ToArray()) + ")"
: "(获取价格中…)");
}
/// <summary>长江有色数据接口(与主窗口母排页一致)。</summary>
private const string 价格接口 = "https://www.ccmn.cn/shop/historyData/getCjysAndCjysw";
/// <summary>接口 AES 密钥(与主窗口一致)。</summary>
private const string AES密钥 = "ccmnCjysw1455881";
/// <summary>
/// 后台联网抓缺失的金属价(need铜/need铝 指明缺哪个,至少一个为 true),
/// 抓到后:①写入配置缓存(下次不用再抓) ②回 UI 线程填入价格框(含加工费合价)。
/// 失败则标题栏提示手填。
/// </summary>
private void FetchMetalPricesOnline(bool need铜, bool need铝)
{
System.Threading.Tasks.Task.Factory.StartNew(() =>
{
string 铜吨 = "", 铝吨 = "", 日期 = "";
try
{
System.Net.ServicePointManager.SecurityProtocol =
(System.Net.SecurityProtocolType)3072; // Tls12
string json;
using (var wc = new System.Net.WebClient())
{
wc.Encoding = System.Text.Encoding.UTF8;
wc.Headers[System.Net.HttpRequestHeader.UserAgent] =
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36";
wc.Headers[System.Net.HttpRequestHeader.Referer] = "https://www.ccmn.cn/";
json = wc.DownloadString(价格接口);
}
string showPriceList = 取JSON字段(json, "showPriceList");
if (!string.IsNullOrEmpty(showPriceList))
{
string plain = AES解密(showPriceList);
foreach (System.Text.RegularExpressions.Match m in
System.Text.RegularExpressions.Regex.Matches(plain, @"\{[^}]*\}"))
{
string obj = m.Value;
string 名称 = 取JSON字段(obj, "productSortName");
var 均价m = System.Text.RegularExpressions.Regex.Match(obj,
@"""avgPrice""\s*:\s*([0-9]+\.?[0-9]*)");
if (!均价m.Success) continue;
if (名称 == "1#铜" && need铜) { 铜吨 = 均价m.Groups[1].Value; 日期 = 取JSON字段(obj, "publishDate"); }
else if (名称 == "A00铝" && need铝) { 铝吨 = 均价m.Groups[1].Value; }
}
}
}
catch { }
// 回 UI 线程填入
if (this.IsHandleCreated && !this.IsDisposed)
{
try
{
this.BeginInvoke(new System.Action(() =>
{
decimal 铜费吨 = ParseDec(this.textBox1加工费1.Text);
decimal 铝费吨 = ParseDec(this.textBox1加工费2.Text);
decimal d铜 = ParseDec(铜吨);
if (d铜 > 0m)
{
// 写入配置缓存(下次打开直接读,不再联网)
if (_main != null) _main.Save母排价格缓存Pub(false, 铜吨, 日期);
_纯铜价Kg = Math.Round(d铜 / 1000m, 2);
this.textBox1当前铜价.Text = Math.Round(_纯铜价Kg + 铜费吨 / 1000m, 2).ToString("0.##");
}
decimal d铝 = ParseDec(铝吨);
if (d铝 > 0m)
{
if (_main != null) _main.Save母排价格缓存Pub(true, 铝吨, 日期);
_纯铝价Kg = Math.Round(d铝 / 1000m, 2);
this.textBox2当前铝价.Text = Math.Round(_纯铝价Kg + 铝费吨 / 1000m, 2).ToString("0.##");
}
List<string> parts = new List<string>();
if (ParseDec(this.textBox1当前铜价.Text) > 0m) parts.Add("铜价OK");
if (ParseDec(this.textBox2当前铝价.Text) > 0m) parts.Add("铝价OK");
this.Text = "调母排" +
(parts.Count == 2 ? "(价格已就绪)" :
parts.Count > 0 ? "(" + string.Join(" ", parts.ToArray()) + " 另一价请手填)"
: "(价格获取失败,请手填)");
}));
}
catch { }
}
});
}
/// <summary>AES-ECB(PKCS7) 解密接口 Base64 密文(与主窗口铜价AES解密一致)。</summary>
private static string AES解密(string 加密Base64)
{
byte[] 密钥 = System.Text.Encoding.UTF8.GetBytes(AES密钥);
byte[] 密文 = System.Convert.FromBase64String(加密Base64);
using (var aes = System.Security.Cryptography.Aes.Create())
{
aes.Mode = System.Security.Cryptography.CipherMode.ECB;
aes.Padding = System.Security.Cryptography.PaddingMode.PKCS7;
aes.Key = 密钥;
using (var 解密器 = aes.CreateDecryptor())
{
byte[] 明文 = 解密器.TransformFinalBlock(密文, 0, 密文.Length);
return System.Text.Encoding.UTF8.GetString(明文);
}
}
}
/// <summary>从简单 JSON 取字符串字段(与MainForm 取JSON字段 一致)。</summary>
private static string 取JSON字段(string json, string key)
{
if (string.IsNullOrEmpty(json)) return "";
var m = System.Text.RegularExpressions.Regex.Match(json,
"\"" + System.Text.RegularExpressions.Regex.Escape(key) + "\"\\s*:\\s*\"((?:[^\"\\\\]|\\\\.)*)\"");
if (!m.Success) return "";
return m.Groups[1].Value.Replace("\\\"", "\"").Replace("\\\\", "\\").Replace("\\/", "/");
}
// ============================================================
// ② 汇总当前项目所有铜排/铝排元件
// ============================================================
/// <summary>汇总表列定义。</summary>
private static readonly string[] SummaryCols =
new string[] { "元件名称", "规格", "单位", "表价(更改前)", "表价(更改后)" };
/// <summary>按规格判断材质:true=铝排,false=铜排。LMY 前缀=铝,其余(TMY/裸规格)=铜。</summary>
private static bool Is铝排(string 规格)
{
string s = (规格 ?? "").Trim().ToUpperInvariant();
return s.StartsWith("LMY") || s.StartsWith("L") && s.IndexOf('-') > 0 && s.Substring(0, s.IndexOf('-')) == "LMY";
}
/// <summary>
/// 解析规格得到 层数/宽度/厚度(与MainForm TryParse铜排规格 同规则):
/// 去掉 "TMY-"/"LMY-" 前缀;"2(60×6)"→2/60/6;"60×6"→1/60/6。
/// </summary>
private static bool TryParse规格(string 规格, out int 层数, out decimal 宽, out decimal 厚)
{
层数 = 1; 宽 = 0m; 厚 = 0m;
if (string.IsNullOrWhiteSpace(规格)) return false;
string s = 规格.Trim();
int dash = s.IndexOf('-');
if (dash >= 0 && dash < s.Length - 1) s = s.Substring(dash + 1).Trim();
var m = System.Text.RegularExpressions.Regex.Match(s,
@"^(\d+)\s*\(\s*(\d+(?:\.\d+)?)\s*[×xX\*]\s*(\d+(?:\.\d+)?)\s*\)");
if (m.Success)
{
if (!int.TryParse(m.Groups[1].Value, out 层数)) 层数 = 1;
宽 = ParseDec(m.Groups[2].Value);
厚 = ParseDec(m.Groups[3].Value);
return 宽 > 0 && 厚 > 0;
}
m = System.Text.RegularExpressions.Regex.Match(s,
@"^(\d+(?:\.\d+)?)\s*[×xX\*]\s*(\d+(?:\.\d+)?)");
if (m.Success)
{
层数 = 1;
宽 = ParseDec(m.Groups[1].Value);
厚 = ParseDec(m.Groups[2].Value);
return 宽 > 0 && 厚 > 0;
}
return false;
}
/// <summary>汇总当前项目所有元件表里的铜排/铝排行到表格(按 名称+规格 聚合数量列不做,逐行显示)。</summary>
private void LoadSummary()
{
_rowKeys.Clear();
_table = new DataTable();
foreach (string c in SummaryCols) _table.Columns.Add(c, typeof(string));
_table.Columns.Add("__表名", typeof(string)); // 内部:元件真实表名 yj_N
_table.Columns.Add("__序号", typeof(string)); // 内部:行序号
_table.Columns.Add("__铝排", typeof(bool)); // 内部:是否铝排
string dbPath = QuoteDbPath;
if (!System.IO.File.Exists(dbPath))
{
MessageBox.Show(this, "当前项目报价库不存在。", "调母排",
MessageBoxButtons.OK, MessageBoxIcon.Warning);
BindSummary();
return;
}
using (var conn = new System.Data.SQLite.SQLiteConnection(ConnStr(dbPath)))
{
conn.Open();
// 所有元件表(表索引 类型=元件)
var yjTables = new List<string>();
using (var cmd = new System.Data.SQLite.SQLiteCommand(
"SELECT DISTINCT 实际表名 FROM 表索引 WHERE 类型='元件';", conn))
using (var rd = cmd.ExecuteReader())
{
while (rd.Read())
{
string t = rd.IsDBNull(0) ? "" : rd.GetString(0);
if (!string.IsNullOrEmpty(t)) yjTables.Add(t);
}
}
_表数 = yjTables.Count;
foreach (string tbl in yjTables)
{
try
{
using (var cmd = new System.Data.SQLite.SQLiteCommand(
"SELECT 序号, 元件名称, 规格, 单位, 表价, 类型 FROM \"" + tbl + "\";", conn))
using (var rd = cmd.ExecuteReader())
{
while (rd.Read())
{
// ★ 注意:表价列在库里是 REAL 类型(浮点),不能用 GetString,
// 否则抛 InvalidCastException 被 catch 吞掉 → 一行都读不出来!
// 统一用 GetValue+ToString,TEXT/REAL 通吃。
string 序号 = rd.IsDBNull(0) ? "" : rd.GetValue(0).ToString();
string 名称 = rd.IsDBNull(1) ? "" : rd.GetValue(1).ToString();
string 规格 = rd.IsDBNull(2) ? "" : rd.GetValue(2).ToString();
string 单位 = rd.IsDBNull(3) ? "" : rd.GetValue(3).ToString();
string 表价 = rd.IsDBNull(4) ? "" : rd.GetValue(4).ToString();
string 类型 = rd.IsDBNull(5) ? "" : rd.GetValue(5).ToString();
// ★ 唯一识别条件:类型字段 = 母排(严格按库里数据,不做任何猜测)
if ((类型 ?? "").Trim() != "母排") continue;
// 材质按规格前缀:LMY=铝排,其余(TMY等)=铜排
bool 铝 = Is铝排(规格);
var row = _table.NewRow();
row["元件名称"] = 名称;
row["规格"] = 规格;
row["单位"] = 单位;
row["表价(更改前)"] = 表价;
row["表价(更改后)"] = 表价; // 默认等于更改前,等「计算」刷新
row["__表名"] = tbl;
row["__序号"] = 序号;
row["__铝排"] = 铝;
_table.Rows.Add(row);
_rowKeys.Add(tbl + "#" + 序号);
}
}
}
catch (Exception exTbl)
{
// 单表读失败不中断其他表,但要留日志(之前静默吞掉表价REAL类型异常吃过亏)
try
{
System.IO.File.AppendAllText(
System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, @"logs\调母排.log"),
"[" + DateTime.Now.ToString("HH:mm:ss.fff") + "] 读表失败 " + tbl + ": " + exTbl.Message + "\r\n");
}
catch { }
}
}
}
BindSummary();
// 诊断日志:确认读到了几个表/几行(排查"打开窗口没数据")
try
{
System.IO.File.AppendAllText(
System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, @"logs\调母排.log"),
"[" + DateTime.Now.ToString("HH:mm:ss.fff") + "] 项目=" + ProjectId +
" 元件表数=" + _表数 + " 母排行数=" + _table.Rows.Count + "\r\n");
}
catch { }
}
/// <summary>本次汇总扫过的元件表数量(诊断用)。</summary>
private int _表数 = 0;
/// <summary>把内存表绑定到表格(只显示 5 个业务列)。</summary>
private void BindSummary()
{
var view = new DataTable();
foreach (string c in SummaryCols) view.Columns.Add(c, typeof(string));
foreach (DataRow r in _table.Rows)
{
var nr = view.NewRow();
foreach (string c in SummaryCols) nr[c] = r[c] ?? "";
view.Rows.Add(nr);
}
// ★ 设计器手工加的 5 列(Name=Column1..5)没设 DataPropertyName,
// 直接绑 DataSource 匹配不上会显示不出数据——按表头顺序接上数据列。
var grid = this.advancedDataGridView1;
grid.AutoGenerateColumns = false;
if (grid.Columns.Count >= SummaryCols.Length)
{
for (int i = 0; i < SummaryCols.Length; i++)
{
grid.Columns[i].DataPropertyName = SummaryCols[i];
}
}
grid.DataSource = view;
}
// ============================================================
// ③ 计算:按当前价格+加工费重算"表价(更改后)"
// ============================================================
/// <summary>
/// button1「计算」(与 tabPage12 母排页同规则):
/// 价格框已是"金属价+加工费"合价(元/kg)
/// 新表价 = round( 合价(元/kg) × 每米重量(kg/m), 0 )
/// 每米重量 = 层数 × 宽 × 厚 × 密度 / 1000 (铜 8.9 / 铝 2.7)
/// —— 即母排页 Recalc单价PerMeter 的批量版,加工费不重复加。
/// 复选框可只算一种材质。
/// </summary>
private void button1_Click(object sender, EventArgs e)
{
if (_table == null || _table.Rows.Count == 0)
{
MessageBox.Show(this, "没有可计算的铜排/铝排数据。", "调母排",
MessageBoxButtons.OK, MessageBoxIcon.Information);
return;
}
decimal 铜价 = ParseDec(this.textBox1当前铜价.Text);
decimal 铝价 = ParseDec(this.textBox2当前铝价.Text);
int 算铜 = 0, 算铝 = 0, 跳过 = 0;
foreach (DataRow r in _table.Rows)
{
bool 铝 = (bool)r["__铝排"];
// 复选框:只算勾选的材质(两个都没勾=都算)
if (this.checkBox1.Checked && !this.checkBox2.Checked && 铝) { 跳过++; continue; }
if (this.checkBox2.Checked && !this.checkBox1.Checked && !铝) { 跳过++; continue; }
decimal 价 = 铝 ? 铝价 : 铜价; // 已含加工费的合价
if (价 <= 0m) { 跳过++; continue; } // 价格没填
int 层; decimal 宽, 厚;
if (!TryParse规格((r["规格"] ?? "").ToString(), out 层, out 宽, out 厚)) { 跳过++; continue; }
decimal 密度 = 铝 ? 2.7m : 8.9m;
decimal 每米重量 = 层 * 宽 * 厚 * 密度 / 1000m;
decimal 新表价 = Math.Round(价 * 每米重量, 0, MidpointRounding.AwayFromZero);
r["表价(更改后)"] = 新表价.ToString("0");
if (铝) 算铝++; else 算铜++;
}
BindSummary();
MessageBox.Show(this,
"计算完成!\n\n铜排 " + 算铜 + " 行,铝排 " + 算铝 + " 行" +
(跳过 > 0 ? "\n跳过 " + 跳过 + " 行(价格未填/规格无法解析/材质未勾选)" : ""),
"调母排", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
// ============================================================
// ④ 更新到项目
// ============================================================
/// <summary>
/// button2「更新到项目」:把"表价(更改后)"写回所有元件表,
/// 派生列(采购单价/采购价/报出单价/报出价)用 SQL 表达式按每行自己的数量与系数重算,
/// 然后通知主窗口清缓存刷新报价页并全量重算。
/// </summary>
private void button2_Click(object sender, EventArgs e)
{
if (_table == null || _table.Rows.Count == 0)
{
MessageBox.Show(this, "没有可更新的数据。", "调母排",
MessageBoxButtons.OK, MessageBoxIcon.Information);
return;
}
// 统计有变化的行
int 有变化 = 0, 相同 = 0;
foreach (DataRow r in _table.Rows)
{
string 前 = (r["表价(更改前)"] ?? "").ToString().Trim();
string 后 = (r["表价(更改后)"] ?? "").ToString().Trim();
decimal d前, d后;
decimal.TryParse(前, out d前);
decimal.TryParse(后, out d后);
if (d后 != d前) 有变化++; else 相同++;
}
if (有变化 == 0)
{
MessageBox.Show(this, "没有价格变化(表价更改后=更改前),无需更新。\n请先点「计算」。", "调母排",
MessageBoxButtons.OK, MessageBoxIcon.Information);
return;
}
if (MessageBox.Show(this,
"将把 " + 有变化 + " 条铜排/铝排的新表价更新到整个项目,\n" +
"并按各行的数量/系数自动重算派生列与汇总。\n\n确定更新吗?",
"更新到项目", MessageBoxButtons.YesNo, MessageBoxIcon.Question,
MessageBoxDefaultButton.Button2) != DialogResult.Yes) return;
string dbPath = QuoteDbPath;
int 更新行 = 0;
try
{
using (var conn = new System.Data.SQLite.SQLiteConnection(ConnStr(dbPath)))
{
conn.Open();
using (var tx = conn.BeginTransaction())
{
try
{
foreach (DataRow r in _table.Rows)
{
string 前 = (r["表价(更改前)"] ?? "").ToString().Trim();
string 后 = (r["表价(更改后)"] ?? "").ToString().Trim();
decimal d前, d后;
decimal.TryParse(前, out d前);
decimal.TryParse(后, out d后);
if (d后 == d前) continue; // 无变化不写
string tbl = (string)r["__表名"];
string 序号 = (string)r["__序号"];
// 表价 + 派生列一起更新(与 RecalcYuanjianRow 公式一致):
// 采购单价 = 表价 × 采购系数
// 采购价 = 采购单价 × 数量
// 报出单价 = 采购单价 × 报出系数
// 报出价 = 报出单价 × 数量
string sql = "UPDATE \"" + tbl.Replace("\"", "") + "\" SET " +
"表价 = @bj, " +
"采购单价 = @bj * CAST(采购系数 AS REAL), " +
"采购价 = (@bj * CAST(采购系数 AS REAL)) * CAST(数量 AS REAL), " +
"报出单价 = (@bj * CAST(采购系数 AS REAL)) * CAST(报出系数 AS REAL), " +
"报出价 = ((@bj * CAST(采购系数 AS REAL)) * CAST(报出系数 AS REAL)) * CAST(数量 AS REAL) " +
"WHERE 序号 = @xh;";
using (var cmd = new System.Data.SQLite.SQLiteCommand(sql, conn, tx))
{
cmd.Parameters.AddWithValue("@bj", d后);
cmd.Parameters.AddWithValue("@xh", 序号);
更新行 += cmd.ExecuteNonQuery();
}
}
tx.Commit();
}
catch
{
try { tx.Rollback(); } catch { }
throw;
}
}
}
// 同步"更改前"=新值(可再次计算而不重复更新)
foreach (DataRow r in _table.Rows) r["表价(更改前)"] = r["表价(更改后)"];
BindSummary();
// 通知主窗口:清缓存 + 全量重算 + 刷新报价页
if (_main != null) _main.RefreshAfter母排调价();
MessageBox.Show(this,
"更新完成!\n\n共更新 " + 更新行 + " 条元件表价,\n项目汇总已自动重算。",
"调母排", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
catch (Exception ex)
{
MessageBox.Show(this, "更新失败:\n" + ex.Message, "调母排",
MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
/// <summary>button3「退出」:关闭窗口。</summary>
private void button3_Click(object sender, EventArgs e)
{
this.Close();
}
}
}
+426
View File
@@ -0,0 +1,426 @@
namespace 成套报价软件
{
public partial class 调系数 : System.Windows.Forms.Form
{
/// <summary>必需的设计器变量。</summary>
private System.ComponentModel.IContainer components = null;
/// <summary>清理正在使用的资源。</summary>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows 窗体设计器生成的代码
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
this.advancedDataGridView1 = new Smart.CustomComponents.EnhancedDataGridView();
((System.ComponentModel.ISupportInitialize)(this.advancedDataGridView1)).BeginInit();
this.panel1 = new System.Windows.Forms.Panel();
this.button1 = new System.Windows.Forms.Button();
this.resizableTextBox1 = new Smart.CustomComponents.ResizableTextBox();
this.resizableComboBox1 = new Smart.CustomComponents.ResizableComboBox();
this.multiSelectComboBox1 = new Smart.CustomComponents.MultiSelectComboBox();
this.resizableComboBox2 = new Smart.CustomComponents.ResizableComboBox();
this.resizableComboBox3 = new Smart.CustomComponents.ResizableComboBox();
this.resizableComboBox4 = new Smart.CustomComponents.ResizableComboBox();
this.SuspendLayout();
//
// advancedDataGridView1
//
this.advancedDataGridView1.ColumnHeadersDefaultCellStyle.BackColor = System.Drawing.Color.FromArgb(255, 240, 240, 240);
this.advancedDataGridView1.ColumnHeadersDefaultCellStyle.ForeColor = System.Drawing.Color.Black;
this.advancedDataGridView1.ColumnHeadersDefaultCellStyle.SelectionBackColor = System.Drawing.Color.FromArgb(255, 240, 240, 240);
this.advancedDataGridView1.ColumnHeadersDefaultCellStyle.SelectionForeColor = System.Drawing.Color.Black;
this.advancedDataGridView1.ColumnHeadersDefaultCellStyle.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 1);
this.advancedDataGridView1.ColumnHeadersDefaultCellStyle.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.advancedDataGridView1.ColumnHeadersDefaultCellStyle.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
this.advancedDataGridView1.DefaultCellStyle.BackColor = System.Drawing.Color.White;
this.advancedDataGridView1.DefaultCellStyle.ForeColor = System.Drawing.Color.Black;
this.advancedDataGridView1.DefaultCellStyle.SelectionBackColor = System.Drawing.Color.White;
this.advancedDataGridView1.DefaultCellStyle.SelectionForeColor = System.Drawing.Color.Black;
this.advancedDataGridView1.DefaultCellStyle.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 1);
this.advancedDataGridView1.DefaultCellStyle.WrapMode = System.Windows.Forms.DataGridViewTriState.False;
this.advancedDataGridView1.DefaultCellStyle.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
this.advancedDataGridView1.RowHeadersDefaultCellStyle.BackColor = System.Drawing.SystemColors.Control;
this.advancedDataGridView1.RowHeadersDefaultCellStyle.ForeColor = System.Drawing.SystemColors.WindowText;
this.advancedDataGridView1.RowHeadersDefaultCellStyle.SelectionBackColor = System.Drawing.SystemColors.Control;
this.advancedDataGridView1.RowHeadersDefaultCellStyle.SelectionForeColor = System.Drawing.SystemColors.WindowText;
this.advancedDataGridView1.RowHeadersDefaultCellStyle.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 1);
this.advancedDataGridView1.RowHeadersDefaultCellStyle.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.advancedDataGridView1.RowHeadersDefaultCellStyle.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
this.advancedDataGridView1.Dock = System.Windows.Forms.DockStyle.Fill;
this.advancedDataGridView1.EnableExcelStyleSelection = true;
this.advancedDataGridView1.EnableCellPaste = false;
this.advancedDataGridView1.AllowUserToAddRows = true;
this.advancedDataGridView1.AllowUserToDeleteRows = true;
this.advancedDataGridView1.AllowUserToOrderColumns = false;
this.advancedDataGridView1.AllowUserToResizeColumns = true;
this.advancedDataGridView1.AllowUserToResizeRows = true;
this.advancedDataGridView1.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.None;
this.advancedDataGridView1.AutoSizeRowsMode = System.Windows.Forms.DataGridViewAutoSizeRowsMode.None;
this.advancedDataGridView1.BackgroundColor = System.Drawing.Color.White;
this.advancedDataGridView1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.advancedDataGridView1.CellBorderStyle = System.Windows.Forms.DataGridViewCellBorderStyle.Single;
this.advancedDataGridView1.ClipboardCopyMode = System.Windows.Forms.DataGridViewClipboardCopyMode.EnableWithAutoHeaderText;
this.advancedDataGridView1.ColumnHeadersBorderStyle = System.Windows.Forms.DataGridViewHeaderBorderStyle.Raised;
this.advancedDataGridView1.ColumnHeadersHeight = 35;
this.advancedDataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.EnableResizing;
this.advancedDataGridView1.ColumnHeadersVisible = true;
this.advancedDataGridView1.EditMode = System.Windows.Forms.DataGridViewEditMode.EditOnKeystrokeOrF2;
this.advancedDataGridView1.EnableHeadersVisualStyles = false;
this.advancedDataGridView1.GridColor = System.Drawing.SystemColors.ControlDark;
this.advancedDataGridView1.ReadOnly = false;
this.advancedDataGridView1.RowHeadersBorderStyle = System.Windows.Forms.DataGridViewHeaderBorderStyle.Raised;
this.advancedDataGridView1.RowHeadersVisible = true;
this.advancedDataGridView1.RowHeadersWidth = 41;
this.advancedDataGridView1.RowHeadersWidthSizeMode = System.Windows.Forms.DataGridViewRowHeadersWidthSizeMode.EnableResizing;
this.advancedDataGridView1.ScrollBars = System.Windows.Forms.ScrollBars.Both;
this.advancedDataGridView1.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.RowHeaderSelect;
this.advancedDataGridView1.ShowCellErrors = true;
this.advancedDataGridView1.ShowCellToolTips = true;
this.advancedDataGridView1.ShowEditingIcon = true;
this.advancedDataGridView1.ShowRowErrors = true;
this.advancedDataGridView1.StandardTab = false;
this.advancedDataGridView1.VirtualMode = false;
this.advancedDataGridView1.Enabled = true;
this.advancedDataGridView1.Margin = new System.Windows.Forms.Padding(3, 3, 3, 3);
this.advancedDataGridView1.TabIndex = 1;
this.advancedDataGridView1.TabStop = true;
this.advancedDataGridView1.Name = "advancedDataGridView1";
this.advancedDataGridView1.Columns.Add(new System.Windows.Forms.DataGridViewTextBoxColumn());
this.advancedDataGridView1.Columns[0].Name = "";
this.advancedDataGridView1.Columns[0].HeaderText = "元件名称";
this.advancedDataGridView1.Columns[0].Width = 100;
this.advancedDataGridView1.Columns[0].Visible = true;
this.advancedDataGridView1.Columns[0].ReadOnly = false;
this.advancedDataGridView1.Columns[0].Frozen = false;
this.advancedDataGridView1.Columns[0].AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.NotSet;
this.advancedDataGridView1.Columns[0].SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
this.advancedDataGridView1.Columns.Add(new System.Windows.Forms.DataGridViewTextBoxColumn());
this.advancedDataGridView1.Columns[1].Name = "";
this.advancedDataGridView1.Columns[1].HeaderText = "单位";
this.advancedDataGridView1.Columns[1].Width = 100;
this.advancedDataGridView1.Columns[1].Visible = true;
this.advancedDataGridView1.Columns[1].ReadOnly = false;
this.advancedDataGridView1.Columns[1].Frozen = false;
this.advancedDataGridView1.Columns[1].AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.NotSet;
this.advancedDataGridView1.Columns[1].SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
this.advancedDataGridView1.Columns.Add(new System.Windows.Forms.DataGridViewTextBoxColumn());
this.advancedDataGridView1.Columns[2].Name = "";
this.advancedDataGridView1.Columns[2].HeaderText = "数量";
this.advancedDataGridView1.Columns[2].Width = 100;
this.advancedDataGridView1.Columns[2].Visible = true;
this.advancedDataGridView1.Columns[2].ReadOnly = false;
this.advancedDataGridView1.Columns[2].Frozen = false;
this.advancedDataGridView1.Columns[2].AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.NotSet;
this.advancedDataGridView1.Columns[2].SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
this.advancedDataGridView1.Columns.Add(new System.Windows.Forms.DataGridViewTextBoxColumn());
this.advancedDataGridView1.Columns[3].Name = "";
this.advancedDataGridView1.Columns[3].HeaderText = "原采购系数";
this.advancedDataGridView1.Columns[3].Width = 100;
this.advancedDataGridView1.Columns[3].Visible = true;
this.advancedDataGridView1.Columns[3].ReadOnly = false;
this.advancedDataGridView1.Columns[3].Frozen = false;
this.advancedDataGridView1.Columns[3].AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.NotSet;
this.advancedDataGridView1.Columns[3].SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
this.advancedDataGridView1.Columns.Add(new System.Windows.Forms.DataGridViewTextBoxColumn());
this.advancedDataGridView1.Columns[4].Name = "";
this.advancedDataGridView1.Columns[4].HeaderText = "新采购系数";
this.advancedDataGridView1.Columns[4].Width = 100;
this.advancedDataGridView1.Columns[4].Visible = true;
this.advancedDataGridView1.Columns[4].ReadOnly = false;
this.advancedDataGridView1.Columns[4].Frozen = false;
this.advancedDataGridView1.Columns[4].AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.NotSet;
this.advancedDataGridView1.Columns[4].SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
this.advancedDataGridView1.Columns.Add(new System.Windows.Forms.DataGridViewTextBoxColumn());
this.advancedDataGridView1.Columns[5].Name = "";
this.advancedDataGridView1.Columns[5].HeaderText = "原报价系数";
this.advancedDataGridView1.Columns[5].Width = 100;
this.advancedDataGridView1.Columns[5].Visible = true;
this.advancedDataGridView1.Columns[5].ReadOnly = false;
this.advancedDataGridView1.Columns[5].Frozen = false;
this.advancedDataGridView1.Columns[5].AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.NotSet;
this.advancedDataGridView1.Columns[5].SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
this.advancedDataGridView1.Columns.Add(new System.Windows.Forms.DataGridViewTextBoxColumn());
this.advancedDataGridView1.Columns[6].Name = "";
this.advancedDataGridView1.Columns[6].HeaderText = "新报价系数";
this.advancedDataGridView1.Columns[6].Width = 100;
this.advancedDataGridView1.Columns[6].Visible = true;
this.advancedDataGridView1.Columns[6].ReadOnly = false;
this.advancedDataGridView1.Columns[6].Frozen = false;
this.advancedDataGridView1.Columns[6].AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.NotSet;
this.advancedDataGridView1.Columns[6].SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
//
// panel1
//
this.panel1.Dock = System.Windows.Forms.DockStyle.Top;
this.panel1.AutoSize = false;
this.panel1.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowOnly;
this.panel1.BorderStyle = System.Windows.Forms.BorderStyle.None;
this.panel1.TabStop = false;
this.panel1.AutoScroll = false;
this.panel1.AutoScrollMargin = new System.Drawing.Size(0, 0);
this.panel1.AutoScrollMinSize = new System.Drawing.Size(0, 0);
this.panel1.BackColor = System.Drawing.SystemColors.Control;
this.panel1.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Tile;
this.panel1.Enabled = true;
this.panel1.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
this.panel1.ForeColor = System.Drawing.SystemColors.ControlText;
this.panel1.Margin = new System.Windows.Forms.Padding(3, 3, 3, 3);
this.panel1.TabIndex = 0;
this.panel1.Size = new System.Drawing.Size(929, 79);
this.panel1.Location = new System.Drawing.Point(0, 0);
this.panel1.Name = "panel1";
//
// button1
//
this.button1.Dock = System.Windows.Forms.DockStyle.None;
this.button1.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowOnly;
this.button1.DialogResult = System.Windows.Forms.DialogResult.None;
this.button1.AutoEllipsis = false;
this.button1.AutoSize = false;
this.button1.BackColor = System.Drawing.SystemColors.Control;
this.button1.FlatStyle = System.Windows.Forms.FlatStyle.Standard;
this.button1.ImageAlign = System.Drawing.ContentAlignment.MiddleCenter;
this.button1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
this.button1.TextImageRelation = System.Windows.Forms.TextImageRelation.Overlay;
this.button1.UseMnemonic = true;
this.button1.UseCompatibleTextRendering = false;
this.button1.UseVisualStyleBackColor = true;
this.button1.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Tile;
this.button1.Enabled = true;
this.button1.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
this.button1.ForeColor = System.Drawing.SystemColors.ControlText;
this.button1.Margin = new System.Windows.Forms.Padding(3, 3, 3, 3);
this.button1.TabIndex = 3;
this.button1.TabStop = true;
this.button1.Size = new System.Drawing.Size(75, 32);
this.button1.Location = new System.Drawing.Point(828, 22);
this.button1.Text = "调整";
this.button1.Name = "button1";
//
// resizableTextBox1
//
this.resizableTextBox1.Dock = System.Windows.Forms.DockStyle.None;
this.resizableTextBox1.MaxLength = 32767;
this.resizableTextBox1.ReadOnly = false;
this.resizableTextBox1.CharacterCasing = System.Windows.Forms.CharacterCasing.Normal;
this.resizableTextBox1.TextAlign = System.Windows.Forms.HorizontalAlignment.Left;
this.resizableTextBox1.BackColor = System.Drawing.Color.White;
this.resizableTextBox1.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Tile;
this.resizableTextBox1.Enabled = true;
this.resizableTextBox1.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
this.resizableTextBox1.ForeColor = System.Drawing.Color.FromArgb(255, 48, 49, 51);
this.resizableTextBox1.Margin = new System.Windows.Forms.Padding(3, 3, 3, 3);
this.resizableTextBox1.TabIndex = 2;
this.resizableTextBox1.TabStop = true;
this.resizableTextBox1.Size = new System.Drawing.Size(58, 32);
this.resizableTextBox1.Location = new System.Drawing.Point(750, 22);
this.resizableTextBox1.Name = "resizableTextBox1";
//
// resizableComboBox1
//
this.resizableComboBox1.Dock = System.Windows.Forms.DockStyle.None;
this.resizableComboBox1.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.resizableComboBox1.MaxDropDownItems = 8;
this.resizableComboBox1.DropDownHeight = 0;
this.resizableComboBox1.IntegralHeight = true;
this.resizableComboBox1.Sorted = false;
this.resizableComboBox1.ArrowHoverColor = System.Drawing.Color.FromArgb(255, 64, 158, 255);
this.resizableComboBox1.BackColor = System.Drawing.Color.White;
this.resizableComboBox1.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Tile;
this.resizableComboBox1.Enabled = true;
this.resizableComboBox1.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
this.resizableComboBox1.ForeColor = System.Drawing.Color.FromArgb(255, 48, 49, 51);
this.resizableComboBox1.Margin = new System.Windows.Forms.Padding(3, 3, 3, 3);
this.resizableComboBox1.TabIndex = 1;
this.resizableComboBox1.TabStop = true;
this.resizableComboBox1.Size = new System.Drawing.Size(160, 32);
this.resizableComboBox1.Location = new System.Drawing.Point(154, 22);
this.resizableComboBox1.Name = "resizableComboBox1";
this.resizableComboBox1.Items.Add("项目");
this.resizableComboBox1.Items.Add("图号");
this.resizableComboBox1.SelectedIndex = 0;
//
// multiSelectComboBox1
//
this.multiSelectComboBox1.Dock = System.Windows.Forms.DockStyle.None;
this.multiSelectComboBox1.MaxDropDownItems = 8;
this.multiSelectComboBox1.DropDownHeight = 0;
this.multiSelectComboBox1.ArrowHoverColor = System.Drawing.Color.FromArgb(255, 64, 158, 255);
this.multiSelectComboBox1.BackColor = System.Drawing.Color.White;
this.multiSelectComboBox1.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Tile;
this.multiSelectComboBox1.Enabled = true;
this.multiSelectComboBox1.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
this.multiSelectComboBox1.ForeColor = System.Drawing.Color.FromArgb(255, 48, 49, 51);
this.multiSelectComboBox1.Margin = new System.Windows.Forms.Padding(3, 3, 3, 3);
this.multiSelectComboBox1.TabIndex = 0;
this.multiSelectComboBox1.TabStop = true;
this.multiSelectComboBox1.Size = new System.Drawing.Size(126, 32);
this.multiSelectComboBox1.Location = new System.Drawing.Point(12, 22);
this.multiSelectComboBox1.Text = "元件";
this.multiSelectComboBox1.Name = "multiSelectComboBox1";
this.multiSelectComboBox1.Items.Add("元件");
this.multiSelectComboBox1.Items.Add("壳体");
this.multiSelectComboBox1.Items.Add("母排");
//
// resizableComboBox2
//
this.resizableComboBox2.Dock = System.Windows.Forms.DockStyle.None;
this.resizableComboBox2.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.resizableComboBox2.MaxDropDownItems = 8;
this.resizableComboBox2.DropDownHeight = 0;
this.resizableComboBox2.IntegralHeight = true;
this.resizableComboBox2.Sorted = false;
this.resizableComboBox2.ArrowHoverColor = System.Drawing.Color.FromArgb(255, 64, 158, 255);
this.resizableComboBox2.BackColor = System.Drawing.Color.White;
this.resizableComboBox2.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Tile;
this.resizableComboBox2.Enabled = true;
this.resizableComboBox2.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
this.resizableComboBox2.ForeColor = System.Drawing.Color.FromArgb(255, 48, 49, 51);
this.resizableComboBox2.Margin = new System.Windows.Forms.Padding(3, 3, 3, 3);
this.resizableComboBox2.TabIndex = 1;
this.resizableComboBox2.TabStop = true;
this.resizableComboBox2.Size = new System.Drawing.Size(160, 32);
this.resizableComboBox2.Location = new System.Drawing.Point(323, 22);
this.resizableComboBox2.Name = "resizableComboBox2";
//
// resizableComboBox3
//
this.resizableComboBox3.Dock = System.Windows.Forms.DockStyle.None;
this.resizableComboBox3.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.resizableComboBox3.MaxDropDownItems = 8;
this.resizableComboBox3.DropDownHeight = 0;
this.resizableComboBox3.IntegralHeight = true;
this.resizableComboBox3.Sorted = false;
this.resizableComboBox3.ArrowHoverColor = System.Drawing.Color.FromArgb(255, 64, 158, 255);
this.resizableComboBox3.BackColor = System.Drawing.Color.White;
this.resizableComboBox3.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Tile;
this.resizableComboBox3.Enabled = true;
this.resizableComboBox3.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
this.resizableComboBox3.ForeColor = System.Drawing.Color.FromArgb(255, 48, 49, 51);
this.resizableComboBox3.Margin = new System.Windows.Forms.Padding(3, 3, 3, 3);
this.resizableComboBox3.TabIndex = 1;
this.resizableComboBox3.TabStop = true;
this.resizableComboBox3.Size = new System.Drawing.Size(100, 32);
this.resizableComboBox3.Location = new System.Drawing.Point(538, 22);
this.resizableComboBox3.Text = "报价系数";
this.resizableComboBox3.Name = "resizableComboBox3";
this.resizableComboBox3.Items.Add("采购系数");
this.resizableComboBox3.Items.Add("报价系数");
this.resizableComboBox3.SelectedIndex = 1;
//
// resizableComboBox4
//
this.resizableComboBox4.Dock = System.Windows.Forms.DockStyle.None;
this.resizableComboBox4.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.resizableComboBox4.MaxDropDownItems = 8;
this.resizableComboBox4.DropDownHeight = 0;
this.resizableComboBox4.IntegralHeight = true;
this.resizableComboBox4.Sorted = false;
this.resizableComboBox4.ArrowHoverColor = System.Drawing.Color.FromArgb(255, 64, 158, 255);
this.resizableComboBox4.BackColor = System.Drawing.Color.White;
this.resizableComboBox4.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Tile;
this.resizableComboBox4.Enabled = true;
this.resizableComboBox4.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
this.resizableComboBox4.ForeColor = System.Drawing.Color.FromArgb(255, 48, 49, 51);
this.resizableComboBox4.Margin = new System.Windows.Forms.Padding(3, 3, 3, 3);
this.resizableComboBox4.TabIndex = 1;
this.resizableComboBox4.TabStop = true;
this.resizableComboBox4.Size = new System.Drawing.Size(71, 32);
this.resizableComboBox4.Location = new System.Drawing.Point(658, 22);
this.resizableComboBox4.Text = "等于";
this.resizableComboBox4.Name = "resizableComboBox4";
this.resizableComboBox4.Items.Add("等于");
this.resizableComboBox4.Items.Add("加");
this.resizableComboBox4.Items.Add("减");
this.resizableComboBox4.SelectedIndex = 0;
// 调系数
this.Controls.AddRange(new System.Windows.Forms.Control[] {
this.advancedDataGridView1,
this.panel1,
});
// panel1
this.panel1.Controls.AddRange(new System.Windows.Forms.Control[] {
this.button1,
this.resizableTextBox1,
this.resizableComboBox1,
this.multiSelectComboBox1,
this.resizableComboBox2,
this.resizableComboBox3,
this.resizableComboBox4,
});
//
// 调系数
//
this.Dock = System.Windows.Forms.DockStyle.None;
this.AutoScroll = false;
this.AutoSize = false;
this.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowOnly;
this.AutoValidate = System.Windows.Forms.AutoValidate.EnablePreventFocusChange;
this.BackColor = System.Drawing.Color.White;
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.Sizable;
this.ControlBox = true;
this.HelpButton = false;
this.IsMdiContainer = false;
this.KeyPreview = false;
this.MaximumSize = new System.Drawing.Size(0, 0);
this.MinimumSize = new System.Drawing.Size(0, 0);
this.MaximizeBox = true;
this.MinimizeBox = true;
this.Opacity = 1;
this.RightToLeftLayout = false;
this.ShowInTaskbar = true;
this.ShowIcon = true;
this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Auto;
this.StartPosition = System.Windows.Forms.FormStartPosition.WindowsDefaultLocation;
this.TopMost = false;
this.WindowState = System.Windows.Forms.FormWindowState.Normal;
this.AutoScrollMargin = new System.Drawing.Size(0, 0);
this.AutoScrollMinSize = new System.Drawing.Size(0, 0);
this.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Tile;
this.Enabled = true;
this.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
this.ForeColor = System.Drawing.SystemColors.ControlText;
this.Padding = new System.Windows.Forms.Padding(0, 0, 0, 0);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
this.Size = new System.Drawing.Size(945, 684);
this.Text = "调系数";
this.Name = "调系数";
((System.ComponentModel.ISupportInitialize)(this.advancedDataGridView1)).EndInit();
this.ResumeLayout(false);
this.PerformLayout();
// === DataGridView Excel 风格选中效果 ===
}
#endregion
private Smart.CustomComponents.EnhancedDataGridView advancedDataGridView1;
private System.Windows.Forms.Panel panel1;
private System.Windows.Forms.Button button1;
private Smart.CustomComponents.ResizableTextBox resizableTextBox1;
private Smart.CustomComponents.ResizableComboBox resizableComboBox1;
private Smart.CustomComponents.MultiSelectComboBox multiSelectComboBox1;
private Smart.CustomComponents.ResizableComboBox resizableComboBox2;
private Smart.CustomComponents.ResizableComboBox resizableComboBox3;
private Smart.CustomComponents.ResizableComboBox resizableComboBox4;
}
}
+529
View File
@@ -0,0 +1,529 @@
using System;
using System.Collections.Generic;
using System.Data;
using System.Globalization;
using System.IO;
using System.Windows.Forms;
using System.Data.SQLite;
using Smart.CustomComponents;
namespace 成套报价软件
{
/// <summary>
/// 调系数 的交互逻辑(事件处理)。
/// UI 布局定义见 调系数.ui.cs。
/// 本窗体作为 MainForm 的对话框使用,故不含独立的 Main 入口点。
///
/// 功能:批量修改元件表中的"采购系数"和"报出系数"。
/// - multiSelectComboBox1:多选元件类型(元件/壳体/母排),只显示/修改所选类型
/// - resizableComboBox1:调整范围(项目/图号)
/// - resizableComboBox2:图号列表(范围=图号时启用)
/// - resizableComboBox3:选择要修改的系数(采购系数/报价系数)
/// - resizableComboBox4:修改方法(等于/加/减)
/// - resizableTextBox1:输入数值
/// - button1:启动调整
/// </summary>
public partial class 调系数
{
// ====== 常量 ======
/// <summary>图号表名(与主窗口一致)。</summary>
private const string TuhaoTableName = "advancedDataGridView9Table";
// ====== 字段 ======
/// <summary>当前项目编号(主窗口传入)。</summary>
private string _projectId;
/// <summary>当前项目的报价库绝对路径。</summary>
private string _quoteDbPath;
/// <summary>内存中的全部元件行(已按当前类型筛选)。</summary>
private readonly List<YuanjianRow> _allRows = new List<YuanjianRow>();
// ====== 内部数据结构 ======
/// <summary>元件表一行的内存表示(含定位信息,用于回写数据库)。</summary>
private class YuanjianRow
{
public string Tuhao; // 所属图号
public string Xianghao; // 所属箱号
public string RealTableName; // 该箱号元件表的真实表名(SQLite 表名)
public long RowId; // 在元件表中的 rowid
public string Name; // 元件名称
public string Unit; // 单位
public string Count; // 数量
public string CaiGouXishu; // 原采购系数
public string BaoChuXishu; // 原报出系数
public string Leixing; // 类型
}
// ====== 构造函数 ======
/// <summary>无参构造函数(设计器/独立测试用,不绑定业务逻辑)。</summary>
public 调系数()
{
InitializeComponent();
}
/// <summary>
/// 带项目编号的构造函数(主窗口调用此版本)。
/// 传入后窗体在 Load 时会从该项目的报价库加载数据。
/// </summary>
/// <param name="projectId">当前项目编号。</param>
public 调系数(string projectId)
{
InitializeComponent();
_projectId = projectId;
_quoteDbPath = GetQuoteDbPath(projectId);
this.Load += 调系数_Load;
this.multiSelectComboBox1.SelectedItemsChanged += multiSelectComboBox1_SelectedIndexChanged;
this.resizableComboBox1.SelectedIndexChanged += resizableComboBox1_SelectedIndexChanged;
this.resizableComboBox2.SelectedIndexChanged += resizableComboBox2_SelectedIndexChanged;
this.resizableComboBox3.SelectedIndexChanged += OnPreviewChanged;
this.resizableComboBox4.SelectedIndexChanged += OnPreviewChanged;
this.resizableTextBox1.TextChanged += OnPreviewChanged;
this.button1.Click += button1_Click;
}
// ====== 窗体事件 ======
private void 调系数_Load(object sender, EventArgs e)
{
// 默认勾选"元件"(用户最常用)
if (this.multiSelectComboBox1.Items.Count > 0)
// multiSelectComboBox 默认不选中
// 默认范围=项目,resizableComboBox2 禁用
this.resizableComboBox2.Enabled = false;
// 表格只读(只用于预览,不能直接编辑)
this.advancedDataGridView1.ReadOnly = true;
this.advancedDataGridView1.AllowUserToAddRows = false;
this.advancedDataGridView1.AllowUserToDeleteRows = false;
this.advancedDataGridView1.SelectionMode = DataGridViewSelectionMode.CellSelect;
// 加载数据
ReloadData();
}
/// <summary>multiSelectComboBox1 选择变化:重新加载表格数据(按所选类型筛选)。</summary>
private void multiSelectComboBox1_SelectedIndexChanged(object sender, EventArgs e)
{
// SelectedItemsChanged 在多选场景下会触发多次,用 BeginInvoke 合并到 UI 空闲时执行
this.BeginInvoke((Action)ReloadData);
}
/// <summary>resizableComboBox1 选择变化:切换"项目/图号"模式。</summary>
private void resizableComboBox1_SelectedIndexChanged(object sender, EventArgs e)
{
string scope = this.resizableComboBox1.Text;
if (scope == "图号")
{
this.resizableComboBox2.Enabled = true;
LoadTuhaoList();
}
else
{
this.resizableComboBox2.Enabled = false;
this.resizableComboBox2.Items.Clear();
ReloadData();
}
}
/// <summary>resizableComboBox2 选择变化:加载指定图号的数据。</summary>
private void resizableComboBox2_SelectedIndexChanged(object sender, EventArgs e)
{
if (!this.resizableComboBox2.Enabled) return;
ReloadData();
}
/// <summary>修改规则变化(系数类型/方法/数值):只刷新"新系数"列预览,不写库。</summary>
private void OnPreviewChanged(object sender, EventArgs e)
{
RefreshPreviewColumns();
}
// ====== button1:启动调整 ======
private void button1_Click(object sender, EventArgs e)
{
if (_allRows.Count == 0)
{
MessageBox.Show(this, "没有可调整的数据,请先选择类型和范围。",
"调系数", MessageBoxButtons.OK, MessageBoxIcon.Information);
return;
}
// 解析输入数值
string numStr = this.resizableTextBox1.Text.Trim();
double numVal;
if (!double.TryParse(numStr, NumberStyles.Any, CultureInfo.InvariantCulture, out numVal) &&
!double.TryParse(numStr, NumberStyles.Any, CultureInfo.CurrentCulture, out numVal))
{
MessageBox.Show(this, "请输入有效的数字。", "调系数",
MessageBoxButtons.OK, MessageBoxIcon.Warning);
this.resizableTextBox1.Focus();
return;
}
string xishu = this.resizableComboBox3.Text; // 采购系数 / 报价系数
string method = this.resizableComboBox4.Text; // 等于 / 加 / 减
string colName = (xishu == "采购系数") ? "采购系数" : "报出系数";
// 二次确认
string scope = this.resizableComboBox1.Text;
string tuhaoInfo = (scope == "图号")
? "图号[" + this.resizableComboBox2.Text + "]"
: "整个项目";
string typeInfo = string.Join("/", GetSelectedTypes());
if (typeInfo == "") typeInfo = "(未选类型)";
string msg = string.Format(
"将调整 {0} 内所有类型为 [{1}] 的元件行\n" +
"调整对象:{2}\n调整方法:{3} {4}\n\n确认继续?",
tuhaoInfo, typeInfo, colName, method, numStr);
if (MessageBox.Show(this, msg, "调系数确认",
MessageBoxButtons.OKCancel, MessageBoxIcon.Question) != DialogResult.OK)
return;
// 写回数据库
int affected = 0;
try
{
if (!File.Exists(_quoteDbPath))
{
MessageBox.Show(this, "报价库不存在:" + _quoteDbPath, "调系数",
MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
using (var conn = new SQLiteConnection(GetConnString(_quoteDbPath)))
{
conn.Open();
using (var tx = conn.BeginTransaction())
{
// 按 RealTableName 分组,减少重复 SQL 解析
var groups = new Dictionary<string, List<YuanjianRow>>();
foreach (var r in _allRows)
{
if (string.IsNullOrEmpty(r.RealTableName)) continue;
if (!groups.ContainsKey(r.RealTableName))
groups[r.RealTableName] = new List<YuanjianRow>();
groups[r.RealTableName].Add(r);
}
foreach (var kv in groups)
{
string tbl = "\"" + kv.Key + "\"";
string sql = "UPDATE " + tbl +
" SET " + colName + " = @v WHERE rowid = @rid;";
using (var cmd = new SQLiteCommand(sql, conn, tx))
{
cmd.Parameters.Add("@v", DbType.String);
cmd.Parameters.Add("@rid", DbType.Int64);
foreach (var r in kv.Value)
{
double oldVal = ParseXishu(r.CaiGouXishu, r.BaoChuXishu, colName);
double newVal = ApplyMethod(oldVal, method, numVal);
cmd.Parameters["@v"].Value = newVal.ToString("0.######", CultureInfo.InvariantCulture);
cmd.Parameters["@rid"].Value = r.RowId;
affected += cmd.ExecuteNonQuery();
}
}
}
tx.Commit();
}
}
MessageBox.Show(this, "调整完成,共更新 " + affected + " 条记录。", "调系数",
MessageBoxButtons.OK, MessageBoxIcon.Information);
}
catch (Exception ex)
{
MessageBox.Show(this, "调整失败:" + ex.Message, "调系数",
MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
// 重新加载数据(刷新原系数列)
ReloadData();
}
// ====== 数据加载 ======
/// <summary>根据当前选择重新加载表格数据。</summary>
private void ReloadData()
{
_allRows.Clear();
this.advancedDataGridView1.Rows.Clear();
if (string.IsNullOrEmpty(_projectId) || !File.Exists(_quoteDbPath))
return;
var selTypes = GetSelectedTypes();
if (selTypes.Count == 0) return;
string scope = this.resizableComboBox1.Text;
string targetTuhao = null;
if (scope == "图号")
{
targetTuhao = this.resizableComboBox2.Text;
if (string.IsNullOrEmpty(targetTuhao)) return;
}
try
{
using (var conn = new SQLiteConnection(GetConnString(_quoteDbPath)))
{
conn.Open();
// 取所有图号名
var tuhaoList = new List<string>();
if (targetTuhao != null)
{
tuhaoList.Add(targetTuhao);
}
else
{
string sqlTh = "SELECT 图号 FROM " + TuhaoTableName + " ORDER BY rowid;";
using (var cmd = new SQLiteCommand(sqlTh, conn))
using (var rdr = cmd.ExecuteReader())
{
while (rdr.Read())
{
string t = rdr.IsDBNull(0) ? "" : rdr.GetValue(0).ToString();
if (!string.IsNullOrEmpty(t)) tuhaoList.Add(t);
}
}
}
foreach (var th in tuhaoList)
{
// 取该图号的箱号表真实表名
string xhTbl = LookupTableByIndex(conn, "箱号", th, "");
if (string.IsNullOrEmpty(xhTbl)) continue;
// 取该图号的所有箱号
var xhList = new List<string>();
try
{
string sqlXh = "SELECT 箱号 FROM \"" + xhTbl + "\" ORDER BY rowid;";
using (var cmd = new SQLiteCommand(sqlXh, conn))
using (var rdr = cmd.ExecuteReader())
{
while (rdr.Read())
{
string x = rdr.IsDBNull(0) ? "" : rdr.GetValue(0).ToString();
if (!string.IsNullOrEmpty(x)) xhList.Add(x);
}
}
}
catch { continue; }
foreach (var xh in xhList)
{
string yjTbl = LookupTableByIndex(conn, "元件", th, xh);
if (string.IsNullOrEmpty(yjTbl)) continue;
try
{
string sqlYj = "SELECT rowid, 元件名称, 单位, 数量, 采购系数, 报出系数, 类型 " +
"FROM \"" + yjTbl + "\" ORDER BY rowid;";
using (var cmd = new SQLiteCommand(sqlYj, conn))
using (var rdr = cmd.ExecuteReader())
{
while (rdr.Read())
{
string leixing = rdr.IsDBNull(6) ? "" : rdr.GetValue(6).ToString();
// 只保留所选类型
if (!selTypes.Contains(leixing)) continue;
var r = new YuanjianRow();
r.Tuhao = th;
r.Xianghao = xh;
r.RealTableName = yjTbl;
r.RowId = rdr.GetInt64(0);
r.Name = rdr.IsDBNull(1) ? "" : rdr.GetValue(1).ToString();
r.Unit = rdr.IsDBNull(2) ? "" : rdr.GetValue(2).ToString();
r.Count = rdr.IsDBNull(3) ? "" : rdr.GetValue(3).ToString();
r.CaiGouXishu = rdr.IsDBNull(4) ? "" : rdr.GetValue(4).ToString();
r.BaoChuXishu = rdr.IsDBNull(5) ? "" : rdr.GetValue(5).ToString();
r.Leixing = leixing;
_allRows.Add(r);
}
}
}
catch { }
}
}
}
// 填充表格(按图号→箱号顺序,顺序与 _allRows 一致)
this.advancedDataGridView1.RowCount = 0;
foreach (var r in _allRows)
{
int idx = this.advancedDataGridView1.Rows.Add();
var row = this.advancedDataGridView1.Rows[idx];
row.Cells[0].Value = r.Name;
row.Cells[1].Value = r.Unit;
row.Cells[2].Value = r.Count;
row.Cells[3].Value = r.CaiGouXishu;
row.Cells[4].Value = ""; // 新采购系数(预览)
row.Cells[5].Value = r.BaoChuXishu;
row.Cells[6].Value = ""; // 新报价系数(预览)
row.Tag = r;
}
// 计算预览列
RefreshPreviewColumns();
}
catch (Exception ex)
{
MessageBox.Show(this, "加载数据失败:" + ex.Message, "调系数",
MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
/// <summary>刷新"新采购系数/新报价系数"两列的预览值(根据当前规则不写库)。</summary>
private void RefreshPreviewColumns()
{
string xishu = this.resizableComboBox3.Text;
string method = this.resizableComboBox4.Text;
string numStr = this.resizableTextBox1.Text.Trim();
double numVal;
bool okNum = double.TryParse(numStr, NumberStyles.Any, CultureInfo.InvariantCulture, out numVal) ||
double.TryParse(numStr, NumberStyles.Any, CultureInfo.CurrentCulture, out numVal);
bool modifyCaiGou = (xishu == "采购系数");
bool modifyBaoChu = (xishu == "报价系数");
for (int i = 0; i < this.advancedDataGridView1.Rows.Count; i++)
{
var row = this.advancedDataGridView1.Rows[i];
var r = row.Tag as YuanjianRow;
if (r == null) continue;
// 新采购系数列
if (modifyCaiGou && okNum)
{
double oldVal = ParseXishu(r.CaiGouXishu, r.BaoChuXishu, "采购系数");
row.Cells[4].Value = ApplyMethod(oldVal, method, numVal)
.ToString("0.######", CultureInfo.InvariantCulture);
}
else
{
row.Cells[4].Value = r.CaiGouXishu;
}
// 新报价系数列
if (modifyBaoChu && okNum)
{
double oldVal = ParseXishu(r.CaiGouXishu, r.BaoChuXishu, "报出系数");
row.Cells[6].Value = ApplyMethod(oldVal, method, numVal)
.ToString("0.######", CultureInfo.InvariantCulture);
}
else
{
row.Cells[6].Value = r.BaoChuXishu;
}
}
}
/// <summary>把所有图号加载到 resizableComboBox2。</summary>
private void LoadTuhaoList()
{
this.resizableComboBox2.Items.Clear();
if (string.IsNullOrEmpty(_projectId) || !File.Exists(_quoteDbPath)) return;
try
{
using (var conn = new SQLiteConnection(GetConnString(_quoteDbPath)))
{
conn.Open();
string sql = "SELECT 图号 FROM " + TuhaoTableName + " ORDER BY rowid;";
using (var cmd = new SQLiteCommand(sql, conn))
using (var rdr = cmd.ExecuteReader())
{
while (rdr.Read())
{
string t = rdr.IsDBNull(0) ? "" : rdr.GetValue(0).ToString();
if (!string.IsNullOrEmpty(t)) this.resizableComboBox2.Items.Add(t);
}
}
}
if (this.resizableComboBox2.Items.Count > 0)
this.resizableComboBox2.SelectedIndex = 0;
else
ReloadData();
}
catch { }
}
// ====== 辅助方法 ======
/// <summary>获取 multiSelectComboBox1 选中的类型列表(元件/壳体/母排)。</summary>
private List<string> GetSelectedTypes()
{
var result = new List<string>();
var valsList = this.multiSelectComboBox1.SelectedValues;
if (valsList != null) foreach (var v in valsList) if (!string.IsNullOrEmpty(v)) result.Add(v);
return result;
}
/// <summary>根据系数列名从行中解析原系数值(空值当 1.0)。</summary>
private double ParseXishu(string caiGou, string baoChu, string colName)
{
string s = (colName == "采购系数") ? caiGou : baoChu;
double d;
if (double.TryParse(s, NumberStyles.Any, CultureInfo.InvariantCulture, out d)) return d;
if (double.TryParse(s, NumberStyles.Any, CultureInfo.CurrentCulture, out d)) return d;
return 1.0; // 默认值
}
/// <summary>按"等于/加/减"方法应用数值。</summary>
private double ApplyMethod(double oldVal, string method, double numVal)
{
switch (method)
{
case "加": return oldVal + numVal;
case "减": return oldVal - numVal;
case "等于":
default: return numVal;
}
}
private string GetQuoteDbPath(string projectId)
{
string safeName = projectId;
foreach (char c in Path.GetInvalidFileNameChars())
safeName = safeName.Replace(c, '_');
return Path.Combine(AppDomain.CurrentDomain.BaseDirectory, @"sjk\bjb\项目" + safeName + ".db");
}
private string GetConnString(string dbPath)
{
return "Data Source=" + dbPath + ";Version=3;";
}
/// <summary>查表索引(复用连接版本)。</summary>
private string LookupTableByIndex(SQLiteConnection conn, string type,
string tuhao, string xianghao)
{
if (conn == null || string.IsNullOrEmpty(tuhao)) return "";
try
{
string sql = "SELECT 实际表名 FROM 表索引 WHERE 类型=@t AND 图号=@th AND 箱号=@xh LIMIT 1;";
using (var cmd = new SQLiteCommand(sql, conn))
{
cmd.Parameters.AddWithValue("@t", type);
cmd.Parameters.AddWithValue("@th", tuhao);
cmd.Parameters.AddWithValue("@xh", xianghao ?? "");
object o = cmd.ExecuteScalar();
return (o == null || o == DBNull.Value) ? "" : o.ToString();
}
}
catch { return ""; }
}
}
}
+288
View File
@@ -0,0 +1,288 @@
namespace 成套报价软件
{
/// <summary>
/// 费用模板 窗口布局(SD 设计器可打开微调)。
/// 控件:dgv模板(模板列表)/txt名称/cbo方式/cbo计入/txt数值(编辑区)
/// btn新增/btn修改/btn删除/btn应用/btn清空费用。
/// 事件在 InitializeComponent 内挂接,处理器方法与业务逻辑在 费用模板.cs(2026-10-01 G1-1)。
/// </summary>
partial class 费用模板 : System.Windows.Forms.Form
{
/// <summary>必需的设计器变量。</summary>
private System.ComponentModel.IContainer components = null;
/// <summary>清理正在使用的资源。</summary>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows 窗体设计器生成的代码
/// <summary>设计器支持所需的方法。</summary>
private void InitializeComponent()
{
this.dgv模板 = new System.Windows.Forms.DataGridView();
this.col启用 = new System.Windows.Forms.DataGridViewCheckBoxColumn();
this.col名称 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.col方式 = new System.Windows.Forms.DataGridViewComboBoxColumn();
this.col数值 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.btn新增 = new System.Windows.Forms.Button();
this.btn修改 = new System.Windows.Forms.Button();
this.txt名称 = new System.Windows.Forms.TextBox();
this.lbl名称 = new System.Windows.Forms.Label();
this.cbo方式 = new System.Windows.Forms.ComboBox();
this.lbl方式 = new System.Windows.Forms.Label();
this.txt数值 = new System.Windows.Forms.TextBox();
this.lbl数值 = new System.Windows.Forms.Label();
this.btn删除 = new System.Windows.Forms.Button();
this.btn清空费用 = new System.Windows.Forms.Button();
this.btn应用 = new System.Windows.Forms.Button();
this.lbl说明 = new System.Windows.Forms.Label();
// ★ 2026-10-01 修复:col计入/cbo计入/lbl计入 已删——"仅报出"在公式链(报出单价=采购单价×
// 报出系数)下数学不成立,费用固定"采购+报出"双向计入
((System.ComponentModel.ISupportInitialize)(this.dgv模板)).BeginInit();
this.groupBox1.SuspendLayout();
this.SuspendLayout();
//
// dgv模板
//
this.dgv模板.AllowUserToAddRows = false;
this.dgv模板.AllowUserToDeleteRows = false;
this.dgv模板.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.dgv模板.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.dgv模板.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
this.col启用,
this.col名称,
this.col方式,
this.col数值});
this.dgv模板.Location = new System.Drawing.Point(12, 12);
this.dgv模板.MultiSelect = false;
this.dgv模板.Name = "dgv模板";
this.dgv模板.ReadOnly = true;
this.dgv模板.RowHeadersVisible = false;
this.dgv模板.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
this.dgv模板.Size = new System.Drawing.Size(660, 240);
this.dgv模板.TabIndex = 0;
this.dgv模板.SelectionChanged += new System.EventHandler(this.dgv模板_SelectionChanged);
this.dgv模板.DataError += new System.Windows.Forms.DataGridViewDataErrorEventHandler(this.dgv模板_DataError);
//
// col启用
//
this.col启用.HeaderText = "启用";
this.col启用.Name = "col启用";
this.col启用.ReadOnly = true;
this.col启用.Width = 45;
//
// col名称
//
this.col名称.HeaderText = "费用名称";
this.col名称.Name = "col名称";
this.col名称.ReadOnly = true;
this.col名称.Width = 150;
//
// col方式
//
this.col方式.HeaderText = "计算方式";
this.col方式.Items.AddRange(new object[] {
"固定金额(每柜)",
"元件采购价×%",
"元件报出价×%"});
this.col方式.Name = "col方式";
this.col方式.ReadOnly = true;
this.col方式.Width = 150;
//
// col数值
//
this.col数值.HeaderText = "数值";
this.col数值.Name = "col数值";
this.col数值.ReadOnly = true;
//
// groupBox1
//
this.groupBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.groupBox1.Controls.Add(this.txt数值);
this.groupBox1.Controls.Add(this.lbl数值);
this.groupBox1.Controls.Add(this.cbo方式);
this.groupBox1.Controls.Add(this.lbl方式);
this.groupBox1.Controls.Add(this.txt名称);
this.groupBox1.Controls.Add(this.lbl名称);
this.groupBox1.Controls.Add(this.btn新增);
this.groupBox1.Controls.Add(this.btn修改);
this.groupBox1.Location = new System.Drawing.Point(12, 258);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(660, 100);
this.groupBox1.TabIndex = 1;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "编辑(先在上方列表选中一行再改,或直接填新值点新增)";
//
// btn新增
//
this.btn新增.Location = new System.Drawing.Point(545, 20);
this.btn新增.Name = "btn新增";
this.btn新增.Size = new System.Drawing.Size(96, 28);
this.btn新增.TabIndex = 4;
this.btn新增.Text = "新增";
this.btn新增.UseVisualStyleBackColor = true;
this.btn新增.Click += new System.EventHandler(this.btn新增_Click);
//
// btn修改
//
this.btn修改.Location = new System.Drawing.Point(545, 54);
this.btn修改.Name = "btn修改";
this.btn修改.Size = new System.Drawing.Size(96, 28);
this.btn修改.TabIndex = 5;
this.btn修改.Text = "修改选中";
this.btn修改.UseVisualStyleBackColor = true;
this.btn修改.Click += new System.EventHandler(this.btn修改_Click);
//
// txt名称
//
this.txt名称.Location = new System.Drawing.Point(116, 26);
this.txt名称.Name = "txt名称";
this.txt名称.Size = new System.Drawing.Size(180, 24);
this.txt名称.TabIndex = 0;
//
// lbl名称
//
this.lbl名称.AutoSize = true;
this.lbl名称.Location = new System.Drawing.Point(54, 29);
this.lbl名称.Name = "lbl名称";
this.lbl名称.Size = new System.Drawing.Size(56, 17);
this.lbl名称.TabIndex = 0;
this.lbl名称.Text = "名称:";
//
// cbo方式
//
this.cbo方式.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cbo方式.FormattingEnabled = true;
this.cbo方式.Items.AddRange(new object[] {
"固定金额(每柜)",
"元件采购价×%",
"元件报出价×%"});
this.cbo方式.Location = new System.Drawing.Point(116, 60);
this.cbo方式.Name = "cbo方式";
this.cbo方式.Size = new System.Drawing.Size(180, 25);
this.cbo方式.TabIndex = 2;
//
// lbl方式
//
this.lbl方式.AutoSize = true;
this.lbl方式.Location = new System.Drawing.Point(54, 63);
this.lbl方式.Name = "lbl方式";
this.lbl方式.Size = new System.Drawing.Size(56, 17);
this.lbl方式.TabIndex = 0;
this.lbl方式.Text = "方式:";
//
// txt数值
//
this.txt数值.Location = new System.Drawing.Point(400, 60);
this.txt数值.Name = "txt数值";
this.txt数值.Size = new System.Drawing.Size(100, 24);
this.txt数值.TabIndex = 3;
//
// lbl数值
//
this.lbl数值.AutoSize = true;
this.lbl数值.Location = new System.Drawing.Point(338, 63);
this.lbl数值.Name = "lbl数值";
this.lbl数值.Size = new System.Drawing.Size(56, 17);
this.lbl数值.TabIndex = 2;
this.lbl数值.Text = "数值:";
//
// btn删除
//
this.btn删除.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.btn删除.Location = new System.Drawing.Point(116, 375);
this.btn删除.Name = "btn删除";
this.btn删除.Size = new System.Drawing.Size(96, 30);
this.btn删除.TabIndex = 6;
this.btn删除.Text = "删除选中";
this.btn删除.UseVisualStyleBackColor = true;
this.btn删除.Click += new System.EventHandler(this.btn删除_Click);
//
// btn清空费用
//
this.btn清空费用.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.btn清空费用.Location = new System.Drawing.Point(228, 375);
this.btn清空费用.Name = "btn清空费用";
this.btn清空费用.Size = new System.Drawing.Size(120, 30);
this.btn清空费用.TabIndex = 7;
this.btn清空费用.Text = "清空项目费用行";
this.btn清空费用.UseVisualStyleBackColor = true;
this.btn清空费用.Click += new System.EventHandler(this.btn清空费用_Click);
//
// btn应用
//
this.btn应用.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.btn应用.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btn应用.Location = new System.Drawing.Point(544, 375);
this.btn应用.Name = "btn应用";
this.btn应用.Size = new System.Drawing.Size(128, 30);
this.btn应用.TabIndex = 8;
this.btn应用.Text = "应用到当前项目";
this.btn应用.UseVisualStyleBackColor = true;
this.btn应用.Click += new System.EventHandler(this.btn应用_Click);
//
// lbl说明
//
this.lbl说明.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.lbl说明.ForeColor = System.Drawing.Color.Gray;
this.lbl说明.Location = new System.Drawing.Point(12, 375);
this.lbl说明.Name = "lbl说明";
this.lbl说明.Size = new System.Drawing.Size(100, 30);
this.lbl说明.TabIndex = 9;
this.lbl说明.Text = "操作:";
this.lbl说明.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// 费用模板
//
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 17F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(684, 417);
this.Controls.Add(this.btn清空费用);
this.Controls.Add(this.btn删除);
this.Controls.Add(this.btn应用);
this.Controls.Add(this.lbl说明);
this.Controls.Add(this.groupBox1);
this.Controls.Add(this.dgv模板);
this.MinimumSize = new System.Drawing.Size(700, 456);
this.Name = "费用模板";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "模板费用 — 费用行按公式计入各箱号合计";
((System.ComponentModel.ISupportInitialize)(this.dgv模板)).EndInit();
this.groupBox1.ResumeLayout(false);
this.groupBox1.PerformLayout();
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.DataGridView dgv模板;
private System.Windows.Forms.DataGridViewCheckBoxColumn col启用;
private System.Windows.Forms.DataGridViewTextBoxColumn col名称;
private System.Windows.Forms.DataGridViewComboBoxColumn col方式;
private System.Windows.Forms.DataGridViewTextBoxColumn col数值;
private System.Windows.Forms.GroupBox groupBox1;
private System.Windows.Forms.Button btn新增;
private System.Windows.Forms.Button btn修改;
private System.Windows.Forms.TextBox txt名称;
private System.Windows.Forms.Label lbl名称;
private System.Windows.Forms.ComboBox cbo方式;
private System.Windows.Forms.Label lbl方式;
private System.Windows.Forms.TextBox txt数值;
private System.Windows.Forms.Label lbl数值;
private System.Windows.Forms.Button btn删除;
private System.Windows.Forms.Button btn清空费用;
private System.Windows.Forms.Button btn应用;
private System.Windows.Forms.Label lbl说明;
}
}
+247
View File
@@ -0,0 +1,247 @@
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Text;
using System.Windows.Forms;
namespace 成套报价软件
{
/// <summary>
/// 费用模板 的交互逻辑(2026-10-01 G1-1):
/// 维护"费用模板"列表(名称/计算方式/数值/计入),点「应用到当前项目」把启用模板
/// 换算成"费用行"写入当前项目每个箱号的元件表(类型='费用',参与箱号/图号/项目聚合,
/// 与普通元件走同一套报价公式,重算稳定)。
/// 计算方式:固定金额(每柜)=数值;元件采购价×%=该箱号非费用元件采购价合计×数值%;
/// 元件报出价×%=非费用元件报出价合计×数值%。
/// 计入:采购+报出(采购系数=1)/仅报出(采购系数=0,成本不含此费用)。
/// 模板存储:exe\sjk\费用模板.xml(全局,与项目无关)。
/// 布局在 费用模板.Designer.cs。
/// </summary>
public partial class 费用模板 : Form
{
private readonly MainForm _主窗;
/// <summary>一条费用模板。
/// ★ 计入维度已删(2026-10-01 修复):费用固定"采购+报出"双向计入——公式链
/// 报出单价=采购单价×报出系数 决定了"仅报出"(采购系数=0)会把报出价也清零,
/// 数学上不成立;辅料/人工/成套费本就应进成本,"只抬报价"请用「调系数」。</summary>
public class 模板行
{
public bool 启用 = true;
public string 名称 = "";
public string 方式 = "固定金额(每柜)"; // 固定金额(每柜)/元件采购价×%/元件报出价×%
public decimal 数值 = 0m;
}
public 费用模板(MainForm 主窗)
{
InitializeComponent();
_主窗 = 主窗;
Load模板();
刷列表();
// ★ 事件挂接在 Designer.cs(SD 设计器可见可编辑,铁律:Designer.cs 纯布局+事件,
// 逻辑与处理器方法在本文件)
cbo方式.SelectedIndex = 0;
}
// ===== 模板存取(sjk\费用模板.xml) =====
private static string 模板路径()
{
return Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "sjk", "费用模板.xml");
}
private List<模板行> _模板s = new List<模板行>();
private void Load模板()
{
try
{
_模板s = new List<模板行>();
string f = 模板路径();
if (!File.Exists(f)) return;
string xml = File.ReadAllText(f, Encoding.UTF8);
int p = 0;
while (true)
{
int s = xml.IndexOf("<模板>", p, StringComparison.Ordinal);
if (s < 0) break;
int e = xml.IndexOf("</模板>", s, StringComparison.Ordinal);
if (e < 0) break;
string seg = xml.Substring(s + 4, e - s - 4);
_模板s.Add(new 模板行
{
启用 = 取段(seg, "启用") == "1",
名称 = 取段(seg, "名称"),
方式 = 取段(seg, "方式"),
数值 = TryParseDec(取段(seg, "数值"))
// 旧 XML 的 <计入> 段忽略(维度已删)
});
p = e;
}
}
catch { }
}
private static string 取段(string xml, string 标签)
{
string 开 = "<" + 标签 + ">", 关 = "</" + 标签 + ">";
int i = xml.IndexOf(开, StringComparison.Ordinal);
if (i < 0) return "";
int j = xml.IndexOf(关, i + 开.Length, StringComparison.Ordinal);
if (j < 0) return "";
return xml.Substring(i + 开.Length, j - i - 开.Length).Trim();
}
private void Save模板()
{
try
{
var sb = new StringBuilder();
sb.AppendLine("<?xml version=\"1.0\" encoding=\"utf-8\"?>");
sb.AppendLine("<!-- 费用模板(全局):应用到当前项目时按方式换算成费用行写入各箱号 -->");
sb.AppendLine("<费用模板列表>");
foreach (var t in _模板s)
{
sb.AppendLine(" <模板>");
sb.AppendLine(" <启用>" + (t.启用 ? "1" : "0") + "</启用>");
sb.AppendLine(" <名称>" + (t.名称 ?? "") + "</名称>");
sb.AppendLine(" <方式>" + (t.方式 ?? "") + "</方式>");
sb.AppendLine(" <数值>" + t.数值.ToString("0.####", CultureInfo.InvariantCulture) + "</数值>");
sb.AppendLine(" </模板>");
}
sb.AppendLine("</费用模板列表>");
string f = 模板路径();
string dir = Path.GetDirectoryName(f);
if (!string.IsNullOrEmpty(dir)) Directory.CreateDirectory(dir);
File.WriteAllText(f, sb.ToString(), new UTF8Encoding(true));
}
catch (Exception ex) { MessageBox.Show(this, "保存模板失败: " + ex.Message, "费用模板"); }
}
private static decimal TryParseDec(string s)
{
decimal d;
if (decimal.TryParse((s ?? "").Trim(), NumberStyles.Any, CultureInfo.InvariantCulture, out d)) return d;
decimal.TryParse((s ?? "").Trim(), out d);
return d;
}
// ===== 界面 =====
/// <summary>合法的方式取值(与 Designer 列 Items、编辑区 ComboBox Items 保持一致)。</summary>
private static readonly string[] 合法方式 = { "固定金额(每柜)", "元件采购价×%", "元件报出价×%" };
private static string 归一化方式(string s)
{
foreach (string v in 合法方式) if (v == s) return v;
return 合法方式[0];
}
private void 刷列表()
{
dgv模板.Rows.Clear();
foreach (var t in _模板s)
dgv模板.Rows.Add(t.启用, t.名称, 归一化方式(t.方式), t.数值.ToString("0.####"));
}
/// <summary>★ 修复(2026-10-01):ComboBox 列值不在 Items 时吞掉 DataError 默认弹框
/// (写值已归一化,此为兜底;异常记日志便于排查)。</summary>
private void dgv模板_DataError(object sender, DataGridViewDataErrorEventArgs e)
{
e.ThrowException = false;
try
{
System.Diagnostics.Debug.WriteLine("[费用模板] DataError 行" + e.RowIndex + " 列" + e.ColumnIndex + ": " + e.Exception.Message);
}
catch { }
}
private void dgv模板_SelectionChanged(object sender, EventArgs e)
{
if (dgv模板.CurrentRow == null) return;
int i = dgv模板.CurrentRow.Index;
if (i < 0 || i >= _模板s.Count) return;
var t = _模板s[i];
txt名称.Text = t.名称;
cbo方式.SelectedItem = 归一化方式(t.方式);
txt数值.Text = t.数值.ToString("0.####");
}
private 模板行 从编辑区读()
{
var t = new 模板行();
t.名称 = (txt名称.Text ?? "").Trim();
t.方式 = cbo方式.SelectedItem == null ? "固定金额(每柜)" : cbo方式.SelectedItem.ToString();
t.数值 = TryParseDec(txt数值.Text);
return t;
}
private void btn新增_Click(object sender, EventArgs e)
{
var t = 从编辑区读();
if (t.名称.Length == 0) { MessageBox.Show(this, "请填写费用名称。", "费用模板"); return; }
if (t.数值 <= 0m && t.方式 != "固定金额(每柜)") { MessageBox.Show(this, "百分比方式的数值必须大于 0。", "费用模板"); return; }
_模板s.Add(t);
Save模板(); 刷列表();
dgv模板.CurrentCell = dgv模板.Rows[dgv模板.Rows.Count - 1].Cells[1];
}
private void btn修改_Click(object sender, EventArgs e)
{
if (dgv模板.CurrentRow == null) { MessageBox.Show(this, "请先在列表选中要修改的模板。", "费用模板"); return; }
int i = dgv模板.CurrentRow.Index;
if (i < 0 || i >= _模板s.Count) return;
var t = 从编辑区读();
if (t.名称.Length == 0) { MessageBox.Show(this, "请填写费用名称。", "费用模板"); return; }
_模板s[i] = t;
Save模板(); 刷列表();
}
private void btn删除_Click(object sender, EventArgs e)
{
if (dgv模板.CurrentRow == null) { MessageBox.Show(this, "请先在列表选中要删除的模板。", "费用模板"); return; }
int i = dgv模板.CurrentRow.Index;
if (i < 0 || i >= _模板s.Count) return;
_模板s.RemoveAt(i);
Save模板(); 刷列表();
}
private void btn应用_Click(object sender, EventArgs e)
{
var 启用的 = _模板s.FindAll(t => t.启用);
if (启用的.Count == 0) { MessageBox.Show(this, "没有勾选「启用」的模板,先勾选或新增。", "费用模板"); return; }
if (MessageBox.Show(this,
"将把 " + 启用的.Count + " 条启用模板换算成费用行,写入当前项目【每个箱号】的元件表:\n" +
"· 之前应用过的同名费用行会被替换(可反复应用)\n" +
"· 各箱号成本价/报出价、图号总价、项目汇总会自动重算\n\n确认应用?",
"应用到当前项目", MessageBoxButtons.YesNo, MessageBoxIcon.Question) != DialogResult.Yes) return;
try
{
string 结果 = _主窗.应用费用模板到当前项目(启用的);
MessageBox.Show(this, 结果, "应用完成", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
catch (Exception ex)
{
MessageBox.Show(this, "应用失败:\n" + ex.Message, "费用模板", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private void btn清空费用_Click(object sender, EventArgs e)
{
if (MessageBox.Show(this,
"删除当前项目所有箱号元件表里「类型=费用」的行?\n(普通元件行不受影响,价格自动重算)",
"清空项目费用行", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) != DialogResult.Yes) return;
try
{
string 结果 = _主窗.清空项目费用行();
MessageBox.Show(this, 结果, "清空完成", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
catch (Exception ex)
{
MessageBox.Show(this, "清空失败:\n" + ex.Message, "费用模板", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
}
}
+589
View File
@@ -0,0 +1,589 @@
// ============================================================
// 项目云窗体:把项目上传到会员服务器(项目云) / 从云下载还原 / 删除
// · 复用 主窗口.项目导入导出 的打包(BackupSQLiteDb+meta.json+zip)与还原(ImportProjectFromZip)
// · 传输走 会员服务Host.PostBinary / DownloadToFile(服务器= shezhi\会员服务.config.xml 指向的会员服务器)
// · 上传/下载按登录手机号隔离(服务器按手机号分目录存储)
// UI 全部代码构建(免设计器 resx 资源化坑,照 PickProjectDialogMulti 模式)
// ============================================================
using System;
using System.Collections.Generic;
using System.Drawing;
using System.IO;
using System.IO.Compression;
using System.Text;
using System.Threading;
using System.Windows.Forms;
namespace 成套报价软件
{
public class 项目云窗体 : Form
{
private readonly MainForm _owner;
private ListView _lv本地; // 本地项目(可勾选上传)
private ListView _lv云端; // 云上项目(可勾选下载/删除)
private Button _btn上传;
private Button _btn刷新云;
private Button _btn下载;
private Button _btn删除云;
private Label _lbl状态;
private TextBox _txt手机号;
public 项目云窗体(MainForm owner)
{
_owner = owner;
初始化UI();
this.BackColor = System.Drawing.Color.White;
填本地项目();
if (!string.IsNullOrWhiteSpace(MainForm.当前登录手机号))
{ _txt手机号.Text = MainForm.当前登录手机号; 刷云端(); }
}
private void 初始化UI()
{
Text = "项目云(上传到会员服务器 / 下载还原)";
StartPosition = FormStartPosition.CenterParent;
FormBorderStyle = FormBorderStyle.FixedDialog;
MaximizeBox = false;
MinimizeBox = false;
ClientSize = new Size(980, 560);
Font = new Font("宋体", 9F);
var lbl登录 = new Label { Text = "登录手机号:", Location = new Point(12, 14), Size = new Size(76, 20) };
Controls.Add(lbl登录);
_txt手机号 = new TextBox { Location = new Point(90, 11), Size = new Size(140, 23), ReadOnly = true, BackColor = SystemColors.Control };
Controls.Add(_txt手机号);
// ---- 左:本地项目 ----
var lbl本地 = new Label { Text = "本地项目(选中要上传的)", Location = new Point(12, 42), Size = new Size(300, 20) };
Controls.Add(lbl本地);
_lv本地 = new ListView
{
Location = new Point(12, 64),
Size = new Size(452, 300),
View = View.Details,
FullRowSelect = true,
MultiSelect = true,
HideSelection = false,
};
_lv本地.Columns.Add("项目编号", 110);
_lv本地.Columns.Add("项目名称", 170);
_lv本地.Columns.Add("客户名称", 110);
_lv本地.Columns.Add("项目日期", 60);
Controls.Add(_lv本地);
// ---- 右:云端项目 ----
var lbl云 = new Label { Text = "云端项目(会员服务器上,选中可下载/删除)", Location = new Point(516, 42), Size = new Size(320, 20) };
Controls.Add(lbl云);
_lv云端 = new ListView
{
Location = new Point(516, 64),
Size = new Size(452, 300),
View = View.Details,
FullRowSelect = true,
MultiSelect = true,
HideSelection = false,
};
_lv云端.Columns.Add("项目编号", 110);
_lv云端.Columns.Add("项目名称", 190);
_lv云端.Columns.Add("上传时间", 80);
_lv云端.Columns.Add("大小", 70);
Controls.Add(_lv云端);
// ---- 按钮(纯项目功能;库备份在主窗口 备份/恢复 按钮,不在这里) ----
_btn上传 = new Button { Text = "↑ 上传选中项目", Location = new Point(12, 474), Size = new Size(130, 30) };
_btn上传.Click += (s, e) => 上传选中();
Controls.Add(_btn上传);
var btn全选本地 = new Button { Text = "全选本地", Location = new Point(150, 474), Size = new Size(80, 30) };
btn全选本地.Click += (s, e) => { foreach (ListViewItem it in _lv本地.Items) it.Selected = true; };
Controls.Add(btn全选本地);
_btn刷新云 = new Button { Text = "刷新云端", Location = new Point(516, 474), Size = new Size(90, 30) };
_btn刷新云.Click += (s, e) => 刷云端();
Controls.Add(_btn刷新云);
_btn下载 = new Button { Text = "↓ 下载还原选中项", Location = new Point(614, 474), Size = new Size(140, 30) };
_btn下载.Click += (s, e) => 下载还原选中();
Controls.Add(_btn下载);
_btn删除云 = new Button { Text = "删除云端选中项", Location = new Point(762, 474), Size = new Size(130, 30), ForeColor = Color.Firebrick };
_btn删除云.Click += (s, e) => 删除云端选中();
Controls.Add(_btn删除云);
_lbl状态 = new Label { Text = "就绪。", Location = new Point(12, 520), Size = new Size(956, 26) };
Controls.Add(_lbl状态);
}
private void 设状态(string s) { _lbl状态.Text = s; Application.DoEvents(); }
/// <summary>写 diag 日志(MainForm.写日志 静态入口)。</summary>
private static void Log(string s)
{
try { MainForm.写日志(s); } catch { }
}
private string 登录手机号
{
get
{
string p = string.IsNullOrWhiteSpace(MainForm.当前登录手机号)
? (_txt手机号.Text ?? "").Trim() : MainForm.当前登录手机号.Trim();
return p;
}
}
// ---------- 本地项目列表 ----------
private void 填本地项目()
{
try
{
_lv本地.Items.Clear();
var projects = _owner.ReadAllProjectsFromDatabaseForCloud();
foreach (var p in projects)
{
string bh = 取字段(p, "项目编号");
var it = new ListViewItem(bh);
it.SubItems.Add(取字段(p, "项目名称"));
it.SubItems.Add(取字段(p, "客户名称"));
it.SubItems.Add(取字段(p, "项目日期"));
_lv本地.Items.Add(it);
}
}
catch (Exception ex) { Log("[项目云] 读本地项目失败: " + ex.Message); }
}
private static string 取字段(Dictionary<string, object> d, string k)
{
return d != null && d.ContainsKey(k) && d[k] != null ? d[k].ToString() : "";
}
// ---------- 上传 ----------
private void 上传选中()
{
string 手机号 = 登录手机号;
if (手机号.Length == 0 || string.IsNullOrEmpty(MainForm.当前登录密码)) { MessageBox.Show(this, "请先登录会员(新版协议需登录换取云操作凭证)。", "项目云", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; }
if (_lv本地.SelectedItems.Count == 0) { MessageBox.Show(this, "请先在左侧选中要上传的项目。", "项目云", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; }
var 选中 = new List<string>();
foreach (ListViewItem it in _lv本地.SelectedItems) 选中.Add(it.Text);
_btn上传.Enabled = false;
try
{
int ok = 0;
for (int i = 0; i < 选中.Count; i++)
{
设状态("正在上传 " + (i + 1) + "/" + 选中.Count + ": " + 选中[i] + " ...");
if (上传单个(手机号, 选中[i])) ok++;
}
设状态("上传完成:成功 " + ok + "/" + 选中.Count + "。");
刷云端();
}
catch (Exception ex)
{
Log("[项目云] 上传异常: " + ex.Message);
设状态("上传失败: " + ex.Message);
MessageBox.Show(this, "上传失败:\n" + ex.Message, "项目云", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
finally { _btn上传.Enabled = true; }
}
/// <summary>每日自动上传用的公开入口(内部走 登录态,单独线程调用须自带 Invoke 保护)。</summary>
public bool 上传单个公开(string pid)
{
return 上传单个(登录手机号, pid);
}
/// <summary>单库备份静态入口(每日自动上传用;不碰 UI,显式传手机号)。
/// 库清单收集在 主窗口.母排与备份.cs 收集云端库清单() 的同款逻辑——此处独立列一份避免跨窗体引用。</summary>
public static bool 备份单个库静态(MainForm owner, string 手机号, string 云编号, string 相对路径)
{
try
{
string 本地 = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, 相对路径);
if (!File.Exists(本地)) return false;
string tempDir = Path.Combine(Path.GetTempPath(), "成套报价_库传_" + Guid.NewGuid().ToString("N"));
Directory.CreateDirectory(tempDir);
try
{
string 打包文件 = Path.Combine(tempDir, Path.GetFileName(相对路径));
if (相对路径.EndsWith(".db", StringComparison.OrdinalIgnoreCase))
owner.BackupSQLiteDbForCloud(本地, 打包文件);
else
File.Copy(本地, 打包文件, true);
byte[] zip;
using (var ms = new MemoryStream())
{
using (var ar = new ZipArchive(ms, ZipArchiveMode.Create, true))
ar.CreateEntryFromFile(打包文件, Path.GetFileName(打包文件), CompressionLevel.Optimal);
zip = ms.ToArray();
}
var 头 = new StringBuilder();
头.Append("{").Append("\"手机号\":\"").Append(owner.EscapeJsonStringForCloud(手机号)).Append("\",")
.Append("\"编号\":\"").Append(owner.EscapeJsonStringForCloud(云编号)).Append("\",")
.Append("\"名称\":\"").Append(owner.EscapeJsonStringForCloud(云编号.Substring(4) + "|" + 相对路径)).Append("\",")
.Append("\"时间\":\"").Append(DateTime.Now.ToString("yyyy-MM-dd")).Append("\"}");
string resp = 会员服务Host.PostBinary("/api/proj/upload", 头.ToString(), zip);
return resp != null && resp.IndexOf("\"ok\":true", StringComparison.OrdinalIgnoreCase) >= 0;
}
finally { try { Directory.Delete(tempDir, true); } catch { } }
}
catch { return false; }
}
/// <summary>打包并上传单个项目。复用导出的 BackupSQLiteDb+meta.json+zip 链路。</summary>
private bool 上传单个(string 手机号, string pid)
{
string dbPath = _owner.GetQuoteDbPathForCloud(pid);
if (!File.Exists(dbPath)) { Log("[项目云] 跳过(库不存在): " + pid); return false; }
var meta = _owner.ReadProjectMetaDataForCloud(pid);
string projName = meta != null && meta.ContainsKey("项目名称") && meta["项目名称"] != null ? meta["项目名称"].ToString() : "";
string tempDir = Path.Combine(Path.GetTempPath(), "成套报价_云传_" + Guid.NewGuid().ToString("N"));
Directory.CreateDirectory(tempDir);
try
{
string dbFile = Path.Combine(tempDir, "项目" + _owner.MakeSafeFileNameForCloud(pid) + ".db");
_owner.BackupSQLiteDbForCloud(dbPath, dbFile);
var sb = new StringBuilder();
sb.Append("{\n \"项目编号\": \"").Append(_owner.EscapeJsonStringForCloud(pid)).Append("\",\n \"字段\": {");
bool first = true;
if (meta != null)
{
foreach (var kv in meta)
{
if (first) first = false; else sb.Append(",");
sb.Append("\n \"").Append(_owner.EscapeJsonStringForCloud(kv.Key)).Append("\": \"")
.Append(_owner.EscapeJsonStringForCloud((kv.Value ?? "").ToString())).Append("\"");
}
}
sb.Append("\n }\n}");
File.WriteAllText(Path.Combine(tempDir, "meta.json"), sb.ToString(), new UTF8Encoding(false));
// ★ 打包到内存流(不用 CreateFromDirectory+ReadAllBytes:临时 zip 文件句柄
// 释放不及时,紧接着读会报"正由另一进程使用")
byte[] zip;
using (var ms = new MemoryStream())
{
using (var ar = new ZipArchive(ms, ZipArchiveMode.Create, true))
{
foreach (var f in Directory.GetFiles(tempDir))
{
ar.CreateEntryFromFile(f, Path.GetFileName(f), CompressionLevel.Optimal);
}
}
zip = ms.ToArray();
}
var 头 = new StringBuilder();
头.Append("{").Append("\"手机号\":\"").Append(_owner.EscapeJsonStringForCloud(手机号)).Append("\",")
.Append("\"编号\":\"").Append(_owner.EscapeJsonStringForCloud(pid)).Append("\",")
.Append("\"名称\":\"").Append(_owner.EscapeJsonStringForCloud(projName)).Append("\",")
.Append("\"时间\":\"").Append(DateTime.Now.ToString("yyyy-MM-dd")).Append("\"}");
string resp = 会员服务Host.PostBinary("/api/proj/upload", 头.ToString(), zip);
bool ok = resp != null && resp.IndexOf("\"ok\":true", StringComparison.OrdinalIgnoreCase) >= 0;
Log("[项目云] 上传 " + pid + "(" + zip.Length + "B): " + resp);
return ok;
}
finally
{
try { Directory.Delete(tempDir, true); } catch { }
}
}
// ---------- 云端列表 ----------
private void 刷云端()
{
string 手机号 = 登录手机号;
if (手机号.Length == 0) { 设状态("未登录,输入/登录手机号后点\"刷新云端\"。"); return; }
try
{
string q = Uri.EscapeDataString("手机号") + "=" + Uri.EscapeDataString(手机号);
string resp = 会员服务Host.Get("/api/proj/list?" + q);
_lv云端.Items.Clear();
if (resp == null || resp.IndexOf("\"ok\":true", StringComparison.OrdinalIgnoreCase) < 0)
{ 设状态("云端列表获取失败: " + (resp ?? "")); return; }
// 解析 [{编号,名称,时间,大小}] —— 项目名/值用轻量解析(照 ParseSimpleJsonFields 思路)
// ★ 过滤掉 LIB_ 开头的库备份条目(企业信息/方案库等在 备份/恢复 按钮的云端流程里管,不混进项目列表)
var 项目们 = 解析项目数组(resp);
int 库条目数 = 0;
foreach (var p in 项目们)
{
if (p.编号 != null && p.编号.StartsWith("LIB_", StringComparison.Ordinal)) { 库条目数++; continue; }
var it = new ListViewItem(p.编号);
it.SubItems.Add(p.名称);
it.SubItems.Add(p.时间);
it.SubItems.Add(格式大小(p.大小));
it.Tag = p.编号;
_lv云端.Items.Add(it);
}
设状态("云端共 " + _lv云端.Items.Count + " 个项目" + (库条目数 > 0 ? "(另有 " + 库条目数 + " 个库备份,在 备份/恢复 里管理)" : "") + "。");
}
catch (Exception ex)
{
Log("[项目云] 刷云端失败: " + ex.Message);
设状态("云端列表获取失败: " + ex.Message);
}
}
private class 云项目 { public string 编号, 名称, 时间; public long 大小; }
/// <summary>解析 /api/proj/list 的 项目:[{编号,名称,时间,大小}] 数组(中文键,轻量逐对象扫描)。</summary>
private static List<云项目> 解析项目数组(string json)
{
var 出 = new List<云项目>();
if (string.IsNullOrEmpty(json)) return 出;
int i = json.IndexOf('[');
if (i < 0) return 出;
int 深 = 0, 对象起 = -1;
var 字段 = new Dictionary<string, string>();
for (; i < json.Length; i++)
{
char c = json[i];
if (c == '{') { if (深 == 0) { 对象起 = i; 字段.Clear(); } 深++; }
else if (c == '}')
{
深--;
if (深 == 0 && 对象起 >= 0)
{
string obj = json.Substring(对象起, i - 对象起 + 1);
出.Add(new 云项目
{
编号 = 取json串(obj, "编号"),
名称 = 取json串(obj, "名称"),
时间 = 取json串(obj, "时间"),
大小 = 取json数(obj, "大小"),
});
对象起 = -1;
}
}
}
return 出;
}
/// <summary>从单个 JSON 对象文本里取字符串字段(处理 \uXXXX 与常规转义)。</summary>
private static string 取json串(string obj, string key)
{
int k = obj.IndexOf("\"" + key + "\"", StringComparison.Ordinal);
if (k < 0) return "";
int 冒 = obj.IndexOf(':', k + key.Length + 2);
if (冒 < 0) return "";
int 起 = obj.IndexOf('"', 冒 + 1);
if (起 < 0) return "";
var sb = new StringBuilder();
for (int i = 起 + 1; i < obj.Length; i++)
{
char c = obj[i];
if (c == '\\' && i + 1 < obj.Length)
{
char n = obj[++i];
if (n == 'u' && i + 4 < obj.Length)
{
sb.Append((char)Convert.ToInt32(obj.Substring(i + 1, 4), 16));
i += 4;
}
else sb.Append(n == 'n' ? '\n' : n);
}
else if (c == '"') break;
else sb.Append(c);
}
return sb.ToString();
}
private static long 取json数(string obj, string key)
{
int k = obj.IndexOf("\"" + key + "\"", StringComparison.Ordinal);
if (k < 0) return 0;
int 冒 = obj.IndexOf(':', k + key.Length + 2);
if (冒 < 0) return 0;
long v; int e = 冒 + 1;
while (e < obj.Length && (char.IsDigit(obj[e]) || obj[e] == '-')) e++;
long.TryParse(obj.Substring(冒 + 1, e - 冒 - 1), out v);
return v;
}
private static string 格式大小(long b)
{
if (b >= 1048576) return (b / 1048576d).ToString("0.#") + "M";
if (b >= 1024) return (b / 1024d).ToString("0.#") + "K";
return b + "B";
}
// ---------- 下载还原 ----------
private void 下载还原选中()
{
string 手机号 = 登录手机号;
if (手机号.Length == 0) { MessageBox.Show(this, "请先登录会员(新版协议需登录换取云操作凭证)。", "项目云", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; }
if (_lv云端.SelectedItems.Count == 0) { MessageBox.Show(this, "请先在右侧选中要下载的项目。", "项目云", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; }
var 选中 = new List<string>();
foreach (ListViewItem it in _lv云端.SelectedItems) 选中.Add((string)it.Tag ?? it.Text);
_btn下载.Enabled = false;
int ok = 0; var 新号 = new List<string>();
try
{
for (int i = 0; i < 选中.Count; i++)
{
设状态("正在下载 " + (i + 1) + "/" + 选中.Count + ": " + 选中[i] + " ...");
string q = Uri.EscapeDataString("手机号") + "=" + Uri.EscapeDataString(手机号)
+ "&" + Uri.EscapeDataString("编号") + "=" + Uri.EscapeDataString(选中[i]);
string zipPath = Path.Combine(Path.GetTempPath(), "成套报价_云取_" + Guid.NewGuid().ToString("N") + ".zip");
try
{
会员服务Host.DownloadToFile("/api/proj/download?" + q, zipPath);
string newPid = _owner.ImportProjectFromZipForCloud(zipPath);
if (newPid != null) { ok++; 新号.Add(newPid); }
}
finally { try { File.Delete(zipPath); } catch { } }
}
设状态("下载还原完成:成功 " + ok + "/" + 选中.Count + (新号.Count > 0 ? "(新编号: " + string.Join(", ", 新号.ToArray()) + ")" : ""));
MessageBox.Show(this, "下载还原完成:成功 " + ok + "/" + 选中.Count + "。" +
(新号.Count > 0 ? "\n新项目编号: " + string.Join(", ", 新号.ToArray()) : ""),
"项目云", MessageBoxButtons.OK, MessageBoxIcon.Information);
填本地项目();
}
catch (Exception ex)
{
Log("[项目云] 下载异常: " + ex.Message);
设状态("下载失败: " + ex.Message);
MessageBox.Show(this, "下载失败:\n" + ex.Message, "项目云", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
finally { _btn下载.Enabled = true; }
}
// ---------- 删除云端 ----------
private void 删除云端选中()
{
string 手机号 = 登录手机号;
if (手机号.Length == 0 || string.IsNullOrEmpty(MainForm.当前登录密码))
{ MessageBox.Show(this, "请先登录会员(删除云端项目需登录凭证)。", "项目云", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; }
if (_lv云端.SelectedItems.Count == 0) { MessageBox.Show(this, "请先在右侧选中要删除的云端项目。", "项目云", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; }
var 选中 = new List<string>();
foreach (ListViewItem it in _lv云端.SelectedItems) 选中.Add((string)it.Tag ?? it.Text);
if (MessageBox.Show(this, "确定删除云端上的 " + 选中.Count + " 个项目?\n(本地项目不受影响,删除后不可恢复)",
"项目云", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) != DialogResult.Yes) return;
_btn删除云.Enabled = false;
try
{
int ok = 0;
string 失败原因 = "";
for (int i = 0; i < 选中.Count; i++)
{
设状态("正在删除 " + (i + 1) + "/" + 选中.Count + ": " + 选中[i] + " ...");
// body 只带 手机号+编号;密码由 会员服务Host.Post 自动补当前登录密码
// (服务端 v1.5.1 起删除接口要求 手机号+密码+编号,漏带密码会报"手机号或密码错误")
string body = "{\"手机号\":\"" + _owner.EscapeJsonStringForCloud(手机号) + "\",\"编号\":\"" + _owner.EscapeJsonStringForCloud(选中[i]) + "\"}";
string resp = 会员服务Host.Post("/api/proj/delete", body);
if (resp != null && resp.IndexOf("\"ok\":true", StringComparison.OrdinalIgnoreCase) >= 0) ok++;
else if (失败原因.Length == 0) 失败原因 = 选中[i] + ": " + (resp ?? "无响应");
// 服务端建议逐条间隔 200ms,避免触发限速
if (i < 选中.Count - 1) System.Threading.Thread.Sleep(200);
}
设状态("云端删除完成:成功 " + ok + "/" + 选中.Count + (失败原因.Length > 0 ? "。失败:" + 失败原因 : "。"));
Log("[项目云] 云端删除 " + ok + "/" + 选中.Count + (失败原因.Length > 0 ? " 失败:" + 失败原因 : ""));
刷云端();
}
catch (Exception ex)
{
Log("[项目云] 删除异常: " + ex.Message);
设状态("删除失败: " + ex.Message);
}
finally { _btn删除云.Enabled = true; }
}
}
/// <summary>每日自动云上传(后台静默):每天首次进软件触发一次,全部项目覆盖上传。</summary>
internal static class 项目云自动上传
{
private static System.Windows.Forms.Timer _timer;
/// <summary>写 diag 日志。</summary>
private static void Log(string s)
{
try { MainForm.写日志(s); } catch { }
}
/// <summary>库文件清单(与 主窗口.母排与备份.cs 收集云端库清单 同款;方案库目录动态收集)。</summary>
private static System.Collections.Generic.List<System.Collections.Generic.KeyValuePair<string, string>> 收集库清单()
{
var 出 = new System.Collections.Generic.List<System.Collections.Generic.KeyValuePair<string, string>>();
string baseDir = AppDomain.CurrentDomain.BaseDirectory;
出.Add(new System.Collections.Generic.KeyValuePair<string, string>("LIB_铜排库", @"sjk\advancedDataGridView8Table.db"));
出.Add(new System.Collections.Generic.KeyValuePair<string, string>("LIB_铝排库", @"sjk\advancedDataGridView8Table_LMY.db"));
出.Add(new System.Collections.Generic.KeyValuePair<string, string>("LIB_用户库", @"sjk\advancedDataGridView7Table.db"));
出.Add(new System.Collections.Generic.KeyValuePair<string, string>("LIB_柜体库", @"sjk\advancedDataGridView10Table.db"));
出.Add(new System.Collections.Generic.KeyValuePair<string, string>("LIB_fak方案库(含公式表)", @"sjk\fak.db"));
出.Add(new System.Collections.Generic.KeyValuePair<string, string>("LIB_企业信息", @"shezhi\企业信息.config.xml"));
string 方案目录 = Path.Combine(baseDir, "sjk", "方案库");
if (Directory.Exists(方案目录))
{
foreach (var f in Directory.GetFiles(方案目录, "*.db"))
出.Add(new System.Collections.Generic.KeyValuePair<string, string>(
"LIB_方案_" + Path.GetFileNameWithoutExtension(f),
"sjk\\方案库\\" + Path.GetFileName(f)));
}
return 出;
}
public static void 启动(MainForm owner)
{
if (_timer != null) return;
_timer = new System.Windows.Forms.Timer { Interval = 60000 }; // 每分钟看一眼
_timer.Tick += (s, e) =>
{
try
{
// 远程模式才自动传(本地 127.0.0.1 模式不传);未登录或无密码(新协议要求)不传
if (!会员服务Host.是远程) return;
if (string.IsNullOrWhiteSpace(MainForm.当前登录手机号)) return;
if (string.IsNullOrEmpty(MainForm.当前登录密码)) { Log("[项目云自动] 无登录密码,跳过(请重新登录)"); return; }
string today = DateTime.Now.ToString("yyyy-MM-dd");
string flag = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "logs");
Directory.CreateDirectory(flag);
flag = Path.Combine(flag, "项目云自动_" + MainForm.当前登录手机号 + ".txt");
if (File.Exists(flag) && File.ReadAllText(flag).Trim() == today) return; // 今天已传
// 后台线程执行,失败静默(只记 diag)
var 项目们 = owner.ReadAllProjectsFromDatabaseForCloud();
var ids = new List<string>();
foreach (var p in 项目们)
{
string bh = p.ContainsKey("项目编号") && p["项目编号"] != null ? p["项目编号"].ToString() : "";
if (bh.Length > 0) ids.Add(bh);
}
// 库文件清单(方案库/用户库/柜体库/铜排铝排库/企业信息)一并自动上传
var 库们 = 收集库清单();
File.WriteAllText(flag, today);
if (ids.Count == 0 && 库们.Count == 0) return;
var 窗 = new 项目云窗体(owner);
ThreadPool.QueueUserWorkItem(delegate
{
try
{
int ok = 0, 总 = ids.Count + 库们.Count;
foreach (var pid in ids)
{
try { if ((bool)窗.Invoke(new Func<string, bool>(窗.上传单个公开), pid)) ok++; }
catch { }
}
foreach (var kv in 库们)
{
try { if (项目云窗体.备份单个库静态(owner, MainForm.当前登录手机号, kv.Key, kv.Value)) ok++; }
catch { }
}
Log("[项目云自动] 每日自动上传完成: " + ok + "/" + 总);
}
catch (Exception ex) { Log("[项目云自动] 失败: " + ex.Message); }
finally { try { 窗.Invoke((Action)窗.Dispose); } catch { } }
});
}
catch (Exception ex) { Log("[项目云自动] 异常: " + ex.Message); }
};
_timer.Start();
}
}
}