//新增身份识别 public void xzsfsb(string xml) { XmlDocument doc = new XmlDocument(); doc.LoadXml(xml); XmlNode list = doc.SelectSingleNode("//result"); XmlNode ot = list.SelectSingleNode("output"); Sfyz s = new Sfyz(); var propers = s.GetType().GetProperties(); foreach (var p in propers) { if (p.Name != "sign" && p.Name != "transid" && p.Name != "errorcode" && p.Name != "errormsg") { string n = ot.SelectSingleNode(p.Name).InnerText; if (n.Trim() == "") { n = null; } p.SetValue(s, n, null); } else { p.SetValue(s, list.SelectSingleNode(p.Name).InnerText, null); } } //status 0验证 1就诊登记 2费用明细上传 3出院登记 4费用结算 5病案上传 DBConn db = new DBConn(); string sql = "INSERT INTO [ydjs_zyy].[dbo].[sfsb]([sign],[transid],[errorcode],[errormsg],[aab301],[yab060],[aac002]," + "[aac043],[aac044],[aac003],[aac004],[aac005],[aac006],[ykc021],[ykc300],[akc026],[akc023],[aae379],[akc252]" + ",[aab001],[aab003],[aab004],[yka116],[yka119],[yka121],[yka123],[ake092],[yka437],[akc200],[ykc667],[yzz014],[ake132]" + ",[ykc669],[ykc678],[ykc670],[aka130],[ykc682],[ake014],[ykc672],[ykc673],[ykc674],[status]) " + "VALUES('" + s.sign + "','" + s.transid + "','" + s.errorcode + "','" + s.errormsg + "','" + s.aab301 + "','" + s.yab060 + "','" + s.aac002 + "'," + "'" + s.aac043 + "','" + s.aac044 + "','" + s.aac003 + "','" + s.aac004 + "','" + s.aac005 + "','" + s.aac006 + "','" + s.ykc021 + "','" + s.ykc300 + "','" + s.akc026 + "'," + "'" + s.akc023 + "','" + s.aae379 + "','" + s.akc252 + "','" + s.aab001 + "','" + s.aab003 + "','" + s.aab004 + "','" + s.yka116 + "','" + s.yka119 + "','" + s.yka121 + "','" + s.yka123 + "','" + s.ake092 + "','" + s.yka437 + "','" + s.akc200 + "','" + s.ykc667 + "','" + s.yzz014 + "','" + s.ake132 + "','" + s.ykc669 + "','" + s.ykc678 + "','" + s.ykc670 + "','" + s.aka130 + "','" + s.ykc682 + "','" + s.ake014 + "'," + "'" + s.ykc672 + "','" + s.ykc673 + "','" + s.ykc674 + "','0')select @@identity "; string issql = "select * from sfsb where aac044 = '" + s.aac044 + "' and status!='5'"; DataTable dt = db.GetDataSet(issql).Tables[0]; if (dt.Rows.Count < 1) { str_id = db.GetDataScalar(sql).ToString(); if (int.Parse(str_id) > 0)//转换测试数据 { MessageBox.Show("身份验证信息已添加"); } } else { MessageBox.Show("身份验证已存在"); } }
//动态添加控件 public void Addkj(Sfyz s) { var props = s.GetType().GetProperties(); int r = 1; int a = 1; int gd = 0; int sign = 0; for (int i = 0; i < props.Length; i++) { Label l1 = new Label(); l1.AutoSize = true; l1.Name = props[i].Name; foreach (var z in qj.zd) { if (z.Key == props[i].Name) { string aa = qj.pipei(props[i].Name, props[i].GetValue(s, null).ToString()); if (aa != null) { if (aa.Length > 100) { aa = aa.Insert(100, "\r\n"); } l1.Text = z.Value + ":" + aa; } else { l1.Text = z.Value + ":" + props[i].GetValue(s, null).ToString(); } } } if (i == 0) { sign = l1.Height + 2; } gd += l1.Height + 2; l1.Size = new Size(41, 12); l1.Location = new Point(50 * r * a - 10, gd); if (i == 20) { r += 1; a = 5; gd = sign; } this.groupBox1.Controls.Add(l1); } }
public void sfyz() { string sql = "select * from sfsb where aac044 = '" + aac044 + "' and id=" + str_id; DBConn db = new DBConn(); DataSet ds = db.GetDataSet(sql); DataTable dt = ds.Tables[0]; s = new Sfyz(); var fss = s.GetType().GetProperties(); foreach (var f in fss) { f.SetValue(s, dt.Rows[0][f.Name].ToString(), null); } Addkj(s); }
public FrmTab(string aac044, Form3 frm, string id) { str_id = id; this.frm = frm; this.aac044 = aac044; InitializeComponent(); string sql = "select * from sfsb where id='" + str_id + "'and aac044 = '" + aac044 + "'"; DBConn db = new DBConn(); DataSet ds = db.GetDataSet(sql); DataTable dt = ds.Tables[0]; sf = new Sfyz(); var fss = sf.GetType().GetProperties(); foreach (var f in fss) { f.SetValue(sf, dt.Rows[0][f.Name].ToString(), null); } }