基线:全量源码首提(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
+1321
View File
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+120
View File
@@ -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>
+29
View File
@@ -0,0 +1,29 @@
// ============================================================
// 扒图数据类型(与原 cadcj 插件 / 网页端 cadbridge.ts 保持一致)
// ============================================================
using System.Collections.Generic;
namespace MyApp
{
/// <summary>
/// 扒数据模式:图号/箱号/元件
/// </summary>
public enum PaMode
{
Tuhao, // 扒图号
Xianghao, // 扒箱号
Yuanjian // 扒元件
}
/// <summary>
/// 扒图结果:一条文本 + 它对应的彩色框的 Handle(句柄字符串)
/// 用于关联表格数据行与网页 CAD 框实体,实现点击行定位、删除行删框。
/// ★ TextHandle:源文本实体自身的 Handle,用于判断"是否同一个文本"。
/// </summary>
public class PaTextResult
{
public string Text;
public string FrameHandle;
public string TextHandle = "";
}
}
+609
View File
@@ -0,0 +1,609 @@
namespace MyApp
{
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.SystemColors.Control;
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, 28);
this.txt项目编号.TabIndex = 0;
//
// lbl项目日期
//
this.lbl项目日期.BackColor = System.Drawing.SystemColors.Control;
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, 28);
this.txt项目日期.TabIndex = 1;
//
// lbl项目名称
//
this.lbl项目名称.BackColor = System.Drawing.SystemColors.Control;
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, 28);
this.txt项目名称.TabIndex = 2;
//
// lbl客户名称
//
this.lbl客户名称.BackColor = System.Drawing.SystemColors.Control;
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, 28);
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, 28);
this.btn选择客户.TabIndex = 4;
this.btn选择客户.Text = "选择客户";
this.btn选择客户.UseVisualStyleBackColor = true;
//
// lbl客户地址
//
this.lbl客户地址.BackColor = System.Drawing.SystemColors.Control;
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, 28);
this.txt客户地址.TabIndex = 5;
//
// lbl联系人
//
this.lbl联系人.BackColor = System.Drawing.SystemColors.Control;
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, 28);
this.txt联系人.TabIndex = 6;
//
// lbl联系电话
//
this.lbl联系电话.BackColor = System.Drawing.SystemColors.Control;
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, 28);
this.txt联系电话.TabIndex = 7;
//
// lbl成套厂名称
//
this.lbl成套厂名称.BackColor = System.Drawing.SystemColors.Control;
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, 28);
this.txt成套厂名称.TabIndex = 8;
//
// lbl成套厂地址
//
this.lbl成套厂地址.BackColor = System.Drawing.SystemColors.Control;
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, 28);
this.txt成套厂地址.TabIndex = 9;
//
// lbl成套厂联系人
//
this.lbl成套厂联系人.BackColor = System.Drawing.SystemColors.Control;
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, 28);
this.txt成套厂联系人.TabIndex = 10;
//
// lbl成套厂联系电话
//
this.lbl成套厂联系电话.BackColor = System.Drawing.SystemColors.Control;
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, 28);
this.txt成套厂联系电话.TabIndex = 11;
//
// lbl报出方式
//
this.lbl报出方式.BackColor = System.Drawing.SystemColors.Control;
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 = 18;
this.cmb报出方式.Location = new System.Drawing.Point(95, 265);
this.cmb报出方式.Name = "cmb报出方式";
this.cmb报出方式.Size = new System.Drawing.Size(220, 26);
this.cmb报出方式.TabIndex = 12;
this.cmb报出方式.Text = "报出价=表价*采购系数*报出系数";
//
// lbl箱柜模板
//
this.lbl箱柜模板.BackColor = System.Drawing.SystemColors.Control;
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 = 18;
this.cmb箱柜模板.Location = new System.Drawing.Point(455, 262);
this.cmb箱柜模板.Name = "cmb箱柜模板";
this.cmb箱柜模板.Size = new System.Drawing.Size(210, 26);
this.cmb箱柜模板.TabIndex = 13;
//
// lbl单台价格
//
this.lbl单台价格.BackColor = System.Drawing.SystemColors.Control;
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 = 18;
this.cmb单台价格.Location = new System.Drawing.Point(95, 293);
this.cmb单台价格.Name = "cmb单台价格";
this.cmb单台价格.Size = new System.Drawing.Size(220, 26);
this.cmb单台价格.TabIndex = 14;
this.cmb单台价格.Text = "保留整数";
//
// lbl项目总价
//
this.lbl项目总价.BackColor = System.Drawing.SystemColors.Control;
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.SystemColors.Control;
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 = 18;
this.comboBox1.Location = new System.Drawing.Point(455, 322);
this.comboBox1.Name = "comboBox1";
this.comboBox1.Size = new System.Drawing.Size(210, 26);
this.comboBox1.TabIndex = 14;
this.comboBox1.Text = "四舍五入";
//
// label1
//
this.label1.BackColor = System.Drawing.SystemColors.Control;
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.SystemColors.Control;
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 = 18;
this.comboBox2.Location = new System.Drawing.Point(95, 324);
this.comboBox2.Name = "comboBox2";
this.comboBox2.Size = new System.Drawing.Size(220, 26);
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 = 18;
this.cmb项目总价.Location = new System.Drawing.Point(455, 290);
this.cmb项目总价.Name = "cmb项目总价";
this.cmb项目总价.Size = new System.Drawing.Size(210, 26);
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.SystemColors.Control;
this.ClientSize = new System.Drawing.Size(678, 482);
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项目总价;
}
}
+132
View File
@@ -0,0 +1,132 @@
using System;
using System.Collections.Generic;
using System.Windows.Forms;
namespace MyApp
{
/// <summary>
/// 新建项目 窗口(简化版,不依赖企业信息)。
/// UI 布局见 新建项目.ui.cs,本文件只含交互逻辑。
/// </summary>
public partial class 新建项目 : Form
{
// 价格格式化选项(与主项目 价格格式化.cs 保持一致)
private static readonly string[] 小数位选项 =
{
"保留整数", "保留1位小数", "保留2位小数", "保留3位小数",
"保留4位小数", "保留5位小数", "保留6位小数"
};
private static readonly string[] 取整方式选项 =
{
"不取整", "四舍五入", "四舍五入到角", "四舍五入到元",
"四舍五入到十元", "向上取整到元", "最近5元", "最近10元"
};
private readonly string _dbPath;
private readonly string _tableName;
public 新建项目() : this(null, null) { }
/// <summary>带数据库路径的构造函数(用于自动生成项目编号)。</summary>
public 新建项目(string dbPath, string tableName)
{
InitializeComponent();
_dbPath = dbPath;
_tableName = tableName;
InitPriceFormatCombos();
this.Load += 新建项目_Load;
}
private void InitPriceFormatCombos()
{
cmb单台价格.Items.Clear();
cmb单台价格.Items.AddRange(小数位选项);
cmb项目总价.Items.Clear();
cmb项目总价.Items.AddRange(小数位选项);
comboBox1.Items.Clear();
comboBox1.Items.AddRange(取整方式选项);
comboBox2.Items.Clear();
comboBox2.Items.AddRange(取整方式选项);
}
private void 新建项目_Load(object sender, EventArgs e)
{
FillAutoFields();
}
/// <summary>自动填充项目日期(当天)和项目编号(yyyyMMdd+3位序号)。</summary>
private void FillAutoFields()
{
DateTime today = DateTime.Today;
txt项目日期.Text = today.ToString("yyyy-MM-dd");
string datePart = today.ToString("yyyyMMdd");
int seq = GetNextSeqForDate(datePart);
txt项目编号.Text = datePart + seq.ToString("000");
txt项目编号.ReadOnly = true;
txt项目编号.TabStop = false;
txt项目编号.BackColor = System.Drawing.SystemColors.Control;
}
/// <summary>查数据库当天最大序号+1,失败返回1。</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();
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;
if (int.TryParse(result.ToString(), out maxSeq)) return maxSeq + 1;
return 1;
}
}
}
catch { return 1; }
}
/// <summary>收集对话框字段,以列名为键返回(供 Form3 写入数据库)。</summary>
public Dictionary<string, string> GetInputValues()
{
var values = new Dictionary<string, string>();
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);
AddIfNotEmpty(values, "成套厂名称", txt成套厂名称.Text);
AddIfNotEmpty(values, "成套厂地址", txt成套厂地址.Text);
AddIfNotEmpty(values, "成套厂联系人", txt成套厂联系人.Text);
AddIfNotEmpty(values, "成套厂联系电话", txt成套厂联系电话.Text);
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();
}
}
}
+120
View File
@@ -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>