/// <summary> /// 教师平台 /// </summary> private void LoginCode() { string aaaastr = "teacherlogintime"; string Hname = Textname.Text.Trim(); string Hpwd = Textpwd.Text.Trim(); if (Hname != "" && Hpwd != "") { LearnSite.Model.Teacher Tmodel = new LearnSite.Model.Teacher(); LearnSite.BLL.Teacher Tbll = new LearnSite.BLL.Teacher(); Tmodel = Tbll.GetTeacherModel(Hname, Hpwd); if (Tmodel != null) { cookieJump(Tmodel, aaaastr);//登录cookie设置和跳转 } else { Labelmsg.Text = "用户名或密码错误!"; Textname.Text = ""; Textpwd.Text = ""; } } else { Labelmsg.Text = "输入不能为空!"; } }
private void Teacheradd() { string Hname = Texthname.Text.Trim(); string Hnick = Texthnick.Text.Trim(); string Hpwd = Texthpwd.Text.Trim(); bool Hpermiss = Ckhpermiss.Checked; string Hnote = Texthnote.Text.Trim(); if (Hname != "" && Hpwd != "" && Hnick != "") { LearnSite.Model.Teacher teacher = new LearnSite.Model.Teacher(); teacher.Hname = Hname; teacher.Hpwd = Hpwd; teacher.Hpermiss = Hpermiss; teacher.Hnote = Hnote; teacher.Hnick = Hnick; LearnSite.BLL.Teacher bll = new LearnSite.BLL.Teacher(); if (bll.ExistsHname(Hname)) { Labelmsg.Text = "账号已经存在,请更换!"; } else { bll.Add(teacher); System.Threading.Thread.Sleep(200); Response.Redirect("~/Manager/teacher.aspx", false); } } else { Labelmsg.Text = "请输入账号、昵称和密码!"; } }
protected void GVTeacher_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "D") { LearnSite.Model.MngCook mcook = new LearnSite.Model.MngCook(); string myhid = mcook.Hid.ToString(); string hid = e.CommandArgument.ToString(); if (myhid != hid) { LearnSite.BLL.Teacher tbll = new LearnSite.BLL.Teacher(); int res = tbll.DownTeacher(Int32.Parse(hid)); //给该老师账号做删除标志 LearnSite.BLL.Room rbll = new LearnSite.BLL.Room(); rbll.ClearRhid(Int32.Parse(hid)); //清除该教师所有班级选择 if (res == 0) { LearnSite.Common.WordProcess.Alert("找不到该教师账号!", this.Page); } else { ShowTeacher(); //刷新列表 } } else { LearnSite.Common.WordProcess.Alert("提示:不能删除当前登录账号!", this.Page); } } }
protected void Btnedit_Click(object sender, EventArgs e) { if (Request.QueryString["Hid"] != null) { int Hid = Int32.Parse(Request.QueryString["Hid"].ToString()); string Hname = Texthname.Text.Trim(); string Hnick = Texthnick.Text.Trim(); string Hpwd = Texthpwd.Text.Trim(); bool Hpermiss = Ckhpermiss.Checked; string Hnote = Texthnote.Text.Trim(); if (Hname != "" && Hpwd != "" && Hnote != "" && Hnick != "") { LearnSite.Model.Teacher tmodel = new LearnSite.Model.Teacher(); tmodel.Hid = Hid; tmodel.Hname = Hname; tmodel.Hpwd = Hpwd; tmodel.Hpermiss = Hpermiss; tmodel.Hnote = Hnote; tmodel.Hnick = Hnick; tmodel.Hpath = ""; LearnSite.BLL.Teacher bll = new LearnSite.BLL.Teacher(); bll.Update(tmodel); System.Threading.Thread.Sleep(200); Response.Redirect("~/Manager/teacher.aspx", true); } else { Labelmsg.Text = "请输入姓名、密码和备注!"; } } }
protected void Btnedit_Click(object sender, EventArgs e) { if (Request.QueryString["Hid"] != null) { int Hid = Int32.Parse(Request.QueryString["Hid"].ToString()); string Hname = Texthname.Text.Trim(); string Hpwd = Texthpwd.Text.Trim(); bool Hpermiss = Ckhpermiss.Checked; string Hnote = Texthnote.Text.Trim(); if (Hname != "" && Hpwd != "") { LearnSite.Model.Teacher teacher = new LearnSite.Model.Teacher(); teacher.Hid = Hid; teacher.Hname = Hname; teacher.Hpwd = Hpwd; teacher.Hpermiss = Hpermiss; teacher.Hnote = Hnote; LearnSite.BLL.Teacher bll = new LearnSite.BLL.Teacher(); bll.Update(teacher); System.Threading.Thread.Sleep(1000); Response.Redirect("~/Manager/teacher.aspx", false); } else { Labelmsg.Text = "请输入姓名和密码!"; } } }
private void Teachers() { LearnSite.BLL.Teacher tb = new LearnSite.BLL.Teacher(); DDLhid.DataSource = tb.GetListHidHname(); DDLhid.DataTextField = "Hnick"; DDLhid.DataValueField = "Hid"; DDLhid.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { LearnSite.Common.CookieHelp.JudgeTeacherCookies(); Master.Page.Title = LearnSite.Common.CookieHelp.SetMainPageTitle() + "课程资源添加页面"; string coursePath= LearnSite.Store.CourseStore.SetSoftDownload(); if (Request.Cookies["TeacherCookies"] != null) { string hidstr = Request.Cookies["TeacherCookies"].Values["Hid"].ToString(); LearnSite.BLL.Teacher bll = new LearnSite.BLL.Teacher(); bll.SetHpath(coursePath, hidstr); } }
protected void DDLhouse_SelectedIndexChanged(object sender, EventArgs e) { ShowSigin(); string pcroom = DDLhouse.SelectedValue; if (Request.Cookies[LearnSite.Common.CookieHelp.teaCookieNname] != null && pcroom != "") { string Hid = tcook.Hid.ToString(); LearnSite.BLL.Teacher tbll = new LearnSite.BLL.Teacher(); tbll.updateHroom(Int32.Parse(Hid), pcroom);//记录上课的电脑室名称 } }
private void ShowTeacher() { if (Request.QueryString["Hid"] != null) { int Hid = Int32.Parse(Request.QueryString["Hid"].ToString()); LearnSite.Model.Teacher teacher = new LearnSite.Model.Teacher(); LearnSite.BLL.Teacher bll = new LearnSite.BLL.Teacher(); teacher = bll.GetModel(Hid); Texthname.Text = teacher.Hname; Texthpwd.Text = teacher.Hpwd; Ckhpermiss.Checked = teacher.Hpermiss; Texthnote.Text = teacher.Hnote; } }
private void ShowTeacher() { if (Request.QueryString["Hid"] != null) { int Hid = Int32.Parse(Request.QueryString["Hid"].ToString()); LearnSite.Model.Teacher teacher = new LearnSite.Model.Teacher(); LearnSite.BLL.Teacher bll = new LearnSite.BLL.Teacher(); teacher = bll.GetModel(Hid); Texthname.Text = teacher.Hname; Texthpwd.Text = teacher.Hpwd; Ckhpermiss.Checked = teacher.Hpermiss; Texthnote.Text = teacher.Hnote; Texthnick.Text = teacher.Hnick; } }
private void GetMyCid() { if (Request.Cookies["TeacherCookies"] != null) { if (Request.QueryString["Cid"] != null) { GetCid = Int32.Parse(Request.QueryString["Cid"].ToString()); coursePath = LearnSite.Store.CourseStore.FCKUserFilesPath(GetCid.ToString()); string hidstr = Request.Cookies["TeacherCookies"].Values["Hid"].ToString(); LearnSite.BLL.Teacher bll = new LearnSite.BLL.Teacher(); bll.SetHpath(coursePath, hidstr); } else { Response.Redirect("~/Teacher/course.aspx", false); } } }
protected void Page_Load(object sender, EventArgs e) { LearnSite.Common.CookieHelp.JudgeTeacherCookies(); Master.Page.Title = LearnSite.Common.CookieHelp.SetMainPageTitle() + "课程活动编辑页面"; if (Request.QueryString["Mcid"] != null) { string Mcid = Request.QueryString["Mcid"].ToString(); string coursePath = LearnSite.Store.CourseStore.FCKUserFilesPath(Mcid); string hidstr = Request.Cookies["TeacherCookies"].Values["Hid"].ToString(); LearnSite.BLL.Teacher bll = new LearnSite.BLL.Teacher(); bll.SetHpath(coursePath, hidstr); } else { Response.Redirect("~/Teacher/course.aspx", false); } if (!IsPostBack) { ShowTypename(); missionview(); } }
private void Teacheradd() { string Hname = Texthname.Text.Trim(); string Hpwd = Texthpwd.Text.Trim(); bool Hpermiss = Ckhpermiss.Checked; string Hnote = Texthnote.Text.Trim(); if (Hname != "" && Hpwd != "") { LearnSite.Model.Teacher teacher = new LearnSite.Model.Teacher(); teacher.Hname = Hname; teacher.Hpwd = Hpwd; teacher.Hpermiss = Hpermiss; teacher.Hnote = Hnote; LearnSite.BLL.Teacher bll = new LearnSite.BLL.Teacher(); bll.Add(teacher); System.Threading.Thread.Sleep(1000); Response.Redirect("~/Manager/teacher.aspx", false); } else { Labelmsg.Text = "请输入姓名和密码!"; } }
protected void Page_Load(object sender, EventArgs e) { LearnSite.Common.CookieHelp.JudgeTeacherCookies(); Master.Page.Title = LearnSite.Common.CookieHelp.SetMainPageTitle() + "试题编辑页面"; if (Request.QueryString["Qid"] != null) { if (!IsPostBack) { ShowQuiz(); } string coursePath = LearnSite.Store.CourseStore.SetQuizStorage(); if (Request.Cookies["TeacherCookies"] != null) { string hidstr = Request.Cookies["TeacherCookies"].Values["Hid"].ToString(); LearnSite.BLL.Teacher bll = new LearnSite.BLL.Teacher(); bll.SetHpath(coursePath, hidstr); } } else { Response.Redirect("~/Quiz/quiz.aspx", false); } }
protected void Btnlogin_Click(object sender, EventArgs e) { string Hname = Textname.Text.Trim(); string Hpwd = Textpwd.Text.Trim(); if (Hname != "" && Hpwd != "") { LearnSite.Model.Teacher Tmodel = new LearnSite.Model.Teacher(); LearnSite.BLL.Teacher Tbll = new LearnSite.BLL.Teacher(); Tmodel = Tbll.GetTeacherModel(Hname, Hpwd); if (Tmodel != null) { if (LearnSite.Common.CookieHelp.SetTeacherCookies(Tmodel)) { System.Threading.Thread.Sleep(500); if (Request.Cookies["TeacherCookies"] != null) { string Hid = Request.Cookies["TeacherCookies"].Values["Hid"].ToString(); Session[Hid + "teacherlogintime"] = DateTime.Now.ToString(); } Response.Redirect("~/Teacher/infomation.aspx", false); } else { string msg = "本机cookies设置失效,无法登录!"; Labelmsg.Text = msg; } } else { Labelmsg.Text = "用户名或密码错误!"; Textname.Text = ""; Textpwd.Text = ""; } } }
private void ShowTeacher() { LearnSite.BLL.Teacher tc = new LearnSite.BLL.Teacher(); GVTeacher.DataSource = tc.GetAllList(); GVTeacher.DataBind(); }
private void ShowTeacher() { LearnSite.BLL.Teacher tbll = new LearnSite.BLL.Teacher(); GVTeacher.DataSource = tbll.GetTeacherList(); GVTeacher.DataBind(); }
private void CountAll() { LearnSite.BLL.Teacher tbll = new LearnSite.BLL.Teacher(); tbll.UpdateHcountAll(); }