📄 buybooks.cs
字号:
using System;
using System.Data;
using System.Data.SqlClient;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Globalization;
namespace Library
{
/// <summary>
/// BuyBooks 的摘要说明。
/// </summary>
public class BuyBooks : System.Windows.Forms.Form
{
private System.Windows.Forms.GroupBox groupBox1;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.Label label5;
private System.Windows.Forms.Label label6;
private System.Windows.Forms.Label label7;
private System.Windows.Forms.Label label8;
private System.Windows.Forms.Label label9;
private System.Windows.Forms.TextBox textBox1;
private System.Windows.Forms.TextBox textBox2;
private System.Windows.Forms.TextBox textBox3;
private System.Windows.Forms.TextBox textBox4;
private System.Windows.Forms.TextBox textBox5;
private System.Windows.Forms.DateTimePicker dateTimePicker1;
private System.Windows.Forms.DateTimePicker dateTimePicker2;
private System.Windows.Forms.ComboBox comboBox1;
private System.Windows.Forms.TextBox textBox6;
private System.Windows.Forms.Button btnAddNewBook;
private System.Windows.Forms.Button btnCancel;
private System.Windows.Forms.Label label12;
private System.Windows.Forms.Label label13;
private System.Windows.Forms.Label label14;
private System.Windows.Forms.Label label15;
private System.Windows.Forms.Label label11;
private System.Windows.Forms.DateTimePicker dateTimePicker3;
private System.Windows.Forms.Label label10;
private System.Windows.Forms.ComboBox comboBox2;
private System.Windows.Forms.Label label16;
private System.Windows.Forms.ComboBox comboBox3;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.Label label17;
private System.Windows.Forms.Label label18;
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.Container components = null;
private SqlCommand cmd;
private SqlDataReader dr;
/// <summary>
/// 是否是修改模式
/// </summary>
private bool isUpdate = false;
/// <summary>
/// 修改模式下图书条码
/// </summary>
private string bookt = "";
public BuyBooks(bool IsUpdate,string bot)
{
//
// Windows 窗体设计器支持所必需的
//
InitializeComponent();
cmd = Global.conn.CreateCommand();
if(!IsUpdate)
{
isUpdate = IsUpdate;
initializeScreen();
}
else
{
isUpdate = IsUpdate;
bookt = bot;
initializeScreen(bot);
}
}
/// <summary>
/// 清理所有正在使用的资源。
/// </summary>
protected override void Dispose( bool disposing )
{
if( disposing )
{
if(components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}
#region Windows 窗体设计器生成的代码
/// <summary>
/// 设计器支持所需的方法 - 不要使用代码编辑器修改
/// 此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.label17 = new System.Windows.Forms.Label();
this.label3 = new System.Windows.Forms.Label();
this.comboBox3 = new System.Windows.Forms.ComboBox();
this.label16 = new System.Windows.Forms.Label();
this.comboBox2 = new System.Windows.Forms.ComboBox();
this.label10 = new System.Windows.Forms.Label();
this.dateTimePicker3 = new System.Windows.Forms.DateTimePicker();
this.label11 = new System.Windows.Forms.Label();
this.label15 = new System.Windows.Forms.Label();
this.label14 = new System.Windows.Forms.Label();
this.label13 = new System.Windows.Forms.Label();
this.textBox6 = new System.Windows.Forms.TextBox();
this.comboBox1 = new System.Windows.Forms.ComboBox();
this.dateTimePicker2 = new System.Windows.Forms.DateTimePicker();
this.dateTimePicker1 = new System.Windows.Forms.DateTimePicker();
this.textBox5 = new System.Windows.Forms.TextBox();
this.textBox4 = new System.Windows.Forms.TextBox();
this.textBox3 = new System.Windows.Forms.TextBox();
this.textBox2 = new System.Windows.Forms.TextBox();
this.textBox1 = new System.Windows.Forms.TextBox();
this.label9 = new System.Windows.Forms.Label();
this.label8 = new System.Windows.Forms.Label();
this.label7 = new System.Windows.Forms.Label();
this.label6 = new System.Windows.Forms.Label();
this.label5 = new System.Windows.Forms.Label();
this.label4 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.label1 = new System.Windows.Forms.Label();
this.btnAddNewBook = new System.Windows.Forms.Button();
this.btnCancel = new System.Windows.Forms.Button();
this.label12 = new System.Windows.Forms.Label();
this.label18 = new System.Windows.Forms.Label();
this.groupBox1.SuspendLayout();
this.SuspendLayout();
//
// groupBox1
//
this.groupBox1.Controls.Add(this.label17);
this.groupBox1.Controls.Add(this.label3);
this.groupBox1.Controls.Add(this.comboBox3);
this.groupBox1.Controls.Add(this.label16);
this.groupBox1.Controls.Add(this.comboBox2);
this.groupBox1.Controls.Add(this.label10);
this.groupBox1.Controls.Add(this.dateTimePicker3);
this.groupBox1.Controls.Add(this.label11);
this.groupBox1.Controls.Add(this.label15);
this.groupBox1.Controls.Add(this.label14);
this.groupBox1.Controls.Add(this.label13);
this.groupBox1.Controls.Add(this.textBox6);
this.groupBox1.Controls.Add(this.comboBox1);
this.groupBox1.Controls.Add(this.dateTimePicker2);
this.groupBox1.Controls.Add(this.dateTimePicker1);
this.groupBox1.Controls.Add(this.textBox5);
this.groupBox1.Controls.Add(this.textBox4);
this.groupBox1.Controls.Add(this.textBox3);
this.groupBox1.Controls.Add(this.textBox2);
this.groupBox1.Controls.Add(this.textBox1);
this.groupBox1.Controls.Add(this.label9);
this.groupBox1.Controls.Add(this.label8);
this.groupBox1.Controls.Add(this.label7);
this.groupBox1.Controls.Add(this.label6);
this.groupBox1.Controls.Add(this.label5);
this.groupBox1.Controls.Add(this.label4);
this.groupBox1.Controls.Add(this.label2);
this.groupBox1.Controls.Add(this.label1);
this.groupBox1.FlatStyle = System.Windows.Forms.FlatStyle.System;
this.groupBox1.Location = new System.Drawing.Point(8, 8);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(432, 360);
this.groupBox1.TabIndex = 0;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "图书信息";
//
// label17
//
this.label17.AutoSize = true;
this.label17.ForeColor = System.Drawing.Color.Red;
this.label17.Location = new System.Drawing.Point(224, 152);
this.label17.Name = "label17";
this.label17.Size = new System.Drawing.Size(17, 17);
this.label17.TabIndex = 39;
this.label17.Text = "2*";
this.label17.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// label3
//
this.label3.AutoSize = true;
this.label3.ForeColor = System.Drawing.Color.Red;
this.label3.Location = new System.Drawing.Point(224, 72);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(17, 17);
this.label3.TabIndex = 38;
this.label3.Text = "1*";
this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// comboBox3
//
this.comboBox3.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.comboBox3.Location = new System.Drawing.Point(296, 317);
this.comboBox3.Name = "comboBox3";
this.comboBox3.Size = new System.Drawing.Size(121, 20);
this.comboBox3.TabIndex = 9;
//
// label16
//
this.label16.AutoSize = true;
this.label16.Location = new System.Drawing.Point(400, 196);
this.label16.Name = "label16";
this.label16.Size = new System.Drawing.Size(17, 17);
this.label16.TabIndex = 35;
this.label16.Text = "元";
//
// comboBox2
//
this.comboBox2.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.comboBox2.Location = new System.Drawing.Point(88, 276);
this.comboBox2.Name = "comboBox2";
this.comboBox2.Size = new System.Drawing.Size(328, 20);
this.comboBox2.TabIndex = 13;
//
// label10
//
this.label10.AutoSize = true;
this.label10.Location = new System.Drawing.Point(232, 319);
this.label10.Name = "label10";
this.label10.Size = new System.Drawing.Size(54, 17);
this.label10.TabIndex = 33;
this.label10.Text = "书架名称";
//
// dateTimePicker3
//
this.dateTimePicker3.Location = new System.Drawing.Point(88, 317);
this.dateTimePicker3.Name = "dateTimePicker3";
this.dateTimePicker3.ShowUpDown = true;
this.dateTimePicker3.Size = new System.Drawing.Size(136, 21);
this.dateTimePicker3.TabIndex = 8;
//
// label11
//
this.label11.AutoSize = true;
this.label11.FlatStyle = System.Windows.Forms.FlatStyle.System;
this.label11.ForeColor = System.Drawing.Color.Red;
this.label11.Location = new System.Drawing.Point(304, 32);
this.label11.Name = "label11";
this.label11.Size = new System.Drawing.Size(79, 17);
this.label11.TabIndex = 27;
this.label11.Text = "<条码枪输入>";
//
// label15
//
this.label15.AutoSize = true;
this.label15.Location = new System.Drawing.Point(24, 319);
this.label15.Name = "label15";
this.label15.Size = new System.Drawing.Size(54, 17);
this.label15.TabIndex = 26;
this.label15.Text = "入库日期";
//
// label14
//
this.label14.AutoSize = true;
this.label14.Location = new System.Drawing.Point(232, 237);
this.label14.Name = "label14";
this.label14.Size = new System.Drawing.Size(54, 17);
this.label14.TabIndex = 24;
this.label14.Text = "编码日期";
//
// label13
//
this.label13.AutoSize = true;
this.label13.Location = new System.Drawing.Point(24, 278);
this.label13.Name = "label13";
this.label13.Size = new System.Drawing.Size(54, 17);
this.label13.TabIndex = 22;
this.label13.Text = "图书类型";
//
// textBox6
//
this.textBox6.Location = new System.Drawing.Point(296, 194);
this.textBox6.Name = "textBox6";
this.textBox6.Size = new System.Drawing.Size(96, 21);
this.textBox6.TabIndex = 5;
this.textBox6.Text = "0";
this.textBox6.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
//
// comboBox1
//
this.comboBox1.Location = new System.Drawing.Point(88, 194);
this.comboBox1.Name = "comboBox1";
this.comboBox1.Size = new System.Drawing.Size(136, 20);
this.comboBox1.TabIndex = 12;
//
// dateTimePicker2
//
this.dateTimePicker2.Location = new System.Drawing.Point(296, 235);
this.dateTimePicker2.Name = "dateTimePicker2";
this.dateTimePicker2.ShowUpDown = true;
this.dateTimePicker2.Size = new System.Drawing.Size(120, 21);
this.dateTimePicker2.TabIndex = 7;
//
// dateTimePicker1
//
this.dateTimePicker1.Location = new System.Drawing.Point(88, 235);
this.dateTimePicker1.Name = "dateTimePicker1";
this.dateTimePicker1.ShowUpDown = true;
this.dateTimePicker1.Size = new System.Drawing.Size(120, 21);
this.dateTimePicker1.TabIndex = 6;
//
// textBox5
//
this.textBox5.Location = new System.Drawing.Point(296, 153);
this.textBox5.Name = "textBox5";
this.textBox5.Size = new System.Drawing.Size(112, 21);
this.textBox5.TabIndex = 4;
this.textBox5.Text = "";
//
// textBox4
//
this.textBox4.Location = new System.Drawing.Point(88, 153);
this.textBox4.Name = "textBox4";
this.textBox4.Size = new System.Drawing.Size(136, 21);
this.textBox4.TabIndex = 3;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -