//*************************************************************************** private void button_enter_Click(object sender, EventArgs e) { //充值成功直接退出页面 if (CplHelper.IsNull(textBox_balance.Text) || CplHelper.IsNull(textBox_name.Text) || CplHelper.IsNull(textBox_sum.Text)) { MessageBox.Show("信息录入不全!"); return; } if (!CplHelper.IsDecimal(textBox_sum.Text)) { MessageBox.Show("充值金额输入错误!"); return; } if (modifyBal()) { MessageBox.Show("充值成功!"); } else { MessageBox.Show("充值失败!"); } //DAL.Recharge.Charge(, r.RechargeAmount); // DAL.Recharge.InputRecord(r); }
private void button1_Click(object sender, EventArgs e) { //information complete check if (CplHelper.IsNull(txtIdcard.Text) || CplHelper.IsNull(txtAccount.Text) || CplHelper.IsNull(txtMemID.Text) || CplHelper.IsNull(txtMemName.Text) || CplHelper.IsNull(txtTel.Text)) { MessageBox.Show("信息录入不全!"); return; } if (!CplHelper.IsEmail(txtTel.Text)) { MessageBox.Show("邮箱格式错误!"); return; } if (!CplHelper.IsDecimal(txtAccount.Text)) { MessageBox.Show("金额格式不正确"); return; } if (!CplHelper.IsSpecLen(txtIdcard.Text, 18)) { MessageBox.Show("身份证格式错误"); return; } //************************* Communal.h.AllButtonEnabled(); MODEL.Member m = new MODEL.Member(); m.MemName = txtMemName.Text; m.MemSex = BoxSex.Text; m.IDCard = txtIdcard.Text; m.MemCardID = txtMemID.Text; m.Memtel = txtTel.Text; try { m.Memacount = Convert.ToDouble(txtAccount.Text); } catch { MessageBox.Show("未输入金额!"); m.Memacount = 0; } if (AddInfoToCard()) { MessageBox.Show("注册成功"); m.Registtime = System.DateTime.Now.ToLongDateString(); m.operateStaff = MODEL.class1.staff.ID; DAL.class1.InputMember(m); this.Close(); } else { MessageBox.Show("请确认将卡添加到读卡器上!"); } }
private void button1_Click(object sender, EventArgs e) { //存主表 MODEL.InStockMain instockmain = new MODEL.InStockMain(); instockmain.InID = textBox1.Text; instockmain.QAID = comboBox1.Text; instockmain.Date = textBox3.Text; instockmain.Operator = textBox4.Text; DAL.InStock.InPutMain(instockmain); //存从表并改变库存 for (int i = 0; i < dataGridView1.Rows.Count - 1; i++) { int curNum = i + 1; MODEL.InStockdetail instockdetail = new MODEL.InStockdetail(); instockdetail.InID = textBox1.Text; instockdetail.GoodID = dataGridView1.Rows[i].Cells[0].Value.ToString(); instockdetail.GoodName = dataGridView1.Rows[i].Cells[1].Value.ToString(); instockdetail.Amount = System.Convert.ToDouble(dataGridView1.Rows[i].Cells[2].Value.ToString()); if (CplHelper.IsDecimal(dataGridView1.Rows[i].Cells[3].Value.ToString())) { instockdetail.goodinprice = System.Convert.ToDouble(dataGridView1.Rows[i].Cells[3].Value.ToString()); } else { MessageBox.Show("第" + curNum.ToString() + "行价格不正确"); return; } //instockdetail.Type= dataGridView1.Rows[i].Cells[4].Value.ToString(); instockdetail.Supplier = dataGridView1.Rows[i].Cells[4].Value.ToString(); if (CplHelper.IsNull(dataGridView1.Rows[i].Cells[5].Value.ToString())) { MessageBox.Show("请输入第" + curNum.ToString() + "仓库信息"); return; } instockdetail.Inventory = dataGridView1.Rows[i].Cells[5].Value.ToString(); DAL.InStock.InputDetail(instockdetail); DAL.Inventory.ChangeNum(instockdetail); } this.TopMost = false; MessageBox.Show("已保存成功"); if (Communal.mapDiag == null || Communal.mapDiag.isClosed) { Communal.mapDiag = new realTimeShow(); Communal.mapDiag.isClosed = false; } Communal.mapDiag.goodsNum = 1; Communal.mapDiag.Show(); Communal.mapDiag.goodsOnTableAnimate(); }
private void btn_match_Click(object sender, EventArgs e) { if (CplHelper.IsNull(txtBox_id.Text) || CplHelper.IsNull(txtbox_rfid.Text)) { MessageBox.Show("输入信息不完整!"); return; } if (!CplHelper.IsMemIdRight(txtBox_id.Text)) { MessageBox.Show("会员ID不正确!"); return; } DAL.ActiveRFID.Input(txtBox_id.Text.Trim(), txtbox_rfid.Text.Trim()); MessageBox.Show("匹配成功!"); }
private void btn_search_Click(object sender, EventArgs e) { if (!isStart) { if (RfID_ID.Text.Trim() != "") { if (CplHelper.IsMemIdRight(RfID_ID.Text)) { string RFIDID = DAL.InStock.getARFIDInfo(RfID_ID.Text.Trim()); if (RFIDID != "") { isStart = true; asyFun(int.Parse(RFIDID)); _th = new System.Threading.Thread(drawPos); _th.Start(); } else { MessageBox.Show("没有找到该会员ID"); return; } } else { MessageBox.Show("会员ID不正确!"); return; } } else { MessageBox.Show("请输入会员标签序号"); return; } } else { if (socket != null) { socket.Close(); socket = null; } isChecked = false; _th.Abort(); isStart = false; MessageBox.Show("关闭成功"); } }
private void button1_Click(object sender, EventArgs e) { switch (state) { case 1: { dataGridView1.DataSource = DAL.Inventory.QuerybyGoodName(textBox1.Text).Tables[0]; break; } case 2: { if (CplHelper.IsGoodsIdRight(textBox1.Text)) { dataGridView1.DataSource = DAL.Inventory.QuerybyGoodID(textBox1.Text).Tables[0]; } else { MessageBox.Show("商品ID不正确"); return; } break; } case 3: { for (int i = 0; i < dataGridView1.Rows.Count - 1; i++) { MODEL.Inventory inventory = new MODEL.Inventory(); inventory.GoodID = dataGridView1.Rows[i].Cells[0].Value.ToString(); inventory.GoodName = dataGridView1.Rows[i].Cells[1].Value.ToString(); inventory.Amount = System.Convert.ToDouble(dataGridView1.Rows[i].Cells[2].Value.ToString()); DAL.Inventory.PanDian(inventory); } MessageBox.Show("盘点成功"); break; } } ChangeName(); for (int i = 0; i < 3; i++) { this.dataGridView1.Columns[i].Width = (dataGridView1.Width - 45) / 3; } }
private void button1_Click(object sender, EventArgs e) { //建立主表 MODEL.QAmain qamain = new MODEL.QAmain(); qamain.QAID = textBox1.Text; if (comboBox1.Text == "") { MessageBox.Show("请选择供应商!~"); return; } qamain.Supplier = comboBox1.Text; qamain.Operator = MODEL.class1.staff.ID; qamain.Date = System.DateTime.Now.ToLongDateString(); DAL.class1.InputQAmain(qamain); //建立从表 for (int i = 0; i < dataGridView1.Rows.Count - 1; i++) { int curNum = i + 1; //MessageBox.Show(dataGridView1.Rows[i].Cells[0].Value.ToString()); for (int t = 0; t < 5; t++) { if (dataGridView1.Rows[i].Cells[t].Value == null) { MessageBox.Show("第" + curNum.ToString() + "行数据不完整!"); return; } } if (CplHelper.IsNull(dataGridView1.Rows[i].Cells[0].Value.ToString()) || CplHelper.IsNull(dataGridView1.Rows[i].Cells[1].Value.ToString()) || CplHelper.IsNull(dataGridView1.Rows[i].Cells[2].Value.ToString()) || CplHelper.IsNull(dataGridView1.Rows[i].Cells[4].Value.ToString())) { MessageBox.Show("第" + curNum.ToString() + "行数据不完整!"); return; } qadetail.QAID = textBox1.Text; qadetail.GoodID = dataGridView1.Rows[i].Cells[0].Value.ToString(); qadetail.GoodName = dataGridView1.Rows[i].Cells[1].Value.ToString(); qadetail.Unit = dataGridView1.Rows[i].Cells[2].Value.ToString(); if (!CplHelper.IsInt(dataGridView1.Rows[i].Cells[3].Value.ToString())) { MessageBox.Show("第" + curNum.ToString() + "行商品数量不正确!"); return; } qadetail.Amount = System.Convert.ToDouble(dataGridView1.Rows[i].Cells[3].Value.ToString()); qadetail.Check = dataGridView1.Rows[i].Cells[4].Value.ToString(); if (!CplHelper.IsGoodsIdRight(qadetail.GoodID)) { MessageBox.Show("第" + curNum.ToString() + "行商品ID不正确,格式为B+10位数字!"); return; } DAL.class1.InputQAdetail(qadetail); } if (dataGridView1.Rows.Count - 1 <= 0) { MessageBox.Show("无商品信息"); return; } MessageBox.Show(qamain.QAID + "号质检单已经生成"); Communal.mapDiag = new realTimeShow(); Communal.mapDiag.goodsNum = 1; Communal.mapDiag.Show(); Communal.mapDiag.qualityAnimate(); }
private void btn_Click(object sender, EventArgs e) { switch (state) { case 1: { dataGridView1.DataSource = DAL.class1.QueryMembyName(textBox1.Text).Tables[0]; ChangeName(); break; } case 2: { dataGridView1.DataSource = DAL.class1.QueryMembyMemId(textBox1.Text).Tables[0]; ChangeName(); break; } case 3: { dataGridView1.DataSource = DAL.class1.QueryMembyDate(dateTimePicker1.Text).Tables[0]; ChangeName(); break; } case 4: { dataGridView1.DataSource = DAL.class1.QueryMembyTel(textBox1.Text).Tables[0]; ChangeName(); break; } case 5: { dataGridView1.DataSource = DAL.class1.QueryMembyId(textBox1.Text).Tables[0]; ChangeName(); break; } case 6: { this.dataGridView1.Columns[0].ReadOnly = true; this.dataGridView1.Columns[6].ReadOnly = true; this.dataGridView1.Columns[7].ReadOnly = true; this.dataGridView1.Columns[8].ReadOnly = true; this.dataGridView1.Columns[9].ReadOnly = true; for (int i = 0; i < dataGridView1.Rows.Count; i++) { MODEL.Member m = new MODEL.Member(); m.MemCardID = dataGridView1.Rows[i].Cells[0].Value.ToString(); m.MemName = dataGridView1.Rows[i].Cells[1].Value.ToString(); m.MemSex = dataGridView1.Rows[i].Cells[2].Value.ToString(); m.MemPd = dataGridView1.Rows[i].Cells[3].Value.ToString(); m.Memtel = dataGridView1.Rows[i].Cells[4].Value.ToString(); m.IDCard = dataGridView1.Rows[i].Cells[5].Value.ToString(); if (CplHelper.IsDecimal(dataGridView1.Rows[i].Cells[6].Value.ToString())) { m.Memacount = System.Convert.ToDouble(dataGridView1.Rows[i].Cells[6].Value.ToString()); } else { MessageBox.Show("金额格式不对!"); return; } m.Registtime = dataGridView1.Rows[i].Cells[7].Value.ToString(); m.operateStaff = dataGridView1.Rows[i].Cells[8].Value.ToString(); if (CplHelper.IsNull(m.MemName) || CplHelper.IsNull(m.MemSex) || CplHelper.IsNull(m.MemPd) || CplHelper.IsNull(m.Memtel) || CplHelper.IsNull(m.IDCard)) { MessageBox.Show("信息未输入完全!"); return; } if (!CplHelper.IsEmail(m.Memtel)) { MessageBox.Show("邮箱格式不对!"); return; } if (!CplHelper.IsSpecLen(m.IDCard, 18)) { MessageBox.Show("身份证格式不正确!"); return; } if (!CplHelper.IsSexRight(m.MemSex)) { MessageBox.Show("性别输入不正确!"); return; } DAL.class1.UpdateMem(m); } MessageBox.Show("已修改成功!请在查询界面进行查询"); break; } case 7: { DAL.class1.DeleteMem(dataGridView1.SelectedRows[0].Cells[0].Value.ToString()); dataGridView1.SelectedRows[0].Cells[0].Value = "停用"; MessageBox.Show("已将该会员记录停用,双击该记录进行重新注册"); break; } } }
private void button1_Click(object sender, EventArgs e) { switch (state) { case 1: { if (CplHelper.IsQualityIDRight(textBox1.Text.Trim())) { dataGridView1.DataSource = DAL.class1.QuerybyQAID(textBox1.Text).Tables[0]; } else { MessageBox.Show("质检信息输入错误"); return; } break; } case 2: { if (CplHelper.IsGoodsIdRight(textBox1.Text.Trim())) { dataGridView1.DataSource = DAL.class1.QuerybyGoodID(textBox1.Text).Tables[0]; } else { MessageBox.Show("商品ID错误"); return; } break; } case 3: { dataGridView1.DataSource = DAL.class1.QuerybyGoodName(textBox1.Text).Tables[0]; break; } case 4: { dataGridView1.DataSource = DAL.class1.QuerybySupplier(textBox1.Text).Tables[0]; break; } case 5: { dataGridView1.DataSource = DAL.class1.QuerybyDate(dateTimePicker1.Text).Tables[0]; break; } case 6: { dataGridView1.DataSource = DAL.class1.QuerybyOperator(textBox1.Text).Tables[0]; break; } } ChangeName(); for (int i = 0; i < 6; i++) { this.dataGridView1.Columns[i].Width = (dataGridView1.Width - 30) / 7; } }