示例#1
0
        /// <summary>
        /// 获取场地选择状态的数据主键ID集合  lwl
        /// </summary>
        /// <param name="parentNode">父级节点</param>
        private void GetSiteCheckedNode(TreeListNode parentNode, ref List <SiteBean> lblist)
        {
            if (parentNode.Nodes.Count == 0)
            {
                return;//递归终止
            }

            foreach (TreeListNode node in parentNode.Nodes)
            {
                if (node.CheckState == CheckState.Checked)
                {
                    TreeBean nodeInfo = node.TreeList.GetDataRecordByNode(node) as TreeBean;
                    LineBean lb       = nodeInfo.Tag as LineBean;
                    if (lb == null)
                    {
                        SiteBean tag = SiteBll.Instance.GetWhere(new { SITECODE = nodeInfo.Tag.ToString() }).ToList()[0];
                        if (tag != null)
                        {
                            lblist.Add(tag);
                        }
                    }
                }
                GetSiteCheckedNode(node, ref lblist);
            }
        }
示例#2
0
        /// <summary>
        /// 定位到场地
        /// </summary>
        /// <param name="sb"></param>
        public static void ZoomToSite(SiteBean sb, GMapControl gMapCtrl)
        {
            PointLatLng sitepoint = new PointLatLng(sb.Latitude, sb.Longtitude);

            gMapCtrl.Position = sitepoint;
            gMapCtrl.Zoom     = 10;
        }
示例#3
0
        public void WriteContent(SiteBean sb)
        {
            try
            {
                this.pdfViewer.CloseDocument();

                if (File.Exists(pFilePath))
                {
                    File.Delete(pFilePath);
                }

                FileStream myStream = new FileStream(pFilePath, FileMode.Create);              //文件流

                iTextSharp.text.Document document = new iTextSharp.text.Document(PageSize.A4); //创建A4纸、横向PDF文档
                PdfWriter writer = PdfWriter.GetInstance(document, myStream);                  //将PDF文档写入创建的文件中
                document.Open();


                //要在PDF文档中写入中文必须指定中文字体,否则无法写入中文
                BaseFont             bftitle   = BaseFont.CreateFont("C:\\Windows\\Fonts\\SIMHEI.TTF", BaseFont.IDENTITY_H, BaseFont.NOT_EMBEDDED); //用系统中的字体文件SimHei.ttf创建文件字体
                iTextSharp.text.Font fonttitle = new iTextSharp.text.Font(bftitle, 22);                                                             //标题字体,大小30
                                                                                                                                                    //单元格中的字体,大小12

                //添加标题
                iTextSharp.text.Paragraph Title = new iTextSharp.text.Paragraph(sb.SiteName + " 跨断层监测场地基本情况", fonttitle); //添加段落,第二个参数指定使用fonttitle格式的字体,写入中文必须指定字体否则无法显示中文
                Title.Alignment = iTextSharp.text.Rectangle.ALIGN_CENTER;                                                 //设置居中
                document.Add(Title);                                                                                      //将标题段加入PDF文档中


                //空一行
                BaseFont                  bf1    = BaseFont.CreateFont("C:\\Windows\\Fonts\\SIMSUN.TTC,1", BaseFont.IDENTITY_H, BaseFont.NOT_EMBEDDED); //用系统中的字体文件SimSun.ttc创建文件字体
                iTextSharp.text.Font      ftitle = new iTextSharp.text.Font(bf1, 15);
                iTextSharp.text.Paragraph nullp  = new iTextSharp.text.Paragraph("      ", ftitle);
                document.Add(nullp);


                PdfPTable table = CreateTable(sb);

                document.Add(table); //将表格加入PDF文档中
                document.Close();
                myStream.Close();


                //    PDFOperation pdf = new PDFOperation();
                //pdf.Open(new FileStream(pFilePath, FileMode.Create));
                //pdf.SetBaseFont("C:\\WINDOWS\\FONTS\\STSONG.TTF");
                ////pdf.SetFont(20);
                //pdf.AddParagraph(sb.SiteName + " 跨断层监测场地基本情况", 15, 1, 20, 0, 0);
                //pdf.Close();
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
        }
示例#4
0
        /// <summary>
        /// 刷新场地节点
        /// </summary>
        /// <param name="sitecode">场地编码</param>
        public void RefreshSiteNode(string sitecode)
        {
            SiteBean sb = SiteBll.Instance.GetWhere(new { SiteCode = sitecode }).ToList()[0];

            List <TreeBean> treeData = this.treeListData.DataSource as List <TreeBean>;

            TreeBean tb = treeData.Find(n => n.KeyFieldName == sitecode);

            tb.KeyFieldName    = sitecode;
            tb.ParentFieldName = sb.UnitCode;
            tb.Caption         = sb.SiteName;
            tb.SiteType        = sb.SiteType;
            tb.Tag             = sb.SiteCode;
            //treeData.Add(tb);
            treeListData.RefreshDataSource();
        }
示例#5
0
        public override void OnRender(Graphics g)
        {
            System.Drawing.Size      st   = new System.Drawing.Size(330, 260);
            System.Drawing.Rectangle rect = new System.Drawing.Rectangle(Marker.ToolTipPosition.X, Marker.ToolTipPosition.Y - st.Height, st.Width + TextPadding.Width, st.Height + TextPadding.Height);
            rect.Offset(Offset.X, Offset.Y);

            using (GraphicsPath objGP = new GraphicsPath())
            {
                objGP.AddLine(rect.X + 2 * Radius * 20, rect.Y + rect.Height, rect.X + Radius * 20, rect.Y + rect.Height + Radius * 20);
                objGP.AddLine(rect.X + Radius * 20, rect.Y + rect.Height + Radius * 20, rect.X + Radius * 20 + 10, rect.Y + rect.Height);

                objGP.AddArc(rect.X, rect.Y + rect.Height - (Radius * 2), Radius * 2, Radius * 2, 90, 90);
                objGP.AddLine(rect.X, rect.Y + rect.Height - (Radius * 2), rect.X, rect.Y + Radius);
                objGP.AddArc(rect.X, rect.Y, Radius * 2, Radius * 2, 180, 90);
                objGP.AddLine(rect.X + Radius, rect.Y, rect.X + rect.Width - (Radius * 2), rect.Y);
                objGP.AddArc(rect.X + rect.Width - (Radius * 2), rect.Y, Radius * 2, Radius * 2, 270, 90);
                objGP.AddLine(rect.X + rect.Width, rect.Y + Radius, rect.X + rect.Width, rect.Y + rect.Height - (Radius * 2));
                objGP.AddArc(rect.X + rect.Width - (Radius * 2), rect.Y + rect.Height - (Radius * 2), Radius * 2, Radius * 2, 0, 90); // Corner

                objGP.CloseFigure();

                g.FillPath(Fill, objGP);
                g.DrawPath(Stroke, objGP);
            }

            try
            {
                SiteBean          sb      = tag as SiteBean;
                InfoWindowContent content = new InfoWindowContent();
                content.SetInfoWindContent(sb.SiteCode, sb.SiteName, sb.SiteStatus, sb.SiteType, sb.ObsType, sb.Place, sb.FaultCode, sb.ObsUnit, sb.SiteSituation);
                Bitmap bit = new Bitmap(content.Width + 20, content.Height + 20);
                content.DrawToBitmap(bit, content.ClientRectangle);

                Rectangle r = rect;
                r.X = r.X + 4;
                r.Y = r.Y + 4;
                g.DrawImageUnscaled(bit, r);
            }
            catch
            { }
        }
示例#6
0
        /// <summary>
        /// 加载单个场地标记
        /// </summary>
        /// <param name="sblist"></param>
        /// <param name="gMapCtrl"></param>
        public static void AddOneSiteMarker(SiteBean sb, GMapControl gMapCtrl)
        {
            GMapOverlay SiteOverlay = IsLayerExisted("sitemarkers", gMapCtrl) ? GetOverlay("sitemarkers", gMapCtrl) : new GMapOverlay("sitemarkers");

            if (!IsLayerExisted("sitemarkers", gMapCtrl))
            {
                gMapCtrl.Overlays.Add(SiteOverlay);
            }

            GMapMarker marker = null;

            if (sb.SiteCode.Substring(0, 1) == "L")//流动
            {
                string picPath = System.Windows.Forms.Application.StartupPath + "//图片缓存//场地类型图片//";

                if (sb.ObsType == "水准")
                {
                    picPath += "ldsz.png";
                }
                else if (sb.ObsType == "基线")
                {
                    picPath += "ldjx.png";
                }
                else if (sb.ObsType == "综合")
                {
                    picPath += "ldzh.png";
                }
                else
                {
                    picPath += "ldsz.png";
                }
                Bitmap markerPic = new Bitmap(picPath);

                //double[] correctLocation = GpsCorrect.transform(sb.Latitude, sb.Longtitude);
                marker = new GMarkerGoogle(new PointLatLng(sb.Latitude, sb.Longtitude), markerPic);
            }
            else//定点
            {
                string picPath = System.Windows.Forms.Application.StartupPath + "//图片缓存//场地类型图片//";

                if (sb.ObsType == "水准")
                {
                    picPath += "ddsz.png";
                }
                else if (sb.ObsType == "基线")
                {
                    picPath += "ddjx.png";
                }
                else if (sb.ObsType == "综合")
                {
                    picPath += "ddzh.png";
                }
                else
                {
                    picPath += "ddsz.png";
                }
                Bitmap markerPic = new Bitmap(picPath);
                marker = new GMarkerGoogle(new PointLatLng(sb.Latitude, sb.Longtitude), markerPic);
            }
            //marker.Tag = sb.SiteCode;
            marker.Tag = sb;

            marker.ToolTipText    = sb.SiteName;
            marker.ToolTip.Offset = new Point(10, -20);

            marker.ToolTipMode = MarkerTooltipMode.OnMouseOver;

            SiteOverlay.Markers.Add(marker);
        }
示例#7
0
        /// <summary>
        /// 加载远程库树列表
        /// </summary>
        /// <param name="gmmkks">GMAP控件</param>
        public void bSignDbTree()
        {
            try
            {
                this.treeListData.ClearNodes();
                this.treeListData.DataSource = null;
                List <TreeBean> treeData = new List <TreeBean>();

                DataTable ubEnumt = UnitInfoBll.Instance.GetDataTable("select UNITNAME,UNITCODE from t_unittb where HASSITES=1");

                foreach (DataRow dr in ubEnumt.Rows)
                {
                    TreeBean tb = new TreeBean();
                    tb.TreeName        = treeListData.Name;
                    tb.KeyFieldName    = dr["UNITCODE"].ToString();
                    tb.ParentFieldName = "0";
                    tb.Caption         = dr["UNITNAME"].ToString();
                    tb.SiteType        = "";
                    tb.LineStatus      = "";
                    tb.Tag             = new UnitInfoBean {
                        UnitName = dr["UNITNAME"].ToString(), UnitCode = dr["UNITCODE"].ToString(), HASSITES = 1
                    };                                                                                                                    //lwl
                    treeData.Add(tb);
                }


                List <SiteBean> sbEnumt = new List <SiteBean>();
                DataTable       sitedt  = SiteBll.Instance.GetDataTable(@"select sitecode, unitcode,sitename from t_siteinfodb");

                foreach (DataRow sitedr in sitedt.Rows)
                {
                    SiteBean sgsb = new SiteBean();
                    sgsb.SiteCode = sitedr["sitecode"].ToString();
                    sgsb.SiteName = sitedr["sitename"].ToString();
                    sgsb.UnitCode = sitedr["unitcode"].ToString();
                    sbEnumt.Add(sgsb);
                }
                //场地列表显示
                List <string> olSiteCode = new List <string>();
                foreach (SiteBean sb in sbEnumt)
                {
                    olSiteCode.Add(sb.SiteCode);
                    TreeBean tb = new TreeBean();
                    tb.KeyFieldName    = sb.SiteCode;
                    tb.ParentFieldName = sb.UnitCode;
                    tb.Caption         = sb.SiteName;
                    tb.SiteType        = sb.SiteType;
                    tb.Tag             = sb.SiteCode;//lwl
                    treeData.Add(tb);
                }


                //树列表显示
                this.treeListData.KeyFieldName               = "KeyFieldName";    //这里绑定的ID的值必须是独一无二的
                this.treeListData.ParentFieldName            = "ParentFieldName"; //表示使用parentID进行树形绑定
                this.treeListData.DataSource                 = treeData;          //绑定数据源
                this.treeListData.OptionsView.ShowCheckBoxes = true;
                this.treeListData.OptionsBehavior.AllowRecursiveNodeChecking = true;
                this.treeListData.OptionsBehavior.Editable = false;
            }
            catch (Exception ex)
            {
                XtraMessageBox.Show(ex.Message, "错误");
            }
        }
示例#8
0
        /// <summary>
        /// 加载测项合并数列表
        /// </summary>
        /// <returns></returns>
        public List <TreeBean> ObslineMergeTree()
        {
            List <TreeBean> tblist = new List <TreeBean>();

            try
            {
                IEnumerable <UnitInfoBean> ubEnumt = UnitInfoBll.Instance.GetAll();

                foreach (UnitInfoBean sb in ubEnumt)
                {
                    TreeBean tb = new TreeBean();
                    if (sb.UnitCode == "152002" || sb.UnitCode == "152003" ||
                        sb.UnitCode == "152006" || sb.UnitCode == "152008" ||
                        sb.UnitCode == "152009" || sb.UnitCode == "152010" ||
                        sb.UnitCode == "152012" || sb.UnitCode == "152015" ||
                        sb.UnitCode == "152022" || sb.UnitCode == "152023" ||
                        sb.UnitCode == "152026" || sb.UnitCode == "152029" ||
                        sb.UnitCode == "152032" || sb.UnitCode == "152034" ||
                        sb.UnitCode == "152035" || sb.UnitCode == "152036" ||
                        sb.UnitCode == "152039" || sb.UnitCode == "152040" ||
                        sb.UnitCode == "152041" || sb.UnitCode == "152042" ||
                        sb.UnitCode == "152043" || sb.UnitCode == "152044" ||
                        sb.UnitCode == "152045" || sb.UnitCode == "152046" ||
                        sb.UnitCode == "152001" || sb.UnitCode == "152047")
                    {
                        continue;
                    }

                    tb.KeyFieldName    = sb.UnitCode;
                    tb.ParentFieldName = "0";
                    tb.Caption         = sb.UnitName;
                    tb.SiteType        = "";
                    tb.LineStatus      = "";
                    tb.Tag             = sb;//lwl
                    tblist.Add(tb);
                }

                List <SiteBean> sbEnumt = new List <SiteBean>();
                DataTable       dt      = SiteBll.Instance.GetDataTable(@"select sitecode, unitcode,sitename from t_siteinfodb");

                foreach (DataRow dr in dt.Rows)
                {
                    SiteBean sgsb = new SiteBean();
                    sgsb.SiteCode = dr["sitecode"].ToString();
                    sgsb.SiteName = dr["sitename"].ToString();
                    sgsb.UnitCode = dr["unitcode"].ToString();
                    sbEnumt.Add(sgsb);
                }


                //场地列表显示
                List <string> olSiteCode = new List <string>();
                foreach (SiteBean sb in sbEnumt)
                {
                    olSiteCode.Add(sb.SiteCode);
                    TreeBean tb = new TreeBean();
                    tb.KeyFieldName    = sb.SiteCode;
                    tb.ParentFieldName = sb.UnitCode;
                    tb.Caption         = sb.SiteName;
                    tb.SiteType        = sb.SiteCode.Substring(0, 1) == "L" ? "流动" : "定点";
                    tb.Tag             = sb.SiteCode;//lwl
                    tblist.Add(tb);
                }

                List <String> remoteExcelList = new List <string>();
                remoteExcelList = getFile(SystemInfo.DatabaseCache);

                foreach (string remoteLineCode in remoteExcelList)
                {
                    string   subLineCode = remoteLineCode.Substring(0, remoteLineCode.Length - 4);
                    LineBean ol          = LineBll.Instance.GetInfoByID(subLineCode);
                    if (olSiteCode.Contains(ol.SITECODE))
                    {
                        TreeBean tb = new TreeBean();
                        tb.KeyFieldName    = ol.OBSLINECODE;
                        tb.ParentFieldName = ol.SITECODE;
                        tb.Caption         = ol.OBSLINENAME;
                        tb.Tag             = ol;//lwl
                        tblist.Add(tb);
                    }
                }
            }
            catch
            {
                //throw new Exception(ex.Message);
            }

            return(tblist);
        }
示例#9
0
        private PdfPTable CreateTable(SiteBean sb)
        {
            BaseFont bf1 = BaseFont.CreateFont("C:\\Windows\\Fonts\\SIMSUN.TTC,1", BaseFont.IDENTITY_H, BaseFont.NOT_EMBEDDED);     //用系统中的字体文件SimSun.ttc创建文件字体

            iTextSharp.text.Font namefont    = new iTextSharp.text.Font(bf1, 12);
            iTextSharp.text.Font contentfont = new iTextSharp.text.Font(bf1, 10);
            contentfont.SetColor(105, 105, 105);

            PdfPTable table = new PdfPTable(4);

            //table.TableEvent = new AlternatingBackground();
            table.WidthPercentage = 85;                    //设置表格占的宽度,百分比
            table.SetWidths(new int[] { 35, 65, 35, 65 }); //两个单元格所占比例 20% 80%
                                                           //table.TotalWidth = 200;//设置表格占的宽度,单位点数
                                                           //table.SetTotalWidth();
                                                           //table.SetWidthPercentage();
            //cell.Colspan = (4); //合并列;
            //cell.Rowspan = (1); //合并行;

            PdfPCell cell = new PdfPCell(new Phrase("场地名称", namefont));

            cell.HorizontalAlignment = PdfPCell.ALIGN_CENTER;
            cell.VerticalAlignment   = PdfPCell.ALIGN_MIDDLE;
            cell.MinimumHeight       = 30;
            table.AddCell(cell);
            cell = new PdfPCell(new Phrase(sb.SiteName, contentfont));
            cell.HorizontalAlignment = PdfPCell.ALIGN_CENTER;
            cell.VerticalAlignment   = PdfPCell.ALIGN_MIDDLE;
            cell.MinimumHeight       = 30;
            table.AddCell(cell);

            cell = new PdfPCell(new Phrase("所跨断裂断层", namefont));
            cell.HorizontalAlignment = PdfPCell.ALIGN_CENTER;
            cell.VerticalAlignment   = PdfPCell.ALIGN_MIDDLE;
            cell.MinimumHeight       = 30;
            table.AddCell(cell);
            cell = new PdfPCell(new Phrase(sb.FaultCode, contentfont));
            cell.HorizontalAlignment = PdfPCell.ALIGN_CENTER;
            cell.VerticalAlignment   = PdfPCell.ALIGN_MIDDLE;
            cell.MinimumHeight       = 30;
            table.AddCell(cell);

            cell = new PdfPCell(new Phrase("运行状况", namefont));
            cell.HorizontalAlignment = PdfPCell.ALIGN_CENTER;
            cell.VerticalAlignment   = PdfPCell.ALIGN_MIDDLE;
            cell.MinimumHeight       = 30;
            table.AddCell(cell);
            cell = new PdfPCell(new Phrase(sb.SiteStatus, contentfont));
            cell.HorizontalAlignment = PdfPCell.ALIGN_CENTER;
            cell.VerticalAlignment   = PdfPCell.ALIGN_MIDDLE;
            cell.MinimumHeight       = 30;
            table.AddCell(cell);

            cell = new PdfPCell(new Phrase("观测周期", namefont));
            cell.HorizontalAlignment = PdfPCell.ALIGN_CENTER;
            cell.VerticalAlignment   = PdfPCell.ALIGN_MIDDLE;
            cell.MinimumHeight       = 30;
            table.AddCell(cell);
            cell = new PdfPCell(new Phrase(sb.ObsCyc, contentfont));
            cell.HorizontalAlignment = PdfPCell.ALIGN_CENTER;
            cell.VerticalAlignment   = PdfPCell.ALIGN_MIDDLE;
            cell.MinimumHeight       = 30;
            table.AddCell(cell);

            cell = new PdfPCell(new Phrase("历史场地", namefont));
            cell.HorizontalAlignment = PdfPCell.ALIGN_CENTER;
            cell.VerticalAlignment   = PdfPCell.ALIGN_MIDDLE;
            cell.MinimumHeight       = 30;
            table.AddCell(cell);
            cell = new PdfPCell(new Phrase(sb.Historysite, contentfont));
            cell.HorizontalAlignment = PdfPCell.ALIGN_CENTER;
            cell.VerticalAlignment   = PdfPCell.ALIGN_MIDDLE;
            cell.MinimumHeight       = 30;
            table.AddCell(cell);

            cell = new PdfPCell(new Phrase("场地类型", namefont));
            cell.HorizontalAlignment = PdfPCell.ALIGN_CENTER;
            cell.VerticalAlignment   = PdfPCell.ALIGN_MIDDLE;
            cell.MinimumHeight       = 30;
            table.AddCell(cell);
            cell = new PdfPCell(new Phrase(sb.SiteType, contentfont));
            cell.HorizontalAlignment = PdfPCell.ALIGN_CENTER;
            cell.VerticalAlignment   = PdfPCell.ALIGN_MIDDLE;
            cell.MinimumHeight       = 30;
            table.AddCell(cell);

            cell = new PdfPCell(new Phrase("观测类型", namefont));
            cell.HorizontalAlignment = PdfPCell.ALIGN_CENTER;
            cell.VerticalAlignment   = PdfPCell.ALIGN_MIDDLE;
            cell.MinimumHeight       = 30;
            table.AddCell(cell);
            cell = new PdfPCell(new Phrase(sb.ObsType, contentfont));
            cell.HorizontalAlignment = PdfPCell.ALIGN_CENTER;
            cell.VerticalAlignment   = PdfPCell.ALIGN_MIDDLE;
            cell.MinimumHeight       = 30;
            table.AddCell(cell);

            cell = new PdfPCell(new Phrase("标石类型", namefont));
            cell.HorizontalAlignment = PdfPCell.ALIGN_CENTER;
            cell.VerticalAlignment   = PdfPCell.ALIGN_MIDDLE;
            cell.MinimumHeight       = 30;
            table.AddCell(cell);
            cell = new PdfPCell(new Phrase(sb.MarkStoneType, contentfont));
            cell.HorizontalAlignment = PdfPCell.ALIGN_CENTER;
            cell.VerticalAlignment   = PdfPCell.ALIGN_MIDDLE;
            cell.MinimumHeight       = 30;
            table.AddCell(cell);

            cell = new PdfPCell(new Phrase("所在地", namefont));
            cell.HorizontalAlignment = PdfPCell.ALIGN_CENTER;
            cell.VerticalAlignment   = PdfPCell.ALIGN_MIDDLE;
            cell.MinimumHeight       = 30;
            table.AddCell(cell);
            cell = new PdfPCell(new Phrase(sb.Place, contentfont));
            cell.HorizontalAlignment = PdfPCell.ALIGN_CENTER;
            cell.VerticalAlignment   = PdfPCell.ALIGN_MIDDLE;
            //cell.Colspan = (3); //合并列;
            cell.MinimumHeight = 30;
            table.AddCell(cell);


            cell = new PdfPCell(new Phrase("场地坐标", namefont));
            cell.HorizontalAlignment = PdfPCell.ALIGN_CENTER;
            cell.VerticalAlignment   = PdfPCell.ALIGN_MIDDLE;
            cell.MinimumHeight       = 30;
            table.AddCell(cell);
            cell = new PdfPCell(new Phrase(sb.Longtitude + "," + sb.Latitude, contentfont));
            cell.HorizontalAlignment = PdfPCell.ALIGN_CENTER;
            cell.VerticalAlignment   = PdfPCell.ALIGN_MIDDLE;
            cell.MinimumHeight       = 30;
            table.AddCell(cell);


            cell = new PdfPCell(new Phrase("海拔高程", namefont));
            cell.HorizontalAlignment = PdfPCell.ALIGN_CENTER;
            cell.VerticalAlignment   = PdfPCell.ALIGN_MIDDLE;
            cell.MinimumHeight       = 30;
            table.AddCell(cell);
            cell = new PdfPCell(new Phrase(sb.Altitude.ToString(), contentfont));
            cell.HorizontalAlignment = PdfPCell.ALIGN_CENTER;
            cell.VerticalAlignment   = PdfPCell.ALIGN_MIDDLE;
            cell.MinimumHeight       = 30;
            table.AddCell(cell);

            cell = new PdfPCell(new Phrase("起测时间", namefont));
            cell.HorizontalAlignment = PdfPCell.ALIGN_CENTER;
            cell.VerticalAlignment   = PdfPCell.ALIGN_MIDDLE;
            cell.MinimumHeight       = 30;
            table.AddCell(cell);
            cell = new PdfPCell(new Phrase(sb.StartDate, contentfont));
            cell.HorizontalAlignment = PdfPCell.ALIGN_CENTER;
            cell.VerticalAlignment   = PdfPCell.ALIGN_MIDDLE;
            cell.MinimumHeight       = 30;
            table.AddCell(cell);

            cell = new PdfPCell(new Phrase("建设单位", namefont));
            cell.HorizontalAlignment = PdfPCell.ALIGN_CENTER;
            cell.VerticalAlignment   = PdfPCell.ALIGN_MIDDLE;
            cell.MinimumHeight       = 30;
            table.AddCell(cell);
            cell = new PdfPCell(new Phrase(sb.BuildUnit, contentfont));
            cell.HorizontalAlignment = PdfPCell.ALIGN_CENTER;
            cell.VerticalAlignment   = PdfPCell.ALIGN_MIDDLE;
            cell.MinimumHeight       = 30;
            table.AddCell(cell);

            cell = new PdfPCell(new Phrase("监测单位", namefont));
            cell.HorizontalAlignment = PdfPCell.ALIGN_CENTER;
            cell.VerticalAlignment   = PdfPCell.ALIGN_MIDDLE;
            cell.MinimumHeight       = 30;
            table.AddCell(cell);
            cell = new PdfPCell(new Phrase(sb.ObsUnit, contentfont));
            cell.HorizontalAlignment = PdfPCell.ALIGN_CENTER;
            cell.VerticalAlignment   = PdfPCell.ALIGN_MIDDLE;
            cell.MinimumHeight       = 30;
            table.AddCell(cell);

            cell = new PdfPCell(new Phrase("资料变更", namefont));
            cell.HorizontalAlignment = PdfPCell.ALIGN_CENTER;
            cell.VerticalAlignment   = PdfPCell.ALIGN_MIDDLE;
            cell.MinimumHeight       = 30;
            table.AddCell(cell);
            cell = new PdfPCell(new Phrase(sb.Datachg, contentfont));
            cell.HorizontalAlignment = PdfPCell.ALIGN_CENTER;
            //cell.VerticalAlignment = PdfPCell.ALIGN_MIDDLE;
            cell.MinimumHeight = 30;
            cell.Colspan       = (3); //合并列;
            table.AddCell(cell);

            cell = new PdfPCell(new Phrase("场地概况", namefont));
            cell.HorizontalAlignment = PdfPCell.ALIGN_CENTER;
            cell.VerticalAlignment   = PdfPCell.ALIGN_MIDDLE;
            cell.MinimumHeight       = 30;
            table.AddCell(cell);
            cell         = new PdfPCell(new Phrase(sb.SiteSituation, contentfont));
            cell.Colspan = (3); //合并列;
            table.AddCell(cell);

            cell = new PdfPCell(new Phrase("地质状况", namefont));
            cell.HorizontalAlignment = PdfPCell.ALIGN_CENTER;
            cell.VerticalAlignment   = PdfPCell.ALIGN_MIDDLE;
            cell.MinimumHeight       = 30;
            table.AddCell(cell);
            cell         = new PdfPCell(new Phrase(sb.GeoSituation, contentfont));
            cell.Colspan = (3); //合并列;
            table.AddCell(cell);

            cell = new PdfPCell(new Phrase("备注", namefont));
            cell.HorizontalAlignment = PdfPCell.ALIGN_CENTER;
            cell.VerticalAlignment   = PdfPCell.ALIGN_MIDDLE;
            cell.MinimumHeight       = 30;
            table.AddCell(cell);
            cell         = new PdfPCell(new Phrase(sb.Note, contentfont));
            cell.Colspan = (3); //合并列;
            table.AddCell(cell);

            try
            {
                cell = new PdfPCell(new Phrase("卫星图", namefont));
                cell.HorizontalAlignment = PdfPCell.ALIGN_CENTER;
                cell.VerticalAlignment   = PdfPCell.ALIGN_MIDDLE;
                cell.MinimumHeight       = 30;
                table.AddCell(cell);
                iTextSharp.text.Image imgremote = null;
                List <RemoteMapBean>  rblist    = RemotemapBll.Instance.GetWhere(new { sitecode = sb.SiteCode }).ToList();
                if (rblist.Count != 0)
                {
                    if (rblist[0].remotemap != null && rblist[0].remotemap.Length > 0)
                    {
                        imgremote = iTextSharp.text.Image.GetInstance(rblist[0].remotemap);
                        imgremote.ScaleToFit(200f, 200f);

                        cell                     = new PdfPCell(imgremote, false);
                        cell.Colspan             = (3); //合并列;
                        cell.MinimumHeight       = 220;
                        cell.HorizontalAlignment = PdfPCell.ALIGN_CENTER;
                        cell.VerticalAlignment   = PdfPCell.ALIGN_MIDDLE;
                        table.AddCell(cell);
                    }
                    else
                    {
                        imgremote = iTextSharp.text.Image.GetInstance(Application.StartupPath + "\\图片缓存\\noPic.png");
                        imgremote.ScaleToFit(50f, 50f);

                        cell                     = new PdfPCell(imgremote, false);
                        cell.Colspan             = (3); //合并列;
                        cell.MinimumHeight       = 60;
                        cell.HorizontalAlignment = PdfPCell.ALIGN_CENTER;
                        cell.VerticalAlignment   = PdfPCell.ALIGN_MIDDLE;
                        table.AddCell(cell);
                    }
                }
                else
                {
                    imgremote = iTextSharp.text.Image.GetInstance(Application.StartupPath + "\\图片缓存\\noPic.png");
                    imgremote.ScaleToFit(50f, 50f);

                    cell                     = new PdfPCell(imgremote, false);
                    cell.Colspan             = (3); //合并列;
                    cell.MinimumHeight       = 60;
                    cell.HorizontalAlignment = PdfPCell.ALIGN_CENTER;
                    cell.VerticalAlignment   = PdfPCell.ALIGN_MIDDLE;
                    table.AddCell(cell);
                }
            }
            catch
            { }

            try
            {
                cell = new PdfPCell(new Phrase("场地图", namefont));
                cell.HorizontalAlignment = PdfPCell.ALIGN_CENTER;
                cell.VerticalAlignment   = PdfPCell.ALIGN_MIDDLE;
                cell.MinimumHeight       = 30;
                table.AddCell(cell);
                iTextSharp.text.Image imglayout = null;
                List <LayoutmapBean>  lblist    = LayoutmapBll.Instance.GetWhere(new { sitecode = sb.SiteCode }).ToList();
                if (lblist.Count != 0)
                {
                    if (lblist[0].layoutmap != null && lblist[0].layoutmap.Length > 0)
                    {
                        imglayout = iTextSharp.text.Image.GetInstance(lblist[0].layoutmap);
                        imglayout.ScaleToFit(200f, 200f);

                        cell                     = new PdfPCell(imglayout, false);
                        cell.Colspan             = (3); //合并列;
                        cell.MinimumHeight       = 220;
                        cell.HorizontalAlignment = PdfPCell.ALIGN_CENTER;
                        cell.VerticalAlignment   = PdfPCell.ALIGN_MIDDLE;
                        table.AddCell(cell);
                    }
                    else
                    {
                        imglayout = iTextSharp.text.Image.GetInstance(Application.StartupPath + "\\图片缓存\\noPic.png");
                        imglayout.ScaleToFit(50f, 50f);

                        cell                     = new PdfPCell(imglayout, false);
                        cell.Colspan             = (3); //合并列;
                        cell.MinimumHeight       = 60;
                        cell.HorizontalAlignment = PdfPCell.ALIGN_CENTER;
                        cell.VerticalAlignment   = PdfPCell.ALIGN_MIDDLE;
                        table.AddCell(cell);
                    }
                }
                else
                {
                    imglayout = iTextSharp.text.Image.GetInstance(Application.StartupPath + "\\图片缓存\\noPic.png");
                    imglayout.ScaleToFit(50f, 50f);

                    cell                     = new PdfPCell(imglayout, false);
                    cell.Colspan             = (3); //合并列;
                    cell.MinimumHeight       = 60;
                    cell.HorizontalAlignment = PdfPCell.ALIGN_CENTER;
                    cell.VerticalAlignment   = PdfPCell.ALIGN_MIDDLE;
                    table.AddCell(cell);
                }
            }
            catch
            { }

            cell = new PdfPCell(new Phrase("其他情况", namefont));
            cell.HorizontalAlignment = PdfPCell.ALIGN_CENTER;
            cell.VerticalAlignment   = PdfPCell.ALIGN_MIDDLE;
            table.AddCell(cell);
            cell                     = new PdfPCell(new Phrase(sb.OtherSituation, contentfont));
            cell.Colspan             = (3); //合并列;
            cell.HorizontalAlignment = PdfPCell.ALIGN_CENTER;
            cell.VerticalAlignment   = PdfPCell.ALIGN_MIDDLE;
            cell.MinimumHeight       = 30;
            table.AddCell(cell);

            return(table);
        }
示例#10
0
 public int Update(SiteBean model)
 {
     return(SiteDal.Instance.Update(model));
 }
示例#11
0
        public int Add(SiteBean model)
        {
            //model = new SiteBean();

            return(SiteDal.Instance.Insert(model));
        }