Beispiel #1
0
 protected void btn_EvalutionProfByLesson_Click(object sender, EventArgs e)
 {
     if (ddl_Term.SelectedValue == null || ddl_Term.SelectedValue == "0")
     {
         RadWindowManager1.RadAlert("لطفا ترم را انتخاب بفرمایید", 0, 100, "پیام", "");
     }
     else
     {
         if (txt_CodeOstad.Text == string.Empty)
         {
             txt_CodeOstad.Text = "0";
         }
         if (ddl_CodeGroup.SelectedValue == null)
         {
             ddl_CodeGroup.SelectedValue = "0";
         }
         if (ddl_CodeDras.SelectedValue == null)
         {
             ddl_CodeDras.SelectedValue = "0";
         }
         Order = 1;
         dt    = FRB.GetEvalutionProfDividedODD(ddl_Term.SelectedValue, int.Parse(txt_CodeOstad.Text), int.Parse(ddl_CodeGroup.SelectedValue), int.Parse(ddl_CodeDras.SelectedValue), Order);
         if (dt.Rows.Count == 0)
         {
             RadWindowManager1.RadAlert("رکوردی وجود ندارد", 0, 100, "پیام", "");
         }
         else
         {
             this.StiWebViewer1.ResetReport();
             StiReport rpt = new StiReport();
             rpt.Load(Server.MapPath("../Report/ReportEvalutionProfDividedDid].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_EvalutionProfDividedODD]"].Parameters["@Term"].ParameterValue      = ddl_Term.SelectedValue;
             rpt.CompiledReport.DataSources["[Faculty].[SP_EvalutionProfDividedODD]"].Parameters["@CodeOstad"].ParameterValue = txt_CodeOstad.Text;
             rpt.CompiledReport.DataSources["[Faculty].[SP_EvalutionProfDividedODD]"].Parameters["@Lesson"].ParameterValue    = int.Parse(ddl_CodeDras.SelectedValue);
             rpt.CompiledReport.DataSources["[Faculty].[SP_EvalutionProfDividedODD]"].Parameters["@Departman"].ParameterValue = int.Parse(ddl_CodeGroup.SelectedValue);
             rpt.CompiledReport.DataSources["[Faculty].[SP_EvalutionProfDividedODD]"].Parameters["@Order"].ParameterValue     = Order;
             ((StiSqlSource)rpt.Dictionary.DataSources["[Faculty].[SP_EvalutionProfDividedODD]"]).CommandTimeout = 10000;
             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;
 }