clientbookin.cs
来自「详细的宾馆管理实现 用Visual Studio 2005实现」· CS 代码 · 共 394 行 · 第 1/2 页
CS
394 行
this.label4.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// label3
//
this.label3.BackColor = System.Drawing.Color.White;
this.label3.Location = new System.Drawing.Point(8, 74);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(56, 25);
this.label3.TabIndex = 9;
this.label3.Text = "顾客性别";
this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// label6
//
this.label6.BackColor = System.Drawing.Color.White;
this.label6.Location = new System.Drawing.Point(8, 45);
this.label6.Name = "label6";
this.label6.Size = new System.Drawing.Size(56, 25);
this.label6.TabIndex = 6;
this.label6.Text = "顾客姓名";
this.label6.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// label2
//
this.label2.BackColor = System.Drawing.Color.White;
this.label2.Location = new System.Drawing.Point(8, 16);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(56, 25);
this.label2.TabIndex = 2;
this.label2.Text = "顾客ID";
this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.label2.Click += new System.EventHandler(this.label2_Click);
//
// label1
//
this.label1.BackColor = System.Drawing.Color.White;
this.label1.Location = new System.Drawing.Point(104, 16);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(48, 25);
this.label1.TabIndex = 1;
this.label1.Text = "房间号";
this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// btnSave
//
this.btnSave.BackColor = System.Drawing.Color.LightGray;
this.btnSave.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.btnSave.Location = new System.Drawing.Point(328, 200);
this.btnSave.Name = "btnSave";
this.btnSave.Size = new System.Drawing.Size(56, 24);
this.btnSave.TabIndex = 23;
this.btnSave.Text = "确定";
this.btnSave.UseVisualStyleBackColor = false;
this.btnSave.Click += new System.EventHandler(this.btnSave_Click);
//
// btnCancel
//
this.btnCancel.BackColor = System.Drawing.Color.LightGray;
this.btnCancel.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
this.btnCancel.Location = new System.Drawing.Point(224, 200);
this.btnCancel.Name = "btnCancel";
this.btnCancel.Size = new System.Drawing.Size(56, 23);
this.btnCancel.TabIndex = 24;
this.btnCancel.Text = "取消";
this.btnCancel.UseVisualStyleBackColor = false;
this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click);
//
// btnReset
//
this.btnReset.BackColor = System.Drawing.Color.LightGray;
this.btnReset.Location = new System.Drawing.Point(128, 200);
this.btnReset.Name = "btnReset";
this.btnReset.Size = new System.Drawing.Size(56, 23);
this.btnReset.TabIndex = 25;
this.btnReset.Text = "清空";
this.btnReset.UseVisualStyleBackColor = false;
this.btnReset.Click += new System.EventHandler(this.btnReset_Click);
//
// groupBox1
//
this.groupBox1.Controls.Add(this.label2);
this.groupBox1.Controls.Add(this.textClientID);
this.groupBox1.Controls.Add(this.label6);
this.groupBox1.Controls.Add(this.textClientName);
this.groupBox1.Controls.Add(this.label3);
this.groupBox1.Controls.Add(this.comboSex);
this.groupBox1.Controls.Add(this.comboNativePlace);
this.groupBox1.Controls.Add(this.label4);
this.groupBox1.Location = new System.Drawing.Point(232, 16);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(256, 136);
this.groupBox1.TabIndex = 28;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "顾客信息";
//
// textBox1
//
this.textBox1.Location = new System.Drawing.Point(13, 231);
this.textBox1.Name = "textBox1";
this.textBox1.Size = new System.Drawing.Size(100, 21);
this.textBox1.TabIndex = 29;
this.textBox1.TextChanged += new System.EventHandler(this.textBox1_TextChanged);
//
// ClientBookIn
//
this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
this.BackColor = System.Drawing.SystemColors.Window;
this.ClientSize = new System.Drawing.Size(536, 270);
this.Controls.Add(this.textBox1);
this.Controls.Add(this.groupBox1);
this.Controls.Add(this.btnReset);
this.Controls.Add(this.btnCancel);
this.Controls.Add(this.btnSave);
this.Controls.Add(this.label1);
this.Controls.Add(this.textRoomID);
this.Controls.Add(this.textRemark);
this.Controls.Add(this.label5);
this.Controls.Add(this.dateTimePicker1);
this.Controls.Add(this.label7);
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.Name = "ClientBookIn";
this.Text = "客户入住";
this.Load += new System.EventHandler(this.ClientBookIn_Load);
this.groupBox1.ResumeLayout(false);
this.groupBox1.PerformLayout();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private void btnSave_Click(object sender, System.EventArgs e)
{
string clientID=this.textClientID.Text;
string clientName=this.textClientName.Text;
string clientSex=this.comboSex.Text;
string clientNativePlace=this.comboNativePlace.Text;
string roomID=this.textRoomID.Text;
System.DateTime inDate=this.dateTimePicker1.Value;
string remark=this.textRemark.Text;
if(this.clientbookin.Client_Add(clientID,clientName,clientSex,clientNativePlace)==true)
{
MessageBox.Show("入住成功");
}
else
{
MessageBox.Show("入住失败");
return;
}
if(this.clientbookin.ClientBookIn_Add(clientID,roomID,inDate,remark)==true)
{
this.Close();
}
}
private void btnReset_Click(object sender, System.EventArgs e)
{
this.textClientID.Clear();
this.textClientName.Clear();
this.textRemark.Clear();
this.comboNativePlace.Text="";
this.comboSex.Text="";
}
private void btnCancel_Click(object sender, System.EventArgs e)
{
this.Close();
}
private void label2_Click(object sender, System.EventArgs e)
{
}
private void textRoomID_TextChanged(object sender, EventArgs e)
{
}
private void ClientBookIn_Load(object sender, EventArgs e)
{
}
private void textBox1_TextChanged(object sender, EventArgs e)
{
char[] m ={ '1', '2' };
this.textBox1.Text = m.ToString();
}
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?