Пример #1
0
    //获取合同附加订单(打印)
    public string GetPrintContractOrdersByContractsID(int Contract_ID)
    {
        string strHTML = "";
        int    i       = 0;

        strHTML += "<table border=\"0\"  width=\"100%\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\"><tr><td>";
        strHTML += "<table border=\"0\"  width=\"608\" align=\"right\" class=\"list_tab\" style=\"border:1px solid #000000;\" cellpadding=\"0\" cellspacing=\"0\">";
        strHTML += "    <tr bgcolor=\"#ffffff\">";
        strHTML += "        <td align=\"center\" style=\"height:25px;\" width=\"50\">序号</td>";
        strHTML += "        <td align=\"center\">订单编号</td>";
        strHTML += "        <td align=\"center\">商品种类</td>";
        strHTML += "        <td align=\"center\">数量</td>";
        strHTML += "        <td align=\"center\">订单金额</td>";
        strHTML += "        <td align=\"center\">下单时间</td>";
        strHTML += "    </tr>";
        int    Goods_Amount = 0;
        double Goods_Sum    = 0;
        IList <OrdersGoodsInfo> GoodsListAll = null;
        ContractInfo            Contract     = GetContractByID(Contract_ID);

        if (Contract != null)
        {
            IList <OrdersInfo> ordersinfos = MyOrders.GetOrderssByContractID(Contract_ID);
            if (ordersinfos != null)
            {
                foreach (OrdersInfo ordersinfo in ordersinfos)
                {
                    Goods_Sum    = 0;
                    Goods_Amount = 0;
                    i            = i + 1;
                    GoodsListAll = MyOrders.GetGoodsListByOrderID(ordersinfo.Orders_ID);
                    if (GoodsListAll != null)
                    {
                        foreach (OrdersGoodsInfo good in GoodsListAll)
                        {
                            if ((good.Orders_Goods_ParentID == 0 && good.Orders_Goods_Type != 2) || good.Orders_Goods_ParentID > 0)
                            {
                                Goods_Amount = Goods_Amount + 1;
                                Goods_Sum    = Goods_Sum + good.Orders_Goods_Amount;
                            }
                        }
                    }

                    strHTML += "    <tr bgcolor=\"#ffffff\">";
                    strHTML += "        <td align=\"left\">" + i + "</td>";
                    strHTML += "        <td align=\"left\">" + ordersinfo.Orders_SN + "</td>";
                    strHTML += "        <td align=\"left\">" + Goods_Amount + "</td>";
                    strHTML += "        <td align=\"left\">" + Goods_Sum + "</td>";
                    strHTML += "        <td align=\"left\">" + Public_Class.DisplayCurrency(ordersinfo.Orders_Total_AllPrice) + "</td>";
                    strHTML += "        <td align=\"left\">" + ordersinfo.Orders_Addtime + "</td>";
                    strHTML += "    </tr>";
                }
            }
        }

        strHTML += "    </table></td></tr></table>";
        return(strHTML);
    }