📄 frmzdcx.cs
字号:
this.label12.Text = "label12";
//
// label11
//
this.label11.Location = new System.Drawing.Point(8, 120);
this.label11.Name = "label11";
this.label11.Size = new System.Drawing.Size(72, 16);
this.label11.TabIndex = 10;
this.label11.Text = "点菜时间:";
//
// label10
//
this.label10.Location = new System.Drawing.Point(472, 80);
this.label10.Name = "label10";
this.label10.Size = new System.Drawing.Size(88, 24);
this.label10.TabIndex = 9;
this.label10.Text = "label10";
//
// label9
//
this.label9.Location = new System.Drawing.Point(408, 88);
this.label9.Name = "label9";
this.label9.Size = new System.Drawing.Size(48, 16);
this.label9.TabIndex = 8;
this.label9.Text = "卡号:";
//
// label8
//
this.label8.Location = new System.Drawing.Point(288, 80);
this.label8.Name = "label8";
this.label8.Size = new System.Drawing.Size(72, 24);
this.label8.TabIndex = 7;
this.label8.Text = "label8";
//
// label7
//
this.label7.Location = new System.Drawing.Point(216, 88);
this.label7.Name = "label7";
this.label7.Size = new System.Drawing.Size(72, 16);
this.label7.TabIndex = 6;
this.label7.Text = "客人姓名:";
//
// label6
//
this.label6.Location = new System.Drawing.Point(72, 80);
this.label6.Name = "label6";
this.label6.Size = new System.Drawing.Size(96, 24);
this.label6.TabIndex = 5;
this.label6.Text = "label6";
//
// label5
//
this.label5.Location = new System.Drawing.Point(8, 88);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(72, 16);
this.label5.TabIndex = 4;
this.label5.Text = "客人人数:";
//
// label4
//
this.label4.Location = new System.Drawing.Point(464, 40);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(88, 24);
this.label4.TabIndex = 3;
this.label4.Text = "label4";
//
// label3
//
this.label3.Location = new System.Drawing.Point(384, 48);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(72, 16);
this.label3.TabIndex = 2;
this.label3.Text = "所属区域:";
//
// label2
//
this.label2.Location = new System.Drawing.Point(280, 48);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(72, 16);
this.label2.TabIndex = 1;
//
// label1
//
this.label1.Location = new System.Drawing.Point(216, 48);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(56, 16);
this.label1.TabIndex = 0;
this.label1.Text = "餐桌号:";
//
// label24
//
this.label24.Location = new System.Drawing.Point(216, 120);
this.label24.Name = "label24";
this.label24.Size = new System.Drawing.Size(56, 24);
this.label24.TabIndex = 14;
this.label24.Text = "收银员:";
//
// listView1
//
this.listView1.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
this.columnHeader1,
this.columnHeader2,
this.columnHeader3,
this.columnHeader4});
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(576, 192);
this.listView1.TabIndex = 8;
this.listView1.View = System.Windows.Forms.View.Details;
//
// columnHeader1
//
this.columnHeader1.Text = "餐桌号";
this.columnHeader1.Width = 115;
//
// columnHeader2
//
this.columnHeader2.Text = "菜单编号";
this.columnHeader2.Width = 94;
//
// columnHeader3
//
this.columnHeader3.Text = "菜单名";
this.columnHeader3.Width = 130;
//
// columnHeader4
//
this.columnHeader4.Text = "单价";
this.columnHeader4.Width = 90;
//
// button2
//
this.button2.Location = new System.Drawing.Point(432, 416);
this.button2.Name = "button2";
this.button2.Size = new System.Drawing.Size(64, 24);
this.button2.TabIndex = 9;
this.button2.Text = "结帐";
this.button2.Click += new System.EventHandler(this.button2_Click);
//
// button4
//
this.button4.Location = new System.Drawing.Point(512, 416);
this.button4.Name = "button4";
this.button4.Size = new System.Drawing.Size(64, 24);
this.button4.TabIndex = 11;
this.button4.Text = "关闭";
this.button4.Click += new System.EventHandler(this.button4_Click_1);
//
// frmzdcx
//
this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
this.ClientSize = new System.Drawing.Size(576, 445);
this.Controls.Add(this.button4);
this.Controls.Add(this.button2);
this.Controls.Add(this.listView1);
this.Controls.Add(this.groupBox1);
this.Name = "frmzdcx";
this.Text = "帐单查询";
this.Load += new System.EventHandler(this.frmzdcx_Load);
this.groupBox1.ResumeLayout(false);
this.ResumeLayout(false);
}
#endregion
private void frmzdcx_Load(object sender, System.EventArgs e)//传值,付值
{
this.label2.Text=deskc;
this.label4.Text=settypec;
this.label6.Text=knumberc;
this.label8.Text=knamec;
this.label10.Text=khaoc;
this.label12.Text=Ddtimec;
this.label15.Text=spersonc;
this.label20.Text=zkc;
objset=sel.selxianshi(this.label2.Text);
this.listView1.Items.Clear();
foreach(DataRow dr in objset.Tables[0].Rows)
{
ListViewItem lst=new ListViewItem();
lst.SubItems.Clear();
lst.SubItems[0].Text=dr[0].ToString();
lst.SubItems.Add(dr[1].ToString());
lst.SubItems.Add(dr[2].ToString());
lst.SubItems.Add(dr[3].ToString());
this.listView1.Items.Add(lst);
}
objset=zhangdan.selzdcd();
foreach(DataRow dr in objset.Tables[0].Rows)
{
long z=Convert.ToInt64(dr[0].ToString())+1;
this.label22.Text=(z.ToString());
}
objset=sel.seldiancai();
float i=0;
foreach(DataRow dr in objset.Tables[0].Rows)
{
i+=float.Parse(dr[3].ToString());
}
float jia=float.Parse(this.label20.Text.Trim())*float.Parse(i.ToString());
this.label17.Text=jia.ToString();
}
private void button4_Click(object sender, System.EventArgs e)
{
this.Close();
}
private void button4_Click_1(object sender, System.EventArgs e)
{
this.Close();
}
private void button1_Click(object sender, System.EventArgs e) //判断
{
if(this.textBox1.Text!="")
{
MessageBox.Show("找零"+Convert.ToString(float.Parse(this.textBox1.Text)-float.Parse(this.label17.Text)));
}
else
{
MessageBox.Show("实收价格不能为空!");
}
}
private void button2_Click(object sender, System.EventArgs e)
{
if(zhangdan.insertzhangdan(this.label2.Text,this.label4.Text,this.label6.Text,this.label8.Text,this.label10.Text,this.label12.Text,this.dateTimePicker1.Text,this.label15.Text,this.label17.Text))
{
if(this.listView1.Items.Count>0)//判断数据是否为空
{
bool pd=true;//定个判断值
for(int i=0;i<this.listView1.Items.Count;i++)//循环lv1的行
{
cs.tablezhangdan tzd=new bggl.cs.tablezhangdan();
//把i行1,2,3,4列的值传给insertexe方法返回是否成功
pd=tzd.addzdcd(this.label22.Text,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("菜单为空,请点菜后再开单");
}
}
this.listView1.Items.Clear();
this.label22.Text="";
this.label2.Text="";
this.label4.Text="";
this.label6.Text="";
this.label8.Text="";
this.label10.Text="";
this.label12.Text="";
this.label15.Text="";
this.label20.Text="";
this.label17.Text="";
this.textBox1.Text="";
}
private void button3_Click(object sender, System.EventArgs e)
{
// frmdyxp zz=new frmdyxp();
// zz.Show();
}
private void textBox1_Leave(object sender, System.EventArgs e)
{
bggl.gong.zhipd pd=new bggl.gong.zhipd();
if(pd.zhi(this.textBox1.Text.Trim())!=true)
{
MessageBox.Show("价格只能输入数字!");
this.textBox1.Text="";
}
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -