private void button5_Click(object sender, EventArgs e) { if (Mysqlcom.Myopen()) return; input getcardid = new input("输入卡号", "请输入卡号:", false); getcardid.ShowDialog(); if (getcardid.value == "" || getcardid.value == "-1") return; input getpw = new input("输入密码", "请输入密码:", true); getpw.ShowDialog(); Mwa_vip vipMod = sql.VIP.GetByPW(getcardid.value, getpw.value); if (vipMod == null) { MessageBox.Show("卡号或密码错误!", "错误", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } label8.Text = "会员卡号:" + getcardid.value; label8.Text += "\n姓名:" + vipMod.vipid; label8.Text += "\n余额:" + vipMod.ChunKuan; label8.Text += "\n打折:" + vipMod.discount; if (vipMod.state == 2) { MessageBox.Show("此卡已挂失!", "错误"); return; } if (MessageBox.Show("姓名:" + vipMod.vipid + "\n余额:" + vipMod.ChunKuan + "\n打折:" + vipMod.discount, "确定要使用此会员卡?", MessageBoxButtons.OKCancel) != DialogResult.OK) return; string OldPro = label5.Text; int cou = 0; double counum = 0; ; double OnePri = 0; for (int i = 0; i < listView1.Items.Count; i++) { if (listView1.Items[i].Checked) { OnePri = Comdata.CalMon(double.Parse(listView1.Items[i].SubItems[11].Text), int.Parse(listView1.Items[i].SubItems[5].Text), vipMod.discount, Comdata.iniShop.FileObj.count_mode); if (Mysqlcom.enq("update wa_wash set FuKuan='VIP卡',CPay=" + OnePri + ",todate=now(),toID='" + Comdata.loginid + "',discount='" + vipMod.discount + "',mark=CONCAT(mark,'取衣刷卡') where WID=" + listView1.Items[i].SubItems[9].Text) == -1) MessageBox.Show("取衣失败:" + Mysqlcom.error); else { Mysqlcom.enq("UPDATE wa_code SET cardid=" + getcardid.value + ",totpri=totpri-" + listView1.Items[i].SubItems[6].Text + "+" + OnePri.ToString() + " where coid=" + listView1.Items[i].SubItems[0].Text); listView1.Items[i].SubItems[7].Text = "VIP卡"; listView1.Items[i].SubItems[8].Text = "已取"; listView1.Items[i].Checked = false; listView1.Items[i].SubItems[6].Text = OnePri.ToString(); listView1.Items[i].SubItems[10].Text = vipMod.discount.ToString(); counum += OnePri; cou++; } } } if (cou <= 0) { MessageBox.Show("无未取衣物!"); return; } if (Mysqlcom.enq("UPDATE wa_vip SET ChunKuan = ChunKuan - " + counum + ",XaoFei=XaoFei+" + counum + " WHERE Card = " + getcardid.value) < 1) { MessageBox.Show("vip账户扣费失败!" + Mysqlcom.error); return; } label8.Text = "会员卡号:" + getcardid.value; label8.Text += "\n姓名:" + vipMod.vipid; label8.Text += "\n余额:" + (vipMod.ChunKuan - counum); label8.Text += "\n打折:" + vipMod.discount; label8.Text += "\n\n原价格:" + OldPro; label8.Text += "\n会员价格:" + counum; printline = ""; printline = " 取衣单\r\n"; printline += " %%%%%%%%%%%%%%%%%%\r\n\r\n"; printline += "顾客姓名: " + vipMod.vipid + "\r\n"; printline += "会员卡号: " + getcardid.value + "\r\n"; if (vipMod.discount == 10) printline += "全单折扣: 无打折\r\n"; else printline += "全单折扣: " + vipMod.discount + "折\r\n"; printline += "取衣数量: " + cou + "件\r\n"; printline += "合计: " + counum + "元\r\n"; printline += "\r\n卡内余额:" + (vipMod.ChunKuan - counum) + "元\r\n\r\n"; printline += Comdata.PrintFooter(); button7.Enabled = true; }
private void 添加瑕疵ToolStripMenuItem_Click(object sender, EventArgs e) { washmange.sql.Xiaci xia = new washmange.sql.Xiaci(); washmange.sql.Brand bran = new washmange.sql.Brand(); this.Activate(); if (listBox4.Focused) { input insert = new input("添加瑕疵", "请输入瑕疵:", false); insert.openIME(); insert.ShowDialog(); if (insert.value == "" || insert.value == "-1") return; xia.Xname = insert.value; if (!xia.Insert()) { MessageBox.Show("添加失败:" + Mysqlcom.error); return; } Comdata.AllXiaci = xia.GetAll(); listBox4.Items.Add(insert.value); } else if (listBox5.Focused) { input insert = new input("添加品牌", "请输入品牌:", false); insert.openIME(); insert.ShowDialog(); if (insert.value == "" || insert.value == "-1") return; bran.Bname = insert.value; if (!bran.Insert()) { MessageBox.Show("添加失败:" + Mysqlcom.error); return; } Comdata.AllBrand = bran.GetAll(); listBox5.Items.Add(insert.value); } }
private void listView1_Click(object sender, EventArgs e) { if (Mysqlcom.Myopen()) return; if (listView1.SelectedIndices.Count > 0) { if (comboBox1.Text == "自动") { } input uip = new input("输入挂点", "挂点(空白清除挂点):", false); uip.ShowDialog(); if (uip.value != "-1") { if (uip.value == "") uip.value = "-1"; try { int.Parse(uip.value); } catch (Exception) { MessageBox.Show("挂点必须是数子!","错误"); return; } if (uip.value != "0" && uip.value != "-1") { string sqlS = "select COID from wa_code,wa_wash where COID=Wnumber and toID='' and GuaDian=" + uip.value; #if !ALONE sqlS += " and shopID=" + Comdata.shopnum; #endif long Gcoid = Mysqlcom.es(sqlS); if (Gcoid > 0) { //剪贴板 Clipboard.SetDataObject(Gcoid.ToString(), true); if( MessageBox.Show("此挂点已存在衣物!\r\n编号为:" + Gcoid,"继续上挂?",MessageBoxButtons.YesNo)!=DialogResult.Yes) return; } } int selectI=listView1.SelectedIndices[0]; if (Mysqlcom.enq("update wa_wash set GuaDian=" + uip.value + " where wid=" + listView1.Items[selectI].SubItems[9].Text) < 1) { MessageBox.Show("上挂失败!" + Mysqlcom.error); return; } if (uip.value == "-1") listView1.Items[selectI].SubItems[4].Text = "无"; else listView1.Items[selectI].SubItems[4].Text = uip.value; } } }
/// <summary> /// vip刷卡 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void radioButton3_CheckedChanged(object sender, EventArgs e) { if (radioButton3.Checked) { try { if (Mysqlcom.Myopen()) { radioButton3.Checked = false; return; } input getcardid = new input("输入卡号", "请输入卡号:", false); getcardid.ShowDialog(); if (getcardid.value == "" || getcardid.value == "-1") { radioButton3.Checked = false; return; } input getpw = new input("输入密码", "请输入密码:", true); getpw.ShowDialog(); vipMod = sql.VIP.GetByPW(getcardid.value, getpw.value); if (vipMod == null) throw new Exception("卡号或密码错误!"); if (vipMod.state == 2) throw new Exception("此卡已挂失!"); textBox10.Text = vipMod.vipid; textBox11.Text = vipMod.Telphone; textBox13.Text = vipMod.ChunKuan.ToString(); comboBox3.Text = vipMod.discount.ToString(); textBox10.ReadOnly = true; textBox11.ReadOnly = true; } catch (Exception ce) { vipMod = null; radioButton3.Checked = false; MessageBox.Show(ce.Message, "错误", MessageBoxButtons.OK, MessageBoxIcon.Error); } } else { textBox10.ReadOnly = false; textBox11.ReadOnly = false; textBox13.Text = ""; comboBox3.Text = "10"; } }