protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            if (Request["assistantNo"] != null && Request["courseNo"] != null && Request["classID"] != null && Request["termTag"] != null)
            {
                assistantNo = Request["assistantNo"];
                String courseNo = Request["courseNo"].ToString().Trim();
                String ClassID = Server.UrlDecode(Request["classID"].ToString().Trim());
                String termTag = Request["termTag"].ToString().Trim();

                DalOperationAboutAssistant DalOperationAboutAssistant = new DalOperationAboutAssistant();
                DalOperationAboutAssistant.AddCourseOfAssistant(assistantNo, courseNo, ClassID, termTag);
                Javascript.RefreshParentWindow("AssistantManager.aspx?fragment=4&assistantNo=" + assistantNo, Page);
                return;
            }
            if (Request["assistantNo"] != null)
            {
                assistantNo = Request["assistantNo"];
                DalOperationAboutAssistant DalOperationAboutAssistant = new DalOperationAboutAssistant();
                DataSet ds = DalOperationAboutAssistant.GetOtherCoursesByAssistantNo(assistantNo);

                dlstCourses.DataSource = ds.Tables[0];
                dlstCourses.DataBind();
            }
            else
            {
                Javascript.GoHistory(-1, Page);
            }
        }
    }
Exemple #2
0
    protected void DatalistBind(string tag)
    {
        UserCookiesInfo UserCookiesInfo = BllOperationAboutUser.GetUserCookiesInfo();
        DataSet ds = new DataSet();

        DataSet dsA = new DataSet();

        DalOperationAboutTeacher DalOperationAboutTeacher = new DalOperationAboutTeacher();
        DalOperationAboutAssistant DalOperationAboutAssistant = new DalOperationAboutAssistant();
        ds = DalOperationAboutTeacher.GetCoursesByTeachertNo(UserCookiesInfo.userNo, tag);
        dsA = DalOperationAboutAssistant.GetCoursesByAssistantNo(UserCookiesInfo.userNo, tag);

        tags = TagToString(tag);

        dlstAssistantCourses.DataSource = dsA.Tables[0];
        dlstAssistantCourses.DataBind();
        dlstCourses.DataSource = ds.Tables[0];
        dlstCourses.DataBind();

        if (dlstAssistantCourses.Items.Count == 0)
        {
            dlstAssistantCourses.ShowFooter = true;
        }
        else
        {
            dlstAssistantCourses.ShowFooter = false;
        }

        if (dlstCourses.Items.Count == 0)
        {
            dlstCourses.ShowFooter = true;
        }
        else
        {
            dlstCourses.ShowFooter = false;
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            //控制Tab的显示
            string fragmentFlag = "3";

            if (Request["fragment"] != null)
            {
                fragmentFlag = Request["fragment"];
            }

            CommonUtility.ShowLiControl(fragmentFlag, liFragment1, liFragment2, liFragment3, liFragment4
                , divFragment1, divFragment2, divFragment3, divFragment4);

            switch (fragmentFlag)
            {
                case "3":
                    DataListBind();
                    break;
                case "4":
                    assistantNo = Request["assistantNo"];
                    DalOperationAboutAssistant DalOperationAboutAssistant = new DalOperationAboutAssistant();
                    if (Request["del"] == "true" && Request["courseNo"] != null && Request["assistantNo"] != null && Request["coursesTeachersCorrelationId"] != null)
                    {
                        string coursesTeachersCorrelationId = Request["coursesTeachersCorrelationId"].ToString().Trim();
                        DalOperationAboutAssistant.DelCourseOfAssistantByCoursesTeachersCorrelationId(coursesTeachersCorrelationId);
                    }

                    liFragment4.Visible = true;
                    lblassistamtName.Text= DalOperationAboutAssistant.GetAssistantbyId(assistantNo).assistantName;

                    DataSet ds = DalOperationAboutAssistant.GetCoursesByAssistantNo(assistantNo);
                    dlstcoursesOfAssistamt.DataSource = ds.Tables[0];
                    dlstcoursesOfAssistamt.DataBind();
                    break;

            }
        }
    }