Esempio n. 1
0
    public CStatueTemp GetListByFieldName(string szFieldName, string value)
    {
        if (xmlTemp == null)
        {
            return(null);
        }
        LoadXmlTemp();
        XmlNode nodeRoot = xmlTemp.SelectSingleNode("//field[@name='" + szFieldName + "']");

        if (nodeRoot == null)
        {
            return(null);
        }

        XmlNodeList nodes = nodeRoot.ChildNodes;

        for (int i = 0; i < nodes.Count; i++)
        {
            XmlNode nodeTemp = nodes[i];
            string  szValue  = nodeTemp.Attributes["value"].InnerXml;

            if (szValue == value)
            {
                CStatueTemp newTemp = new CStatueTemp();
                newTemp.szValue = value;
                newTemp.szName  = nodeTemp.InnerText;;
                return(newTemp);
            }
        }
        return(null);
    }
Esempio n. 2
0
    public ArrayList GetListByFieldName(string szFieldName)
    {
        if (xmlTemp == null)
        {
            return(null);
        }
        LoadXmlTemp();
        XmlNode nodeRoot = xmlTemp.SelectSingleNode("//field[@name='" + szFieldName + "']");

        if (nodeRoot == null)
        {
            return(null);
        }

        XmlNodeList nodes = nodeRoot.ChildNodes;
        ArrayList   list  = new ArrayList();

        for (int i = 0; i < nodes.Count; i++)
        {
            XmlNode nodeTemp = nodes[i];
            string  szValue  = nodeTemp.Attributes["value"].InnerXml;
            uint    uValue   = 0;
            uint.TryParse(szValue, out uValue);
            string szName = nodeTemp.InnerXml;

            {
                CStatueTemp temp = new CStatueTemp();
                temp.szValue = szValue;// uValue.ToString();
                temp.szName  = szName;
                list.Add(temp);
            }
        }
        return(list);
    }
Esempio n. 3
0
    protected void Page_Load(object sender, EventArgs e)
    {
        string szop       = Request["op"];
        string szfielName = Request["fieldName"];
        string szValue    = Request["delID"];

        if (szop == "del")
        {
            del(szfielName, szValue);
        }
        string szKind = Request["kind"];

        if (szKind == null || szKind == "")
        {
            szKind = "ResvAbsTime";
        }
        ArrayList list = GetListByFieldName(szKind);

        for (int i = 0; list != null && i < list.Count; i++)
        {
            CStatueTemp temp = new CStatueTemp();
            temp     = (CStatueTemp)list[i];
            m_szOut += "<tr>";
            m_szOut += "<td data-fieldName='" + szKind + "' data-id='" + temp.szValue.ToString() + "'>" + temp.szName.ToString() + "</td>";


            m_szOut += "<td><div class='OPTD'></div></td>";
            m_szOut += "</tr>";
        }


        PutBackValue();
    }
Esempio n. 4
0
    protected void Page_Load(object sender, EventArgs e)
    {
        for (int i = 0; i <= 59; i++)
        {
            m_szMin += GetInputItemHtml(CONSTHTML.option, "", i.ToString("00"), i.ToString());
        }

        for (int i = 6; i <= 23; i++)
        {
            m_szHour += GetInputItemHtml(CONSTHTML.option, "", i.ToString("00"), i.ToString());
        }
        if (IsPostBack)
        {
            string      szOldValue  = Request["oldValue"];
            CStatueTemp temp        = new CStatueTemp();
            string      szValue     = "";
            string      szName      = "";
            string      szfieldName = Request["fieldName"];
            CStatueTemp value       = new CStatueTemp();
            if (szfieldName == "ResvTheme")
            {
                szValue = Request["szThemeName"];
                szName  = szValue;
            }
            else if (szfieldName == "ResvAbsTime")
            {
                uint uValue = (Parse(Request["startHour"]) * 100 + Parse(Request["startMin"])) * 10000 + (Parse(Request["endHour"]) * 100 + Parse(Request["endMin"]));
                szValue = uValue.ToString();
                szName  = Request["startHour"] + "点" + Request["startMin"] + "分到" + Request["endHour"] + "点" + Request["endMin"] + "分";

                value.szName  = szName;
                value.szValue = szValue;
            }

            if (!(update(szfieldName, szValue, szName, szOldValue)))
            {
                MessageBox(m_Request.szErrMessage, "设置失败", MSGBOX.ERROR, MSGBOX_ACTION.NONE);
            }
            else
            {
                MessageBox("设置成功", "提示", MSGBOX.SUCCESS, MSGBOX_ACTION.OK);
                return;
            }
        }
        if (Request["op"] == "set")
        {
            string      szName  = Request["fieldName"];
            string      szValue = Request["id"];
            CStatueTemp value   = GetListByFieldName(szName, szValue);
            m_szValue = szName;
            if (szName == "ResvTheme")
            {
                PutMemberValue2("szThemeName", szValue.ToString());
            }
            else if (szName == "ResvAbsTime")
            {
                uint uValue = Parse(szValue);
                uint uStart = uValue / 10000;
                uint uEnd   = uValue % 10000;

                PutMemberValue2("startHour", (uStart / 100).ToString());
                PutMemberValue2("startMin", (uStart % 100).ToString());


                PutMemberValue2("EndHour", (uEnd / 100).ToString());
                PutMemberValue2("EndMin", (uEnd % 100).ToString());
            }
            PutMemberValue2("oldValue", szValue);
            if (value == null)
            {
                MessageBox(m_Request.szErrMessage, "获取失败", MSGBOX.ERROR, MSGBOX_ACTION.CANCEL);
            }
            else
            {
                //  PutJSObj(value);
            }
        }
        else
        {
            m_Title = "新建";
        }
    }
Esempio n. 5
0
    protected void Page_Load(object sender, EventArgs e)
    {
        uint uCouserProp  = 0;
        uint dwTestPlanid = Parse(Request["dwTestplanid"]);
        uint uCourseID    = Parse(Request["dwCourseID"]);

        Response.CacheControl = "no-cache";
        MyString szOut = new MyString();

        if (dwTestPlanid == 0 && uCourseID == 0)
        {
            szOut += "[";
            int uWeekTotal = GetWeekTotalNow();
            for (int i = 1; i <= uWeekTotal; i++)
            {
                szOut += "{\"id\":\"" + (i).ToString() + "\",\"label\": \"" + szWeeksList[i] + "\"}";
                if (i < (uWeekTotal))
                {
                    szOut += ",";
                }
            }
            szOut += "]";
            Response.Write(szOut);
            Response.End();
        }
        if (uCourseID == 0)
        {
            UNITESTPLAN[] vtTestPlan = GetTestPlanByID(dwTestPlanid);
            if (vtTestPlan != null && vtTestPlan.Length > 0)
            {
                uCourseID = (uint)vtTestPlan[0].dwCourseID;
            }
        }
        COURSEREQ courseGet = new COURSEREQ();

        courseGet.dwCourseID = uCourseID;
        UNICOURSE[] vtCouse;
        if (m_Request.Reserve.GetCourse(courseGet, out vtCouse) == REQUESTCODE.EXECUTE_SUCCESS && vtCouse != null)
        {
            UNICOURSE couse = new UNICOURSE();
            couse = vtCouse[0];
            uint uProp = (uint)couse.dwCourseProperty;
            if (((uProp & (uint)UNICOURSE.DWCOURSEPROPERTY.COURSEPROP_WITHTHEORY)) > 0)//理论课
            {
                if (couse.szMemo != null && couse.szMemo == "1")
                {
                    uCouserProp = 2;
                }
                else
                {
                    uCouserProp = 1;
                }
            }
            else if (((uProp & (uint)UNICOURSE.DWCOURSEPROPERTY.COURSEPROP_NOTHEORY)) > 0)//实践课
            {
                uCouserProp = 3;
            }

            CLASSTIMETABLE[] classTimeTable = GetTermClasTimeTable();
            szOut += "[";
            if (uCouserProp == 1)
            {
                //     for (int i = 1; i <=6; i = i + 2)
                for (int i = 1; i <= classTimeTable.Length; i = i + 2)
                {
                    int nBegin = i * 100;
                    int nEnd   = (i + 1);
                    if (nEnd > classTimeTable.Length)
                    {
                        nEnd = classTimeTable.Length;
                    }
                    int nValue = nBegin + nEnd;
                    szOut += "{\"id\":\"" + (nValue).ToString() + "\",\"label\": \"" + szSecsListTwo[i] + "\"}";
                    if (i <= (classTimeTable.Length - 1))
                    {
                        szOut += ",";
                    }
                    //szOut += GetInputItemHtml(CONSTHTML.radioButton, "resvTime", , );
                }
            }
            else if (uCouserProp == 2)
            {
                //                for (int i = 1; i <= classTimeTable.Length; i = i + 4)

                for (int i = 1; i <= 8; i = i + 4)
                {
                    int nBegin = i * 100;
                    int nEnd   = (i + 3);
                    if (nEnd > classTimeTable.Length)
                    {
                        nEnd = classTimeTable.Length;
                    }
                    int nValue = nBegin + nEnd;
                    szOut += "{\"id\":\"" + (nValue).ToString() + "\",\"label\": \"" + szSecsListFour[i] + "\"}";
                    if (i <= (classTimeTable.Length - 1))
                    {
                        szOut += ",";
                    }

                    //  szOut += GetInputItemHtml(CONSTHTML.radioButton, "", szSecsListFour[i], i.ToString());
                }
            }
            else if (uCouserProp == 3)
            {
                ArrayList list = GetListByFieldName("ResvAbsTime");
                for (int i = 0; list != null && i < list.Count; i++)
                {
                    CStatueTemp temp = new CStatueTemp();
                    temp = (CStatueTemp)list[i];

                    szOut += "{\"id\":\"" + temp.szValue + "\",\"label\": \"" + temp.szName + "\"},";
                }
            }

            szOut += "]";
            Response.Write(szOut);
        }
        else
        {
            Response.Write("[{}]");
        }
    }