コード例 #1
0
        void Carrega(Principal _principal, PropietarisManager _propietaris_manager, PointsManager _points_manager,
                     ServerManager _server_manager, UIManager _ui_manager)
        {
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode       = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize          = new System.Drawing.Size(970, 465);
            this.Name  = "Analítiques";
            this.Text  = this.Name;
            this.Load += new System.EventHandler(this.Form5_Load);
            this.ResumeLayout(false);
            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
            this.MaximizeBox     = false;
            this.MinimizeBox     = false;

            // Set Managers ----------------------
            propietaris_manager = _propietaris_manager;
            point_manager       = _points_manager;
            server_manager      = _server_manager;
            ui_manager          = _ui_manager;
            principal           = _principal;
            // -----------------------------------

            // UI --------------------------------
            LoadUI();
            // -----------------------------------
        }
コード例 #2
0
ファイル: Analitiques.cs プロジェクト: Guillemsc/GisAnaWin
 public Analitiques(Principal principal, PropietarisManager _propietaris_manager, PointsManager _points_manager, ServerManager _server_manager, UIManager _ui_manager)
 {
     InitializeComponent();
     Carrega(principal, _propietaris_manager, _points_manager, _server_manager, _ui_manager);
 }
コード例 #3
0
        // Load
        void Carrega()
        {
            //
            // gmap
            //
            this.gmap.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
                                                                      | System.Windows.Forms.AnchorStyles.Left)
                                                                     | System.Windows.Forms.AnchorStyles.Right)));
            this.gmap.AutoSize                 = true;
            this.gmap.BackColor                = System.Drawing.SystemColors.ControlLightLight;
            this.gmap.Bearing                  = 0F;
            this.gmap.CanDragMap               = true;
            this.gmap.EmptyTileColor           = System.Drawing.Color.AliceBlue;
            this.gmap.GrayScaleMode            = false;
            this.gmap.HelperLineOption         = GMap.NET.WindowsForms.HelperLineOptions.DontShow;
            this.gmap.LevelsKeepInMemmory      = 5;
            this.gmap.MarkersEnabled           = true;
            this.gmap.MaximumSize              = new System.Drawing.Size(10000, 10000);
            this.gmap.MaxZoom                  = 23;
            this.gmap.MinZoom                  = 2;
            this.gmap.MouseWheelZoomEnabled    = true;
            this.gmap.EmptyTileText            = "No es pot carregar";
            this.gmap.IgnoreMarkerOnMouseWheel = true;
            this.gmap.MouseWheelZoomType       = GMap.NET.MouseWheelZoomType.MousePositionWithoutCenter;
            this.gmap.Name                  = "gmap";
            this.gmap.NegativeMode          = false;
            this.gmap.PolygonsEnabled       = true;
            this.gmap.RetryLoadTile         = 2;
            this.gmap.RoutesEnabled         = false;
            this.gmap.ScaleMode             = GMap.NET.WindowsForms.ScaleModes.Fractional;
            this.gmap.SelectedAreaFillColor = System.Drawing.Color.FromArgb(((int)(((byte)(33)))), ((int)(((byte)(65)))), ((int)(((byte)(105)))), ((int)(((byte)(225)))));
            this.gmap.ShowTileGridLines     = false;
            this.gmap.Location              = new System.Drawing.Point(232, 0);
            this.gmap.Size                  = new System.Drawing.Size(580, 600);
            this.gmap.TabIndex              = 0;
            this.gmap.Zoom                  = 14D;
            this.gmap.OnMarkerClick        += new GMap.NET.WindowsForms.MarkerClick(this.gmap_MarkerClick);
            this.gmap.OnPolygonClick       += new GMap.NET.WindowsForms.PolygonClick(this.gmap_PoligonClick);
            this.gmap.OnPolygonEnter       += new GMap.NET.WindowsForms.PolygonEnter(this.gmap_PoligonEnter);
            this.gmap.OnPolygonLeave       += new GMap.NET.WindowsForms.PolygonLeave(this.gmap_PoligonOut);
            this.gmap.DoubleClick          += new System.EventHandler(this.gmap_DoubleClick);
            this.gmap.OnMapDrag            += new GMap.NET.MapDrag(this.UpdateLatLon);
            this.gmap.MouseUp              += new System.Windows.Forms.MouseEventHandler(this.gmap_MouseClick);
            //
            // Form1
            //
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode       = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize          = new System.Drawing.Size(800, 581); // 800, 581
            this.Controls.Add(this.gmap);
            this.MinimumSize = new System.Drawing.Size(815, 606);         // 816, 606
            this.Name        = "Gis AnaWin";
            this.Text        = this.Name;
            this.ResumeLayout(false);
            this.PerformLayout();

            // Managers --------------------------
            point_manager       = new PointsManager(gmap);
            propietaris_manager = new PropietarisManager();
            ui_manager          = new UIManager(this);
            id_manager          = new IDManager();
            server_manager      = new ServerManager();
            // -----------------------------------

            // Server config ---------------------
            XDocument xdoc       = XDocument.Load(AppDomain.CurrentDomain.BaseDirectory + "Config" + Environment.UserName + ".xml");
            XElement  connection = xdoc.Element("Configuracion").Element("ServidorPrograma");
            XElement  empresa    = xdoc.Element("Configuracion").Element("EmpresaInfo");

            string id        = connection.Element("Id").Value;
            string server    = connection.Element("Server").Value;
            string data_base = connection.Element("DataBase").Value;
            string user      = connection.Element("User").Value;
            string pass      = connection.Element("Password").Value;

            UpdateConnectionConfig(server, data_base, user, pass);

            this.Text += (" (" + data_base + ")");

            propietaris_manager.empresa_nom = empresa.Element("Nom").Value;
            // -----------------------------------

            // Gmap ------------------------------
            gmap.MapProvider             = GMap.NET.MapProviders.GoogleSatelliteMapProvider.Instance;
            GMap.NET.GMaps.Instance.Mode = GMap.NET.AccessMode.ServerAndCache;
            gmap.SetPositionByKeywords("Batea, España");
            gmap.ShowCenter = false;
            // -----------------------------------

            // UI --------------------------------
            LoadUI();
            text_input_nom.SetText("Batea, España");
            // -----------------------------------

            // Carrega info ----------------------
            if (server_manager.CheckServerConnection())
            {
                Console.WriteLine("----------------------------------");
                ActualitzaPropietarisDesDeServidor();
                ActualitzaFinquesDesDeServidor();
                ActualitzaVarietatsDesDeServidor();
                ActualitzaTreballsDesDeServidor();
                ActualitzaParcelesDesDeServidor();
                ActualitzaPartesDesDeServidor();
                ActualitzaPartesLineaDesDeServidor();
                ActualitzaAnalitiquesDesDeServidor();
                ActualitzaTreballsDesDeServidor();
                ActualitzaUnitatsMetriquesDesDeServidor();
                ActualitzaMaquinariaDesDeServidor();
                ActualitzaPersonalDesDeServidor();
                ActualitzaAdobsDesDeServidor();

                ActualitzaLlistaParceles();

                UpdateLatLon();
            }

            gmap.ZoomAndCenterMarkers(point_manager.overlay_finca.Id);
            // -----------------------------------

            // Forms -----------------------------
            crea_parte_form             = new AfegirPartes(this, propietaris_manager, point_manager, server_manager, ui_manager);
            crea_parte_form.FormClosed += new System.Windows.Forms.FormClosedEventHandler(CreaParteTanca);

            info_parte_form             = new ModificaPartes(this, propietaris_manager, point_manager, server_manager, ui_manager);
            info_parte_form.FormClosed += new System.Windows.Forms.FormClosedEventHandler(InfoParteTanca);

            report_viewer_form = new Imprimir();

            visualitza_analitica_form = new Analitiques(this, propietaris_manager, point_manager, server_manager, ui_manager);

            quadern_camp_form = new Forms.QuadernCamp();

            configura_quadern_camp_form = new Forms.ConfiguraQuadernCamp(this, propietaris_manager, point_manager, server_manager, ui_manager, quadern_camp_form);

            personal_form = new Forms.Perso(this, propietaris_manager, point_manager, server_manager, ui_manager);

            maquinaria_form = new Forms.Maquinaria(this, propietaris_manager, point_manager, server_manager, ui_manager);

            adobats_form = new Forms.Adobats(this, propietaris_manager, point_manager, server_manager, ui_manager);
            // -----------------------------------

            this.MinimumSize = new System.Drawing.Size(1027, 606);
        }
コード例 #4
0
 public AfegirPartes(Principal principal, PropietarisManager propietaris_manager, PointsManager points_manager, ServerManager server_manager, UIManager ui_manager)
 {
     InitializeComponent();
     Carrega(principal, propietaris_manager, points_manager, server_manager, ui_manager);
 }