コード例 #1
0
        /// <summary>
        /// 根据环节id获取是否所有步骤已完成 false为全完成
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public static bool boolCheckStepFinish(DataRow dr, int jcid)
        {
            SqlParameter[] hssqlParams =
            {
                new SqlParameter("stepid", dr["stepID"].ToString()),
                new SqlParameter("jcid",   jcid)
            };
            int type = PageBase.static_ext_int(dr["nStepType"].ToString());

            if (dr["nEnabled"].ToString() == "0")
            {
                return(true);
            }
            if (type >= 7 && type <= 99 && type != 17)
            {
                string sql = @"select count(*) from View_CheckStandardHandleFinish where strID = @stepid and nEnabled=1 and JiCheID=@jcid and nState=1;";
                if (PageBase.static_ext_int(SqlHelper.ExecuteScalar(searchmaster.GetSqlConnConfig("57"), CommandType.Text, sql, hssqlParams)) <= 0)
                {
                    return(false);
                }
            }
            else
            {
                switch (type)
                {
                case 0:    //风速 只检验整备后风速
                    if (dr["nCaseType"].ToString() == "2")
                    {
                        string Sql2 = @"select strID,JiCheID from View_CheckFengSuFinish where strID = @stepid and nEnabled=1 and JiCheID=@jcid and nFinalIsQualified=1 and nSstate=1 group by strID,JiCheID;";
                        if (PageBase.static_ext_int(SqlHelper.ExecuteDataset(searchmaster.GetSqlConnConfig("57"), CommandType.Text, Sql2, hssqlParams).Tables[0].Rows.Count) <= 0)
                        {
                            return(false);
                        }
                    }
                    break;

                case 1:    //滤网

                    ///读取手持机卡控 是否启用该步骤
                    if (SysConfig.GetSingleSysconfig("Scjkk", "Lw") == "True")
                    {
                        lsDatLvWang lsdatlv = lsDatLvWang.getLastLvWangJianCeRiQi("", "", jcid);
                        TimeSpan    ts      = PageBase.diffTimeReturnTimeSpan(lsdatlv.genghuanriqi, DateTime.Now);
                        if (ts.Days > lsdatlv.nGhts)
                        {
                            string Sql1 = @"select count(*) from View_ChecklvWangFinish where strID = @stepid and nEnabled=1 and JiCheID=@jcid and nState=1;";
                            if (PageBase.static_ext_int(SqlHelper.ExecuteScalar(searchmaster.GetSqlConnConfig("57"), CommandType.Text, Sql1, hssqlParams)) <= 0)
                            {
                                return(false);
                            }
                        }
                    }
                    break;

                case 2:    //单节
                    string Sql3 = @"select count(*) from View_CheckDanJieFinish where strID = @stepid and nEnabled=1 and JiCheID=@jcid and nState=1;";
                    if (PageBase.static_ext_int(SqlHelper.ExecuteScalar(searchmaster.GetSqlConnConfig("57"), CommandType.Text, Sql3, hssqlParams)) <= 0)
                    {
                        return(false);
                    }
                    break;

                case 3:    //直供电
                    string Sql4 = @"select strID,JiCheID from View_CheckZhiGongDianFinish where strID = @stepid and nEnabled=1 and JiCheID=@jcid and nSstate=1 group by strID,JiCheID;";
                    if (PageBase.static_ext_int(SqlHelper.ExecuteDataset(searchmaster.GetSqlConnConfig("57"), CommandType.Text, Sql4, hssqlParams).Tables[0].Rows.Count) <= 0)
                    {
                        return(false);
                    }
                    break;

                case 4:    //瓷瓶
                    string Sql5 = @"select count(*) from View_CheckCiPingFinish where strID = @stepid and nEnabled=1 and JiCheID=@jcid and nState=1;";
                    if (PageBase.static_ext_int(SqlHelper.ExecuteScalar(searchmaster.GetSqlConnConfig("57"), CommandType.Text, Sql5, hssqlParams)) <= 0)
                    {
                        return(false);
                    }
                    break;

                case 5:    //列车管
                    if (SysConfig.GetSingleSysconfig("Scjkk", "Lcg") == "True")
                    {
                        lsDatLieCheGuan lsdatlcg = lsDatLieCheGuan.getLastLcgJianCeRiQi("", "", jcid);
                        TimeSpan        timespan = PageBase.diffTimeReturnTimeSpan(lsdatlcg.JianChaDate, DateTime.Now);
                        if (timespan.Days > lsdatlcg.nGhts)
                        {
                            string Sql6 = @"select count(*) from View_CheckLiCheGuanFinish where strID = @stepid and nEnabled=1 and JiCheID=@jcid and nState=1;";
                            if (PageBase.static_ext_int(SqlHelper.ExecuteScalar(searchmaster.GetSqlConnConfig("57"), CommandType.Text, Sql6, hssqlParams)) <= 0)
                            {
                                return(false);
                            }
                        }
                    }
                    break;

                case 6:    //受电弓
                    string Sql7 = @"select count(*) from View_CheckHuaBanFinish where strID = @stepid and nEnabled=1 and JiCheID=@jcid and nState=1;";
                    if (PageBase.static_ext_int(SqlHelper.ExecuteScalar(searchmaster.GetSqlConnConfig("57"), CommandType.Text, Sql7, hssqlParams)) <= 0)
                    {
                        return(false);
                    }
                    break;
                }
            }
            return(true);
        }
コード例 #2
0
        /// <summary>
        /// 根据环节id获取是否所有步骤已完成 false为全完成
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public static bool boolCheckCaseFinish(string id, int zbid)
        {
            string hssql = @"select a.strID,a.nStepType,b.nCaseType from TAB_HandleStep a,TAB_HandleCase b where b.strID=a.strCaseID and a.strCaseID = @id and a.nEnabled=1";

            SqlParameter[] hssqlParams =
            {
                new SqlParameter("id",   id),
                new SqlParameter("zbid", zbid)
            };
            DataTable dtHandlerStepStrid = SqlHelper.ExecuteDataset(searchmaster.GetSqlConnConfig("57"), CommandType.Text, hssql, hssqlParams).Tables[0];

            foreach (DataRow dr in dtHandlerStepStrid.Rows)
            {
                int type = PageBase.static_ext_int(dr["nStepType"].ToString());

                if (type >= 7 && type <= 16)
                {
                    String strSQLText = "select count(*) from View_CheckStandardHandleFinish where JiCheID=@zbid and nEnabled=1 And strCaseID = @id and nState=1 and nStepType = " + type;
                    if (PageBase.static_ext_int(SqlHelper.ExecuteScalar(searchmaster.GetSqlConnConfig("57"), CommandType.Text, strSQLText, hssqlParams)) <= 0)
                    {
                        return(false);
                    }
                }
                else
                {
                    switch (type)
                    {
                    //卡控整备后的数据
                    case 0:    //风速
                        if (dr["nCaseType"].ToString() == "2")
                        {
                            string Sql2 = @"select strCaseID from View_CheckFengSuFinish where strCaseID = @id and nEnabled=1 and JiCheID=@zbid and nSstate=1 group by strCaseID,JiCheID;";
                            if (PageBase.static_ext_int(SqlHelper.ExecuteDataset(searchmaster.GetSqlConnConfig("57"), CommandType.Text, Sql2, hssqlParams).Tables[0].Rows.Count) <= 0)
                            {
                                return(false);
                            }
                        }
                        break;

                    case 1:    //滤网
                        ///读取手持机卡控 是否启用该步骤
                        if (SysConfig.GetSingleSysconfig("Scjkk", "Lw") == "True")
                        {
                            lsDatLvWang lsdatlv = lsDatLvWang.getLastLvWangJianCeRiQi("", "", zbid);
                            TimeSpan    ts      = PageBase.diffTimeReturnTimeSpan(lsdatlv.genghuanriqi, DateTime.Now);
                            if (ts.Days > lsdatlv.nGhts)
                            {
                                string Sql1 = @"select count(*) from View_ChecklvWangFinish where strID = @stepid and nEnabled=1 and JiCheID=@jcid and nState=1;";
                                if (PageBase.static_ext_int(SqlHelper.ExecuteScalar(searchmaster.GetSqlConnConfig("57"), CommandType.Text, Sql1, hssqlParams)) <= 0)
                                {
                                    return(false);
                                }
                            }
                        }
                        break;

                    case 2:    //单节
                        string Sql3 = @"select count(*) from View_CheckDanJieFinish where strCaseID = @id and nEnabled=1 and JiCheID=@zbid and nState=1;";
                        if (PageBase.static_ext_int(SqlHelper.ExecuteScalar(searchmaster.GetSqlConnConfig("57"), CommandType.Text, Sql3, hssqlParams)) <= 0)
                        {
                            return(false);
                        }
                        break;

                    case 3:    //直供电
                        string Sql4 = @"select strCaseID from View_CheckZhiGongDianFinish where strCaseID = @id and nEnabled=1 and JiCheID=@zbid and nSstate=1 group by strCaseID,JiCheID;";
                        if (PageBase.static_ext_int(SqlHelper.ExecuteDataset(searchmaster.GetSqlConnConfig("57"), CommandType.Text, Sql4, hssqlParams).Tables[0].Rows.Count) <= 0)
                        {
                            return(false);
                        }
                        break;

                    case 4:    //瓷瓶
                        string Sql5 = @"select count(*) from View_CheckCiPingFinish where strCaseID = @id and nEnabled=1 and JiCheID=@zbid and nState=1;";
                        if (PageBase.static_ext_int(SqlHelper.ExecuteScalar(searchmaster.GetSqlConnConfig("57"), CommandType.Text, Sql5, hssqlParams)) <= 0)
                        {
                            return(false);
                        }
                        break;

                    case 5:    //列车管
                        if (SysConfig.GetSingleSysconfig("Scjkk", "Lcg") == "True")
                        {
                            lsDatLieCheGuan lsdatlcg = lsDatLieCheGuan.getLastLcgJianCeRiQi("", "", zbid);
                            TimeSpan        timespan = PageBase.diffTimeReturnTimeSpan(lsdatlcg.JianChaDate, DateTime.Now);
                            if (timespan.Days > lsdatlcg.nGhts)
                            {
                                string Sql6 = @"select count(*) from View_CheckLiCheGuanFinish where strID = @stepid and nEnabled=1 and JiCheID=@jcid and nState=1;";
                                if (PageBase.static_ext_int(SqlHelper.ExecuteScalar(searchmaster.GetSqlConnConfig("57"), CommandType.Text, Sql6, hssqlParams)) <= 0)
                                {
                                    return(false);
                                }
                            }
                        }
                        break;

                    case 6:    //受电弓
                        string Sql7 = @"select count(*) from View_CheckHuaBanFinish where strCaseID = @id and nEnabled=1 and JiCheID=@zbid and nState=1;";
                        if (PageBase.static_ext_int(SqlHelper.ExecuteScalar(searchmaster.GetSqlConnConfig("57"), CommandType.Text, Sql7, hssqlParams)) <= 0)
                        {
                            return(false);
                        }
                        break;
                    }
                }
            }
            return(true);
        }