Exemple #1
0
        public static string getDataList(string conditions, int rows, int page, string sort, string sortOrder)
        {
            if (rows == 0)
            {
                return("{\"total\":0,\"rows\":[]}");
            }

            StatisticsBLL bll = new StatisticsBLL();

            PagerInfo pagerInfo = new PagerInfo();

            pagerInfo.CurrenetPageIndex = page;
            pagerInfo.PageSize          = rows;

            SortInfo            sortInfo       = new SortInfo(sort, sortOrder);
            QueryConditionModel conditionModel = JsonConvert.DeserializeObject <QueryConditionModel>(conditions.Replace("\"0\"", "\"\""));

            //List<QueryList> list = new List<QueryList>();
            DataTable dt = bll.StatisticsByAreaBLL(conditionModel, pagerInfo, sortInfo);

            pagerInfo.RecordCount = bll.getAreaDeviceCount(conditionModel);

            //Json格式的要求{total:22,rows:{}}
            //构造成Json的格式传递
            var result = new { total = pagerInfo.RecordCount, rows = dt };

            return(JsonConvert.SerializeObject(result).Replace("null", "0"));
        }
        public static string getDataList(string conditions, int rows)
        {
            if (rows == 0)
            {
                return("[]");
            }

            StatisticsBLL       bll            = new StatisticsBLL();
            QueryConditionModel conditionModel = JsonConvert.DeserializeObject <QueryConditionModel>(conditions.Replace("\"0\"", "\"\""));

            DataTable            dt   = bll.StatisticsByModelBLL(conditionModel);
            List <KeyValueModel> list = new List <KeyValueModel>();

            if (dt.Rows.Count > 0)
            {
                list.Add(new KeyValueModel("全血-CBC", string.IsNullOrEmpty(dt.Rows[0]["count_times_wb_cbc"].ToString()) ? "0" : dt.Rows[0]["count_times_wb_cbc"].ToString()));
                list.Add(new KeyValueModel("全血-CBC+CRP", string.IsNullOrEmpty(dt.Rows[0]["count_times_wb_cbc_crp"].ToString()) ? "0" : dt.Rows[0]["count_times_wb_cbc_crp"].ToString()));
                list.Add(new KeyValueModel("全血-CRP", string.IsNullOrEmpty(dt.Rows[0]["count_times_wb_crp"].ToString()) ? "0" : dt.Rows[0]["count_times_wb_crp"].ToString()));
                list.Add(new KeyValueModel("预稀释-CBC", string.IsNullOrEmpty(dt.Rows[0]["count_times_pd_cbc"].ToString()) ? "0" : dt.Rows[0]["count_times_pd_cbc"].ToString()));
                list.Add(new KeyValueModel("预稀释-CBC+CRP", string.IsNullOrEmpty(dt.Rows[0]["count_times_pd_cbc_crp"].ToString()) ? "0" : dt.Rows[0]["count_times_pd_cbc_crp"].ToString()));
                list.Add(new KeyValueModel("预稀释-CRP", string.IsNullOrEmpty(dt.Rows[0]["count_times_pd_crp"].ToString()) ? "0" : dt.Rows[0]["count_times_pd_crp"].ToString()));
            }
            else
            {
                list.Add(new KeyValueModel("全血-CBC", "0"));
                list.Add(new KeyValueModel("全血-CBC+CRP", "0"));
                list.Add(new KeyValueModel("全血-CRP", "0"));
                list.Add(new KeyValueModel("预稀释-CBC", "0"));
                list.Add(new KeyValueModel("预稀释-CBC+CRP", "0"));
                list.Add(new KeyValueModel("预稀释-CRP", "0"));
            }

            //构造成Json的格式传递
            return(JsonConvert.SerializeObject(list).Replace("null", "0"));
        }
Exemple #3
0
        /// <summary>
        /// 报表绑定数据集
        /// </summary>
        /// <param name="accCode"></param>
        protected void BindReportDataSource()
        {
            //int WorkerId = int.Parse(User.Identity.Name.Split('|')[0]);

            this.MyReportViewer.LocalReport.DataSources.Clear();
            this.MyReportViewer.LocalReport.ReportPath = @"Report\RDLC\" + ReportName;
            switch (ReportName)
            {
            case "PrintAttemper.rdlc":    //
                string AlarmCode = Request.QueryString["AlarmCode"];
                string name0     = Request.QueryString["name0"];
                string name1     = Request.QueryString["name1"];
                string name2     = Request.QueryString["name2"];
                string name3     = Request.QueryString["name3"];
                string name4     = Request.QueryString["name4"];
                string name5     = Request.QueryString["name5"];
                string name6     = Request.QueryString["name6"];
                string name7     = Request.QueryString["name7"];
                Microsoft.Reporting.WebForms.ReportParameter Name0  = new Microsoft.Reporting.WebForms.ReportParameter("name0", name0);
                Microsoft.Reporting.WebForms.ReportParameter Name1  = new Microsoft.Reporting.WebForms.ReportParameter("name1", name1);
                Microsoft.Reporting.WebForms.ReportParameter Name2  = new Microsoft.Reporting.WebForms.ReportParameter("name2", name2);
                Microsoft.Reporting.WebForms.ReportParameter Name3  = new Microsoft.Reporting.WebForms.ReportParameter("name3", name3);
                Microsoft.Reporting.WebForms.ReportParameter Name4  = new Microsoft.Reporting.WebForms.ReportParameter("name4", name4);
                Microsoft.Reporting.WebForms.ReportParameter Name5  = new Microsoft.Reporting.WebForms.ReportParameter("name5", name5);
                Microsoft.Reporting.WebForms.ReportParameter Name6  = new Microsoft.Reporting.WebForms.ReportParameter("name6", name6);
                Microsoft.Reporting.WebForms.ReportParameter Name7  = new Microsoft.Reporting.WebForms.ReportParameter("name7", name7);
                Microsoft.Reporting.WebForms.ReportParameter Header = new Microsoft.Reporting.WebForms.ReportParameter("Header", AppConfig.GetStringConfigValue("PrtAttHeaderName"));
                Microsoft.Reporting.WebForms.ReportParameter Unit   = new Microsoft.Reporting.WebForms.ReportParameter("Unit", AppConfig.GetStringConfigValue("PrtAttUnitName"));
                Microsoft.Reporting.WebForms.ReportParameter Footer = new Microsoft.Reporting.WebForms.ReportParameter("Footer", AppConfig.GetStringConfigValue("PrtAttFooterName"));
                this.MyReportViewer.LocalReport.SetParameters(new Microsoft.Reporting.WebForms.ReportParameter[] { Name0, Name1, Name2, Name3, Name4, Name5, Name6, Name7, Header, Unit, Footer });
                List <AttemperAlarmInfo> list1 = Anchor.FA.BLL.BasicInfo.StatisticsBLL.GetAlarmInfo(AlarmCode);
                this.MyReportViewer.LocalReport.DataSources.Add(new ReportDataSource("AnchorV7_FirstAidManager_SE_StatisticsInfo_AttemperAlarmInfo", list1));
                List <AttemperAcceptInfo> list2 = StatisticsBLL.GetAcceptInfo(AlarmCode);
                this.MyReportViewer.LocalReport.DataSources.Add(new ReportDataSource("AnchorV7_FirstAidManager_SE_StatisticsInfo_AttemperAcceptInfo", list2));
                List <AttemperTaskInfo> list3 = StatisticsBLL.GetTaskInfo(AlarmCode);
                this.MyReportViewer.LocalReport.DataSources.Add(new ReportDataSource("AnchorV7_FirstAidManager_SE_StatisticsInfo_AttemperTaskInfo", list3));
                List <AttemperTelInfo> list4 = StatisticsBLL.GetTelInfo(AlarmCode);
                this.MyReportViewer.LocalReport.DataSources.Add(new ReportDataSource("AnchorV7_FirstAidManager_SE_StatisticsInfo_AttemperTelInfo", list4));
                break;

            case "PrintCommand.rdlc":    //
                string TaskCode = Request.QueryString["TaskCode"];
                List <StationCommandInfo> list = new List <StationCommandInfo>();
                StationCommandInfo        info = StatisticsBLL.PrintCommand(TaskCode);
                list.Add(info);
                this.MyReportViewer.LocalReport.DataSources.Add(new ReportDataSource("AnchorV7_FirstAidManager_SE_StatisticsInfo_StationCommandInfo", list));
                break;

            default:
                break;
            }
            this.MyReportViewer.LocalReport.Refresh();
        }
Exemple #4
0
        public static string getDataList(string conditions, int rows)
        {
            if (rows == 0)
            {
                return("{\"total\":0,\"rows\":[]}");
            }

            StatisticsBLL       bll            = new StatisticsBLL();
            QueryConditionModel conditionModel = JsonConvert.DeserializeObject <QueryConditionModel>(conditions.Replace("\"0\"", "\"\""));

            DataTable dt = bll.StatisticsByReagentTypeBLL(conditionModel);

            if (dt.Rows.Count < 2)
            {
                DataRow dr;
                if (dt.Rows.Count == 0)
                {
                    dr    = dt.NewRow();
                    dr[0] = "open";
                    dr[1] = dr[2] = dr[3] = dr[4] = dr[5] = 0;
                    dt.Rows.Add(dr);
                    dr    = dt.NewRow();
                    dr[0] = "close";
                    dr[1] = dr[2] = dr[3] = dr[4] = dr[5] = 0;
                    dt.Rows.Add(dr);
                }
                else
                {
                    if (dt.Rows[0][0].ToString().ToLower() == "close")
                    {
                        dr    = dt.NewRow();
                        dr[0] = "open";
                        dr[1] = dr[2] = dr[3] = dr[4] = dr[5] = 0;
                        dt.Rows.InsertAt(dr, 0);
                    }
                    else if (dt.Rows[0][0].ToString().ToLower() == "open")
                    {
                        dr    = dt.NewRow();
                        dr[0] = "close";
                        dr[1] = dr[2] = dr[3] = dr[4] = dr[5] = 0;
                        dt.Rows.Add(dr);
                    }
                }
            }

            //构造成Json的格式传递
            return(JsonConvert.SerializeObject(dt).Replace("null", "0"));
        }
Exemple #5
0
        public static string getDeviceList(string conditions)
        {
            StatisticsBLL       bll            = new StatisticsBLL();
            QueryConditionModel conditionModel = JsonConvert.DeserializeObject <QueryConditionModel>(conditions.Replace("\"0\"", "\"\""));
            var dt              = bll.StatisticsByReagentTypeBLL(conditionModel);
            var deivceTotal     = Convert.ToInt32(dt.Compute("sum(机器数)", "true"));
            var countTimesTotal = Convert.ToInt32(dt.Compute("sum(样本数)", "true"));

            for (int i = 0; i < dt.Rows.Count; i++)
            {
                if (deivceTotal > 0)
                {
                    dt.Rows[i]["机器数比例"] = Math.Round((double)(Convert.ToInt32(dt.Rows[i]["机器数"]) / deivceTotal * 100), 2) + "%";
                }

                if (countTimesTotal > 0)
                {
                    dt.Rows[i]["样本数比例"] = Math.Round((double)(Convert.ToInt32(dt.Rows[i]["样本数"]) / deivceTotal * 100), 2) + "%";
                }
            }

            return(JsonConvert.SerializeObject(dt).Replace("null", "\"\""));
        }
        public void ProcessRequest(HttpContext context)
        {
            //context.Response.ContentType = "text/plain";
            //context.Response.Write("Hello World");

            string message = "";
            string Action  = context.Request["Action"];
            //params
            string sn    = context.Request["sn"] ?? "";
            string model = context.Request["model"] ?? "";

            if (model.Trim() == "0")
            {
                model = "";
            }

            string conditions = context.Request["conditions"] ?? "";

            DeviceQueryBLL      bll           = new DeviceQueryBLL();
            StatisticsBLL       staticBll     = new StatisticsBLL();
            PoctStatisticsBLL   poctStaticBll = new PoctStatisticsBLL();
            QueryConditionModel condition;
            DataTable           dt = new DataTable();
            string fileName        = "";

            string[] headers = new string[] { };
            switch (Action)
            {
            case "fault":
                dt       = bll.GetDeviceFaultForExportBLL(sn);//获取导出数据源
                fileName = "错误信息";
                headers  = new string[] { "错误码", "时间" };
                break;

            case "yangben":
                dt       = bll.GetDeviceSampleForExportBLL();//获取导出数据源
                fileName = "样本信息";
                headers  = new string[] { "system_seq", "仪器序列号", "计数值", "计数类型", "时间" };
                break;

            case "cuowu":
                dt       = bll.GetDeviceFaultForExportBLL();//获取导出数据源
                fileName = "错误信息";
                headers  = new string[] { "id", "仪器序列号", "错误码", "时间" };
                break;

            case "bio_fault":
                condition = JsonConvert.DeserializeObject <QueryConditionModel>(conditions.Replace("\"0\"", "\"\""));
                dt        = bll.GetBioDeviceFaultBLL(condition.SN, condition.dtStart, condition.dtEnd);
                fileName  = "生化仪统计_故障信息";
                headers   = new string[] { "错误码", "时间" };
                break;

            case "bio_all":
                condition = JsonConvert.DeserializeObject <QueryConditionModel>(conditions.Replace("\"0\"", "\"\""));
                dt        = staticBll.StatisticsAllBioDevicesForExportBLL(condition);
                fileName  = "生化仪统计_所有机器";
                headers   = new string[] { "仪器名称", "上报时间", "SIM卡号", "仪器序列号", "样本数", "R1试剂使用量(mL)", "R2试剂使用量(mL)" };
                break;

            case "bio_area":
                condition = JsonConvert.DeserializeObject <QueryConditionModel>(conditions.Replace("\"0\"", "\"\""));
                dt        = staticBll.BioStatisticsByAreaForExportBLL(condition);
                fileName  = "生化仪统计_按区域";
                headers   = new string[] { "装机区域", "仪器总数", "样本数", "R1试剂使用量(mL)", "R2试剂使用量(mL)" };
                break;

            case "bio_type":
                condition = JsonConvert.DeserializeObject <QueryConditionModel>(conditions.Replace("\"0\"", "\"\""));
                dt        = staticBll.BioStatisticsByTypeForExportBLL(condition);
                fileName  = "生化仪统计_按机型";
                headers   = new string[] { "机型", "仪器总数", "样本数", "R1试剂使用量(mL)", "R2试剂使用量(mL)" };
                break;

            case "poct_fault":
                condition = JsonConvert.DeserializeObject <QueryConditionModel>(conditions.Replace("\"0\"", "\"\""));
                dt        = bll.GetPoctDeviceFaultBLL(condition.SN, condition.dtStart, condition.dtEnd);
                fileName  = "POCT统计_故障信息";
                headers   = new string[] { "错误码", "时间" };
                break;

            case "poct_all":
                condition = JsonConvert.DeserializeObject <QueryConditionModel>(conditions.Replace("\"0\"", "\"\""));
                dt        = poctStaticBll.StatisticsAllPoctDevicesForExportBLL(condition);
                fileName  = "POCT统计_所有机器";
                headers   = new string[] { "仪器名称", "上报时间", "SIM卡号", "仪器序列号", "样本数", "测试卡消耗数" };
                break;

            case "poct_area":
                condition = JsonConvert.DeserializeObject <QueryConditionModel>(conditions.Replace("\"0\"", "\"\""));
                dt        = poctStaticBll.PoctStatisticsByAreaForExportBLL(condition);
                fileName  = "POCT统计_按区域";
                headers   = new string[] { "装机区域", "仪器总数", "样本数", "测试卡消耗数" };
                break;

            case "poct_type":
                condition = JsonConvert.DeserializeObject <QueryConditionModel>(conditions.Replace("\"0\"", "\"\""));
                dt        = poctStaticBll.PoctStatisticsByTypeForExportBLL(condition);
                fileName  = "POCT统计_按机型";
                headers   = new string[] { "机型", "仪器总数", "样本数", "测试卡消耗数" };
                break;

            case "poct_all_num":
                condition = JsonConvert.DeserializeObject <QueryConditionModel>(conditions.Replace("\"0\"", "\"\""));
                dt        = poctStaticBll.StatisticsAllPoctNumForExportBLL(condition);
                fileName  = "POCT统计_总量统计";
                headers   = new string[] { "仪器型号", "测试项目", "样本数", "测试卡消耗数" };
                break;

            case "bio_log":
                LogConditionModel conditionModel = JsonConvert.DeserializeObject <LogConditionModel>(conditions.Replace("\"0\"", "\"\""));
                dt       = staticBll.StatisticsLogsForExportBLL(conditionModel);
                fileName = "日志查询";
                headers  = new string[] { "仪器名称", "SIM卡号", "仪器序列号", "发生时间", "日志内容" };
                break;
            }
            ExportExcel(context, dt, headers, fileName + sn + "_" + DateTime.Now.ToString("yyyyMMddHHmmss"));
            context.Response.Write(message);
        }
 /// <summary>
 /// Releases the data containted within the Progress and Statistics properties.
 /// </summary>
 public void FlushAnalytics()
 {
     _progress   = null;
     _statistics = null;
 }