C#+SQL工厂 多码合一工具

68 篇文章 1 订阅

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace Multi_CodeTie_Yards_Tools_V1._00
{
    public partial class Yards : Form
    {
        public int Yards_Number = 0;
        public List<String> Product_Info;
        public Yards()
        {
            InitializeComponent();
        }


        private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)//选择绑码数
        {
            if (comboBox1.Text != String.Empty && comboBox1.Text != null)
            {
                try
                {
                    Operation_DataBase Get_Product_Total = new Operation_DataBase(@"SERVER2\SERVER2", "E_One_More_Yards", "sa", "adminsystem", "usp_Get_Product_Yards_Total");
                    if (Get_Product_Total.Get_Product_Total(comboBox2.Text, comboBox3.Text, textBox12))
                    {
                        Yards_Number = Convert.ToInt32(comboBox1.Text);
                        comboBox1.Enabled = false;
                        textBox1.Enabled = true;
                        textBox1.Focus();
                    }
                    else
                    {
                        comboBox1.Focus();
                        comboBox1.SelectAll();
                    }
                }
                catch (Exception)
                {
                    comboBox1.Focus();
                    comboBox1.SelectAll();
                }
            }
            else
            {
                comboBox1.Focus();
                comboBox1.SelectAll();
            }
        }

        public Boolean Querying_CodeBar_IsFind(String CodeBar,Label Item)//检查SN条码是否存在
        {
            Boolean Flag = false;
            Item.BackColor = Color.White;
            Item.Text = "";
            Operation_DataBase Querying_CodeBar_IsFind = new Operation_DataBase(@"SERVER2\SERVER2", "E_One_More_Yards", "sa", "adminsystem", "usp_Querying_Code_Bar_If_There_Is_A");
            if (Querying_CodeBar_IsFind.Querying_CodeBar(CodeBar, label13))
            {
                
                Flag = true;
            }
            return Flag;
        }
        private void textBox1_KeyPress(object sender, KeyPressEventArgs e)//isn条码
        {
            label13.BackColor = Color.White;
            label13.Text = "";
            if (e.KeyChar == (Char)Keys.Enter)
            {
                if (textBox1.Text != String.Empty && textBox1.Text != null)
                {
                    if (Querying_CodeBar_IsFind(textBox1.Text, label13))
                    {
                        textBox1.Enabled = false;
                        textBox2.Enabled = true;
                        textBox2.Focus();
                    }
                    else
                    {
                        textBox1.Focus();
                        textBox1.SelectAll();
                    }
                }
                else
                {
                    textBox1.Focus();
                    textBox1.SelectAll();
                }
            }
        }

        public void Create_New_Table()//清空所有多余空间内容
        {
            foreach (Control ss in this.Controls)
            {
                if (ss.Name.ToString() == "groupBox1")
                {
                    foreach (Control s in ss.Controls)
                    {
                        if (s.Name.ToString() == "groupBox2")
                        {
                            foreach (Control s1 in s.Controls)
                            {
                                if (//s1.GetType().ToString() == "System.Windows.Forms.ComboBox" ||
                                        s1.GetType().ToString() == "System.Windows.Forms.TextBox")
                                {
                                    s1.Text = "";
                                    s1.Enabled = false;
                                }
                            }
                        }
                    }
                }
            }
            textBox1.Enabled = true;
            comboBox1.Focus();
        }

        public Boolean Insert_Yards_Data(String Customer_Name, String Product_Name, String ISN, String Code_Bar2, String Code_Bar3, String Code_Bar4,
            String Code_Bar5, String Code_Bar6, String Code_Bar7, String Code_Bar8, String Code_Bar9, String Code_Bar10,Label Item)
        {
            Boolean Flag = false;
            Operation_DataBase My_Insert_Yards_Data = new Operation_DataBase(@"SERVER2\SERVER2", "E_One_More_Yards", "sa", "adminsystem", "usp_Insert_Update_Yards_Data");
            if(My_Insert_Yards_Data.Insert_Yards_Data(Customer_Name, Product_Name, ISN, Code_Bar2, Code_Bar3, Code_Bar4,
            Code_Bar5, Code_Bar6, Code_Bar7, Code_Bar8, Code_Bar9, Code_Bar10))
            {
                Item.BackColor = Color.Red;
                Item.Text = "ISN="+textBox1.Text+"绑码数据写入失败!!";
                Flag = true;
            }
            return Flag;
        }
        private void textBox2_KeyPress(object sender, KeyPressEventArgs e)//绑定条码2
        {
            label13.BackColor = Color.White;
            label13.Text = "";
            if (e.KeyChar == (Char)Keys.Enter)
            {
                if (textBox2.Text != String.Empty && textBox2.Text != null)
                {
                    if (Querying_CodeBar_IsFind(textBox2.Text, label13))
                    {
                        if (Yards_Number == 2)
                        {
                            if (Insert_Yards_Data(comboBox2.Text, comboBox3.Text, textBox1.Text, textBox2.Text, "NULL", "NULL", "NULL", "NULL"
                                , "NULL", "NULL", "NULL", "NULL", label13))
                            {
                                textBox12.Text = (Convert.ToInt32(textBox12.Text) + 1).ToString();
                                label13.BackColor = Color.Green;
                                label13.Text = "ISN=" + textBox1.Text + "条码绑码数据写入成功!!";
                                Create_New_Table();
                            }
                            else
                            {
                                textBox2.Focus();
                                textBox2.SelectAll();
                            }
                        }
                        else
                        {
                            textBox2.Enabled = false;
                            textBox3.Enabled = true;
                            textBox3.Focus();
                        }
                    }
                    else
                    {
                        textBox2.Focus();
                        textBox2.SelectAll();
                    }
                }
                else
                {
                    textBox2.Focus();
                    textBox2.SelectAll();
                }
            }
        }

        private void textBox3_KeyPress(object sender, KeyPressEventArgs e)//绑定条码3
        {
            label13.BackColor = Color.White;
            label13.Text = "";
            if (e.KeyChar == (Char)Keys.Enter)
            {
                if (textBox3.Text != null && textBox3.Text != String.Empty)
                {
                    if (Querying_CodeBar_IsFind(textBox3.Text, label13))
                    {
                        if (Yards_Number == 3)
                        {
                            if (Insert_Yards_Data(comboBox2.Text, comboBox3.Text, textBox1.Text, textBox2.Text, textBox3.Text, "NULL", "NULL", "NULL"
                                , "NULL", "NULL", "NULL", "NULL", label13))
                            {
                                textBox12.Text = (Convert.ToInt32(textBox12.Text) + 1).ToString();
                                label13.BackColor = Color.Green;
                                label13.Text = "ISN=" + textBox1.Text + "条码绑码数据写入成功!!";
                                Create_New_Table();
                            }
                            else
                            {
                                textBox3.Focus();
                                textBox3.SelectAll();
                            }
                        }
                        else
                        {
                            textBox3.Enabled = false;
                            textBox4.Enabled = true;
                            textBox4.Focus();
                        }
                    }
                    else
                    {
                        textBox3.Focus();
                        textBox3.SelectAll();
                    }
                }
                else
                {
                    textBox3.Focus();
                    textBox3.SelectAll();
                }
            }
        }

        private void textBox4_KeyPress(object sender, KeyPressEventArgs e)//绑定条码4
        {
            label13.BackColor = Color.White;
            label13.Text = "";
            if (e.KeyChar == (Char)Keys.Enter)
            {
                if (textBox4.Text != null && textBox4.Text != String.Empty)
                {
                    if (Querying_CodeBar_IsFind(textBox4.Text, label13))
                    {
                        if (Yards_Number == 4)
                        {
                            if (Insert_Yards_Data(comboBox2.Text, comboBox3.Text, textBox1.Text, textBox2.Text, textBox3.Text, textBox4.Text, "NULL", "NULL"
                                , "NULL", "NULL", "NULL", "NULL", label13))
                            {
                                textBox12.Text = (Convert.ToInt32(textBox12.Text) + 1).ToString();
                                label13.BackColor = Color.Green;
                                label13.Text = "ISN=" + textBox1.Text + "条码绑码数据写入成功!!";
                                Create_New_Table();
                            }
                            else
                            {
                                textBox4.Focus();
                                textBox4.SelectAll();
                            }
                        }
                        else
                        {
                            textBox4.Enabled = false;
                            textBox5.Enabled = true;
                            textBox5.Focus();
                        }
                    }
                    else
                    {
                        textBox4.Focus();
                        textBox4.SelectAll();
                    }
                }
                else
                {
                    textBox4.Focus();
                    textBox4.SelectAll();
                }
            }
        }

        private void textBox5_KeyPress(object sender, KeyPressEventArgs e)//绑定条码5
        {
            label13.BackColor = Color.White;
            label13.Text = "";
            if (e.KeyChar == (Char)Keys.Enter)
            {
                if (textBox5.Text != null && textBox5.Text != String.Empty)
                {
                    if (Querying_CodeBar_IsFind(textBox5.Text, label13))
                    {
                        if (Yards_Number == 5)
                        {
                            if (Insert_Yards_Data(comboBox2.Text, comboBox3.Text, textBox1.Text, textBox2.Text, textBox3.Text, textBox4.Text, textBox5.Text, "NULL"
                                , "NULL", "NULL", "NULL", "NULL", label13))
                            {
                                textBox12.Text = (Convert.ToInt32(textBox12.Text) + 1).ToString();
                                label13.BackColor = Color.Green;
                                label13.Text = "ISN=" + textBox1.Text + "条码绑码数据写入成功!!";
                                Create_New_Table();
                            }
                            else
                            {
                                textBox5.Focus();
                                textBox5.SelectAll();
                            }
                        }
                        else
                        {
                            textBox5.Enabled = false;
                            textBox6.Enabled = true;
                            textBox6.Focus();
                        }
                    }
                    else
                    {
                        textBox5.Focus();
                        textBox5.SelectAll();
                    }
                }
                else
                {
                    textBox5.Focus();
                    textBox5.SelectAll();
                }
            }
        }

        private void textBox6_KeyPress(object sender, KeyPressEventArgs e)//绑定条码6
        {
            label13.BackColor = Color.White;
            label13.Text = "";
            if (e.KeyChar == (Char)Keys.Enter)
            {
                if (textBox6.Text != null && textBox6.Text != String.Empty)
                {

                    if (Querying_CodeBar_IsFind(textBox6.Text, label13))
                    {
                        if (Yards_Number == 6)
                        {
                            if (Insert_Yards_Data(comboBox2.Text, comboBox3.Text, textBox1.Text, textBox2.Text, textBox3.Text, textBox4.Text, textBox5.Text, textBox6.Text
                                , "NULL", "NULL", "NULL", "NULL", label13))
                            {
                                textBox12.Text = (Convert.ToInt32(textBox12.Text) + 1).ToString();
                                label13.BackColor = Color.Green;
                                label13.Text = "ISN=" + textBox1.Text + "条码绑码数据写入成功!!";
                                Create_New_Table();
                            }
                            else
                            {
                                textBox6.Focus();
                                textBox6.SelectAll();
                            }
                        }
                        else
                        {
                            textBox6.Enabled = false;
                            textBox7.Enabled = true;
                            textBox7.Focus();
                        }
                    }
                    else
                    {
                        textBox6.Focus();
                        textBox6.SelectAll();
                    }  
                }
                else
                {
                    textBox6.Focus();
                    textBox6.SelectAll();
                }
            }
        }

        private void textBox7_KeyPress(object sender, KeyPressEventArgs e)//绑定条码7
        {
            label13.BackColor = Color.White;
            label13.Text = "";
            if (e.KeyChar == (Char)Keys.Enter)
            {
                if (textBox7.Text != null && textBox7.Text != String.Empty)
                {
                    if (Querying_CodeBar_IsFind(textBox7.Text, label13))
                    {
                        if (Yards_Number == 7)
                        {
                            if (Insert_Yards_Data(comboBox2.Text, comboBox3.Text, textBox1.Text, textBox2.Text, textBox3.Text, textBox4.Text, textBox5.Text, textBox6.Text
                                , textBox7.Text, "NULL", "NULL", "NULL", label13))
                            {
                                textBox12.Text = (Convert.ToInt32(textBox12.Text) + 1).ToString();
                                label13.BackColor = Color.Green;
                                label13.Text = "ISN=" + textBox1.Text + "条码绑码数据写入成功!!";
                                Create_New_Table();
                            }
                            else
                            {
                                textBox7.Focus();
                                textBox7.SelectAll();
                            }
                        }
                        else
                        {
                            textBox7.Enabled = false;
                            textBox8.Enabled = true;
                            textBox8.Focus();
                        }
                    }
                    else
                    {
                        textBox7.Focus();
                        textBox7.SelectAll();
                    }
                }
                else
                {
                    textBox7.Focus();
                    textBox7.SelectAll();
                }
            }
        }

        private void textBox8_KeyPress(object sender, KeyPressEventArgs e)//绑定条码8
        {
            label13.BackColor = Color.White;
            label13.Text = "";
            if (e.KeyChar == (Char)Keys.Enter)
            {
                if (textBox8.Text != null && textBox8.Text != String.Empty)
                {
                    if (Querying_CodeBar_IsFind(textBox8.Text, label13))
                    {
                        if (Yards_Number == 8)
                        {
                            if (Insert_Yards_Data(comboBox2.Text, comboBox3.Text, textBox1.Text, textBox2.Text, textBox3.Text, textBox4.Text, textBox5.Text, textBox6.Text
                                , textBox7.Text, textBox8.Text, "NULL", "NULL", label13))
                            {
                                textBox12.Text = (Convert.ToInt32(textBox12.Text) + 1).ToString();
                                label13.BackColor = Color.Green;
                                label13.Text = "ISN=" + textBox1.Text + "条码绑码数据写入成功!!";
                                Create_New_Table();
                            }
                            else
                            {
                                textBox8.Focus();
                                textBox8.SelectAll();
                            }
                        }
                        else
                        {
                            textBox8.Enabled = false;
                            textBox9.Enabled = true;
                            textBox9.Focus();
                        }
                    }
                    else
                    {
                        textBox8.Focus();
                        textBox8.SelectAll();
                    }
                }
                else
                {
                    textBox8.Focus();
                    textBox8.SelectAll();
                }
            }
        }

        private void textBox9_KeyPress(object sender, KeyPressEventArgs e)//绑定条码9
        {
            label13.BackColor = Color.White;
            label13.Text = "";
            if (e.KeyChar == (Char)Keys.Enter)
            {
                if (textBox9.Text != null && textBox9.Text != String.Empty)
                {
                    if (Querying_CodeBar_IsFind(textBox9.Text, label13))
                    {
                        if (Yards_Number == 9)
                        {
                            if (Insert_Yards_Data(comboBox2.Text, comboBox3.Text, textBox1.Text, textBox2.Text, textBox3.Text, textBox4.Text, textBox5.Text, textBox6.Text
                                , textBox7.Text, textBox8.Text, textBox9.Text, "NULL", label13))
                            {
                                textBox12.Text = (Convert.ToInt32(textBox12.Text) + 1).ToString();
                                label13.BackColor = Color.Green;
                                label13.Text = "ISN=" + textBox1.Text + "条码绑码数据写入成功!!";
                                Create_New_Table();
                            }
                            else
                            {
                                textBox9.Focus();
                                textBox9.SelectAll();
                            }
                        }
                        else
                        {
                            textBox9.Enabled = false;
                            textBox10.Enabled = true;
                            textBox10.Focus();
                        }
                    }
                    else
                    {
                        textBox9.Focus();
                        textBox9.SelectAll();
                    } 
                }
                else
                {
                    textBox9.Focus();
                    textBox9.SelectAll();
                }
            }
        }

        private void textBox10_KeyPress(object sender, KeyPressEventArgs e)//绑定条码10
        {
            label13.BackColor = Color.White;
            label13.Text = "";
            if (e.KeyChar == (Char)Keys.Enter)
            {
                if (textBox10.Text != null && textBox10.Text != String.Empty)
                {
                    if (Querying_CodeBar_IsFind(textBox10.Text, label13))
                    {
                        if (Insert_Yards_Data(comboBox2.Text, comboBox3.Text, textBox1.Text, textBox2.Text, textBox3.Text, textBox4.Text, textBox5.Text, textBox6.Text
                            , textBox7.Text, textBox8.Text, textBox9.Text, textBox10.Text, label13))
                        {
                            textBox12.Text = (Convert.ToInt32(textBox12.Text) + 1).ToString();
                            label13.BackColor = Color.Green;
                            label13.Text = "ISN=" + textBox1.Text + "条码绑码数据写入成功!!";
                            Create_New_Table();
                        }
                        else
                        {
                            textBox10.Focus();
                            textBox10.SelectAll();
                        }
                    }
                    else
                    {
                        textBox10.Focus();
                        textBox10.SelectAll();
                    }
                }
                else
                {
                    textBox10.Focus();
                    textBox10.SelectAll();
                }
            }
        }

        private void Yards_MouseMove(object sender, MouseEventArgs e)//移动鼠标
        {
            toolStripStatusLabel3.Text = String.Format("{0},{1}", e.X, e.Y);
        }

        private void timer1_Tick(object sender, EventArgs e)
        {
            toolStripStatusLabel2.Text = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
        }

        private void Yards_Load(object sender, EventArgs e)
        {
            String strFullPath = Application.ExecutablePath;//读取执行路径
            String strFileName = System.IO.Path.GetFileName(strFullPath);//读取程式名称
            String FileName = strFileName.Substring(0, strFileName.Length - 4);
            System.Diagnostics.Process[] myProcesses = System.Diagnostics.Process.GetProcessesByName(FileName);
            if (myProcesses.Length > 1)//判断程式是否启动
            {
                MessageBox.Show("程式已启动", "系统提醒", MessageBoxButtons.OK, MessageBoxIcon.Error);
                System.Environment.Exit(0);
            }

            Product_Info = new List<String>();
            Operation_DataBase Get_Product_Info = new Operation_DataBase(@"SERVER2\SERVER2", "E_One_More_Yards", "sa", "adminsystem", @"SELECT * FROM Product_Information");
            if (Get_Product_Info.Get_Product_Information("Customer_Name", comboBox2, Product_Info))
            {
                comboBox2.Enabled = true;
                comboBox2.Focus();
            }
        }

        private void comboBox2_SelectedIndexChanged(object sender, EventArgs e)//选择客户名称
        {
            if (comboBox2.Text != null && comboBox2.Text != String.Empty)
            {
                comboBox3.Items.Clear();
                foreach (String ss in Product_Info)
                {
                    String[] Array_Str = ss.Split(new String[] { "#" }, StringSplitOptions.RemoveEmptyEntries);
                    if (Array_Str[0] == comboBox2.Text)
                    {
                        comboBox3.Items.Add(Array_Str[1]);
                    }
                }
                comboBox2.Enabled = false;
                comboBox3.Enabled = true;
                comboBox3.Focus();
            }
            else
            {
                comboBox2.Focus();
                comboBox2.SelectAll();
            }
        }

        private void comboBox3_SelectedIndexChanged(object sender, EventArgs e)//选择客户
        {
            if (comboBox3.Text != String.Empty && comboBox3.Text != null)
            {
                comboBox3.Enabled = false;
                comboBox1.Enabled = true;
                comboBox1.Focus();
            }
            else
            {
                comboBox3.Focus();
                comboBox3.SelectAll();
            }
        }

    }
}
 

namespace Multi_CodeTie_Yards_Tools_V1._00
{
    partial class Yards
    {
        /// <summary>
        /// 必需的设计器变量。
        /// </summary>
        private System.ComponentModel.IContainer components = null;

        /// <summary>
        /// 清理所有正在使用的资源。
        /// </summary>
        /// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
        protected override void Dispose(bool disposing)
        {
            if (disposing && (components != null))
            {
                components.Dispose();
            }
            base.Dispose(disposing);
        }

        #region Windows 窗体设计器生成的代码

        /// <summary>
        /// 设计器支持所需的方法 - 不要
        /// 使用代码编辑器修改此方法的内容。
        /// </summary>
        private void InitializeComponent()
        {
            this.components = new System.ComponentModel.Container();
            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Yards));
            this.groupBox1 = new System.Windows.Forms.GroupBox();
            this.textBox12 = new System.Windows.Forms.TextBox();
            this.groupBox2 = new System.Windows.Forms.GroupBox();
            this.groupBox3 = new System.Windows.Forms.GroupBox();
            this.label13 = new System.Windows.Forms.Label();
            this.statusStrip1 = new System.Windows.Forms.StatusStrip();
            this.toolStripStatusLabel1 = new System.Windows.Forms.ToolStripStatusLabel();
            this.toolStripStatusLabel3 = new System.Windows.Forms.ToolStripStatusLabel();
            this.toolStripStatusLabel9 = new System.Windows.Forms.ToolStripStatusLabel();
            this.toolStripStatusLabel2 = new System.Windows.Forms.ToolStripStatusLabel();
            this.textBox1 = new System.Windows.Forms.TextBox();
            this.textBox10 = new System.Windows.Forms.TextBox();
            this.label2 = new System.Windows.Forms.Label();
            this.textBox9 = new System.Windows.Forms.TextBox();
            this.label11 = new System.Windows.Forms.Label();
            this.textBox2 = new System.Windows.Forms.TextBox();
            this.textBox8 = new System.Windows.Forms.TextBox();
            this.label3 = new System.Windows.Forms.Label();
            this.label10 = new System.Windows.Forms.Label();
            this.textBox7 = new System.Windows.Forms.TextBox();
            this.textBox3 = new System.Windows.Forms.TextBox();
            this.textBox6 = new System.Windows.Forms.TextBox();
            this.label9 = new System.Windows.Forms.Label();
            this.label4 = new System.Windows.Forms.Label();
            this.textBox5 = new System.Windows.Forms.TextBox();
            this.textBox4 = new System.Windows.Forms.TextBox();
            this.label8 = new System.Windows.Forms.Label();
            this.label5 = new System.Windows.Forms.Label();
            this.label6 = new System.Windows.Forms.Label();
            this.label7 = new System.Windows.Forms.Label();
            this.comboBox3 = new System.Windows.Forms.ComboBox();
            this.comboBox2 = new System.Windows.Forms.ComboBox();
            this.comboBox1 = new System.Windows.Forms.ComboBox();
            this.label15 = new System.Windows.Forms.Label();
            this.label12 = new System.Windows.Forms.Label();
            this.label14 = new System.Windows.Forms.Label();
            this.label1 = new System.Windows.Forms.Label();
            this.timer1 = new System.Windows.Forms.Timer(this.components);
            this.label16 = new System.Windows.Forms.Label();
            this.groupBox1.SuspendLayout();
            this.groupBox2.SuspendLayout();
            this.groupBox3.SuspendLayout();
            this.statusStrip1.SuspendLayout();
            this.SuspendLayout();
            // 
            // groupBox1
            // 
            this.groupBox1.Controls.Add(this.textBox12);
            this.groupBox1.Controls.Add(this.groupBox2);
            this.groupBox1.Controls.Add(this.comboBox3);
            this.groupBox1.Controls.Add(this.comboBox2);
            this.groupBox1.Controls.Add(this.comboBox1);
            this.groupBox1.Controls.Add(this.label15);
            this.groupBox1.Controls.Add(this.label12);
            this.groupBox1.Controls.Add(this.label14);
            this.groupBox1.Controls.Add(this.label1);
            this.groupBox1.Location = new System.Drawing.Point(10, 8);
            this.groupBox1.Name = "groupBox1";
            this.groupBox1.Size = new System.Drawing.Size(661, 812);
            this.groupBox1.TabIndex = 0;
            this.groupBox1.TabStop = false;
            // 
            // textBox12
            // 
            this.textBox12.Enabled = false;
            this.textBox12.Location = new System.Drawing.Point(426, 67);
            this.textBox12.Name = "textBox12";
            this.textBox12.Size = new System.Drawing.Size(214, 29);
            this.textBox12.TabIndex = 4;
            // 
            // groupBox2
            // 
            this.groupBox2.Controls.Add(this.groupBox3);
            this.groupBox2.Controls.Add(this.statusStrip1);
            this.groupBox2.Controls.Add(this.textBox1);
            this.groupBox2.Controls.Add(this.textBox10);
            this.groupBox2.Controls.Add(this.label2);
            this.groupBox2.Controls.Add(this.textBox9);
            this.groupBox2.Controls.Add(this.label11);
            this.groupBox2.Controls.Add(this.textBox2);
            this.groupBox2.Controls.Add(this.textBox8);
            this.groupBox2.Controls.Add(this.label3);
            this.groupBox2.Controls.Add(this.label10);
            this.groupBox2.Controls.Add(this.textBox7);
            this.groupBox2.Controls.Add(this.textBox3);
            this.groupBox2.Controls.Add(this.textBox6);
            this.groupBox2.Controls.Add(this.label9);
            this.groupBox2.Controls.Add(this.label4);
            this.groupBox2.Controls.Add(this.textBox5);
            this.groupBox2.Controls.Add(this.textBox4);
            this.groupBox2.Controls.Add(this.label8);
            this.groupBox2.Controls.Add(this.label5);
            this.groupBox2.Controls.Add(this.label6);
            this.groupBox2.Controls.Add(this.label7);
            this.groupBox2.Location = new System.Drawing.Point(10, 103);
            this.groupBox2.Name = "groupBox2";
            this.groupBox2.Size = new System.Drawing.Size(640, 699);
            this.groupBox2.TabIndex = 3;
            this.groupBox2.TabStop = false;
            // 
            // groupBox3
            // 
            this.groupBox3.Controls.Add(this.label13);
            this.groupBox3.Location = new System.Drawing.Point(9, 559);
            this.groupBox3.Name = "groupBox3";
            this.groupBox3.Size = new System.Drawing.Size(623, 112);
            this.groupBox3.TabIndex = 6;
            this.groupBox3.TabStop = false;
            this.groupBox3.Text = "日志";
            // 
            // label13
            // 
            this.label13.AutoSize = true;
            this.label13.Location = new System.Drawing.Point(199, 51);
            this.label13.Name = "label13";
            this.label13.Size = new System.Drawing.Size(0, 19);
            this.label13.TabIndex = 0;
            // 
            // statusStrip1
            // 
            this.statusStrip1.Font = new System.Drawing.Font("宋体", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
            this.statusStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
            this.toolStripStatusLabel1,
            this.toolStripStatusLabel3,
            this.toolStripStatusLabel9,
            this.toolStripStatusLabel2});
            this.statusStrip1.Location = new System.Drawing.Point(3, 674);
            this.statusStrip1.Name = "statusStrip1";
            this.statusStrip1.Size = new System.Drawing.Size(634, 22);
            this.statusStrip1.TabIndex = 5;
            this.statusStrip1.Text = "statusStrip1";
            // 
            // toolStripStatusLabel1
            // 
            this.toolStripStatusLabel1.Name = "toolStripStatusLabel1";
            this.toolStripStatusLabel1.Size = new System.Drawing.Size(39, 17);
            this.toolStripStatusLabel1.Text = "X,Y:";
            // 
            // toolStripStatusLabel3
            // 
            this.toolStripStatusLabel3.Name = "toolStripStatusLabel3";
            this.toolStripStatusLabel3.Size = new System.Drawing.Size(103, 17);
            this.toolStripStatusLabel3.Text = "            ";
            // 
            // toolStripStatusLabel9
            // 
            this.toolStripStatusLabel9.Name = "toolStripStatusLabel9";
            this.toolStripStatusLabel9.Size = new System.Drawing.Size(107, 17);
            this.toolStripStatusLabel9.Text = "   系统时间: ";
            // 
            // toolStripStatusLabel2
            // 
            this.toolStripStatusLabel2.Name = "toolStripStatusLabel2";
            this.toolStripStatusLabel2.Size = new System.Drawing.Size(0, 17);
            // 
            // textBox1
            // 
            this.textBox1.Enabled = false;
            this.textBox1.Location = new System.Drawing.Point(97, 27);
            this.textBox1.Name = "textBox1";
            this.textBox1.Size = new System.Drawing.Size(533, 29);
            this.textBox1.TabIndex = 2;
            this.textBox1.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.textBox1_KeyPress);
            // 
            // textBox10
            // 
            this.textBox10.Enabled = false;
            this.textBox10.Location = new System.Drawing.Point(97, 513);
            this.textBox10.Name = "textBox10";
            this.textBox10.Size = new System.Drawing.Size(533, 29);
            this.textBox10.TabIndex = 2;
            this.textBox10.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.textBox10_KeyPress);
            // 
            // label2
            // 
            this.label2.AutoSize = true;
            this.label2.BackColor = System.Drawing.Color.LightCoral;
            this.label2.Location = new System.Drawing.Point(28, 32);
            this.label2.Name = "label2";
            this.label2.Size = new System.Drawing.Size(49, 19);
            this.label2.TabIndex = 0;
            this.label2.Text = "ISN:";
            // 
            // textBox9
            // 
            this.textBox9.Enabled = false;
            this.textBox9.Location = new System.Drawing.Point(97, 459);
            this.textBox9.Name = "textBox9";
            this.textBox9.Size = new System.Drawing.Size(533, 29);
            this.textBox9.TabIndex = 2;
            this.textBox9.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.textBox9_KeyPress);
            // 
            // label11
            // 
            this.label11.AutoSize = true;
            this.label11.BackColor = System.Drawing.Color.LightPink;
            this.label11.Location = new System.Drawing.Point(9, 518);
            this.label11.Name = "label11";
            this.label11.Size = new System.Drawing.Size(87, 19);
            this.label11.TabIndex = 0;
            this.label11.Text = "条码_10:";
            // 
            // textBox2
            // 
            this.textBox2.Enabled = false;
            this.textBox2.Location = new System.Drawing.Point(97, 79);
            this.textBox2.Name = "textBox2";
            this.textBox2.Size = new System.Drawing.Size(533, 29);
            this.textBox2.TabIndex = 2;
            this.textBox2.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.textBox2_KeyPress);
            // 
            // textBox8
            // 
            this.textBox8.Enabled = false;
            this.textBox8.Location = new System.Drawing.Point(97, 405);
            this.textBox8.Name = "textBox8";
            this.textBox8.Size = new System.Drawing.Size(533, 29);
            this.textBox8.TabIndex = 2;
            this.textBox8.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.textBox8_KeyPress);
            // 
            // label3
            // 
            this.label3.AutoSize = true;
            this.label3.BackColor = System.Drawing.Color.LemonChiffon;
            this.label3.Location = new System.Drawing.Point(14, 84);
            this.label3.Name = "label3";
            this.label3.Size = new System.Drawing.Size(77, 19);
            this.label3.TabIndex = 0;
            this.label3.Text = "条码_2:";
            // 
            // label10
            // 
            this.label10.AutoSize = true;
            this.label10.BackColor = System.Drawing.Color.PaleVioletRed;
            this.label10.Location = new System.Drawing.Point(14, 464);
            this.label10.Name = "label10";
            this.label10.Size = new System.Drawing.Size(77, 19);
            this.label10.TabIndex = 0;
            this.label10.Text = "条码_9:";
            // 
            // textBox7
            // 
            this.textBox7.Enabled = false;
            this.textBox7.Location = new System.Drawing.Point(97, 351);
            this.textBox7.Name = "textBox7";
            this.textBox7.Size = new System.Drawing.Size(533, 29);
            this.textBox7.TabIndex = 2;
            this.textBox7.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.textBox7_KeyPress);
            // 
            // textBox3
            // 
            this.textBox3.Enabled = false;
            this.textBox3.Location = new System.Drawing.Point(97, 135);
            this.textBox3.Name = "textBox3";
            this.textBox3.Size = new System.Drawing.Size(533, 29);
            this.textBox3.TabIndex = 2;
            this.textBox3.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.textBox3_KeyPress);
            // 
            // textBox6
            // 
            this.textBox6.Enabled = false;
            this.textBox6.Location = new System.Drawing.Point(97, 297);
            this.textBox6.Name = "textBox6";
            this.textBox6.Size = new System.Drawing.Size(533, 29);
            this.textBox6.TabIndex = 2;
            this.textBox6.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.textBox6_KeyPress);
            // 
            // label9
            // 
            this.label9.AutoSize = true;
            this.label9.BackColor = System.Drawing.Color.MediumSlateBlue;
            this.label9.Location = new System.Drawing.Point(14, 410);
            this.label9.Name = "label9";
            this.label9.Size = new System.Drawing.Size(77, 19);
            this.label9.TabIndex = 0;
            this.label9.Text = "条码_8:";
            // 
            // label4
            // 
            this.label4.AutoSize = true;
            this.label4.BackColor = System.Drawing.Color.YellowGreen;
            this.label4.Location = new System.Drawing.Point(14, 140);
            this.label4.Name = "label4";
            this.label4.Size = new System.Drawing.Size(77, 19);
            this.label4.TabIndex = 0;
            this.label4.Text = "条码_3:";
            // 
            // textBox5
            // 
            this.textBox5.Enabled = false;
            this.textBox5.Location = new System.Drawing.Point(97, 243);
            this.textBox5.Name = "textBox5";
            this.textBox5.Size = new System.Drawing.Size(533, 29);
            this.textBox5.TabIndex = 2;
            this.textBox5.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.textBox5_KeyPress);
            // 
            // textBox4
            // 
            this.textBox4.Enabled = false;
            this.textBox4.Location = new System.Drawing.Point(97, 189);
            this.textBox4.Name = "textBox4";
            this.textBox4.Size = new System.Drawing.Size(533, 29);
            this.textBox4.TabIndex = 2;
            this.textBox4.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.textBox4_KeyPress);
            // 
            // label8
            // 
            this.label8.AutoSize = true;
            this.label8.BackColor = System.Drawing.Color.RoyalBlue;
            this.label8.Location = new System.Drawing.Point(14, 356);
            this.label8.Name = "label8";
            this.label8.Size = new System.Drawing.Size(77, 19);
            this.label8.TabIndex = 0;
            this.label8.Text = "条码_7:";
            // 
            // label5
            // 
            this.label5.AutoSize = true;
            this.label5.BackColor = System.Drawing.Color.SpringGreen;
            this.label5.Location = new System.Drawing.Point(14, 194);
            this.label5.Name = "label5";
            this.label5.Size = new System.Drawing.Size(77, 19);
            this.label5.TabIndex = 0;
            this.label5.Text = "条码_4:";
            // 
            // label6
            // 
            this.label6.AutoSize = true;
            this.label6.BackColor = System.Drawing.Color.LightSeaGreen;
            this.label6.Location = new System.Drawing.Point(14, 248);
            this.label6.Name = "label6";
            this.label6.Size = new System.Drawing.Size(77, 19);
            this.label6.TabIndex = 0;
            this.label6.Text = "条码_5:";
            // 
            // label7
            // 
            this.label7.AutoSize = true;
            this.label7.BackColor = System.Drawing.Color.DeepSkyBlue;
            this.label7.Location = new System.Drawing.Point(14, 302);
            this.label7.Name = "label7";
            this.label7.Size = new System.Drawing.Size(77, 19);
            this.label7.TabIndex = 0;
            this.label7.Text = "条码_6:";
            // 
            // comboBox3
            // 
            this.comboBox3.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.SuggestAppend;
            this.comboBox3.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems;
            this.comboBox3.Enabled = false;
            this.comboBox3.FormattingEnabled = true;
            this.comboBox3.Location = new System.Drawing.Point(426, 29);
            this.comboBox3.Name = "comboBox3";
            this.comboBox3.Size = new System.Drawing.Size(214, 27);
            this.comboBox3.TabIndex = 1;
            this.comboBox3.SelectedIndexChanged += new System.EventHandler(this.comboBox3_SelectedIndexChanged);
            // 
            // comboBox2
            // 
            this.comboBox2.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.SuggestAppend;
            this.comboBox2.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems;
            this.comboBox2.Enabled = false;
            this.comboBox2.FormattingEnabled = true;
            this.comboBox2.Location = new System.Drawing.Point(107, 29);
            this.comboBox2.Name = "comboBox2";
            this.comboBox2.Size = new System.Drawing.Size(214, 27);
            this.comboBox2.TabIndex = 1;
            this.comboBox2.SelectedIndexChanged += new System.EventHandler(this.comboBox2_SelectedIndexChanged);
            // 
            // comboBox1
            // 
            this.comboBox1.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.SuggestAppend;
            this.comboBox1.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems;
            this.comboBox1.Enabled = false;
            this.comboBox1.FormattingEnabled = true;
            this.comboBox1.Items.AddRange(new object[] {
            "2",
            "3",
            "4",
            "5",
            "6",
            "7",
            "8",
            "9",
            "10"});
            this.comboBox1.Location = new System.Drawing.Point(107, 69);
            this.comboBox1.Name = "comboBox1";
            this.comboBox1.Size = new System.Drawing.Size(214, 27);
            this.comboBox1.TabIndex = 1;
            this.comboBox1.SelectedIndexChanged += new System.EventHandler(this.comboBox1_SelectedIndexChanged);
            // 
            // label15
            // 
            this.label15.AutoSize = true;
            this.label15.BackColor = System.Drawing.Color.Lime;
            this.label15.Location = new System.Drawing.Point(335, 33);
            this.label15.Name = "label15";
            this.label15.Size = new System.Drawing.Size(85, 19);
            this.label15.TabIndex = 0;
            this.label15.Text = "产品名称";
            // 
            // label12
            // 
            this.label12.AutoSize = true;
            this.label12.BackColor = System.Drawing.Color.GreenYellow;
            this.label12.Location = new System.Drawing.Point(36, 33);
            this.label12.Name = "label12";
            this.label12.Size = new System.Drawing.Size(67, 19);
            this.label12.TabIndex = 0;
            this.label12.Text = "客户  ";
            // 
            // label14
            // 
            this.label14.AutoSize = true;
            this.label14.BackColor = System.Drawing.Color.MediumSpringGreen;
            this.label14.Location = new System.Drawing.Point(332, 72);
            this.label14.Name = "label14";
            this.label14.Size = new System.Drawing.Size(85, 19);
            this.label14.TabIndex = 0;
            this.label14.Text = "订单完成";
            // 
            // label1
            // 
            this.label1.AutoSize = true;
            this.label1.BackColor = System.Drawing.Color.ForestGreen;
            this.label1.Location = new System.Drawing.Point(35, 72);
            this.label1.Name = "label1";
            this.label1.Size = new System.Drawing.Size(66, 19);
            this.label1.TabIndex = 0;
            this.label1.Text = "合码数";
            // 
            // timer1
            // 
            this.timer1.Enabled = true;
            this.timer1.Tick += new System.EventHandler(this.timer1_Tick);
            // 
            // label16
            // 
            this.label16.AutoSize = true;
            this.label16.BackColor = System.Drawing.Color.ForestGreen;
            this.label16.Location = new System.Drawing.Point(624, 80);
            this.label16.Name = "label16";
            this.label16.Size = new System.Drawing.Size(39, 19);
            this.label16.TabIndex = 0;
            this.label16.Text = "PCS";
            // 
            // Yards
            // 
            this.AutoScaleDimensions = new System.Drawing.SizeF(10F, 19F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(683, 832);
            this.Controls.Add(this.groupBox1);
            this.Controls.Add(this.label16);
            this.Font = new System.Drawing.Font("宋体", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
            this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
            this.Margin = new System.Windows.Forms.Padding(5);
            this.MaximizeBox = false;
            this.MinimizeBox = false;
            this.Name = "Yards";
            this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
            this.Text = "FEREX.整机多码合一工具V1.00";
            this.Load += new System.EventHandler(this.Yards_Load);
            this.MouseMove += new System.Windows.Forms.MouseEventHandler(this.Yards_MouseMove);
            this.groupBox1.ResumeLayout(false);
            this.groupBox1.PerformLayout();
            this.groupBox2.ResumeLayout(false);
            this.groupBox2.PerformLayout();
            this.groupBox3.ResumeLayout(false);
            this.groupBox3.PerformLayout();
            this.statusStrip1.ResumeLayout(false);
            this.statusStrip1.PerformLayout();
            this.ResumeLayout(false);
            this.PerformLayout();

        }

        #endregion

        private System.Windows.Forms.GroupBox groupBox1;
        private System.Windows.Forms.ComboBox comboBox1;
        private System.Windows.Forms.Label label1;
        private System.Windows.Forms.TextBox textBox1;
        private System.Windows.Forms.Label label11;
        private System.Windows.Forms.Label label10;
        private System.Windows.Forms.Label label9;
        private System.Windows.Forms.Label label8;
        private System.Windows.Forms.Label label7;
        private System.Windows.Forms.Label label6;
        private System.Windows.Forms.Label label5;
        private System.Windows.Forms.Label label4;
        private System.Windows.Forms.Label label3;
        private System.Windows.Forms.Label label2;
        private System.Windows.Forms.TextBox textBox10;
        private System.Windows.Forms.TextBox textBox9;
        private System.Windows.Forms.TextBox textBox8;
        private System.Windows.Forms.TextBox textBox7;
        private System.Windows.Forms.TextBox textBox6;
        private System.Windows.Forms.TextBox textBox5;
        private System.Windows.Forms.TextBox textBox4;
        private System.Windows.Forms.TextBox textBox3;
        private System.Windows.Forms.TextBox textBox2;
        private System.Windows.Forms.GroupBox groupBox2;
        private System.Windows.Forms.ComboBox comboBox2;
        private System.Windows.Forms.Label label12;
        private System.Windows.Forms.StatusStrip statusStrip1;
        private System.Windows.Forms.ToolStripStatusLabel toolStripStatusLabel1;
        private System.Windows.Forms.ToolStripStatusLabel toolStripStatusLabel3;
        private System.Windows.Forms.ToolStripStatusLabel toolStripStatusLabel9;
        private System.Windows.Forms.Timer timer1;
        private System.Windows.Forms.ToolStripStatusLabel toolStripStatusLabel2;
        private System.Windows.Forms.GroupBox groupBox3;
        private System.Windows.Forms.Label label13;
        private System.Windows.Forms.TextBox textBox12;
        private System.Windows.Forms.Label label15;
        private System.Windows.Forms.Label label14;
        private System.Windows.Forms.Label label16;
        private System.Windows.Forms.ComboBox comboBox3;
    }
}

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
C#SQL Server的Web环境中,可以使用ASP.NET来构建Web应用程序。ASP.NET是一个跨平台的Web应用程序框架,它支持多种编程语言,包括C#和Visual Basic。ASP.NET提供了丰富的库和工具,可以帮助开发者快速构建高质量的Web应用程序。 在ASP.NET中,可以使用ADO.NET来访问和操作SQL Server数据库。ADO.NET是一个用于访问数据的类库,它提供了一组类和方法,可以帮助开发者连接数据库、执行SQL查询、读取和写入数据等。可以使用C#编写代码来访问和操作SQL Server数据库,例如: ```csharp using System.Data.SqlClient; // 创建连接字符串 string connectionString = "Data Source=myServerAddress;Initial Catalog=myDataBase;User Id=myUsername;Password=myPassword;" // 创建SQL查询 string query = "SELECT * FROM myTable"; // 创建连接对象和命令对象 SqlConnection connection = new SqlConnection(connectionString); SqlCommand command = new SqlCommand(query, connection); // 打开数据库连接 connection.Open(); // 执行查询并读取数据 SqlDataReader reader = command.ExecuteReader(); while (reader.Read()) { // 读取数据 string name = reader.GetString(0); int age = reader.GetInt32(1); // ... } // 关闭连接和读取器 reader.Close(); connection.Close(); ``` 除了使用原生的ADO.NET,还可以使用Entity Framework来访问和操作SQL Server数据库。Entity Framework是一个ORM(对象关系映射)框架,可以将数据库表映射为C#对象,并提供了一组API来访问和操作这些对象。使用Entity Framework可以大大简化代码编写和数据库操作。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值