/// <summary> /// 保存 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btnSave_Click(object sender, EventArgs e) { #region 验证 if (string.IsNullOrEmpty(tbCode.Text.Trim())) { Common.JShelper.JSAlert(this.Page, "", "教师编号不能为空!"); tbCode.Focus(); } else if (string.IsNullOrEmpty(tbName.Text.Trim())) { Common.JShelper.JSAlert(this.Page, "", "老师名称不能为空!"); tbName.Focus(); } else if (string.IsNullOrEmpty(tbPassword.Text.Trim())) { Common.JShelper.JSAlert(this.Page,"","密码不能为空!"); tbPassword.Focus(); } #endregion else { LabMS.Model.Teacher MT = new LabMS.Model.Teacher(); MT.CardCode = tbkpCode.Text.Trim(); MT.ComeFrom = tbcs.Text.Trim(); MT.Dirthday = DateTime.Parse(tbcsrq.Text.Trim()); MT.Education = tbwhcd.Text.Trim(); MT.Email = tbEmail.Text.Trim(); MT.Fax = tbFax.Text.Trim(); MT.GDate = DateTime.Parse(tbbysj.Text.Trim()); MT.GSchool = tbbyxx.Text.Trim(); MT.Health = tbjkzk.Text.Trim(); MT.HomeAddress = tbhomeAdd.Text.Trim(); MT.Homephone = tbhomeTel.Text.Trim(); MT.Jobs = tbzw.Text.Trim(); MT.Marriage = tbhyzk.Text.Trim(); MT.Mobile = tbPhone.Text.Trim(); MT.Nation = tbmz.Text.Trim(); MT.OfficeAddress = tbOfficeAdd.Text.Trim(); MT.Political = tbzzmm.Text.Trim(); MT.Professional = tbjszc.Text.Trim(); MT.Province = tbPro.Text.Trim(); MT.SexCode = ddlSex.SelectedValue.ToString(); MT.Specially = tbzyjstc.Text.Trim(); MT.Teacher_Code = tbCode.Text.Trim(); MT.Teacher_Name = tbName.Text.Trim(); MT.Tel = tbOfficeTel.Text.Trim(); MT.WorkDate = DateTime.Parse(tbgzrq.Text.Trim()); MT.Password = tbPassword.Text.Trim(); LabMS.BLL.Teacher BT = new LabMS.BLL.Teacher(); int a = BT.Add(MT); if (a > 0) { Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "", "<script type='text/javascript'>alert('新增成功!');window.opener.location.href=window.opener.location.href;self.close();</script>"); } } }
public void ProcessRequest(HttpContext context) { context.Response.ContentType = "text/plain"; string psw = context.Request.Params["Password"].ToString(); string usercode = context.Request.Params["UserCode"].ToString(); string usertype = context.Request.Params["UserType"].ToString(); string returnvalue=""; if (usertype == "mana") { LabMS.BLL.UserTable userTable = new LabMS.BLL.UserTable(); List<LabMS.Model.UserTable> userTableModelList = new List<LabMS.Model.UserTable>(); userTableModelList = userTable.GetModelList("Password='******' and PCode='" + usercode + "'"); if (userTableModelList.Count == 1) { returnvalue = "\"" + psw + "\",true"; } else { returnvalue = "\"" + psw + "\",false"; } } else if (usertype == "student") { LabMS.BLL.Student userTable = new LabMS.BLL.Student(); List<LabMS.Model.Student> userTableModelList = new List<LabMS.Model.Student>(); userTableModelList = userTable.GetModelList("Student_Pass='******' and Student_Code='" + usercode + "'"); if (userTableModelList.Count == 1) { returnvalue = "\"" + psw + "\",true"; } else { returnvalue = "\"" + psw + "\",false"; } } if (usertype == "teacher") { LabMS.BLL.Teacher userTable = new LabMS.BLL.Teacher(); List<LabMS.Model.Teacher> userTableModelList = new List<LabMS.Model.Teacher>(); userTableModelList = userTable.GetModelList("Password='******' and Teacher_Code='" + usercode + "'"); if (userTableModelList.Count == 1) { returnvalue = "\"" + psw + "\",true"; } else { returnvalue = "\"" + psw + "\",false"; } } context.Response.Write(returnvalue); }
void bind(string strwhere) { LabMS.Model.SysSetting msys = new LabMS.Model.SysSetting(); ExtendBLL.SysSetting extendsys = new ExtendBLL.SysSetting(); msys = extendsys.GetCurrentSetting(); List<LabMS.Model.OpentProject> listmopproject = new List<LabMS.Model.OpentProject>(); LabMS.BLL.OpentProject bopproject = new LabMS.BLL.OpentProject(); if (strwhere.Equals("")) { strwhere += " 1=1 "; } strwhere += " and SYear = " + msys.CurrentYear + " and Semester = " + msys.CurrentSemester; if (UserType == "teacher") { strwhere += " and OP_Teacher = '" + UserCode + "'"; } listmopproject = bopproject.GetModelList(strwhere + " order by ID desc "); foreach (LabMS.Model.OpentProject op in listmopproject) { List<LabMS.Model.Teacher> listmteacher = new List<LabMS.Model.Teacher>(); LabMS.BLL.Teacher bteacher = new LabMS.BLL.Teacher(); listmteacher = bteacher.GetModelList(" Teacher_Code= '" + op.OP_Teacher + "'"); if (listmteacher.Count > 0) { op.OP_Teacher = listmteacher[0].Teacher_Name; } LabMS.BLL.Lab blab = new LabMS.BLL.Lab(); List<LabMS.Model.Lab> mLab = new List<LabMS.Model.Lab>(); mLab = blab.GetModelList(" Lab_Code='"+ op.Project_Lab +"'"); if (mLab.Count > 0) { op.Project_Lab = mLab[0].Lab_Name; } ExtendBLL.Dictionary eDictionary = new ExtendBLL.Dictionary(); List<Model.Dictionary> listCClass = new List<LabMS.Model.Dictionary>(); listCClass = eDictionary.GetModelList("DClass = 'shiyanyaoqiu' and Code = '"+op.Project_Require+"'"); if (listCClass.Count > 0) { op.Project_Require = listCClass[0].Name; } op.OP_Phone = op.Project_StartWeek.ToString()+"--"+op.Project_EndWeek.ToString(); List<LabMS.Model.ProjectAppointment>listprojectapp = new List<LabMS.Model.ProjectAppointment>(); ExtendBLL.ProjectAppointment bprojectapp = new ExtendBLL.ProjectAppointment(); listprojectapp = bprojectapp.GetModelList(" OP_ProjectCode ='"+op.OP_ProjectCode+"'"); op.OP_OpenType = listprojectapp.Count.ToString(); listCClass = eDictionary.GetModelList("DClass = 'shiyanleixing' and Code = '" + op.Project_Type + "'"); if (listCClass.Count > 0) { op.Project_Type = listCClass[0].Name; } if (op.OP_Audit == "0") { } op.OP_Audit = LabMS.Common.Status.GetOpenProjectStatus(op.OP_Audit); } gv_OpenProjectList.DataSource = listmopproject; gv_OpenProjectList.DataBind(); }
/// <summary> /// 处理DS /// </summary> /// <param name="ds"></param> /// <returns></returns> protected DataSet HandleData(DataSet ds) { ds.Tables[0].Columns.Add("LabName"); ds.Tables[0].Columns.Add("RecorderName"); ds.Tables[0].Columns.Add("AttatchmentPath"); LabMS.Model.Lab labInfo; LabMS.BLL.Lab lab = new LabMS.BLL.Lab(); for (int i = ds.Tables[0].Rows.Count - 1; i > -1; i--) { int labID = int.Parse(ds.Tables[0].Rows[i]["LabID"].ToString()); labInfo = lab.GetModel(labID); ds.Tables[0].Rows[i]["LabName"] = (labInfo != null) ? labInfo.Lab_Name : "全部"; if (ds.Tables[0].Rows[i]["ResourceRecorderType"].ToString() == "0") // 管理员 { BLL.UserTable ut = new LabMS.BLL.UserTable(); LabMS.Model.UserTable utInfo = ut.GetModel(int.Parse(ds.Tables[0].Rows[i]["ResourceRecorder"].ToString())); ds.Tables[0].Rows[i]["RecorderName"] = (utInfo == null) ? "<del>已删除管理员</del>" : utInfo.UserName + " 管理员"; } else { BLL.Teacher teacher = new LabMS.BLL.Teacher(); LabMS.Model.Teacher teacherInfo = teacher.GetModel(int.Parse(ds.Tables[0].Rows[i]["ResourceRecorder"].ToString())); ds.Tables[0].Rows[i]["RecorderName"] = (teacherInfo == null) ? "<del>已删除老师</del>" : teacherInfo.Teacher_Name + " 老师"; } ds.Tables[0].Rows[i]["AttatchmentPath"] = ds.Tables[0].Rows[i]["ResourceAttachmentPath"]; } return ds; }
/// <summary> /// ���ݷ����������ҵ���ʵ�������������� /// </summary> /// <param name="posterID">�����߱�ʶ</param> /// <param name="PosterType">���������(0Ϊ����Ա,1Ϊ��ʦ,2Ϊѧ��)</param> /// <returns></returns> public string GetAuthorName(int posterID, string posterType) { string name = String.Empty; switch (posterType) { case "0": // ����Ա LabMS.BLL.UserTable ut = new LabMS.BLL.UserTable(); LabMS.Model.UserTable utInfo = ut.GetModel(posterID); if (utInfo != null) name = utInfo.UserName; break; case "1": //��ʦ LabMS.BLL.Teacher bTeacher = new LabMS.BLL.Teacher(); LabMS.Model.Teacher teacher = bTeacher.GetModel(posterID); if (teacher != null) name = teacher.Teacher_Name; break; case "2"://ѧ�� LabMS.BLL.Student bStudent = new LabMS.BLL.Student(); LabMS.Model.Student student = bStudent.GetModel(posterID); if (student != null) name = student.Student_Name; break; } return name; }
void bind(LabMS.Model.OpentProject mopproject) { tbOPContent.Text = mopproject.OP_OpenType; tbOPInCharge.Text = mopproject.OP_InCharge; tbOPPhone.Text = mopproject.OP_Phone; tbOPPlanningCourseTime.Text = mopproject.OP_PlanningCourseTime; tbOPProfessioanl.Text = mopproject.OP_Professioanl; tbOPReason.Text = mopproject.OP_AppIntro; tbProjectCode.Text = mopproject.OP_ProjectCode; tbProjectEndWeek.Text = mopproject.Project_EndWeek.Value.ToString(); tbProjectName.Text = mopproject.OP_ProjectName; tbProjectStartWeek.Text = mopproject.Project_StartWeek.Value.ToString(); ExtendBLL.Dictionary eDictionary = new ExtendBLL.Dictionary(); List<Model.Dictionary> listCClass = new List<LabMS.Model.Dictionary>(); listCClass = eDictionary.GetModelList(" DClass='xueke' and Code ='" + mopproject.Project_Subject + "'"); tbProjectSubjectCode.Value = mopproject.Project_Subject; if (listCClass.Count > 0) { tbProjectSubjectName.Value = listCClass[0].Name; } LabMS.BLL.Teacher bteacher = new LabMS.BLL.Teacher(); List<Model.Teacher> listteacher = new List<LabMS.Model.Teacher>(); listteacher = bteacher.GetModelList(" Teacher_Code ='" + mopproject.OP_Teacher + "'"); tbTeacherCode.Value = mopproject.OP_Teacher; if (listteacher.Count > 0) { tbTeacherName.Value = listteacher[0].Teacher_Name; } tbTeacherCode.Value = mopproject.OP_Teacher; lbAppDate.Text = mopproject.OP_AppTime.Value.ToShortDateString(); lbAppPerson.Text = mopproject.OP_Applicant; #region 绑定学生列表 ExtendBLL.ProjectAppointment eprojectapp = new ExtendBLL.ProjectAppointment(); List<LabMS.Model.Student> listStudent = new List<LabMS.Model.Student>(); listStudent = eprojectapp.GetStudentByProject(mopproject.OP_ProjectCode); string strHTML = "<table id='studenlist' border='1' class='infoTable' style='width: 400px; border-collapse: collapse;'>"; strHTML += "<thead>"; strHTML += "<tr class='header'>"; strHTML += "<td class='none'>"; strHTML += "ID"; strHTML += "</td>"; strHTML += "<td>"; strHTML += "学号"; strHTML += "</td>"; strHTML += "<td>"; strHTML += "姓名"; strHTML += "</td>"; strHTML += "<td>"; strHTML += ""; strHTML += "</td>"; strHTML += "</tr>"; strHTML += "</thead>"; strHTML += "<tbody>"; tb_StudentIDs.Value = ""; foreach (LabMS.Model.Student s in listStudent) { if (tb_StudentIDs.Value == "") { tb_StudentIDs.Value += s.ID.ToString(); } else { tb_StudentIDs.Value += "," + s.ID.ToString(); } strHTML += "<tr>"; strHTML += "<td class='none'>"; strHTML += s.ID.ToString(); strHTML += "</td>"; strHTML += "<td>"; strHTML += s.Student_Code; strHTML += "</td>"; strHTML += "<td>"; strHTML += s.Student_Name; strHTML += "</td>"; strHTML += "<td>"; strHTML += "<a>删除</a>"; strHTML += "</td>"; strHTML += "</tr>"; } strHTML += "</tbody>"; strHTML += "</table>"; tblistStudents.Value = strHTML; tblistEmpty.Value = "0"; #endregion }
/// <summary> /// 搜索 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btnSearch_Click(object sender, EventArgs e) { string str = "1=1 "; if (!string.IsNullOrEmpty(tbSearchTeacherCode.Text.Trim())) { str += " and Teacher_Code = '" + tbSearchTeacherCode.Text.Trim() + "' "; } if (!string.IsNullOrEmpty(tbSearchTeacherName.Text.Trim())) { str += " and Teacher_Name like '%" + tbSearchTeacherName.Text.Trim() + "%' "; } if (!string.IsNullOrEmpty(tbSearchTeacherJobs.Text.Trim())) { str += " and Jobs like '%" + tbSearchTeacherJobs.Text.Trim() + "%' "; } if (!string.IsNullOrEmpty(tbSearchTeacherProfessional.Text.Trim())) { str += " and Professional like '%" + tbSearchTeacherProfessional.Text.Trim() + "%' "; } LabMS.BLL.Teacher BT = new LabMS.BLL.Teacher(); gvTeacherList.DataSource = BT.GetModelList(str); gvTeacherList.DataBind(); }
private bool IsUserNameAndPassword() { if (UserType == "mana") { LabMS.BLL.UserTable userTable = new LabMS.BLL.UserTable(); List<LabMS.Model.UserTable> userTableModelList = new List<LabMS.Model.UserTable>(); userTableModelList = userTable.GetModelList("Password='******' and PCode='" + UserCodeTBX.Text + "'"); if (userTableModelList.Count == 1) { return true; } else { return false; } } else if (UserType == "teacher") { LabMS.BLL.Teacher userTable = new LabMS.BLL.Teacher(); List<LabMS.Model.Teacher> userTableModelList = new List<LabMS.Model.Teacher>(); userTableModelList = userTable.GetModelList("Password='******' and Teacher_Code='" + UserCodeTBX.Text + "'"); if (userTableModelList.Count == 1) { return true; } else { return false; } } else { LabMS.BLL.Student userTable = new LabMS.BLL.Student(); List<LabMS.Model.Student> userTableModelList = new List<LabMS.Model.Student>(); userTableModelList = userTable.GetModelList("Student_Pass='******' and Student_Code='" + UserCodeTBX.Text + "'"); if (userTableModelList.Count == 1) { return true; } else { return false; } } }
protected void Page_Load(object sender, EventArgs e) { //strPagePrivilege.Add("BJKB"); //strPageUserType.Add("mana"); if (!Page.IsPostBack) { if (!string.IsNullOrEmpty(Request.QueryString["ID"]) && !string.IsNullOrEmpty(Request.QueryString["Year"]) && !string.IsNullOrEmpty(Request.QueryString["Term"])) { int ID = 0; int Year = 0; int Term = 0; if (int.TryParse(Request.QueryString["ID"], out ID) && int.TryParse(Request.QueryString["Year"], out Year) && int.TryParse(Request.QueryString["Term"], out Term)) { LabMS.BLL.Teacher Teacher = new LabMS.BLL.Teacher(); LabMS.Model.Teacher model=Teacher.GetModel(ID); if (model != null) { lb_Teacher.Text = model.Teacher_Name +" ��ʦ��ţ�"+ model.Teacher_Code; } lb_Year.Text=Year.ToString(); if (Term == 1) { lb_Term.Text = "��ѧ��"; } else { lb_Term.Text = "��ѧ��"; } } } DataBinds(); } }
protected void DataBinds() { LabMS.BLL.TeachMission Mission = new LabMS.BLL.TeachMission(); LabMS.Model.TeachMission model = new LabMS.Model.TeachMission(); model = Mission.GetModel(QueryString); tb_CourseCode.Text = model.Ms_CourseCode; tb_CourseName.Text = model.Ms_CourseName; tb_ExpHouse.Text = model.Ms_CourseHourse.ToString(); tb_StartWeek.Text = model.Ms_StartWeek.ToString(); tb_EndWeek.Text = model.Ms_EndWeek.ToString(); tb_ComputerTime.Text = model.Ms_ComputerHourse.ToString(); if (model.Ms_Teacher != null) { tb_TeacherID.Text = model.Ms_Teacher.ToString(); LabMS.BLL.Teacher Teacher = new LabMS.BLL.Teacher(); LabMS.Model.Teacher teachermodel = Teacher.GetModel(model.Ms_Teacher.Value); if (teachermodel != null) { tb_Teacher.Text = teachermodel.Teacher_Name; } } YearBind(model.Ms_Year); LabMS.BLL.Lab Lab = new LabMS.BLL.Lab(); List<LabMS.Model.Lab> ParentLab = new List<LabMS.Model.Lab>(); ParentLab = Lab.GetModelList("Lab_ParentID is null"); List<LabMS.Model.Lab> SonLab = new List<LabMS.Model.Lab>(); SonLab = Lab.GetModelList("Lab_ParentID is not null"); for (int i = 0; i < ParentLab.Count; i++) { ddl_Lab.Items.Add(new ListItem(ParentLab[i].Lab_Name, ParentLab[i].ID.ToString())); for (int j = 0; j < SonLab.Count; j++) { if (SonLab[j].Lab_ParentID == ParentLab[i].ID) { ddl_Lab.Items.Add(new ListItem("--|" + SonLab[j].Lab_Name, SonLab[j].ID.ToString())); } } } ddl_Lab.Items.Insert(0, new ListItem("--��ѡ��--", "0")); if (model.LabID != null) { ddl_Lab.Items.FindByValue(model.LabID.ToString()).Selected = true; } LabMS.BLL.DictionaryClass DicClass = new LabMS.BLL.DictionaryClass(); LabMS.BLL.Dictionary Dic = new LabMS.BLL.Dictionary(); LabMS.Model.DictionaryClass ds = new LabMS.Model.DictionaryClass(); List<LabMS.Model.Dictionary> ls = new List<LabMS.Model.Dictionary>(); if (DicClass.GetModelList("Code='Conflict'").Count != 0) { ds = DicClass.GetModelList("Code='Conflict'")[0]; ls = Dic.GetModelList("DClass='" + ds.Code + "'"); if (ls.Count != 0) { rbl_Conflict.DataSource = ls; rbl_Conflict.DataTextField = "Name"; rbl_Conflict.DataValueField = "Code"; rbl_Conflict.DataBind(); if (model.Ms_Conflict != "") { rbl_Conflict.Items.FindByValue(model.Ms_Conflict).Selected = true; } } } }
protected void Page_Load(object sender, EventArgs e) { strPagePrivilege.Add("QBZY"); strPageUserType.Add("mana"); strPageUserType.Add("teacher"); if (!Page.IsPostBack) { try { #region Get id int id; if (string.IsNullOrEmpty(Request.QueryString["id"])) { throw new Exception("�Բ����������ʵ�ҳ�治����"); } try { id = int.Parse(Request.QueryString["id"]); } catch { throw new Exception("�Բ����������ʵ�ҳ�治����"); } #endregion LabMS.Model.Resource resourceInfo; ExtendBLL.Resource resource = new ExtendBLL.Resource(); resourceInfo = resource.GetModel(id); if (resourceInfo == null) { throw new Exception("�Բ����������ʵ�ҳ�治����"); } #region ��ȡʵ���� LabMS.BLL.Lab lab = new LabMS.BLL.Lab(); DataSet dsLabs = lab.GetList(" Lab_ParentID is null "); ResourceLab.Items.Add(new ListItem("ȫ��", "-1")); foreach (DataRow dr in dsLabs.Tables[0].Rows) { ListItem li = new ListItem(); li.Text = dr["Lab_Name"].ToString(); li.Value = dr["ID"].ToString(); if (resourceInfo.LabID.Equals(int.Parse(li.Value))) { li.Selected = true; } ResourceLab.Items.Add(li); } #endregion if (resourceInfo.RecorderType.Equals(0)) // ����Ա { LabMS.BLL.UserTable staff = new LabMS.BLL.UserTable(); LabMS.Model.UserTable staffInfo = staff.GetModel(resourceInfo.ResourceRecorder.HasValue ? resourceInfo.ResourceRecorder.Value : 0); ResourceRecorder.Text = (staffInfo == null) ? "<del>��ɾ���û�</del>" : staffInfo.UserName + " ����Ա"; } else if (resourceInfo.RecorderType == 1) { LabMS.BLL.Teacher teacher = new LabMS.BLL.Teacher(); LabMS.Model.Teacher teacherInfo = teacher.GetModel(resourceInfo.ResourceRecorder.HasValue ? resourceInfo.ResourceRecorder.Value : 0); ResourceRecorder.Text = (teacherInfo == null) ? "<del>��ɾ���û�</del>" : teacherInfo.Teacher_Name + " ��ʦ"; } // ResourceType.Text = resourceInfo.ResourceType.HasValue ? resourceInfo.ResourceType.Value.ToString() : ""; // TBD ResourceTitle.Text = resourceInfo.ResourceTitle; ResourceContent.Text = Server.HtmlDecode(resourceInfo.ResourceContent); ResourceVisitTime.Text = (resourceInfo.ResourceVisitTime.Value + 1).ToString(); ResourceRecordTime.Text = resourceInfo.ResourceRecordTime.Value.ToString("yyyy��MM��dd�� hh:mm"); if (!string.IsNullOrEmpty(resourceInfo.ResourceAttachmentPath)) { ResourceAttachment.Text = "<a target='_blank' href='" + resourceInfo.ResourceAttachmentPath + "' >������ظ���</a>"; } else { ResourceAttachment.Text = "<label style='color: #ff0000;'>������</label>"; } #region Tags DataSet dsTags = resource.GetTags(resourceInfo); System.Text.StringBuilder sb = new System.Text.StringBuilder(); for (int i = dsTags.Tables[0].Rows.Count - 1; i > -1; i--) { sb.Append(dsTags.Tables[0].Rows[i]["TagName"]); if (i != 0) { sb.Append(","); } } ResourceTags.Text = sb.ToString(); #endregion } catch (Exception ex) { } } }
/// <summary> /// 保存 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btnSave_Click(object sender, EventArgs e) { #region 验证 if (string.IsNullOrEmpty(tbCode.Text.Trim())) { Common.JShelper.JSAlert(this.Page, "", "教师编号不能为空!"); tbCode.Focus(); } else if (string.IsNullOrEmpty(tbName.Text.Trim())) { Common.JShelper.JSAlert(this.Page, "", "老师名称不能为空!"); tbName.Focus(); } else if (string.IsNullOrEmpty(tbPassword.Text.Trim())) { Common.JShelper.JSAlert(this.Page, "", "密码不能为空!"); tbPassword.Focus(); } #endregion else { LabMS.Model.Teacher MT = new LabMS.Model.Teacher(); MT.CardCode = tbkpCode.Text.Trim(); MT.ComeFrom = tbcs.Text.Trim(); if (tbcsrq.Text.Trim() != "") { MT.Dirthday = DateTime.Parse(tbcsrq.Text.Trim()); } MT.Education = tbwhcd.Text.Trim(); MT.Email = tbEmail.Text.Trim(); MT.Fax = tbFax.Text.Trim(); if (tbbysj.Text.Trim() != "") { MT.GDate = DateTime.Parse(tbbysj.Text.Trim()); } MT.GSchool = tbbyxx.Text.Trim(); MT.Health = tbjkzk.Text.Trim(); MT.HomeAddress = tbhomeAdd.Text.Trim(); MT.Homephone = tbhomeTel.Text.Trim(); MT.Jobs = tbzw.Text.Trim(); MT.Marriage = tbhyzk.Text.Trim(); MT.Mobile = tbPhone.Text.Trim(); MT.Nation = tbmz.Text.Trim(); MT.OfficeAddress = tbOfficeAdd.Text.Trim(); MT.Political = tbzzmm.Text.Trim(); MT.Professional = tbjszc.Text.Trim(); MT.Province = tbPro.Text.Trim(); MT.SexCode = ddlSex.SelectedValue.ToString(); MT.Specially = tbzyjstc.Text.Trim(); MT.Teacher_Code = tbCode.Text.Trim(); MT.Teacher_Name = tbName.Text.Trim(); MT.Tel = tbOfficeTel.Text.Trim(); MT.Password = tbPassword.Text.Trim(); if (tbgzrq.Text.Trim() != "") { MT.WorkDate = DateTime.Parse(tbgzrq.Text.Trim()); } MT.ID = int.Parse(Request.QueryString["ID"].ToString()); LabMS.BLL.Teacher BT = new LabMS.BLL.Teacher(); try { BT.Update(MT); if (FlagHF.Value == "look") { Common.JShelper.JsAlertAndClose(Page, "", "修改成功!"); } else { Common.JShelper.JSAlertAndRedirect(this.Page, "", "修改成功!", "BaseDataTeacherList.aspx"); } } catch { Common.JShelper.JSAlert(this.Page, "", "修改失败!"); } } }
/// <summary> /// 根据传递过来的ID从数据库中读出初始值 /// </summary> /// <param name="ID"></param> protected void InitBindFromDB(int ID) { string str = ""; LabMS.BLL.Teacher BTeacher = new LabMS.BLL.Teacher(); LabMS.Model.Teacher MT = BTeacher.GetModel(ID); tbkpCode.Text = MT.CardCode; tbcs.Text = MT.ComeFrom; tbcsrq.Text = MT.Dirthday == null ? "" : MT.Dirthday.Value.ToString(); tbwhcd.Text = MT.Education; tbEmail.Text = MT.Email; tbFax.Text = MT.Fax; tbbysj.Text = MT.GDate == null ? "" : MT.GDate.Value.ToString(); tbbyxx.Text = MT.GSchool; tbjkzk.Text = MT.Health; tbhomeAdd.Text = MT.HomeAddress; tbhomeTel.Text = MT.Homephone; tbzw.Text = MT.Jobs; tbhyzk.Text = MT.Marriage; tbPhone.Text = MT.Mobile; tbmz.Text = MT.Nation; tbOfficeAdd.Text = MT.OfficeAddress; tbzzmm.Text = MT.Political; tbjszc.Text = MT.Professional; tbPro.Text = MT.Province; ddlSex.SelectedValue = MT.SexCode; tbzyjstc.Text = MT.Specially; tbCode.Text = MT.Teacher_Code; tbName.Text = MT.Teacher_Name; tbOfficeTel.Text = MT.Tel; tbgzrq.Text = MT.WorkDate == null ? "" : MT.WorkDate.Value.ToString(); tbPassword.Text = MT.Password; }
protected void Save_OnClick(object sender, EventArgs e) { #region if (String.IsNullOrEmpty(UserPasswordTBX.Text.Trim())) { Common.JShelper.JSAlert(Page, "script", "请输入旧密码!"); return; } if (UserPasswordTBX.Text.Length > 50) { Common.JShelper.JSAlert(Page, "script", "旧密码长度输入过长!"); return; } if (String.IsNullOrEmpty(NewPasswordTBX.Text.Trim())) { Common.JShelper.JSAlert(Page, "script", "请输入新密码密码!"); return; } if (NewPasswordTBX.Text.Length > 50) { Common.JShelper.JSAlert(Page, "script", "新密码长度输入过长!"); return; } if (!Regex.IsMatch(NewPasswordTBX.Text.Trim(), @"^\w+$")) { Common.JShelper.JSAlert(Page, "script", "新密码输入不合法(只能为数字、英文或下划线的组合)!"); return; } //if (String.IsNullOrEmpty(RePasswordTBX.Text.Trim())) //{ // Common.JShelper.JSAlert(Page, "script", "请重复输入新密码!"); //} //if (RePasswordTBX.Text.Length > 50) //{ // Common.JShelper.JSAlert(Page, "script", "重复新密码长度输入过长!"); //} //if (!Regex.IsMatch(RePasswordTBX.Text.Trim(), @"^\w+$")) //{ // Common.JShelper.JSAlert(Page, "script", "重复新密码输入不合法(只能为数字、英文或下划线的组合)!"); //} if (String.Compare(RePasswordTBX.Text, NewPasswordTBX.Text) != 0) { Common.JShelper.JSAlert(Page, "script", "两次新密码输入不一致!"); return; } //验证用户名和密码输入是否正确 if (!IsUserNameAndPassword()) { Common.JShelper.JSAlert(Page, "script", "用户名和密码输入不匹配!"); return; } #endregion if (!String.IsNullOrEmpty(UserID)) { int ID; if (int.TryParse(UserID, out ID)) { if (UserType == "mana") { LabMS.BLL.UserTable userTable = new LabMS.BLL.UserTable(); LabMS.Model.UserTable userTableModel = new LabMS.Model.UserTable(); userTableModel = userTable.GetModel(ID); userTableModel.Password = NewPasswordTBX.Text.Trim(); try { userTable.Update(userTableModel); Common.JShelper.JsAlertAndClose(Page, "script", "密码修改成功!"); } catch { Common.JShelper.JsAlertAndClose(Page, "script", "密码修改失败!"); } } else if (UserType == "teacher") { LabMS.BLL.Teacher userTable = new LabMS.BLL.Teacher(); LabMS.Model.Teacher userTableModel = new LabMS.Model.Teacher(); userTableModel = userTable.GetModel(ID); userTableModel.Password = NewPasswordTBX.Text.Trim(); try { userTable.Update(userTableModel); Common.JShelper.JsAlertAndClose(Page, "script", "密码修改成功!"); } catch { Common.JShelper.JsAlertAndClose(Page, "script", "密码修改失败!"); } } else { LabMS.BLL.Student userTable = new LabMS.BLL.Student(); LabMS.Model.Student userTableModel = new LabMS.Model.Student(); userTableModel = userTable.GetModel(ID); userTableModel.Student_Pass = NewPasswordTBX.Text.Trim(); try { userTable.Update(userTableModel); Common.JShelper.JsAlertAndClose(Page, "script", "密码修改成功!"); } catch { Common.JShelper.JsAlertAndClose(Page, "script", "密码修改失败!"); } } } else { Common.JShelper.JsAlertAndClose(Page, "script", "用户ID存储不合法,请退出系统,重新登录后进行修改密码!"); } } else { Common.JShelper.JsAlertAndClose(Page, "script", "用户Session丢失,请退出系统,重新登录后进行修改密码!"); } }
void IniPage(string strYear, string strSemester) { List<LabMS.Model.Lab> listlab = new List<LabMS.Model.Lab>(); LabMS.BLL.Lab blab = new LabMS.BLL.Lab(); try { listlab = blab.GetModelList(""); } catch (Exception ex) { lbErr.Visible = true; lbErr.Text = ex.Message; return; } List<LabMS.Model.OpentProject> listopproject = new List<LabMS.Model.OpentProject>(); LabMS.BLL.OpentProject bopproject = new LabMS.BLL.OpentProject(); List<LabMS.Model.Teacher> listmteacher = new List<LabMS.Model.Teacher>(); LabMS.BLL.Teacher bteacher = new LabMS.BLL.Teacher(); List<LabMS.Model.ProjectAppointment> listprojectapp = new List<LabMS.Model.ProjectAppointment>(); ExtendBLL.ProjectAppointment bprojectapp = new ExtendBLL.ProjectAppointment(); string strtotalTable = "<table cellpadding='5' cellspacing='0' border='1' style='width: 100%; border-collapse: collapse;' class='infoTable'>"; strtotalTable += "<thead>"; strtotalTable += "<tr class='header'>"; strtotalTable += "<th scope='col'>"; strtotalTable += "实验室"; strtotalTable += "</th>"; strtotalTable += "<th scope='col'>"; strtotalTable += "开放项目"; strtotalTable += "</th>"; strtotalTable += "</tr>"; strtotalTable += "</thead>"; strtotalTable += "<tbody>"; foreach (LabMS.Model.Lab l in listlab) { strtotalTable += "<tr>"; strtotalTable += "<td>"; strtotalTable += l.Lab_Name; strtotalTable += "</td>"; strtotalTable += "<td>"; try { listopproject = bopproject.GetModelList(" SYear=" + strYear + " and Semester = " + strSemester + " and Project_Lab='" + l.Lab_Code + "' order by ID"); } catch (Exception ex) { lbErr.Visible = true; lbErr.Text = ex.Message; return; } if (listopproject.Count > 0) { strtotalTable += "<table cellpadding='0' cellspacing='0' border='1' style='width: 100%; border-collapse: collapse;' class='infoTable'>"; strtotalTable += "<thead>"; strtotalTable += "<tr class='header'>"; strtotalTable += "<td scope='col'>"; strtotalTable += "实验项目"; strtotalTable += "</td>"; strtotalTable += "<td scope='col'>"; strtotalTable += "时间(周次)"; strtotalTable += "</td>"; strtotalTable += "<td scope='col'>"; strtotalTable += "指导老师"; strtotalTable += "</td>"; strtotalTable += "<td scope='col'>"; strtotalTable += "学生数"; strtotalTable += "</td>"; strtotalTable += "</tr>"; strtotalTable += "</thead>"; strtotalTable += "<tbody>"; foreach (LabMS.Model.OpentProject o in listopproject) { strtotalTable += "<tr>"; strtotalTable += "<td>"; strtotalTable += o.OP_ProjectName; strtotalTable += "</td>"; strtotalTable += "<td>"; strtotalTable += o.Project_StartWeek.Value.ToString() + "--" + o.Project_EndWeek.Value.ToString(); strtotalTable += "</td>"; strtotalTable += "<td>"; try { listmteacher = bteacher.GetModelList(" Teacher_Code= '" + o.OP_Teacher + "'"); } catch (Exception ex) { lbErr.Visible = true; lbErr.Text = ex.Message; return; } if (listmteacher.Count > 0) { o.OP_Teacher = listmteacher[0].Teacher_Name; } strtotalTable += o.OP_Teacher; strtotalTable += "</td>"; strtotalTable += "<td>"; try { listprojectapp = bprojectapp.GetModelList(" OP_ProjectCode ='" + o.OP_ProjectCode + "'"); } catch (Exception ex) { lbErr.Visible = true; lbErr.Text = ex.Message; return; } o.OP_OpenType = listprojectapp.Count.ToString(); strtotalTable += o.OP_OpenType; strtotalTable += "</td>"; strtotalTable += "</tr>"; } strtotalTable += "</tbody>"; strtotalTable += "</table>"; } else { strtotalTable += "无"; } strtotalTable += "</td>"; strtotalTable += "</tr>"; } strtotalTable += "</tbody>"; strtotalTable += "</table>"; lbSituation.Text = strtotalTable; }
protected void Page_Load(object sender, EventArgs e) { strPagePrivilege.Add("QBZY"); if (!UserType.Equals("mana")) { modify.Style.Add("display", "none"); } if (!Page.IsPostBack) { try { #region Get id int id; if (string.IsNullOrEmpty(Request.QueryString["id"])) { throw new Exception("�Բ����������ʵ�ҳ�治����"); } try { id = int.Parse(Request.QueryString["id"]); } catch { throw new Exception("�Բ����������ʵ�ҳ�治����"); } #endregion LabMS.Model.Resource resourceInfo; ExtendBLL.Resource resource = new ExtendBLL.Resource(); resourceInfo = resource.GetModel(id); if (resourceInfo == null) { throw new Exception("�Բ����������ʵ�ҳ�治����"); } LabMS.BLL.Lab lab = new LabMS.BLL.Lab(); LabMS.Model.Lab labInfo = lab.GetModel(resourceInfo.LabID.Value); ResourceLab.Text = (labInfo == null) ? "ȫ��" : labInfo.Lab_Name; if (resourceInfo.RecorderType == 0) // ����Ա { BLL.UserTable staff = new LabMS.BLL.UserTable(); LabMS.Model.UserTable staffInfo = staff.GetModel(resourceInfo.ResourceRecorder.HasValue ? resourceInfo.ResourceRecorder.Value : 0); ResourceRecorder.Text = (staffInfo == null) ? "<del>��ɾ���û�</del>" : staffInfo.UserName + " ����Ա"; } else if (resourceInfo.RecorderType == 1) { LabMS.BLL.Teacher teacher = new LabMS.BLL.Teacher(); LabMS.Model.Teacher teacherInfo = teacher.GetModel(resourceInfo.ResourceRecorder.HasValue ? resourceInfo.ResourceRecorder.Value : 0); ResourceRecorder.Text = (teacherInfo == null) ? "<del>��ɾ���û�</del>" : teacherInfo.Teacher_Name + " ��ʦ"; } // ResourceType.Text = resourceInfo.ResourceType.HasValue ? resourceInfo.ResourceType.Value.ToString() : ""; // TBD ResourceTitle.Text = resourceInfo.ResourceTitle; ResourceContent.Text = Server.HtmlDecode(resourceInfo.ResourceContent); ResourceVisitTime.Text = (resourceInfo.ResourceVisitTime.Value + 1).ToString(); ResourceRecordTime.Text = resourceInfo.ResourceRecordTime.Value.ToString("yyyy��MM��dd�� HH:mm"); if (!string.IsNullOrEmpty(resourceInfo.ResourceAttachmentPath)) { ResourceAttachment.Text = "<a target='_blank' href='" + resourceInfo.ResourceAttachmentPath + "' >������ظ���</a>"; } else { ResourceAttachment.Text = "<label style='color: #ff0000;'>������</label>"; } #region Tags DataSet dsTags = resource.GetTags(resourceInfo); System.Text.StringBuilder sb = new System.Text.StringBuilder(); for (int i = dsTags.Tables[0].Rows.Count - 1; i > -1; i--) { sb.Append(dsTags.Tables[0].Rows[i]["TagName"]); if (i != 0) { sb.Append(","); } } ResourceTags.Text = sb.ToString(); #endregion resourceInfo.ResourceVisitTime += 1; resource.Update(resourceInfo); } catch (Exception ex) { } } }
void bind(LabMS.Model.OpentProject mopproject) { tbOPContent.Text = mopproject.OP_OpenType; tbOPInCharge.Text = mopproject.OP_InCharge; tbOPPhone.Text = mopproject.OP_Phone; tbOPPlanningCourseTime.Text = mopproject.OP_PlanningCourseTime; tbOPProfessioanl.Text = mopproject.OP_Professioanl; tbOPReason.Text = mopproject.OP_AppIntro; tbProjectCode.Text = mopproject.OP_ProjectCode; tbProjectEndWeek.Text = mopproject.Project_EndWeek.Value.ToString(); tbProjectName.Text = mopproject.OP_ProjectName; tbProjectStartWeek.Text = mopproject.Project_StartWeek.Value.ToString(); ExtendBLL.Dictionary eDictionary = new ExtendBLL.Dictionary(); List<Model.Dictionary> listCClass = new List<LabMS.Model.Dictionary>(); listCClass = eDictionary.GetModelList(" DClass='xueke' and Code ='" + mopproject.Project_Subject + "'"); if (listCClass.Count > 0) { tbProjectSubjectCode.Text = listCClass[0].Name; } LabMS.BLL.Teacher bteacher = new LabMS.BLL.Teacher(); List<Model.Teacher> listteacher = new List<LabMS.Model.Teacher>(); listteacher = bteacher.GetModelList(" Teacher_Code ='" + mopproject.OP_Teacher + "'"); if (listteacher.Count > 0) { tbTeacherCode.Text = listteacher[0].Teacher_Name; } tbTeacherCode.Text = mopproject.OP_Teacher; lbAppDate.Text = mopproject.OP_AppTime.Value.ToShortDateString(); lbAppPerson.Text = mopproject.OP_Applicant; lbOP_Approval.Text = mopproject.OP_Approval; string strSemester = Common.Status.GetSemester(mopproject.Semester.Value); lbSTime.Text = mopproject.SYear.Value.ToString() + "学年 " + strSemester; string strStatus = Common.Status.GetOpenProjectStatus(mopproject.OP_Audit); lbStatus.Text = strStatus; ExtendBLL.ProjectAppointment eprojectapp = new ExtendBLL.ProjectAppointment(); List<LabMS.Model.Student> listStudent = new List<LabMS.Model.Student>(); listStudent = eprojectapp.GetStudentByProject(mopproject.OP_ProjectCode); gv_studentList.DataSource = listStudent; gv_studentList.DataBind(); if (mopproject.OP_Audit == "2" || mopproject.OP_Audit == "3") { panelExamine.Visible = true; lbAuditOpinion.Text = mopproject.AuditOpinion; lbCheckTime.Text = mopproject.CheckTime.Value.ToShortDateString(); } }