Exemplo n.º 1
0
    public void TeacherCourse(string TermSrl)
    {
        Srl = Session["TeacherSrl"] as string;
        //Term = Session["TermSrl"] as string;
        JavaScriptSerializer serializer = new JavaScriptSerializer();

        AllCourse = Course.GetTeacherCourseData(Srl, TermSrl);
        JsonRes Res = new JsonRes();

        Res.Term = Term.GetTermData(TermSrl);

        List <Dictionary <string, string> > output = new List <Dictionary <string, string> >();

        if (AllCourse != null)
        {
            int count = AllCourse.Rows.Count;
            //System.Diagnostics.Debug.WriteLine(AllFoods.Columns.Count);
            for (int i = 0, j = 1; i < count; i++, j++)
            {
                Dictionary <string, string> data = new Dictionary <string, string>();

                data["id"] = j.ToString();

                data["Name"] = AllCourse.Rows[i]["Name"].ToString();

                data["CodeErae"] = AllCourse.Rows[i]["CodeErae"].ToString() + "_" + AllCourse.Rows[i]["Srl_Department"].ToString() + "" + AllCourse.Rows[i]["Srl_Group"].ToString() + "" + AllCourse.Rows[i]["Code"].ToString();

                data["SumFinalPercent"] = Activity.GetSumFinalPercent(AllCourse.Rows[i]["Srl"].ToString()) + "از  100 ";

                data["GetSumMeeting"] = APChecking.GetSumMeetingHeld(AllCourse.Rows[i]["Srl"].ToString()).ToString();

                data["EraeSrl"] = "TeacherListStudent.aspx?EraeSrl=" + AllCourse.Rows[i]["Srl"].ToString();

                data["TeacherActivity"] = "TeacherActivity.aspx?EraeSrl=" + AllCourse.Rows[i]["Srl"].ToString();

                data["TeacherAPChecking"] = "TeacherAPChecking.aspx?EraeSrl=" + AllCourse.Rows[i]["Srl"].ToString();


                output.Add(data);
            }


            Res.code    = 200;
            Res.message = output;
            Response.Write(serializer.Serialize(Res));
            return;
        }
        Res.code    = 500;
        Res.message = "Error";
        Response.Write(serializer.Serialize(Res));
        return;
    }
Exemplo n.º 2
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (Request.QueryString["asrl"] != null && Request.QueryString["asrl"] != "" && Request.QueryString["EraeSrl"] != null && Request.QueryString["EraeSrl"] != "")
     {
         int ID = Convert.ToInt32(Request.QueryString["asrl"]);
         EraeSrl = Convert.ToInt32(Request.QueryString["EraeSrl"]);
         //پیغام خطا
         bool result = APChecking.Delete(ID);
         if (result != false)
         {
             Response.Redirect("http://localhost:16354/UI/Pages/Teacher/TeacherAPChecking.aspx?EraeSrl=" + EraeSrl);
         }
     }
 }
    protected void Page_Load(object sender, EventArgs e)
    {
        JavaScriptSerializer hh = new JavaScriptSerializer();

        //Response.Write(hh.Serialize(Convert.ToInt32(Request.QueryString["SessionSrl"])));
        //Response.End();
        if (Request.QueryString["Delay"] != null && Request.QueryString["Absent"] != null)
        {
            APChecking APChecking_cs = new APChecking();


            APChecking_cs.Srl_Session = Convert.ToInt32(Request.QueryString["SessionSrl"]);
            APChecking_cs.Srl_Student = Convert.ToInt32(Request.QueryString["StudentSrl"]);
            if (Convert.ToInt32(Request.QueryString["Delay"]) != 0 && Convert.ToInt32(Request.QueryString["Absent"]) != 0)
            {
                APChecking_cs.Delay = Convert.ToInt32(Request.QueryString["Delay"]);
            }
            else if (Convert.ToInt32(Request.QueryString["Delay"]) == 0 && Convert.ToInt32(Request.QueryString["Absent"]) == 0)
            {
                APChecking_cs.Delay = -1;
            }
            bool Result = APChecking_cs.Insert();
            JavaScriptSerializer     serializer = new JavaScriptSerializer();
            Dictionary <string, int> data       = new Dictionary <string, int>();

            if (Result == true)
            {
                data["code"] = 200;
            }
            else
            {
                data["code"] = 500;
            }

            Response.Write(serializer.Serialize(data));
            Response.End();
        }
    }