示例#1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            i = 0;
            if (Session["SysBaseLine"] != null)
            {
                sys_line sysBaseLine = System.Web.HttpContext.Current.Session["SysBaseLine"] as sys_line;
                Label1.Text = BasePage.CutString(sysBaseLine.LineName, 18);
            }
            if (Session["UserName"] != null)
            {
                string Line = "'" + ((ResultInfo)Session["UserInfo"]).Line.Replace(",", "','") + "'";
                Line = Line == "''" ? ((ResultInfo)Session["UserInfo"]).LineID : Line;
                string  strSql = @"select 
                  ID ,
                  LineName ,
                  Description ,
                  DataSourceAddress ,
                  UserName ,
                  PassWord ,
                  DataBaseName FROM sys_line WHERE ID in(" + Line + ")";
                DataSet ds     = LineDbHelperSQL.Query(strSql);


                this.rp_list.DataSource = ds;
                this.rp_list.DataBind();
            }
        }
    }
    private String pxreport(String proc, int ftype, out int pageCount, out int records)
    {
        BLL_ParallelReport BLL         = new BLL_ParallelReport();
        sys_line           sysBaseLine = System.Web.HttpContext.Current.Session["SysBaseLine"] as sys_line;

        if (sysBaseLine.IsActive == 0)
        {
        }
        else
        {
            proc = "sp_pxjz_report";
        }

        string Meet = "meet".RequestStr();

        Meet = Meet.IsNullOrEmpty() ? "0" : Meet;
        DataTable dt = BLL.GetProcDataTable(proc, StartDate, DateTime.Parse(EndDate).AddDays(1).ToString("yyyy-MM-dd"), SelectedTestRoomCodes.Replace("'", ""), ftype, PageIndex, PageSize, Meet, OrderType, out pageCount, out records);

        if (dt != null)
        {
            return(JsonConvert.SerializeObject(dt));
        }
        else
        {
            return("");
        }
    }
    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("");
        }
    }
示例#4
0
    private String qxzlhzbchartpop(string proc, string testcode)
    {
        BLL_Document BLL         = new BLL_Document();
        sys_line     sysBaseLine = System.Web.HttpContext.Current.Session["SysBaseLine"] as sys_line;

        testcode = GetSelectTree(testcode, SelectedTestRoomCodes);
        DataTable dt = BLL.GetProcDataTableChartsPara5(proc, StartDate, DateTime.Parse(EndDate).AddDays(1).ToString("yyyy-MM-dd"), testcode, 1);

        if (dt != null)
        {
            List <ChartModel> list = new List <ChartModel>();
            foreach (DataRow dr in dt.Rows)
            {
                ChartModel trcs = new ChartModel();
                trcs.Description = dr["testname"].ToString();
                trcs.IntNumber   = Int32.Parse(dr["ncount"].ToString());
                trcs.Para1       = dr["modelid"].ToString();
                trcs.Para2       = dr["segment"].ToString() + "-" + dr["company"].ToString();
                list.Add(trcs);
            }
            return(JsonConvert.SerializeObject(list));
        }
        else
        {
            return("");
        }
    }
示例#5
0
    private String unpopEvaluatedata()
    {
        BLL_FailReport BLL      = new BLL_FailReport();
        string         sqlwhere = "";
        string         testcode = Request.Params["sTestcode"].ToString();

        testcode = GetSelectTree(testcode, SelectedTestRoomCodes);
        sys_line sysBaseLine = System.Web.HttpContext.Current.Session["SysBaseLine"] as sys_line;

        if (sysBaseLine.IsActive == 0)
        {
            sqlwhere  = " SELECT  Max(TestRoomName) AS testname,COUNT(1) as ncount,MAX(TestRoomCode) as companycode,COUNT(1) as uncounts  FROM dbo.biz_all_failreport ";
            sqlwhere += "where  ReportDate>='" + StartDate + "' AND ReportDate<'" + DateTime.Parse(EndDate).AddDays(1).ToString("yyyy-MM-dd") + "'  AND (SGComment IS NULL OR JLComment IS NULL)  ";
            if (!String.IsNullOrEmpty(testcode))
            {
                sqlwhere += " and TestRoomCode in (" + testcode + ")";
            }
            else
            {
                sqlwhere += " 1=2 ";
            }
            sqlwhere += "   GROUP BY TestRoomCode";
        }
        else
        {
            sqlwhere  = " SELECT  Max(TestRoomName) AS testname,COUNT(1) as ncount,MAX(TestRoomCode) as companycode  FROM dbo.v_invalid_document ";
            sqlwhere += "where  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(testcode))
            {
                sqlwhere += " and TestRoomCode in (" + testcode + ")";
            }
            else
            {
                sqlwhere += " 1=2 ";
            }
            sqlwhere += "   GROUP BY TestRoomCode";
        }
        DataTable dt = BLL.GetTablelist(sqlwhere);

        if (dt != null)
        {
            List <ChartModel> list = new List <ChartModel>();
            foreach (DataRow dr in dt.Rows)
            {
                ChartModel trcs = new ChartModel();
                trcs.Description = dr["testname"].ToString();
                trcs.IntNumber   = Int32.Parse(dr["ncount"].ToString());
                trcs.Para1       = dr["companycode"].ToString();
                list.Add(trcs);
            }
            return(JsonConvert.SerializeObject(list));
        }
        else
        {
            return("");
        }
    }
示例#6
0
    public void SiteMap()
    {
        string   DoMain      = Session["DoMain"] == null? "sys":Session["DoMain"].ToString();
        sys_line sysBaseLine = System.Web.HttpContext.Current.Session["SysBaseLine"] as sys_line;
        string   Sql         = " Select * from Domain_Line_Map where DoMain ='" + DoMain + "'";

        DataSet Ds = LineDbHelperSQL.Query(Sql);

        Site = Newtonsoft.Json.JsonConvert.DeserializeObject <LineMapEnt>(Ds.Tables[0].Rows[0]["Map"].ToString());
    }
示例#7
0
 protected void Page_Load(object sender, EventArgs e)
 {
     //UpDataUserLine();
     PostHandler();
     InitLinesSites();
     SiteMap();
     if (Session["SysBaseLine"] != null)
     {
         sys_line sysBaseLine = System.Web.HttpContext.Current.Session["SysBaseLine"] as sys_line;
         //Label1.Text = BasePage.CutString(sysBaseLine.LineName, 18);
     }
 }
示例#8
0
    /// <summary>
    /// 见证频率分析
    /// </summary>
    /// <returns></returns>
    public DataTable JZPLFX()
    {
        //  json = pxreport("", 2, out pageCount, out records);
        string             proc        = "";
        BLL_ParallelReport BLL         = new BLL_ParallelReport();
        sys_line           sysBaseLine = System.Web.HttpContext.Current.Session["SysBaseLine"] as sys_line;

        if (sysBaseLine.IsActive == 0)
        {
        }
        else
        {
            proc = "sp_pxjz_report";
        }
        string    meet = "meet".RequestStr();
        DataTable dt   = BLL.GetProcDataTable(proc, StartDate, DateTime.Parse(EndDate).AddDays(1).ToString("yyyy-MM-dd"), SelectedTestRoomCodes.Replace("'", ""), 2, 1, 100000, meet, "ASC", out pageCount, out records);


        dt.Columns.Remove("id");
        dt.Columns.Remove("modelID");
        dt.Columns.Remove("testroomID");
        dt.Columns.Remove("pxqulifty");


        dt.Columns["modelName"].ColumnName = "试验名称";
        dt.Columns["condition"].ColumnName = "标准见证频率(%)";
        dt.Columns["zjCount"].ColumnName   = "施工单位资料总数";
        dt.Columns["pxCount"].ColumnName   = "见证次数";
        dt.Columns["frequency"].ColumnName = "见证频率(%)";
        dt.Columns["result"].ColumnName    = "是否满足要求";
        dt.Columns["segment"].ColumnName   = "标段";
        dt.Columns["jl"].ColumnName        = "监理单位";
        dt.Columns["sg"].ColumnName        = "施工单位";
        dt.Columns["testroom"].ColumnName  = "施工单位试验室";

        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);

        return(dt);
    }
示例#9
0
    private String bsloginpop(string proc, string users)
    {
        int       records = 0, pageCount = 0;
        sys_line  sysBaseLine = System.Web.HttpContext.Current.Session["SysBaseLine"] as sys_line;
        DataTable dt          = LineDbHelperSQL.GetDataTableFromProc(proc, StartDate, DateTime.Parse(EndDate).AddDays(1).ToString("yyyy-MM-dd"), users, sysBaseLine.ID.ToString(), PageIndex, PageSize, "", "", out pageCount, out records);

        if (dt != null)
        {
            string Data = JsonConvert.SerializeObject(dt);
            return("{\"pageCount\":\"" + pageCount + "\",\"Data\":" + Data + "}");
        }
        else
        {
            return("");
        }
    }
示例#10
0
    private String evaluatedata()
    {
        BLL_FailReport BLL         = new BLL_FailReport();
        string         sqlwhere    = "";
        sys_line       sysBaseLine = System.Web.HttpContext.Current.Session["SysBaseLine"] as sys_line;

        if (sysBaseLine.IsActive == 0)
        {
            sqlwhere  = " SELECT CompanyCode as companycode,COUNT(1) as ncount,MAX(SectionName) as segment,MAX(CompanyName) AS companyname FROM dbo.biz_all_failreport ";
            sqlwhere += "where ReportDate>='" + StartDate + "' AND ReportDate<'" + DateTime.Parse(EndDate).AddDays(1).ToString("yyyy-MM-dd") + "'";
            if (!String.IsNullOrEmpty(SelectedTestRoomCodes))
            {
                sqlwhere += " and TestRoomCode in (" + SelectedTestRoomCodes + ") ";
            }
            sqlwhere += "   GROUP BY CompanyCode";
        }
        else
        {
            sqlwhere  = "SELECT b.CompanyCode AS companycode,COUNT(DISTINCT a.ID) AS ncount,MAX(c.标段名称) AS segment,MAX(c.单位名称) AS companyname FROM dbo.sys_invalid_document a JOIN dbo.sys_document b ON a.ID = b.ID JOIN dbo.v_bs_codeName c ON b.CompanyCode=c.单位编码 JOIN dbo.sys_module d ON b.ModuleID=d.ID AND b.Status>0  ";
            sqlwhere += "where b.BGRQ>='" + StartDate + "' AND b.BGRQ<'" + DateTime.Parse(EndDate).AddDays(1).ToString("yyyy-MM-dd") + "'   ";
            if (!String.IsNullOrEmpty(SelectedTestRoomCodes))
            {
                sqlwhere += " and b.TestRoomCode in (" + SelectedTestRoomCodes + ") ";
            }
            sqlwhere += "   GROUP BY  b.CompanyCode";
        }
        DataTable dt = BLL.GetTablelist(sqlwhere);

        if (dt != null)
        {
            List <ChartModel> list = new List <ChartModel>();
            foreach (DataRow dr in dt.Rows)
            {
                ChartModel trcs = new ChartModel();
                trcs.Description = dr["segment"].ToString() + "\n" + dr["companyname"].ToString();
                trcs.IntNumber   = Int32.Parse(dr["ncount"].ToString());
                trcs.Para1       = dr["companycode"].ToString();
                list.Add(trcs);
            }
            return(JsonConvert.SerializeObject(list));
        }
        else
        {
            return("");
        }
    }
示例#11
0
    private string DeleteUserManageList(string UserName)
    {
        sys_line sysBaseLine = System.Web.HttpContext.Current.Session["SysBaseLine"] as sys_line;

        try
        {
            string SQL = "delete from sys_bs_users where username='******';delete from sys_users_testroom where username='******'";
            DbHelperSQL.ExecuteSql(SQL).ToString();
            #region
            SQL = "DELETE dbo.sys_BaseLine_Users WHERE UserName='******'  AND LineID='{1}'";
            LineDbHelperSQL.ExecuteSql(string.Format(SQL, UserName, sysBaseLine.ID));
            SQL = "SELECT * FROM  dbo.sys_BaseLine_Users WHERE UserName='******'";
            DataSet ds = LineDbHelperSQL.Query(string.Format(SQL, UserName));
            if (ds != null && ds.Tables[0].Rows.Count > 0)
            {
                SQL = "SELECT * FROM dbo.sys_BaseUsers WHERE  UserName='******'";
                DataSet ds1 = LineDbHelperSQL.Query(string.Format(SQL, UserName));
                if (ds1 != null && ds1.Tables[0].Rows.Count > 0)
                {
                    SQL = "SELECT * FROM  dbo.sys_BaseLine_Users WHERE LineID='{0}' and UserName='******'";
                    DataSet ds2 = LineDbHelperSQL.Query(string.Format(SQL, ds1.Tables[0].Rows[0]["LineID"].ToString(), UserName));
                    if (ds2 != null && ds2.Tables[0].Rows.Count > 0)
                    {
                    }
                    else
                    {
                        //此处修改用户表的默认登录库,因为一旦删除了线路表里面的数据,用户登录以后找不到这个线路会报错
                        SQL = "UPDATE dbo.sys_BaseUsers SET LineID='{0}' ,Descrption='{1}' WHERE UserName='******'";
                        LineDbHelperSQL.ExecuteSql(string.Format(SQL, ds.Tables[0].Rows[0]["LineID"].ToString(), "", UserName));
                    }
                }
            }
            else
            {
                SQL = "DELETE dbo.sys_BaseUsers WHERE UserName='******'";
                LineDbHelperSQL.ExecuteSql(string.Format(SQL, UserName));
            }
            #endregion
            return("1");
        }
        catch
        {
            return("0");
        }
    }
    private String qxzlhzbcharttogrid(String proc, int ftype, String testcode, String modelid, out int pageCount, out int records)
    {
        BLL_Document BLL         = new BLL_Document();
        sys_line     sysBaseLine = System.Web.HttpContext.Current.Session["SysBaseLine"] as sys_line;

        //if (sysBaseLine.IsActive == 0)
        //{
        testcode = GetSelectTree(testcode, SelectedTestRoomCodes);
        //}
        DataTable dt = BLL.GetProcDataTable(proc, StartDate, DateTime.Parse(EndDate).AddDays(1).ToString("yyyy-MM-dd"), testcode, modelid, ftype, PageIndex, PageSize, OrderField, OrderType, 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("");
        }
    }
示例#14
0
    protected void Button1_Click(object sender, EventArgs e)
    {
        sys_line sysBaseLine = System.Web.HttpContext.Current.Session["SysBaseLine"] as sys_line;

        if (sysBaseLine.IsActive == 1)
        {
            string  SQL = "SELECT * FROM dbo.sys_document WHERE  ModuleID='BA23C25D-7C79-4CB3-A0DC-ACFA6C285295' ";
            DataSet ds  = DbHelperSQL.Query(SQL);
            SQL = " TRUNCATE TABLE biz_machinelist ";
            DbHelperSQL.Query(SQL);

            DateTime d_min = DateTime.Parse(SqlDateTime.MinValue.ToString());
            DateTime d_max = DateTime.Parse(SqlDateTime.MaxValue.ToString());



            if (ds != null)
            {
                List <biz_machinelist> list = new List <biz_machinelist>();
                foreach (DataRow dr in ds.Tables[0].Rows)
                {
                    string     str = dr["Data"].ToString();
                    JZDocument doc = Newtonsoft.Json.JsonConvert.DeserializeObject <JZDocument>(str);
                    if (doc != null)
                    {
                        #region
                        for (int i = 6; i < 32; i++)
                        {
                            biz_machinelist biz = new biz_machinelist();
                            biz.SCTS = DateTime.Parse(dr["CreatedTime"].ToString());
                            biz.SCPT = dr["TestRoomCode"].ToString();
                            //int n=0;
                            //if (Int32.TryParse(JZCommonHelper.GetCellValue(doc, doc.Sheets[0].ID, "A" + i).ToString(),out n))
                            //{
                            //    biz.col_norm_A6 = Int32.Parse(JZCommonHelper.GetCellValue(doc, doc.Sheets[0].ID, "A" + i).ToString());
                            //}
                            if (JZCommonHelper.GetCellValue(doc, doc.Sheets[0].ID, "B" + i) != null)
                            {
                                biz.col_norm_B6 = JZCommonHelper.GetCellValue(doc, doc.Sheets[0].ID, "B" + i).ToString();
                            }
                            if (JZCommonHelper.GetCellValue(doc, doc.Sheets[0].ID, "C" + i) != null)
                            {
                                biz.col_norm_C6 = JZCommonHelper.GetCellValue(doc, doc.Sheets[0].ID, "C" + i).ToString();
                            }
                            if (JZCommonHelper.GetCellValue(doc, doc.Sheets[0].ID, "D" + i) != null)
                            {
                                biz.col_norm_D6 = JZCommonHelper.GetCellValue(doc, doc.Sheets[0].ID, "D" + i).ToString();
                            }
                            if (JZCommonHelper.GetCellValue(doc, doc.Sheets[0].ID, "E" + i) != null)
                            {
                                biz.col_norm_E6 = JZCommonHelper.GetCellValue(doc, doc.Sheets[0].ID, "E" + i).ToString();
                            }
                            if (JZCommonHelper.GetCellValue(doc, doc.Sheets[0].ID, "F" + i) != null)
                            {
                                biz.col_norm_F6 = JZCommonHelper.GetCellValue(doc, doc.Sheets[0].ID, "F" + i).ToString();
                            }
                            if (JZCommonHelper.GetCellValue(doc, doc.Sheets[0].ID, "G" + i) != null)
                            {
                                biz.col_norm_G6 = JZCommonHelper.GetCellValue(doc, doc.Sheets[0].ID, "G" + i).ToString();
                            }
                            if (JZCommonHelper.GetCellValue(doc, doc.Sheets[0].ID, "H" + i) != null)
                            {
                                DateTime date = new DateTime();
                                if (DateTime.TryParse(JZCommonHelper.GetCellValue(doc, doc.Sheets[0].ID, "H" + i).ToString(), out date) == false)
                                {
                                    biz.col_norm_H6 = null;
                                }
                                else
                                {
                                    if (DateTime.Compare(d_min, DateTime.Parse(JZCommonHelper.GetCellValue(doc, doc.Sheets[0].ID, "H" + i).ToString())) < 0 && DateTime.Compare(d_max, DateTime.Parse(JZCommonHelper.GetCellValue(doc, doc.Sheets[0].ID, "H" + i).ToString())) >= 0)
                                    {
                                        biz.col_norm_H6 = DateTime.Parse(JZCommonHelper.GetCellValue(doc, doc.Sheets[0].ID, "H" + i).ToString());
                                    }
                                    else
                                    {
                                        biz.col_norm_H6 = null;
                                    }
                                }
                            }
                            if (JZCommonHelper.GetCellValue(doc, doc.Sheets[0].ID, "I" + i) != null)
                            {
                                biz.col_norm_I6 = JZCommonHelper.GetCellValue(doc, doc.Sheets[0].ID, "I" + i).ToString();
                            }
                            if (JZCommonHelper.GetCellValue(doc, doc.Sheets[0].ID, "J" + i) != null)
                            {
                                biz.col_norm_J6 = JZCommonHelper.GetCellValue(doc, doc.Sheets[0].ID, "J" + i).ToString();
                            }
                            if (JZCommonHelper.GetCellValue(doc, doc.Sheets[0].ID, "K" + i) != null)
                            {
                                biz.col_norm_K6 = JZCommonHelper.GetCellValue(doc, doc.Sheets[0].ID, "K" + i).ToString();
                            }
                            if (JZCommonHelper.GetCellValue(doc, doc.Sheets[0].ID, "L" + i) != null)
                            {
                                biz.col_norm_L6 = JZCommonHelper.GetCellValue(doc, doc.Sheets[0].ID, "L" + i).ToString();
                            }
                            if (JZCommonHelper.GetCellValue(doc, doc.Sheets[0].ID, "M" + i) != null)
                            {
                                biz.col_norm_M6 = JZCommonHelper.GetCellValue(doc, doc.Sheets[0].ID, "M" + i).ToString();
                            }
                            if (JZCommonHelper.GetCellValue(doc, doc.Sheets[0].ID, "N" + i) != null)
                            {
                                DateTime date = new DateTime();
                                if (DateTime.TryParse(JZCommonHelper.GetCellValue(doc, doc.Sheets[0].ID, "N" + i).ToString(), out date) == false)
                                {
                                    biz.col_norm_N6 = null;
                                }
                                else
                                {
                                    //biz.col_norm_N6 = DateTime.Parse(JZCommonHelper.GetCellValue(doc, doc.Sheets[0].ID, "N" + i).ToString());
                                    if (DateTime.Compare(d_min, DateTime.Parse(JZCommonHelper.GetCellValue(doc, doc.Sheets[0].ID, "N" + i).ToString())) < 0 && DateTime.Compare(d_max, DateTime.Parse(JZCommonHelper.GetCellValue(doc, doc.Sheets[0].ID, "N" + i).ToString())) >= 0)
                                    {
                                        biz.col_norm_N6 = DateTime.Parse(JZCommonHelper.GetCellValue(doc, doc.Sheets[0].ID, "N" + i).ToString());
                                    }
                                    else
                                    {
                                        biz.col_norm_N6 = null;
                                    }
                                }
                            }
                            if (JZCommonHelper.GetCellValue(doc, doc.Sheets[0].ID, "O" + i) != null)
                            {
                                DateTime date = new DateTime();
                                if (DateTime.TryParse(JZCommonHelper.GetCellValue(doc, doc.Sheets[0].ID, "O" + i).ToString(), out date) == false)
                                {
                                    biz.col_norm_O6 = null;
                                }
                                else
                                {
                                    //biz.col_norm_O6 = DateTime.Parse(JZCommonHelper.GetCellValue(doc, doc.Sheets[0].ID, "O" + i).ToString());
                                    if (DateTime.Compare(d_min, DateTime.Parse(JZCommonHelper.GetCellValue(doc, doc.Sheets[0].ID, "O" + i).ToString())) < 0 && DateTime.Compare(d_max, DateTime.Parse(JZCommonHelper.GetCellValue(doc, doc.Sheets[0].ID, "O" + i).ToString())) >= 0)
                                    {
                                        biz.col_norm_O6 = DateTime.Parse(JZCommonHelper.GetCellValue(doc, doc.Sheets[0].ID, "O" + i).ToString());
                                    }
                                    else
                                    {
                                        biz.col_norm_O6 = null;
                                    }
                                }
                            }
                            if (JZCommonHelper.GetCellValue(doc, doc.Sheets[0].ID, "P" + i) != null)
                            {
                                biz.col_norm_P6 = JZCommonHelper.GetCellValue(doc, doc.Sheets[0].ID, "P" + i).ToString();
                            }
                            if (JZCommonHelper.GetCellValue(doc, doc.Sheets[0].ID, "Q" + i) != null)
                            {
                                biz.col_norm_Q6 = JZCommonHelper.GetCellValue(doc, doc.Sheets[0].ID, "Q" + i).ToString();
                            }
                            if (biz.col_norm_B6 == null && biz.col_norm_C6 == null && biz.col_norm_D6 == null && biz.col_norm_E6 == null && biz.col_norm_F6 == null)
                            {
                            }
                            else
                            {
                                list.Add(biz);
                            }
                        }
                        #endregion
                    }
                }

                #region
                foreach (var item in list)
                {
                    long n = 0;
                    n = Add(item);
                }
                #endregion

                SQL = "DELETE dbo.biz_machinelist WHERE  col_norm_B6='' AND col_norm_C6='' AND col_norm_D6='' AND col_norm_E6='' AND col_norm_F6='' AND col_norm_G6='' ";
                DbHelperSQL.Query(SQL);
                Label1.Text = "执行成功";
            }
        }
    }
示例#15
0
    /// <summary>
    /// 添加
    /// </summary>
    public string Edit()
    {
        string Result = "";

        try
        {
            string KMID    = Request["KMID"].ToString();
            string Content = Request["Content"].ToString();
            string Person  = UserName;
            //rolename


            string Sql = @"

                UPDATE [dbo].[sys_KeyModify]
                          SET 
                           [YZUserName] = '{0}'
                          ,[YZContent] = '{1}'
                          ,[YZOPTime] = '{2}'
                          ,Status={4}
                   WHERE KMID = '{3}'

";

            Sql = string.Format(Sql, Person, Content, DateTime.Now.ToString(), KMID, "Type".RequestStr());
            BLL_Document BLL = new BLL_Document();



            Result = BLL.ExcuteCommand(Sql) > 0 ? "true" : "false";

            try
            {
                #region 发短信
                if ("Type".RequestStr() == "2" && Result == "true")
                {
                    sys_line sysBaseLine = System.Web.HttpContext.Current.Session["SysBaseLine"] as sys_line;
                    DataSet  DsTemp      = LineDbHelperSQL.Query("SELECT [SMSState] FROM [sys_line] where ID ='" + sysBaseLine.ID + "'");
                    if (DsTemp.Tables.Count > 0 && DsTemp.Tables[0].Rows.Count > 0 && DsTemp.Tables[0].Rows[0][0].ToString() == "1")
                    {
                        string SMSSql = @"
                                 SELECT sys_module.name,sys_KeyModify.BGBH,sys_KeyModify.ModifyItem,sys_KeyModify.YzUserName,
                        t1.DESCRIPTION +' '+sys_tree.DESCRIPTION as DESCRIPTION,TestRoomCode
                         FROM sys_KeyModify
                        left outer join sys_tree on sys_KeyModify.testroomcode = sys_tree.nodecode
                        left outer join sys_tree as t1 on Left(sys_KeyModify.testroomcode,8) = t1.nodecode
                        left outer join sys_module on sys_module.id = sys_KeyModify.moduleid
                        where sys_KeyModify.KMID = '" + KMID + "'";

                        DataSet Ds = BLL.GetDataSet(SMSSql);

                        string SmsContent = "{0} {1} {2} {3} {4}拒绝";
                        if (Ds.Tables[0] != null && Ds.Tables[0].Rows.Count > 0)
                        {
                            DataRow Dr = Ds.Tables[0].Rows[0];

                            ModifyItem[] Temp = Newtonsoft.Json.JsonConvert.DeserializeObject <ModifyItem[]>(Dr["ModifyItem"].ToString());

                            SmsContent = string.Format(SmsContent
                                                       , Dr["DESCRIPTION"].ToString()
                                                       , Dr["name"].ToString()
                                                       , Dr["BGBH"].ToString()
                                                       , Temp[0].Description + Temp[0].CurrentValue + "修改为" + Temp[0].OriginalValue
                                                       , Dr["YzUserName"].ToString()
                                                       );



                            string CPS = @"  SELECT CellPhone
                        FROM [SYGLDB_ZhengXu].[dbo].[sys_sms_receiver]
                        where TestRoomCode ='" + Ds.Tables[0].Rows[0]["TestRoomCode"].ToString() + "' and CellPhone <>'' ANd CellPhone is not null and IsActive=1";

                            string MS = "";
                            Ds = BLL.GetDataSet(CPS);
                            if (Ds.Tables[0] != null && Ds.Tables[0].Rows.Count > 0)
                            {
                                foreach (DataRow Dr1 in Ds.Tables[0].Rows)
                                {
                                    if (!Dr1[0].ToString().IsNullOrEmpty())
                                    {
                                        MS += MS.IsNullOrEmpty() ? Dr1[0].ToString() : "," + Dr1[0].ToString();
                                    }
                                }
                            }
                            if (!MS.IsNullOrEmpty())
                            {
                                string SMSResult = SendSMS("Mobile=" + MS + "&Content=" + SmsContent + "&Stime=" + DateTime.Now.ToString() + "&Extno=1");
                            }
                        }
                    }
                }
                #endregion
            }
            catch { }
        }
        catch
        {
            Result = "false";
        }
        return(Result);
    }
    /// <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("");
        }
    }
示例#17
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            String id = Request.Params["id"];
            if (!String.IsNullOrEmpty(id))
            {
                sys_line sysBaseLine = System.Web.HttpContext.Current.Session["SysBaseLine"] as sys_line;
                if (sysBaseLine.IsActive == 0)
                {
                    #region
                    BLL_UserInfo bll = new BLL_UserInfo();
                    DataTable    dt  = bll.GetUserInfo(id);
                    if (dt != null && dt.Rows.Count > 0)
                    {
                        lbl_xingming.Text        = dt.Rows[0]["col_norm_D6"].ToString();
                        lbl_xingbie.Text         = dt.Rows[0]["col_norm_G6"].ToString();
                        lbl_nianling.Text        = dt.Rows[0]["col_norm_K6"].ToString();
                        lbl_jishuzhicheng.Text   = dt.Rows[0]["col_norm_D7"].ToString();
                        lbl_zhiwu.Text           = dt.Rows[0]["col_norm_G7"].ToString();
                        lbl_gongzuonianxian.Text = dt.Rows[0]["col_norm_K7"].ToString();
                        lbl_zhuanye.Text         = dt.Rows[0]["col_norm_D8"].ToString();
                        lbl_xueli.Text           = dt.Rows[0]["col_norm_G8"].ToString();


                        try
                        {
                            lbl_biyeshijian.Text = Convert.ToDateTime(dt.Rows[0]["col_norm_K8"].ToString()).ToShortDateString();
                        }
                        catch
                        {
                            lbl_biyeshijian.Text = dt.Rows[0]["col_norm_K8"].ToString();
                        }

                        lbl_lianxidianhua.Text = dt.Rows[0]["col_norm_D9"].ToString();
                        lbl_biyexuexiao.Text   = dt.Rows[0]["col_norm_G9"].ToString();

                        //dt.Rows[0]["col_norm_L6"].ToString()

                        #region
                        StringBuilder sb1 = new StringBuilder();
                        if (!string.IsNullOrEmpty(dt.Rows[0]["col_norm_L6"].ToString()))
                        {
                            string pathname = dt.Rows[0]["ID"].ToString();
                            string fullPath = Server.MapPath("../userphoto/ ") + pathname + ".jpg";
                            if (!File.Exists(fullPath))
                            {
                                object o = dt.Rows[0]["col_norm_L6"];
                                var    _tempMemoryStream = new MemoryStream((byte[])o);
                                System.Drawing.Image img = System.Drawing.Image.FromStream(_tempMemoryStream);
                                img.Save(fullPath);
                                _tempMemoryStream.Close();
                            }
                            else
                            {
                            }
                            sb1.Append("<img width=\"130px\" height=\"165px\" src=\"../userphoto/" + pathname + ".jpg\" />");
                        }
                        else
                        {
                            sb1.Append("<img width=\"130px\" height=\"165px\" src=\"../images/nohead.png\" />");
                        }
                        Literal3.Text = sb1.ToString();
                        #endregion


                        #region
                        if (!String.IsNullOrEmpty(dt.Rows[0]["col_norm_B14"].ToString()))
                        {
                            StringBuilder sb = new StringBuilder();
                            for (int i = 14; i < 28; i++)
                            {
                                if (!String.IsNullOrEmpty(dt.Rows[0]["col_norm_B" + i + ""].ToString()))
                                {
                                    sb.Append("<tr><td colspan=\"2\">" + dt.Rows[0]["col_norm_B" + i + ""].ToString() + "</td>");
                                    sb.Append("<td colspan=\"3\">" + dt.Rows[0]["col_norm_E" + i + ""].ToString() + "</td>");
                                    sb.Append("<td>" + dt.Rows[0]["col_norm_K" + i + ""].ToString() + "</td>");
                                    sb.Append("<td>" + dt.Rows[0]["col_norm_M" + i + ""].ToString() + "</td></tr>");
                                }
                            }
                            Literal1.Text = sb.ToString();
                        }
                        else
                        {
                            tr_gzjl.Style["display"]    = "none";
                            tr_gzjl_mx.Style["display"] = "none";
                        }

                        if (!String.IsNullOrEmpty(dt.Rows[0]["col_norm_B31"].ToString()))
                        {
                            StringBuilder sb = new StringBuilder();
                            for (int i = 31; i < 37; i++)
                            {
                                if (!String.IsNullOrEmpty(dt.Rows[0]["col_norm_B" + i + ""].ToString()))
                                {
                                    sb.Append("<tr><td colspan=\"2\">" + dt.Rows[0]["col_norm_B" + i + ""].ToString() + "</td>");
                                    sb.Append("<td colspan=\"4\">" + dt.Rows[0]["col_norm_E" + i + ""].ToString() + "</td>");


                                    try
                                    {
                                        string[] Temp = Newtonsoft.Json.JsonConvert.DeserializeObject <string[]>(dt.Rows[0]["col_norm_K" + i + ""].ToString());

                                        sb.Append("<td>" + Temp[0] + "<img src='data:image/gif;base64," + Temp[1] + "' /></td></tr>");
                                    }
                                    catch
                                    {
                                        sb.Append("<td>" + dt.Rows[0]["col_norm_K" + i + ""].ToString() + "' /></td></tr>");
                                    }
                                }
                            }
                            Literal2.Text = sb.ToString();
                        }
                        else
                        {
                            tr_pxjl.Style["display"]    = "none";
                            tr_pxjl_mx.Style["display"] = "none";
                        }
                        #endregion
                    }
                    #endregion
                }
                else
                {
                    string SQL = "SELECT * FROM dbo.sys_document WHERE ID='" + id + "'";

                    DataSet    ds  = DbHelperSQL.Query(SQL);
                    string     str = ds.Tables[0].Rows[0]["Data"].ToString();
                    JZDocument doc = Newtonsoft.Json.JsonConvert.DeserializeObject <JZDocument>(str);
                    if (doc != null)
                    {
                        #region
                        if (JZCommonHelper.GetCellValue(doc, doc.Sheets[0].ID, "D6") != null)
                        {
                            lbl_xingming.Text = JZCommonHelper.GetCellValue(doc, doc.Sheets[0].ID, "D6").ToString();
                        }
                        if (JZCommonHelper.GetCellValue(doc, doc.Sheets[0].ID, "G6") != null)
                        {
                            lbl_xingbie.Text = JZCommonHelper.GetCellValue(doc, doc.Sheets[0].ID, "G6").ToString();
                        }
                        if (JZCommonHelper.GetCellValue(doc, doc.Sheets[0].ID, "K6") != null)
                        {
                            lbl_nianling.Text = JZCommonHelper.GetCellValue(doc, doc.Sheets[0].ID, "K6").ToString();
                        }
                        if (JZCommonHelper.GetCellValue(doc, doc.Sheets[0].ID, "D7") != null)
                        {
                            lbl_jishuzhicheng.Text = JZCommonHelper.GetCellValue(doc, doc.Sheets[0].ID, "D7").ToString();
                        }
                        if (JZCommonHelper.GetCellValue(doc, doc.Sheets[0].ID, "G7") != null)
                        {
                            lbl_zhiwu.Text = JZCommonHelper.GetCellValue(doc, doc.Sheets[0].ID, "G7").ToString();
                        }
                        if (JZCommonHelper.GetCellValue(doc, doc.Sheets[0].ID, "K7") != null)
                        {
                            lbl_gongzuonianxian.Text = JZCommonHelper.GetCellValue(doc, doc.Sheets[0].ID, "K7").ToString();
                        }
                        if (JZCommonHelper.GetCellValue(doc, doc.Sheets[0].ID, "D8") != null)
                        {
                            lbl_zhuanye.Text = JZCommonHelper.GetCellValue(doc, doc.Sheets[0].ID, "D8").ToString();
                        }
                        if (JZCommonHelper.GetCellValue(doc, doc.Sheets[0].ID, "G8") != null)
                        {
                            lbl_xueli.Text = JZCommonHelper.GetCellValue(doc, doc.Sheets[0].ID, "G8").ToString();
                        }
                        if (JZCommonHelper.GetCellValue(doc, doc.Sheets[0].ID, "K8") != null)
                        {
                            lbl_biyeshijian.Text = JZCommonHelper.GetCellValue(doc, doc.Sheets[0].ID, "K8").ToString();
                        }
                        if (JZCommonHelper.GetCellValue(doc, doc.Sheets[0].ID, "D9") != null)
                        {
                            lbl_lianxidianhua.Text = JZCommonHelper.GetCellValue(doc, doc.Sheets[0].ID, "D9").ToString();
                        }
                        if (JZCommonHelper.GetCellValue(doc, doc.Sheets[0].ID, "G9") != null)
                        {
                            lbl_biyexuexiao.Text = JZCommonHelper.GetCellValue(doc, doc.Sheets[0].ID, "G9").ToString();
                        }
                        if (JZCommonHelper.GetCellValue(doc, doc.Sheets[0].ID, "D10") != null)
                        {
                            lbl_idcard.Text = JZCommonHelper.GetCellValue(doc, doc.Sheets[0].ID, "D10").ToString();
                        }
                        #endregion

                        #region
                        if (JZCommonHelper.GetCellValue(doc, doc.Sheets[0].ID, "B14") != null)
                        {
                            StringBuilder sb = new StringBuilder();
                            for (int i = 14; i < 28; i++)
                            {
                                if (JZCommonHelper.GetCellValue(doc, doc.Sheets[0].ID, "B" + i + "") != null)
                                {
                                    sb.Append("<tr><td colspan=\"2\">" + JZCommonHelper.GetCellValue(doc, doc.Sheets[0].ID, "B" + i + "").ToString() + "</td>");
                                }
                                else
                                {
                                    sb.Append("<tr><td colspan=\"2\"></td>");
                                }
                                if (JZCommonHelper.GetCellValue(doc, doc.Sheets[0].ID, "E" + i + "") != null)
                                {
                                    sb.Append("<td colspan=\"3\">" + JZCommonHelper.GetCellValue(doc, doc.Sheets[0].ID, "E" + i + "").ToString() + "</td>");
                                }
                                else
                                {
                                    sb.Append("<td colspan=\"3\"></td>");
                                }

                                if (JZCommonHelper.GetCellValue(doc, doc.Sheets[0].ID, "K" + i + "") != null)
                                {
                                    sb.Append("<td>" + JZCommonHelper.GetCellValue(doc, doc.Sheets[0].ID, "K" + i + "").ToString() + "</td>");
                                }
                                else
                                {
                                    sb.Append("<td></td>");
                                }

                                if (JZCommonHelper.GetCellValue(doc, doc.Sheets[0].ID, "M" + i + "") != null)
                                {
                                    sb.Append("<td>" + JZCommonHelper.GetCellValue(doc, doc.Sheets[0].ID, "M" + i + "").ToString() + "</td></tr>");
                                }
                                else
                                {
                                    sb.Append("<td></td></tr>");
                                }
                            }
                            Literal1.Text = sb.ToString();
                        }
                        else
                        {
                            tr_gzjl.Style["display"]    = "none";
                            tr_gzjl_mx.Style["display"] = "none";
                        }


                        if (JZCommonHelper.GetCellValue(doc, doc.Sheets[0].ID, "B31") != null)
                        {
                            StringBuilder sb = new StringBuilder();
                            for (int i = 31; i < 37; i++)
                            {
                                if (JZCommonHelper.GetCellValue(doc, doc.Sheets[0].ID, "B" + i + "") != null)
                                {
                                    sb.Append("<tr><td colspan=\"2\">" + JZCommonHelper.GetCellValue(doc, doc.Sheets[0].ID, "B" + i + "").ToString() + "</td>");
                                }
                                else
                                {
                                    sb.Append("<tr><td colspan=\"2\"></td>");
                                }
                                if (JZCommonHelper.GetCellValue(doc, doc.Sheets[0].ID, "E" + i + "") != null)
                                {
                                    sb.Append("<td colspan=\"4\">" + JZCommonHelper.GetCellValue(doc, doc.Sheets[0].ID, "E" + i + "").ToString() + "</td>");
                                }
                                else
                                {
                                    sb.Append("<td colspan=\"4\"></td>");
                                }

                                if (JZCommonHelper.GetCellValue(doc, doc.Sheets[0].ID, "K" + i + "") != null)
                                {
                                    try
                                    {
                                        string[] Temp = Newtonsoft.Json.JsonConvert.DeserializeObject <string[]>(JZCommonHelper.GetCellValue(doc, doc.Sheets[0].ID, "K" + i + "").ToString());

                                        System.Drawing.Image img = BizCommon.JZCommonHelper.StringToBitmap(Temp[1]);

                                        sb.Append("<td>" + Temp[0] + "&nbsp;&nbsp;&nbsp;&nbsp;<a title=\"点击查看大图\" href=\"javascript:Show('" + id + "','" + doc.Sheets[0].ID.ToString() + "'," + i + ")\"><img src='data:image/gif;base64," + Temp[1] + "' height=\"30px;\" /></a></td>");
                                    }
                                    catch
                                    {
                                        if (JZCommonHelper.GetCellValue(doc, doc.Sheets[0].ID, "K" + i + "").ToString() != "[null,null,null]")
                                        {
                                            sb.Append("<td>" + JZCommonHelper.GetCellValue(doc, doc.Sheets[0].ID, "K" + i + "").ToString() + "</td>");
                                        }
                                        else
                                        {
                                            sb.Append("<td></td>");
                                        }
                                    }
                                }
                                else
                                {
                                    sb.Append("<td></td>");
                                }
                            }
                            Literal2.Text = sb.ToString();
                        }
                        else
                        {
                            tr_pxjl.Style["display"]    = "none";
                            tr_pxjl_mx.Style["display"] = "none";
                        }

                        #endregion

                        #region
                        StringBuilder sb1 = new StringBuilder();


                        if (JZCommonHelper.GetCellValue(doc, doc.Sheets[0].ID, "L6") != null)
                        {
                            string pathname = id;
                            string fullPath = Server.MapPath("../userphoto/ ") + pathname + ".jpg";
                            if (!File.Exists(fullPath))
                            {
                                object o = JZCommonHelper.GetCellValue(doc, doc.Sheets[0].ID, "L6");
                                System.Drawing.Image img = null;
                                byte[] bitmapBytes       = System.Convert.FromBase64String(o.ToString());
                                using (MemoryStream memoryStream = new MemoryStream(bitmapBytes))
                                {
                                    img = System.Drawing.Image.FromStream(memoryStream);
                                    img.Save(fullPath);
                                    memoryStream.Close();
                                }
                            }
                            //else
                            //{
                            //    sb1.Append("<img width=\"130px\" height=\"165px\" src=\"../images/nohead.png\" />");
                            //}
                            sb1.Append("<img width=\"130px\" height=\"165px\" src=\"../userphoto/" + pathname + ".jpg\" />");
                        }
                        else
                        {
                            sb1.Append("<img width=\"130px\" height=\"165px\" src=\"../images/nohead.png\" />");
                        }
                        Literal3.Text = sb1.ToString();
                        #endregion
                    }
                }
            }
        }
    }
示例#18
0
    private string SaveSysBsUsers(string RID, string uname, string upwd, string truename, string active, string group, string temp)
    {
        sys_line sysBaseLine = System.Web.HttpContext.Current.Session["SysBaseLine"] as sys_line;

        //0:操作失败,1:操作成功,2:用户名重复.
        if (!string.IsNullOrEmpty(uname))
        {
            string SQL = "";
            #region 添加线路库的数据
            SQL = "SELECT * FROM dbo.sys_BaseUsers WHERE UserName='******'";
            DataSet sys_ds = LineDbHelperSQL.Query(string.Format(SQL, uname));                      //判断大库里面的use表
            SQL = "SELECT * FROM  dbo.sys_BaseLine_Users WHERE UserName='******' AND LineID='{1}'";
            DataSet sys_line_ds = LineDbHelperSQL.Query(string.Format(SQL, uname, sysBaseLine.ID)); //判断大库里面的Line权限
            SQL = "SELECT id FROM sys_bs_users where UserName='******';";
            DataSet ds = DbHelperSQL.Query(string.Format(SQL, uname));
            if (ds != null && ds.Tables[0].Rows.Count == 0)
            {
                if (sys_ds != null && sys_ds.Tables[0].Rows.Count == 0)
                {
                    #region

                    SQL = @"INSERT dbo.sys_BaseUsers
                                                                        ( UserName ,
                                                                          Password ,
                                                                          IsActive ,
                                                                          TrueName ,
                                                                          LineID ,
                                                                          Descrption ,
                                                                          RoleName
                                                                        )VALUES  ( '{0}' ,
                                                                          '{1}' ,
                                                                          '{2}' ,
                                                                          '{3}' ,
                                                                         '{4}' , 
                                                                         '{5}' , 
                                                                         '{6}'
                                                                        )";
                    LineDbHelperSQL.ExecuteSql(string.Format(SQL, uname, EncryptSerivce.Encrypt(upwd), active, truename, sysBaseLine.ID, sysBaseLine.LineName, group));


                    SQL = @"INSERT dbo.sys_BaseLine_Users
                                                                ( UserName, LineID)
                                                        VALUES  ( '{0}', 
                                                                  '{1}'
                                                                  )";
                    LineDbHelperSQL.ExecuteSql(string.Format(SQL, uname, sysBaseLine.ID));
                    #endregion
                }
                else
                {
                    #region
                    //if ((group == "S" && ((sys_ds.Tables[0].Rows[0]["RoleName"].ToString() == "S") || (sys_ds.Tables[0].Rows[0]["RoleName"].ToString() == "SS"))) || (group == "SS" && ((sys_ds.Tables[0].Rows[0]["RoleName"].ToString() == "S") || (sys_ds.Tables[0].Rows[0]["RoleName"].ToString() == "SS"))))
                    if ((group == "S" || group == "SS" || group == "X" || group == "A") && ((sys_ds.Tables[0].Rows[0]["RoleName"].ToString() == "S") || (sys_ds.Tables[0].Rows[0]["RoleName"].ToString() == "SS") || (sys_ds.Tables[0].Rows[0]["RoleName"].ToString() == "X") || (sys_ds.Tables[0].Rows[0]["RoleName"].ToString() == "A")))
                    {
                        SQL = @"INSERT dbo.sys_BaseLine_Users
                                                                ( UserName, LineID )
                                                        VALUES  ( '{0}', 
                                                                  '{1}'
                                                                  )";
                        LineDbHelperSQL.ExecuteSql(string.Format(SQL, uname, sysBaseLine.ID));
                    }
                    else
                    {
                        return("2");
                    }
                    #endregion
                }
                SQL = "INSERT INTO sys_bs_users(UserName,Password,IsActive,TrueName)VALUES('{0}','{1}','{2}','{3}');";
                int userCount = DbHelperSQL.ExecuteSql(string.Format(SQL, uname, EncryptSerivce.Encrypt(upwd), active, truename));
                if (userCount > 0)
                {
                    StringBuilder str = new StringBuilder();
                    SQL = "INSERT INTO sys_users_testroom(username,testroomcode,segment)VALUES('{0}','{1}','{2}');";
                    string[] roomCode = temp.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
                    for (int i = 0; i < roomCode.Length; i++)
                    {
                        str.Append(string.Format(SQL, uname, roomCode[i], group));
                    }
                    DbHelperSQL.ExecuteSql(str.ToString());
                    return("1");
                }
                return("0");
            }
            else
            {
                SQL = "UPDATE sys_bs_users set Password='******',IsActive='{1}',TrueName='{2}' where UserName='******';";
                int userCount = DbHelperSQL.ExecuteSql(string.Format(SQL, EncryptSerivce.Encrypt(upwd), active, truename, uname));
                if (userCount > 0)
                {
                    SQL = "delete from sys_users_testroom where username='******';";
                    DbHelperSQL.ExecuteSql(string.Format(SQL, uname));
                    StringBuilder str = new StringBuilder();
                    SQL = "INSERT INTO sys_users_testroom(username,testroomcode,segment)VALUES('{0}','{1}','{2}');";
                    string[] roomCode = temp.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
                    for (int i = 0; i < roomCode.Length; i++)
                    {
                        str.Append(string.Format(SQL, uname, roomCode[i], group));
                    }
                    DbHelperSQL.ExecuteSql(str.ToString());

                    #region 修改大库的密码
                    SQL = "SELECT * FROM dbo.sys_BaseUsers WHERE UserName='******' ";
                    DataSet sys_ds_edit = LineDbHelperSQL.Query(string.Format(SQL, uname));//判断大库里面的use表
                    if (sys_ds_edit != null && sys_ds_edit.Tables.Count > 0)
                    {
                        SQL = @"UPDATE dbo.sys_BaseUsers SET  Password='******' WHERE UserName='******'";
                        LineDbHelperSQL.ExecuteSql(string.Format(SQL, EncryptSerivce.Encrypt(upwd), uname));
                    }
                    #endregion
                    return("1");
                }
                return("0");
            }
            #endregion
        }
        else
        {
            return("0");
        }
    }
示例#19
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            String id = Request.Params["id"];
            if (!String.IsNullOrEmpty(id))
            {
                BLL_FailReport bll         = new BLL_FailReport();
                DataTable      dt          = new DataTable();
                sys_line       sysBaseLine = System.Web.HttpContext.Current.Session["SysBaseLine"] as sys_line;
                if (sysBaseLine.IsActive == 0)
                {
                    dt = bll.GetFailInfo("biz_all_failreport", id);
                }
                else
                {
                    dt = bll.GetFailInfo("v_invalid_document", id);
                }

                lbl_biaoduan.Text      = dt.Rows[0]["SectionName"].ToString();
                lbl_danwei.Text        = dt.Rows[0]["CompanyName"].ToString();
                lbl_shiyanshi.Text     = dt.Rows[0]["TestRoomName"].ToString();
                lbl_shiyanbaogao.Text  = dt.Rows[0]["ReportName"].ToString();
                lbl_baogaobianhao.Text = dt.Rows[0]["ReportNumber"].ToString();
                lbl_baogaoriqi.Text    = dt.Rows[0]["ReportDate"].ToString();
                string str = dt.Rows[0]["F_InvalidItem"].ToString();

                StringBuilder sb = new StringBuilder();

                String[] Items = str.Split(new string[] { "||" }, StringSplitOptions.RemoveEmptyEntries);
                foreach (String Item in Items)
                {
                    String[] substrings = Item.Split(',');
                    if (substrings.Length > 0)
                    {
                        sb.Append(" <tr>");
                        for (int i = 0; i < substrings.Length; i++)
                        {
                            sb.Append("<td   style=\"text-align: center;\">" + substrings[i] + "</td>");
                        }
                        sb.Append(" </tr>");
                    }
                }
                Literal1.Text         = sb.ToString();
                lbl_yuanyinfenxi.Text = dt.Rows[0]["SGComment"].ToString();
                lbl_jianliyijian.Text = dt.Rows[0]["JLComment"].ToString();
                lbl_chulijiegou.Text  = dt.Rows[0]["DealResult"].ToString();
                if (Session["UserName"] == null)
                {
                    Response.Redirect("~/login.aspx");
                }
                else
                {
                    DataTable dt1 = bll.GetImageInfo(id);
                    if (dt1 != null && dt1.Rows.Count > 0)
                    {
                        StringBuilder sb1 = new StringBuilder();

                        foreach (DataRow item in dt1.Rows)
                        {
                            string pathname = item["ImgName"].ToString();
                            string fullPath = Server.MapPath("../content/ ") + pathname;
                            if (!File.Exists(fullPath))
                            {
                                object o = item["ImgContent"];
                                var    _tempMemoryStream = new MemoryStream((byte[])o);
                                if (_tempMemoryStream.Length > 0)
                                {
                                    System.Drawing.Image img = System.Drawing.Image.FromStream(_tempMemoryStream);
                                    img.Save(fullPath);
                                }
                                else
                                {
                                    _tempMemoryStream.Close();
                                    continue;
                                }
                                _tempMemoryStream.Close();
                            }
                            else
                            {
                            }
                            sb1.Append("<p><a class=\"group4\"  href=\"../content/" + pathname + "\" title=\"" + item["ImgRemark"].ToString() + "\">" + item["ImgName"].ToString() + "</a></p>");
                        }

                        Literal2.Text = sb1.ToString();
                    }
                }
            }
        }
    }
示例#20
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);
    }