コード例 #1
0
ファイル: F3205ApexSketchComp.cs プロジェクト: CSSAdmin/TScan
        /// <summary>
        ///F3205 pcget SketchLinks Exist.
        /// </summary>
        public static F3205ApexSketchData F3205pcgetSketchLinksExist(int parcelId, int userId)
        {
            F3205ApexSketchData getApexSketchData = new F3205ApexSketchData();
            Hashtable           ht = new Hashtable();

            ht.Add("@ParcelID", parcelId);
            ht.Add("@UserID", userId);
            Utility.LoadDataSet(getApexSketchData.F3205pcgetSketchLinksExist, "f3205_pcget_SketchLinksExist", ht);
            return(getApexSketchData);
        }
コード例 #2
0
ファイル: F3205ApexSketchComp.cs プロジェクト: CSSAdmin/TScan
        /// <summary>
        /// Saves the sketch Image Path.
        /// </summary>
        /// <param name="statementItems">The statement items.</param>
        /// <param name="userId">The userId.</param>
        /// <returns>typed dataset</returns>
        public static F3205ApexSketchData F3205pcinsSketchImage(int parcelId, int userId, int pageCount)
        {
            F3205ApexSketchData getApexSketchData = new F3205ApexSketchData();
            Hashtable           ht = new Hashtable();

            ht.Add("@ParcelID", parcelId);
            ht.Add("@UserID", userId);
            ht.Add("@PageCount", pageCount);
            Utility.LoadDataSet(getApexSketchData.F3205pcinsSketchImage, "f3205_pcins_SketchImage", ht);
            return(getApexSketchData);
        }
コード例 #3
0
ファイル: F3205.cs プロジェクト: CSSAdmin/TScan
 private void apexSketch_ApexSaveImage(object sender, int pageCount, bool apexSave)
 {
     try
     {
         if (!TerraScanCommon.IsFieldUser)
         {
             if (apexSave)
             {
                 this.ApexSketchData = this.form3205Controll.WorkItem.F3205pcinsSketchImage(this.keyId, TerraScanCommon.UserId, pageCount);
                 ////Re called the method to create thumnails by purushotham during Solving process TFS#19913 on 22Dec2013
                 this.createThumbNail();
             }
         }
     }
     catch (Exception ex)
     {
         ExceptionManager.ManageException(ex, ExceptionManager.ActionType.JustLog, this);
         MessageBox.Show("There was an error creating or updating the Sketch Image Attachment record. The rest of the Save process will proceed as normal. If this happens again, please contact T2 Support for further assistance.", "TerraScan T2 - Error Saving Sketch Image", MessageBoxButtons.OK, MessageBoxIcon.Warning);
     }
 }
コード例 #4
0
ファイル: F3205.cs プロジェクト: CSSAdmin/TScan
        /// <summary>
        /// Apexes the sketch_ apex form closed.
        /// </summary>
        /// <param name="sender">The sender.</param>
        /// <param name="apexData">The apex data.</param>
        /// <param name="pageCount">The page count.</param>
        ///
        private void apexSketch_ApexFormClosed(object sender, string apexData, int pageCount, bool apexSave)
        {
            try
            {
                ///Used to Store the Sketch data
                if (apexData != null && apexSave)
                {
                    this.form3205Controll.WorkItem.SaveApexSketch(apexData, this.keyId, TerraScanCommon.UserId);
                    //Called this method to create medium and short tumbnails Solves TFS#19913 by Purushotham on 22Dec2013
                    this.createThumbNail();
                    this.ApexSketchData = this.form3205Controll.WorkItem.F3205pcgetSketchLinksExist(this.keyId, TerraScanCommon.UserId);
                    if (this.ApexSketchData.F3205pcgetSketchLinksExist.Rows.Count > 0)
                    {
                        int  sketchLink;
                        bool sketchLinkExist = (this.ApexSketchData.F3205pcgetSketchLinksExist.Rows[0][0].ToString().Equals("1") ? true : false);
                        //sketchLinkExist =  this.ApexSketchData.F3205pcgetSketchLinksExist.Rows[0][0].ToString();
                        //bool.TryParse(this.ApexSketchData.F3205pcgetSketchLinksExist.Rows[0][0].ToString(), out sketchLinkExist);
                        if (!sketchLinkExist)
                        {
                            ///used to open the Sketch Link Form if Sketch Link does not exist
                            //   this.Cursor = Cursors.WaitCursor;
                            //  this.ParentForm.Close();
                            if (this.ShowForm != null)
                            {
                                object[] optionalParameter = { this.keyId };
                                FormInfo formInfo;
                                formInfo = TerraScanCommon.GetFormInfo(3201);
                                formInfo.optionalParameters    = new object[1];
                                formInfo.optionalParameters[0] = this.keyId;
                                this.ShowForm(this, new DataEventArgs <FormInfo>(formInfo));
                            }
                        }
                        else
                        {
                            ///used to call the execute Recalculate RCN Values for the form
                            string Result = this.form3205Controll.WorkItem.F3205_pcexeReCalcValues(TerraScanCommon.UserId, this.keyId);
                            if (!string.IsNullOrEmpty(Result))
                            {
                                object[] optionalParameter = { Result };
                                Form     SketchErrorMsg    = TerraScanCommon.GetForm(3299, optionalParameter, form3205Controll.WorkItem);//(3205, optionalParameter, this.form32012Control.WorkItem);
                                ////open form in view mode - possible to edit
                                if (SketchErrorMsg != null)
                                {
                                    SketchErrorMsg.ShowDialog();
                                }
                            }
                        }
                    }
                    this.WindowState   = FormWindowState.Minimized;
                    this.ShowInTaskbar = false;
                    if (apexSketch != null)
                    {
                        AxExchange2XControl1.AxExchange2X existingApex = (AxExchange2XControl1.AxExchange2X)apexSketch.Controls["apexExchange"];
                        this.ApexPanel.Controls.Remove(apexSketch);
                        apexSketch = null;
                        this.Close();
                    }
                }
                else
                if (apexData != null)
                {
                    if (apexSketch != null)
                    {
                        AxExchange2XControl1.AxExchange2X existingApex = (AxExchange2XControl1.AxExchange2X)apexSketch.Controls["apexExchange"];
                        this.ApexPanel.Controls.Remove(apexSketch);
                        apexSketch = null;
                        this.Close();
                    }

                    bool apexOpen = false;
                    F32012.IsApexOpened = false;
                    if (this.F9030_ApexOpenEvent != null)
                    {
                        this.F9030_ApexOpenEvent(this, new DataEventArgs <bool>(apexOpen));
                    }
                }
            }
            catch (Exception ex)
            {
                ExceptionManager.ManageException(ex, ExceptionManager.ActionType.JustLog, this);
                MessageBox.Show("The Apex Sketch Application has encountered an error and must close. If you receive this error message repeatedly, please contact T2 Support", "TerraScan T2 - Error in Apex Sketch", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
            finally
            {
                sketchCount = 0;
                apexSketch  = null;
            }
        }
コード例 #5
0
ファイル: F3205.cs プロジェクト: CSSAdmin/TScan
        private void F3205_Load(object sender, EventArgs e)
        {
            try
            {
                if (this.FormPermissionFields.openPermission)
                {
                    flagLoadOnProcess = true;
                    if (apexSketch != null)
                    {
                        AxExchange2XControl1.AxExchange2X existingApex = (AxExchange2XControl1.AxExchange2X)apexSketch.Controls["apexExchange"];
                        existingApex.CloseApex();
                    }
                    if (!TerraScanCommon.IsFieldUser)
                    {
                        this.ApexSketchData = this.form3205Controll.WorkItem.F3205pcgetSketchFilePath(this.keyId, TerraScanCommon.UserId);
                        if (this.ApexSketchData.F3205pcgetSketchFilePath.Rows.Count > 0)
                        {
                            string ApexFilePath = this.ApexSketchData.F3205pcgetSketchFilePath.Rows[0][0].ToString();
                            Uri    uriAddress2  = new Uri(ApexFilePath);
                            //FileInfo f = new FileInfo(ApexFilePath);
                            //if (!uriAddress2.IsLoopback)
                            //{
                            //    string[] path = ApexFilePath.Split('\\');
                            //    int length = path.Length;
                            //    int param = path[length - 1].Length;
                            //    int FileLength = ApexFilePath.Length;
                            //    if (length < 5)
                            //    {
                            //        MessageBox.Show("There was Error in Creating Apex File UNC File Path.", "TerraScan", MessageBoxButtons.OK, MessageBoxIcon.Information);
                            //    }
                            //    else
                            //    {
                            //        this.ApexPathFolder = ApexFilePath.Remove(FileLength - (param), param);
                            //        FileIOPermission f2 = new FileIOPermission(FileIOPermissionAccess.Write, this.ApexPathFolder);
                            //        f2.AllFiles = FileIOPermissionAccess.Write;
                            //        string Permission = f2.AllFiles.ToString();
                            //        if (Permission.Equals("NoAccess"))
                            //        {
                            //            MessageBox.Show("There was Error in Creating Apex File.", "TerraScan", MessageBoxButtons.OK, MessageBoxIcon.Information);
                            //        }
                            //        else
                            //        {
                            //            this.ApexPanel.Controls.Add(apexSketch);
                            //            apexSketch = new ApexSketch();
                            //            apexSketch.FilePath = this.ApexSketchData.F3205pcgetSketchFilePath.Rows[0][0].ToString();
                            //            sketchCount = 1;
                            //            apexSketch.ApexSaveImage += new ApexSketch.SaveImageHandler(apexSketch_ApexSaveImage);
                            //            apexSketch.ApexFormClosed += new ApexSketch.CloseEventHandler(apexSketch_ApexFormClosed);
                            //            flagLoadOnProcess = false;
                            //        }
                            //    }

                            //}
                            //else
                            //{
                            if (!uriAddress2.IsLoopback)
                            {
                                string[] path       = ApexFilePath.Split('\\');
                                int      length     = path.Length;
                                int      param      = path[length - 1].Length;
                                int      FileLength = ApexFilePath.Length;
                                if (length < 5)
                                {
                                    MessageBox.Show("There was Error in Creating Apex File UNC File Path.", "TerraScan T2", MessageBoxButtons.OK, MessageBoxIcon.Information);
                                }
                                else
                                {
                                    this.ApexPathFolder = ApexFilePath;
                                    this.ApexPathFolder = ApexFilePath.Remove(FileLength - (param + 1), param + 1);
                                    bool permission = HasWritePermissionOnDir(this.ApexPathFolder);
                                    if (permission)
                                    {
                                        this.ApexPanel.Controls.Add(apexSketch);
                                        apexSketch                 = new ApexSketch();
                                        apexSketch.FilePath        = this.ApexSketchData.F3205pcgetSketchFilePath.Rows[0][0].ToString();
                                        sketchCount                = 1;
                                        apexSketch.ApexSaveImage  += new ApexSketch.SaveImageHandler(apexSketch_ApexSaveImage);
                                        apexSketch.ApexFormClosed += new ApexSketch.CloseEventHandler(apexSketch_ApexFormClosed);
                                        apexSketch.InterLogEvent  += new ApexSketch.InterruptEventLogging(apexSketch_InterLogEvent);
                                        flagLoadOnProcess          = false;

                                        // Code added to dispose object to avoid exception on immediate close on apex load
                                        // while trying to close apex without its initialization completes
                                        if (((AxExchange2XControl1.AxExchange2X)apexSketch.Controls["apexExchange"]).ApplicationStatus != null &&
                                            ((AxExchange2XControl1.AxExchange2X)apexSketch.Controls["apexExchange"]).ApplicationStatus.ToUpper().Equals("CLOSED"))
                                        {
                                            AxExchange2XControl1.AxExchange2X existingApex = (AxExchange2XControl1.AxExchange2X)apexSketch.Controls["apexExchange"];
                                            this.ApexPanel.Controls.Remove(apexSketch);
                                            apexSketch = null;
                                            this.Close();
                                        }
                                    }
                                }
                            }
                        }
                    }
                    else
                    {
                        this.ApexSketchData = this.form3205Controll.WorkItem.F3205pcgetSketchFilePath(this.keyId, TerraScanCommon.UserId);
                        if (this.ApexSketchData.F3205pcgetSketchFilePath.Rows.Count > 0)
                        {
                            string ApexFilePath = this.ApexSketchData.F3205pcgetSketchFilePath.Rows[0][0].ToString();
                            string SpecialPath  = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData);
                            string tempPath1    = SpecialPath + @"\Terrascan Attachment\Apex Path\" + ApexFilePath;
                            this.ApexPathFolder = SpecialPath + @"\Terrascan Attachment\Apex Path";
                            this.ApexPanel.Controls.Add(apexSketch);
                            apexSketch                 = new ApexSketch();
                            apexSketch.FilePath        = tempPath1;
                            sketchCount                = 1;
                            apexSketch.ApexSaveImage  += new ApexSketch.SaveImageHandler(apexSketch_ApexSaveImage);
                            apexSketch.ApexFormClosed += new ApexSketch.CloseEventHandler(apexSketch_ApexFormClosed);
                            apexSketch.InterLogEvent  += new ApexSketch.InterruptEventLogging(apexSketch_InterLogEvent);
                            flagLoadOnProcess          = false;

                            // Code added to dispose object to avoid exception on immediate close on apex load
                            // while trying to close apex without its initialization completes
                            if (((AxExchange2XControl1.AxExchange2X)apexSketch.Controls["apexExchange"]).ApplicationStatus != null &&
                                ((AxExchange2XControl1.AxExchange2X)apexSketch.Controls["apexExchange"]).ApplicationStatus.ToUpper().Equals("CLOSED"))
                            {
                                AxExchange2XControl1.AxExchange2X existingApex = (AxExchange2XControl1.AxExchange2X)apexSketch.Controls["apexExchange"];
                                this.ApexPanel.Controls.Remove(apexSketch);
                                apexSketch = null;
                                this.Close();
                            }
                        }
                    }
                }
            }


            catch (Exception ex)
            {
                if (ex.Message.Equals("Method failed with unexpected error code 53."))
                {
                    MessageBox.Show("Please provide the specific Network path to create apex file", "Terrascan T2", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                }
                else if (ex.Message.Equals("Attempted to perform an unauthorized operation."))
                {
                    MessageBox.Show("Please provide the folder permission to create apex file", "Terrascan T2", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                }
                else
                {
                    ExceptionManager.ManageException(ex, ExceptionManager.ActionType.JustLog, this);
                    MessageBox.Show("There was an error launching the Apex Sketch module. It may not have been installed properly. Please contact T2 Support for further assistance.", "TerraScan – Error opening Apex", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    this.Close();
                }
            }
        }