private void button1_Click(object sender, EventArgs e) { string organ_code = null; string organ_name = textBox1.Text; string input_name = this.comboBox6.SelectedValue.ToString(); string zeren_doctor = this.comboBox7.SelectedValue.ToString(); string bc = this.comboBox8.SelectedValue.ToString(); string xcg = this.comboBox9.SelectedValue.ToString(); string sh = this.comboBox10.SelectedValue.ToString(); string sgtz = this.comboBox11.SelectedValue.ToString(); string ncg = this.comboBox12.SelectedValue.ToString(); string xdt = this.comboBox13.SelectedValue.ToString(); string xy = this.comboBox14.SelectedValue.ToString(); string wx = textBox3.Text; string other = textBox2.Text; string captain = "";//this.comboBox15.SelectedValue.ToString(); string members = textBox4.Text; string operation = this.comboBox16.SelectedValue.ToString(); string car_name = this.comboBox17.SelectedValue.ToString(); string create_user = null; string create_name = null; if (xcuncode != null && !"".Equals(xcuncode)) { bool bl = bsdao.addBasicSetting(shengcode, shicode, qxcode, xzcode, xcuncode, organ_code, organ_name, input_name, zeren_doctor, bc, xcg, sh, sgtz, ncg, xdt, xy, wx, other, captain, members, operation, car_name, create_user, create_name); if (bl) { MessageBox.Show("数据保存成功!"); } } else { MessageBox.Show("区域选择不完整!"); } }
private void button1_Click(object sender, EventArgs e) { if (this.comboBox5.Text == "" || this.comboBox5.Text == "--请选择--" || this.comboBox5.SelectedValue == null) { MessageBox.Show("【区域设置】信息不完整!"); return; } try { xcuncode = this.comboBox5.SelectedValue.ToString(); } catch { MessageBox.Show("出错!"); return; } if (xcuncode == null || "".Equals(xcuncode)) { MessageBox.Show("【区域设置】信息不完整!"); return; } else if (this.comboBox5.Text == "--请选择--") { DataTable dtxzs = areadao.cunInfo(xzcode); this.comboBox5.Text = dtxzs.Rows[0]["name"].ToString(); xcuncode = dtxzs.Rows[0]["code"].ToString(); } shengName = this.comboBox1.Text; shiName = this.comboBox2.Text; qxName = this.comboBox3.Text; xzName = this.comboBox4.Text; xcName = this.comboBox5.Text; allareaname = this.comboBox1.Text + this.comboBox2.Text + this.comboBox3.Text + xzName + xcName; string organ_code = null; organ_name = textBox1.Text; if (organ_name == "" || organ_name.Length < 1) { MessageBox.Show("建档单位不能为空!"); return; } input_name = this.comboBox6.Text; DataRow[] drs6 = dtuserlist.Select("uname = '" + input_name + "' "); if (drs6.Count() < 1) { MessageBox.Show("无此建档人名称,请重新选择!"); return; } zeren_doctor = this.comboBox7.Text; DataRow[] drs7 = dtuserlist.Select("uname = '" + zeren_doctor + "' "); if (drs7.Count() < 1) { MessageBox.Show("无此责任医生,请重新选择!"); return; } //if (shengName == "陕西") //{ zeren_doctorId = this.comboBox7.SelectedValue.ToString(); //} bc = this.comboBox8.Text; if (Common._bxgwry == "0") { if (this.comboBox8.Text == "") { MessageBox.Show("B超人员不能为空!"); return; } } else { DataRow[] drs8 = dtuserlist.Select("uname = '" + bc + "' "); if (drs8.Count() < 1) { MessageBox.Show("无此B超人员名称,请重新选择!"); return; } } xcg = this.comboBox9.Text; if (Common._bxgwry == "0") { if (this.comboBox9.Text == "") { MessageBox.Show("血球人员不能为空!"); return; } } else { DataRow[] drs9 = dtuserlist.Select("uname = '" + xcg + "' "); if (drs9.Count() < 1) { MessageBox.Show("无此血球人员名称,请重新选择!"); return; } } sh = this.comboBox10.Text; if (Common._bxgwry == "0") { if (this.comboBox10.Text == "") { MessageBox.Show("生化人员不能为空!"); return; } } else { DataRow[] drs10 = dtuserlist.Select("uname = '" + sh + "' "); if (drs10.Count() < 1) { MessageBox.Show("无此生化人员名称,请重新选择!"); return; } } sgtz = this.comboBox11.Text; if (Common._bxgwry == "0") { if (this.comboBox11.Text == "") { MessageBox.Show("身高体重不能为空!"); return; } } else { DataRow[] drs11 = dtuserlist.Select("uname = '" + sgtz + "' "); if (drs11.Count() < 1) { MessageBox.Show("无此身高体重人员名称,请重新选择!"); return; } } ncg = this.comboBox12.Text; if (Common._bxgwry == "0") { if (this.comboBox12.Text == "") { MessageBox.Show("尿机人员不能为空!"); return; } } else { DataRow[] drs12 = dtuserlist.Select("uname = '" + ncg + "' "); if (drs12.Count() < 1) { MessageBox.Show("无此尿机人员名称,请重新选择!"); return; } } xdt = this.comboBox13.Text; if (Common._bxgwry == "0") { if (this.comboBox13.Text == "") { MessageBox.Show("心电人员不能为空!"); return; } } else { DataRow[] drs13 = dtuserlist.Select("uname = '" + xdt + "' "); if (drs13.Count() < 1) { MessageBox.Show("无此心电人员名称,请重新选择!"); return; } } xy = this.comboBox14.Text; if (Common._bxgwry == "0") { if (this.comboBox14.Text == "") { MessageBox.Show("血压计人员不能为空!"); return; } } else { DataRow[] drs14 = dtuserlist.Select("uname = '" + xy + "' "); if (drs14.Count() < 1) { MessageBox.Show("无此血压计人员名称,请重新选择!"); return; } } wx = textBox3.Text; string other = textBox2.Text; string captain = ""; //this.comboBox15.SelectedValue.ToString(); string members = ""; // textBox4.Text; string operation = this.comboBox16.Text; if (Common._bxgwry == "0") { if (this.comboBox16.Text == "") { MessageBox.Show("操作人员不能为空!"); return; } } else { DataRow[] drs16 = dtuserlist.Select("uname = '" + operation + "' "); if (drs16.Count() < 1) { MessageBox.Show("无此操作人员名称,请重新选择!"); return; } } string car_name = this.comboBox17.Text; if (Common._bxgwry == "0") { if (this.comboBox17.Text == "") { MessageBox.Show("司机人员不能为空!"); return; } } else { DataRow[] drs17 = dtuserlist.Select("uname = '" + car_name + "' "); if (drs17.Count() < 1) { MessageBox.Show("无此司机人员名称,请重新选择!"); return; } } string create_user = null; string create_name = null; if (xcuncode != null && !"".Equals(xcuncode)) { bool bl = bsdao.addBasicSetting(shengcode, shicode, qxcode, xzcode, xcuncode, organ_code, organ_name, input_name, zeren_doctor, bc, xcg, sh, sgtz, ncg, xdt, xy, wx, other, captain, members, operation, car_name, create_user, create_name, zeren_doctorId, allareaname); if (bl) { //createtime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); ////重置条码起始位置 //xmlDoc.Load(path); //node = xmlDoc.SelectSingleNode("config/barnumCode"); //node.InnerText = "10001"; //xmlDoc.Save(path); //处理别的窗体的信息 if (setFunDelegate == null) { frmMainmm frm = (frmMainmm)this.Parent.Parent; frm.SetJianDangInfo(textBox1.Text.Trim(), comboBox6.Text, comboBox7.Text); MessageBox.Show("数据保存成功!"); } else { setFunDelegate(textBox1.Text.Trim(), comboBox6.Text, comboBox7.Text); MessageBox.Show("数据保存成功!"); this.Close(); } issave = "1"; } } else { MessageBox.Show("区域选择不完整!"); } }