예제 #1
0
파일: F2004.cs 프로젝트: CSSAdmin/TScan
        /// <summary>
        /// FillParcelTypeCombo
        /// </summary>
        private void FillParcelTypeCombo()
        {
            this.parcelTypeDataset = this.formF2004Control.WorkItem.GetParcelTypeDetails(-1);
            if (this.parcelTypeDataset.f2004ListParcelType.Rows.Count > 0)
            {
                this.ParcelTypeComboBox.DisplayMember = this.parcelTypeDataset.f2004ListParcelType.ParcelTypeColumn.ColumnName;
                this.ParcelTypeComboBox.ValueMember   = this.parcelTypeDataset.f2004ListParcelType.ParcelTypeIDColumn.ColumnName;
                this.ParcelTypeComboBox.DataSource    = this.parcelTypeDataset.f2004ListParcelType;
                this.parcelTypeDataset.f2004ListParcelType.DefaultView.Sort = SharedFunctions.GetResourceString("ParcelType");
                this.parcelTypeDataset = this.formF2004Control.WorkItem.GetParcelTypeDetails(this.keyId);
                if (this.parcelTypeDataset.f2004ListParcelType.Rows.Count > 0)
                {
                    this.parcelTypeIndex = this.ConvertStringToInteger(this.parcelTypeDataset.f2004ListParcelType.Rows[0][this.parcelTypeDataset.f2004ListParcelType.ParcelTypeIDColumn].ToString());
                    this.ParcelTypeComboBox.SelectedValue = this.parcelTypeIndex;
                }
            }


            this.editScheduleassessmentdata = this.formF2004Control.WorkItem.F2200_GetAssessmentTypeDetails("Parcel");
            if (this.editScheduleassessmentdata.List_AssessmentTypeDataTable.Rows.Count > 0)
            {
                this.AssessmentTypeComboBox.DataSource    = this.editScheduleassessmentdata.List_AssessmentTypeDataTable;
                this.AssessmentTypeComboBox.DisplayMember = this.editScheduleassessmentdata.List_AssessmentTypeDataTable.AssessmentTypeColumn.ColumnName;
                this.AssessmentTypeComboBox.ValueMember   = this.editScheduleassessmentdata.List_AssessmentTypeDataTable.AssessmentTypeIDColumn.ColumnName;
            }
        }
예제 #2
0
        /// <summary>
        /// Gets the parcel attachment details.
        /// </summary>
        /// <param name="oldParcelID">The old parcel ID.</param>
        /// <param name="newParcelID">The new parcel ID.</param>
        /// <param name="userID">The user ID.</param>
        /// <param name="moduleID">The module ID.</param>
        /// <returns>The parcel compy dataset.</returns>
        public static F2004ParcelCopyData GetParcelAttachmentDetails(int oldParcelID, int newParcelID, int userID, int moduleID)
        {
            F2004ParcelCopyData parcelType = new F2004ParcelCopyData();
            Hashtable           ht         = new Hashtable();

            ht.Add("@OldParcelID", oldParcelID);
            ht.Add("@NewParcelID", newParcelID);
            ht.Add("@UserID", userID);
            ht.Add("@ModuleID", moduleID);
            Utility.LoadDataSet(parcelType.getParcelAttachmentTable, "f2000_pcget_ParcelAttachment", ht);
            return(parcelType);
        }
예제 #3
0
        /// <summary>
        /// GetParcelTypeDetails
        /// </summary>
        /// <param name="parcelId">parcelId</param>
        /// <returns>typed dataset</returns>
        public static F2004ParcelCopyData GetParcelTypeDetails(int parcelId)
        {
            F2004ParcelCopyData parcelType = new F2004ParcelCopyData();
            Hashtable           ht         = new Hashtable();

            if (parcelId > 0)
            {
                ht.Add("@ParcelID", parcelId);
            }

            Utility.LoadDataSet(parcelType.f2004ListParcelType, "f2004_pclst_ParcelType", ht);
            return(parcelType);
        }
예제 #4
0
파일: F2004.cs 프로젝트: CSSAdmin/TScan
        /// <summary>
        ///// To create a parcel Copy
        /// </summary>
        private void CreateNewParcel()
        {
            ////if ((this.parcelNumber == this.ParcelNumberTextBox.Text.Trim()) && (this.parcelYear == this.RollYearTextBox.Text.Trim()) && (this.parcelTypeIndex == Convert.ToInt32(this.ParcelTypeComboBox.SelectedValue.ToString())))
            ////{
            //////// MessageBox.Show("sorry already created");
            ////    MessageBox.Show(SharedFunctions.GetResourceString("RecordStatus"), ConfigurationWrapper.ApplicationName, MessageBoxButtons.OK, MessageBoxIcon.Information);
            ////}
            ////else
            ////{
            F2004ParcelCopyData createNewParcel = new F2004ParcelCopyData();

            F2004ParcelCopyData.createNewParcelCopyDataTableRow dr = createNewParcel.createNewParcelCopyDataTable.NewcreateNewParcelCopyDataTableRow();
            dr.ModuleID         = SharedFunctions.GetResourceString("ParcelCopyNo");
            dr.InsertedBy       = TerraScanCommon.UserId;
            dr.InsertedDate     = DateTime.Now.ToString();
            dr.IsDeleted        = SharedFunctions.GetResourceString("False");
            dr.ParcelNumber     = this.ParcelNumberTextBox.Text.Trim();
            dr.RollYear         = this.RollYearTextBox.Text.Trim();
            dr.AssessmentTypeID = Convert.ToInt16(this.AssessmentTypeComboBox.SelectedValue);
            createNewParcel.createNewParcelCopyDataTable.Rows.Add(dr);
            createNewParcel.createNewParcelCopyDataTable.AcceptChanges();
            DataSet tempDataSet = new DataSet(SharedFunctions.GetResourceString("Root"));

            tempDataSet.Tables.Add(createNewParcel.createNewParcelCopyDataTable.Copy());
            tempDataSet.Tables[0].TableName = SharedFunctions.GetResourceString("SaleAdvisoryTable");
            this.returnValue = this.formF2004Control.WorkItem.CreateNewParcelCopy(this.keyId, this.ConvertStringToInteger(this.ParcelTypeComboBox.SelectedValue.ToString()), this.NonRollingObjectComboBox.SelectedIndex, this.NonRollingValueSlicesComboBox.SelectedIndex, this.AttachmentsComboBox.SelectedIndex, this.CommentsComboBox.SelectedIndex, tempDataSet.GetXml(), TerraScanCommon.UserId);

            ////Coding added for the issue 4496 by malliga on 12/11/2009
            if (this.returnValue.Equals(-1))
            {
                MessageBox.Show(SharedFunctions.GetResourceString("RecordStatus"), ConfigurationWrapper.ApplicationName, MessageBoxButtons.OK, MessageBoxIcon.Information);
                //// this.CancelCommandButton.Enabled = true;
                this.createButton = false;
                this.DialogResult = DialogResult.None;
                return;
            }

            if (this.AttachmentsComboBox.SelectedIndex == 1)
            {
                if (this.returnValue > 0)
                {
                    this.parcelTypeDataset = this.formF2004Control.WorkItem.GetParcelAttachmentDetails(this.keyId, this.returnValue, TerraScanCommon.UserId, Convert.ToInt32(SharedFunctions.GetResourceString("ParcelCopyNo")));
                    if (this.parcelTypeDataset.getParcelAttachmentTable.Rows.Count > 0)
                    {
                        for (int i = 0; i < this.parcelTypeDataset.getParcelAttachmentTable.Rows.Count; i++)
                        {
                            string fileTypeId = string.Empty;
                            int    primaryValue;
                            int    publicValue;
                            int    rollValue;
                            string description = string.Empty;
                            string eventDate   = string.Empty;
                            //string filetype = string.Empty;
                            //string aurl = string.Empty;
                            //string pfileid = string.Empty;

                            this.attachmentKeyID  = Convert.ToInt32(this.parcelTypeDataset.getParcelAttachmentTable.Rows[i][this.parcelTypeDataset.getParcelAttachmentTable.Column1Column].ToString());
                            this.attachmentFormID = Convert.ToInt32(this.parcelTypeDataset.getParcelAttachmentTable.Rows[i][this.parcelTypeDataset.getParcelAttachmentTable.FormColumn].ToString());
                            this.browsePathExt    = this.parcelTypeDataset.getParcelAttachmentTable.Rows[i][this.parcelTypeDataset.getParcelAttachmentTable.ExtensionColumn].ToString();

                            eventDate   = this.parcelTypeDataset.getParcelAttachmentTable.Rows[i][this.parcelTypeDataset.getParcelAttachmentTable.EventDateColumn].ToString();
                            description = this.parcelTypeDataset.getParcelAttachmentTable.Rows[i][this.parcelTypeDataset.getParcelAttachmentTable.DescriptionColumn].ToString();
                            fileTypeId  = this.parcelTypeDataset.getParcelAttachmentTable.Rows[i][this.parcelTypeDataset.getParcelAttachmentTable.FileTypeIDColumn].ToString();

                            // filetype = this.parcelTypeDataset.getParcelAttachmentTable.Rows[i][this.parcelTypeDataset.getParcelAttachmentTable.LinkTypeColumn].ToString();

                            //aurl = this.parcelTypeDataset.getParcelAttachmentTable.Rows[i][this.parcelTypeDataset.getParcelAttachmentTable.AURLColumn].ToString();

                            // pfileid = this.parcelTypeDataset.getParcelAttachmentTable.Rows[i][this.parcelTypeDataset.getParcelAttachmentTable.PFileIDColumn].ToString();

                            if (this.parcelTypeDataset.getParcelAttachmentTable.Rows[i][this.parcelTypeDataset.getParcelAttachmentTable.IsPrimaryColumn].ToString().Equals(SharedFunctions.GetResourceString("True")))
                            {
                                primaryValue = 1;
                            }
                            else
                            {
                                primaryValue = 0;
                            }

                            if (this.parcelTypeDataset.getParcelAttachmentTable.Rows[i][this.parcelTypeDataset.getParcelAttachmentTable.IsPublicColumn].ToString().Equals("True"))
                            {
                                publicValue = 1;
                            }
                            else
                            {
                                publicValue = 0;
                            }

                            if (this.parcelTypeDataset.getParcelAttachmentTable.Rows[i][this.parcelTypeDataset.getParcelAttachmentTable.IsRollColumn].ToString().Equals("True"))
                            {
                                rollValue = 1;
                            }
                            else
                            {
                                rollValue = 0;
                            }

                            this.attachmentDataSet.GetFilePath.Clear();
                            this.attachmentDataSet.GetFilePath.Merge(this.formF2004Control.WorkItem.GetFilePath(SharedFunctions.GetResourceString("TSFile"), this.attachmentFormID, this.attachmentKeyID, this.browsePathExt, TerraScanCommon.UserId));
                            this.filePath = this.attachmentDataSet.GetFilePath.Rows[0][SharedFunctions.GetResourceString("ParcelCopyFilePath")].ToString();
                            this.fileID   = this.attachmentDataSet.GetFilePath.Rows[0][SharedFunctions.GetResourceString("FileID")].ToString();

                            string tempFilePath = string.Empty;
                            tempFilePath = this.parcelTypeDataset.getParcelAttachmentTable.Rows[i][this.parcelTypeDataset.getParcelAttachmentTable.SourceColumn].ToString();
                            try
                            {
                                if (System.IO.File.Exists(tempFilePath))
                                {
                                    FileStream   fs = new FileStream(tempFilePath, FileMode.Open);
                                    BinaryReader bR = new BinaryReader(fs);

                                    //// Upload the Image to the Central Location.
                                    UpLoadImage(bR.ReadBytes((int)fs.Length), this.filePath);
                                    ////this.fileExist = true;
                                    bR.Close();
                                    fs.Close();
                                }
                            }
                            catch (UnauthorizedAccessException)
                            {
                                MessageBox.Show(String.Concat(new string[] { SharedFunctions.GetResourceString("NoAccessFileLocation"), SharedFunctions.GetResourceString("NexLine"), tempFilePath, SharedFunctions.GetResourceString("NexLine"), SharedFunctions.GetResourceString("ContactAdmin") }), SharedFunctions.GetResourceString("TS_File"), MessageBoxButtons.OK, MessageBoxIcon.Information);
                            }

                            this.formF2004Control.WorkItem.SaveAttachments(Convert.ToInt32(this.fileID), this.browsePathExt, this.attachmentFormID, this.attachmentKeyID, Convert.ToInt32(fileTypeId), tempFilePath, primaryValue, description, eventDate, TerraScan.Common.TerraScanCommon.UserId, publicValue, rollValue, 0, "", 0, "TSFile");
                        }
                    }
                }
            }
            else
            {
            }

            this.DialogResult = DialogResult.Cancel;
            //// this.CancelCommandButton.Enabled = false;
            if (MessageBox.Show(SharedFunctions.GetResourceString("ParcelCopy"), ConfigurationWrapper.ApplicationName, MessageBoxButtons.OK, MessageBoxIcon.Information) == DialogResult.OK)
            {
                if (this.createButton)
                {
                    this.Close();
                }
            }
            //// }
        }