protected void bloodGroupSaveButton_Click(object sender, EventArgs e) { string a = bloodGroupNameTextBox.Text.Trim(); if (!String.IsNullOrEmpty(a)) { BloodInfo aBloodInfo = new BloodInfo(); aBloodInfo.BloodGroupName = a; string msg = _bloodInfoManager.SaveBloodGroup(aBloodInfo); if (msg == "success") { DisplayMessage("Save Successfully.", Color.ForestGreen); Response.Redirect("showBloodInfo.aspx"); } else if (msg == "failed") { DisplayMessage("Failed! Try Again.", Color.DarkRed); } else if (msg == "exist") { DisplayMessage("Duplicate BloodGroup Exist! Try Again.", Color.DarkRed); } } else { DisplayMessage("Empty Fields Are Required! Try Again.", Color.Red); } }
public static int SaveFault(BloodInfo info) { if (info.category.BLOOD == null || info.category.BLOOD.fault == null) { return(0); } string sql = "INSERT INTO blood_fault(device_sn,code,dttime) " + "VALUES(?sn,?code,?dttime) "; MySqlParameter[] parameters = { new MySqlParameter("?sn", MySqlDbType.VarChar), new MySqlParameter("?code", MySqlDbType.VarChar), new MySqlParameter("?dttime", MySqlDbType.Timestamp) }; int num = 0; for (int i = 0; i < info.category.BLOOD.fault.Count; i++) { parameters[0].Value = info.sn; parameters[1].Value = info.category.BLOOD.fault[i].code; parameters[2].Value = info.category.BLOOD.fault[i].time; num += MySqlHelper.ExecuteNonQuery(Conn, sql, parameters); } return(num); }
public int[] AddAnswer(BloodInfo answer) { _given.SetActive(true); int[] score = { -1, -1 }; if (_compts[(int)answer.type - 1].ababo[(int)answer.family - 1] <= _givenCompts[(int)answer.type - 1].ababo[(int)answer.family - 1]) { Debug.Log("lose command"); PlaySound(_soundLose); Generate(); score[0] = -1; } else { given.Add(answer); bordsGiven[given.Count - 1].SetData(true, sprites[(int)answer.type - 1], "" + answer.family); score[0] = _data.ScoreByCommandPartiallyComplete; CanvasManager.inst.AddScore(score[0]); _compts[(int)answer.type - 1].ababo[(int)answer.family - 1]++; _remaining--; if (_remaining <= 0) { _nBagnextCommands.RemoveAt(0); Debug.Log("command completed"); PlaySound(_soundSuccess); _truck.SetNeedGo(); score[1] = _data.ScoreByCommandComplete; CanvasManager.inst.AddScore(score[1]); Generate(); } } return(score); }
public static int UpdateOrSaveSession(string id, DateTime dt, string strJson) { int num = 0; BloodInfo bloodInfo = null; BioInfo bioInfo = null; PoctInfo poctInfo = null; strJson = strJson.Trim().TrimStart('&').TrimEnd('#'); try { if (strJson.IndexOf("\"bio\"") >= 0) {//生化仪 bioInfo = JsonConvert.DeserializeObject <BioInfo>(strJson); } else if (strJson.IndexOf("\"poct\"") >= 0) {//POCT poctInfo = JsonConvert.DeserializeObject <PoctInfo>(strJson); } else {//血液分析仪 bloodInfo = JsonConvert.DeserializeObject <BloodInfo>(strJson.Replace("+", "_")); } } catch (Exception e) { bloodInfo = null; Console.WriteLine("Json 转 ClientInfo 出错:" + e.Message); } if (bloodInfo != null) { bloodInfo.sessionid = id; bloodInfo.starttime = dt; num = ReceiveDao.UpdateOrSaveSession(bloodInfo); SaveBloodData(bloodInfo); } else if (bioInfo != null) { bioInfo.sessionid = id; bioInfo.starttime = dt; num = ReceiveDao.UpdateOrSaveSessionForBio(bioInfo); SaveBioData(bioInfo); SaveLog(bioInfo.sn, strJson); } else if (poctInfo != null) { poctInfo.sessionid = id; poctInfo.starttime = dt; num = ReceiveDao.UpdateOrSaveSessionForPoct(poctInfo); SavePoctData(poctInfo); SaveLog(poctInfo.sn, strJson); } else { Console.WriteLine("ClientInfo 为 null."); } return(num); }
public void Init(GameData data, BloodInfo bloodInfo) { _data = data; state = State.home; //if (_data.HumansDatas != null) { SetModels(_data.HumansDatas[Random.Range(0, _data.HumansDatas.Count)]); this.bloodInfo = bloodInfo; _waitingFill.SetProgressionColor(_data.MedicColor); } }
public static int UpdateOrSaveRuntime(BloodInfo info) { if (info.category.BLOOD == null || info.category.BLOOD.runtime == null) { return(0); } string sql = "INSERT INTO blood_runtime(device_sn,runtime_days,runtime_power,runtime_opt,runtime_air_supply) VALUES(?sn,?days,?power,?opt,?supply) " + "ON DUPLICATE KEY UPDATE "; if (info.category.BLOOD.runtime.runtime_DAYS != null) { sql += ",runtime_days = ?days"; } if (info.category.BLOOD.runtime.runtime_POWER != null) { sql += ",runtime_power = ?power"; } if (info.category.BLOOD.runtime.runtime_OPT != null) { sql += ",runtime_opt = ?opt"; } if (info.category.BLOOD.runtime.runtime_AIR_SUPPLY != null) { sql += ",runtime_air_supply = ?supply"; } sql += ";"; sql = sql.Replace("UPDATE ,", "UPDATE "); MySqlParameter[] parameters = { new MySqlParameter("?sn", MySqlDbType.VarChar), new MySqlParameter("?days", MySqlDbType.VarChar), new MySqlParameter("?power", MySqlDbType.VarChar), new MySqlParameter("?opt", MySqlDbType.VarChar), new MySqlParameter("?supply", MySqlDbType.VarChar) }; parameters[0].Value = info.sn; parameters[1].Value = info.category.BLOOD.runtime.runtime_DAYS; parameters[2].Value = info.category.BLOOD.runtime.runtime_POWER; parameters[3].Value = info.category.BLOOD.runtime.runtime_OPT; parameters[4].Value = info.category.BLOOD.runtime.runtime_AIR_SUPPLY; int num = MySqlHelper.ExecuteNonQuery(Conn, sql, parameters); return(num); }
public void Generate() { int nBag = Commands.maxQuantity; if (_nBagnextCommands.Count > 0) { nBag = _nBagnextCommands[0]; } ask = new List <BloodInfo>(); given = new List <BloodInfo>(); _compts = new BloodInfo.Compatibilities[] { new BloodInfo.Compatibilities(BloodInfo.BloodType.Blood), new BloodInfo.Compatibilities(BloodInfo.BloodType.Platelet), new BloodInfo.Compatibilities(BloodInfo.BloodType.Plasma) }; _givenCompts = new BloodInfo.Compatibilities[] { new BloodInfo.Compatibilities(BloodInfo.BloodType.Blood), new BloodInfo.Compatibilities(BloodInfo.BloodType.Platelet), new BloodInfo.Compatibilities(BloodInfo.BloodType.Plasma) }; for (int i = 0; i < nBag; i++) { BloodInfo info = GameManager.inst.BloodInfoGetRand(); _compts[(int)info.type - 1].Increase(info.Compatibility()); ask.Add(info); bordsNeeds[i].SetData(true, sprites[(int)info.type - 1], "" + info.family); } for (int i = nBag; i < Commands.maxQuantity; i++) { bordsNeeds[i].SetData(false, null, null); } for (int i = 0; i < Commands.maxQuantity; i++) { bordsGiven[i].SetData(false, null, null); } _remaining = nBag; _given.SetActive(false); }
public bool Equals(BloodInfo info, bool c_type, bool c_family, bool c_rhesus) { bool equal = true; if (c_type && type != info.type) { equal = false; } else if (c_family && family != info.family) { equal = false; } else if (c_rhesus && rhesus != info.rhesus) { equal = false; } return(equal); }
private static void SaveBloodData(BloodInfo info) { if (info.category != null && info.category.BLOOD != null) { try { BloodDao.UpdateOrSaveRuntime(info); BloodDao.UpdateOrSaveCount(info); BloodDao.InsertCountDetail(info); BloodDao.UpdateOrSaveReagent(info); BloodDao.UpdateOrSaveModule(info); BloodDao.SaveFault(info); } catch (Exception e) { Console.WriteLine(e.Message); } } }
public string SaveBloodGroup(BloodInfo aBloodInfo) { bool isDuplicateBloodGroup = _bloodInfoGateway.IsDuplicatBldGroup(aBloodInfo); if (!isDuplicateBloodGroup) { int rowAffected = _bloodInfoGateway.SaveBloodGroup(aBloodInfo); if (rowAffected > 0) { return("success"); } else { return("failed"); } } else { return("exist"); } }
public bool EqualsType(BloodInfo info, bool c_type, bool c_family) { return(Equals(info, c_type, c_family, false)); }
public static int UpdateOrSaveSession(BloodInfo info) { string sql = "INSERT INTO device_info(SN,SIM,Region,Hospital,Address,Model,DeviceType,ProductSeries,ProductModel,OEM,Agent,ReagentType,FactoryDate,InstallDate,SoftVersion,last_poweroff_time,last_poweron_time,UpdateTime,dtupdate,sessionid,starttime) " + "VALUES(?sn,?sim,?region,?hospoital,?address,?model,'血液细胞分析仪',?series,?pmodel,?oem,?agent,?reatype,?dtfactory,?dtinstall,?version,?last_poweroff_time,?last_poweron_time,?updatetime,?dtupdate,?id,?dt) " + "ON DUPLICATE KEY UPDATE "; if (info.sim != null) { sql += ",SIM = ?sim"; } if (info.region != null) { sql += ",Region = ?region"; } if (info.hospital != null) { sql += ",Hospital = ?hospoital"; } if (info.addr != null) { sql += ",Address = ?address"; } if (info.model != null) { sql += ",Model = ?model"; } if (info.category != null && info.category.BLOOD != null) { if (info.category.BLOOD.series != null) { sql += ",ProductSeries = ?series"; } if (info.category.BLOOD.product_model != null) { sql += ",ProductModel = ?pmodel"; } if (info.category.BLOOD.OEM != null) { sql += ",OEM = ?oem"; } if (info.category.BLOOD.agent != null) { sql += ",Agent = ?agent"; } if (info.category.BLOOD.reagent_type != null) { sql += ",ReagentType = ?reatype"; } if (info.category.BLOOD.date_factory != null && info.category.BLOOD.date_factory != DateTime.MinValue) { sql += ",FactoryDate = ?dtfactory"; } if (info.category.BLOOD.date_install != null && info.category.BLOOD.date_install != DateTime.MinValue) { sql += ",InstallDate = ?dtinstall"; } if (info.category.BLOOD.soft_main_version != null) { sql += ",SoftVersion = ?version"; } if (info.category.BLOOD.last_poweroff_time != null) { sql += ",last_poweroff_time = ?last_poweroff_time"; } if (info.category.BLOOD.last_poweron_time != null) { sql += ",last_poweron_time = ?last_poweron_time"; } if (info.category.BLOOD.update_time != null && info.category.BLOOD.update_time != DateTime.MinValue) { sql += ",UpdateTime = ?updatetime"; } } sql += ",dtupdate = ?dtupdate "; sql += ",sessionid = ?id,starttime = ?dt; "; sql = sql.Replace("UPDATE ,", "UPDATE "); MySqlParameter[] parameters = { new MySqlParameter("?sn", MySqlDbType.VarChar), new MySqlParameter("?sim", MySqlDbType.VarChar), new MySqlParameter("?region", MySqlDbType.VarChar), new MySqlParameter("?hospoital", MySqlDbType.VarChar), new MySqlParameter("?address", MySqlDbType.VarChar), new MySqlParameter("?model", MySqlDbType.VarChar), new MySqlParameter("?series", MySqlDbType.VarChar), new MySqlParameter("?pmodel", MySqlDbType.VarChar), new MySqlParameter("?oem", MySqlDbType.VarChar), new MySqlParameter("?agent", MySqlDbType.VarChar), new MySqlParameter("?reatype", MySqlDbType.VarChar), new MySqlParameter("?dtfactory", MySqlDbType.Timestamp), new MySqlParameter("?dtinstall", MySqlDbType.Timestamp), new MySqlParameter("?version", MySqlDbType.VarChar), new MySqlParameter("?last_poweroff_time", MySqlDbType.VarChar), new MySqlParameter("?last_poweron_time", MySqlDbType.VarChar), new MySqlParameter("?updatetime", MySqlDbType.Timestamp), new MySqlParameter("?dtupdate", MySqlDbType.Timestamp), new MySqlParameter("?id", MySqlDbType.VarChar), new MySqlParameter("?dt", MySqlDbType.Timestamp) }; parameters[0].Value = info.sn; parameters[1].Value = info.sim; parameters[2].Value = info.region; parameters[3].Value = info.hospital; parameters[4].Value = info.addr; parameters[5].Value = info.model != null?info.model.ToUpper() : null; if (info.category == null || info.category.BLOOD == null) { parameters[6].Value = DBNull.Value; parameters[7].Value = DBNull.Value; parameters[8].Value = ""; parameters[9].Value = ""; parameters[10].Value = ""; parameters[11].Value = DBNull.Value; parameters[12].Value = DBNull.Value; parameters[13].Value = ""; parameters[14].Value = ""; parameters[15].Value = ""; parameters[16].Value = DBNull.Value; } else { parameters[6].Value = info.category.BLOOD.series; parameters[7].Value = info.category.BLOOD.product_model; parameters[8].Value = info.category.BLOOD.OEM; parameters[9].Value = info.category.BLOOD.agent; parameters[10].Value = info.category.BLOOD.reagent_type; parameters[11].Value = info.category.BLOOD.date_factory; parameters[12].Value = info.category.BLOOD.date_install; parameters[13].Value = info.category.BLOOD.soft_main_version; parameters[14].Value = info.category.BLOOD.last_poweroff_time; parameters[15].Value = info.category.BLOOD.last_poweron_time; parameters[16].Value = info.category.BLOOD.update_time; } parameters[17].Value = DateTime.Now; parameters[18].Value = info.sessionid; parameters[19].Value = info.starttime; int num = MySqlHelper.ExecuteNonQuery(Conn, sql, parameters); return(num); }
public static int UpdateOrSaveCount(BloodInfo info) { if (info.category.BLOOD == null || info.category.BLOOD.count_statistics == null) { return(0); } string sql = "INSERT INTO blood_count(device_sn,count_times_total,count_times_wb_cbc,count_times_wb_cd,count_times_wb_crp,count_times_wb_cbc_crp,count_times_wb_cd_crp,count_times_pd_cbc,count_times_pd_cd,count_times_pd_crp,count_times_pd_cbc_crp,count_times_pd_cd_crp,count_times_tipwb_cbc,count_times_tipwb_cd,count_times_qc) " + "VALUES(?sn,?total,?wbcbc,?wbcd,?wbcrp,?wbcbccrp,?wbcdcrp,?pdcbc,?pdcd,?pdcrp,?pdcbccrp,?pdcdcrp,?qc) " + "ON DUPLICATE KEY UPDATE "; if (info.category.BLOOD.count_statistics.count_times_TOTAL != null) { sql += ",count_times_total = ?total"; } if (info.category.BLOOD.count_statistics.count_times_WB_CBC != null) { sql += ",count_times_wb_cbc = ?wbcbc"; } if (info.category.BLOOD.count_statistics.count_times_WB_CD != null) { sql += ",count_times_wb_cd = ?wbcd"; } if (info.category.BLOOD.count_statistics.count_times_WB_CRP != null) { sql += ",count_times_wb_crp = ?wbcrp"; } if (info.category.BLOOD.count_statistics.count_times_WB_CBC_CRP != null) { sql += ",count_times_wb_cbc_crp = ?wbcbccrp"; } if (info.category.BLOOD.count_statistics.count_times_WB_CD_CRP != null) { sql += ",count_times_wb_cd_crp = ?wbcdcrp"; } if (info.category.BLOOD.count_statistics.count_times_PD_CBC != null) { sql += ",count_times_pd_cbc = ?pdcbc"; } if (info.category.BLOOD.count_statistics.count_times_PD_CD != null) { sql += ",count_times_pd_cd = ?pdcd"; } if (info.category.BLOOD.count_statistics.count_times_PD_CRP != null) { sql += ",count_times_pd_crp = ?pdcrp"; } if (info.category.BLOOD.count_statistics.count_times_PD_CBC_CRP != null) { sql += ",count_times_pd_cbc_crp = ?pdcbccrp"; } if (info.category.BLOOD.count_statistics.count_times_PD_CD_CRP != null) { sql += ",count_times_pd_cd_crp = ?pdcdcrp"; } if (info.category.BLOOD.count_statistics.count_times_tipwb_cbc != null) { sql += ",count_times_tipwb_cbc = ?count_times_tipwb_cbc"; } if (info.category.BLOOD.count_statistics.count_times_tipwb_cd != null) { sql += ",count_times_tipwb_cd = ?count_times_tipwb_cd"; } if (info.category.BLOOD.count_statistics.count_times_QC != null) { sql += ",count_times_qc = ?qc"; } sql += ";"; sql = sql.Replace("UPDATE ,", "UPDATE "); MySqlParameter[] parameters = { new MySqlParameter("?sn", MySqlDbType.VarChar), new MySqlParameter("?total", MySqlDbType.VarChar), new MySqlParameter("?wbcbc", MySqlDbType.VarChar), new MySqlParameter("?wbcd", MySqlDbType.VarChar), new MySqlParameter("?wbcrp", MySqlDbType.VarChar), new MySqlParameter("?wbcbccrp", MySqlDbType.VarChar), new MySqlParameter("?wbcdcrp", MySqlDbType.VarChar), new MySqlParameter("?pdcbc", MySqlDbType.VarChar), new MySqlParameter("?pdcd", MySqlDbType.VarChar), new MySqlParameter("?pdcrp", MySqlDbType.VarChar), new MySqlParameter("?pdcbccrp", MySqlDbType.VarChar), new MySqlParameter("?pdcdcrp", MySqlDbType.VarChar), new MySqlParameter("?count_times_tipwb_cbc", MySqlDbType.VarChar), new MySqlParameter("?count_times_tipwb_cd", MySqlDbType.VarChar), new MySqlParameter("?qc", MySqlDbType.VarChar) }; parameters[0].Value = info.sn; parameters[1].Value = info.category.BLOOD.count_statistics.count_times_TOTAL; parameters[2].Value = info.category.BLOOD.count_statistics.count_times_WB_CBC; parameters[3].Value = info.category.BLOOD.count_statistics.count_times_WB_CD; parameters[4].Value = info.category.BLOOD.count_statistics.count_times_WB_CRP; parameters[5].Value = info.category.BLOOD.count_statistics.count_times_WB_CBC_CRP; parameters[6].Value = info.category.BLOOD.count_statistics.count_times_WB_CD_CRP; parameters[7].Value = info.category.BLOOD.count_statistics.count_times_PD_CBC; parameters[8].Value = info.category.BLOOD.count_statistics.count_times_PD_CD; parameters[9].Value = info.category.BLOOD.count_statistics.count_times_PD_CRP; parameters[10].Value = info.category.BLOOD.count_statistics.count_times_PD_CBC_CRP; parameters[11].Value = info.category.BLOOD.count_statistics.count_times_PD_CD_CRP; parameters[12].Value = info.category.BLOOD.count_statistics.count_times_tipwb_cbc; parameters[13].Value = info.category.BLOOD.count_statistics.count_times_tipwb_cd; parameters[14].Value = info.category.BLOOD.count_statistics.count_times_QC; int num = MySqlHelper.ExecuteNonQuery(Conn, sql, parameters); return(num); }
public static int UpdateOrSaveReagent(BloodInfo info) { if (info.category.BLOOD == null || info.category.BLOOD.reagent == null) { return(0); } string sql = "INSERT INTO blood_reagent(device_sn,reagent_type,reagent_dil,reagent_lh,reagent_r1,reagent_r2,reagent_diff1,reagent_diff2,reagent_fl1,reagent_fl2,reagent_fl3,reagent_fl4,reagent_fl5,reagent_fl6) " + "VALUES(?sn,?reagent_type,?dil,?lh,?r1,?r2,?diff1,?diff2,?fl1,?fl2,?fl3,?fl4,?fl5,?fl6) " + "ON DUPLICATE KEY UPDATE "; if (info.category.BLOOD.reagent.reagent_type != null) { sql += ",reagent_type = ?reagent_type"; } if (info.category.BLOOD.reagent.reagent_DIL != null) { sql += ",reagent_dil = ?dil"; } if (info.category.BLOOD.reagent.reagent_LH != null) { sql += ",reagent_lh = ?lh"; } if (info.category.BLOOD.reagent.reagent_R1 != null) { sql += ",reagent_r1 = ?r1"; } if (info.category.BLOOD.reagent.reagent_R2 != null) { sql += ",reagent_r2 = ?r2"; } if (info.category.BLOOD.reagent.reagent_DIFF1 != null) { sql += ",reagent_diff1 = ?diff1"; } if (info.category.BLOOD.reagent.reagent_DIFF2 != null) { sql += ",reagent_diff2 = ?diff2"; } if (info.category.BLOOD.reagent.reagent_FL1 != null) { sql += ",reagent_fl1 = ?fl1"; } if (info.category.BLOOD.reagent.reagent_FL2 != null) { sql += ",reagent_fl2 = ?fl2"; } if (info.category.BLOOD.reagent.reagent_FL3 != null) { sql += ",reagent_fl3 = ?fl3"; } if (info.category.BLOOD.reagent.reagent_FL4 != null) { sql += ",reagent_fl4 = ?fl4"; } if (info.category.BLOOD.reagent.reagent_FL5 != null) { sql += ",reagent_fl5 = ?fl5"; } if (info.category.BLOOD.reagent.reagent_FL6 != null) { sql += ",reagent_fl6 = ?fl6"; } sql += ";"; sql = sql.Replace("UPDATE ,", "UPDATE "); MySqlParameter[] parameters = { new MySqlParameter("?sn", MySqlDbType.VarChar), new MySqlParameter("?reagent_type", MySqlDbType.VarChar), new MySqlParameter("?dil", MySqlDbType.VarChar), new MySqlParameter("?lh", MySqlDbType.VarChar), new MySqlParameter("?r1", MySqlDbType.VarChar), new MySqlParameter("?r2", MySqlDbType.VarChar), new MySqlParameter("?diff1", MySqlDbType.VarChar), new MySqlParameter("?diff2", MySqlDbType.VarChar), new MySqlParameter("?fl1", MySqlDbType.VarChar), new MySqlParameter("?fl2", MySqlDbType.VarChar), new MySqlParameter("?fl3", MySqlDbType.VarChar), new MySqlParameter("?fl4", MySqlDbType.VarChar), new MySqlParameter("?fl5", MySqlDbType.VarChar), new MySqlParameter("?fl6", MySqlDbType.VarChar) }; parameters[0].Value = info.sn; parameters[1].Value = info.category.BLOOD.reagent.reagent_type; parameters[2].Value = info.category.BLOOD.reagent.reagent_DIL; parameters[3].Value = info.category.BLOOD.reagent.reagent_LH; parameters[4].Value = info.category.BLOOD.reagent.reagent_R1; parameters[5].Value = info.category.BLOOD.reagent.reagent_R2; parameters[6].Value = info.category.BLOOD.reagent.reagent_DIFF1; parameters[7].Value = info.category.BLOOD.reagent.reagent_DIFF2; parameters[8].Value = info.category.BLOOD.reagent.reagent_FL1; parameters[9].Value = info.category.BLOOD.reagent.reagent_FL2; parameters[10].Value = info.category.BLOOD.reagent.reagent_FL3; parameters[11].Value = info.category.BLOOD.reagent.reagent_FL4; parameters[12].Value = info.category.BLOOD.reagent.reagent_FL5; parameters[13].Value = info.category.BLOOD.reagent.reagent_FL6; int num = MySqlHelper.ExecuteNonQuery(Conn, sql, parameters); return(num); }
public static int InsertCountDetail(BloodInfo info) { if (info.category.BLOOD == null || info.category.BLOOD.count_statistics == null) { return(0); } string base_sql = "INSERT INTO blood_count_detail(device_sn,device_count,device_count_type) VALUES(\"{0}\",{1},\"{2}\"); "; string sql = ""; if (info.category.BLOOD.count_statistics.count_times_TOTAL != null) { sql += string.Format(base_sql, info.sn, info.category.BLOOD.count_statistics.count_times_TOTAL, "count_times_total"); } if (info.category.BLOOD.count_statistics.count_times_WB_CBC != null) { sql += string.Format(base_sql, info.sn, info.category.BLOOD.count_statistics.count_times_WB_CBC, "count_times_wb_cbc"); } if (info.category.BLOOD.count_statistics.count_times_WB_CD != null) { sql += string.Format(base_sql, info.sn, info.category.BLOOD.count_statistics.count_times_WB_CD, "count_times_wb_cd"); } if (info.category.BLOOD.count_statistics.count_times_WB_CRP != null) { sql += string.Format(base_sql, info.sn, info.category.BLOOD.count_statistics.count_times_WB_CRP, "count_times_wb_crp"); } if (info.category.BLOOD.count_statistics.count_times_WB_CBC_CRP != null) { sql += string.Format(base_sql, info.sn, info.category.BLOOD.count_statistics.count_times_WB_CBC_CRP, "count_times_wb_cbc_crp"); } if (info.category.BLOOD.count_statistics.count_times_WB_CD_CRP != null) { sql += string.Format(base_sql, info.sn, info.category.BLOOD.count_statistics.count_times_WB_CD_CRP, "count_times_wb_cd_crp"); } if (info.category.BLOOD.count_statistics.count_times_PD_CBC != null) { sql += string.Format(base_sql, info.sn, info.category.BLOOD.count_statistics.count_times_PD_CBC, "count_times_pd_cbc"); } if (info.category.BLOOD.count_statistics.count_times_PD_CD != null) { sql += string.Format(base_sql, info.sn, info.category.BLOOD.count_statistics.count_times_PD_CD, "count_times_pd_cd"); } if (info.category.BLOOD.count_statistics.count_times_PD_CRP != null) { sql += string.Format(base_sql, info.sn, info.category.BLOOD.count_statistics.count_times_PD_CRP, "count_times_pd_crp"); } if (info.category.BLOOD.count_statistics.count_times_PD_CBC_CRP != null) { sql += string.Format(base_sql, info.sn, info.category.BLOOD.count_statistics.count_times_PD_CBC_CRP, "count_times_pd_cbc_crp"); } if (info.category.BLOOD.count_statistics.count_times_PD_CD_CRP != null) { sql += string.Format(base_sql, info.sn, info.category.BLOOD.count_statistics.count_times_PD_CD_CRP, "count_times_pd_cd_crp"); } if (info.category.BLOOD.count_statistics.count_times_tipwb_cbc != null) { sql += string.Format(base_sql, info.sn, info.category.BLOOD.count_statistics.count_times_tipwb_cbc, "count_times_tipwb_cbc"); } if (info.category.BLOOD.count_statistics.count_times_tipwb_cd != null) { sql += string.Format(base_sql, info.sn, info.category.BLOOD.count_statistics.count_times_tipwb_cd, "count_times_tipwb_cd"); } if (info.category.BLOOD.count_statistics.count_times_QC != null) { sql += string.Format(base_sql, info.sn, info.category.BLOOD.count_statistics.count_times_QC, "count_times_qc"); } MySqlParameter[] parameters = {}; int num = MySqlHelper.ExecuteNonQuery(Conn, sql, parameters); return(num); }
public bool EqualsType(BloodInfo info, bool c_type) { return(Equals(info, c_type, true, true)); }
public bool EqualsType(BloodInfo info) { return(Equals(info, true, true, true)); }
public static int UpdateOrSaveModule(BloodInfo info) { if (info.category.BLOOD == null || info.category.BLOOD.module_statistics == null) { return(0); } string sql = "INSERT INTO blood_module(device_sn,hole_times_wbc,hole_times_rbc,needle_times_impale,sampling_times_fault,syringe_times_syringe_fault,inject_times_fault,mixing_times_fault) " + "VALUES(?sn,?wbc,?rbc,?needle,?sampling,?syringe,?inject,?mixing) " + "ON DUPLICATE KEY UPDATE "; if (info.category.BLOOD.module_statistics.hole_times_WBC != null) { sql += ",hole_times_wbc = ?wbc"; } if (info.category.BLOOD.module_statistics.hole_times_RBC != null) { sql += ",hole_times_rbc = ?rbc"; } if (info.category.BLOOD.module_statistics.needle_times_impale != null) { sql += ",needle_times_impale = ?needle"; } if (info.category.BLOOD.module_statistics.sampling_times_fault != null) { sql += ",sampling_times_fault = ?sampling"; } if (info.category.BLOOD.module_statistics.Syringe_times_syringe_fault != null) { sql += ",syringe_times_syringe_fault = ?syringe"; } if (info.category.BLOOD.module_statistics.inject_times_fault != null) { sql += ",inject_times_fault = ?inject"; } if (info.category.BLOOD.module_statistics.mixing_times_fault != null) { sql += ",mixing_times_fault = ?mixing"; } sql += ";"; sql = sql.Replace("UPDATE ,", "UPDATE "); MySqlParameter[] parameters = { new MySqlParameter("?sn", MySqlDbType.VarChar), new MySqlParameter("?wbc", MySqlDbType.VarChar), new MySqlParameter("?rbc", MySqlDbType.VarChar), new MySqlParameter("?needle", MySqlDbType.VarChar), new MySqlParameter("?sampling", MySqlDbType.VarChar), new MySqlParameter("?syringe", MySqlDbType.VarChar), new MySqlParameter("?inject", MySqlDbType.VarChar), new MySqlParameter("?mixing", MySqlDbType.VarChar) }; parameters[0].Value = info.sn; parameters[1].Value = info.category.BLOOD.module_statistics.hole_times_WBC; parameters[2].Value = info.category.BLOOD.module_statistics.hole_times_RBC; parameters[3].Value = info.category.BLOOD.module_statistics.needle_times_impale; parameters[4].Value = info.category.BLOOD.module_statistics.sampling_times_fault; parameters[5].Value = info.category.BLOOD.module_statistics.Syringe_times_syringe_fault; parameters[6].Value = info.category.BLOOD.module_statistics.inject_times_fault; parameters[7].Value = info.category.BLOOD.module_statistics.mixing_times_fault; int num = MySqlHelper.ExecuteNonQuery(Conn, sql, parameters); return(num); }