Exemplo n.º 1
0
        // static string[] _series_types = new string[] { "title", "author", "publisher", "isbn" };

        static string BuildBiblioHtml(
            OrderListItem item,
            string strPubType)
        {
            string[] types = _book_types;
            //if (strPubType == "series")
            //    types = _series_types;

            StringBuilder text = new StringBuilder();

            text.Append("\r\n<table class='biblio'>");

            foreach (string type in types)
            {
                string strName  = "";
                string strValue = "";
                if (type == "title")
                {
                    strName  = "题名";
                    strValue = item.Title;
                }

                if (type == "author")
                {
                    strName  = "著者";
                    strValue = item.Author;
                }

                if (type == "publisher")
                {
                    strName  = "出版者";
                    strValue = item.Publisher;
                }

                if (type == "isbn")
                {
                    strName  = "ISBN/ISSN";
                    strValue = item.Isbn;
                }

                if (string.IsNullOrEmpty(strValue) == true)
                {
                    continue;
                }

                string strClass = "line";
                if (string.IsNullOrEmpty(type) == false)
                {
                    strClass += " type-" + type;
                }
                text.Append("\r\n\t<tr class='" + strClass + "'>");
                {
                    text.Append("\r\n\t\t<td class='name'>" + HttpUtility.HtmlEncode(strName) + "</td>");
                    text.Append("\r\n\t\t<td class='value'>" + HttpUtility.HtmlEncode(strValue).Replace("\n", "<br/>") + "</td>");
                }
                text.Append("\r\n\t</tr>");
            }
            text.Append("\r\n</table>");
            return(text.ToString());
        }
Exemplo n.º 2
0
        void OutputLine(WebBrowser webBrowser1,
                        OrderListItem item,
                        ref int nStart)
        {
            StringBuilder text = new StringBuilder();

            string strPubType = OrderEditForm.GetPublicationType(item.BiblioStore.RecPath);

            if (_tableCount == 0)
            {
                text.Append("\r\n<" + TABLE + " class=''>");
            }

            int nColSpan = 7;

            if (strPubType == "series")
            {
                nColSpan += 2;
            }
            text.Append("\r\n\t<" + TR + " class='biblio' biblio-recpath='" + HttpUtility.HtmlEncode(item.BiblioStore.RecPath) + "'>");
            // text.Append("\r\n\t\t<" + TD + " class='biblio-index'><div>" + (nStart + 1).ToString() + "</div></" + TD + ">");
            text.Append("\r\n\t\t<" + TD + " class='nowrap' colspan='" + nColSpan + "'>"
                        // + "<div class='biblio-head'>" + HttpUtility.HtmlEncode(item.RecPath) + "</div>"
                        + "<div class='biblio-table-container'>" + BuildBiblioHtml(item, strPubType) + "</div>"
                        + "</" + TD + ">");

            text.Append("\r\n\t</" + TR + ">");

            text.Append(GetTitleLine(strPubType));
            text.Append(BuildLineHtml(item, strPubType, nStart, null));

            text.Append("\r\n\t<" + TR + " class='sep'>");
            text.Append("\r\n\t\t<" + TD + " colspan='10'>"
                        + "</" + TD + ">");
            text.Append("\r\n\t</" + TR + ">");

            nStart++;

            if (_tableCount >= 9)
            {
                text.Append("\r\n</" + TABLE + ">");
                _tableCount = 0;
            }
            else
            {
                _tableCount++;
            }

            AppendHtml(webBrowser1, text.ToString(), false);
            text.Clear();
        }
Exemplo n.º 3
0
        // 根据 BiblioStore 对象拆分出 OrderListItem 对象数组
        public static List <OrderListItem> SplitOrderListItems(BiblioStore biblio)
        {
            List <OrderListItem> results = new List <OrderListItem>();

            List <OrderStore> orders = new List <OrderStore>();

            // orders.AddRange(biblio.Orders);
            foreach (OrderStore order in biblio.Orders)
            {
                if (order.Type == "deleted")
                {
                    continue;
                }
                if (string.IsNullOrEmpty(order.GetFieldValue("state")))
                {
                    orders.Add(order);
                }
            }

            while (orders.Count > 0)
            {
                OrderListItem item  = new OrderListItem();
                OrderStore    start = orders[0];
                item.Merge(start);
                orders.RemoveAt(0);
                for (int i = 0; i < orders.Count; i++)
                {
                    OrderStore order = orders[i];
                    if (Compare(start, order) == true)
                    {
                        item.Merge(order);
                        orders.RemoveAt(i);
                        i--;
                    }
                }

                results.Add(item);
            }

            return(results);
        }
Exemplo n.º 4
0
        string BuildLineHtml(
            OrderListItem item,
            string strPubType,
            int i,
            string strClass)
        {
            StringBuilder text = new StringBuilder();

            // string strPubType = BatchOrderForm.GetPublicationType(item.BiblioStore.RecPath);

            text.Append("\r\n\t<" + TR + " "
                        + "class='item check "
                        + (string.IsNullOrEmpty(strClass) ? "" : " " + strClass)
                        + "' index='" + i + "' seller='" + HttpUtility.HtmlEncode(item.Seller)
                        + "' biblio-recpath='" + HttpUtility.HtmlEncode(item.BiblioStore.RecPath) + "' "
                        + " orders-refid='" + HttpUtility.HtmlEncode(item.GetOrdersRefIDList()) + "' "
                        + strOnClick + ">");
            // text.Append("<td class='nowrap'></td>");
            text.Append("\r\n\t\t<" + TD + " class='item-index'>" + (i + 1).ToString() + "</" + TD + ">");

            text.Append("\r\n\t\t<" + TD + " class='catalogNo'>");
            text.Append(HttpUtility.HtmlEncode(item.CatalogNo));
            text.Append("</" + TD + ">");

#if NO
            text.Append("\r\n\t\t<" + TD + " class='title'>");
            text.Append(HttpUtility.HtmlEncode(item.Title));
            text.Append("</" + TD + ">");

            text.Append("\r\n\t\t<" + TD + " class='author'>");
            text.Append(HttpUtility.HtmlEncode(item.Author));
            text.Append("</" + TD + ">");

            text.Append("\r\n\t\t<" + TD + " class='publisher'>");
            text.Append(HttpUtility.HtmlEncode(item.Publisher));
            text.Append("</" + TD + ">");
#endif
            if (strPubType == "series")
            {
                text.Append("\r\n\t\t<" + TD + " class='range'>");
                text.Append(HttpUtility.HtmlEncode(item.Range));
                text.Append("</" + TD + ">");
            }

            text.Append("\r\n\t\t<" + TD + " class='copy'>");
            text.Append(HttpUtility.HtmlEncode(item.Copy));
            text.Append("</" + TD + ">");

            if (strPubType == "series")
            {
                text.Append("\r\n\t\t<" + TD + " class='issueCount'>");
                text.Append(HttpUtility.HtmlEncode(item.IssueCount));
                text.Append("</" + TD + ">");
            }

            text.Append("\r\n\t\t<" + TD + " class='price'>");
            text.Append(HttpUtility.HtmlEncode(item.Price));
            text.Append("</" + TD + ">");

            text.Append("\r\n\t\t<" + TD + " class='totalPrice'>");
            text.Append(HttpUtility.HtmlEncode(item.TotalPrice));
            text.Append("</" + TD + ">");

            text.Append("\r\n\t</" + TR + ">");

            return(text.ToString());
        }
Exemplo n.º 5
0
 public void Add(OrderListItem item)
 {
     _items.Add(item);
 }