Example #1
0
        private void catalogForm_ApexFormOpened(object sender, string filePath)
        {
            if (!IsApexOpened)
            {
                //    IsApexOpened = true;
                //catalogForm.DisableSketch(true);
                if (apexForm != null)
                {
                    //  MessageBox.Show("Please Close the previous apex before opening new sketch", "Terrascan", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    ((F3205)apexForm).CloseSketch();
                }

                //catalogForm.DisableSketch(true);

                object[] optionalParameter = { this.ParcelId };
                apexForm = TerraScanCommon.GetForm(3205, optionalParameter, this.form32012Control.WorkItem);//(3205, optionalParameter, this.form32012Control.WorkItem);
                ////open form in view mode - possible to edit
                if (apexForm != null)
                {
                    apexForm.Show();
                }


                //catalogForm.DisableSketch(true);

                IsApexOpened = true;

                this.F9030_ApexOpenEvent(this, new DataEventArgs <bool>(true));
            }
        }
        /// <summary>
        /// Handles the Click event of the CommentButton control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="T:System.EventArgs"/> instance containing the event data.</param>
        private void CommentButton_Click(object sender, EventArgs e)
        {
            //// this.CommentButtonClick(this, new DataEventArgs<string>(string.Empty));

            try
            {
                this.Cursor = Cursors.WaitCursor;
                object[] optionalParameter;
                int      currentCommentForm;
                if (this.commentFormIdDiffers)
                {
                    currentCommentForm = this.commentFormId;
                }
                else
                {
                    currentCommentForm = this.currentFormId;
                }

                if (Convert.ToBoolean(TerraScanCommon.GetFormInfo(currentCommentForm).openPermission))
                {
                    optionalParameter = new object[] { currentCommentForm, this.keyId, this.parentFormId };

                    Form commentForm = new Form();
                    commentForm     = TerraScanCommon.GetForm(9075, optionalParameter, this.ParentWorkItem);
                    commentForm.Tag = currentCommentForm;

                    if (commentForm != null)
                    {
                        commentForm.ShowDialog();

                        // Code Need to be Modified to Set the Text For Attachmnent/Comment Button (Get the Count,Flag From Attachment/Comment Form Makin Public Propertis.
                        AdditionalOperationCountEntity additionalOperationCountEnt;
                        additionalOperationCountEnt = new AdditionalOperationCountEntity(-999, -999, false);
                        additionalOperationCountEnt.CommentCount = Convert.ToInt16(TerraScanCommon.GetValue(commentForm, "CommentCount"));
                        additionalOperationCountEnt.HighPriority = Convert.ToBoolean(TerraScanCommon.GetValue(commentForm, "HighPriorityFlag"));
                        this.SetText(additionalOperationCountEnt);
                    }
                }
                else
                {
                    MessageBox.Show(SharedFunctions.GetResourceString("OpenPermission"), ConfigurationWrapper.ApplicationName, MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
            }
            catch (Exception ex)
            {
                ExceptionManager.ManageException(ex, ExceptionManager.ActionType.Display, this.ParentForm);
            }
            finally
            {
                this.Cursor = Cursors.Default;
            }
        }
Example #3
0
        private void Districbutton_Click(object sender, EventArgs e)
        {
            try
            {
                Form     districtF15122    = new Form();
                object[] optionalParameter = new object[] { this.rollYear, this.ParentFormId };
                districtF15122 = TerraScanCommon.GetForm(1512, optionalParameter, this.form1024Control.WorkItem);

                DialogResult districtDialog;
                if (districtF15122 != null)
                {
                    districtDialog = districtF15122.ShowDialog();

                    if (districtDialog == DialogResult.OK)
                    {
                        try
                        {
                            this.districtId = TerraScanCommon.GetValue(districtF15122, "DistrictId");
                            int selectedDistrictId = 0;
                            if (this.districtId != null && !string.IsNullOrEmpty(this.districtId))
                            {
                                int.TryParse(this.districtId, out selectedDistrictId);
                            }

                            F1512DistrictSelectionData districtSlectionDataset = this.form1024Control.WorkItem.F1204_GetDistrictSelectionData(selectedDistrictId, "", "", -999);

                            if (districtSlectionDataset.ListDistrictSelection.Rows.Count > 0)
                            {
                                this.DistrictTextBox.Text = districtSlectionDataset.ListDistrictSelection.Rows[0][districtSlectionDataset.ListDistrictSelection.DistrictColumn].ToString() + " - " + districtSlectionDataset.ListDistrictSelection.Rows[0][districtSlectionDataset.ListDistrictSelection.DescriptionColumn].ToString();
                            }
                            this.LoadSubGrid(this.districtId);
                        }
                        catch (Exception ex)
                        {
                            ExceptionManager.ManageException(SharedFunctions.GetResourceString("ErrorLoadingForm"), ex, ExceptionManager.ActionType.Display, this.ParentForm);
                        }
                    }
                }
            }
            catch (Exception e1)
            {
                ExceptionManager.ManageException(e1, ExceptionManager.ActionType.CloseCurrentForm, this.ParentForm);
            }
            finally
            {
                this.Cursor = Cursors.Default;
            }
        }
Example #4
0
        /// <summary>
        /// Shows the queryUtility form on query UtilityButton Click.- called from smartpart used this
        /// </summary>
        public void ShowQueryUtilityForm()
        {
            object[] optionalParameter = new object[] { this.toolBoxEntity.CurrentFormId, this.toolBoxEntity.WhereCondition, this.toolBoxEntity.UserDefinedWhereCondition };
            ////9050 - query utility form
            Form query = TerraScanCommon.GetForm(9050, optionalParameter, this.toolBoxEntity.ParentWorkItem);

            if (query != null && query.ShowDialog() == DialogResult.Yes)
            {
                this.toolBoxEntity.CalledFormStatus          = true;
                this.toolBoxEntity.KeyId                     = Convert.ToInt32(TerraScanCommon.GetValue(query, "QueryId"));
                this.toolBoxEntity.WhereCondition            = TerraScanCommon.GetValue(query, "WhereCondition");
                this.toolBoxEntity.UserDefinedWhereCondition = TerraScanCommon.GetValue(query, "UserWhereCondition");
            }
            else
            {
                this.toolBoxEntity.CalledFormStatus = false;
            }
        }
Example #5
0
        /// <summary>
        /// Shows the SnapshotUtility form on Snapshot UtilityButton Click.- called from smartpart used this
        /// </summary>
        public void ShowSnapshotUtilityForm()
        {
            object[] optionalParameter = new object[] { this.toolBoxEntity.CurrentFormId, this.toolBoxEntity.SnapshotIdXmlString, this.toolBoxEntity.SnapshotCount };
            ////9051 - snapshot utility form
            Form snapshot = TerraScanCommon.GetForm(9051, optionalParameter, this.toolBoxEntity.ParentWorkItem);

            if (snapshot != null && snapshot.ShowDialog() == DialogResult.Yes)
            {
                this.toolBoxEntity.CalledFormStatus    = true;
                this.toolBoxEntity.KeyId               = Convert.ToInt32(TerraScanCommon.GetValue(snapshot, "SnapShotId"));
                this.toolBoxEntity.SnapshotName        = TerraScanCommon.GetValue(snapshot, "SnapshotName");
                this.toolBoxEntity.SnapshotDescription = TerraScanCommon.GetValue(snapshot, "SnapshotDescription");
            }
            else
            {
                this.toolBoxEntity.CalledFormStatus = false;
            }
        }
Example #6
0
        /// <summary>
        /// Shows the requery form on Filtered Button Click.
        /// </summary>
        public void ShowRequeryForm()
        {
            ////shows form
            if (this.statusBarEntity.CalledForm == null)
            {
                ////9052 - requery form
                this.statusBarEntity.CalledForm = TerraScanCommon.GetForm(9052, this.statusBarEntity.OptionalInputParameter, this.statusBarEntity.ParentWorkItem);
            }

            if (this.statusBarEntity.CalledForm != null && this.statusBarEntity.CalledForm.ShowDialog() == DialogResult.Yes)
            {
                this.statusBarEntity.CalledFormStatus          = true;
                this.statusBarEntity.WhereCondition            = TerraScanCommon.GetValue(this.statusBarEntity.CalledForm, "CurrentQueryWhereCondition");
                this.statusBarEntity.UserDefinedWhereCondition = TerraScanCommon.GetValue(this.statusBarEntity.CalledForm, "UserDefinedWhereCondition");
            }
            else
            {
                this.statusBarEntity.CalledFormStatus = false;
                this.statusBarEntity.CalledForm       = null;
            }
        }
        /// <summary>
        /// Handles the Click event of the AttachmentButton control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="T:System.EventArgs"/> instance containing the event data.</param>
        private void AttachmentButton_Click(object sender, EventArgs e)
        {
            try
            {
                this.Cursor = Cursors.WaitCursor;
                object[] optionalParameter = new object[] { this.currentFormId, this.keyId, this.parentFormId };

                Form attachmentForm = new Form();
                //attachmentForm.Icon = @"D:\Workarea\TerraScan-T.ico";
                if (Convert.ToBoolean(TerraScanCommon.GetFormInfo(this.currentFormId).openPermission))
                {
                    attachmentForm     = TerraScanCommon.GetForm(9005, optionalParameter, this.ParentWorkItem);
                    attachmentForm.Tag = this.currentFormId;
                    if (attachmentForm != null)
                    {
                        attachmentForm.ShowDialog();

                        // Code Need to be Modified to Set the Text For Attachmnent/Comment Button (Get the Count,Flag From Attachment/Comment Form Makin Public Propertis.
                        AdditionalOperationCountEntity additionalOperationCountEnt;
                        additionalOperationCountEnt = new AdditionalOperationCountEntity(-999, -999, false);
                        additionalOperationCountEnt.AttachmentCount = Convert.ToInt16(TerraScanCommon.GetValue(attachmentForm, "AttachmentCount"));
                        this.SetText(additionalOperationCountEnt);
                    }
                }
                else
                {
                    MessageBox.Show(SharedFunctions.GetResourceString("OpenPermission"), ConfigurationWrapper.ApplicationName, MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
            }
            catch (Exception ex)
            {
                ExceptionManager.ManageException(ex, ExceptionManager.ActionType.Display, this.ParentForm);
            }
            finally
            {
                this.Cursor = Cursors.Default;
            }
        }
Example #8
0
        /// <summary>
        /// Handles the Click event of the DistrictButton control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        private void DistrictButton_Click(object sender, EventArgs e)
        {
            try
            {
                Form     districtSelectionForm = new Form();
                object[] optionalParameter     = new object[] { this.RollYearTextBox.Text.Trim(), 2205 };
                districtSelectionForm = TerraScanCommon.GetForm(1512, optionalParameter, this.formF2205Control.WorkItem);

                if (districtSelectionForm != null)
                {
                    if (districtSelectionForm.ShowDialog() == DialogResult.OK)
                    {
                        // Get selected district details
                        this.districtId           = TerraScanCommon.GetValue(districtSelectionForm, "DistrictId");
                        this.districtNumber       = TerraScanCommon.GetValue(districtSelectionForm, "CommandValue");
                        this.DistrictTextBox.Text = this.districtNumber;
                    }
                }
            }
            catch (Exception ex)
            {
                ExceptionManager.ManageException(ex, ExceptionManager.ActionType.CloseCurrentForm, this.ParentForm);
            }
        }
Example #9
0
        /// <summary>
        /// Handles the Click event of the RunBatchButton control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="T:System.EventArgs"/> instance containing the event data.</param>
        private void RunBatchButton_Click(object sender, EventArgs e)
        {
            try
            {
                switch (this.currentParentFormBatchButtonStatusMode)
                {
                ////when the BatchButtonStatusMode is Pause
                case BatchButtonStatusMode.Pause:
                {
                    this.currentParentFormBatchButtonStatusMode = BatchButtonStatusMode.Run;
                    this.SetBatchButton(BatchButtonStatusMode.Run);
                    break;
                }

                ////when the BatchButtonStatusMode is Run
                case BatchButtonStatusMode.Run:
                {
                    this.currentParentFormBatchButtonStatusMode = BatchButtonStatusMode.Pause;
                    this.SetBatchButton(BatchButtonStatusMode.Pause);
                    break;
                }

                ////when the BatchButtonStatusMode is load
                default:
                {
                    object[] optionalParameter;
                    optionalParameter = new object[] { this.formSliceFormNo, this.currentFormSlicePermission };
                    Form snapShotForm = new Form();
                    snapShotForm = TerraScanCommon.GetForm(9040, optionalParameter, this.parentWorkItem);
                    if (snapShotForm != null)
                    {
                        DialogResult dialogResult = snapShotForm.ShowDialog();

                        if (dialogResult.Equals(DialogResult.OK))
                        {
                            this.snapShotId = Convert.ToInt32(TerraScanCommon.GetValue(snapShotForm, "CurrentSnapShotId"));
                        }
                        else
                        {
                            ////if no record is select in the F9040 snapshot dialog form set it as zero
                            this.snapShotId = 0;
                        }
                    }

                    ////if the F9040 snapShot form returns snapshot id, chnage the Batch Button status
                    if (this.snapShotId > 0)
                    {
                        ////db call is used get the no of count in snapshot item collection
                        this.currentFormBatchItemCount = WSHelper.F1440_SaveRecieptinSnapShotBatchButtonControl(this.snapShotId, null, this.currentBatchButtonUserId);
                        this.currentParentFormBatchButtonStatusMode = BatchButtonStatusMode.Pause;
                        this.SetBatchButton(BatchButtonStatusMode.Pause);
                    }

                    break;
                }
                }
            }
            catch (SoapException soapException)
            {
                ExceptionManager.ManageException(soapException, ExceptionManager.ActionType.CloseCurrentForm, this.ParentForm);
            }
            catch (Exception ex)
            {
                ExceptionManager.ManageException(ex, ExceptionManager.ActionType.Display, this.ParentForm);
            }
        }
Example #10
0
        /// <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;
            }
        }