Beispiel #1
0
        public HtmlTable CreateConsultationList(ObjConsultationList[] objConsultationList)
        {
            HtmlTable tb = CreateTable(0, 0, 0, "100%", null, null);

            if (null != objConsultationList && objConsultationList.Length > 0)
            {
                //HtmlTableRow trHeader = new HtmlTableRow();
                //HtmlTableCell tdHeader = CreateTD(3, null, null, "billTopTd");
                //tdHeader.InnerText = "";
                //trHeader.Controls.Add(tdHeader);
                //tb.Controls.Add(trHeader);

                foreach (ObjConsultationList objConsultation in objConsultationList)
                {
                    string ConsultationUserName = objConsultation.ConsultationUserName;
                    string ConsultationDate = objConsultation.ConsultationDate.ToString("yyyy-MM-dd HH:mm");
                    string Content = objConsultation.Content;

                    string ReplyContent = objConsultation.ReplyContent;
                    string ReplyDate = objConsultation.ReplyDate.ToString("yyyy-MM-dd HH:mm");
                    string ReplyUserName = objConsultation.ReplyUserName;

                    HtmlTableRow tr1 = new HtmlTableRow();
                    HtmlTableCell tdOne1 = CreateTD(1, null, null, "billAuditPerson");
                    tdOne1.InnerText = "咨询时间";

                    HtmlTableCell tdOne2 = CreateTD(1, "2%", null, null);

                    HtmlTableCell tdOne3 = CreateTD(1, "80%", null, null);
                    tdOne3.Align = "left";
                    tdOne3.InnerText = ConsultationDate;

                    tr1.Controls.Add(tdOne1);
                    tr1.Controls.Add(tdOne2);
                    tr1.Controls.Add(tdOne3);
                    tb.Controls.Add(tr1);

                    HtmlTableRow tr2 = new HtmlTableRow();
                    HtmlTableCell tdTwo1 = CreateTD(1, null, null, "billAuditPerson");
                    tdTwo1.InnerText = "咨询人";

                    HtmlTableCell tdTwo2 = CreateTD(1, "2%", null, null);

                    HtmlTableCell tdTwo3 = CreateTD(1, "80%", null, null);
                    tdTwo3.Align = "left";
                    tdTwo3.InnerText = ConsultationUserName;

                    tr2.Controls.Add(tdTwo1);
                    tr2.Controls.Add(tdTwo2);
                    tr2.Controls.Add(tdTwo3);
                    tb.Controls.Add(tr2);

                    HtmlTableRow tr3 = new HtmlTableRow();
                    HtmlTableCell tdThree1 = CreateTD(1, null, null, "billAuditPerson");
                    tdThree1.InnerText = "咨询内容";

                    HtmlTableCell tdThree2 = CreateTD(1, "2%", null, null);

                    HtmlTableCell tdThree3 = CreateTD(1, "80%", null, null);
                    tdThree3.Align = "left";
                    tdThree3.InnerText = Content;

                    tr3.Controls.Add(tdThree1);
                    tr3.Controls.Add(tdThree2);
                    tr3.Controls.Add(tdThree3);
                    tb.Controls.Add(tr3);

                    HtmlTableRow tr4 = new HtmlTableRow();
                    HtmlTableCell tdFour1 = CreateTD(1, null, null, "billAuditPerson");
                    tdFour1.InnerText = "回复时间";

                    HtmlTableCell tdFour2 = CreateTD(1, "2%", null, null);

                    HtmlTableCell tdFour3 = CreateTD(1, "80%", null, null);
                    tdFour3.Align = "left";
                    tdFour3.InnerText = ReplyDate;

                    tr4.Controls.Add(tdFour1);
                    tr4.Controls.Add(tdFour2);
                    tr4.Controls.Add(tdFour3);
                    tb.Controls.Add(CreateBottomLine());
                    tb.Controls.Add(tr4);


                    HtmlTableRow tr5 = new HtmlTableRow();
                    HtmlTableCell tdFive1 = CreateTD(1, null, null, "billAuditPerson");
                    tdFive1.InnerText = "回复人";

                    HtmlTableCell tdFive2 = CreateTD(1, "2%", null, null);

                    HtmlTableCell tdFive3 = CreateTD(1, "80%", null, null);
                    tdFive3.Align = "left";
                    tdFive3.InnerText = ReplyUserName;

                    tr5.Controls.Add(tdFive1);
                    tr5.Controls.Add(tdFive2);
                    tr5.Controls.Add(tdFive3);
                    tb.Controls.Add(tr5);

                    HtmlTableRow tr6 = new HtmlTableRow();
                    HtmlTableCell tdSix1 = CreateTD(1, null, null, "billAuditPerson");
                    tdSix1.InnerText = "回复内容";

                    HtmlTableCell tdSix2 = CreateTD(1, "2%", null, null);

                    HtmlTableCell tdSix3 = CreateTD(1, "80%", null, null);
                    tdSix3.Align = "left";
                    tdSix3.InnerText = ReplyContent;

                    tr6.Controls.Add(tdSix1);
                    tr6.Controls.Add(tdSix2);
                    tr6.Controls.Add(tdSix3);
                    tb.Controls.Add(tr6);
                }

                tb.Controls.Add(CreateBottomLine());
            }

            tb.ID = "tbConsultationList";
            HtmlTableRow tr = AddTable(tb);
            tr.Cells[0].ID = "tdConsultationList";
            TableCtrl.Rows.Add(tr);

            return tb;
        }
Beispiel #2
0
        public static ObjConsultationList[] CreateConsultationList(XmlNode nodeObject)
        {
            XmlNodeList list = nodeObject.SelectNodes("Consultation");
            ObjConsultationList[] consultationList = new ObjConsultationList[list.Count];

            for (int i = 0; i < list.Count; i++)
            {
                XmlElement element = list[i] as XmlElement;
                string Content = element.GetAttribute("Content");

                string ConsultationDate = element.GetAttribute("ConsultationDate");
                string ConsultationUserName = element.GetAttribute("ConsultationUserName");
                string Flag = element.GetAttribute("Flag");
                string ReplyContent = element.GetAttribute("ReplyContent");
                string ReplyDate = element.GetAttribute("ReplyDate");
                string ReplyUserName = element.GetAttribute("ReplyUserName");
                string ConsultationID = element.GetAttribute("ConsultationID");
                ObjConsultationList objConsultation = new ObjConsultationList();
                objConsultation.Content = Content;
                objConsultation.ConsultationDate = Convert.ToDateTime(ConsultationDate);
                objConsultation.ConsultationUserName = ConsultationUserName;
                objConsultation.Flag = Flag;
                objConsultation.ReplyContent = ReplyContent;
                objConsultation.ReplyDate = Convert.ToDateTime(ReplyDate);
                objConsultation.ReplyUserName = ReplyUserName;
                objConsultation.ConsultationID = ConsultationID;
                consultationList[i] = objConsultation;
            }

            return consultationList;
        }