private String unpopfailgrid(String name, String fileds, String sqlwhere, String key, int ftype, out int pageCount, out int records)
    {
        sys_line sysBaseLine = System.Web.HttpContext.Current.Session["SysBaseLine"] as sys_line;

        if (sysBaseLine.IsActive == 0)
        {
            sqlwhere = "and ReportDate>='" + StartDate + "' AND ReportDate<'" + DateTime.Parse(EndDate).AddDays(1).ToString("yyyy-MM-dd") + "'  AND (SGComment IS NULL OR JLComment IS NULL) ";
            if (!String.IsNullOrEmpty(Request.Params["sTestcode"].ToString()))
            {
                sqlwhere += " and TestRoomCode='" + Request.Params["sTestcode"].ToString() + "' ";
            }
        }
        else
        {
            name     = "v_invalid_document";
            sqlwhere = "and ReportDate>='" + StartDate + "' AND ReportDate<'" + DateTime.Parse(EndDate).AddDays(1).ToString("yyyy-MM-dd") + "' AND  F_InvalidItem NOT LIKE '%#%' AND AdditionalQualified=0   AND (SGComment IS NULL OR JLComment IS NULL)  ";
            if (!String.IsNullOrEmpty(Request.Params["sTestcode"].ToString()))
            {
                sqlwhere += " and TestRoomCode='" + Request.Params["sTestcode"].ToString() + "' ";
            }
        }

        BLL_LoginLog BLL = new BLL_LoginLog();
        DataTable    dt  = BLL.GetDataTablePager(name, fileds, sqlwhere, key, "ReportDate", OrderType, PageIndex, PageSize, out pageCount, out records);

        if (dt != null)
        {
            return(JsonConvert.SerializeObject(dt));
        }
        else
        {
            return("");
        }
    }
    private String SMS(String name, String fileds, String sqlwhere, String key, int ftype, out int pageCount, out int records)
    {
        sqlwhere = "and SentTime>='" + StartDate + "' AND SentTime<'" + DateTime.Parse(EndDate).AddDays(1).ToString("yyyy-MM-dd") + "'";
        if (!String.IsNullOrEmpty(Request.Params["username"]))
        {
            sqlwhere += " and  PersonName LIKE '%" + Request.Params["username"].Trim() + "%'";
        }
        if (!String.IsNullOrEmpty(Request.Params["tel"]))
        {
            sqlwhere += " and  SMSPhone LIKE '%" + Request.Params["tel"].Trim() + "%'";
        }
        if (!String.IsNullOrEmpty(SelectedTestRoomCodes))
        {
            sqlwhere += " and testroomcode in (" + SelectedTestRoomCodes + ") ";
        }
        else
        {
            sqlwhere += "and 1=0";
        }
        BLL_LoginLog BLL = new BLL_LoginLog();
        DataTable    dt  = BLL.GetDataTablePager(name, fileds, sqlwhere, key, OrderField, OrderType, PageIndex, PageSize, out pageCount, out records);

        if (dt != null)
        {
            return(JsonConvert.SerializeObject(dt));
        }
        else
        {
            return("");
        }
    }
    private String loginLog(String name, String fileds, String sqlwhere, String key, int ftype, out int pageCount, out int records)
    {
        fileds   = @"loginDay ,
          ipAddress ,
          macAddress ,
          machineName ,
          osVersion ,
          osUserName ,
          UserName ,
          ProjectName ,
          SegmentName ,
          CompanyName ,
          TestRoomName ,
          TestRoomCode ,
          FirstAccessTime ,
          LastAccessTime";
        sqlwhere = "and FirstAccessTime>='" + StartDate + "' AND FirstAccessTime<'" + DateTime.Parse(EndDate).AddDays(1).ToString("yyyy-MM-dd") + "'";


        #region For 首页
        if (!"NUM".RequestStr().IsNullOrEmpty())
        {
            sqlwhere += " and testroomcode in ('" + "NUM".RequestStr() + "') ";
        }
        else if (!String.IsNullOrEmpty(SelectedTestRoomCodes))
        {
            sqlwhere += " and testroomcode in (" + SelectedTestRoomCodes + ") ";
        }
        else
        {
            sqlwhere += "and 1=0";
        }


        #endregion

        if (!String.IsNullOrEmpty(Request.Params["username"]))
        {
            sqlwhere += " and  UserName LIKE '%" + Request.Params["username"].Trim() + "%'";
        }

        BLL_LoginLog BLL = new BLL_LoginLog();
        DataTable    dt  = BLL.GetDataTablePager(name, fileds, sqlwhere, key, "loginDay", OrderType, PageIndex, PageSize, out pageCount, out records);
        if (dt != null)
        {
            return(JsonConvert.SerializeObject(dt));
        }
        else
        {
            return("");
        }
    }
    private String stadiumLog(String name, String fileds, String sqlwhere, String key, int ftype, out int pageCount, out int records)
    {
        BLL_LoginLog BLL = new BLL_LoginLog();
        DataTable    dt  = BLL.GetDataTablePager(name, fileds, sqlwhere, key, OrderField, OrderType, PageIndex, PageSize, out pageCount, out records);

        if (dt != null)
        {
            return(JsonConvert.SerializeObject(dt));
        }
        else
        {
            return("");
        }
    }
    private String operateLog(String name, String fileds, String sqlwhere, String key, int ftype, out int pageCount, out int records)
    {
        sys_line sysBaseLine = System.Web.HttpContext.Current.Session["SysBaseLine"] as sys_line;

        if (sysBaseLine.IsActive == 0)
        {
        }
        else
        {
            name = "v_operate_log";
        }
        sqlwhere = "and modifiedDate>='" + StartDate + "' AND modifiedDate<'" + DateTime.Parse(EndDate).AddDays(1).ToString("yyyy-MM-dd") + "'";
        if (!String.IsNullOrEmpty(Request.Params["username"]))
        {
            sqlwhere += " and  modifiedby LIKE '%" + Request.Params["username"].Trim() + "%'";
        }
        if (!String.IsNullOrEmpty(SelectedTestRoomCodes))
        {
            sqlwhere += " and testroomcode in (" + SelectedTestRoomCodes + ") ";
        }
        else
        {
            sqlwhere += "and 1=0";
        }
        BLL_LoginLog BLL = new BLL_LoginLog();
        DataTable    dt  = BLL.GetDataTablePager(name, fileds, sqlwhere, key, "modifiedDate", OrderType, PageIndex, PageSize, out pageCount, out records);

        if (dt != null)
        {
            return(JsonConvert.SerializeObject(dt));
        }
        else
        {
            return("");
        }
    }
    /// <summary>
    /// 不合格数据分析
    /// </summary>
    /// <param name="name"></param>
    /// <param name="fileds"></param>
    /// <param name="sqlwhere"></param>
    /// <param name="key"></param>
    /// <param name="ftype"></param>
    /// <param name="pageCount"></param>
    /// <param name="records"></param>
    /// <returns></returns>
    private String evaluatedata(String name, String fileds, String sqlwhere, String key, int ftype, out int pageCount, out int records)
    {
        sys_line sysBaseLine = System.Web.HttpContext.Current.Session["SysBaseLine"] as sys_line;

        if (sysBaseLine.IsActive == 0)
        {
            sqlwhere = "and ReportDate>='" + StartDate + "' AND ReportDate<'" + DateTime.Parse(EndDate).AddDays(1).ToString("yyyy-MM-dd") + "'";
            if (!String.IsNullOrEmpty(SelectedTestRoomCodes))
            {
                sqlwhere += " and TestRoomCode in (" + SelectedTestRoomCodes + ") ";
            }
            if (!String.IsNullOrEmpty(Request.Params["sReportCode"]))
            {
                sqlwhere += " and  ReportNumber LIKE '%" + Request.Params["sReportCode"].Trim() + "%'";
            }
            if (!String.IsNullOrEmpty(Request.Params["sReportName"]))
            {
                sqlwhere += " and  ReportName LIKE '%" + Request.Params["sReportName"].Trim() + "%'";
            }
        }
        else
        {
            name     = "v_invalid_document";
            sqlwhere = "and ReportDate>='" + StartDate + "' AND ReportDate<'" + DateTime.Parse(EndDate).AddDays(1).ToString("yyyy-MM-dd") + "' AND  F_InvalidItem NOT LIKE '%#%' AND AdditionalQualified=0 ";

            #region  FOR 首页
            if (!string.IsNullOrEmpty("RPNAME".RequestStr()))
            {
                switch ("RPNAME".RequestStr())
                {
                case "1":     //混凝土抗压
                    sqlwhere += @"  AND ModelIndex IN (
                                                                                'A46D053A-0776-467F-9136-0AA45D2021D2',
                                                                                '90973417-6C68-4E90-849B-0B1AEB36A234',
                                                                                'E1E2A6EA-C092-4C8D-920D-170BE5128BC4',
                                                                                'D06E5471-EE69-49E4-9AF4-1BE8AB2E0310',
                                                                                '8A2B5231-8602-4519-8919-1FF649ED2E41',
                                                                                'FA0D1C8C-DE69-4C16-A301-3A861C6B11CD',
                                                                                'D1C56FBD-2EDC-40FF-956F-4DA7178F2DD3',
                                                                                '4500603A-5BE7-4574-BBBA-77B4626A3EA1',
                                                                                '05D0D71B-DEF3-42EE-A16A-79B34DE97E9B',
                                                                                'A14D0408-690C-420C-9D41-7A2FA515C371',
                                                                                'F21C9D4A-CB80-4705-AA7C-81A8BD17DB7D',
                                                                                'C9A1DD95-79BF-4543-924B-94362381E705',
                                                                                'E25F399F-A147-4663-B74A-98A46A39F121',
                                                                                '269EE291-F6E7-4AEA-B4C7-A7D02B7C59DE',
                                                                                '3AB86F48-7A73-46B1-8AA4-D1B55DE1EE8A',
                                                                                'F34C2B8B-DDBE-4C04-BD01-F08B0F479AE8',
                                                                                'A974B39B-EC88-4917-A1D5-F8FBBFBB1F7A',
                                                                                'C72E2DD8-EC76-4663-B400-FB1B7F8F8C2B',
                                                                                '7894EACD-DA8C-4659-9891-FB4D62EB9FF5'
                                                                                )";
                    break;

                case "2":    //钢筋实验
                    sqlwhere += @"  AND ModelIndex IN (
                                                                                'AE9F8E75-773F-4DEE-A3A8-3E871AC8598E',
                                                                                'A98902C1-BB72-4E79-9C74-4746D1709D3B',
                                                                                '68F05EBC-5D34-49C5-9B57-49B688DF24F7',
                                                                                '9B8BD64A-2D9C-4B67-B9DC-53FCF67FD361',
                                                                                '46622671-E829-412C-99E6-587525ED968F',
                                                                                'C7B2620E-7F4C-4586-AEBB-59855B54E522',
                                                                                '3B46BC3A-92DF-4AFC-AA85-AE74FC00F96D',
                                                                                '377A20DA-7E27-4CD3-B9E1-B3C7993CF6EA',
                                                                                'A12AD84C-A7D3-4B42-A9DF-6E80A3E3A0CF',
                                                                                '0A2F0365-D561-4504-B602-98FCC5C3AB94',
                                                                                '4C817CF9-E7F3-422D-975F-C8175E738382'
                                                                                ) ";
                    break;

                case "3":     //混凝土原材
                    sqlwhere += "AND ModelIndex IN (SELECT ID FROM dbo.sys_module WHERE CatlogCode LIKE '0001%') ";
                    break;

                case "4":     //其他
                    sqlwhere += @" AND ModelIndex not IN(SELECT ID FROM dbo.sys_module WHERE CatlogCode LIKE '0001%' or ID in('AE9F8E75-773F-4DEE-A3A8-3E871AC8598E','A98902C1-BB72-4E79-9C74-4746D1709D3B','68F05EBC-5D34-49C5-9B57-49B688DF24F7','9B8BD64A-2D9C-4B67-B9DC-53FCF67FD361','46622671-E829-412C-99E6-587525ED968F','C7B2620E-7F4C-4586-AEBB-59855B54E522','3B46BC3A-92DF-4AFC-AA85-AE74FC00F96D','377A20DA-7E27-4CD3-B9E1-B3C7993CF6EA','A12AD84C-A7D3-4B42-A9DF-6E80A3E3A0CF','0A2F0365-D561-4504-B602-98FCC5C3AB94','4C817CF9-E7F3-422D-975F-C8175E738382','A46D053A-0776-467F-9136-0AA45D2021D2','90973417-6C68-4E90-849B-0B1AEB36A234','E1E2A6EA-C092-4C8D-920D-170BE5128BC4','D06E5471-EE69-49E4-9AF4-1BE8AB2E0310','8A2B5231-8602-4519-8919-1FF649ED2E41','FA0D1C8C-DE69-4C16-A301-3A861C6B11CD','D1C56FBD-2EDC-40FF-956F-4DA7178F2DD3','4500603A-5BE7-4574-BBBA-77B4626A3EA1','05D0D71B-DEF3-42EE-A16A-79B34DE97E9B','A14D0408-690C-420C-9D41-7A2FA515C371','F21C9D4A-CB80-4705-AA7C-81A8BD17DB7D','C9A1DD95-79BF-4543-924B-94362381E705','E25F399F-A147-4663-B74A-98A46A39F121','269EE291-F6E7-4AEA-B4C7-A7D02B7C59DE','3AB86F48-7A73-46B1-8AA4-D1B55DE1EE8A','F34C2B8B-DDBE-4C04-BD01-F08B0F479AE8','A974B39B-EC88-4917-A1D5-F8FBBFBB1F7A','C72E2DD8-EC76-4663-B400-FB1B7F8F8C2B','7894EACD-DA8C-4659-9891-FB4D62EB9FF5')) ";
                    break;

                case "5":     //已处理
                    sqlwhere += @" AND  (DealResult IS NOT NULL) AND DealResult <> '' ";
                    break;

                case "6":     //未处理
                    sqlwhere += @" AND (DealResult='' OR DealResult IS NULL) ";
                    break;
                }
            }

            #endregion

            if (!"NUM".RequestStr().IsNullOrEmpty())
            {
                sqlwhere += " and testroomcode in ('" + "NUM".RequestStr() + "') ";
            }
            else if (!String.IsNullOrEmpty(SelectedTestRoomCodes))
            {
                sqlwhere += " and testroomcode in (" + SelectedTestRoomCodes + ") ";
            }

            if (!String.IsNullOrEmpty(Request.Params["sReportCode"]))
            {
                sqlwhere += " and  ReportNumber LIKE '%" + Request.Params["sReportCode"].Trim() + "%'";
            }
            if (!String.IsNullOrEmpty(Request.Params["sReportName"]))
            {
                sqlwhere += " and  ReportName LIKE '%" + Request.Params["sReportName"].Trim() + "%'";
            }
        }

        BLL_LoginLog BLL = new BLL_LoginLog();
        DataTable    dt  = BLL.GetDataTablePager(name, fileds, sqlwhere, key, "OrderID", "ASC", PageIndex, PageSize, out pageCount, out records);

        if (dt != null)
        {
            return(JsonConvert.SerializeObject(dt));
        }
        else
        {
            return("");
        }
    }
Beispiel #7
0
    /// <summary>
    /// 不合格数据分析
    /// </summary>
    /// <returns></returns>
    public DataTable BHGSJFX()
    {
        sys_line sysBaseLine = System.Web.HttpContext.Current.Session["SysBaseLine"] as sys_line;
        string   sqlwhere    = string.Empty;
        string   name        = "biz_all_failreport";

        if (sysBaseLine.IsActive == 0)
        {
            sqlwhere = "and ReportDate>='" + StartDate + "' AND ReportDate<'" + DateTime.Parse(EndDate).AddDays(1).ToString("yyyy-MM-dd") + "'";
            if (!String.IsNullOrEmpty(SelectedTestRoomCodes))
            {
                sqlwhere += " and TestRoomCode in (" + SelectedTestRoomCodes + ") ";
            }
            if (!String.IsNullOrEmpty(Request.Params["sReportCode"]))
            {
                sqlwhere += " and  ReportNumber LIKE '%" + Request.Params["sReportCode"].Trim() + "%'";
            }
            if (!String.IsNullOrEmpty(Request.Params["sReportName"]))
            {
                sqlwhere += " and  ReportName LIKE '%" + Request.Params["sReportName"].Trim() + "%'";
            }
        }
        else
        {
            name     = "v_invalid_document";
            sqlwhere = "and ReportDate>='" + StartDate + "' AND ReportDate<'" + DateTime.Parse(EndDate).AddDays(1).ToString("yyyy-MM-dd") + "' AND  F_InvalidItem NOT LIKE '%#%' AND AdditionalQualified=0 ";
            if (!String.IsNullOrEmpty(SelectedTestRoomCodes))
            {
                sqlwhere += " and TestRoomCode in (" + SelectedTestRoomCodes + ") ";
            }
            if (!String.IsNullOrEmpty(Request.Params["sReportCode"]))
            {
                sqlwhere += " and  ReportNumber LIKE '%" + Request.Params["sReportCode"].Trim() + "%'";
            }
            if (!String.IsNullOrEmpty(Request.Params["sReportName"]))
            {
                sqlwhere += " and  ReportName LIKE '%" + Request.Params["sReportName"].Trim() + "%'";
            }
        }


        BLL_LoginLog BLL = new BLL_LoginLog();
        DataTable    dt  = BLL.GetDataTablePager(name, "*", sqlwhere, "IndexID", "SectionName", "ASC", 1, 100000, out pageCount, out records);



        dt.Columns.Remove("rowNum");
        dt.Columns.Remove("CompanyCode");
        dt.Columns.Remove("TestRoomCode");
        dt.Columns.Remove("AdditionalQualified");
        dt.Columns.Remove("DeviceType");
        dt.Columns.Remove("WTBH");

        dt.Columns["ReportDate"].ColumnName    = "日期";
        dt.Columns["ReportName"].ColumnName    = "试验报告";
        dt.Columns["ReportNumber"].ColumnName  = "报告编码";
        dt.Columns["F_InvalidItem"].ColumnName = "不合格项目";
        dt.Columns["SGComment"].ColumnName     = "原因分析";
        dt.Columns["JLComment"].ColumnName     = "监理意见";
        dt.Columns["SectionName"].ColumnName   = "标段";
        dt.Columns["CompanyName"].ColumnName   = "单位";
        dt.Columns["TestRoomName"].ColumnName  = "试验室";
        dt.Columns["DealResult"].ColumnName    = "处理情况";
        dt.Columns.Add("标准值");
        dt.Columns.Add("误差值");

        dt.Columns["日期"].SetOrdinal(0);
        dt.Columns["标段"].SetOrdinal(1);
        dt.Columns["单位"].SetOrdinal(2);
        dt.Columns["试验室"].SetOrdinal(3);
        dt.Columns["试验报告"].SetOrdinal(4);
        dt.Columns["不合格项目"].SetOrdinal(5);
        dt.Columns["标准值"].SetOrdinal(6);
        dt.Columns["误差值"].SetOrdinal(7);
        dt.Columns["原因分析"].SetOrdinal(8);
        dt.Columns["监理意见"].SetOrdinal(9);
        dt.Columns["处理情况"].SetOrdinal(10);
        dt.Columns["报告编码"].SetOrdinal(11);

        string[] Temp  = null;
        string[] Temp1 = null;
        string   _XM   = string.Empty;
        string   _SZ   = string.Empty;
        string   _WCZ  = string.Empty;

        foreach (DataRow Dr in dt.Rows)
        {
            Temp = Dr["不合格项目"].ToString().Split(new string[] { "||" }, StringSplitOptions.RemoveEmptyEntries);
            if (Temp == null)
            {
                continue;
            }
            foreach (string V in Temp)
            {
                if (V.IsNullOrEmpty())
                {
                    break;
                }
                Temp1 = V.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
                _XM  += Temp1.Length >= 1 ?  Temp1[0] + "<br />":"";
                _SZ  += Temp1.Length >= 2?  Temp1[1] + "<br />":"";
                _WCZ += Temp1.Length >= 3 ? Temp1[2] + "<br />" : "";
            }
            Dr["不合格项目"] = _XM;
            Dr["标准值"]   = _SZ;
            Dr["误差值"]   = _WCZ;
            Temp        = null;
            Temp1       = null;
            _XM         = string.Empty;
            _SZ         = string.Empty;
            _WCZ        = string.Empty;
        }

        return(dt);
    }