/// <summary> /// 体检保存 /// </summary> /// <returns></returns> private yy_asd_tab GetObj() { yy_asd_tab obj = CommonHelper.GetObj <yy_asd_tab>(panel2.Controls); if (dataGridView2.SelectedRows.Count > 0) { yy_asd_tabNotMap qttab = dataGridView2.SelectedRows[0].Tag as yy_asd_tabNotMap; obj.id = qttab.id; obj.child_id = qttab.child_id; obj.yy_djrq = qttab.yy_djrq; obj.yy_xm = _yyxm; } return(obj); }
/// <summary> /// 保存儿童体检项目信息 /// </summary> public void saveRecord() { _obj = GetObj(); if (bll.SaveOrUpdate(_obj)) { MessageBox.Show("保存成功!", "软件提示"); RefreshCheckList(); } else { MessageBox.Show("保存失败!", "软件提示"); } }
private void buttonX4_Click(object sender, EventArgs e) { yy_asd_tab yyobj = CommonHelper.GetObjMenzhen <yy_asd_tab>(panel2.Controls, 0); yyobj.yy_bh = ""; yyobj.yy_bz = ""; yyobj.yy_djrq = DateTime.Now.ToString("yyyy-MM-dd"); yyobj.yy_rq = DateTime.Now.ToString("yyyy-MM-dd"); yyobj.yy_sfjf = ""; yyobj.yy_sjd = ""; yyobj.yy_xm = _yyxm; bll.SaveOrUpdate(yyobj); _obj = yyobj; RefreshCheckList(); }
private void buttonX5_Click(object sender, EventArgs e) { yy_pz_tab pzobj = pzbll.GetByXm(_yyxm); DateTime starttime = dateTimePicker1.Value; DateTime endtime = dateTimePicker2.Value; int daycount = (endtime - starttime).Days; if (pzobj != null) { yy_asd_tab yyobj = CommonHelper.GetObjMenzhen <yy_asd_tab>(panel2.Controls, 0); if (!String.IsNullOrEmpty(pzobj.pz_xq)) { string[] xqargs = pzobj.pz_xq.Split(','); foreach (string xq in xqargs) { for (int i = 0; i <= daycount; i++) { string[] sjdargs = pzobj.pz_sjd.Split(','); if (xq.Contains(getWeekStr(starttime.AddDays(i)))) { for (int j = 0; j < sjdargs.Length; j++) { yyobj.yy_bh = ""; yyobj.yy_bz = ""; yyobj.yy_djrq = DateTime.Now.ToString("yyyy-MM-dd"); yyobj.yy_rq = starttime.AddDays(i).ToString("yyyy-MM-dd"); yyobj.yy_sfjf = ""; yyobj.yy_sjd = sjdargs[j]; yyobj.yy_xm = _yyxm; bll.Add(yyobj); } } } } RefreshCheckList(); } } }
private void buttonX8_Click(object sender, EventArgs e) { Paneltsb_searchInfo frmsearcher = new Paneltsb_searchInfo(); frmsearcher.ShowDialog(); if (frmsearcher.DialogResult == DialogResult.OK) { tb_childbase jibenobj = frmsearcher.returnval; if (jibenobj != null) { yy_asd_tab obj = GetObj(); obj.child_id = jibenobj.id; if (bll.SaveOrUpdate(obj)) { MessageBox.Show("保存成功!", "软件提示"); RefreshCheckList(); } else { MessageBox.Show("保存失败!", "软件提示"); } } } }