コード例 #1
0
        public string GetXML()
        {
            StringBuilder sb = new StringBuilder("<?xml version=\"1.0\" encoding=\"UTF-8\"?>").Append(HssStr.WinNextLine);

            sb.Append("<ElectionDocument xmlns:myObj=\"urn:myObj\">").Append(HssStr.WinNextLine);
            sb.Append("<AnnouncementName>").Append(this.AnnouncementName).Append("</AnnouncementName>").Append(HssStr.WinNextLine);
            sb.Append("<AnnouncementSender>").Append(this.AnnouncementSender).Append("</AnnouncementSender>").Append(HssStr.WinNextLine);
            sb.Append("<AnnouncementIdentifier>").Append(this.AnnouncementIdentifier).Append("</AnnouncementIdentifier>").Append(HssStr.WinNextLine);
            sb.Append("<AnnouncementDate>").Append(this.AnnouncementDate.ToString("yyyy-MM-ddThh:mm:ss")).Append("</AnnouncementDate>").Append(HssStr.WinNextLine);

            sb.Append(this.eventInfo.GetXML());

            sb.Append("<DTC_PARTICIPANT_Election_INFORMATION>").Append(HssStr.WinNextLine);
            List <decimal> DTC_WHrate_list = new List <decimal>(this.DTC_participant_dic.Keys);

            DTC_WHrate_list.Sort();
            foreach (decimal key_rate in DTC_WHrate_list)
            {
                Election_item ei = this.DTC_participant_dic[key_rate];
                sb.Append(ei.GetXML());
            }
            sb.Append("</DTC_PARTICIPANT_Election_INFORMATION>").Append(HssStr.WinNextLine);

            sb.Append("<RSH_Election_INFORMATION>").Append(HssStr.WinNextLine);
            List <decimal> RSH_WHrate_list = new List <decimal>(this.RSH_dic.Keys);

            RSH_WHrate_list.Sort();
            foreach (decimal key_rate in RSH_WHrate_list)
            {
                Election_item ei = this.RSH_dic[key_rate];
                sb.Append(ei.GetXML());
            }
            sb.Append("</RSH_Election_INFORMATION>").Append(HssStr.WinNextLine);

            sb.Append("<CUSTODIAN_DETAILS>").Append(HssStr.WinNextLine);
            foreach (Custodian_ele ce in this.custodianEle_dic.Values)
            {
                sb.Append(ce.GetXML());
            }
            sb.Append("</CUSTODIAN_DETAILS>").Append(HssStr.WinNextLine);

            sb.Append(summary.GetXML());

            sb.Append("</ElectionDocument>").Append(HssStr.WinNextLine);
            return(sb.ToString());
        }
コード例 #2
0
ファイル: Custodian_ele.cs プロジェクト: huangss0/GTS0
        public Dictionary <decimal, Election_item> cust_dic = new Dictionary <decimal, Election_item>();//[WHRate] as key

        public string GetXML()
        {
            StringBuilder sb = new StringBuilder("<CUSTODIAN_ELECTION ID=\"" + this.ID + "\">").Append(HssStr.WinNextLine);

            sb.Append("<CUSTODIAN_REFERENCE>").Append(this.CUSTODIAN_REFERENCE).Append("</CUSTODIAN_REFERENCE>").Append(HssStr.WinNextLine);
            sb.Append("<CUSTODIAN_NAME>").Append(this.CUSTODIAN_NAME).Append("</CUSTODIAN_NAME>").Append(HssStr.WinNextLine);

            List <decimal> WHrate_list = new List <decimal>(this.cust_dic.Keys);

            WHrate_list.Sort();
            foreach (decimal key_rate in WHrate_list)
            {
                Election_item ei = this.cust_dic[key_rate];
                sb.Append(ei.GetXML());
            }

            sb.Append("</CUSTODIAN_ELECTION>");
            return(sb.ToString());
        }
コード例 #3
0
ファイル: Summary_ele.cs プロジェクト: huangss0/GTS0
        //public decimal DTC_participant_total = 0, RSH_total = 0;

        public string GetXML()
        {
            StringBuilder sb = new StringBuilder("<SUMMARY>").Append(HssStr.WinNextLine);

            sb.Append("<TOTAL_ELECTION_INFORMATION>").Append(HssStr.WinNextLine);
            List <decimal> WHrate_list = new List <decimal>(this.totalEle_dic.Keys);

            WHrate_list.Sort();
            foreach (decimal key_rate in WHrate_list)
            {
                Election_item ei = this.totalEle_dic[key_rate];
                sb.Append(ei.GetXML());
            }
            sb.Append("</TOTAL_ELECTION_INFORMATION>").Append(HssStr.WinNextLine);

            sb.Append("<PRE_RELEASE_TOTAL>").Append((int)this.PRE_RELEASE_TOTAL).Append("</PRE_RELEASE_TOTAL>").Append(HssStr.WinNextLine);
            sb.Append("<WORKING_SUPPLY_TOTAL>").Append((int)this.WORKING_SUPPLY_TOTAL).Append("</WORKING_SUPPLY_TOTAL>").Append(HssStr.WinNextLine);

            sb.Append("</SUMMARY>").Append(HssStr.WinNextLine);
            return(sb.ToString());
        }