protected void OnQuery(object sender, EventArgs e) { CleanMessage(MessagePanel, ErrorPanel); try { string optionSelected = btnConfirm.CommandName; BindEntities(1); DescriptionInput.Text = ""; SmallDescriptionInput.Text = ""; if (optionSelected == "CRE") { DetailPanel.Visible = true; ConfirmButtonPanel.Visible = true; IdInput.Text = "Auto"; IdInput.Enabled = false; } BigPanel.DefaultButton = "btnConfirm"; DescriptionInput.Focus(); } catch (Exception exp) { ShowError(ErrorPanel, exp.Message); } }
protected void OnOptions(object sender, EventArgs e) { OptionsPanel.Enabled = false; SearchPanel.Visible = true; SearchPanelButtons.Visible = true; btnConfirm.CommandName = Options.SelectedValue; BigPanel.DefaultButton = "btnSearch"; DescriptionInput.Focus(); }
protected void OnGridView1SelectedIndexChanged(object sender, EventArgs e) { try { string optionSelected = btnConfirm.CommandName; GridViewRow currentRow = GridView1.SelectedRow; CleanMessage(MessagePanel, ErrorPanel); if (currentRow == null) { return; } DetailPanel.Visible = true; DetailPanel.Enabled = true; ConfirmButtonPanel.Visible = true; BackPanel.Visible = false; Label AreaId = currentRow.FindControl("AreaIdLabel") as Label; IdInput.Text = Server.HtmlDecode(AreaId.Text).Trim(); Label AreaDescription = currentRow.FindControl("AreaDescriptionLabel") as Label; DescriptionInput.Text = Server.HtmlDecode(AreaDescription.Text).Trim(); Label AreaSmallDescription = currentRow.FindControl("AreaSmallDescriptionLabel") as Label; SmallDescriptionInput.Text = Server.HtmlDecode(AreaSmallDescription.Text).Trim(); Label Hectares = currentRow.FindControl("HectaresLabel") as Label; HectaresInput.Text = Server.HtmlDecode(Hectares.Text).Trim(); switch (optionSelected) { case "QRY": ConfirmButtonPanel.Visible = false; DetailPanel.Enabled = false; BackPanel.Visible = true; break; case "DEL": DetailPanel.Enabled = false; break; case "UPD": IdInput.Enabled = false; break; case "CRE": IdInput.Text = "Auto"; break; } BigPanel.DefaultButton = "btnConfirm"; DescriptionInput.Focus(); } catch (Exception exp) { ShowError(ErrorPanel, exp.Message); } }
protected void OnGridView1SelectedIndexChanged(object sender, EventArgs e) { try { string optionSelected = btnConfirm.CommandName; GridViewRow currentRow = GridView1.SelectedRow; CleanMessage(MessagePanel, ErrorPanel); if (currentRow == null) { return; } DetailPanel.Visible = true; DetailPanel.Enabled = true; ConfirmButtonPanel.Visible = true; BackPanel.Visible = false; Label FormId = currentRow.FindControl("FormIdLabel") as Label; IdInput.Text = Server.HtmlDecode(FormId.Text).Trim(); Label Description = currentRow.FindControl("DescriptionLabel") as Label; DescriptionInput.Text = Server.HtmlDecode(Description.Text).Trim(); Label smallDescription = currentRow.FindControl("SmallDescriptionLabel") as Label; SmallDescriptionInput.Text = Server.HtmlDecode(smallDescription.Text).Trim(); HiddenField periodicityIdLabel = currentRow.FindControl("PeriodicityIdLabel") as HiddenField; ddlPeriodicity.SelectedValue = Server.HtmlDecode(periodicityIdLabel.Value).Trim(); HiddenField formTypeLabel = currentRow.FindControl("FormTypeLabel") as HiddenField; ddlFormType.SelectedValue = Server.HtmlDecode(formTypeLabel.Value).Trim(); HiddenField alarmUserRangeHidden = currentRow.FindControl("AlarmUserRangeHidden") as HiddenField; SliderAlarmUser.Text = alarmUserRangeHidden.Value; HiddenField alarmManagerRangeHidden = currentRow.FindControl("AlarmManagerRangeHidden") as HiddenField; SliderAlarmManager.Text = alarmManagerRangeHidden.Value; HiddenField alarmExecutiveRangeHidden = currentRow.FindControl("AlarmExecutiveRangeHidden") as HiddenField; SliderAlarmExecutive.Text = alarmExecutiveRangeHidden.Value; switch (optionSelected) { case "QRY": ConfirmButtonPanel.Visible = false; DetailPanel.Enabled = false; BackPanel.Visible = true; break; case "DEL": DetailPanel.Enabled = false; break; case "UPD": IdInput.Enabled = false; SliderExtenderUser.Enabled = true; SliderExtenderManager.Enabled = true; SliderExtenderExecutive.Enabled = true; break; case "CRE": IdInput.Text = "Auto"; SliderExtenderUser.Enabled = true; SliderExtenderManager.Enabled = true; SliderExtenderExecutive.Enabled = true; break; } BigPanel.DefaultButton = "btnConfirm"; DescriptionInput.Focus(); } catch (Exception exp) { ShowError(ErrorPanel, exp.Message); } }