示例#1
0
    private void InitTestItem()
    {
        string          planId = Request["plan_id"];
        TESTITEMINFOREQ req    = new TESTITEMINFOREQ();

        if (!string.IsNullOrEmpty(planId))
        {
            req.dwTestPlanID = ToUInt(planId);
        }
        req.dwYearTerm = yearTerm.dwYearTerm;
        req.dwAccNo    = acc.dwAccNo;
        //req.dwPlanKind = (uint)UNITESTPLAN.DWKIND.TESTPLANKIND_TEACHING;
        req.szReqExtInfo.szOrderKey  = "szTestPlanName";
        req.szReqExtInfo.szOrderMode = "ASC";
        TESTITEMINFO[] rlt;
        if (m_Request.Reserve.GetTestItemInfo(req, out rlt) == REQUESTCODE.EXECUTE_SUCCESS)
        {
            string head = "<table class='table' style='margin-bottom:60px;'><thead style='background-color:#F3F3F3;'><tr>" +
                          "<th><span class='text-primary'><span class='glyphicon glyphicon-list'></span> 实验列表</span></th>" +
                          "<th>教师</th><th>学时</th><th></th><th>实验报告模版</th><th>实验报告状态</th><th></th><th>实验评分</th></tr></thead><tbody>";
            for (int i = 0; i < rlt.Length; i++)
            {
                TESTITEMINFO it = rlt[i];
                //if (yearTerm.dwYearTerm != it.dwYearTerm) continue;
                uint?usehour;
                InitResvPanel(it, out usehour);
                if (i == 0 || it.dwTestPlanID != rlt[i - 1].dwTestPlanID)
                {
                    uint?kind = it.dwPlanKind;
                    resultList += (resultList == "" ? "" : "</tbody></table></div>") + "<div class='plan_kind_" + kind + "'><h2 class='h_title'>" + it.szCourseName + " <small style='font-size:16px;'>" + (kind == 1?"教学统一安排":(kind == 2?"教学开放实验":"")) + "</small></h2>" + head;// (i == rlt.Length - 1 ? "" : head);
                }
                resultList += "<tr id='test_it_" + it.dwTestItemID + "'><td>" + it.szTestName + "</td><td>" + it.szTeacherName + " </td>" +
                              "<td>" + it.dwTestHour + " 学时</td>" +
                              "<td><div><a class='click btn_test_resv' test_id='" + it.dwTestItemID + "'>上课时间安排 <span class='caret'></span></a></div></td>" +
                              //"<td>" + Util.Converter.GetTestItemState(it.dwStatus) + "</td>" +
                              "<td>" + (it.szReportFormURL == "" ? "<span class='orange'>缺少实验报告模版</span>" : "<a href='" + Page.ResolveClientUrl("~/ClientWeb/") + "upload/UpLoadFile/" + it.szReportFormURL + "'>下载实验报告模版</a>") + "</td>" +
                              "<td>" + (it.szReportURL == "" ? "<span class='orange'>未上传实验报告</span>" : "<a href='" + Page.ResolveClientUrl("~/ClientWeb/") + "upload/UpLoadFile/" + it.dwTestItemID + "/" + it.szReportURL + "'>已上传,点击下载</a>") + "</td>" +
                              "<td><a class='click' onclick='upload(\"" + it.dwSID + "\",\"" + it.dwTestItemID + "\",\"" + it.szTestName + "\")'>上传实验报告  <span class='glyphicon glyphicon-upload'></span></a></td>" +
                              "<td>" + (it.dwReportScore == 0 ? "<div class='orange text-center'>未评分</div>" : "<div class='text-info text-center'>" + it.dwReportScore + " 分 <span title='" + it.szReportMarkInfo + "'>[评语]</span></div>") + "</td></tr>";
            }
            if (resultList != "")
            {
                resultList += "</tbody></table></div>";
            }
        }
    }
示例#2
0
    private void InitReport()
    {
        UNITESTITEM test = GetTestItemByID(testId);

        if (test.dwTestItemID == null)
        {
            MsgBox("未找到实验");
            return;
        }
        else
        {
            curLink = test.dwTestPlanID + "," + testId;
            plan    = GetTestPlanByID(test.dwTestPlanID.ToString());
            InitResvRec();
            curTest = test.szTestName;
        }
        TESTITEMINFOREQ req = new TESTITEMINFOREQ();

        req.dwTeacherID  = acc.dwAccNo;
        req.dwTestItemID = ToUInt(testId);
        TESTITEMINFO[] rlt;
        if (m_Request.Reserve.GetTestItemInfo(req, out rlt) == REQUESTCODE.EXECUTE_SUCCESS)
        {
            for (int i = 0; i < rlt.Length; i++)
            {
                TESTITEMINFO info    = rlt[i];
                string       url     = info.szReportURL == "" ? "<span class='orange'>未提交实验报告</span>" : "<a href='" + Page.ResolveClientUrl("~/ClientWeb/") + "upload/UpLoadFile/" + info.dwTestItemID + "/" + info.szReportURL + "'>下载实验报告 <span class='glyphicon glyphicon-download'></span></a>";
                uint?        score   = info.dwReportScore;
                string       szScore = (score == null || score == 0) ? "<span class='orange'>未评分</span>" : "<span class='text-primary'>" + score + " 分</span>";
                report_list += "<tr><td>" + (i + 1) + "</td><td>" + info.szTrueName + "(" + info.szPID + ")</td><td>" + url + "</td><td>" + szScore + "</td>" +
                               "<td>" + GetAttend(info.dwAccNo) + "</td>" +
                               "<td><button type='button' class='btn btn-info btn-xs' onclick='correct(\"" + info.dwSID + "\",\"" + info.dwAccNo + "\",\"" + info.dwReportScore + "\",\"" + info.szReportMarkInfo + "\");'>评分  <span class='glyphicon glyphicon-edit'></span></button></td></tr>";
            }
        }
        else
        {
            MsgBox(m_Request.szErrMsg);
        }
    }
示例#3
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["tabs"] != null)
        {
            m_tab = (int)Session["tabs"];
        }
        if (m_Request.m_UniDCom.SessionID == 0)
        {
            if (!string.IsNullOrEmpty((string)Request["sessionid"]))
            {
                Session["sessionid"]        = Parse(Request["sessionid"]);
                Session["UniCodeSessionid"] = Request["sessionid"];
            }
            if (!string.IsNullOrEmpty((string)Request["staid"]))
            {
                Session["StationSN"] = Parse(Request["staid"]);
                Session["UniStaid"]  = Request["staid"];
            }
            if (string.IsNullOrEmpty((string)Session["UniCodeSessionid"]))
            {
                Response.Redirect("Error.html");
                return;
            }
            m_Request.m_UniDCom.SessionID = Parse((string)Session["UniCodeSessionid"]);
            m_Request.m_UniDCom.StaSN     = Parse((string)Session["UniStaid"]);
        }
        UNIACCOUNT accno = new UNIACCOUNT();

        if (Session["loginacc"] == null)
        {
            ACCINFOREQ recGet = new ACCINFOREQ();

            if (m_Request.Account.AccInfoGet(recGet, out accno) == REQUESTCODE.EXECUTE_SUCCESS)
            {
                Session["loginacc"] = accno;
            }
            else
            {
                Response.Write("未获取个人信息请再试");
                Response.End();
            }
        }
        szFormID = form1.ClientID;
        string szFileID = Request["delID"];

        if (szFileID != null && szFileID != "" && szFileID.IndexOf(',') == -1)
        {
            if (isExist(szFileID))
            {
                CLOUDDISK diskDel = new CLOUDDISK();
                diskDel.dwFileID = Parse(szFileID);
                if (m_Request.Account.CloudDiskDel(diskDel) == REQUESTCODE.EXECUTE_SUCCESS)
                {
                    Session["tabs"] = 1;
                }
            }
        }

        TESTITEMINFOREQ testItemReq = new TESTITEMINFOREQ();

        TESTITEMINFO[] testitem;
        if (m_Request.Reserve.GetTestItemInfo(testItemReq, out testitem) == REQUESTCODE.EXECUTE_SUCCESS)
        {
            for (int i = 0; i < testitem.Length; i++)
            {
                m_szOut += "<tr>";
                m_szOut += "<td>" + testitem[i].szTeacherName + "</td>";
                m_szOut += "<td>" + testitem[i].szCourseName + "</td>";
                m_szOut += "<td>" + testitem[i].szTestName + "</td>";
                uint   uState = (uint)testitem[i].dwStatus;
                uint   uScore = (uint)testitem[i].dwReportScore;
                string szURL  = testitem[i].szReportURL;
                if (uScore != 0)
                {
                    m_szOut += "<td>" + "实验报告已批改" + "</td>";
                    m_szOut += "<td>" + "" + "</td>";
                }
                else
                {
                    if (szURL != null && szURL != "")
                    {
                        m_szOut += "<td>" + "实验报告已提交" + "</td>";
                        string szHref = "<a class='href' href='" + ("..\\ClientWeb\\upload\\UpLoadFile\\" + testitem[i].dwTestItemID.ToString()) + "\\" + testitem[i].szReportURL + "' class='subReport'>下载</a>";
                        szHref  += "___<a class='href subReport' data-id=" + testitem[i].dwTestItemID.ToString() + " >重新提交</a>";
                        m_szOut += "<td>" + szHref + "</td>";
                    }
                    else
                    {
                        m_szOut += "<td>" + "实验报告未提交" + "</td>";
                        string szHref = "<a class='href' href='" + ("..\\ClientWeb\\upload\\UpLoadFile\\" + testitem[i].szReportFormURL.ToString()) + "' class='subReport'>下载模板</a>";
                        szHref  += "___<a class='href subReport' data-id=" + testitem[i].dwTestItemID.ToString() + " >提交实验报告</a>";
                        m_szOut += "<td>" + szHref + "</td>";
                    }
                }
            }
        }

        CDISKSTATREQ vrstateGet = new CDISKSTATREQ();

        vrstateGet.dwAccNo = accno.dwAccNo;
        CDISKSTAT vtState;
        string    szLogoName = "";

        if (m_Request.Account.CloudDiskStat(vrstateGet, out vtState) == REQUESTCODE.EXECUTE_SUCCESS)
        {
            szLogoName        = vtState.szPID;
            m_szOutDISKSTATE += "网络硬盘可用大小:" + vtState.dwTotalSize.ToString() + "mb;" + "已经使用:" + vtState.dwUsedSize.ToString() + "mb;文件个数:" + vtState.dwFileNum.ToString() + "个";
        }
        else
        {
            m_szOutDISKSTATE += "请刷新后重试";
            return;
        }
        //获取个人网盘
        CLOUDDISKREQ cloudreq = new CLOUDDISKREQ();

        cloudreq.dwAccNo = accno.dwAccNo;
        CLOUDDISK[] disk;
        if (m_Request.Account.CloudDiskOpen(cloudreq, out disk) == REQUESTCODE.EXECUTE_SUCCESS)
        {
            for (int i = 0; i < disk.Length; i++)
            {
                m_szOutDISK += "<tr>";
                m_szOutDISK += "<td>" + disk[i].szFileName + "</td>";
                m_szOutDISK += "<td>" + disk[i].dwFileSize + "</td>";
                m_szOutDISK += "<td>" + GetDateStr(disk[i].dwSubmitDate) + "</td>";
                m_szOutDISK += "<td>" + disk[i].szMemo + "</td>";
                string szHref = "<a class='href' href='" + ("..\\ClientWeb\\upload\\UpLoadFile\\mydisk\\" + szLogoName + "\\" + disk[i].szLocation.ToString()) + "' class='subReport'>下载</a>";
                szHref      += "___<a class='href del' data-id=" + disk[i].dwFileID.ToString() + " >删除</a>";
                m_szOutDISK += "<td>" + szHref + "</td>";
                m_szOutDISK += "</tr>";
            }
        }
    }
示例#4
0
    protected void Page_Load(object sender, EventArgs e)
    {
        string id = Request["id"];

        if (id == null || id == "")
        {
            MessageBox("实验项目信息为空不能上传", "提示", MSGBOX.ERROR);
        }
        else
        {
            ViewState["id"] = id;
        }
        if (IsPostBack)
        {
            UNIACCOUNT      accno = (UNIACCOUNT)Session["loginAcc"];
            TESTITEMINFOREQ vrGet = new TESTITEMINFOREQ();
            vrGet.dwAccNo      = accno.dwAccNo;
            vrGet.dwTestItemID = Parse(id);
            TESTITEMINFO[] testitemInfo;
            if (!(m_Request.Reserve.GetTestItemInfo(vrGet, out testitemInfo) == REQUESTCODE.EXECUTE_SUCCESS && testitemInfo != null && testitemInfo.Length > 0))
            {
                MessageBox("获取不到实验项目信息为空不能上传", "提示", MSGBOX.ERROR);
            }
            string filePath = HttpContext.Current.Server.MapPath("~\\ClientWeb\\upload\\UpLoadFile\\" + testitemInfo[0].dwTestItemID.ToString());
            if (Directory.Exists(filePath) == false)//如果不存在就创建file文件夹
            {
                try
                {
                    Directory.CreateDirectory(filePath);
                }
                catch
                {
                    MessageBox("创建目录失败,请稍后再试", "提示", MSGBOX.ERROR);
                }
            }

            if (AttachFile.HasFile)
            {
                string FileName     = this.AttachFile.FileName;                                                                                                               //获取上传文件的文件名,包括后缀
                string ExtenName    = System.IO.Path.GetExtension(FileName);                                                                                                  //获取扩展名
                string filePathInfo = filePath + "\\" + accno.szLogonName + "_" + accno.szTrueName + "_" + DateTime.Now.ToString("yyyyMMddhhmm") + ExtenName;
                string SaveFileName = System.IO.Path.Combine(filePath, accno.szLogonName + "_" + accno.szTrueName + "_" + DateTime.Now.ToString("yyyyMMddhhmm") + ExtenName); //合并两个路径为上传到服务器上的全路径
                if (this.AttachFile.ContentLength > 0)
                {
                    try
                    {
                        this.AttachFile.MoveTo(SaveFileName, Brettle.Web.NeatUpload.MoveToOptions.Overwrite);
                    }
                    catch (Exception ex)
                    {
                        MessageBox(ex.ToString(), "提示", MSGBOX.ERROR);
                    }
                }
                string url      = filePathInfo;                                                           //文件保存的路径
                float  FileSize = (float)System.Math.Round((float)AttachFile.ContentLength / 1024000, 1); //获取文件大小并保留小数点后一位,单位是M

                REPORTUPLOAD upload = new REPORTUPLOAD();
                upload.dwAccNo     = accno.dwAccNo;
                upload.dwSID       = testitemInfo[0].dwSID;
                upload.szReportURL = accno.szLogonName + "_" + accno.szTrueName + "_" + DateTime.Now.ToString("yyyyMMddhhmm") + ExtenName;
                if (!(m_Request.Reserve.UploadReport(upload) == REQUESTCODE.EXECUTE_SUCCESS))
                {
                    MessageBox(m_Request.szErrMessage, "提示", MSGBOX.ERROR);
                }
                else
                {
                    //  Response.Write("<script>alert('');opener.parent.mainFrame.location.reload();</script>");
                    MessageBox("上传成功", "提示", MSGBOX.SUCCESS, MSGBOX_ACTION.OK);
                    Session["tabs"] = 0;
                }
            }
        }
    }