Example #1
0
        /// <summary>
        /// 获取指定prjName的核心数据
        /// </summary>
        /// <param name="prjName"></param>
        /// <returns></returns>
        public List <DbBean> GetSpecificDbData(string prjName)
        {
            //读取所有的Markers表中的数据
            SQLiteCommand readCmd = connection.CreateCommand();

            readCmd.CommandText = "SELECT * FROM Markers WHERE prjName=" + "'" + prjName + "'";
            SQLiteDataReader reader = readCmd.ExecuteReader();
            //将数据填充到List中
            List <DbBean> list = new List <DbBean>();

            while (reader.Read())
            {
                //填充数据
                DbBean bean = new DbBean();
                bean.PrjName           = reader[DbCons.COLUMN_PRJNAME] + "";
                bean.Longitude         = reader[DbCons.COLUMN_LONGITUDE] + "";
                bean.Latitude          = reader[DbCons.COLUMN_LATITUDE] + "";
                bean.DeviceType        = reader[DbCons.COLUMN_DEVICE_TYPE] + "";
                bean.KilometerMark     = reader[DbCons.COLUMN_KILOMETER_MARK] + "";
                bean.SideDirection     = reader[DbCons.COLUMN_SIDE_DIRECTION] + "";
                bean.DistanceToRail    = reader[DbCons.COLUMN_DISTANCE_TO_RAIL] + "";
                bean.PhotoPathName     = reader[DbCons.COLUMN_PHOTO_PATH_NAME] + "";
                bean.Comment           = reader[DbCons.COLUMN_COMMENT] + "";
                bean.TowerType         = reader[DbCons.COLUMN_TOWER_TYPE] + "";
                bean.TowerHeight       = reader[DbCons.COLUMN_TOWER_HEIGHT] + "";
                bean.AntennaDirection1 = reader[DbCons.COLUMN_ANTENNA_DIRECTION_1] + "";
                bean.AntennaDirection2 = reader[DbCons.COLUMN_ANTENNA_DIRECTION_2] + "";
                bean.AntennaDirection3 = reader[DbCons.COLUMN_ANTENNA_DIRECTION_3] + "";
                bean.AntennaDirection4 = reader[DbCons.COLUMN_ANTENNA_DIRECTION_4] + "";
                //添加数据
                list.Add(bean);
            }
            return(list);
        }
Example #2
0
        /// <summary>
        /// word 插入表格功能(13行2列)
        /// </summary>
        /// <param name="m_Docx">根文档</param>
        /// <param name="device_type">设备类型</param>
        /// <param name="kilometer_mark">公里标</param>
        /// <param name="side_direction">下行侧向</param>
        /// <param name="longitude">经度</param>
        /// <param name="latitude">纬度</param>
        private static void word_inster_table(XWPFDocument m_Docx, DbBean bean, int i = 1)
        {
            XWPFTable table = m_Docx.CreateTable(12, 2);
            CT_Tbl ctbl = m_Docx.Document.body.GetTblArray()[i];
            CT_TblPr ctblpr = ctbl.AddNewTblPr();
            ctblpr.jc = new CT_Jc();
            ctblpr.jc.val = ST_Jc.center;

            table.Width = 3500;
            table.GetRow(0).GetCell(0).SetText("设备类型");
            table.GetRow(0).GetCell(1).SetText(bean.DeviceType);
            table.GetRow(1).GetCell(0).SetText("公里标");
            table.GetRow(1).GetCell(1).SetText(bean.KilometerMark);
            table.GetRow(2).GetCell(0).SetText("下行侧向");
            table.GetRow(2).GetCell(1).SetText(bean.SideDirection);
            table.GetRow(3).GetCell(0).SetText("距线路中心距离(m)");
            table.GetRow(4).GetCell(0).SetText("经度");
            table.GetRow(4).GetCell(1).SetText(bean.Longitude);
            table.GetRow(5).GetCell(0).SetText("纬度");
            table.GetRow(5).GetCell(1).SetText(bean.Latitude);
            table.GetRow(6).GetCell(0).SetText("杆塔类型");
            table.GetRow(6).GetCell(1).SetText(bean.TowerType);
            table.GetRow(7).GetCell(0).SetText("杆塔高度");
            table.GetRow(7).GetCell(1).SetText(bean.TowerHeight);
            table.GetRow(8).GetCell(0).SetText("天线1方向角");
            table.GetRow(8).GetCell(1).SetText(bean.AntennaDirection1);
            table.GetRow(9).GetCell(0).SetText("天线2方向角");
            table.GetRow(9).GetCell(1).SetText(bean.AntennaDirection2);
            table.GetRow(10).GetCell(0).SetText("天线3方向角");
            table.GetRow(10).GetCell(1).SetText(bean.AntennaDirection3);
            table.GetRow(11).GetCell(0).SetText("天线4方向角");
            table.GetRow(11).GetCell(1).SetText(bean.AntennaDirection4);
            CT_TcPr m_Pr = table.GetRow(2).GetCell(1).GetCTTc().AddNewTcPr();
            m_Pr.tcW = new CT_TblWidth();
            m_Pr.tcW.w = "3500";
            m_Pr.tcW.type = ST_TblWidth.dxa; //设置单元格宽度

            XWPFTableRow m_Row = table.InsertNewTableRow(0);
            XWPFTableCell cell = m_Row.CreateCell();
            CT_Tc cttc = cell.GetCTTc();
            CT_TcPr ctPr = cttc.AddNewTcPr();
            ctPr.gridSpan = new CT_DecimalNumber();
            ctPr.gridSpan.val = "2";
            cttc.GetPList()[0].AddNewR().AddNewT().Value = "SITE 【序号】";

            word_insert_space(1, m_Docx, 100);
            word_insert_text(m_Docx, "宋体", 11, "SITE 【序号】勘站照片");
            word_insert_text(m_Docx, "宋体", 11, "(3-10张照片)");

            word_insert_space(1, m_Docx, 100);
        }
Example #3
0
 /// <summary>
 /// 获取数据库中---所有的---的核心数据
 /// </summary>
 /// <returns></returns>
 public List<DbBean> GetDbData()
 {
     //读取所有的Markers表中的数据
     SQLiteCommand readCmd = connection.CreateCommand();
     readCmd.CommandText = "SELECT * FROM Markers";
     SQLiteDataReader reader = readCmd.ExecuteReader();
     //将数据填充到List中
     List<DbBean> list = new List<DbBean>();
     while (reader.Read())
     {
         //填充数据
         DbBean bean = new DbBean();
         bean.PrjName = reader[DbCons.COLUMN_PRJNAME] + "";
         bean.Longitude = reader[DbCons.COLUMN_LONGITUDE] + "";
         bean.Latitude = reader[DbCons.COLUMN_LATITUDE] + "";
         bean.DeviceType = reader[DbCons.COLUMN_DEVICE_TYPE] + "";
         bean.KilometerMark = reader[DbCons.COLUMN_KILOMETER_MARK] + "";
         bean.SideDirection = reader[DbCons.COLUMN_SIDE_DIRECTION] + "";
         bean.DistanceToRail = reader[DbCons.COLUMN_DISTANCE_TO_RAIL] + "";
         bean.PhotoPathName = reader[DbCons.COLUMN_PHOTO_PATH_NAME] + "";
         bean.Comment = reader[DbCons.COLUMN_COMMENT] + "";
         bean.TowerType = reader[DbCons.COLUMN_TOWER_TYPE] + "";
         bean.TowerHeight = reader[DbCons.COLUMN_TOWER_HEIGHT] + "";
         bean.AntennaDirection1 = reader[DbCons.COLUMN_ANTENNA_DIRECTION_1] + "";
         bean.AntennaDirection2 = reader[DbCons.COLUMN_ANTENNA_DIRECTION_2] + "";
         bean.AntennaDirection3 = reader[DbCons.COLUMN_ANTENNA_DIRECTION_3] + "";
         bean.AntennaDirection4 = reader[DbCons.COLUMN_ANTENNA_DIRECTION_4] + "";
         //添加数据
         list.Add(bean);
     }
     return list;
 }