/// <summary> /// 删除 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void button_del_Click(object sender, EventArgs e) { int rowIndex = dataGridView1.CurrentRow.Index; DialogResult result; result = MessageBox.Show("确定要删除数据吗? \r\n确定:删除数据 \r\n取消:取消本次操作", "退出", MessageBoxButtons.OKCancel, MessageBoxIcon.Question); if (result == DialogResult.Cancel) { return; } try { DataTable dtupdate = (DataTable)dataGridView1.DataSource; Form_yljgBll SjzdBll = new Form_yljgBll(); if (dtupdate != null && dtupdate.Rows.Count > 0 && dtupdate.Rows.Count > rowIndex) { SjzdBll.Del(dtupdate, rowIndex); } dataSelect(); MessageBox.Show("删除成功!"); } catch (Exception ex) { MessageBox.Show("删除失败!" + ex.Message); } }
private void Form_downLoad_Load(object sender, EventArgs e) { ////progressBar_xz.Visible = false; ////取得前以页面传递的数据 ////DataTable dtPara = (DataTable)((jktj)this.Owner).Tag; ////用户id //userId = dt_para_sys.Rows[0]["userId"].ToString(); ////工作组 //yhfz = dt_para_sys.Rows[0]["gzz"].ToString(); ////医疗机构 //yljg = dt_para_sys.Rows[0]["yljg"].ToString(); DBAccess dBAccess = new DBAccess(); //取得导入数据的设定信息 Form_yljgBll Form_yljg = new Form_yljgBll(); DataTable importDataSet = Form_yljg.GetMoHuList(string.Format(" and YLJGBM='{0}' ", UserInfo.Yybm), "sql_importDataSet_select"); //绑定导入数据的设定信息 comboBox_importDataSet.DataSource = importDataSet; comboBox_importDataSet.DisplayMember = "title"; comboBox_importDataSet.ValueMember = "IID"; dt_fileType = importDataSet.Copy(); }
/// <summary> /// 检索 /// </summary> private void dataSelect() { Form_yljgBll xmfl = new Form_yljgBll(); string strWhere = ""; if (UserInfo.Yybm != null && UserInfo.Yybm.Trim().Length > 0) { strWhere = strWhere + string.Format(" and YLJGBM ='{0}' ", UserInfo.Yybm); } if (mc.Text.Trim().Length > 0) { strWhere = strWhere + string.Format(" and XT_GG_SYDW.MC like '%{0}%' ", mc.Text.Trim()); } DataTable dt = xmfl.GetMoHuList(strWhere); showDataGrid(dt); }
/// <summary> /// 按照条形码号获取健康档案号 /// </summary> /// <param name="Txmh"></param> /// <returns></returns> public string getJkdahByTxmh(string Txmh) { string jkdah = ""; try { Form_yljgBll Form_jkdah = new Form_yljgBll(); DataTable importDataSet = Form_jkdah.GetMoHuList(string.Format(" and YLJGBM='{0}' and TXMBH='{1}' ", UserInfo.Yybm, Txmh), "sql_select_people_txm"); if (importDataSet != null && importDataSet.Rows.Count > 0) { jkdah = importDataSet.Rows[0]["JKDAH"].ToString(); } } catch (Exception ex) { } return(jkdah); }
//保存 private void button1_Click(object sender, EventArgs e) { try { DataTable dtupdate = (DataTable)dataGridView1.DataSource; Form_yljgBll SjzdBll = new Form_yljgBll(); if (dtupdate != null && dtupdate.Rows.Count > 0) { SjzdBll.Add(dtupdate); SjzdBll.Upd(dtupdate); } dataSelect(); MessageBox.Show("保存成功!"); } catch (Exception ex) { MessageBox.Show("保存失败!" + ex.Message); } }
private void Form_downLoad_Load(object sender, EventArgs e) { //progressBar_xz.Visible = false; //取得前以页面传递的数据 //DataTable dtPara = (DataTable)((jktj)this.Owner).Tag; //用户id userId = dt_para_sys.Rows[0]["userId"].ToString(); //工作组 yhfz = dt_para_sys.Rows[0]["gzz"].ToString(); //医疗机构 yljg = dt_para_sys.Rows[0]["yljg"].ToString(); //取得医疗机构编码 Form_yljgBll Form_yljg = new Form_yljgBll(); DataTable dtYljg = Form_yljg.GetMoHuList("", "sql039"); //绑定医疗机构 comboBox_yljg.DataSource = dtYljg; comboBox_yljg.DisplayMember = "mc"; comboBox_yljg.ValueMember = "bm"; comboBox_yljg.SelectedValue = yljg; comboBox_yljg.Enabled = false; //取得村庄 listboxFormBll listbox = new listboxFormBll(); DataTable dtCunzhuang = listbox.GetMoHuList(string.Format("and YLJGBM = '{0}'", UserInfo.Yybm), "sql038"); //绑定医疗机构 comboBox_cunzhuang.DataSource = dtCunzhuang; comboBox_cunzhuang.DisplayMember = "czmc"; comboBox_cunzhuang.ValueMember = "czbm"; comboBox_cunzhuang.Focus(); }