Example #1
0
        public void MyBind()
        {
            SchList_Radio.DataSource = schBll.SelByUid(buser.GetLogin().UserID);
            SchList_Radio.DataBind();
            SchList_Radio.Items.Insert(0, new ListItem("请选择配置"));
            DataTable teachDt = teachBll.Select_All();

            Teacher_RPT.DataSource = teachDt;
            Teacher_RPT.DataBind();
            ClassRPT.DataSource = classBll.Select_All();
            ClassRPT.DataBind();
            DataTable dt = pkBll.SelByClassID(ClassID, buser.GetLogin().UserID);

            foreach (DataRow item in dt.Rows)
            {
                DateList_R.Items.Add(new ListItem(Convert.ToDateTime(item["SDate"]).ToString("yyyy年MM月dd日") + "-" + Convert.ToDateTime(item["EDate"]).ToString("yyyy年MM月dd日"), item["Sdate"] + "," + item["EDate"]));
            }
            if (DateList_R.Items.Count > 0)
            {
                DateList_R.Items[0].Selected = true;
            }
            if (ClassID > 0)
            {
                Set_Div.Visible = false;
                Sel_Div.Visible = true;
                string[] dates = DateList_R.SelectedValue.Split(',');
                SetConfig(dates[0], dates[1]);
            }
            TeacList_Dr.DataSource = teachDt;
            TeacList_Dr.DataBind();
        }
        public void MyBind()
        {
            M_UserInfo   mu      = buser.GetLogin();
            M_EDU_School schMod  = new M_EDU_School();
            DataTable    classDT = classBll.SelByUid(mu.UserID);

            ClassRPT.DataSource = classDT;
            ClassRPT.DataBind();
            if (classDT.Rows.Count < 1)
            {
                Empty_SP.Visible = true; ClassRPT.Visible = false;
            }
            if (Cid > 0)
            {
                schMod          = schBll.SelReturnModel(Convert.ToInt32(Cid));
                TermName_L.Text = "[" + schMod.TermName + "]";
                //SchoolName_T.Text = schMod.SchoolName;
                TermName_T.Text            = schMod.TermName;
                WeekDay_DP.SelectedValue   = schMod.weekday.ToString();
                PreMoning_DP.SelectedValue = schMod.premoning.ToString();
                Moring_DP.SelectedValue    = schMod.moring.ToString();
                Afternoon_DP.SelectedValue = schMod.afternoon.ToString();
                Evening_DP.SelectedValue   = schMod.evening.ToString();
                if (mu.UserID != schMod.UserID)
                {
                    op_table.Visible  = false;
                    BanEdit_Hid.Value = "1";
                }
                function.Script(this, "SetChkVal('ClassIDS_chk','" + schMod.ClassIDS + "');");
            }
            else
            {
                TermName_T.Text  = DateTime.Now.ToString("yyyy-MM-dd") + "_" + function.GetRandomString(4, 2);
                schMod.premoning = 1;
                schMod.moring    = 4;
                schMod.afternoon = 3;
                schMod.evening   = 2;
                schMod.weekday   = 5;
                Json_Hid.Value   = JsonConvert.SerializeObject(schMod);
            }
            Json_Hid.Value = JsonConvert.SerializeObject(schMod);
        }