コード例 #1
0
    protected void FilterHWBTN_Click(object sender, EventArgs e)
    {
        if (ChooseClassDLL.SelectedValue == "בחר" || ChooseLessonsDLL.SelectedValue == "בחר מקצוע")
        {
            ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "success", "alert('לא בחרת כיתה ו/או מקצוע'); ", true);
        }
        else
        {
            string TeacherId = Request.Cookies["UserID"].Value;
            Dictionary <string, string> LessonsList = new Dictionary <string, string>();
            LessonsList = (Dictionary <string, string>)(Session["LessonsList"]);
            Dictionary <string, string> ClassesList = new Dictionary <string, string>();
            ClassesList = (Dictionary <string, string>)(Session["ClassesList"]);
            DataTable dtt = new DataTable();

            string   ClassCode      = KeyByValue(ClassesList, ChooseClassDLL.SelectedValue);
            string   LessonCode     = KeyByValue(LessonsList, ChooseLessonsDLL.SelectedValue);
            HomeWork FilterHomeWork = new HomeWork();
            dtt = FilterHomeWork.FilterHomeWork(TeacherId, LessonCode, ClassCode);

            if (dtt.Rows.Count == 0)
            {
                ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "success", "alert('אין היסטוריית שיעורים שהוזנה על ידך עבור הכיתה והמקצוע שנבחר'); ", true);
                GridView1.DataSource = null;
            }
            else
            {
                GridView1.DataSource = dtt;
            }
            GridView1.DataBind();
        }
    }