//获取点位信息 private string getPointList() { string strSortname = Request.Params["sortname"]; string strSortorder = Request.Params["sortorder"]; //当前页面 int intPageIndex = Convert.ToInt32(Request.Params["page"]); //每页记录数 int intPageSize = Convert.ToInt32(Request.Params["pagesize"]); if (strSortname == null || strSortname.Length < 0) { strSortname = TMisMonitorTaskPointVo.NUM_FIELD; } string strSubtaskID = this.SUBTASK_ID.Value; if (strSubtaskID.Length == 0) { return(""); } TMisMonitorSampleInfoVo objSampleInfo = new TMisMonitorSampleInfoVo(); objSampleInfo.SUBTASK_ID = strSubtaskID; //objSampleInfo.QC_TYPE = "0"; objSampleInfo.SORT_FIELD = "ISNULL(SAMPLE_COUNT,'9999'),POINT_ID,ID"; objSampleInfo.NOSAMPLE = "0"; DataTable dtSample = new DataTable(); DataTable dt = new TMisMonitorSampleInfoLogic().SelectByTableForPoint(objSampleInfo, intPageIndex, intPageSize); dtSample = dt.Clone(); for (int i = 0; i < dt.Rows.Count; i++) { dtSample.ImportRow(dt.Rows[i]); //objSampleInfo.QC_TYPE = ""; //objSampleInfo.QC_SOURCE_ID = dt.Rows[i]["ID"].ToString(); //objSampleInfo.SORT_FIELD = "QC_TYPE"; //objSampleInfo.NOSAMPLE = "0"; //DataTable dtQcSample = new TMisMonitorSampleInfoLogic().SelectByTableForPoint(objSampleInfo, 0, 0); //for (int j = 0; j < dtQcSample.Rows.Count; j++) //{ // DataRow dr = dt.NewRow(); // dr = dtQcSample.Rows[j]; // dtSample.ImportRow(dr); //} } int intTotalCount = dtSample.Rows.Count; string strJson = CreateToJson(dtSample, intTotalCount); return(strJson); }
/// <summary> /// 获取监测点位信息 /// </summary> /// <returns></returns> private string getThreeGridInfo(string strTwoGridId) { string strSortname = Request.Params["sortname"]; string strSortorder = Request.Params["sortorder"]; //当前页面 int intPageIndex = Convert.ToInt32(Request.Params["page"]); //每页记录数 int intPageSize = Convert.ToInt32(Request.Params["pagesize"]); TMisMonitorSampleInfoVo objSampleInfo = new TMisMonitorSampleInfoVo(); objSampleInfo.SUBTASK_ID = strTwoGridId; objSampleInfo.QC_TYPE = "0"; objSampleInfo.SORT_FIELD = "POINT_ID"; DataTable dtSample = new DataTable(); DataTable dt = new TMisMonitorSampleInfoLogic().SelectByTableForPoint(objSampleInfo, intPageIndex, intPageSize); dtSample = dt.Clone(); for (int i = 0; i < dt.Rows.Count; i++) { dtSample.ImportRow(dt.Rows[i]); objSampleInfo.QC_TYPE = ""; objSampleInfo.QC_SOURCE_ID = dt.Rows[i]["ID"].ToString(); objSampleInfo.SORT_FIELD = "QC_TYPE"; DataTable dtQcSample = new TMisMonitorSampleInfoLogic().SelectByTableForPoint(objSampleInfo, 0, 0); for (int j = 0; j < dtQcSample.Rows.Count; j++) { DataRow dr = dt.NewRow(); dr = dtQcSample.Rows[j]; dtSample.ImportRow(dr); } } objSampleInfo.QC_TYPE = "11"; objSampleInfo.QC_SOURCE_ID = ""; dt = new TMisMonitorSampleInfoLogic().SelectByTableForPoint(objSampleInfo, 0, 0); for (int i = 0; i < dt.Rows.Count; i++) { dtSample.ImportRow(dt.Rows[i]); } int intTotalCount = dtSample.Rows.Count; string strJson = CreateToJson(dtSample, intTotalCount); return(strJson); }
/// <summary> /// 样品编号设置 /// </summary> /// <returns></returns> protected void SetSampleCode() { TMisMonitorSampleInfoVo objSample = new TMisMonitorSampleInfoVo(); objSample.SUBTASK_ID = this.SUBTASK_ID.Value; objSample.QC_TYPE = "0"; objSample.SORT_FIELD = "POINT_ID"; DataTable dtSample = new DataTable(); DataTable dt = new TMisMonitorSampleInfoLogic().SelectByTableForPoint(objSample, 0, 0); dtSample = dt.Clone(); for (int i = 0; i < dt.Rows.Count; i++) { dtSample.ImportRow(dt.Rows[i]); objSample.QC_TYPE = ""; objSample.QC_SOURCE_ID = dt.Rows[i]["ID"].ToString(); objSample.SORT_FIELD = "QC_TYPE"; DataTable dtQcSample = new TMisMonitorSampleInfoLogic().SelectByTableForPoint(objSample, 0, 0); for (int j = 0; j < dtQcSample.Rows.Count; j++) { DataRow dr = dt.NewRow(); dr = dtQcSample.Rows[j]; dtSample.ImportRow(dr); } } for (int j = 0; j < dtSample.Rows.Count; j++) { if (dtSample.Rows[j]["SAMPLE_CODE"].ToString().Length > 0) { continue; } string[] strSampleCode = new string[2] { "S" + DateTime.Now.Year + DateTime.Now.Month, i3.View.PageBase.GetSerialNumber("monitor_samplecode") }; objSample = new TMisMonitorSampleInfoVo(); objSample.ID = dtSample.Rows[j]["ID"].ToString(); objSample.SAMPLE_CODE = i3.View.PageBase.CreateSerialNumber(strSampleCode); new TMisMonitorSampleInfoLogic().Edit(objSample); } }
//获取点位信息 private string getPointList() { string strSortname = Request.Params["sortname"]; string strSortorder = Request.Params["sortorder"]; //当前页面 int intPageIndex = Convert.ToInt32(Request.Params["page"]); //每页记录数 int intPageSize = Convert.ToInt32(Request.Params["pagesize"]); if (strSortname == null || strSortname.Length < 0) { strSortname = TMisMonitorTaskPointVo.NUM_FIELD; } string strSubtaskID = this.SUBTASK_ID.Value; if (strSubtaskID.Length == 0) { return(""); } TMisMonitorSampleInfoVo objSampleInfo = new TMisMonitorSampleInfoVo(); objSampleInfo.SUBTASK_ID = strSubtaskID; objSampleInfo.QC_TYPE = "0"; objSampleInfo.SORT_FIELD = "POINT_ID"; DataTable dtSample = new DataTable(); DataTable dt = new TMisMonitorSampleInfoLogic().SelectByTableForPoint(objSampleInfo, intPageIndex, intPageSize); int intTotalCount = new TMisMonitorSampleInfoLogic().SelectByTableForPointCount(objSampleInfo); dtSample = dt.Clone(); TMisMonitorSubtaskVo objSubtaskVo = new TMisMonitorSubtaskLogic().Details(strSubtaskID); TMisMonitorTaskVo objTaskVo = new TMisMonitorTaskLogic().Details(objSubtaskVo.TASK_ID); //定义样品计数器 int c = 0; for (int i = 0; i < dt.Rows.Count; i++) { dtSample.ImportRow(dt.Rows[i]); //清远 采样时自动生成样品编号(原始样) TMisMonitorSampleInfoVo objSample = new TMisMonitorSampleInfoLogic().Details(dt.Rows[i]["ID"].ToString()); if (objSample.SAMPLE_CODE.Length == 0) { if (objTaskVo.TASK_TYPE == "1") { objSample.SAMPLE_CODE = objSample.SAMPLE_NAME; } else { objSample.SAMPLE_CODE = GetSampleCode(dt.Rows[i]["ID"].ToString()); } objSample.SAMPLECODE_CREATEDATE = DateTime.Now.ToString("yyyy-MM-dd"); new TMisMonitorSampleInfoLogic().Edit(objSample); dtSample.Rows[i + c]["SAMPLE_CODE"] = objSample.SAMPLE_CODE; } objSampleInfo.QC_TYPE = ""; objSampleInfo.QC_SOURCE_ID = dt.Rows[i]["ID"].ToString(); objSampleInfo.SORT_FIELD = "QC_TYPE"; DataTable dtQcSample = new TMisMonitorSampleInfoLogic().SelectByTableForPoint(objSampleInfo, 0, 0); for (int j = 0; j < dtQcSample.Rows.Count; j++) { c++;//质控样+1 DataRow dr = dt.NewRow(); dr = dtQcSample.Rows[j]; //清远 生成样品编号(质控) TMisMonitorSampleInfoVo objSampleQc = new TMisMonitorSampleInfoLogic().Details(dr["ID"].ToString()); if (objSampleQc.SAMPLE_CODE.Length == 0) { if (objTaskVo.TASK_TYPE == "1") { objSample.SAMPLE_CODE = objSample.SAMPLE_NAME; } else { objSampleQc.SAMPLE_CODE = GetSampleCode(dr["ID"].ToString()); } objSampleQc.SAMPLECODE_CREATEDATE = DateTime.Now.ToString("yyyy-MM-dd"); new TMisMonitorSampleInfoLogic().Edit(objSampleQc); dr["SAMPLE_CODE"] = objSampleQc.SAMPLE_CODE; } dtSample.ImportRow(dr); } } objSampleInfo.QC_TYPE = "11"; objSampleInfo.QC_SOURCE_ID = ""; dt = new TMisMonitorSampleInfoLogic().SelectByTableForPoint(objSampleInfo, 0, 0); for (int i = 0; i < dt.Rows.Count; i++) { dtSample.ImportRow(dt.Rows[i]); } if (objSubtaskVo.MONITOR_ID == "000000001") { //流量测定情况属性 感官描述属性 dt = new TBaseAttributeInfoLogic().GetAttDate("'000000017','000000210'"); for (int i = 0; i < dt.Rows.Count; i++) { dtSample.Columns.Add(dt.Rows[i]["ID"].ToString() + "@" + dt.Rows[i]["CONTROL_ID"].ToString() + "@" + dt.Rows[i]["ATTRIBUTE_NAME"].ToString() + "@" + dt.Rows[i]["CONTROL_NAME"].ToString() + "@" + dt.Rows[i]["DICTIONARY"].ToString(), typeof(string)); } for (int i = 0; i < dtSample.Rows.Count; i++) { dt = new TBaseAttributeInfoLogic().GetAttValue("'000000017','000000210'", dtSample.Rows[i]["POINT_ID"].ToString()); for (int j = 0; j < dt.Rows.Count; j++) { dtSample.Rows[i][dt.Rows[j]["ID"].ToString() + "@" + dt.Rows[j]["CONTROL_ID"].ToString() + "@" + dt.Rows[j]["ATTRIBUTE_NAME"].ToString() + "@" + dt.Rows[j]["CONTROL_NAME"].ToString() + "@" + dt.Rows[j]["DICTIONARY"].ToString()] = dt.Rows[j]["ATTRBUTE_VALUE"].ToString(); } } } if (objSubtaskVo.MONITOR_ID == "EnvRiver") { //流量测定情况属性 感官描述属性 dt = new TBaseAttributeInfoLogic().GetAttDate("'000000211'"); for (int i = 0; i < dt.Rows.Count; i++) { dtSample.Columns.Add(dt.Rows[i]["ID"].ToString() + "@" + dt.Rows[i]["CONTROL_ID"].ToString() + "@" + dt.Rows[i]["ATTRIBUTE_NAME"].ToString() + "@" + dt.Rows[i]["CONTROL_NAME"].ToString() + "@" + dt.Rows[i]["DICTIONARY"].ToString(), typeof(string)); } for (int i = 0; i < dtSample.Rows.Count; i++) { dt = new TBaseAttributeInfoLogic().GetAttValue("'000000211'", dtSample.Rows[i]["POINT_ID"].ToString()); for (int j = 0; j < dt.Rows.Count; j++) { dtSample.Rows[i][dt.Rows[j]["ID"].ToString() + "@" + dt.Rows[j]["CONTROL_ID"].ToString() + "@" + dt.Rows[j]["ATTRIBUTE_NAME"].ToString() + "@" + dt.Rows[j]["CONTROL_NAME"].ToString() + "@" + dt.Rows[j]["DICTIONARY"].ToString()] = dt.Rows[j]["ATTRBUTE_VALUE"].ToString(); } } } string strJson = CreateToJson(dtSample, intTotalCount); return(strJson); }
//获取点位信息 private string getPointList() { string strSortname = Request.Params["sortname"]; string strSortorder = Request.Params["sortorder"]; //当前页面 int intPageIndex = Convert.ToInt32(Request.Params["page"]); //每页记录数 int intPageSize = Convert.ToInt32(Request.Params["pagesize"]); if (strSortname == null || strSortname.Length < 0) { strSortname = TMisMonitorTaskPointVo.NUM_FIELD; } string strSubtaskID = this.SUBTASK_ID.Value; if (strSubtaskID.Length == 0) { return(""); } TMisMonitorSampleInfoVo objSampleInfo = new TMisMonitorSampleInfoVo(); objSampleInfo.SUBTASK_ID = strSubtaskID; objSampleInfo.QC_TYPE = "0"; objSampleInfo.SORT_FIELD = "POINT_ID"; DataTable dtSample = new DataTable(); DataTable dt = new TMisMonitorSampleInfoLogic().SelectByTableForPoint(objSampleInfo, intPageIndex, intPageSize); dtSample = dt.Clone(); for (int i = 0; i < dt.Rows.Count; i++) { dtSample.ImportRow(dt.Rows[i]); objSampleInfo.QC_TYPE = ""; objSampleInfo.QC_SOURCE_ID = dt.Rows[i]["ID"].ToString(); objSampleInfo.SORT_FIELD = "QC_TYPE"; DataTable dtQcSample = new TMisMonitorSampleInfoLogic().SelectByTableForPoint(objSampleInfo, 0, 0); for (int j = 0; j < dtQcSample.Rows.Count; j++) { DataRow dr = dt.NewRow(); dr = dtQcSample.Rows[j]; //清远 生成样品编号(质控) TMisMonitorSampleInfoVo objSampleQc = new TMisMonitorSampleInfoLogic().Details(dr["ID"].ToString()); if (objSampleQc.SAMPLE_CODE.Length == 0) { objSampleQc.SAMPLE_CODE = GetSampleCode(dr["ID"].ToString()); objSampleQc.SAMPLECODE_CREATEDATE = DateTime.Now.ToString("yyyy-MM-dd"); new TMisMonitorSampleInfoLogic().Edit(objSampleQc); dr["SAMPLE_CODE"] = objSampleQc.SAMPLE_CODE; } dtSample.ImportRow(dr); } //清远 采样时自动生成样品编号(原始样) TMisMonitorSampleInfoVo objSample = new TMisMonitorSampleInfoLogic().Details(dt.Rows[i]["ID"].ToString()); if (objSample.SAMPLE_CODE.Length == 0) { objSample.SAMPLE_CODE = GetSampleCode(dt.Rows[i]["ID"].ToString()); objSample.SAMPLECODE_CREATEDATE = DateTime.Now.ToString("yyyy-MM-dd"); new TMisMonitorSampleInfoLogic().Edit(objSample); dtSample.Rows[i]["SAMPLE_CODE"] = objSample.SAMPLE_CODE; } } int intTotalCount = dtSample.Rows.Count; string strJson = CreateToJson(dtSample, intTotalCount); return(strJson); }