Esempio n. 1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Student        student    = (Student)Session["loginuser"];
            string         stuAccount = student.StuAccount;
            TitleRecordBll trecordBll = new TitleRecordBll();

            ds = trecordBll.GetByAccount(stuAccount);
            if (ds != null)
            {
                int i             = ds.Tables[0].Rows.Count - 1;
                int titleRecordId = Convert.ToInt32(ds.Tables[0].Rows[i]["titleRecordId"].ToString());
                name  = ds.Tables[0].Rows[i]["teaName"].ToString();
                sex   = ds.Tables[0].Rows[i]["teaSex"].ToString();
                phone = ds.Tables[0].Rows[i]["teaPhone"].ToString();
                email = ds.Tables[0].Rows[i]["teaEmail"].ToString();
                GuideRecordBll guideBll = new GuideRecordBll();
                dsGuide = guideBll.Select(titleRecordId);
                if (dsGuide != null)
                {
                    int j = dsGuide.Tables[0].Rows.Count - 1;
                    if (j < 0)
                    {
                        opinion = "<h3 class='text-primary'>教师未回复,请耐心等待</h3>";
                    }
                    else
                    {
                        opinion = "教师最新回复:" + dsGuide.Tables[0].Rows[j]["opinion"].ToString();
                    }
                }
                else
                {
                    opinion = "<h3 class='text-primary'>教师未回复,请耐心等待</h3>";
                }
            }
        }
Esempio n. 2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Student        student        = (Student)Session["loginuser"];
            string         stuAccount     = student.StuAccount;
            TitleRecordBll titleRecordBll = new TitleRecordBll();
            TitleRecord    titleRecord    = titleRecordBll.getRtId(stuAccount);
            int            rtId           = titleRecord.TitleRecordId;
            Path           path           = pathBll.getState(rtId, 1);

            pstate = path.state;
            if (rtId == 0)
            {
                //未选题
                state = 3;
            }
            else
            {
                Result result = pathBll.selectByTitleRecordId(rtId.ToString());
                if (result == Result.记录存在)
                {
                    //显示页面
                    state = 1;
                }
                else
                {
                    state = 0;
                }
            }
        }
Esempio n. 3
0
        //获取表格数据
        public void getPage(String strWhere)
        {
            string currentPage = Request.QueryString["currentPage"];

            if (currentPage == null || currentPage.Length <= 0)
            {
                currentPage = "1";
            }

            TitleRecordBll titlerd    = new TitleRecordBll();
            Teacher        tea        = (Teacher)Session["loginuser"];
            string         teaAccount = tea.TeaAccount;
            string         where1     = "teaAccount = " + teaAccount;
            string         where2     = "teaAccount = " + teaAccount + " and " + strWhere;
            TableBuilder   tabuilder  = new TableBuilder()
            {
                StrTable      = "V_TitleRecord",
                StrWhere      = strWhere == null || strWhere == "" ? where1 : where2,
                IntColType    = 0,
                IntOrder      = 0,
                IntPageNum    = int.Parse(currentPage),
                IntPageSize   = pagesize,
                StrColumn     = "titleRecordId",
                StrColumnlist = "*"
            };

            getCurrentPage = int.Parse(currentPage);
            ds             = titlerd.SelectBypage(tabuilder, out count);
        }
Esempio n. 4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            TitleRecordBll titleRecordBll = new TitleRecordBll();
            TitleBll       titleBll       = new TitleBll();

            //获取登录学生学号
            stu = (Student)Session["loginuser"];
            string stuAccount = stu.StuAccount.ToString();

            ds = titleRecordBll.Select();
            if (ds != null)
            {
                if (ds.Tables[0].Rows.Count != 0)
                {
                    for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
                    {
                        if (stuAccount == ds.Tables[0].Rows[i]["stuAccount"].ToString())
                        {
                            string tId       = ds.Tables[0].Rows[i]["titleId"].ToString();
                            Title  title     = titleBll.GetTitle(int.Parse(tId));
                            string showTitle = title.title.ToString();
                            if (showTitle != "")
                            {
                                Response.Write("<a href='../PaperDtailStu.aspx'>你已选过题目,请点击跳转到题目详情界面  </a>");
                                Response.End();
                            }
                        }
                    }
                }
            }
            //获取op titiId
            string op      = Context.Request.QueryString["op"];
            string titleid = Context.Request.QueryString["titleId"];
            //获取学生专业id
            string proId = stu.profession.ProId.ToString();

            if (!Page.IsPostBack)
            {
                if (proId != null)
                {
                    proId = "proId=" + proId;
                    getPage(proId);
                }
            }

            if (op == "selectTitle")
            {
                StusecltTitle();
            }
        }
Esempio n. 5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Student        student        = (Student)Session["loginuser"];
            string         stuAccount     = student.StuAccount;
            TitleRecordBll titleRecordBll = new TitleRecordBll();
            PathBll        pathBll        = new PathBll();
            TitleRecord    titleRecord    = titleRecordBll.getRtId(stuAccount);
            int            titleRecordId  = titleRecord.TitleRecordId;
            OpenReport     openReport     = titleRecordBll.getState(titleRecordId);
            Path           path           = pathBll.getState(titleRecordId, 0);

            openState = openReport.state;
            state     = path.state;
        }
Esempio n. 6
0
        protected void Page_Load(object sender, EventArgs e)
        {
            TitleRecordBll trbll = new TitleRecordBll();

            student    = (Student)Session["loginuser"];
            stuAccount = student.StuAccount;
            stuName    = student.RealName;
            profession = student.profession.ProName;
            dsTR       = trbll.GetByAccount(stuAccount);
            if (dsTR == null)
            {
                opinion = "暂未选题";
            }
            else
            {
                for (int i = 0; i < dsTR.Tables[0].Rows.Count; i++)
                {
                    string stuaccount = dsTR.Tables[0].Rows[i]["stuAccount"].ToString();
                    if (stuaccount == stuAccount)
                    {
                        title         = dsTR.Tables[0].Rows[0]["title"].ToString();
                        teaName       = dsTR.Tables[0].Rows[0]["teaName"].ToString();
                        planId        = Convert.ToInt32(dsTR.Tables[0].Rows[0]["planId"].ToString());
                        titleRecordId = Convert.ToInt32(dsTR.Tables[0].Rows[0]["titleRecordId"].ToString());
                        break;
                    }
                }
                OpenReport openReport = trbll.getState(titleRecordId);
                state = openReport.state;
                or    = orbll.Select(titleRecordId);
                open  = orbll.Select(titleRecordId);
                if (open == null)
                {
                    opinion = "教师未回复,请耐心等待";
                }
                else
                {
                    opinion     = open.teacherOpinion;
                    deanOpinion = open.deanOpinion;
                }
            }

            Result result = orbll.isOpenReport(stuAccount, planId);

            if (result == Result.记录存在)
            {
                insert();
            }
        }
Esempio n. 7
0
        protected void Page_Load(object sender, EventArgs e)
        {
            TitleRecordBll trbll      = new TitleRecordBll();
            PathBll        pathBll    = new PathBll();
            Teacher        teacher    = (Teacher)Session["loginuser"];
            string         teaAccount = teacher.TeaAccount;
            string         op         = Context.Request.Form["op"];
            string         type       = Request.QueryString["type"];

            if (!IsPostBack)
            {
                Search();
                getData(Search());
            }
        }
Esempio n. 8
0
        protected void Page_Load(object sender, EventArgs e)
        {
            TitleRecordBll trbll      = new TitleRecordBll();
            ProfessionBll  probll     = new ProfessionBll();
            PlanBll        planBll    = new PlanBll();
            Teacher        teacher    = (Teacher)Session["loginuser"];
            string         teaAccount = teacher.TeaAccount;

            collegeId = teacher.college.ColID;
            dsPro     = probll.SelectByCollegeId(collegeId);
            dsPlan    = planBll.GetplanByCollegeId(collegeId);
            string op   = Context.Request.Form["op"];
            string type = Request.QueryString["type"];

            if (!IsPostBack)
            {
                Search();
                getPage(Search());
            }
            //批次下拉菜单
            if (type == "plandrop")
            {
                dropstrWhereplan = Context.Request.QueryString["dropstrWhereplan"].ToString();
                if (dropstrWhereplan == "0")
                {
                    getPage("");
                }
                string strWhere = string.Format(" planId = {0}", dropstrWhereplan);
                getPage(strWhere);
            }
            //专业下拉菜单
            if (type == "prodrop")
            {
                dropstrWherepro = Context.Request.QueryString["dropstrWherepro"].ToString();
                string strWhere = string.Format(" proId = {0}", dropstrWherepro);
                getPage(strWhere);
            }
            //所有下拉菜单
            if (type == "alldrop")
            {
                dropstrWhereplan = Context.Request.QueryString["dropstrWhereplan"].ToString();
                dropstrWherepro  = Context.Request.QueryString["dropstrWherepro"].ToString();
                string strWhere = string.Format(" proId = {0} and planId = {1}", dropstrWherepro, dropstrWhereplan);
                getPage(strWhere);
            }
        }
Esempio n. 9
0
        protected void Page_Load(object sender, EventArgs e)
        {
            TitleRecordBll trbll    = new TitleRecordBll();
            CrossBll       crossBll = new CrossBll();

            teacher = (Teacher)Session["loginuser"];
            string  teaAccount = teacher.TeaAccount;
            DataSet ds         = crossBll.SelectByTea(teaAccount);

            if (ds != null)
            {
                int planId = 0;
                for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
                {
                    string stuAccount = ds.Tables[0].Rows[i]["stuAccount"].ToString();
                    string account    = Request.QueryString["stuAccount"];
                    if (account == null || account == "")
                    {
                        string op = Request["op"];
                        if (op == "add")
                        {
                            insert();
                        }
                    }
                    else
                    {
                        if (stuAccount == account)
                        {
                            Session["stuAccount"] = stuAccount;
                            stuName           = ds.Tables[0].Rows[i]["realName"].ToString();
                            proName           = ds.Tables[0].Rows[i]["proName"].ToString();
                            title             = ds.Tables[0].Rows[i]["title"].ToString();
                            planId            = Convert.ToInt32(ds.Tables[0].Rows[i]["planId"].ToString());
                            Session["planId"] = planId;
                            break;
                        }
                    }
                }
            }
        }
Esempio n. 10
0
        //获取表格数据
        public void getPage(String strWhere)
        {
            string currentPage = Request.QueryString["currentPage"];

            if (currentPage == null || currentPage.Length <= 0)
            {
                currentPage = "1";
            }

            CrossBll crossBll = new CrossBll();
            Teacher  tea      = (Teacher)Session["loginuser"];

            teaAccount = tea.TeaAccount;
            TitleRecordBll trbll = new TitleRecordBll();
            DataSet        ds    = trbll.GetByAccount(teaAccount);

            if (ds != null)
            {
                int i             = ds.Tables[0].Rows.Count - 1;
                int titleRecoreId = Convert.ToInt32(ds.Tables[0].Rows[i]["titleRecordId"].ToString());
            }
            DataSet      dsTRAll   = trbll.Select();
            string       where1    = "teaAccount = " + teaAccount;
            string       where2    = "teaAccount = " + teaAccount + " and " + strWhere;
            TableBuilder tabuilder = new TableBuilder()
            {
                StrTable      = "V_Cross",
                StrWhere      = strWhere == null || strWhere == "" ? where1 : where2,
                IntColType    = 0,
                IntOrder      = 0,
                IntPageNum    = int.Parse(currentPage),
                IntPageSize   = pagesize,
                StrColumn     = "titleRecordId",
                StrColumnlist = "*"
            };

            getCurrentPage = int.Parse(currentPage);
            dsTR           = crossBll.SelectBypage(tabuilder, out count);
        }
Esempio n. 11
0
        protected void Page_Load(object sender, EventArgs e)
        {
            TitleRecordBll trbll      = new TitleRecordBll();
            PathBll        pathBll    = new PathBll();
            Path           path       = new Path();
            Teacher        teacher    = (Teacher)Session["loginuser"];
            string         teaAccount = teacher.TeaAccount;

            collegeId = teacher.college.ColID;
            string op   = Context.Request.Form["op"];
            string type = Request.QueryString["type"];

            if (!IsPostBack)
            {
                Search();
                getPage(Search());
            }
            string agree = Request["agree"];

            if (agree != null)
            {
                string      stuAccount  = Request["stuAccount"];
                DataSet     ds          = trbll.GetByAccount(stuAccount);
                int         i           = ds.Tables[0].Rows.Count - 1;
                TitleRecord titleRecord = new TitleRecord();
                titleRecord.TitleRecordId = Convert.ToInt32(ds.Tables[0].Rows[i]["titleRecordId"].ToString());
                if (agree == "yes")
                {
                    path.state = 3;
                }
                else if (agree == "no")
                {
                    path.state = 1;
                }
                path.type        = 1;
                path.titleRecord = titleRecord;
                pathBll.updateState(path);
            }
        }
Esempio n. 12
0
 /// <summary>
 /// 根据登录者判断加载公告
 /// </summary>
 public void loadNewsList()
 {
     state = Session["state"].ToString();
     if (state == "0" || state == "2")//根据登录的管理员只显示相关公告
     {
         admin = (Teacher)Session["user"];
         colId = admin.college.ColID;
         teaId = admin.TeaAccount;
     }
     else if (state == "1")//根据登录的教师只显示相关公告
     {
         teacher = (Teacher)Session["loginuser"];
         colId   = teacher.college.ColID;
         teaId   = teacher.TeaAccount;
     }
     else//根据登录的学生只显示相关公告
     {
         stu        = (Student)Session["loginuser"];
         col        = stu.college;
         colId      = col.ColID;
         stuAccount = stu.StuAccount;
         TitleRecordBll recordBll = new TitleRecordBll();
         ds = recordBll.Select();
         if (ds != null)
         {
             for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
             {
                 if (stuAccount == ds.Tables[0].Rows[i]["stuAccount"].ToString())
                 {
                     TitleBll titleBll = new TitleBll();
                     titleId = int.Parse(ds.Tables[0].Rows[i]["titleId"].ToString());
                     title   = titleBll.GetTitle(titleId);
                     teaId   = title.teacher.TeaAccount;
                 }
             }
         }
     }
 }
Esempio n. 13
0
        /// <summary>
        /// 添加学生
        /// </summary>
        /// <returns></returns>
        public Result addStudent()
        {
            string stuAccount = Request["stuAccount"];

            string[] stuList = stuAccount.Split('?');
            for (int i = 0; i < stuList.Length - 1; i++)
            {
                TitleRecordBll titleBll      = new TitleRecordBll();
                TitleRecord    titleRecord   = titleBll.getRtId(stuList[i]);
                int            titleRecordId = titleRecord.TitleRecordId;
                DefenceBll     defenceBll    = new DefenceBll();
                DefenceRecord  defence       = new DefenceRecord();
                defence.titleRecord = titleRecord;
                DefenceGroup defenceGroup = new DefenceGroup();
                int          defenId      = Convert.ToInt32(Session["defenGroupId"]);
                defenceGroup.defenGroupId = defenId;
                defence.defenceGroup      = defenceGroup;
                row = defenceBll.InsertStudent(defence);
                StudentBll stuBll  = new StudentBll();
                Student    student = stuBll.GetModel(stuList[i]);
                string     stu     = stuList[i];
                student.state = 1;
                Result result = stuBll.Updata(student);
                if (row != Result.添加成功 || result != Result.更新成功)
                {
                    Response.Write("添加失败");
                    Response.End();
                    break;
                }
                else
                {
                    LogHelper.Info(this.GetType(), tea.TeaAccount + " - " + tea.TeaName + " - 添加" + defenId + "答辩小组学生 - " + student.StuAccount + " - " + student.RealName);
                }
            }
            return(row);
        }
Esempio n. 14
0
        /// <summary>
        /// //获取数据
        /// </summary>
        /// <param name="strWhere">查询字符串</param>
        public void getPage(String strWhere)
        {
            string currentPage = Request.QueryString["currentPage"];

            if (currentPage == null || currentPage.Length <= 0)
            {
                currentPage = "1";
            }
            TitleRecordBll titlerd   = new TitleRecordBll();
            TableBuilder   tabuilder = new TableBuilder()
            {
                StrTable      = "V_TitleRecord",
                StrWhere      = strWhere == null ? "" : strWhere,
                IntColType    = 0,
                IntOrder      = 0,
                IntPageNum    = int.Parse(currentPage),
                IntPageSize   = pagesize,
                StrColumn     = "titleRecordId",
                StrColumnlist = "*"
            };

            getCurrentPage = int.Parse(currentPage);
            ds             = titlerd.SelectBypage(tabuilder, out count);
        }
Esempio n. 15
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string account = "", teaAccount = "";
            int    college = 0;
            int    state   = Convert.ToInt32(Session["state"].ToString());

            if (state == 1)
            {
                Teacher tea = (Teacher)Session["loginuser"];
                account = tea.TeaAccount;
                college = tea.college.ColID;
            }
            else if (state == 0 || state == 2)
            {
                Teacher admin = (Teacher)Session["user"];
                account = admin.TeaAccount;
                college = admin.college.ColID;
            }
            else if (state == 3)
            {
                Student stu = (Student)Session["loginuser"];
                account = stu.StuAccount;
                college = stu.college.ColID;
                TitleRecordBll trBll = new TitleRecordBll();
                bool           flag  = trBll.selectBystuId(account);
                if (flag == true)
                {
                    TableBuilder tbd = new TableBuilder()
                    {
                        StrTable      = "V_TitleRecord",
                        StrColumn     = "titleRecordId",
                        IntColType    = 0,
                        IntOrder      = 0,
                        StrColumnlist = "*",
                        IntPageSize   = 1,
                        IntPageNum    = 1,
                        StrWhere      = "stuAccount ='" + account + "'"
                    };
                    dsTea      = trBll.SelectBypage(tbd, out count);
                    teaAccount = dsTea.Tables[0].Rows[0]["teaAccount"].ToString();
                }
            }
            if (!Page.IsPostBack)
            {
                roleId = Request.QueryString["roleId"];
                if (roleId == "0")
                {
                    strteaType = "teaType=0";
                    newsType   = "学校公告";
                }
                else if (roleId == "1")
                {
                    strteaType = "teaType=1 and teaAccount = '" + teaAccount + "'";
                    newsType   = "学生公告";
                }
                else if (roleId == "2")
                {
                    strteaType = "teaType=2 and collegeId=" + college;
                    newsType   = "学院公告";
                }
                getdata(strteaType);
            }
        }
Esempio n. 16
0
        protected void Page_Load(object sender, EventArgs e)
        {
            TitleRecordBll    trbll   = new TitleRecordBll();
            MedtermQualityBll mqbll   = new MedtermQualityBll();
            MedtermQuality    medterm = new MedtermQuality();

            state = Convert.ToInt32(Session["state"].ToString());
            int    titleRecordId = 0;
            string op            = Request["op"];

            if (!IsPostBack)
            {
                string stuAccount = Request.QueryString["stuAccount"];
                if (stuAccount != null)
                {
                    Session["stuAccount"] = stuAccount;
                }
                else
                {
                    if (state == 3)
                    {
                        Student student = (Student)Session["loginuser"];
                        stuAccount = student.StuAccount;
                    }
                    else
                    {
                        stuAccount = Session["stuAccount"].ToString();
                    }
                }
            }
            if (state == 1)
            {
                Teacher     teacher     = (Teacher)Session["loginuser"];
                string      teaAccount  = teacher.TeaAccount;
                string      acount      = Session["stuAccount"].ToString();
                TitleRecord titleRecord = trbll.getRtIdByTea(acount, teaAccount);
                TitleRecord stuTitle    = trbll.GetTitleRecord(titleRecord.TitleRecordId);
                mq = mqbll.Select(titleRecord.TitleRecordId);
                if (mq == null)
                {
                    content = "学生未提交中期质量检查";
                }
                else
                {
                    planFinishSituation = mq.planFinishSituation;
                    stuAccount          = acount;
                    stuName             = stuTitle.student.RealName;
                    proName             = stuTitle.profession.ProName;
                    title       = stuTitle.title.title;
                    collegeName = teacher.college.ColName;
                    teaName     = teacher.TeaName;
                    MedtermQuality medtermQuality = mqbll.getState(titleRecord.TitleRecordId);
                    mstate = medtermQuality.state;
                    if (mstate == 3)
                    {
                        teacherOpinion = mq.teacherOpinion;
                    }
                }
                if (op == "teacher")
                {
                    try
                    {
                        string opinion = Request["teacher"];
                        medterm.teacherOpinion = opinion;
                        medterm.dateTime       = DateTime.Now;
                        medterm.titleRecord    = titleRecord;
                        medterm.state          = 3;
                        Result row = mqbll.teaInsert(medterm);
                        if (row == Result.添加成功)
                        {
                            LogHelper.Info(this.GetType(), teacher.TeaAccount + " - " + teacher.TeaName + " - 教师提交 - " + stuTitle.student.StuAccount + " - " + stuTitle.student.RealName + " - 学生的中期质量报告意见");
                            Response.Write("提交成功");
                            Response.End();
                        }
                        else
                        {
                            Response.Write("提交失败");
                            Response.End();
                        }
                    }
                    catch (Exception ex)
                    {
                        LogHelper.Error(this.GetType(), ex);
                    }
                }
            }
            else if (state == 3)
            {
                try
                {
                    Student student = (Student)Session["loginuser"];
                    stuAccount  = student.StuAccount;
                    stuName     = student.RealName;
                    proName     = student.profession.ProName;
                    collegeName = student.college.ColName;
                    DataSet        ds             = trbll.GetByAccount(stuAccount);
                    TitleRecordBll titleRecordBll = new TitleRecordBll();
                    TitleRecord    titleRecord    = titleRecordBll.getRtId(stuAccount);
                    int            rtId           = titleRecord.TitleRecordId;
                    Result         result         = pathBll.selectByTitleRecordId(rtId.ToString());
                    if (ds == null)
                    {
                        content = "暂未选题";
                    }
                    else
                    {
                        if (result == Result.记录存在)
                        {
                            mq = mqbll.Select(titleRecord.TitleRecordId);
                            if (mq != null)
                            {
                                planFinishSituation = mq.planFinishSituation;
                            }
                            for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
                            {
                                string stuaccount = ds.Tables[0].Rows[i]["stuAccount"].ToString();
                                if (stuaccount == stuAccount)
                                {
                                    title         = ds.Tables[0].Rows[0]["title"].ToString();
                                    teaName       = ds.Tables[0].Rows[0]["teaName"].ToString();
                                    titleRecordId = Convert.ToInt32(ds.Tables[0].Rows[i]["titleRecordId"].ToString());
                                    break;
                                }
                            }
                            MedtermQuality medtermQuality = mqbll.getState(titleRecordId);
                            mstate = medtermQuality.state;
                            if (mstate == 3)
                            {
                                teacherOpinion = mq.teacherOpinion;
                            }
                        }
                        else
                        {
                            content = "暂未提交论文";
                        }
                    }
                    if (op == "student")
                    {
                        string plan = Request["student"];
                        medterm.planFinishSituation = plan;
                        medterm.dateTime            = DateTime.Now;
                        titleRecord.TitleRecordId   = titleRecordId;
                        medterm.titleRecord         = titleRecord;
                        medterm.state = 2;
                        Result row = mqbll.stuInsert(medterm);
                        if (row == Result.添加成功)
                        {
                            LogHelper.Info(this.GetType(), student.StuAccount + " - " + student.RealName + " - 学生提交中期质量报告");
                            Response.Write("提交成功");
                            Response.End();
                        }
                        else
                        {
                            Response.Write("提交失败");
                            Response.End();
                        }
                    }
                }
                catch (Exception ex)
                {
                    LogHelper.Error(this.GetType(), ex);
                }
            }
        }
Esempio n. 17
0
        protected void Page_Load(object sender, EventArgs e)
        {
            tea = (Teacher)Session["loginuser"];
            TitleRecordBll trbll      = new TitleRecordBll();
            PathBll        pathBll    = new PathBll();
            Teacher        teacher    = (Teacher)Session["loginuser"];
            string         teaAccount = teacher.TeaAccount;

            collegeId = teacher.college.ColID;
            string addop = Context.Request.Form["op"];
            string type  = Request.QueryString["type"];

            op = Request["op"];
            try
            {
                if (op == "add")
                {
                    string         stuAccount = Request["stuAccount"];
                    string         opinion    = Request["opinion"];
                    GuideRecordBll guideBll   = new GuideRecordBll();
                    GuideRecord    guide      = new GuideRecord();
                    DataSet        dsTR       = trbll.GetByAccount(stuAccount);
                    int            i          = dsTR.Tables[0].Rows.Count - 1;
                    guide.opinion = opinion;
                    TitleRecord titleRecord = new TitleRecord();
                    titleRecord.TitleRecordId = Convert.ToInt32(dsTR.Tables[0].Rows[i]["titleRecordId"].ToString());
                    guide.titleRecord         = titleRecord;
                    guide.dateTime            = DateTime.Now;
                    path             = pathBll.Select(titleRecord.TitleRecordId, stuAccount);
                    guide.path       = path;
                    path.titleRecord = titleRecord;
                    path.state       = 1;
                    path.type        = 0;
                    Result result = pathBll.updateState(path);
                    if (result == Result.更新成功)
                    {
                        Result row = guideBll.Insert(guide);
                        if (row == Result.添加成功)
                        {
                            StudentBll studentBll = new StudentBll();
                            Student    stu        = studentBll.GetModel(stuAccount);
                            LogHelper.Info(this.GetType(), tea.TeaAccount + " - " + tea.TeaName + " - 教师添加 - " + stuAccount + " - " + stu.RealName + " - 学生的指导记录");
                            Response.Write("提交成功");
                            Response.End();
                        }
                        else
                        {
                            Response.Write("提交失败");
                            Response.End();
                        }
                    }
                    else
                    {
                        Response.Write("提交失败");
                        Response.End();
                    }
                }
                else if (op == "download")
                {
                    download = "download";
                    string account          = Request["stuAccount"];
                    Path   getTitleRecordId = pathBll.getTitleRecordId(account);
                    int    titleRecordId    = getTitleRecordId.titleRecord.TitleRecordId;
                    paperPath = pathBll.Select(titleRecordId, account);
                    //Response.Redirect(paperPath.paperPath);
                    Response.Write("<script>$('#loadHref').href = '" + paperPath.paperPath + "';</script>");
                    //Response.End();
                }
                if (!IsPostBack)
                {
                    Search();
                    getPage(Search());
                }
            }
            catch (Exception ex)
            {
                LogHelper.Error(this.GetType(), ex);
            }
        }
Esempio n. 18
0
        protected void Page_Load(object sender, EventArgs e)
        {
            TitleRecordBll trbll         = new TitleRecordBll();
            OpenReportBll  orbll         = new OpenReportBll();
            Teacher        teacher       = (Teacher)Session["loginuser"];
            string         teaAccount    = teacher.TeaAccount;
            DataSet        ds            = trbll.GetByAccount(teaAccount);
            int            titleRecordId = 0;
            string         account       = Request.QueryString["stuAccount"];

            for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
            {
                string stuaccount = ds.Tables[0].Rows[i]["stuAccount"].ToString();
                if (stuaccount == account)
                {
                    stuAccount    = stuaccount;
                    stuName       = ds.Tables[0].Rows[i]["realName"].ToString();
                    proName       = ds.Tables[0].Rows[i]["proName"].ToString();
                    title         = ds.Tables[0].Rows[i]["title"].ToString();
                    titleRecordId = Convert.ToInt32(ds.Tables[0].Rows[i]["titleRecordId"].ToString());
                    break;
                }
            }
            or      = orbll.Select(titleRecordId);
            teaName = teacher.TeaName;
            string op             = Request["op"];
            string teacherOpinion = Request["teacherOpinion"];
            string deanOpinion    = Request["deanOpinion"];

            try
            {
                if (op == "no")
                {
                    int    openId = or.openId;
                    Result row    = orbll.teaInsert(openId, teacherOpinion);
                    Result state  = orbll.updateState(1, titleRecordId);
                    if (deanOpinion != "")
                    {
                        Result dean = orbll.deanInsert(openId, teacherOpinion);
                        if (row == Result.添加成功 && dean == Result.添加成功)
                        {
                            LogHelper.Info(this.GetType(), teacher.TeaAccount + " - " + teacher.TeaName + " - 教师不同意并回复 - " + stuAccount + " - " + stuName + " - 学生的开题报告");
                            Response.Write("提交成功");
                            Response.End();
                        }
                        else
                        {
                            Response.Write("提交失败");
                            Response.End();
                        }
                    }
                    if (row == Result.添加成功)
                    {
                        LogHelper.Info(this.GetType(), teacher.TeaAccount + " - " + teacher.TeaName + " - 教师不同意并回复 - " + stuAccount + " - " + stuName + " - 学生的开题报告");
                        Response.Write("提交成功");
                        Response.End();
                    }
                    else
                    {
                        Response.Write("提交失败");
                        Response.End();
                    }
                }
                else if (op == "yes")
                {
                    int    openId = or.openId;
                    Result row    = orbll.teaInsert(openId, teacherOpinion);
                    Result state  = orbll.updateState(3, titleRecordId);
                    if (deanOpinion != "")
                    {
                        Result dean = orbll.deanInsert(openId, teacherOpinion);
                        if (row == Result.添加成功 && dean == Result.添加成功 && state == Result.更新成功)
                        {
                            LogHelper.Info(this.GetType(), teacher.TeaAccount + " - " + teacher.TeaName + " - 教师同意并回复 - " + stuAccount + " - " + stuName + " - 学生的开题报告");
                            Response.Write("提交成功");
                            Response.End();
                        }
                        else
                        {
                            Response.Write("提交失败");
                            Response.End();
                        }
                    }
                    if (row == Result.添加成功 && state == Result.更新成功)
                    {
                        LogHelper.Info(this.GetType(), teacher.TeaAccount + " - " + teacher.TeaName + " - 教师同意并回复 - " + stuAccount + " - " + stuName + " - 学生的开题报告");
                        Response.Write("提交成功");
                        Response.End();
                    }
                    else
                    {
                        Response.Write("提交失败");
                        Response.End();
                    }
                }
            }
            catch (Exception ex)
            {
                LogHelper.Error(this.GetType(), ex);
            }
        }
Esempio n. 19
0
        protected void Page_Load(object sender, EventArgs e)
        {
            TitleRecordBll trbll   = new TitleRecordBll();
            ScoreBll       sbll    = new ScoreBll();
            Student        student = (Student)Session["loginuser"];

            stuAccount = student.StuAccount;
            stuName    = student.RealName;
            proName    = student.profession.ProName;
            DataSet dsTR = trbll.GetByAccount(stuAccount);

            if (dsTR == null)
            {
                content = "暂未选题";
            }
            else
            {
                int planId = 0;
                for (int i = 0; i < dsTR.Tables[0].Rows.Count; i++)
                {
                    string stuaccount = dsTR.Tables[0].Rows[i]["stuAccount"].ToString();
                    if (stuaccount == stuAccount)
                    {
                        titleRecordId = Convert.ToInt32(dsTR.Tables[0].Rows[0]["titleRecordId"].ToString());
                        title         = dsTR.Tables[0].Rows[0]["title"].ToString();
                        planId        = Convert.ToInt32(dsTR.Tables[0].Rows[0]["planId"].ToString());
                        break;
                    }
                }
                Score _score = sbll.getState(titleRecordId.ToString());
                state = _score.state;
                if (state == 0 || state == 1 || state == 2)
                {
                    content = "暂无成绩";
                }
                else
                {
                    //获取成绩
                    DataSet ds        = sbll.Select(stuAccount, planId);
                    int     openState = Convert.ToInt32(ds.Tables[0].Rows[0]["openState"].ToString());
                    if (openState == 0)
                    {
                        Response.Write("成绩还未开放查询,请耐心等待");
                        Response.End();
                    }
                    else
                    {
                        double guideScore = 0, crossScore = 0, defenceScore = 0;
                        for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
                        {
                            string remarks = ds.Tables[0].Rows[i]["remarks"].ToString();
                            if (remarks == "指导成绩")
                            {
                                guideScore = Convert.ToDouble(ds.Tables[0].Rows[i]["score"].ToString());
                            }
                            else if (remarks == "交叉评阅")
                            {
                                crossScore = Convert.ToDouble(ds.Tables[0].Rows[i]["score"].ToString());
                            }
                            else if (remarks == "答辩成绩")
                            {
                                defenceScore = Convert.ToDouble(ds.Tables[0].Rows[i]["score"].ToString());
                            }
                        }
                        score = guideScore * 0.4 + crossScore * 0.3 + defenceScore * 0.3;
                    }
                }
            }
        }
Esempio n. 20
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string op  = Context.Request.Form["op"];
            string op1 = Context.Request.QueryString["op"];
            //下拉专业ID
            string dropstrWhere = Request.QueryString["dropstrWhere"];
            //下拉批次ID
            string batchWhere = Request.QueryString["batchWhere"];
            //下拉分院ID
            string collegeIdstWhere = Request.QueryString["collegeIdstrWhere"];
            //搜索信息
            string strsearch = Request.QueryString["search"];

            //获取登录者信息、判断是分院管理员还是超管
            userType     = Session["state"].ToString();
            collegeAdmin = (Teacher)Session["user"];
            if (userType == "0")
            {
                //0为超级管理员
                bads  = colbll.Select();
                prods = probll.Select();

                if (collegeIdstWhere == "0" || collegeIdstWhere == "null" || collegeIdstWhere == null)
                {
                    plands = planbll.Select();
                }
                else
                {
                    plands = planbll.GetplanByCollegeId(int.Parse(collegeIdstWhere));
                }
                if (collegeIdstWhere != null && collegeIdstWhere != "null" && batchWhere == "null")
                {
                    // 分院id不为空,批次id为空

                    getPage(Searchcollege());
                }
                else if (batchWhere != null && batchWhere != "null" && (collegeIdstWhere == "null" || collegeIdstWhere == "0"))
                {
                    // 分院id为空,批次id不为空
                    getPage(batcchdrop());
                }
                else if (collegeIdstWhere != null && collegeIdstWhere != "null" && batchWhere != null && batchWhere != "null")
                {
                    //两个都不为空
                    getPage(SearchCollegeAndBatch());
                }
                else if (strsearch != null)
                {
                    getPage(Search());
                }
                else
                {
                    getPage("");
                }
            }
            else if (userType == "2")
            {
                //2为分院管理员
                //获取分管所在分院ID
                int collegeId = collegeAdmin.college.ColID;

                prods  = probll.SelectByCollegeId(collegeId);
                plands = planbll.GetplanByCollegeId(collegeId);

                if (dropstrWhere != null && dropstrWhere != "null" && batchWhere == "null")
                {// 如果批次id为空,专业id不为空
                    getPage(Searchdrop());
                }
                else if (batchWhere != null && batchWhere != "null" && (dropstrWhere == "null" || dropstrWhere == "0"))
                {// 如果专业id为空,批次id不为空
                    getPage(batcchdrop());
                }
                else if (dropstrWhere != null && dropstrWhere != "null" && batchWhere != null && batchWhere != "null")
                {
                    //两个都不为空
                    getPage(SearchProAndBatch());
                }
                else if (strsearch != null)
                {
                    getPage(Search());
                }
                else
                {
                    getPage("");
                }
            }
            else
            {
                prods  = probll.Select();
                plands = planbll.Select();
                getPage("");
            }
            if (op == "del")
            {//删除
                IsdeleteCollege();
                delPro();
            }
            //导出列表
            if (op1 == "export")
            {
                //分院id
                string collegeId = Request.QueryString["collegeIdstrWhere"];
                //专业id
                string pro = Request.QueryString["dropstrWhere"];
                //批次Id
                string batch = Request.QueryString["batchWhere"];
                //输入框条件
                string input    = Request.QueryString["search"];
                string strWhere = "";

                if (userType == "2")
                {
                    if (input == null)
                    {
                        if ((pro == "null" || pro == "0") && batch == "null")
                        {
                            strWhere = string.Format("");
                        }
                        else if (pro != "null" && batch == "null")
                        {
                            strWhere = string.Format(" where proId = {0}", "'" + pro + "'");
                        }
                        else if ((pro == "null" || pro == "0") && batch != "null")
                        {
                            strWhere = string.Format(" where planId = {0}", "'" + batch + "'");
                        }
                        else
                        {
                            strWhere = string.Format(" where planId = {0} and proId = {1}", "'" + batch + "'", "'" + pro + "'");
                        }
                    }
                    //如果不为空传 input里的值
                    else
                    {
                        strWhere = string.Format(" where teaName {0} or title {0} or realName {0} or planName {0} or proName {0} or collegeName {0}", "like '%" + input + "%'");
                    }
                }
                else
                {
                    if (input == null)
                    {
                        if (collegeId == "null" && batch == "null")
                        {
                            strWhere = string.Format("");
                        }
                        else if (collegeId != "null" && batch == "null")
                        {
                            strWhere = string.Format(" where collegeId = {0}", "'" + collegeId + "'");
                        }
                        else if ((collegeId == "null" || collegeId == "0") && batch != "null")
                        {
                            strWhere = string.Format(" where planId = {0}", "'" + batch + "'");
                        }
                        else
                        {
                            strWhere = string.Format(" where planId = {0} and collegeId = {1}", "'" + batch + "'", "'" + collegeId + "'");
                        }
                    }
                    //如果不为空传 input里的值
                    else
                    {
                        strWhere = string.Format(" where teaName {0} or title {0} or realName {0} or planName {0} or proName {0} or collegeName {0}", "like '%" + input + "%'");
                    }
                }

                TitleRecordBll titlerd = new TitleRecordBll();
                try
                {
                    var       name = DateTime.Now.ToString("yyyyMMddhhmmss") + new Random(DateTime.Now.Second).Next(10000);
                    DataTable dt   = titlerd.ExportExcel(strWhere);
                    if (dt != null && dt.Rows.Count > 0)
                    {
                        var path = Server.MapPath("~/download/选题记录导出/" + name + ".xls");
                        ExcelHelper.x2003.TableToExcelForXLS(dt, path);
                        downloadfile(path);
                    }
                    else
                    {
                        Response.Write("<script language='javascript'>alert('查询不到数据,不能执行导出操作!')</script>");
                    }
                }
                catch (Exception ex)
                {
                    LogHelper.Error(this.GetType(), ex);
                }
            }
        }