public static bool InsertAccessSh(UpLoadDataForSH obj, out string err) { bool flag = false; err = ""; try { string sql = string.Format(@"insert into zkhw_tj_sh(bar_code,ALT,AST,TBIL,DBIL,CREA,UREA,GLU,TG,CHO,HDLC,LDLC,ALB,UA,HCY,AFP, CEA,Ka,Na,TP,ALP,GGT,CHE,TBA,APOA1,APOB,CK,CKMB,LDHL,HBDH,aAMY,createtime)values('{0}','{1}','{2}' ,'{3}','{4}','{5}','{6}','{7}','{8}','{9}','{10}','{11}','{12}','{13}','{14}','{15}','{16}','{17}','{18}','{19}' ,'{20}','{21}','{22}','{23}','{24}','{25}','{26}','{27}','{28}','{29}','{30}','{31}')", obj.bar_code, obj.ALT, obj.AST, obj.TBIL, obj.DBIL, obj.CREA, obj.UREA, obj.GLU, obj.TG, obj.CHO, obj.HDL_C, obj.LDL_C, obj.ALB, obj.UA, obj.HCY, obj.AFP, obj.CEA, obj.Ka, obj.Na, obj.TP, obj.ALP, obj.GGT, obj.CHE, obj.TBA, obj.APOA1, obj.APOB, obj.CK, obj.CKMB, obj.LDHL, obj.HBDH, obj.aAMY, obj.createtime); int ret = DbHelperAccess.ExecuteSql(sql); if (ret > 0) { flag = true; } } catch (Exception e) { err = e.Message; } return(flag); }
public static bool UpLoadDatashDal(UpLoadDataForSH obj, out string err) { err = ""; bool flag = false; try { string id = Common.GetNewId(); string timeCodeUnique = obj.bar_code + "_" + obj.createtime; string sql0 = string.Format("select count(ID) from zkhw_temp_sh where timecodeUnique='{0}'", timeCodeUnique); object o = DbHelperMySQL.GetSingleYpt(sql0); bool isinsert = false; if (o == null) { isinsert = true; } else { if (int.Parse(o.ToString()) <= 0) { isinsert = true; } } string sql = ""; if (isinsert == true) { sql = string.Format(@"insert into zkhw_temp_sh(ID,bar_code,ALT,AST,TBIL,DBIL,CREA,UREA,GLU,TG,CHO,HDLC,LDLC,ALB,UA,HCY,AFP, CEA,Ka,Na,TP,ALP,GGT,CHE,TBA,APOA1,APOB,CK,CKMB,LDHL,HBDH,aAMY,createtime,status,timecodeUnique)values('{0}','{1}','{2}' ,'{3}','{4}','{5}','{6}','{7}','{8}','{9}','{10}','{11}','{12}','{13}','{14}','{15}','{16}','{17}','{18}','{19}' ,'{20}','{21}','{22}','{23}','{24}','{25}','{26}','{27}','{28}','{29}','{30}','{31}','{32}',0,'{33}')", id, obj.bar_code, obj.ALT, obj.AST, obj.TBIL, obj.DBIL, obj.CREA, obj.UREA, obj.GLU, obj.TG, obj.CHO, obj.HDL_C, obj.LDL_C, obj.ALB, obj.UA, obj.HCY, obj.AFP, obj.CEA, obj.Ka, obj.Na, obj.TP, obj.ALP, obj.GGT, obj.CHE, obj.TBA, obj.APOA1, obj.APOB, obj.CK, obj.CKMB, obj.LDHL, obj.HBDH, obj.aAMY, obj.createtime, timeCodeUnique); } else { sql = @"update zkhw_temp_sh set status=0,ALB='" + obj.ALB + "',ALP='" + obj.ALP + "',ALT='" + obj.ALT + "',AST='" + obj.AST + "',CHO='" + obj.CHO + "',Crea='" + obj.CREA + "',DBIL='" + obj.DBIL + "',GGT='" + obj.GGT + "',GLU='" + obj.GLU + "',HDLC='" + obj.HDL_C + "',LDLC='" + obj.LDL_C + "',TBIL='" + obj.TBIL + "',TG='" + obj.TG + "',TP='" + obj.TP + "',UA='" + obj.UA + "',UREA='" + obj.UREA + "' where timecodeUnique = '" + timeCodeUnique + "'"; } int ret = DbHelperMySQL.ExecuteSqlYpt(sql); if (ret > 0) { flag = true; } } catch (Exception e) { err = e.Message; } return(flag); }
public static DisplayData GetobjDisplaySh(UpLoadDataForSH a) { a.LDLC = a.LDL_C; a.HDLC = a.HDL_C; DisplayData obj = new DisplayData(); obj.BarCode = a.bar_code; obj.UploadDate = a.createtime; obj.Type = "生化"; StringBuilder sb = new StringBuilder(); sb.AppendFormat(@"ALT:{0},AST:{1},TBIL:{2},DBIL:{3},CREA:{4},UREA:{5},GLU:{6},TG:{7},CHO:{8},HDLC:{9},LDLC:{10},ALB:{11},UA:{12},HCY:{13},AFP:{14},", a.ALT, a.AST, a.TBIL, a.DBIL, a.CREA, a.UREA, a.GLU, a.TG, a.CHO, a.HDLC, a.LDLC, a.ALB, a.UA, a.HCY, a.AFP); sb.AppendFormat(@"CEA:{0}, Ka:{1}, Na:{2}, TP:{3}, ALP:{4}, GGT:{5}, CHE:{6}, TBA:{7}, APOA1:{8}, APOB:{9}, CK:{10}, CKMB:{11}, LDHL:{12}, HBDH:{13}, aAMY:{14}", a.CEA, a.Ka, a.Na, a.TP, a.ALP, a.GGT, a.CHE, a.TBA, a.APOA1, a.APOB, a.CK, a.CKMB, a.LDHL, a.HBDH, a.aAMY); obj.Content = sb.ToString(); return(obj); }
public static UpLoadDataForSH GetObjshByDR(DataRow dr) { UpLoadDataForSH obj = new UpLoadDataForSH(); if (dr["ID"] != null) { obj.ID = dr["ID"].ToString(); } if (dr["bar_code"] != null) { obj.bar_code = dr["bar_code"].ToString(); } if (dr["ALT"] != null) { obj.ALT = dr["ALT"].ToString(); } if (dr["AST"] != null) { obj.AST = dr["AST"].ToString(); } if (dr["TBIL"] != null) { obj.TBIL = dr["TBIL"].ToString(); } if (dr["DBIL"] != null) { obj.DBIL = dr["DBIL"].ToString(); } if (dr["CREA"] != null) { obj.CREA = dr["CREA"].ToString(); } if (dr["UREA"] != null) { obj.UREA = dr["UREA"].ToString(); } if (dr["GLU"] != null) { obj.GLU = dr["GLU"].ToString(); } if (dr["TG"] != null) { obj.TG = dr["TG"].ToString(); } if (dr["CHO"] != null) { obj.CHO = dr["CHO"].ToString(); } if (dr["HDLC"] != null) { obj.HDLC = dr["HDLC"].ToString(); obj.HDL_C = obj.HDLC; } if (dr["LDLC"] != null) { obj.LDLC = dr["LDLC"].ToString(); obj.LDL_C = obj.LDLC; } if (dr["ALB"] != null) { obj.ALB = dr["ALB"].ToString(); } if (dr["UA"] != null) { obj.UA = dr["UA"].ToString(); } if (dr["HCY"] != null) { obj.HCY = dr["HCY"].ToString(); } if (dr["AFP"] != null) { obj.AFP = dr["AFP"].ToString(); } if (dr["CEA"] != null) { obj.CEA = dr["CEA"].ToString(); } if (dr["Ka"] != null) { obj.Ka = dr["Ka"].ToString(); } if (dr["Na"] != null) { obj.Na = dr["Na"].ToString(); } if (dr["TP"] != null) { obj.TP = dr["TP"].ToString(); } if (dr["ALP"] != null) { obj.ALP = dr["ALP"].ToString(); } if (dr["GGT"] != null) { obj.GGT = dr["GGT"].ToString(); } if (dr["CHE"] != null) { obj.CHE = dr["CHE"].ToString(); } if (dr["TBA"] != null) { obj.TBA = dr["TBA"].ToString(); } if (dr["APOA1"] != null) { obj.APOA1 = dr["APOA1"].ToString(); } if (dr["APOB"] != null) { obj.APOB = dr["APOB"].ToString(); } if (dr["CK"] != null) { obj.CK = dr["CK"].ToString(); } if (dr["CKMB"] != null) { obj.CKMB = dr["CKMB"].ToString(); } if (dr["LDHL"] != null) { obj.LDHL = dr["LDHL"].ToString(); } if (dr["HBDH"] != null) { obj.HBDH = dr["HBDH"].ToString(); } if (dr["aAMY"] != null) { obj.aAMY = dr["aAMY"].ToString(); } if (dr["createtime"] != null) { obj.createtime = dr["createtime"].ToString(); } return(obj); }