protected void btn_ShowList_Click(object sender, EventArgs e)
        {
            img_ExportToExcel1.Visible = false;
            img_ExportToExcel2.Visible = false;
            if (ddl_Term.SelectedValue == null)
            {
                RadWindowManager1.RadAlert("لطفا ترم را انتخاب کنید", 0, 100, "پیام", "");
            }
            if (ddl_Day.SelectedValue == null || ddl_Day.SelectedValue == "0")
            {
                RadWindowManager1.RadAlert("لطفا روز را انتخاب کنید", 0, 100, "پیام", "");
            }
            if (ddl_NumberClass.SelectedValue == null || ddl_NumberClass.SelectedValue == ".")
            {
                RadWindowManager1.RadAlert("لطفا شماره کلاس را انتخاب کنید", 0, 100, "پیام", "");
            }
            else
            {
                if (txt_CodeOstad.Text == string.Empty || txt_CodeOstad.Text == "")
                {
                    txt_CodeOstad.Text = "0";
                }
                else
                {
                    LTKD.CodeOstad = txt_CodeOstad.Text;
                }

                if (rdb_ListByOstad.Checked == true)
                {
                    Sort      = 0;
                    dtResault = FRB.GetConflictClassByCodeOstad(ddl_Term.SelectedValue, int.Parse(txt_CodeOstad.Text), Sort, int.Parse(ddl_Day.SelectedValue), int.Parse(ddl_NumberClass.SelectedValue));
                    if (dtResault.Rows.Count == 0)
                    {
                        RadWindowManager1.RadAlert("رکوردی وجود ندارد", 0, 100, "پیام", "");
                    }
                    else
                    {
                        img_ExportToExcel1.Visible = true;
                        this.StiWebViewer1.ResetReport();
                        StiWebViewer1.Visible = true;
                        StiReport rpt = new StiReport();
                        rpt.Load(Server.MapPath("../Report/ReportConflictClassbyCodeOstad.mrt"));
                        rpt.ReportCacheMode = StiReportCacheMode.On;
                        rpt.Dictionary.Databases.Clear();
                        rpt.Dictionary.Databases.Add(new StiSqlDatabase("Connection1", CB.ReportConnection.ToString()));
                        rpt.Compile();
                        rpt.CompiledReport.DataSources["[Faculty].[SP_ConflictClassbyCodeOstad]"].Parameters["@Term"].ParameterValue        = ddl_Term.SelectedValue;
                        rpt.CompiledReport.DataSources["[Faculty].[SP_ConflictClassbyCodeOstad]"].Parameters["@CodeOstad"].ParameterValue   = int.Parse(txt_CodeOstad.Text);
                        rpt.CompiledReport.DataSources["[Faculty].[SP_ConflictClassbyCodeOstad]"].Parameters["@Sort"].ParameterValue        = Sort;
                        rpt.CompiledReport.DataSources["[Faculty].[SP_ConflictClassbyCodeOstad]"].Parameters["@Day"].ParameterValue         = int.Parse(ddl_Day.SelectedValue);
                        rpt.CompiledReport.DataSources["[Faculty].[SP_ConflictClassbyCodeOstad]"].Parameters["@NumberClass"].ParameterValue = (ddl_NumberClass.SelectedValue);
                        ((StiSqlSource)rpt.Dictionary.DataSources["[Faculty].[SP_ConflictClassbyCodeOstad]"]).CommandTimeout = 30000;
                        rpt.RegData(dtResault);
                        rpt.Dictionary.Synchronize();
                        //rpt.Show();
                        StiWebViewer1.Report  = rpt;
                        StiWebViewer1.Visible = true;
                        //rpt.Print(true);
                    }
                    if (txt_CodeOstad.Text == "0" || txt_CodeOstad.Text == "")
                    {
                        txt_CodeOstad.Text    = "";
                        Session["code_ostad"] = null;;
                    }
                    txt_CodeOstad.Text    = "";
                    Session["code_ostad"] = null;
                }
                if (rdb_ListByNumberClass.Checked == true)
                {
                    Sort = 2;
                    if (ddl_Day.SelectedValue == null || ddl_Day.SelectedValue == "")
                    {
                        RadWindowManager1.RadAlert("لطفا روز را انتخاب کنید", 0, 100, "پیام", "");
                    }
                    else
                    {
                        dtResault = FRB.GetConflictClassByNumberClass(ddl_Term.SelectedValue, ddl_NumberClass.SelectedValue, Sort, int.Parse(ddl_Day.SelectedValue));
                        if (dtResault.Rows.Count == 0)
                        {
                            RadWindowManager1.RadAlert("رکوردی وجود ندارد", 0, 100, "پیام", "");
                        }
                        else
                        {
                            img_ExportToExcel2.Visible = true;
                            this.StiWebViewer1.ResetReport();
                            StiWebViewer1.Visible = true;
                            StiReport rpt = new StiReport();
                            rpt.Load(Server.MapPath("../Report/ReportConflictClassbyNumberClass.mrt"));
                            rpt.ReportCacheMode = StiReportCacheMode.On;
                            StiOptions.Engine.ReportCache.AmountOfProcessedPagesForStartGCCollect = 20000; // default - 20
                            StiOptions.Engine.ReportCache.AmountOfQuickAccessPages = 10000;                // default - 50
                            rpt.Dictionary.Databases.Clear();
                            rpt.Dictionary.Databases.Add(new StiSqlDatabase("Connection1", CB.ReportConnection.ToString()));
                            rpt.Compile();
                            rpt.CompiledReport.DataSources["[Faculty].[SP_ConflictClassbyNumberClass]"].Parameters["@Term"].ParameterValue        = ddl_Term.SelectedValue;
                            rpt.CompiledReport.DataSources["[Faculty].[SP_ConflictClassbyNumberClass]"].Parameters["@NumberClass"].ParameterValue = ddl_NumberClass.SelectedValue;
                            rpt.CompiledReport.DataSources["[Faculty].[SP_ConflictClassbyNumberClass]"].Parameters["@Sort"].ParameterValue        = Sort;
                            rpt.CompiledReport.DataSources["[Faculty].[SP_ConflictClassbyNumberClass]"].Parameters["@Day"].ParameterValue         = int.Parse(ddl_Day.SelectedValue);
                            ((StiSqlSource)rpt.Dictionary.DataSources["[Faculty].[SP_ConflictClassbyNumberClass]"]).CommandTimeout = 30000;
                            rpt.RegData(dtResault);
                            rpt.Render();
                            StiWebViewer1.Report  = rpt;
                            StiWebViewer1.Visible = true;
                        }
                        if (txt_CodeOstad.Text == "0" || txt_CodeOstad.Text == "")
                        {
                            txt_CodeOstad.Text    = "";
                            Session["code_ostad"] = null;;
                        }
                        txt_CodeOstad.Text    = "";
                        Session["code_ostad"] = null;
                    }
                }
            }
        }