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);
        }
Esempio n. 2
0
        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;
        }
        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();
        }
Esempio n. 4
0
        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();
 }
Esempio n. 6
0
        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;
                }
            }
        }
        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();
            }
        }