/// <summary> /// Initializes a new instance of the permitImportTemplateDetailsDataSet class. /// </summary> public F2321() { this.InitializeComponent(); this.PermitImportTemplateSelectionPanel.Focus(); this.ActiveControl = this.TemplateNameTextBox; this.permitImportTemplateDetailsDataSet = new ListPermitImportTemplateData(); this.permitImportTemplateId = -1; }
/// <summary> /// SearchButton_Click /// </summary> /// <param name="sender">The sender.</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 { this.Cursor = Cursors.WaitCursor; if (this.SearchButton.Enabled) { int recordCount = 0; //Removed the .Replace("'","''") for Database Execution retrieves nothing string templateName = this.TemplateNameTextBox.Text.Trim(); string description = this.DecriptionTextBox.Text.Trim(); string fileType = this.FileTypeTextBox.Text.Trim(); //if (string.IsNullOrEmpty(templateName) || string.IsNullOrEmpty(description) || string.IsNullOrEmpty(fileType)) //{ this.permitImportTemplateDetailsDataSet = this.form2321Control.WorkItem.GetPermitImportTemplateDetails(templateName, description, fileType); if (this.permitImportTemplateDetailsDataSet.ListPermitImportData.Rows.Count > 0) { recordCount = this.permitImportTemplateDetailsDataSet.ListPermitImportData.Rows.Count; this.PermitImportTemplateSelectionGridView.Enabled = true; this.PermitImportTemplateSelectionGridView.DataSource = this.permitImportTemplateDetailsDataSet.ListPermitImportData; this.PermitImportTemplateSelectionGridView.Focus(); this.PermitImportTemplateSelectionGridView.Rows[0].Selected = true; this.AcceptMasterNameButton.Enabled = true; this.ClearButton.Enabled = true; this.emptyRecord = false; } else { this.PermitImportTemplateSelectionGridView.DataSource = this.permitImportTemplateDetailsDataSet.ListPermitImportData; this.PermitImportTemplateSelectionGridView.Rows[0].Selected = false; this.PermitImportTemplateSelectionGridView.Enabled = false; this.emptyRecord = true; this.AcceptMasterNameButton.Enabled = false; this.ClearButton.Enabled = true; } this.RecordCountLabel.Text = recordCount + SharedFunctions.GetResourceString("9101MasterNameSearch"); this.DisableVScrollBar(); //} //else //{ // this.RecordCountLabel.Text = 0 + SharedFunctions.GetResourceString("9101MasterNameSearch"); //} } } catch (Exception ex) { ExceptionManager.ManageException(ex, ExceptionManager.ActionType.CloseCurrentForm, this.ParentForm); } finally { this.Cursor = Cursors.Default; } }
/// <summary> /// Gets the Permit Import Template Details /// </summary> /// <returns> The dataset containing the list of Permit Import Template Details.</returns> public static ListPermitImportTemplateData GetPermitImportTemplateDetails(string TemplateName, string Description, string FileType) { ListPermitImportTemplateData permitImportTemplateSelectData = new ListPermitImportTemplateData(); Hashtable ht = new Hashtable(); ht.Add("@TemplateName", TemplateName); ht.Add("@Description", Description); ht.Add("@FileType", FileType); Utility.LoadDataSet(permitImportTemplateSelectData.ListPermitImportData, "f2321_pclst_PermitImportTemplateSelection", ht); return(permitImportTemplateSelectData); }