/// <summary> /// 对象编辑 /// </summary> /// <param name="tMisMonitorDustattribute">用户对象</param> /// <returns>是否成功</returns> public bool Edit(TMisMonitorDustattributeVo tMisMonitorDustattribute) { string strSQL = SqlHelper.BuildUpdateExpress(tMisMonitorDustattribute, TMisMonitorDustattributeVo.T_MIS_MONITOR_DUSTATTRIBUTE_TABLE); strSQL += string.Format(" where ID='{0}' ", tMisMonitorDustattribute.ID); return(SqlHelper.ExecuteNonQuery(CommandType.Text, strSQL) > 0 ? true : false); }
/// <summary> /// 获取对象DataTable /// </summary> /// <param name="tMisMonitorDustattribute">对象</param> /// <param name="iIndex">起始页码</param> /// <param name="iCount">每页数目</param> /// <returns>返回结果</returns> public DataTable SelectByTable(TMisMonitorDustattributeVo tMisMonitorDustattribute, int iIndex, int iCount) { string strSQL = " select * from T_MIS_MONITOR_DUSTATTRIBUTE {0} order by id"; strSQL = String.Format(strSQL, BuildWhereStatement(tMisMonitorDustattribute)); return(SqlHelper.ExecuteDataTable(BuildPagerExpress(strSQL, iIndex, iCount))); }
/// <summary> /// 对象编辑 /// </summary> /// <param name="tMisMonitorDustattribute_UpdateSet">UpdateSet用户对象</param> /// <param name="tMisMonitorDustattribute_UpdateWhere">UpdateWhere用户对象</param> /// <returns>是否成功</returns> public bool Edit(TMisMonitorDustattributeVo tMisMonitorDustattribute_UpdateSet, TMisMonitorDustattributeVo tMisMonitorDustattribute_UpdateWhere) { string strSQL = SqlHelper.BuildUpdateExpress(tMisMonitorDustattribute_UpdateSet, TMisMonitorDustattributeVo.T_MIS_MONITOR_DUSTATTRIBUTE_TABLE); strSQL += this.BuildWhereStatement(tMisMonitorDustattribute_UpdateWhere); return(SqlHelper.ExecuteNonQuery(CommandType.Text, strSQL) > 0 ? true : false); }
/// <summary> /// 对象删除 /// </summary> /// <param name="Id">ID</param> /// <returns>是否成功</returns> public bool Delete(TMisMonitorDustattributeVo tMisMonitorDustattribute) { string strSQL = "delete from T_MIS_MONITOR_DUSTATTRIBUTE "; strSQL += this.BuildWhereStatement(tMisMonitorDustattribute); return(SqlHelper.ExecuteNonQuery(CommandType.Text, strSQL) > 0 ? true : false); }
/// <summary> /// 创建原因:根据原始记录表基本数据ID获取当前项目的属性表数据信息 /// 创建人:胡方扬 /// 创建日期:2013-07-09 /// </summary> /// <returns></returns> public string getAttInfor() { string result = ""; if (!String.IsNullOrEmpty(strBaseInfor_Id)) { TMisMonitorDustattributeVo objDustAtt = new TMisMonitorDustattributeVo(); objDustAtt.BASEINFOR_ID = strBaseInfor_Id; objDustAtt.SORT_FIELD = "ID"; objDustAtt.SORT_TYPE = "desc"; DataTable objDt = new TMisMonitorDustattributeLogic().SelectByTable(objDustAtt, intPageIndex, intPageSize); int CountNum = new TMisMonitorDustattributeLogic().GetSelectResultCount(objDustAtt); result = LigerGridDataToJson(objDt, CountNum); } return(result); }
/// <summary> /// 创建原因:根据监测项目基础属性ID,创建初始化属性数据信息 /// 创建人:胡方扬 /// 创建时间:2013-07-09 /// </summary> /// <returns></returns> public string SaveAttInfor() { string result = ""; if (!String.IsNullOrEmpty(strBaseInfor_Id)) { TMisMonitorDustattributeVo objDustAtt = new TMisMonitorDustattributeVo(); objDustAtt.BASEINFOR_ID = strBaseInfor_Id; objDustAtt.SAMPLE_CODE = (GetDustyCoutForBaseInfor() + 1).ToString(); objDustAtt.ID = GetSerialNumber("t_mis_dutyAttInforID"); if (new TMisMonitorDustattributeLogic().Create(objDustAtt)) { result = objDustAtt.ID; } } return(result); }
/// <summary> /// 创建原因:根据指定监测项目属性ID 更新指定列的数据 /// 创建人:胡方扬 /// 创建时间:2013-07-09 /// </summary> /// <returns></returns> public bool UpdateAttValue() { bool blFlag = false; if (!String.IsNullOrEmpty(strAttInfor_Id) && !String.IsNullOrEmpty(strUpdateCell)) { blFlag = new TMisMonitorDustattributeLogic().UpdateCell(strAttInfor_Id, strUpdateCell, strUpdateCellValue); Regex r = new Regex("^\\d+(\\.)?\\d*$"); TMisMonitorDustattributeVo DustattributeVo = new TMisMonitorDustattributeVo(); DustattributeVo = new TMisMonitorDustattributeLogic().Details(strAttInfor_Id); if (blFlag) { switch (strUpdateCell) { case "L_STAND": //标况体积 case "SMOKE_DISCHARGE": //定溶体积 case "SMOKE_POTENCY2": //油烟浓度 //计算油烟排放浓度:(油烟浓度*定溶体积)/标况体积 decimal dL_STAND = r.IsMatch(DustattributeVo.L_STAND) ? decimal.Parse(DustattributeVo.L_STAND) : 0; decimal dSMOKE_DISCHARGE = r.IsMatch(DustattributeVo.SMOKE_DISCHARGE) ? decimal.Parse(DustattributeVo.SMOKE_DISCHARGE) : 0; decimal dSMOKE_POTENCY2 = r.IsMatch(DustattributeVo.SMOKE_POTENCY2) ? decimal.Parse(DustattributeVo.SMOKE_POTENCY2) : 0; decimal dSMOKE_POTENCY = 0; if (dL_STAND != 0) { dSMOKE_POTENCY = (dSMOKE_POTENCY2 * dSMOKE_DISCHARGE) / dL_STAND; blFlag = new TMisMonitorDustattributeLogic().UpdateCell(strAttInfor_Id, "SMOKE_POTENCY", Math.Round(dSMOKE_POTENCY, 2).ToString()); } break; default: break; } } } return(blFlag); }
/// <summary> /// 根据对象获取全部数据,用Table承载 /// 数据量较小时使用【不推荐】 /// </summary> /// <param name="tMisMonitorDustattribute"></param> /// <returns></returns> public DataTable SelectByTable(TMisMonitorDustattributeVo tMisMonitorDustattribute) { string strSQL = "select * from T_MIS_MONITOR_DUSTATTRIBUTE " + this.BuildWhereStatement(tMisMonitorDustattribute) + " order by id"; return(SqlHelper.ExecuteDataTable(strSQL)); }
public string CheckDustyTable(string strSumResultId) { bool isSuccess = true; DataTable dtDustinfor = new TMisMonitorDustinforLogic().SelectTableByID(strSumResultId); DataRow[] drDustinfor; //如果是烟尘,粉尘,总悬浮颗粒物,颗粒物(000001827,000001945,000000130,000000220)初重、终重、重量 不能为空 drDustinfor = dtDustinfor.Select("ITEM_ID in('000001827','000001945','000000130','000000220')"); for (int i = 0; i < drDustinfor.Length; i++) { TMisMonitorDustattributeVo objDustattribute = new TMisMonitorDustattributeVo(); objDustattribute.BASEINFOR_ID = drDustinfor[i]["ID"].ToString(); DataTable dt = new TMisMonitorDustattributeLogic().SelectByTable(objDustattribute); for (int j = 0; j < dt.Rows.Count; j++) { if (dt.Rows[j]["FITER_BEGIN_WEIGHT"].ToString().Length == 0 && dt.Rows[j]["SAMPLE_CODE"].ToString() != "平均") { isSuccess = false; break; } if (dt.Rows[j]["FITER_AFTER_WEIGHT"].ToString().Length == 0 && dt.Rows[j]["SAMPLE_CODE"].ToString() != "平均") { isSuccess = false; break; } if (dt.Rows[j]["SAMPLE_WEIGHT"].ToString().Length == 0 && dt.Rows[j]["SAMPLE_CODE"].ToString() != "平均") { isSuccess = false; break; } } TMisMonitorDustattributePmVo objDustattributePm = new TMisMonitorDustattributePmVo(); objDustattributePm.BASEINFOR_ID = drDustinfor[i]["ID"].ToString(); dt = new TMisMonitorDustattributePmLogic().SelectByTable(objDustattributePm); for (int j = 0; j < dt.Rows.Count; j++) { if (dt.Rows[j]["SAMPLE_FWEIGHT"].ToString().Length == 0 && dt.Rows[j]["FITER_CODE"].ToString() != "平均") { isSuccess = false; break; } if (dt.Rows[j]["SAMPLE_EWEIGHT"].ToString().Length == 0 && dt.Rows[j]["FITER_CODE"].ToString() != "平均") { isSuccess = false; break; } if (dt.Rows[j]["SAMPLE_WEIGHT"].ToString().Length == 0 && dt.Rows[j]["FITER_CODE"].ToString() != "平均") { isSuccess = false; break; } } } drDustinfor = dtDustinfor.Select("ITEM_ID not in('000001827','000001945','000000130','000000220')"); for (int i = 0; i < drDustinfor.Length; i++) { TMisMonitorDustattributeVo objDustattribute = new TMisMonitorDustattributeVo(); objDustattribute.BASEINFOR_ID = drDustinfor[i]["ID"].ToString(); DataTable dt = new TMisMonitorDustattributeLogic().SelectByTable(objDustattribute); for (int j = 0; j < dt.Rows.Count; j++) { if (dt.Rows[j]["SMOKE_POTENCY"].ToString().Length == 0 && dt.Rows[j]["SAMPLE_CODE"].ToString() != "平均") { isSuccess = false; break; } } TMisMonitorDustattributePmVo objDustattributePm = new TMisMonitorDustattributePmVo(); objDustattributePm.BASEINFOR_ID = drDustinfor[i]["ID"].ToString(); dt = new TMisMonitorDustattributePmLogic().SelectByTable(objDustattributePm); for (int j = 0; j < dt.Rows.Count; j++) { if (dt.Rows[j]["SAMPLE_CONCENT"].ToString().Length == 0 && dt.Rows[j]["FITER_CODE"].ToString() != "平均") { isSuccess = false; break; } } } return(isSuccess == true ? "1" : "0"); }
/// <summary> /// 获取对象List /// </summary> /// <param name="tMisMonitorDustattribute">对象</param> /// <param name="iIndex">起始页码</param> /// <param name="iCount">每页数目</param> /// <returns>返回结果</returns> public List <TMisMonitorDustattributeVo> SelectByObject(TMisMonitorDustattributeVo tMisMonitorDustattribute, int iIndex, int iCount) { string strSQL = String.Format("select * from T_MIS_MONITOR_DUSTATTRIBUTE " + this.BuildWhereStatement(tMisMonitorDustattribute)); return(SqlHelper.ExecuteObjectList(tMisMonitorDustattribute, BuildPagerExpress(strSQL, iIndex, iCount))); }
/// <summary> /// 对象编辑 /// </summary> /// <param name="tMisMonitorDustattribute">用户对象</param> /// <returns>是否成功</returns> public bool Edit(TMisMonitorDustattributeVo tMisMonitorDustattribute) { return(access.Edit(tMisMonitorDustattribute)); }
/// <summary> /// 获得查询结果总行数,用于分页 /// </summary> /// <param name="tMisMonitorDustattribute">对象</param> /// <returns>返回行数</returns> public int GetSelectResultCount(TMisMonitorDustattributeVo tMisMonitorDustattribute) { string strSQL = "select Count(*) from T_MIS_MONITOR_DUSTATTRIBUTE " + this.BuildWhereStatement(tMisMonitorDustattribute); return(Convert.ToInt32(SqlHelper.ExecuteScalar(strSQL))); }
/// <summary> /// 对象明细 /// </summary> /// <param name="tMisMonitorDustattribute">对象条件</param> /// <returns>对象</returns> public TMisMonitorDustattributeVo Details(TMisMonitorDustattributeVo tMisMonitorDustattribute) { string strSQL = String.Format("select * from T_MIS_MONITOR_DUSTATTRIBUTE " + this.BuildWhereStatement(tMisMonitorDustattribute)); return(SqlHelper.ExecuteObject(new TMisMonitorDustattributeVo(), strSQL)); }
/// <summary> /// 创建原因:根据指定监测项目属性ID 更新指定列的数据 /// 创建人:胡方扬 /// 创建时间:2013-07-09 /// </summary> /// <returns></returns> public bool UpdateAttValue() { bool blFlag = false; if (!String.IsNullOrEmpty(strAttInfor_Id) && !String.IsNullOrEmpty(strUpdateCell)) { blFlag = new TMisMonitorDustattributeLogic().UpdateCell(strAttInfor_Id, strUpdateCell, strUpdateCellValue); Regex r = new Regex("^\\d+(\\.)?\\d*$"); TMisMonitorDustattributeVo DustattributeVo = new TMisMonitorDustattributeVo(); DustattributeVo = new TMisMonitorDustattributeLogic().Details(strAttInfor_Id); if (blFlag) { switch (strUpdateCell) { case "FITER_BEGIN_WEIGHT": //初重 case "FITER_AFTER_WEIGHT": //终重 //计算样品重量:终重-初重 decimal dWEIGHT_BEGIN = r.IsMatch(DustattributeVo.FITER_BEGIN_WEIGHT) ? decimal.Parse(DustattributeVo.FITER_BEGIN_WEIGHT) : 0; decimal dWEIGHT_END = r.IsMatch(DustattributeVo.FITER_AFTER_WEIGHT) ? decimal.Parse(DustattributeVo.FITER_AFTER_WEIGHT) : 0; decimal dWEIGHT = Math.Abs(dWEIGHT_END - dWEIGHT_BEGIN); blFlag = new TMisMonitorDustattributeLogic().UpdateCell(strAttInfor_Id, "SAMPLE_WEIGHT", dWEIGHT.ToString()); //计算烟尘浓度:(样品重量/标况体积)*1000000 decimal dL_STAND = r.IsMatch(DustattributeVo.L_STAND) ? decimal.Parse(DustattributeVo.L_STAND) : 0; decimal dPOTENCY = 0; if (dL_STAND != 0) { dPOTENCY = (dWEIGHT / dL_STAND) * 1000000; blFlag = new TMisMonitorDustattributeLogic().UpdateCell(strAttInfor_Id, "SMOKE_POTENCY", Math.Round(dPOTENCY, 0).ToString()); } //计算烟尘折算浓度:((21/(21-烟气含氧量))*烟尘浓度)/折算系数 decimal dOXYGEN = r.IsMatch(DustattributeVo.SMOKE_OXYGEN) ? decimal.Parse(DustattributeVo.SMOKE_OXYGEN) : 0; TMisMonitorDustinforVo DustinforVo = new TMisMonitorDustinforLogic().Details(DustattributeVo.BASEINFOR_ID); decimal dMODUL_NUM = r.IsMatch(DustinforVo.MODUL_NUM) ? decimal.Parse(DustinforVo.MODUL_NUM) : 0; decimal dPOTENCY2 = 0; if (dMODUL_NUM != 0) { dPOTENCY2 = ((21 / (21 - dOXYGEN)) * dPOTENCY) / dMODUL_NUM; blFlag = new TMisMonitorDustattributeLogic().UpdateCell(strAttInfor_Id, "SMOKE_POTENCY2", Math.Round(dPOTENCY2, 0).ToString()); } //计算烟尘排放量:(烟尘浓度*标态流量)/1000000 decimal dSPEED = r.IsMatch(DustattributeVo.NM_SPEED) ? decimal.Parse(DustattributeVo.NM_SPEED) : 0; blFlag = new TMisMonitorDustattributeLogic().UpdateCell(strAttInfor_Id, "SMOKE_DISCHARGE", Math.Round((dPOTENCY * dSPEED) / 1000000, 3).ToString()); break; case "SAMPLE_WEIGHT": //样品重量 //计算烟尘浓度:(样品重量/标况体积)*1000000 dL_STAND = r.IsMatch(DustattributeVo.L_STAND) ? decimal.Parse(DustattributeVo.L_STAND) : 0; dWEIGHT = r.IsMatch(DustattributeVo.SAMPLE_WEIGHT) ? decimal.Parse(DustattributeVo.SAMPLE_WEIGHT) : 0; dPOTENCY = 0; if (dL_STAND != 0) { dPOTENCY = (dWEIGHT / dL_STAND) * 1000000; blFlag = new TMisMonitorDustattributeLogic().UpdateCell(strAttInfor_Id, "SMOKE_POTENCY", Math.Round(dPOTENCY, 0).ToString()); } //计算烟尘折算浓度:((21/(21-烟气含氧量))*烟尘浓度)/折算系数 dOXYGEN = r.IsMatch(DustattributeVo.SMOKE_OXYGEN) ? decimal.Parse(DustattributeVo.SMOKE_OXYGEN) : 0; DustinforVo = new TMisMonitorDustinforLogic().Details(DustattributeVo.BASEINFOR_ID); dMODUL_NUM = r.IsMatch(DustinforVo.MODUL_NUM) ? decimal.Parse(DustinforVo.MODUL_NUM) : 0; dPOTENCY2 = 0; if (dMODUL_NUM != 0) { dPOTENCY2 = ((21 / (21 - dOXYGEN)) * dPOTENCY) / dMODUL_NUM; blFlag = new TMisMonitorDustattributeLogic().UpdateCell(strAttInfor_Id, "SMOKE_POTENCY2", Math.Round(dPOTENCY2, 0).ToString()); } //计算烟尘排放量:(烟尘浓度*标态流量)/1000000 dSPEED = r.IsMatch(DustattributeVo.NM_SPEED) ? decimal.Parse(DustattributeVo.NM_SPEED) : 0; blFlag = new TMisMonitorDustattributeLogic().UpdateCell(strAttInfor_Id, "SMOKE_DISCHARGE", Math.Round((dPOTENCY * dSPEED) / 1000000, 3).ToString()); break; case "SMOKE_POTENCY": //烟尘浓度 //计算烟尘折算浓度:((21/(21-烟气含氧量))*烟尘浓度)/折算系数 dPOTENCY = r.IsMatch(DustattributeVo.SMOKE_POTENCY) ? decimal.Parse(DustattributeVo.SMOKE_POTENCY) : 0; dOXYGEN = r.IsMatch(DustattributeVo.SMOKE_OXYGEN) ? decimal.Parse(DustattributeVo.SMOKE_OXYGEN) : 0; DustinforVo = new TMisMonitorDustinforLogic().Details(DustattributeVo.BASEINFOR_ID); dMODUL_NUM = r.IsMatch(DustinforVo.MODUL_NUM) ? decimal.Parse(DustinforVo.MODUL_NUM) : 0; dPOTENCY2 = 0; if (dMODUL_NUM != 0) { dPOTENCY2 = ((21 / (21 - dOXYGEN)) * dPOTENCY) / dMODUL_NUM; blFlag = new TMisMonitorDustattributeLogic().UpdateCell(strAttInfor_Id, "SMOKE_POTENCY2", Math.Round(dPOTENCY2, 0).ToString()); } else { if (DustattributeVo.SAMPLE_CODE == "平均") { //更新结果表 TMisMonitorResultVo objResultVo = new TMisMonitorResultVo(); objResultVo.ID = DustinforVo.SUBTASK_ID; objResultVo.ITEM_RESULT = strUpdateCellValue; blFlag = new TMisMonitorResultLogic().Edit(objResultVo); } } //计算烟尘排放量:(烟尘浓度*标态流量)/1000000 dSPEED = r.IsMatch(DustattributeVo.NM_SPEED) ? decimal.Parse(DustattributeVo.NM_SPEED) : 0; blFlag = new TMisMonitorDustattributeLogic().UpdateCell(strAttInfor_Id, "SMOKE_DISCHARGE", Math.Round((dPOTENCY * dSPEED) / 1000000, 3).ToString()); break; case "SMOKE_POTENCY2": DustinforVo = new TMisMonitorDustinforLogic().Details(DustattributeVo.BASEINFOR_ID); dMODUL_NUM = r.IsMatch(DustinforVo.MODUL_NUM) ? decimal.Parse(DustinforVo.MODUL_NUM) : 0; if (dMODUL_NUM != 0 && DustattributeVo.SAMPLE_CODE == "平均") { //更新结果表 TMisMonitorResultVo objResultVo = new TMisMonitorResultVo(); objResultVo.ID = DustinforVo.SUBTASK_ID; objResultVo.ITEM_RESULT = strUpdateCellValue; blFlag = new TMisMonitorResultLogic().Edit(objResultVo); } break; default: break; } } } return(blFlag); }
public TMisMonitorDustattributeLogic(TMisMonitorDustattributeVo _tMisMonitorDustattribute) { tMisMonitorDustattribute = _tMisMonitorDustattribute; access = new TMisMonitorDustattributeAccess(); }
/// <summary> /// 对象编辑 /// </summary> /// <param name="tMisMonitorDustattribute_UpdateSet">UpdateSet用户对象</param> /// <param name="tMisMonitorDustattribute_UpdateWhere">UpdateWhere用户对象</param> /// <returns>是否成功</returns> public bool Edit(TMisMonitorDustattributeVo tMisMonitorDustattribute_UpdateSet, TMisMonitorDustattributeVo tMisMonitorDustattribute_UpdateWhere) { return(access.Edit(tMisMonitorDustattribute_UpdateSet, tMisMonitorDustattribute_UpdateWhere)); }
/// <summary> /// 获得查询结果总行数,用于分页 /// </summary> /// <param name="tMisMonitorDustattribute">对象</param> /// <returns>返回行数</returns> public int GetSelectResultCount(TMisMonitorDustattributeVo tMisMonitorDustattribute) { return(access.GetSelectResultCount(tMisMonitorDustattribute)); }
/// <summary> /// 对象添加 /// </summary> /// <param name="tMisMonitorDustattribute">对象</param> /// <returns>是否成功</returns> public bool Create(TMisMonitorDustattributeVo tMisMonitorDustattribute) { string strSQL = SqlHelper.BuildInsertExpress(tMisMonitorDustattribute, TMisMonitorDustattributeVo.T_MIS_MONITOR_DUSTATTRIBUTE_TABLE); return(SqlHelper.ExecuteNonQuery(CommandType.Text, strSQL) > 0 ? true : false); }
/// <summary> /// 根据对象获取全部数据,用Table承载 /// 数据量较小时使用【不推荐】 /// </summary> /// <param name="tMisMonitorDustattribute"></param> /// <returns></returns> public DataTable SelectByTable(TMisMonitorDustattributeVo tMisMonitorDustattribute) { return(access.SelectByTable(tMisMonitorDustattribute)); }
/// <summary> /// 获取对象DataTable /// </summary> /// <param name="tMisMonitorDustattribute">对象</param> /// <param name="iIndex">起始页码</param> /// <param name="iCount">每页数目</param> /// <returns>返回结果</returns> public DataTable SelectByTable(TMisMonitorDustattributeVo tMisMonitorDustattribute, int iIndex, int iCount) { return(access.SelectByTable(tMisMonitorDustattribute, iIndex, iCount)); }
/// <summary> /// 获取对象List /// </summary> /// <param name="tMisMonitorDustattribute">对象</param> /// <param name="iIndex">起始页码</param> /// <param name="iCount">每页数目</param> /// <returns>返回结果</returns> public List <TMisMonitorDustattributeVo> SelectByObject(TMisMonitorDustattributeVo tMisMonitorDustattribute, int iIndex, int iCount) { return(access.SelectByObject(tMisMonitorDustattribute, iIndex, iCount)); }
/// <summary> /// 对象明细 /// </summary> /// <param name="tMisMonitorDustattribute">对象条件</param> /// <returns>对象</returns> public TMisMonitorDustattributeVo Details(TMisMonitorDustattributeVo tMisMonitorDustattribute) { return(access.Details(tMisMonitorDustattribute)); }
/// <summary> /// 创建原因:计算原始记录表的平均数据 /// 创建人:魏林 /// 创建时间:2014-04-16 /// </summary> /// <returns></returns> public string AvgAttInfor() { Regex r = new Regex("^\\d+(\\.)?\\d*$"); bool iSuccess = true; decimal SMOKE_TEMPERATURE = 0, SMOKE_OXYGEN = 0, SMOKE_SPEED = 0, NM_SPEED = 0, L_STAND = 0; decimal SMOKE_POTENCY = 0, SMOKE_POTENCY2 = 0, SMOKE_DISCHARGE = 0; decimal SMOKE_TEMPERATURE_COut = 0, SMOKE_OXYGEN_COut = 0, SMOKE_SPEED_COut = 0, NM_SPEED_COut = 0, L_STAND_COut = 0, SMOKE_POTENCY_COut = 0, SMOKE_POTENCY2_COut = 0, SMOKE_DISCHARGE_COut = 0; int iPRECISION = 0; //平均值的小数位位数 if (!String.IsNullOrEmpty(strBaseInfor_Id)) { TMisMonitorDustattributeVo objDustAtt = new TMisMonitorDustattributeVo(); objDustAtt.BASEINFOR_ID = strBaseInfor_Id; objDustAtt.SORT_FIELD = "ID"; DataTable dt = new TMisMonitorDustattributeLogic().SelectByTable(objDustAtt); if (dt.Rows[dt.Rows.Count - 1]["SAMPLE_CODE"].ToString() == "平均") { objDustAtt.SORT_FIELD = ""; objDustAtt.ID = dt.Rows[dt.Rows.Count - 1]["ID"].ToString(); for (int i = 0; i < dt.Rows.Count - 1; i++) { if (r.IsMatch(dt.Rows[i]["SMOKE_TEMPERATURE"].ToString())) { SMOKE_TEMPERATURE += decimal.Parse(dt.Rows[i]["SMOKE_TEMPERATURE"].ToString()); } else { SMOKE_TEMPERATURE_COut = GetNumber(dt.Rows[i]["SMOKE_TEMPERATURE"].ToString()); SMOKE_TEMPERATURE += SMOKE_TEMPERATURE_COut / 2; } if (r.IsMatch(dt.Rows[i]["SMOKE_OXYGEN"].ToString())) { SMOKE_OXYGEN += decimal.Parse(dt.Rows[i]["SMOKE_OXYGEN"].ToString()); } else { SMOKE_OXYGEN_COut = GetNumber(dt.Rows[i]["SMOKE_OXYGEN"].ToString()); SMOKE_OXYGEN += SMOKE_OXYGEN_COut / 2; } if (r.IsMatch(dt.Rows[i]["SMOKE_SPEED"].ToString())) { SMOKE_SPEED += decimal.Parse(dt.Rows[i]["SMOKE_SPEED"].ToString()); } else { SMOKE_SPEED_COut = GetNumber(dt.Rows[i]["SMOKE_SPEED"].ToString()); SMOKE_SPEED += SMOKE_SPEED_COut / 2; } if (r.IsMatch(dt.Rows[i]["NM_SPEED"].ToString())) { NM_SPEED += decimal.Parse(dt.Rows[i]["NM_SPEED"].ToString()); } else { NM_SPEED_COut = GetNumber(dt.Rows[i]["NM_SPEED"].ToString()); NM_SPEED += NM_SPEED_COut / 2; } if (r.IsMatch(dt.Rows[i]["L_STAND"].ToString())) { L_STAND += decimal.Parse(dt.Rows[i]["L_STAND"].ToString()); } else { L_STAND_COut = GetNumber(dt.Rows[i]["L_STAND"].ToString()); L_STAND += L_STAND_COut / 2; } if (r.IsMatch(dt.Rows[i]["SMOKE_POTENCY"].ToString())) { SMOKE_POTENCY += decimal.Parse(dt.Rows[i]["SMOKE_POTENCY"].ToString()); } else { SMOKE_POTENCY_COut = GetNumber(dt.Rows[i]["SMOKE_POTENCY"].ToString()); SMOKE_POTENCY += SMOKE_POTENCY_COut / 2; } if (r.IsMatch(dt.Rows[i]["SMOKE_POTENCY2"].ToString())) { SMOKE_POTENCY2 += decimal.Parse(dt.Rows[i]["SMOKE_POTENCY2"].ToString()); } else { SMOKE_POTENCY2_COut = GetNumber(dt.Rows[i]["SMOKE_POTENCY2"].ToString()); SMOKE_POTENCY2 += SMOKE_POTENCY2_COut / 2; } if (r.IsMatch(dt.Rows[i]["SMOKE_DISCHARGE"].ToString())) { SMOKE_DISCHARGE += decimal.Parse(dt.Rows[i]["SMOKE_DISCHARGE"].ToString()); } else { SMOKE_DISCHARGE_COut = GetNumber(dt.Rows[i]["SMOKE_DISCHARGE"].ToString()); SMOKE_DISCHARGE += SMOKE_DISCHARGE_COut / 2; } } iPRECISION = dt.Rows[0]["SMOKE_TEMPERATURE"].ToString().Contains('.') ? dt.Rows[0]["SMOKE_TEMPERATURE"].ToString().Split('.')[1].Length : 0; if (SMOKE_TEMPERATURE_COut != 0 && Math.Round(SMOKE_TEMPERATURE / (dt.Rows.Count - 1), iPRECISION) < SMOKE_TEMPERATURE_COut) { objDustAtt.SMOKE_TEMPERATURE = SMOKE_TEMPERATURE_COut.ToString() + "(L)"; } else { objDustAtt.SMOKE_TEMPERATURE = Math.Round(SMOKE_TEMPERATURE / (dt.Rows.Count - 1), iPRECISION).ToString(); } iPRECISION = dt.Rows[0]["SMOKE_OXYGEN"].ToString().Contains('.') ? dt.Rows[0]["SMOKE_OXYGEN"].ToString().Split('.')[1].Length : 0; if (SMOKE_OXYGEN_COut != 0 && Math.Round(SMOKE_OXYGEN / (dt.Rows.Count - 1), iPRECISION) < SMOKE_OXYGEN_COut) { objDustAtt.SMOKE_OXYGEN = SMOKE_OXYGEN_COut.ToString() + "(L)"; } else { objDustAtt.SMOKE_OXYGEN = Math.Round(SMOKE_OXYGEN / (dt.Rows.Count - 1), iPRECISION).ToString(); } iPRECISION = dt.Rows[0]["SMOKE_SPEED"].ToString().Contains('.') ? dt.Rows[0]["SMOKE_SPEED"].ToString().Split('.')[1].Length : 0; if (SMOKE_SPEED_COut != 0 && Math.Round(SMOKE_SPEED / (dt.Rows.Count - 1), iPRECISION) < SMOKE_SPEED_COut) { objDustAtt.SMOKE_SPEED = SMOKE_SPEED_COut.ToString() + "(L)"; } else { objDustAtt.SMOKE_SPEED = Math.Round(SMOKE_SPEED / (dt.Rows.Count - 1), iPRECISION).ToString(); } iPRECISION = dt.Rows[0]["NM_SPEED"].ToString().Contains('.') ? dt.Rows[0]["NM_SPEED"].ToString().Split('.')[1].Length : 0; if (NM_SPEED_COut != 0 && Math.Round(NM_SPEED / (dt.Rows.Count - 1), iPRECISION) < NM_SPEED_COut) { objDustAtt.NM_SPEED = NM_SPEED_COut.ToString() + "(L)"; } else { objDustAtt.NM_SPEED = Math.Round(NM_SPEED / (dt.Rows.Count - 1), iPRECISION).ToString(); } iPRECISION = dt.Rows[0]["L_STAND"].ToString().Contains('.') ? dt.Rows[0]["L_STAND"].ToString().Split('.')[1].Length : 0; if (L_STAND_COut != 0 && Math.Round(L_STAND / (dt.Rows.Count - 1), iPRECISION) < L_STAND_COut) { objDustAtt.L_STAND = L_STAND_COut.ToString() + "(L)"; } else { objDustAtt.L_STAND = Math.Round(L_STAND / (dt.Rows.Count - 1), iPRECISION).ToString(); } iPRECISION = dt.Rows[0]["SMOKE_POTENCY"].ToString().Contains('.') ? dt.Rows[0]["SMOKE_POTENCY"].ToString().Split('.')[1].Length : 0; if (SMOKE_POTENCY_COut != 0 && Math.Round(SMOKE_POTENCY / (dt.Rows.Count - 1), iPRECISION) < SMOKE_POTENCY_COut) { objDustAtt.SMOKE_POTENCY = SMOKE_POTENCY_COut.ToString() + "(L)"; } else { objDustAtt.SMOKE_POTENCY = Math.Round(SMOKE_POTENCY / (dt.Rows.Count - 1), iPRECISION).ToString(); } iPRECISION = dt.Rows[0]["SMOKE_POTENCY2"].ToString().Contains('.') ? dt.Rows[0]["SMOKE_POTENCY2"].ToString().Split('.')[1].Length : 0; if (SMOKE_POTENCY2_COut != 0 && Math.Round(SMOKE_POTENCY2 / (dt.Rows.Count - 1), iPRECISION) < SMOKE_POTENCY2_COut) { objDustAtt.SMOKE_POTENCY2 = SMOKE_POTENCY2_COut.ToString() + "(L)"; } else { objDustAtt.SMOKE_POTENCY2 = Math.Round(SMOKE_POTENCY2 / (dt.Rows.Count - 1), iPRECISION).ToString(); } iPRECISION = dt.Rows[0]["SMOKE_DISCHARGE"].ToString().Contains('.') ? dt.Rows[0]["SMOKE_DISCHARGE"].ToString().Split('.')[1].Length : 0; if (SMOKE_DISCHARGE_COut != 0 && Math.Round(SMOKE_DISCHARGE / (dt.Rows.Count - 1), iPRECISION) < SMOKE_DISCHARGE_COut) { objDustAtt.SMOKE_DISCHARGE = SMOKE_DISCHARGE_COut.ToString() + "(L)"; } else { objDustAtt.SMOKE_DISCHARGE = Math.Round(SMOKE_DISCHARGE / (dt.Rows.Count - 1), iPRECISION).ToString(); } iSuccess = new TMisMonitorDustattributeLogic().Edit(objDustAtt); } else { objDustAtt.SORT_FIELD = ""; objDustAtt.ID = GetSerialNumber("t_mis_dutyAttInforID"); objDustAtt.SAMPLE_CODE = "平均"; for (int i = 0; i < dt.Rows.Count; i++) { if (r.IsMatch(dt.Rows[i]["SMOKE_TEMPERATURE"].ToString())) { SMOKE_TEMPERATURE += decimal.Parse(dt.Rows[i]["SMOKE_TEMPERATURE"].ToString()); } else { SMOKE_TEMPERATURE_COut = GetNumber(dt.Rows[i]["SMOKE_TEMPERATURE"].ToString()); SMOKE_TEMPERATURE += SMOKE_TEMPERATURE_COut / 2; } if (r.IsMatch(dt.Rows[i]["SMOKE_OXYGEN"].ToString())) { SMOKE_OXYGEN += decimal.Parse(dt.Rows[i]["SMOKE_OXYGEN"].ToString()); } else { SMOKE_OXYGEN_COut = GetNumber(dt.Rows[i]["SMOKE_OXYGEN"].ToString()); SMOKE_OXYGEN += SMOKE_OXYGEN_COut / 2; } if (r.IsMatch(dt.Rows[i]["SMOKE_SPEED"].ToString())) { SMOKE_SPEED += decimal.Parse(dt.Rows[i]["SMOKE_SPEED"].ToString()); } else { SMOKE_SPEED_COut = GetNumber(dt.Rows[i]["SMOKE_SPEED"].ToString()); SMOKE_SPEED += SMOKE_SPEED_COut / 2; } if (r.IsMatch(dt.Rows[i]["NM_SPEED"].ToString())) { NM_SPEED += decimal.Parse(dt.Rows[i]["NM_SPEED"].ToString()); } else { NM_SPEED_COut = GetNumber(dt.Rows[i]["NM_SPEED"].ToString()); NM_SPEED += NM_SPEED_COut / 2; } if (r.IsMatch(dt.Rows[i]["L_STAND"].ToString())) { L_STAND += decimal.Parse(dt.Rows[i]["L_STAND"].ToString()); } else { L_STAND_COut = GetNumber(dt.Rows[i]["L_STAND"].ToString()); L_STAND += L_STAND_COut / 2; } if (r.IsMatch(dt.Rows[i]["SMOKE_POTENCY"].ToString())) { SMOKE_POTENCY += decimal.Parse(dt.Rows[i]["SMOKE_POTENCY"].ToString()); } else { SMOKE_POTENCY_COut = GetNumber(dt.Rows[i]["SMOKE_POTENCY"].ToString()); SMOKE_POTENCY += SMOKE_POTENCY_COut / 2; } if (r.IsMatch(dt.Rows[i]["SMOKE_POTENCY2"].ToString())) { SMOKE_POTENCY2 += decimal.Parse(dt.Rows[i]["SMOKE_POTENCY2"].ToString()); } else { SMOKE_POTENCY2_COut = GetNumber(dt.Rows[i]["SMOKE_POTENCY2"].ToString()); SMOKE_POTENCY2 += SMOKE_POTENCY2_COut / 2; } if (r.IsMatch(dt.Rows[i]["SMOKE_DISCHARGE"].ToString())) { SMOKE_DISCHARGE += decimal.Parse(dt.Rows[i]["SMOKE_DISCHARGE"].ToString()); } else { SMOKE_DISCHARGE_COut = GetNumber(dt.Rows[i]["SMOKE_DISCHARGE"].ToString()); SMOKE_DISCHARGE += SMOKE_DISCHARGE_COut / 2; } } iPRECISION = dt.Rows[0]["SMOKE_TEMPERATURE"].ToString().Contains('.') ? dt.Rows[0]["SMOKE_TEMPERATURE"].ToString().Split('.')[1].Length : 0; if (SMOKE_TEMPERATURE_COut != 0 && Math.Round(SMOKE_TEMPERATURE / (dt.Rows.Count - 1), iPRECISION) < SMOKE_TEMPERATURE_COut) { objDustAtt.SMOKE_TEMPERATURE = SMOKE_TEMPERATURE_COut.ToString() + "(L)"; } else { objDustAtt.SMOKE_TEMPERATURE = Math.Round(SMOKE_TEMPERATURE / (dt.Rows.Count - 1), iPRECISION).ToString(); } iPRECISION = dt.Rows[0]["SMOKE_OXYGEN"].ToString().Contains('.') ? dt.Rows[0]["SMOKE_OXYGEN"].ToString().Split('.')[1].Length : 0; if (SMOKE_OXYGEN_COut != 0 && Math.Round(SMOKE_OXYGEN / (dt.Rows.Count - 1), iPRECISION) < SMOKE_OXYGEN_COut) { objDustAtt.SMOKE_OXYGEN = SMOKE_OXYGEN_COut.ToString() + "(L)"; } else { objDustAtt.SMOKE_OXYGEN = Math.Round(SMOKE_OXYGEN / (dt.Rows.Count - 1), iPRECISION).ToString(); } iPRECISION = dt.Rows[0]["SMOKE_SPEED"].ToString().Contains('.') ? dt.Rows[0]["SMOKE_SPEED"].ToString().Split('.')[1].Length : 0; if (SMOKE_SPEED_COut != 0 && Math.Round(SMOKE_SPEED / (dt.Rows.Count - 1), iPRECISION) < SMOKE_SPEED_COut) { objDustAtt.SMOKE_SPEED = SMOKE_SPEED_COut.ToString() + "(L)"; } else { objDustAtt.SMOKE_SPEED = Math.Round(SMOKE_SPEED / (dt.Rows.Count - 1), iPRECISION).ToString(); } iPRECISION = dt.Rows[0]["NM_SPEED"].ToString().Contains('.') ? dt.Rows[0]["NM_SPEED"].ToString().Split('.')[1].Length : 0; if (NM_SPEED_COut != 0 && Math.Round(NM_SPEED / (dt.Rows.Count - 1), iPRECISION) < NM_SPEED_COut) { objDustAtt.NM_SPEED = NM_SPEED_COut.ToString() + "(L)"; } else { objDustAtt.NM_SPEED = Math.Round(NM_SPEED / (dt.Rows.Count - 1), iPRECISION).ToString(); } iPRECISION = dt.Rows[0]["L_STAND"].ToString().Contains('.') ? dt.Rows[0]["L_STAND"].ToString().Split('.')[1].Length : 0; if (L_STAND_COut != 0 && Math.Round(L_STAND / (dt.Rows.Count - 1), iPRECISION) < L_STAND_COut) { objDustAtt.L_STAND = L_STAND_COut.ToString() + "(L)"; } else { objDustAtt.L_STAND = Math.Round(L_STAND / (dt.Rows.Count - 1), iPRECISION).ToString(); } iPRECISION = dt.Rows[0]["SMOKE_POTENCY"].ToString().Contains('.') ? dt.Rows[0]["SMOKE_POTENCY"].ToString().Split('.')[1].Length : 0; if (SMOKE_POTENCY_COut != 0 && Math.Round(SMOKE_POTENCY / (dt.Rows.Count - 1), iPRECISION) < SMOKE_POTENCY_COut) { objDustAtt.SMOKE_POTENCY = SMOKE_POTENCY_COut.ToString() + "(L)"; } else { objDustAtt.SMOKE_POTENCY = Math.Round(SMOKE_POTENCY / (dt.Rows.Count - 1), iPRECISION).ToString(); } iPRECISION = dt.Rows[0]["SMOKE_POTENCY2"].ToString().Contains('.') ? dt.Rows[0]["SMOKE_POTENCY2"].ToString().Split('.')[1].Length : 0; if (SMOKE_POTENCY2_COut != 0 && Math.Round(SMOKE_POTENCY2 / (dt.Rows.Count - 1), iPRECISION) < SMOKE_POTENCY2_COut) { objDustAtt.SMOKE_POTENCY2 = SMOKE_POTENCY2_COut.ToString() + "(L)"; } else { objDustAtt.SMOKE_POTENCY2 = Math.Round(SMOKE_POTENCY2 / (dt.Rows.Count - 1), iPRECISION).ToString(); } iPRECISION = dt.Rows[0]["SMOKE_DISCHARGE"].ToString().Contains('.') ? dt.Rows[0]["SMOKE_DISCHARGE"].ToString().Split('.')[1].Length : 0; if (SMOKE_DISCHARGE_COut != 0 && Math.Round(SMOKE_DISCHARGE / (dt.Rows.Count - 1), iPRECISION) < SMOKE_DISCHARGE_COut) { objDustAtt.SMOKE_DISCHARGE = SMOKE_DISCHARGE_COut.ToString() + "(L)"; } else { objDustAtt.SMOKE_DISCHARGE = Math.Round(SMOKE_DISCHARGE / (dt.Rows.Count - 1), iPRECISION).ToString(); } iSuccess = new TMisMonitorDustattributeLogic().Create(objDustAtt); } //更新结果表 TMisMonitorDustinforVo objDustinforVo = new TMisMonitorDustinforLogic().Details(strBaseInfor_Id); TMisMonitorResultVo objResultVo = new TMisMonitorResultLogic().Details(objDustinforVo.SUBTASK_ID); if (objDustinforVo.MODUL_NUM.Length > 0) { objResultVo.ITEM_RESULT = objDustAtt.SMOKE_POTENCY2; } else { objResultVo.ITEM_RESULT = objDustAtt.SMOKE_POTENCY; } iSuccess = new TMisMonitorResultLogic().Edit(objResultVo); } return(iSuccess ? "1" : "0"); }
/// <summary> /// 对象添加 /// </summary> /// <param name="sysRole">对象</param> /// <returns>是否成功</returns> public bool Create(TMisMonitorDustattributeVo tMisMonitorDustattribute) { return(access.Create(tMisMonitorDustattribute)); }
/// <summary> /// 根据对象构造条件语句 /// </summary> /// <param name="tMisMonitorDustattribute"></param> /// <returns></returns> public string BuildWhereStatement(TMisMonitorDustattributeVo tMisMonitorDustattribute) { StringBuilder strWhereStatement = new StringBuilder(" Where 1=1 "); if (null != tMisMonitorDustattribute) { // if (!String.IsNullOrEmpty(tMisMonitorDustattribute.ID.ToString().Trim())) { strWhereStatement.Append(string.Format(" AND ID = '{0}'", tMisMonitorDustattribute.ID.ToString())); } // if (!String.IsNullOrEmpty(tMisMonitorDustattribute.BASEINFOR_ID.ToString().Trim())) { strWhereStatement.Append(string.Format(" AND BASEINFOR_ID = '{0}'", tMisMonitorDustattribute.BASEINFOR_ID.ToString())); } //采样序号 if (!String.IsNullOrEmpty(tMisMonitorDustattribute.SAMPLE_CODE.ToString().Trim())) { strWhereStatement.Append(string.Format(" AND SAMPLE_CODE = '{0}'", tMisMonitorDustattribute.SAMPLE_CODE.ToString())); } //滤筒编号 if (!String.IsNullOrEmpty(tMisMonitorDustattribute.FITER_CODE.ToString().Trim())) { strWhereStatement.Append(string.Format(" AND FITER_CODE = '{0}'", tMisMonitorDustattribute.FITER_CODE.ToString())); } //采样日期 if (!String.IsNullOrEmpty(tMisMonitorDustattribute.SAMPLE_DATE.ToString().Trim())) { strWhereStatement.Append(string.Format(" AND SAMPLE_DATE = '{0}'", tMisMonitorDustattribute.SAMPLE_DATE.ToString())); } //烟气动压 if (!String.IsNullOrEmpty(tMisMonitorDustattribute.SMOKE_MOVE_PRESSURE.ToString().Trim())) { strWhereStatement.Append(string.Format(" AND SMOKE_MOVE_PRESSURE = '{0}'", tMisMonitorDustattribute.SMOKE_MOVE_PRESSURE.ToString())); } //烟气静压 if (!String.IsNullOrEmpty(tMisMonitorDustattribute.SMOKE_STATIC_PRESSURE.ToString().Trim())) { strWhereStatement.Append(string.Format(" AND SMOKE_STATIC_PRESSURE = '{0}'", tMisMonitorDustattribute.SMOKE_STATIC_PRESSURE.ToString())); } //烟气全压 if (!String.IsNullOrEmpty(tMisMonitorDustattribute.SMOKE_ALL_PRESSURE.ToString().Trim())) { strWhereStatement.Append(string.Format(" AND SMOKE_ALL_PRESSURE = '{0}'", tMisMonitorDustattribute.SMOKE_ALL_PRESSURE.ToString())); } //烟气计压 if (!String.IsNullOrEmpty(tMisMonitorDustattribute.SMOKE_K_PRESSURE.ToString().Trim())) { strWhereStatement.Append(string.Format(" AND SMOKE_K_PRESSURE = '{0}'", tMisMonitorDustattribute.SMOKE_K_PRESSURE.ToString())); } //烟气温度 if (!String.IsNullOrEmpty(tMisMonitorDustattribute.SMOKE_TEMPERATURE.ToString().Trim())) { strWhereStatement.Append(string.Format(" AND SMOKE_TEMPERATURE = '{0}'", tMisMonitorDustattribute.SMOKE_TEMPERATURE.ToString())); } //烟气含氧量 if (!String.IsNullOrEmpty(tMisMonitorDustattribute.SMOKE_OXYGEN.ToString().Trim())) { strWhereStatement.Append(string.Format(" AND SMOKE_OXYGEN = '{0}'", tMisMonitorDustattribute.SMOKE_OXYGEN.ToString())); } //烟气流速 if (!String.IsNullOrEmpty(tMisMonitorDustattribute.SMOKE_SPEED.ToString().Trim())) { strWhereStatement.Append(string.Format(" AND SMOKE_SPEED = '{0}'", tMisMonitorDustattribute.SMOKE_SPEED.ToString())); } //标态流量 if (!String.IsNullOrEmpty(tMisMonitorDustattribute.NM_SPEED.ToString().Trim())) { strWhereStatement.Append(string.Format(" AND NM_SPEED = '{0}'", tMisMonitorDustattribute.NM_SPEED.ToString())); } //标况体积 if (!String.IsNullOrEmpty(tMisMonitorDustattribute.L_STAND.ToString().Trim())) { strWhereStatement.Append(string.Format(" AND L_STAND = '{0}'", tMisMonitorDustattribute.L_STAND.ToString())); } //滤筒初重 if (!String.IsNullOrEmpty(tMisMonitorDustattribute.FITER_BEGIN_WEIGHT.ToString().Trim())) { strWhereStatement.Append(string.Format(" AND FITER_BEGIN_WEIGHT = '{0}'", tMisMonitorDustattribute.FITER_BEGIN_WEIGHT.ToString())); } //滤筒终重 if (!String.IsNullOrEmpty(tMisMonitorDustattribute.FITER_AFTER_WEIGHT.ToString().Trim())) { strWhereStatement.Append(string.Format(" AND FITER_AFTER_WEIGHT = '{0}'", tMisMonitorDustattribute.FITER_AFTER_WEIGHT.ToString())); } //样品重量 if (!String.IsNullOrEmpty(tMisMonitorDustattribute.SAMPLE_WEIGHT.ToString().Trim())) { strWhereStatement.Append(string.Format(" AND SAMPLE_WEIGHT = '{0}'", tMisMonitorDustattribute.SAMPLE_WEIGHT.ToString())); } //烟尘浓度 if (!String.IsNullOrEmpty(tMisMonitorDustattribute.SMOKE_POTENCY.ToString().Trim())) { strWhereStatement.Append(string.Format(" AND SMOKE_POTENCY = '{0}'", tMisMonitorDustattribute.SMOKE_POTENCY.ToString())); } //烟尘折算浓度 if (!String.IsNullOrEmpty(tMisMonitorDustattribute.SMOKE_POTENCY2.ToString().Trim())) { strWhereStatement.Append(string.Format(" AND SMOKE_POTENCY2 = '{0}'", tMisMonitorDustattribute.SMOKE_POTENCY2.ToString())); } //烟尘排放量 if (!String.IsNullOrEmpty(tMisMonitorDustattribute.SMOKE_DISCHARGE.ToString().Trim())) { strWhereStatement.Append(string.Format(" AND SMOKE_DISCHARGE = '{0}'", tMisMonitorDustattribute.SMOKE_DISCHARGE.ToString())); } // if (!String.IsNullOrEmpty(tMisMonitorDustattribute.REMARK1.ToString().Trim())) { strWhereStatement.Append(string.Format(" AND REMARK1 = '{0}'", tMisMonitorDustattribute.REMARK1.ToString())); } // if (!String.IsNullOrEmpty(tMisMonitorDustattribute.REMARK2.ToString().Trim())) { strWhereStatement.Append(string.Format(" AND REMARK2 = '{0}'", tMisMonitorDustattribute.REMARK2.ToString())); } // if (!String.IsNullOrEmpty(tMisMonitorDustattribute.REMARK3.ToString().Trim())) { strWhereStatement.Append(string.Format(" AND REMARK3 = '{0}'", tMisMonitorDustattribute.REMARK3.ToString())); } } return(strWhereStatement.ToString()); }
/// <summary> /// 对象删除 /// </summary> /// <param name="Id">ID</param> /// <returns>是否成功</returns> public bool Delete(TMisMonitorDustattributeVo tMisMonitorDustattribute) { return(access.Delete(tMisMonitorDustattribute)); }
/// <summary> /// 获取监测项目信息 /// </summary> /// <returns></returns> private string getFourGridInfo(string strThreeGridId) { string strSortname = Request.Params["sortname"]; string strSortorder = Request.Params["sortorder"]; //当前页面 int intPageIndex = Convert.ToInt32(Request.Params["page"]); //每页记录数 int intPageSize = Convert.ToInt32(Request.Params["pagesize"]); DataTable dt = new TMisMonitorResultLogic().getItemInfoInAlloction_QHD(strThreeGridId, "'01','00'", "0", "", "", intPageIndex, intPageSize); //退回意见 for (int i = 0; i < dt.Rows.Count; i++) { TMisMonitorResultVo objResutlVo = new TMisMonitorResultLogic().Details(dt.Rows[i]["ID"].ToString()); TMisMonitorSampleInfoVo objSampleInfoVo = new TMisMonitorSampleInfoLogic().Details(objResutlVo.SAMPLE_ID); TMisMonitorSubtaskVo objSubtaskVo = new TMisMonitorSubtaskLogic().Details(objSampleInfoVo.SUBTASK_ID); TMisReturnInfoVo objReturnInfoVo = new TMisReturnInfoVo(); objReturnInfoVo.TASK_ID = objSubtaskVo.TASK_ID; objReturnInfoVo.SUBTASK_ID = objSubtaskVo.ID; objReturnInfoVo.RESULT_ID = dt.Rows[i]["ID"].ToString(); objReturnInfoVo.CURRENT_STATUS = SerialType.Monitor_007; objReturnInfoVo.BACKTO_STATUS = SerialType.Monitor_006; objReturnInfoVo = new TMisReturnInfoLogic().Details(objReturnInfoVo); dt.Rows[i]["REMARK_1"] = objReturnInfoVo.SUGGESTION; //获取原始记录表的采样编号 DataTable dtInfo = new DataTable(); DataRow[] drInfo = dtInfo.Select("1=2"); string strFiter_Code = ""; TMisMonitorDustinforVo objDustinforVo = new TMisMonitorDustinforVo(); objDustinforVo.SUBTASK_ID = dt.Rows[i]["ID"].ToString(); objDustinforVo = new TMisMonitorDustinforLogic().Details(objDustinforVo); if (objDustinforVo.ID.Length > 0) { TMisMonitorDustattributeVo objDustattributeVo = new TMisMonitorDustattributeVo(); objDustattributeVo.BASEINFOR_ID = objDustinforVo.ID; dtInfo = new TMisMonitorDustattributeLogic().SelectByTable(objDustattributeVo); if (dtInfo.Rows.Count > 0) { drInfo = dtInfo.Select("FITER_CODE<>'平均'"); } else { TMisMonitorDustattributeSo2ornoxVo objDustattributeSo2ornoxVo = new TMisMonitorDustattributeSo2ornoxVo(); objDustattributeSo2ornoxVo.BASEINFOR_ID = objDustinforVo.ID; dtInfo = new TMisMonitorDustattributeSo2ornoxLogic().SelectByTable(objDustattributeSo2ornoxVo); if (dtInfo.Rows.Count > 0) { drInfo = dtInfo.Select("FITER_CODE<>'平均'"); } else { TMisMonitorDustattributePmVo DustattributePmVo = new TMisMonitorDustattributePmVo(); DustattributePmVo.BASEINFOR_ID = objDustinforVo.ID; dtInfo = new TMisMonitorDustattributePmLogic().SelectByTable(DustattributePmVo); if (dtInfo.Rows.Count > 0) { drInfo = dtInfo.Select("FITER_CODE<>'平均'"); } } } for (int j = 0; j < drInfo.Length; j++) { strFiter_Code += drInfo[j]["FITER_CODE"].ToString() + ","; } dt.Rows[i]["REMARK_2"] = strFiter_Code.TrimEnd(','); } } int intTotalCount = new TMisMonitorResultLogic().getItemInfoCountInAlloction_QHD(strThreeGridId, "'01','00'", "0", "", ""); string strJson = CreateToJson(dt, intTotalCount); return(strJson); }
/// <summary> /// 根据对象特征获取单一对象 /// </summary> /// <param name="tMisMonitorDustattribute">对象</param> /// <returns></returns> public TMisMonitorDustattributeVo SelectByObject(TMisMonitorDustattributeVo tMisMonitorDustattribute) { return(access.SelectByObject(tMisMonitorDustattribute)); }