// public HttpResponseMessage Geteqia_r_daySTG(string itemcontent, string standardnum, string std, string type) { string result = string.Empty; try { string itemCode1000 = System.Configuration.ConfigurationManager.AppSettings["itemCode1000"].ToString();//因子单位mg转ug *1000 List <ItemSTD> itemstd = new List <ItemSTD>(); RuletblEQIA_R_ItemSTD rule_itemstd = new RuletblEQIA_R_ItemSTD(); IList <tblEQIA_R_ItemSTD> list = rule_itemstd.GetDaySTG(itemcontent.TrimEnd(new char[] { ',' }), standardnum); if (list != null && list.Count > 0) { for (int i = 0; i < list.Count; i++) { if (itemCode1000.Contains(list[i].fldItemCode)) { list[i].fldDaySTG1 = list[i].fldDaySTG1; list[i].fldDaySTG2 = list[i].fldDaySTG2; list[i].fldDaySTG3 = list[i].fldDaySTG3; list[i].fldHourSTG1 = list[i].fldHourSTG1; list[i].fldHourSTG2 = list[i].fldHourSTG2; list[i].fldHourSTG3 = list[i].fldHourSTG3; } string stgstr = ""; switch (std) { case "1": stgstr = type == "0" ? list[i].fldDaySTG1.ToString() : list[i].fldHourSTG1.ToString(); break; case "2": stgstr = type == "0" ? list[i].fldDaySTG2.ToString() : list[i].fldHourSTG2.ToString(); break; case "3": stgstr = type == "0" ? list[i].fldDaySTG3.ToString() : list[i].fldHourSTG3.ToString(); break; } ItemSTD str = new ItemSTD(); str.key = list[i].fldItemCode; str.stg = stgstr; itemstd.Add(str); } result = rule.JsonStr("ok", "", itemstd); } else { result = rule.JsonStr("nodata", "没有因子对应的执行质量标准", itemstd); } } catch (Exception e) { result = rule.JsonStr("error", e.Message, ""); } return(new HttpResponseMessage { Content = new StringContent(result, System.Text.Encoding.UTF8, "application/json") }); }
// public HttpResponseMessage Geteqiw_r_daySTG(string itemcontent, string standardnum, string std, string type) { string result = string.Empty; try { RuletblEQIW_R_DAQLTSTD rule_itemstd = new RuletblEQIW_R_DAQLTSTD(); List <ItemSTD> itemstd = new List <ItemSTD>(); IList <tblEQIW_R_DAQLTSTD> list = rule_itemstd.GetSTD(itemcontent, standardnum); if (list != null && list.Count > 0) { for (int i = 0; i < list.Count; i++) { string stgstr = ""; switch (std) { case "1": stgstr = list[i].fldST10.ToString(); break; case "2": stgstr = list[i].fldST20.ToString(); break; case "3": stgstr = list[i].fldST30.ToString(); break; case "4": stgstr = list[i].fldST40.ToString(); break; case "5": stgstr = list[i].fldST50.ToString(); break; } ItemSTD str = new ItemSTD(); str.key = list[i].fldItemCode; str.stg = stgstr; itemstd.Add(str); } result = rule.JsonStr("ok", "", itemstd); } else { result = rule.JsonStr("nodata", "没有因子对应的执行质量标准", itemstd); } } catch (Exception e) { result = rule.JsonStr("error", e.Message, ""); } return(new HttpResponseMessage { Content = new StringContent(result, System.Text.Encoding.UTF8, "application/json") }); }