private void btnAdd_Click(object sender, EventArgs e) { //db.DeleteBusiness_Detail(CompanyID,txt1dh.Text); if (txtname.Text.Trim() == "") { MessageBox.Show("请选择公司或者新增公司再选择!"); return; } WindowAdd wa = new WindowAdd(); wa.Owner = this; wa.ShowDialog(); if (wa.DialogResult == DialogResult.OK) { int i = 1; while (i == 1) { try { if (txt1dh.Text == "") { LoadTemppic(1); } else if (txt2dh.Text == "") { LoadTemppic(2); } else if (txt3dh.Text == "") { LoadTemppic(3); } else if (txt4dh.Text == "") { LoadTemppic(4); } else if (txt5dh.Text == "") { LoadTemppic(5); } else if (txt6dh.Text == "") { LoadTemppic(6); } else { if (MessageBox.Show("当前页数据已满,请先保存当前数据,如果已经保存,请点确定继续?" + pictureBox1.Tag.ToString(), "提示", MessageBoxButtons.YesNo) == DialogResult.Yes) { InitAPP("Y"); i = 1; continue; } } i = 2; } catch { i = 2; } } } }
private void btnAdd_Click(object sender, EventArgs e) { //db.DeleteBusiness_Detail(CompanyID,txt1dh.Text); if (txtname.Text.Trim() == "") { MessageBox.Show("请选择公司或者新增公司再选择!"); return; } WindowAdd wa = new WindowAdd(); wa.Owner = this; wa.ShowDialog(); if (wa.DialogResult == DialogResult.OK) { int i = 1; while (i == 1) { try { if (txt1dh.Text == "") LoadTemppic(1); else if (txt2dh.Text == "") LoadTemppic(2); else if (txt3dh.Text == "") LoadTemppic(3); else if (txt4dh.Text == "") LoadTemppic(4); else if (txt5dh.Text == "") LoadTemppic(5); else if (txt6dh.Text == "") LoadTemppic(6); else { if (MessageBox.Show("当前页数据已满,请先保存当前数据,如果已经保存,请点确定继续?" + pictureBox1.Tag.ToString(), "提示", MessageBoxButtons.YesNo) == DialogResult.Yes) { InitAPP("Y"); i = 1; continue; } } i = 2; } catch { i = 2; } } } }