/// <summary>
 /// F1402_s the list schedule search.
 /// </summary>
 /// <param name="ScheduleConditionXML">The schedule condition XML.</param>
 /// <returns>Dataset</returns>
 public static F1402ScheduleSelectionData F1402_ListScheduleSearch(string ScheduleConditionXML)
 {
     F1402ScheduleSelectionData scheduleSearchEngineDetails = new F1402ScheduleSelectionData();
     Hashtable ht = new Hashtable();
     ht.Add("@ScheduleConditionXML", ScheduleConditionXML);
     Utility.LoadDataSet(scheduleSearchEngineDetails.GetScheduleSelection, "f1402_pclst_Schedule", ht);
     return scheduleSearchEngineDetails;
 }
Beispiel #2
0
        /// <summary>
        /// Loads the schedule selection grid.
        /// </summary>
        /// <param name="scheduleConditionXML">The schedule condition XML.</param>
        private void LoadScheduleSelectionGrid(string scheduleConditionXML)
        {
            try
            {
                ////For Grid
                this.scheduleSelectionData         = this.form1402Control.WorkItem.F1402_ListScheduleSearch(scheduleConditionXML);
                this.scheduleSelectionGridRowCount = this.scheduleSelectionData.GetScheduleSelection.Rows.Count;

                if (this.scheduleSelectionGridRowCount > 0)
                {
                    this.ScheduleSearchDataGridView.Enabled = true;

                    this.ScheduleSearchDataGridView.DataSource = this.scheduleSelectionData;
                    this.ScheduleSearchDataGridView.Focus();
                    this.ScheduleSearchDataGridView.Rows[0].Selected = true;

                    this.ScheduleAcceptButton.Enabled = true;
                    this.ClearButton.Enabled          = true;
                }
                else
                {
                    this.ClearScheduleSearchGrid();
                }

                //////to enable or disable the vertical scroll bar
                ////if (this.scheduleSelectionGridRowCount > this.ScheduleSearchDataGridView.NumRowsVisible)
                ////{
                ////    this.ScheduleSelectionVerticalScroll.Visible = false;
                ////}
                ////else
                ////{
                ////    this.ScheduleSelectionVerticalScroll.Visible = true;
                ////}

                ////To display the no of display rows in the grid
                this.RecordCountLabel.Text = this.scheduleSelectionGridRowCount + SharedFunctions.GetResourceString("9101MasterNameSearch");
                this.ScheduleSearchDataGridView.ScrollBars = ScrollBars.Both;
            }
            catch (Exception ex)
            {
                ExceptionManager.ManageException(ex, ExceptionManager.ActionType.CloseCurrentForm, this.ParentForm);
            }
        }
Beispiel #3
0
        /// <summary>
        /// Handles the Click event of the SearchButton 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 SearchButton_Click(object sender, EventArgs e)
        {
            try
            {
                string   fillDate = string.Empty;
                DateTime fillDateTime;

                if (!this.ValidateDate())
                {
                    MessageBox.Show("please enter valid date range." + "\n" + "Allowed formats: " + "m/d/yyyy." + "\n" + "Minimum value: " + "1/1/1900" + "\n" + "Minimum value: " + "6/6/2079", ConfigurationManager.AppSettings["ApplicationName"].ToString(), MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    this.FilingDateTextBox.Text = "";
                    this.FilingDateTextBox.Focus();
                    return;
                }

                if (!string.IsNullOrEmpty(this.FilingDateTextBox.Text.Trim()))
                {
                    fillDateTime = Convert.ToDateTime(this.FilingDateTextBox.Text.Trim());
                    fillDate     = fillDateTime.ToShortDateString();
                }

                if (fillDate != "")
                {
                    int pos = fillDate.LastIndexOf("/");

                    string str1 = fillDate.Substring(pos + 1, 4);
                    if (Convert.ToInt32(str1) < 1900 || Convert.ToInt32(str1) > 2079)
                    {
                        MessageBox.Show("please enter valid date range." + "\n" + "Allowed formats: " + "m/d/yyyy." + "\n" + "Minimum value: " + "1/1/1900" + "\n" + "Minimum value: " + "6/6/2079", ConfigurationManager.AppSettings["ApplicationName"].ToString(), MessageBoxButtons.OK, MessageBoxIcon.Warning);
                        this.FilingDateTextBox.Text = "";
                        this.FilingDateTextBox.Focus();
                        return;
                    }
                }

                if (this.RollYearTextBox.Text != "")
                {
                    int rollyear;
                    int.TryParse(this.RollYearTextBox.Text, out rollyear);

                    if (rollyear == 0)
                    {
                        MessageBox.Show("Year should be greater than 1899 and lesser than 2080", ConfigurationManager.AppSettings["ApplicationName"].ToString(), MessageBoxButtons.OK, MessageBoxIcon.Error);
                        this.RollYearTextBox.Text = "";
                        return;
                    }

                    if (Convert.ToInt32(this.RollYearTextBox.Text) < 1900 || Convert.ToInt32(this.RollYearTextBox.Text) > 2079)
                    {
                        MessageBox.Show("Year should be greater than 1899 and lesser than 2080", ConfigurationManager.AppSettings["ApplicationName"].ToString(), MessageBoxButtons.OK, MessageBoxIcon.Error);
                        this.RollYearTextBox.Text = "";
                        return;
                    }
                }

                string schedulecondition = string.Empty;

                F1402ScheduleSelectionData scheduleSelectionData1 = new F1402ScheduleSelectionData();

                DataTable searchdt = new DataTable();
                searchdt = (DataTable)scheduleSelectionData1.GetScheduleSelection.Clone();

                DataRow searchdr;
                searchdr = searchdt.NewRow();
                searchdr[this.scheduleSelectionData.GetScheduleSelection.ScheduleNumberColumn.ColumnName]  = this.ScheduleNumberTextBox.Text.Trim();
                searchdr[this.scheduleSelectionData.GetScheduleSelection.ParcelNumberColumn.ColumnName]    = this.refParcelNumberTextBox.Text.Trim();
                searchdr[this.scheduleSelectionData.GetScheduleSelection.StatementNumberColumn.ColumnName] = this.StatementNumberTextBox.Text.Trim();
                searchdr[this.scheduleSelectionData.GetScheduleSelection.OwnerNameColumn.ColumnName]       = this.OwnerTextBox.Text.Trim();
                if (this.RollYearTextBox.Text != "")
                {
                    searchdr[this.scheduleSelectionData.GetScheduleSelection.RollYearColumn.ColumnName] = this.RollYearTextBox.Text.Trim();
                }
                else
                {
                    searchdr[this.scheduleSelectionData.GetScheduleSelection.RollYearColumn.ColumnName] = DBNull.Value;
                }

                searchdr[this.scheduleSelectionData.GetScheduleSelection.StreetAddressColumn.ColumnName] = this.StreetAddressTextBox.Text.Trim();
                if (this.FilingDateTextBox.Text != "")
                {
                    searchdr[this.scheduleSelectionData.GetScheduleSelection.FilingDateColumn.ColumnName] = fillDate;
                }
                else
                {
                    searchdr[this.scheduleSelectionData.GetScheduleSelection.FilingDateColumn.ColumnName] = DBNull.Value;
                }

                searchdr[this.scheduleSelectionData.GetScheduleSelection.NAICSColumn.ColumnName]        = this.NAICSTextBox.Text.Trim();
                searchdr[this.scheduleSelectionData.GetScheduleSelection.LegalColumn.ColumnName]        = this.LegalTextBox.Text.Trim();
                searchdr[this.scheduleSelectionData.GetScheduleSelection.DistrictColumn.ColumnName]     = this.DistrictTextBox.Text.Trim();
                searchdr[this.scheduleSelectionData.GetScheduleSelection.DescriptionColumn.ColumnName]  = this.DescriptionTextBox.Text.Trim();
                searchdr[this.scheduleSelectionData.GetScheduleSelection.BuisnessNameColumn.ColumnName] = this.BusinessNameTextBox.Text.Trim();
                searchdr[this.scheduleSelectionData.GetScheduleSelection.PropertyTypeColumn.ColumnName] = this.PropertyTypeTextBox.Text.Trim();
                searchdt.Rows.Add(searchdr);

                schedulecondition = TerraScanCommon.GetXmlString(searchdt);
                this.LoadScheduleSelectionGrid(schedulecondition);
            }
            catch (Exception ex)
            {
                ExceptionManager.ManageException(ex, ExceptionManager.ActionType.CloseCurrentForm, this.ParentForm);
            }
        }