/// <summary>
        /// 获取班次中的时间范围,返回值例:起始时间2014-03-18 08:00:00.000,结束时间2014-03-18 16:00:00.000
        /// </summary>
        /// <param name="strWorkTimeName"></param>
        /// <param name="strDate"></param>
        /// <returns></returns>
        //public static string[] GetDateShiftTimes(string strWorkTimeName, string strDate)
        //{
        //    //select WORK_TIME_FROM,WORK_TIME_TO from T_WORK_TIME where WORK_TIME_NAME ='早班'
        //    string[] times = null;
        //    StringBuilder strSql = new StringBuilder();
        //    strSql.Append("SELECT ");
        //    strSql.Append(LibBusiness.WorkTimeDbConstNames.WORK_TIME_FROM + ",");
        //    strSql.Append(LibBusiness.WorkTimeDbConstNames.WORK_TIME_TO);
        //    strSql.Append(" FROM ");
        //    strSql.Append(LibBusiness.WorkTimeDbConstNames.TABLE_NAME);
        //    strSql.Append(" WHERE ");
        //    strSql.Append(LibBusiness.WorkTimeDbConstNames.WORK_TIME_NAME);
        //    strSql.Append(" = ");
        //    strSql.Append("'" + strWorkTimeName + "'");
        //    DataSet ds = _database.ReturnDSNotOpenAndClose(strSql.ToString());
        //    if (ds != null)
        //    {
        //        DataTable dt = ds.Tables[0];
        //        if (dt != null)
        //        {
        //            //2014-03-05 15:43:45.000
        //            if (dt.Rows.Count > 0)
        //            {
        //                times = new string[2];
        //                times[0] = strDate + " " + dt.Rows[0][LibBusiness.WorkTimeDbConstNames.WORK_TIME_FROM].ToString();
        //                times[1] = strDate + " " + dt.Rows[0][LibBusiness.WorkTimeDbConstNames.WORK_TIME_TO].ToString();
        //            }
        //        }
        //    }
        //    return times;
        //}

        /// <summary>
        /// 根据tunelID,查找巷道名称。若属于回采巷道,返回工作面名称
        /// </summary>
        /// <param name="tunelId"></param>
        /// <returns></returns>
        public static string GetTunelNameByTunelID(string tunelId)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("SELECT ");
            strSql.Append(TunnelInfoDbConstNames.TUNNEL_NAME + ",");
            strSql.Append(TunnelInfoDbConstNames.TUNNEL_TYPE + ",");
            strSql.Append(TunnelInfoDbConstNames.WORKINGFACE_ID);
            strSql.Append(" FROM ");
            strSql.Append(TunnelInfoDbConstNames.TABLE_NAME);
            strSql.Append(" WHERE ");
            strSql.Append(TunnelInfoDbConstNames.ID);
            strSql.Append(" = ");
            strSql.Append(tunelId);
            DataTable dt =
                _database.ReturnDSNotOpenAndClose(strSql.ToString()).Tables[0];

            if (dt != null)
            {
                if (dt.Rows.Count > 0)
                {
                    //判断是否属于回采巷道
                    if
                    (TunnelUtils.IsStoping((TunnelTypeEnum)Convert.ToInt32(dt.Rows[0][LibBusiness.TunnelInfoDbConstNames.TUNNEL_TYPE])))
                    {
                        //获取工作面名称
                        int workFaceId;
                        int.TryParse(dt.Rows[0][TunnelInfoDbConstNames.WORKINGFACE_ID].ToString(),
                                     out workFaceId);
                        WorkingFace workingFace =
                            WorkingFace.Find(workFaceId);
                        if (workingFace != null)
                        {
                            return(workingFace.WorkingFaceName);
                        }
                    }
                    else
                    {
                        return
                            (dt.Rows[0][LibBusiness.TunnelInfoDbConstNames.TUNNEL_NAME].ToString());
                    }
                }
            }
            return("");
        }
        /// <summary>
        /// 根据tunelID,查找巷道名称。若属于回采巷道,返回工作面名称
        /// </summary>
        /// <param name="tunelId"></param>
        /// <returns></returns>
        public static void loadTunnelNames()
        {
            tunnelNames.Clear();
            string sSql = "SELECT A." + TunnelInfoDbConstNames.ID +
                          " , A." + TunnelInfoDbConstNames.TUNNEL_NAME +
                          " , B." + WorkingFaceDbConstNames.WORKINGFACE_NAME +
                          " , A." + TunnelInfoDbConstNames.TUNNEL_TYPE +
                          " FROM " + TunnelInfoDbConstNames.TABLE_NAME + " AS A, "
                          + WorkingFaceDbConstNames.TABLE_NAME + " AS B " +
                          "WHERE A." + TunnelInfoDbConstNames.WORKINGFACE_ID +
                          "= B." + WorkingFaceDbConstNames.WORKINGFACE_ID;

            ManageDataBase db = new
                                ManageDataBase(DATABASE_TYPE.WarningManagementDB);
            DataSet   ds   = db.ReturnDS(sSql);
            DataTable dtWF = ds.Tables[0];

            foreach (DataRow dr in dtWF.Rows)
            {
                TunnelTypeEnum tunnelType =
                    (TunnelTypeEnum)Convert.ToInt32(dr[TunnelInfoDbConstNames.TUNNEL_TYPE]);
                try
                {
                    if (!TunnelUtils.IsStoping(tunnelType))
                    {
                        tunnelNames.Add(dr[TunnelInfoDbConstNames.ID],
                                        dr[WorkingFaceDbConstNames.WORKINGFACE_NAME]);
                    }
                    else
                    {
                        tunnelNames.Add(dr[TunnelInfoDbConstNames.ID],
                                        dr[WorkingFaceDbConstNames.WORKINGFACE_NAME].ToString()
                                        + " - " +
                                        dr[TunnelInfoDbConstNames.TUNNEL_NAME].ToString());
                    }
                }
                catch (Exception ex)
                {
                    Log.Error(ex.ToString());
                }
            }
        }