📄 frmkaidan.cs
字号:
this.label7.Size = new System.Drawing.Size(56, 16);
this.label7.TabIndex = 28;
this.label7.Text = "收银员:";
//
// dateTimePicker1
//
this.dateTimePicker1.Format = System.Windows.Forms.DateTimePickerFormat.Short;
this.dateTimePicker1.Location = new System.Drawing.Point(264, 104);
this.dateTimePicker1.Name = "dateTimePicker1";
this.dateTimePicker1.Size = new System.Drawing.Size(112, 21);
this.dateTimePicker1.TabIndex = 27;
//
// textBox3
//
this.textBox3.Location = new System.Drawing.Point(72, 136);
this.textBox3.Multiline = true;
this.textBox3.Name = "textBox3";
this.textBox3.Size = new System.Drawing.Size(480, 32);
this.textBox3.TabIndex = 26;
this.textBox3.Text = "";
//
// label6
//
this.label6.Location = new System.Drawing.Point(8, 144);
this.label6.Name = "label6";
this.label6.Size = new System.Drawing.Size(48, 16);
this.label6.TabIndex = 25;
this.label6.Text = "备注:";
//
// label3
//
this.label3.Location = new System.Drawing.Point(200, 104);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(72, 24);
this.label3.TabIndex = 23;
this.label3.Text = "点菜时间:";
//
// textBox8
//
this.textBox8.Location = new System.Drawing.Point(264, 64);
this.textBox8.Name = "textBox8";
this.textBox8.Size = new System.Drawing.Size(104, 21);
this.textBox8.TabIndex = 19;
this.textBox8.Text = "";
//
// label10
//
this.label10.Location = new System.Drawing.Point(200, 64);
this.label10.Name = "label10";
this.label10.Size = new System.Drawing.Size(48, 16);
this.label10.TabIndex = 18;
this.label10.Text = "卡号:";
//
// textBox7
//
this.textBox7.Location = new System.Drawing.Point(448, 24);
this.textBox7.Name = "textBox7";
this.textBox7.Size = new System.Drawing.Size(104, 21);
this.textBox7.TabIndex = 17;
this.textBox7.Text = "";
this.textBox7.Leave += new System.EventHandler(this.textBox7_Leave);
//
// label9
//
this.label9.Location = new System.Drawing.Point(384, 24);
this.label9.Name = "label9";
this.label9.Size = new System.Drawing.Size(72, 24);
this.label9.TabIndex = 16;
this.label9.Text = "客人人数:";
//
// label2
//
this.label2.Location = new System.Drawing.Point(192, 24);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(72, 16);
this.label2.TabIndex = 14;
this.label2.Text = "客人姓名:";
//
// label5
//
this.label5.Location = new System.Drawing.Point(8, 104);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(72, 16);
this.label5.TabIndex = 4;
this.label5.Text = "点菜:";
this.label5.Click += new System.EventHandler(this.label5_Click);
//
// textBox2
//
this.textBox2.Enabled = false;
this.textBox2.Location = new System.Drawing.Point(72, 16);
this.textBox2.Name = "textBox2";
this.textBox2.Size = new System.Drawing.Size(104, 21);
this.textBox2.TabIndex = 3;
this.textBox2.Text = "";
//
// label4
//
this.label4.Location = new System.Drawing.Point(8, 24);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(64, 16);
this.label4.TabIndex = 2;
this.label4.Text = "餐台号:";
//
// listView1
//
this.listView1.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
this.columnHeader1,
this.columnHeader6,
this.columnHeader2,
this.columnHeader3});
this.listView1.FullRowSelect = true;
this.listView1.GridLines = true;
this.listView1.Location = new System.Drawing.Point(0, 0);
this.listView1.Name = "listView1";
this.listView1.Size = new System.Drawing.Size(600, 248);
this.listView1.TabIndex = 5;
this.listView1.View = System.Windows.Forms.View.Details;
this.listView1.Click += new System.EventHandler(this.listView1_Click);
this.listView1.SelectedIndexChanged += new System.EventHandler(this.listView1_SelectedIndexChanged);
//
// columnHeader1
//
this.columnHeader1.Text = "餐桌号";
this.columnHeader1.Width = 140;
//
// columnHeader6
//
this.columnHeader6.Text = "菜单ID";
this.columnHeader6.Width = 150;
//
// columnHeader2
//
this.columnHeader2.Text = "菜单名";
this.columnHeader2.Width = 150;
//
// columnHeader3
//
this.columnHeader3.Text = "单价";
this.columnHeader3.Width = 150;
//
// frmkaidan
//
this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
this.ClientSize = new System.Drawing.Size(600, 485);
this.Controls.Add(this.listView1);
this.Controls.Add(this.groupBox2);
this.Controls.Add(this.groupBox1);
this.Name = "frmkaidan";
this.ShowInTaskbar = false;
this.Text = "客人开单";
this.Load += new System.EventHandler(this.frmkaidan_Load);
this.groupBox1.ResumeLayout(false);
this.groupBox2.ResumeLayout(false);
this.ResumeLayout(false);
}
#endregion
private void label7_Click(object sender, System.EventArgs e)
{
}
private void frmkaidan_Load(object sender, System.EventArgs e) //将传值
{
this.textBox2.Text=j;
this.textBox6.Text=z;
}
private void textBox1_TextChanged(object sender, System.EventArgs e)
{
}
private void button7_Click(object sender, System.EventArgs e) //退出
{
this.Close();
}
private void button4_Click(object sender, System.EventArgs e) // 对frmmenule的界面定位
{
int x=Control.MousePosition.X;
int y=Control.MousePosition.Y;
frmmenule menulei=new frmmenule(this.listView1,j,this.textBox6.Text);
menulei.Location = new System.Drawing.Point(x,y);
menulei.ShowDialog();
}
private void button1_Click(object sender, System.EventArgs e) //保存开单
{
//ListViewItem lst=new ListViewItem();
//lst.SubItems[0].Text="2";
//lst.SubItems.Add("1");
// this.listView1.Items.Remove(this.listView1.SelectedItems[0]);
if(zuowei.updatekaidan(this.textBox2.Text,this.textBox4.Text,this.textBox7.Text,this.textBox6.Text,this.textBox8.Text,this.textBox5.Text,this.dateTimePicker1.Text,this.textBox1.Text,this.textBox3.Text,empty))
{
if(this.listView1.Items.Count>0)//判断数据是否为空
{
bool pd=true;//定个判断值
for(int i=0;i<this.listView1.Items.Count;i++)//循环lv1的行
{
cs.diancai dcsq=new bggl.cs.diancai();
//把i行1,2,3,4列的值传给insertexe方法返回是否成功
pd=dcsq.insertexe(this.listView1.Items[i].SubItems[0].Text,this.listView1.Items[i].SubItems[1].Text,this.listView1.Items[i].SubItems[2].Text,this.listView1.Items[i].SubItems[3].Text);
}
if(pd==true){
MessageBox.Show("开单成功");
}
}
else{
MessageBox.Show("菜单为空,请点菜后再开单");
}
}
}
private void listView1_SelectedIndexChanged(object sender, System.EventArgs e)
{
}
private void button2_Click(object sender, System.EventArgs e) //从点菜报表中移除已点的菜
{
if(zhi.Trim()!="")
{
this.listView1.Items.Remove(this.listView1.SelectedItems[0]);
}
else{
MessageBox.Show("请选择你要移除的菜名");
}
}
private void listView1_Click(object sender, System.EventArgs e) // 传值
{
zhi=this.listView1.SelectedItems[0].SubItems[0].Text;
}
private void button3_Click(object sender, System.EventArgs e) //定位界面
{
int x=Control.MousePosition.X;
int y=Control.MousePosition.Y;
fm.hyxs hyx=new hyxs(this.textBox4,this.textBox5,this.textBox8,2);
//设置出现位置
hyx.Location = new System.Drawing.Point(x, y);
hyx.ShowDialog();
}
private void groupBox2_Enter(object sender, System.EventArgs e)
{
}
private void textBox7_Leave(object sender, System.EventArgs e) //判断textBox7
{
bggl.gong.zhipd pd=new bggl.gong.zhipd();
if(pd.intjc(this.textBox7.Text.Trim())!=true)
{
MessageBox.Show("客人人数只能为数字!");
this.textBox7.Text="";
}
}
private void label5_Click(object sender, System.EventArgs e)
{
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -