Esempio n. 1
0
        protected void btnRunReport_Click(object sender, System.EventArgs e)
        {
            // Check if the selected dates are valid
            if (WebTool.ValidateHistoricDateControl(this.lstEffectiveDay, this.lstEffectiveMonth, this.lstEffectiveYear) &&
                WebTool.ValidateHistoricDateControl(this.lstEffectiveToDay, this.lstEffectiveToMonth, this.lstEffectiveToYear))
            {
                if ((this.lstEffectiveYear.SelectedValue.Length > 0) && (this.lstEffectiveToYear.SelectedValue.Length > 0))
                {                //Both From and To Dates are selected
                    DateTime dtFromDate = new DateTime(int.Parse(this.lstEffectiveYear.SelectedValue), int.Parse(this.lstEffectiveMonth.SelectedValue), int.Parse(this.lstEffectiveDay.SelectedValue));
                    DateTime dtToDate   = new DateTime(int.Parse(this.lstEffectiveToYear.SelectedValue), int.Parse(this.lstEffectiveToMonth.SelectedValue), int.Parse(this.lstEffectiveToDay.SelectedValue));

                    if (dtFromDate <= dtToDate)
                    {
                        this.plhSearchCriteria.Visible = false;
                        this.plhReportResults.Visible  = true;
                        this.plhTitle.Visible          = false;
                        this.lblError.Visible          = false;
                        this.ShowReport();
                    }
                    else
                    {
                        this.plhSearchCriteria.Visible = true;
                        this.plhReportResults.Visible  = false;
                        this.plhTitle.Visible          = true;
                        this.lblError.Text             = ResourceManager.GetString("lblError.Date");          //"The effective from date must be less than to date";
                        this.lblError.Visible          = true;
                    }
                }
                else
                {
                    this.plhSearchCriteria.Visible = false;
                    this.plhReportResults.Visible  = true;
                    this.plhTitle.Visible          = false;
                    this.lblError.Visible          = false;
                    this.ShowReport();
                }
            }
            else
            {
                this.plhSearchCriteria.Visible = true;
                this.plhReportResults.Visible  = false;
                this.plhTitle.Visible          = true;
                this.lblError.Text             = ResourceManager.GetString("lblError.Date2");  //"The effective date must be valid and cannot be greater than today";
                this.lblError.Visible          = true;
            }
        }
Esempio n. 2
0
 protected void btnRunReport_Click(object sender, System.EventArgs e)
 {
     if (WebTool.ValidateHistoricDateControl(this.lstEffectiveDay, this.lstEffectiveMonth, this.lstEffectiveYear))
     {
         this.plhSearchCriteria.Visible = false;
         this.plhReportResults.Visible  = true;
         this.plhTitle.Visible          = false;
         this.lblError.Visible          = false;
         this.ShowReport();
     }
     else
     {
         this.plhSearchCriteria.Visible = true;
         this.plhReportResults.Visible  = false;
         this.plhTitle.Visible          = true;
         this.lblError.Text             = ResourceManager.GetString("lblError.Date");  //"The effective date must be valid and cannot be greater than today";
         this.lblError.Visible          = true;
     }
 }