Example #1
0
        /// <summary>
        /// 根据车型车号获取列车管上次更换时间
        /// </summary>
        /// <param name="locotype"></param>
        /// <param name="loconum"></param>
        /// <returns></returns>
        public static lsDatLieCheGuan getLastLcgJianCeRiQi(string locotype, string loconum, int jcid)
        {
            string strSql = "SELECT TOP (1) a.*,(SELECT TianShu FROM dbo.lsDicJianCeTianShu WHERE (LocoType = b.LocoType) AND (FenLei = '列车管') AND (UnitId = b.UnitId)) as ts FROM dbo.lsDatLieCheGuan a,lsDatJT6JiChe b WHERE (a.LocoType = b.LocoType) AND (a.LocoNum = b.LocoNum) AND (a.LocoNum = @LocoNum) AND (a.LocoType = @LocoType) ORDER BY a.JianChaDate DESC";

            if (jcid != 0)
            {
                strSql = "SELECT TOP (1) a.*,(SELECT TianShu FROM dbo.lsDicJianCeTianShu WHERE (LocoType = b.LocoType) AND (FenLei = '列车管') AND (UnitId = b.UnitId)) as ts FROM dbo.lsDatLieCheGuan a,lsDatJT6JiChe b WHERE a.LocoType = b.LocoType AND a.LocoNum = b.LocoNum and b.ID=@ID ORDER BY a.JianChaDate DESC";
            }

            SqlParameter[] sqlParams =
            {
                new SqlParameter("LocoType", locotype),
                new SqlParameter("LocoNum",  loconum),
                new SqlParameter("ID",       jcid)
            };
            DataTable       dt       = SqlHelper.ExecuteDataset(searchmaster.GetSqlConnConfig("57"), CommandType.Text, strSql, sqlParams).Tables[0];
            lsDatLieCheGuan lsdatlcg = new lsDatLieCheGuan();

            if (dt.Rows.Count > 0)
            {
                lsdatlcg.nGhts = PageBase.static_ext_int(dt.Rows[0]["ts"]);
                SetValue(lsdatlcg, dt.Rows[0]);
            }
            return(lsdatlcg);
        }
Example #2
0
        public static string GetBjInfo(lsDatJT6JiChe jiche)
        {
            string    rtnstr      = "";
            DataTable dtCheckType = lsDicJianCeTianShu.GetlsDicJianCeTianShu(jiche.LocoType, jiche.UnitId);

            if (dtCheckType.Rows.Count > 0)
            {
                foreach (DataRow dr in dtCheckType.Rows)
                {
                    switch (dr["FenLei"].ToString())
                    {
                    case "滤网":
                        lsDatLvWang lsdatlw = lsDatLvWang.getLastLvWangJianCeRiQi(jiche.LocoType, jiche.LocoNum, 0);
                        string      lvbj    = MakeBjContent(lsdatlw.genghuanriqi, PageBase.static_ext_int(dr["TianShu"]), PageBase.static_ext_int(dr["BaoJing"]), "滤网");
                        rtnstr += lvbj;
                        rtnstr += lvbj == "" ? "" : ",";
                        break;

                    case "列车管":
                        lsDatLieCheGuan lsdatlcg = lsDatLieCheGuan.getLastLcgJianCeRiQi(jiche.LocoType, jiche.LocoNum, 0);
                        string          lcgbj    = MakeBjContent(lsdatlcg.JianChaDate, PageBase.static_ext_int(dr["TianShu"]), PageBase.static_ext_int(dr["BaoJing"]), "列车管");
                        rtnstr += lcgbj;
                        rtnstr += lcgbj == "" ? "" : ",";
                        break;
                    }
                }
            }
            rtnstr = PageBase.CutComma(rtnstr);
            return(rtnstr);
        }
Example #3
0
 /// <summary>
 /// 结构体赋值
 /// </summary>
 /// <param name="StandardHandle"></param>
 /// <param name="dr"></param>
 /// <returns></returns>
 public static lsDatLieCheGuan SetValue(lsDatLieCheGuan lcg, DataRow dr)
 {
     if (dr != null)
     {
         lcg.ID           = dr["strID"].ToString();
         lcg.LocoType     = dr["LocoType"].ToString();
         lcg.LocoNum      = dr["LocoNum"].ToString();
         lcg.banCi        = dr["BanCi"].ToString();
         lcg.JianChaDate  = PageBase.static_ext_date(dr["JianChaDate"].ToString());
         lcg.JianChaRen   = dr["JianChaRen"].ToString();
         lcg.GovernUnitId = PageBase.static_ext_int(dr["GovernUnitId"].ToString());
         lcg.UnitId       = PageBase.static_ext_int(dr["UnitId"].ToString());
         lcg.DepartmentId = PageBase.static_ext_int(dr["DepartmentId"].ToString());
         lcg.ApanageId    = PageBase.static_ext_int(dr["ApanageId"].ToString());
         lcg.strStepID    = dr["strStepID"].ToString();
         lcg.strID        = dr["strID"].ToString();
         lcg.JiCheID      = PageBase.static_ext_int(dr["JiCheID"].ToString());
         lcg.nState       = PageBase.static_ext_int(dr["nState"].ToString());
         lcg.dtBeginTime  = PageBase.static_ext_date(dr["dtBeginTime"].ToString());
         lcg.dtEndTime    = PageBase.static_ext_date(dr["dtEndTime"].ToString());
         lcg.strFileName  = dr["strFileName"].ToString();
     }
     return(lcg);
 }
Example #4
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);
        }
Example #5
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);
        }