private void button2_Click(object sender, EventArgs e) { Entity.AgreeMent ag = new Entity.AgreeMent(); try { ag.pID = int.Parse(this.textBox1.Text); ag.amStart = this.dateTimePicker1.Value; ag.amStop = this.dateTimePicker2.Value; ag.amState = this.comboBox1.Text; ag.AMText = this.textBox2.Text; ag.amBase = double.Parse(this.txt_amBase.Text); if (BLL.AgreeMentBLL.AgreeMent1(ag) == true) { Msg.Box.Show("添加成功"); this.textBox1.Text = ""; this.comboBox1.SelectedIndex = 0; this.txt_amBase.Text = ""; } else { Msg.Box.Show("添加失败"); return; } } catch { Msg.Box.Show("您填写的信息有误!"); return; } }
private void button2_Click(object sender, EventArgs e) { Entity.AgreeMent ag = new Entity.AgreeMent(); try { if (this.radioButton1.Checked) { ag.amID = int.Parse(this.textBox1.Text); dataGridView1.DataSource = BLL.AgreeMentBLL.AgreeMent3(ag); if (sum() == false) { return; } } else if (this.radioButton3.Checked) { ag.pID = int.Parse(this.textBox2.Text); dataGridView1.DataSource = BLL.AgreeMentBLL.AgreeMent4(ag); if (sum() == false) { return; } } else if (this.radioButton2.Checked) { ag.amState = this.comboBox1.Text; dataGridView1.DataSource = BLL.AgreeMentBLL.AgreeMent5(ag); if (sum() == false) { return; } } else { Msg.Box.Show("您还未勾选查询方式!"); return; } } catch { Msg.Box.Show("您填的信息有误!"); return; } }
private void button3_Click(object sender, EventArgs e) { Entity.AgreeMent ag = new Entity.AgreeMent(); try { ag.amID = int.Parse(this.textBox3.Text); ag.pID = int.Parse(this.textBox4.Text); ag.amStop = this.dateTimePicker1.Value; ag.amState = this.comboBox2.Text; ag.amBase = double.Parse(this.textBox5.Text); if (BLL.AgreeMentBLL.AgreeMent6(ag) == true) { Msg.Box.Show("恭喜您,修改成功"); this.dataGridView1.DataSource = BLL.AgreeMentBLL.AgreeMent2(ag); } } catch { Msg.Box.Show("您输入的信息有误!"); return; } //清空 this.textBox3.Text = this.textBox4.Text = this.textBox5.Text = this.comboBox2.Text = ""; }
private void AgreeMentListForm_Load(object sender, EventArgs e) { Entity.AgreeMent ag = new Entity.AgreeMent(); this.dataGridView1.DataSource = BLL.AgreeMentBLL.AgreeMent2(ag); }