Ejemplo n.º 1
0
 private void button1_Click(object sender, EventArgs e)
 {
     if (this.listViewEx1.SelectedItems.Count > 0)
     {
         ListViewItem item = this.listViewEx1.SelectedItems[0];
         AppManager   am   = AppManager.GetInstance();
         MainForm     mf   = am.AppForm;
         if (item.SubItems[4].Text == "上传")
         {
             mf.ChangeToCheckInVersion(item.SubItems[0].Text);
         }
         else if (item.SubItems[4].Text == "下发")
         {
             mf.ChangeToCheckOutVerstion(item.SubItems[0].Text);
         }
         else if (item.SubItems[4].Text == "监理已检查")
         {
             mf.ChangeToCheckInVersion(item.SubItems[0].Text);
         }
         else
         {
             mf.ChangeToArchivedVersion(item.SubItems[0].Text, item.SubItems[5].Text);
         }
         this.Close();
     }
 }
Ejemplo n.º 2
0
        private void backgroundWorker1_DoWork(object sender, DoWorkEventArgs e)
        {
            SDECheckerManager cm = SDECheckerManager.GetInstance();
            AppManager        am = AppManager.GetInstance();

            cm.Check(am.TaskName, cbxCheckPartial.Checked);
        }
Ejemplo n.º 3
0
        private void MainForm_Load(object sender, EventArgs e)
        {
            string mappath = Properties.Settings.Default.MapDoc;
            bool   isMap   = this.axMapControl1.CheckMxFile(mappath);

            if (isMap)
            {
                this.axMapControl1.LoadMxFile(mappath);
                this.axMapControl2.LoadMxFile(mappath);
            }
            for (int i = 0; i < axMapControl2.LayerCount; i++)
            {
                ILayer   lyr = axMapControl2.get_Layer(i);
                IVersion ver = GetMapVersion(lyr);
                if (ver != null)
                {
                    AppManager am = AppManager.GetInstance();
                    am.CurrentVersion = ver;
                    break;
                }
            }

            CheckOutTool tool = new CheckOutTool();

            idx = this.axToolbarControl1.AddItem(tool);
        }
Ejemplo n.º 4
0
        public void ChangeToArchivedVersion(string taskName, string timeStamp)
        {
            this.superTabControl1.SelectedTabIndex = 1;
            IHistoricalWorkspace   hws  = Util.ServerWorkspace as IHistoricalWorkspace;
            IVersionedWorkspace    vws  = hws as IVersionedWorkspace;
            DateTime               ts   = DateTime.Parse(timeStamp);
            IHistoricalVersion     ver  = hws.FindHistoricalVersionByTimeStamp(ts);
            IMapAdmin3             ma   = this.axMapControl2.Map as IMapAdmin3;
            IBasicMap              bmap = this.axMapControl2.Map as IBasicMap;
            AppManager             am   = AppManager.GetInstance();
            IChangeDatabaseVersion cdv  = new ChangeDatabaseVersionClass();

            if (am.CurrentVersion == null)
            {
                ma.FireChangeVersion(vws.DefaultVersion, ver as IVersion);
                cdv.Execute(vws.DefaultVersion, ver as IVersion, bmap);
            }
            else
            {
                ma.FireChangeVersion(am.CurrentVersion, ver as IVersion);
                cdv.Execute(am.CurrentVersion, ver as IVersion, bmap);
            }
            am.CurrentVersion = ver as IVersion;
            am.TaskName       = taskName;

            LocateTask(taskName);
            SetUpdateGridList(taskName);
        }
Ejemplo n.º 5
0
        static void Main()
        {
            //RuntimeManager.Bind(ProductCode.Desktop);
            //ESRI License Initializer generated code.
            if (!m_AOLicenseInitializer.InitializeApplication(new esriLicenseProductCode[] { esriLicenseProductCode.esriLicenseProductCodeEngineGeoDB },
                                                              new esriLicenseExtensionCode[] { }))
            {
                System.Windows.Forms.MessageBox.Show(m_AOLicenseInitializer.LicenseMessage() +
                                                     "\n\nThis application could not initialize with the correct ArcGIS license and will shutdown.",
                                                     "ArcGIS License Failure");
                m_AOLicenseInitializer.ShutdownApplication();
                Application.Exit();
                return;
            }
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            AppManager am = AppManager.GetInstance();
            MainForm   mf = new MainForm();

            am.AppForm = mf;
            Application.Run(am.AppForm);

            //ESRI License Initializer generated code.
            //Do not make any call to ArcObjects after ShutDownApplication()
            m_AOLicenseInitializer.ShutdownApplication();
        }
Ejemplo n.º 6
0
 private void button6_Click(object sender, EventArgs e)
 {
     if (lbxLog.SelectedItem != null)
     {
         CheckError error = lbxLog.SelectedItem as CheckError;
         if (error.Locations != null && error.Locations.Count > 0)
         {
             AppManager am = AppManager.GetInstance();
             am.AppForm.LocateCheckError(error.Locations[0]);
         }
     }
 }
Ejemplo n.º 7
0
        private void backgroundWorker1_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
        {
            MdbCheckerManager cm = MdbCheckerManager.GetInstance();

            lbxLog.DataSource    = cm.Errors;
            lblProblemCount.Text = cm.Errors.Count.ToString();
            lblRecordCount.Text  = cm.CheckItemCount.ToString();
            tbxLog.Lines         = m_log;
            AppManager am = AppManager.GetInstance();

            am.AppForm.LoadLayers(cm.CheckItems.Keys.ToList());
            this.progressBar1.Visible = false;
        }
Ejemplo n.º 8
0
        private void SetLayerDefinition(ILayer lyr)
        {
            if (lyr is ICompositeLayer)
            {
                ICompositeLayer comlyr = lyr as ICompositeLayer;
                for (int j = 0; j < comlyr.Count; j++)
                {
                    ILayer lyr2 = comlyr.get_Layer(j);
                    SetLayerDefinition(lyr2);
                }
            }
            else
            {
                switch (lyr.Name.Trim().ToLower())
                {
                case "checkitemptn":
                case "checkitemln":
                case "checkitempoly":
                case "checkarea":
                    if (lyr is IFeatureLayerDefinition2)
                    {
                        IFeatureLayerDefinition2 flyrd = lyr as IFeatureLayerDefinition2;
                        flyrd.DefinitionExpression = "VersionName = '" + AppManager.GetInstance().TaskName + "'";
                    }
                    break;

                case "passedgrid":
                    if (lyr is IFeatureLayerDefinition2)
                    {
                        IFeatureLayerDefinition2 flyrd = lyr as IFeatureLayerDefinition2;
                        flyrd.DefinitionExpression = "passed =1 and TaskName='" + AppManager.GetInstance().TaskName + "'";
                    }
                    break;

                case "updategrid":
                    if (lyr is IFeatureLayerDefinition2)
                    {
                        IFeatureLayerDefinition2 flyrd = lyr as IFeatureLayerDefinition2;
                        flyrd.DefinitionExpression = "passed is null and TaskName='" + AppManager.GetInstance().TaskName + "'";
                    }
                    break;

                default:
                    break;
                }
            }
        }
Ejemplo n.º 9
0
        //提交
        private void buttonItem9_Click(object sender, EventArgs e)
        {
            DialogResult res = MessageBox.Show("是否提交任务", "任务提交", MessageBoxButtons.YesNo);

            if (res == DialogResult.Yes)
            {
                this.buttonItem9.Enabled = false;
                AppManager am = AppManager.GetInstance();
                string     postVersionName = am.CurrentVersion.VersionName;
                string[]   versionfullName = postVersionName.Split('.');
                this.ChangeToDefaultVersion();
                TaskManager tm = TaskManager.GetInstance();
                tm.FinishTask(versionfullName[versionfullName.Length - 1]);
                this.buttonItem9.Enabled = true;
                MessageBox.Show("提交成功!");
            }
        }
Ejemplo n.º 10
0
        public void ChangeToCheckOutVerstion(string versionName)
        {
            this.superTabControl1.SelectedTabIndex = 1;
            IVersionedWorkspace    vws  = Util.ServerWorkspace as IVersionedWorkspace;
            IVersion               ver  = vws.DefaultVersion;
            IMapAdmin3             ma   = this.axMapControl2.Map as IMapAdmin3;
            IBasicMap              bmap = this.axMapControl2.Map as IBasicMap;
            AppManager             am   = AppManager.GetInstance();
            IChangeDatabaseVersion cdv  = new ChangeDatabaseVersionClass();

            ma.FireChangeVersion(am.CurrentVersion, ver);
            cdv.Execute(am.CurrentVersion, ver, bmap);

            am.CurrentVersion = ver;
            am.TaskName       = versionName;

            LocateTask(versionName);
        }
Ejemplo n.º 11
0
        private void QCReportForm_Load(object sender, EventArgs e)
        {
            AppManager    am       = AppManager.GetInstance();
            string        taskName = am.TaskName;
            TaskManager   tm       = TaskManager.GetInstance();
            List <string> infos    = tm.GetTaskInfoDetail(taskName);

            if (infos.Count != 0)
            {
                this.tbxTaskName.Text     = infos[0];
                this.tbxDept.Text         = infos[1];
                this.tbxCheckComment.Text = infos[2];
                this.tbxUpdateItems.Text  = infos[3];
                this.tbxAddItems.Text     = infos[4];
                this.tbxDeleteItems.Text  = infos[5];
                this.tbxUpdateGrids.Text  = infos[6];
                this.tbxUpdateArea.Text   = infos[7];
                this.tbxCheckedGrids.Text = tm.GetPassedUpdateGrids(taskName).ToString();
            }
        }
Ejemplo n.º 12
0
        public void ChangeToDefaultVersion()
        {
            IVersionedWorkspace    vws  = Util.ServerWorkspace as IVersionedWorkspace;
            IVersion               ver  = vws.DefaultVersion;
            IMapAdmin3             ma   = this.axMapControl2.Map as IMapAdmin3;
            IBasicMap              bmap = this.axMapControl2.Map as IBasicMap;
            AppManager             am   = AppManager.GetInstance();
            IChangeDatabaseVersion cdv  = new ChangeDatabaseVersionClass();

            cdv.Execute(am.CurrentVersion, ver, bmap);

            am.CurrentVersion = ver;
            am.TaskName       = "";

            IGraphicsContainer gcon = this.axMapControl2.ActiveView.GraphicsContainer;

            gcon.DeleteAllElements();
            this.axMapControl2.Refresh(esriViewDrawPhase.esriViewGraphics, null, null);
            this.lstGrids.Items.Clear();
        }
Ejemplo n.º 13
0
 private void button2_Click(object sender, EventArgs e)
 {
     if (this.listViewEx1.SelectedItems.Count > 0)
     {
         ListViewItem item = this.listViewEx1.SelectedItems[0];
         DialogResult dres = MessageBox.Show("是否确定取消选中任务", "取消任务", MessageBoxButtons.OKCancel);
         if (dres == DialogResult.OK)
         {
             string     taskName = item.SubItems[0].Text;
             AppManager am       = AppManager.GetInstance();
             if (am.CurrentVersion.VersionName == taskName)
             {
                 MainForm mf = am.AppForm;
                 mf.ChangeToDefaultVersion();
             }
             TaskManager tm = TaskManager.GetInstance();
             tm.DeleteTask(item.SubItems[0].Text);
             am.TaskName = "";
             FillterTasks();
         }
     }
 }