private void button1_Click(object sender, EventArgs e) { DialogResult dr = MessageBox.Show("确定吗???", "提示", MessageBoxButtons.YesNo); if (dr == DialogResult.Yes) { tsuhan_scgl_fx fx = new tsuhan_scgl_fx(); var s = fxBLL.SelectAllXlh(this.textBox1.Text); fx.id = s.id; fx.原因 = this.comboBox6.Text; fx.良现象 = s.良现象; fx.成品编码 = s.成品编码; fx.次数 = s.次数 + 1; fx.工位 = s.工位; fx.客户 = s.客户; fx.型号 = s.型号; fx.序列号 = s.序列号; fx.关联码 = s.关联码; fx.进时间 = s.进时间; fx.出时间 = Convert.ToDateTime(DateTime.Now.ToString("yyyy-M-d HH:mm")); fx.处理方式 = this.comboBox7.Text; bool result = fxBLL.Update(fx); if (result == true) { MessageBox.Show("提交成功!", "提示"); } else { MessageBox.Show("提交失败!", "提示"); } } }
private void textBox1_KeyUp(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Enter) { var xlh = this.textBox1.Text; bool result = fxBLL.Exists(xlh); if (result == true) { tsuhan_scgl_fx fx = fxBLL.SelectAllXlh(xlh); this.textBox2.Text = fx.客户; this.textBox3.Text = fx.型号; this.textBox4.Text = fx.成品编码; this.textBox6.Text = fx.关联码; this.textBox5.Text = Convert.ToString(fx.次数); if (fx.工位 == "包装") { this.textBox7.Text = fx.良现象; } else if (fx.工位 == "LD") { this.textBox8.Text = fx.良现象; } else if (fx.工位 == "PT") { this.textBox9.Text = fx.良现象; } else if (fx.工位 == "测试") { this.textBox10.Text = fx.良现象; } else if (fx.工位 == "清洗") { this.textBox11.Text = fx.良现象; } this.button1.Enabled = true; } else { this.button1.Enabled = false; return; } } this.textBox1.Focus(); }
/// <summary> /// 添加 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void button1_Click(object sender, EventArgs e) { DialogResult dr = MessageBox.Show("确定吗???", "提示", MessageBoxButtons.YesNo); if (dr == DialogResult.Yes) { bool result1 = fxBLL.Exists(this.textBox1.Text); if (result1 == true) { var f = fxBLL.SelectAllXlh(this.textBox1.Text); if (f.出时间 == null) { MessageBox.Show("未完成,请继续下一步", "提示"); } else { tsuhan_scgl_fx fxmodel = new tsuhan_scgl_fx(); if (this.textBox8.Visible == true) { //this.textBox8.Visible = true; fxmodel.关联码 = this.textBox8.Text; } else { fxmodel.关联码 = ""; } fxmodel.序列号 = this.textBox1.Text;; fxmodel.客户 = this.textBox2.Text; fxmodel.型号 = this.textBox3.Text; fxmodel.成品编码 = this.textBox4.Text; fxmodel.次数 = Convert.ToInt32(this.textBox5.Text); fxmodel.进时间 = Convert.ToDateTime(DateTime.Now.ToString("yyyy-M-d HH:mm")); var dh = this.textBox6.Text; var str = dh.Substring(0, 1); if (str == "1") { fxmodel.工位 = "包装"; if (comboBox1.Text == "110其他") { fxmodel.良现象 = this.textBox7.Text; } else { fxmodel.良现象 = this.comboBox1.Text; } } else if (str == "2") { fxmodel.工位 = "LD"; if (comboBox2.Text == "210其他") { fxmodel.良现象 = this.textBox7.Text; } else { fxmodel.良现象 = this.comboBox2.Text; } } else if (str == "3") { fxmodel.工位 = "PT"; if (comboBox3.Text == "310其他") { fxmodel.良现象 = this.textBox7.Text; } else { fxmodel.良现象 = this.comboBox3.Text; } } else if (str == "4") { fxmodel.工位 = "测试"; if (comboBox4.Text == "409其他") { fxmodel.良现象 = this.textBox7.Text; } else { fxmodel.良现象 = this.comboBox4.Text; } } else if (str == "5") { fxmodel.工位 = "清洗"; if (comboBox5.Text == "502其他") { fxmodel.良现象 = this.textBox7.Text; } else { fxmodel.良现象 = this.comboBox5.Text; } } else { MessageBox.Show("不良现象选择错误!!!", "提示"); return; } bool result = false; result = fxBLL.Add(fxmodel); if (result == true) { MessageBox.Show("提交成功", "提示"); } else { MessageBox.Show("提交失败", "提示"); } } } else { tsuhan_scgl_fx fxmodel = new tsuhan_scgl_fx(); if (this.textBox8.Visible == true) { fxmodel.关联码 = this.textBox8.Text; } else { fxmodel.关联码 = ""; } fxmodel.序列号 = this.textBox1.Text;; fxmodel.客户 = this.textBox2.Text; fxmodel.型号 = this.textBox3.Text; fxmodel.成品编码 = this.textBox4.Text; fxmodel.次数 = Convert.ToInt32(this.textBox5.Text); fxmodel.进时间 = Convert.ToDateTime(DateTime.Now.ToString("yyyy-M-d HH:mm")); var dh = this.textBox6.Text; var str = dh.Substring(0, 1); if (str == "1") { fxmodel.工位 = "包装"; if (comboBox1.Text == "110其他") { fxmodel.良现象 = this.textBox7.Text; } else { fxmodel.良现象 = this.comboBox1.Text; } } else if (str == "2") { fxmodel.工位 = "LD"; if (comboBox2.Text == "210其他") { fxmodel.良现象 = this.textBox7.Text; } else { fxmodel.良现象 = this.comboBox2.Text; } } else if (str == "3") { fxmodel.工位 = "PT"; if (comboBox3.Text == "310其他") { fxmodel.良现象 = this.textBox7.Text; } else { fxmodel.良现象 = this.comboBox3.Text; } } else if (str == "4") { fxmodel.工位 = "测试"; if (comboBox4.Text == "409其他") { fxmodel.良现象 = this.textBox7.Text; } else { fxmodel.良现象 = this.comboBox4.Text; } } else if (str == "5") { fxmodel.工位 = "清洗"; if (comboBox5.Text == "502其他") { fxmodel.良现象 = this.textBox7.Text; } else { fxmodel.良现象 = this.comboBox5.Text; } } else { MessageBox.Show("不良现象选择错误!!!", "提示"); return; } //000000T435382421 bool result = false; result = fxBLL.Add(fxmodel); if (result == true) { MessageBox.Show("提交成功", "提示"); } else { MessageBox.Show("提交失败", "提示"); } } } }
/// <summary> /// 更新 /// </summary> /// <param name="fx"></param> /// <returns></returns> public bool Update(tsuhan_scgl_fx fx) { return(dal.Update(fx)); }
/// <summary> /// 添加 /// </summary> /// <param name="fxmodel"></param> /// <returns></returns> public bool Add(tsuhan_scgl_fx fxmodel) { return(dal.Add(fxmodel)); }