protected void RadGrid2_NeedDataSource(object source, GridNeedDataSourceEventArgs e)
 {
     if (!string.IsNullOrEmpty(this.ReportType))
     {
         SchedulableRpt rpt = SchedulableRpt.GetSchedulableRptByRptName(this.ReportType);
         System.Collections.Generic.List <ReportTriggerDetail> dt = this.ShowAllUser ? rpt.GetTriggers() : rpt.GetTriggers(this.UserID);
         this.RadGrid2.DataSource              = dt;
         this.ddlCheckTriggerID.DataSource     = dt;
         this.ddlCheckTriggerID.DataValueField = "Name";
         this.ddlCheckTriggerID.DataTextField  = "Name";
         this.ddlCheckTriggerID.DataBind();
     }
 }
    protected void btnOk_Click(object sender, EventArgs e)
    {
        try
        {
            SchedulableRpt rpt = SchedulableRpt.GetSchedulableRptByRptName(this.ReportType);

            int existTriggerCount = rpt.GetTriggerCount(this.UserID, this.SelectedFrequency);

            int            maxTriggerCount;
            Quartz.Trigger trigger = this.GetTrigger(out maxTriggerCount);

            if (existTriggerCount >= maxTriggerCount)
            {
                this.ShowMessage(existTriggerCount + " " + this.SelectedFrequency + " schedule setted. No more allowed.");
            }
            else
            {
                rpt.AddToScheduler(
                    trigger,
                    this.UserID,
                    this.SelectedFrequency,
                    this.Parameters,
                    this.Availability,
                    this.PastType,
                    this.PastUnit,
                    this.ckbMonitor.Checked,
                    this.CheckTriggerID);
                this.RadGrid2.Rebind();
                this.ShowMessage("Report schedule trigger set successful");
            }
        }
        catch (Exception ex)
        {
            this.ShowMessage("Add trigger error! \r\n => " + ex.Message);
        }
    }