Beispiel #1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        TERMREQ vrParameter = new TERMREQ();

        UNITERM[] vrResult;
        if (Request["delID"] != null)
        {
            DelTerm(Request["delID"]);
        }
        GetPageCtrlValue(out vrParameter.szReqExtInfo);
        if (m_Request.Reserve.GetTerm(vrParameter, out vrResult) == REQUESTCODE.EXECUTE_SUCCESS)
        {
            for (int i = 0; i < vrResult.Length; i++)
            {
                m_szOut += "<tr>";
                m_szOut += "<td data-id=\"" + vrResult[i].dwYearTerm.ToString() + "\">" + vrResult[i].szMemo + "</td>";
                m_szOut += "<td>" + GetDateStr(vrResult[i].dwBeginDate) + "到" + GetDateStr(vrResult[i].dwEndDate) + "</td>";

                m_szOut += "<td>" + vrResult[i].dwFirstWeekDays + "</td>";
                m_szOut += "<td>" + vrResult[i].dwTotalWeeks + "</td>";
                m_szOut += "<td>" + GetJustName(vrResult[i].dwStatus, "Term_Status") + "</td>";
                string szDivOPTD = "OPTD";
                if (((vrResult[i].dwStatus & (uint)UNITERM.DWSTATUS.TERMSTAT_OVER) > 0))
                {
                    szDivOPTD = "";
                }
                m_szOut += "<td><div class='" + szDivOPTD + "'></div></td>";
                m_szOut += "</tr>";
            }
            UpdatePageCtrl(m_Request.Reserve);
        }
        PutBackValue();
    }
Beispiel #2
0
    public CLASSTIMETABLE[] GetTermClasTimeTable()
    {
        /*
         * if (Session["ClassTimeTable"] != null)
         * {
         *  return (CLASSTIMETABLE[])Session["ClassTimeTable"];
         * }
         */
        TERMREQ vrGet = new TERMREQ();

        vrGet.dwStatus = (uint)UNITERM.DWSTATUS.TERMSTAT_FORCE;
        UNITERM[] vtRes;
        if (m_Request.Reserve.GetTerm(vrGet, out vtRes) == REQUESTCODE.EXECUTE_SUCCESS && vtRes != null && vtRes.Length > 0)
        {
            Session["ClassTimeTable"] = vtRes[0].szCTS1;
            return(vtRes[0].szCTS1);
        }
        else
        {
            vrGet.dwStatus = (uint)UNITERM.DWSTATUS.TERMSTAT_UNFORCE;
            if (m_Request.Reserve.GetTerm(vrGet, out vtRes) == REQUESTCODE.EXECUTE_SUCCESS && vtRes != null && vtRes.Length > 0)
            {
                Session["ClassTimeTable"] = vtRes[0].szCTS1;
                return(vtRes[0].szCTS1);
            }
        }
        return(null);
    }
Beispiel #3
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (IsPostBack)
        {
            UNITERM newTerm;
            GetHTTPObj(out newTerm);
            if (m_Request.Reserve.SetTerm(newTerm, out newTerm) != REQUESTCODE.EXECUTE_SUCCESS)
            {
                MessageBox(m_Request.szErrMessage, "新建失败", MSGBOX.ERROR, MSGBOX_ACTION.NONE);
            }
            else
            {
                MessageBox("新建成功", "新建成功", MSGBOX.SUCCESS, MSGBOX_ACTION.OK);
                return;
            }
        }
        m_szSta = GetInputHtmlFromXml(0, CONSTHTML.option, "", "Term_Status", true);
        if (Request["op"] == "set")
        {
            bSet = true;

            TERMREQ vrTermGet = new TERMREQ();
            //vrTermGet.dwGetType = (uint)TERMREQ.DWGETTYPE.TERMGET_BYYEARTERM;
            vrTermGet.dwYearTerm = Parse(Request["dwID"]);
            UNITERM[] vrTermRes;
            if (m_Request.Reserve.GetTerm(vrTermGet, out vrTermRes) != REQUESTCODE.EXECUTE_SUCCESS)
            {
                MessageBox(m_Request.szErrMessage, "获取失败", MSGBOX.ERROR, MSGBOX_ACTION.CANCEL);
            }
            else
            {
                if (vrTermRes.Length == 0)
                {
                    MessageBox("获取失败", "获取失败", MSGBOX.ERROR, MSGBOX_ACTION.CANCEL);
                }
                else
                {
                    PutJSObj(vrTermRes[0]);
                    m_Title = "修改" + "【" + vrTermRes[0].szMemo + "】";
                }
            }
        }
        else
        {
            uint?uMax = 0;
            uint uID  = PRStation.DOORCTRLSRV_BASE | PRDoorCtrlSrv.MSREQ_DCS_SET;

            if (GetMaxValue(ref uMax, uID, "dwSN"))
            {
                UNIDCS setValue = new UNIDCS();
                setValue.dwSN = uMax;
                PutJSObj(setValue);
            }
            m_Title = "新建学期";
        }
    }
Beispiel #4
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (IsPostBack)
        {
            UNITERM newTerm;
            GetHTTPObj(out newTerm);
            if (m_Request.Reserve.SetTerm(newTerm, out newTerm) != REQUESTCODE.EXECUTE_SUCCESS)
            {
                MessageBox(m_Request.szErrMessage, "修改失败", MSGBOX.ERROR, MSGBOX_ACTION.NONE);
            }
            else
            {
                MessageBox("修改成功", "修改成功", MSGBOX.SUCCESS, MSGBOX_ACTION.OK);
                return;
            }
        }

        if (Request["op"] == "set")
        {
            bSet = true;

            TERMREQ vrTermGet = new TERMREQ();
            vrTermGet.dwYearTerm = Parse(Request["dwID"]);
            UNITERM[] vrTermRes;
            if (m_Request.Reserve.GetTerm(vrTermGet, out vrTermRes) != REQUESTCODE.EXECUTE_SUCCESS)
            {
                MessageBox(m_Request.szErrMessage, "获取失败", MSGBOX.ERROR, MSGBOX_ACTION.CANCEL);
            }
            else
            {
                if (vrTermRes.Length == 0)
                {
                    MessageBox("获取失败", "获取失败", MSGBOX.ERROR, MSGBOX_ACTION.CANCEL);
                }
                else
                {
                    PutJSObj(vrTermRes[0]);
                    ViewState["dwYearTermCode"] = vrTermRes[0].dwYearTerm.ToString();
                    m_Title = "修改" + "【" + vrTermRes[0].szMemo + "】";
                }
            }
        }
        else
        {
            uint?uMax = 0;
            uint uID  = PRStation.DOORCTRLSRV_BASE | PRDoorCtrlSrv.MSREQ_DCS_SET;

            if (GetMaxValue(ref uMax, uID, "dwSN"))
            {
                UNIDCS setValue = new UNIDCS();
                setValue.dwSN = uMax;
                PutJSObj(setValue);
            }
            m_Title = "新建学期";
        }
    }
Beispiel #5
0
    public UNITERM[] GetAllYearTerm()
    {
        TERMREQ vrGet = new TERMREQ();

        UNITERM[] vtRes;
        if (m_Request.Reserve.GetTerm(vrGet, out vtRes) == REQUESTCODE.EXECUTE_SUCCESS)
        {
            return(vtRes);
        }
        return(null);
    }
Beispiel #6
0
    public UNITERM[] GetTermByID(uint uTermID)
    {
        TERMREQ vrGet = new TERMREQ();

        vrGet.dwYearTerm = uTermID;
        UNITERM[] vtRes;
        if (m_Request.Reserve.GetTerm(vrGet, out vtRes) == REQUESTCODE.EXECUTE_SUCCESS && vtRes != null && vtRes.Length > 0)
        {
            //Session["ClassTimeTable"] = vtRes[0].szCTS1;
            return(vtRes);
        }
        return(null);
    }
Beispiel #7
0
    public UNITERM[] GetTermNow()
    {
        if (Session["TermNow"] != null)
        {
            //return (UNITERM[])Session["TermNow"];
        }
        TERMREQ vrGet = new TERMREQ();

        vrGet.dwStatus = (uint)UNITERM.DWSTATUS.TERMSTAT_FORCE;
        UNITERM[] vtRes;
        if (m_Request.Reserve.GetTerm(vrGet, out vtRes) == REQUESTCODE.EXECUTE_SUCCESS && vtRes != null && vtRes.Length > 0)
        {
            Session["TermNow"] = vtRes;
            return(vtRes);
        }
        return(null);
    }
Beispiel #8
0
    protected void Page_Load(object sender, EventArgs e)
    {
        m_bRemember = false;

        string  szTerm  = Request["termID"];
        TERMREQ termReq = new TERMREQ();

        termReq.dwYearTerm = Parse(szTerm);
        UNITERM[] vtTerm;
        Response.CacheControl = "no-cache";

        uint uEndDate = 10;

        if (m_Request.Reserve.GetTerm(termReq, out vtTerm) == REQUESTCODE.EXECUTE_SUCCESS && vtTerm != null && vtTerm.Length > 0)
        {
            uEndDate = (uint)vtTerm[0].dwEndDate;
        }
        GROUPREQ vrGet = new GROUPREQ();

        vrGet.dwMaxDeadLine = uEndDate;
        vrGet.dwMinDeadLine = uEndDate;
        UNIGROUP[] vtDept;

        vrGet.szReqExtInfo.dwNeedLines = 100000; //最多10条

        if (m_Request.Group.GetGroup(vrGet, out vtDept) == REQUESTCODE.EXECUTE_SUCCESS && vtDept != null)
        {
            MyString szOut = new MyString();
            szOut += "[";
            for (int i = 0; i < vtDept.Length; i++)
            {
                szOut += "{\"id\":\"" + vtDept[i].dwGroupID + "\",\"label\": \"" + vtDept[i].szName + "\"}";
                if (i < vtDept.Length - 1)
                {
                    szOut += ",";
                }
            }
            szOut += "]";
            Response.Write(szOut);
        }
        else
        {
            Response.Write("[ ]");
        }
    }
Beispiel #9
0
    private void InitTerm()
    {
        TERMREQ req = new TERMREQ();

        req.dwStatus = (uint)UNITERM.DWSTATUS.TERMSTAT_FORCE;
        UNITERM[] rlt;
        if (m_Request.Reserve.GetTerm(req, out rlt) == REQUESTCODE.EXECUTE_SUCCESS)
        {
            if (rlt.Length > 0)
            {
                yearTerm    = rlt[0];
                Master.Year = (uint)rlt[0].dwYearTerm;
            }
        }
        else
        {
            MsgBox(m_Request.szErrMsg);
        }
    }
Beispiel #10
0
    public UNITERM[] GetAllTerm()
    {
        /*
         * if (Session["TermList"] != null)
         * {
         *  UNITERM[] termList = (UNITERM[])Session["TermList"];
         *  return termList;
         * }
         */
        //获取学期列表
        TERMREQ vrParameter = new TERMREQ();

        UNITERM[] vrResult;


        if (m_Request.Reserve.GetTerm(vrParameter, out vrResult) == REQUESTCODE.EXECUTE_SUCCESS)
        {
            Session["TermList"] = vrResult;
            return(vrResult);
        }
        return(null);
    }
Beispiel #11
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (yearTerm == 0)
        {
            return;
        }
        TERMREQ req = new TERMREQ();

        req.dwYearTerm = yearTerm;
        UNITERM[] rlt;
        if (m_Request.Reserve.GetTerm(req, out rlt) == REQUESTCODE.EXECUTE_SUCCESS && rlt != null)
        {
            if (rlt.Length > 0)
            {
                UNITERM term = rlt[0];
                year      = term.dwYearTerm.ToString();
                name      = term.szMemo;
                status    = term.dwStatus.ToString();
                start     = Util.Converter.UintToDateStr(term.dwBeginDate);
                end       = Util.Converter.UintToDateStr(term.dwEndDate);
                firstweek = (int)term.dwFirstWeekDays;
                totalweek = (int)term.dwTotalWeeks;
                secnum    = (int)term.dwSecNum;
                cts1      = "{}";
                cts1start = term.dwCTS1Begin.ToString();
                cts1end   = term.dwCTS1End.ToString();
                cts2      = "{}";
                cts2start = term.dwCTS2Begin.ToString();
                cts2end   = term.dwCTS2End.ToString();
            }
        }
        else
        {
            MsgBox(m_Request.szErrMsg);
        }
    }
Beispiel #12
0
    protected void Page_Load(object sender, EventArgs e)
    {
        //注意:需要在App_Code/UniPage.cs文件中ImportProcess函数里实现导入功能

        TERMREQ vrGetTerm = new TERMREQ();

        UNITERM[] vtTerm;
        if (m_Request.Reserve.GetTerm(vrGetTerm, out vtTerm) == REQUESTCODE.EXECUTE_SUCCESS && vtTerm != null && vtTerm.Length > 0)
        {
            for (int i = 0; i < vtTerm.Length; i++)
            {
                if (((uint)vtTerm[i].dwStatus & (uint)UNITERM.DWSTATUS.TERMSTAT_FORCE) > 0)
                {
                    m_szTerm += GetInputItemHtml(CONSTHTML.option, "", vtTerm[i].szMemo, vtTerm[i].dwYearTerm.ToString(), true);
                }
                else
                {
                    m_szTerm += GetInputItemHtml(CONSTHTML.option, "", vtTerm[i].szMemo, vtTerm[i].dwYearTerm.ToString());
                }
            }
        }
        GetHTTPObj(out pagedata);

        Response.CacheControl = "no-cache";

        //使用HTTP输入参数:
        //pagedata.szTitle = "项目卡";
        //pagedata.szTemplateFile = MyVPath+"Upload/TestCard_Template.csv";
        //pagedata.szDestName = "TESTCARD";
        //pagedata.szDestFieldList = "szTestName,szCategoryName,dwGroupPeopleNum,dwTestHour,dwTestClass,dwTestKind,dwRequirement,szConstraints,szMemo";
        //<<

        /*
         * if (string.IsNullOrEmpty(pagedata.szDestName) || string.IsNullOrEmpty(pagedata.szDestFieldList) || string.IsNullOrEmpty(pagedata.szTemplateFile) || string.IsNullOrEmpty(pagedata.szTitle))
         * {
         *  pagedata.dwStep = 4;
         *  pagedata.szMessage = "参数不能为空";
         * }
         * */
        if (Request["Submit"] == "true")
        {
            if (pagedata.dwStep == 0)
            {
                if (Request.Files.Count > 0)
                {
                    string szTempPath    = MyVPath + "Upload/Import_" + DateTime.Now.Ticks + ".csv";
                    string szTempRawPath = Server.MapPath(szTempPath);
                    Request.Files[0].SaveAs(szTempRawPath);

                    pagedata.dwStep     = 1;
                    pagedata.szFileName = Request.Files[0].FileName;
                    pagedata.szMessage  = "已成功上传文件:" + pagedata.szFileName;
                    pagedata.szFilePath = szTempPath;
                }
                else
                {
                    pagedata.szMessage = "没获取到上传的文件";
                }
            }

            if (pagedata.dwStep == 3)
            {
                pagedata.dwStep = 4;
            }

            if (pagedata.dwStep == 2)
            {
                pagedata.dwStep    = 3;
                pagedata.szMessage = "";
                uint nImported;
                uint nFailed;
                pagedata.szErrListFile = MyVPath + "Upload/ImportError_" + DateTime.Now.Ticks + ".csv";
                string szErrListRawFile = Server.MapPath(pagedata.szErrListFile);
                Import(pagedata.szFilePath, szErrListRawFile, out nImported, out nFailed);
                pagedata.dwTotalLine = nImported + nFailed;
                pagedata.dwImported  = nImported;
                pagedata.dwFailed    = nFailed;
                string szErrLines = "";
                for (int i = 0; i < ErrorLines.Count; i++)
                {
                    szErrLines += ErrorLines[i].ToString();
                    if (i < ErrorLines.Count - 1)
                    {
                        szErrLines += ",";
                    }
                }
                pagedata.szErrLines = szErrLines;
            }

            if (pagedata.dwStep == 1)
            {
                pagedata.dwStep    = 2;
                pagedata.szMessage = "已成功上传文件:" + pagedata.szFileName;
                m_szOut            = ReadCSV(pagedata.szFilePath, 10, out pagedata.dwTotalLine);
            }
        }
        else
        {
            m_szOut = ReadCSV(pagedata.szTemplateFile, 10, out pagedata.dwTotalLine);
        }

        PutJSObj(pagedata);
    }
Beispiel #13
0
    public uint GetTermList()
    {
        uint ret = 0;

        //获取学期列表
        TERMREQ vrParameter = new TERMREQ();

        UNITERM[] vrResult;
        uint      curYear = (uint)DateTime.Now.Year;
        uint      curTerm = 1;

        if (DateTime.Now.Month >= 9)
        {
            curTerm = 2;
        }

        uint prevYear = 0;
        uint prevTerm = 0;
        uint nextYear = 0;
        uint nextTerm = 0;


        if (curTerm == 2)
        {
            prevYear = curYear;
            prevTerm = 1;

            nextYear = curYear + 1;
            nextTerm = 1;
        }
        else
        {
            prevTerm = 2;
            prevYear = curYear - 1;

            nextYear = curYear;
            nextTerm = 2;
        }


        if (m_Request.Reserve.GetTerm(vrParameter, out vrResult) == REQUESTCODE.EXECUTE_SUCCESS)
        {
            for (int i = 0; i < vrResult.Length; i++)
            {
                uint y = (uint)vrResult[i].dwYearTerm / 10000;
                uint t = (uint)vrResult[i].dwYearTerm % 10;
                if (y == prevYear && t == prevTerm)
                {
                    ret |= 1;
                }
                if (y == curYear && t == curTerm)
                {
                    ret |= 2;
                }
                if (y == nextYear && t == nextTerm)
                {
                    ret |= 4;
                }
            }
        }
        return(ret);
    }
Beispiel #14
0
    public uint GetTerm(string szParam)
    {
        uint uParam = ToUint(szParam);

        if (szParam != null)
        {
            Session["TermIndex"] = uParam;
        }
        else if (Session["TermIndex"] != null)
        {
            uParam = (uint)Session["TermIndex"];
        }

        //获取学期列表
        TERMREQ vrParameter = new TERMREQ();

        UNITERM[] vrResult;
        uint      curYear = (uint)DateTime.Now.Year;
        uint      curTerm = 1;

        if (DateTime.Now.Month >= 9)
        {
            curTerm = 2;
        }
        if (uParam == 1)
        {
            if (curTerm == 2)
            {
                curTerm = 1;
            }
            else
            {
                curTerm = 2;
                curYear--;
            }
        }
        else if (uParam == 2)
        {
            if (curTerm == 2)
            {
                curTerm = 1;
                curYear++;
            }
            else
            {
                curTerm = 2;
            }
        }

        if (m_Request.Reserve.GetTerm(vrParameter, out vrResult) == REQUESTCODE.EXECUTE_SUCCESS)
        {
            for (int i = 0; i < vrResult.Length; i++)
            {
                if (vrResult[i].dwYearTerm / 10000 == curYear)
                {
                    if (vrResult[i].dwYearTerm % 10 == curTerm)
                    {
                        return((uint)vrResult[i].dwYearTerm);
                    }
                }
            }
        }
        return(0);
    }
Beispiel #15
0
    protected void Page_Load(object sender, EventArgs e)
    {
        UNITESTPLAN newTestPlan;

        TERMREQ termGet = new TERMREQ();

        UNITERM[] vtTerm;
        if (m_Request.Reserve.GetTerm(termGet, out vtTerm) == REQUESTCODE.EXECUTE_SUCCESS && vtTerm != null && vtTerm.Length > 0)
        {
            for (int i = 0; i < vtTerm.Length; i++)
            {
                if ((((uint)vtTerm[i].dwStatus & (uint)UNITERM.DWSTATUS.TERMSTAT_FORCE) > 0))
                {
                    m_szTerm += "<option selected=\"selected\" value=\"" + vtTerm[i].dwYearTerm + "\"> " + vtTerm[i].szMemo + "</option>";
                }
                else
                {
                    m_szTerm += GetInputItemHtml(CONSTHTML.option, "", vtTerm[i].szMemo, vtTerm[i].dwYearTerm.ToString());
                }
            }



            if (IsPostBack)
            {
                GetHTTPObj(out newTestPlan);
                if (m_Request.Reserve.SetTestPlan(newTestPlan, out newTestPlan) != REQUESTCODE.EXECUTE_SUCCESS)
                {
                    MessageBox(m_Request.szErrMessage, "新建实验计划失败", MSGBOX.ERROR, MSGBOX_ACTION.NONE);
                }
                else
                {
                    MessageBox("新建实验计划成功", "提示", MSGBOX.SUCCESS, MSGBOX_ACTION.OK);
                    return;
                }
            }


            if (Request["op"] == "set")
            {
                bSet = true;

                LABREQ vrGetLab = new LABREQ();
                vrGetLab.dwLabID = Parse(Request["dwLabID"]);
                UNILAB[] vtLab;
                if (m_Request.Device.LabGet(vrGetLab, out vtLab) != REQUESTCODE.EXECUTE_SUCCESS)
                {
                    MessageBox(m_Request.szErrMessage, "获取失败", MSGBOX.ERROR, MSGBOX_ACTION.CANCEL);
                }
                else
                {
                    if (vtLab.Length == 0)
                    {
                        MessageBox("获取失败", "获取失败", MSGBOX.ERROR, MSGBOX_ACTION.CANCEL);
                    }
                    else
                    {
                        PutJSObj(vtLab[0]);
                        m_Title = "修改站点【" + vtLab[0].szLabName + "】";
                    }
                }
            }
            else
            {
                m_Title = "新建" + ConfigConst.GCLabName;
            }
        }
    }