Esempio n. 1
0
 protected void btn_EvalutionProf_Click(object sender, EventArgs e)
 {
     if (TED.Term == null)
     {
         RadWindowManager1.RadAlert("لطفا ترم را انتخاب بفرمایید", 0, 100, "پیام", "");
     }
     else
     {
         if (txt_CodeOstad.Text == "")
         {
             txt_CodeOstad.Text = "0";
         }
         if (TED.Departman == null)
         {
             TED.Departman = "0";
         }
         if (TED.Lesson == null)
         {
             TED.Lesson = "0";
         }
         Order = 1;
         dt    = FRB.GetEvalutionAllProf(TED.Term, int.Parse(txt_CodeOstad.Text), int.Parse(TED.Departman), int.Parse(TED.Lesson), Order);
         if (dt.Rows.Count == 0)
         {
             RadWindowManager1.RadAlert("رکوردی وجود ندارد", 0, 100, "پیام", "");
         }
         else
         {
             this.StiWebViewer1.ResetReport();
             StiReport rpt = new StiReport();
             rpt.Load(Server.MapPath("../Report/ReportEvalutionProf.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_EvalutionProf]"].Parameters["@Term"].ParameterValue      = TED.Term;
             rpt.CompiledReport.DataSources["[Faculty].[SP_EvalutionProf]"].Parameters["@CodeOstad"].ParameterValue = int.Parse(txt_CodeOstad.Text);
             rpt.CompiledReport.DataSources["[Faculty].[SP_EvalutionProf]"].Parameters["@Lesson"].ParameterValue    = int.Parse(TED.Lesson);
             rpt.CompiledReport.DataSources["[Faculty].[SP_EvalutionProf]"].Parameters["@Departman"].ParameterValue = int.Parse(TED.Departman);
             rpt.CompiledReport.DataSources["[Faculty].[SP_EvalutionProf]"].Parameters["@Order"].ParameterValue     = Order;
             ((StiSqlSource)rpt.Dictionary.DataSources["[Faculty].[SP_EvalutionProf]"]).CommandTimeout = 30000;
             rpt.RegData(dt);
             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;
 }