Esempio n. 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);
    }
Esempio n. 2
0
    //合同订单所有产品(打印)
    public string Contract_Orders_Goods_Print(int Contract_ID)
    {
        string strHTML = "";
        IList <OrdersGoodsInfo> GoodsListAll = null;
        int freighted_amount;
        int icount = 0;

        ContractInfo contractinfo = GetContractByID(Contract_ID);

        if (contractinfo != null)
        {
            strHTML += "<table width=\"635\" border=\"0\" align=\"center\" class=\"list_tab\" style=\"border:1px solid #000000;page-break-before:always;\" cellpadding=\"0\" cellspacing=\"0\" bgcolor=\"#000000\">";
            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>";

            if (contractinfo.Contract_Status == 1)
            {
                strHTML += "<td align=\"center\">规格</td>";
                strHTML += "<td align=\"center\">单价</td>";
                strHTML += "<td align=\"center\">数量</td>";
                strHTML += "<td align=\"center\">金额</td>";
            }
            else
            {
                strHTML += "<td align=\"center\">数量</td>";
            }
            //strHTML += "<td align=\"center\">总价(元)</td>";
            strHTML += "</tr>";
            IList <OrdersInfo> ordersinfos = MyOrders.GetOrderssByContractID(Contract_ID);
            if (ordersinfos != null)
            {
                foreach (OrdersInfo ordersinfo in ordersinfos)
                {
                    GoodsListAll = MyOrders.GetGoodsListByOrderID(ordersinfo.Orders_ID);
                    if (GoodsListAll != null)
                    {
                        foreach (OrdersGoodsInfo entity in GoodsListAll)
                        {
                            string      Product_Spec  = "";
                            string      Product_Unit  = "";
                            ProductInfo productEntity = new Product().GetProductByID(entity.Orders_Goods_Product_ID);
                            if (productEntity != null)
                            {
                                Product_Spec = productEntity.Product_Spec;
                                Product_Unit = productEntity.Product_Unit;
                                if (Product_Unit == "0")
                                {
                                    Product_Unit = "";
                                }
                            }

                            if (entity.Orders_Goods_Type == 2 && entity.Orders_Goods_ParentID == 0)
                            {
                                freighted_amount = 0;
                            }
                            else
                            {
                                icount   = icount + 1;
                                strHTML += "<tr bgcolor=\"#ffffff\">";
                                strHTML += "<td align=\"center\">" + icount + "</td>";
                                strHTML += "<td align=\"center\">" + entity.Orders_Goods_Product_Name + "</td>";

                                //strHTML += "<td align=\"center\">" + ordersinfo.Orders_SN + "</td>";
                                strHTML += "<td align=\"center\">" + Product_Spec + "</td>";
                                strHTML += "<td align=\"center\">" + Product_Unit + "</td>";
                                strHTML += "<td align=\"center\">" + entity.Orders_Goods_Product_Price + "</td>";

                                if (contractinfo.Contract_Status == 1)
                                {
                                    strHTML += "<td align=\"center\">" + entity.Orders_Goods_Product_Spec + "&nbsp;</td>";
                                    strHTML += "<td align=\"center\">" + Public_Class.DisplayCurrency(entity.Orders_Goods_Product_Price) + "</td>";
                                    strHTML += "<td align=\"center\">" + (entity.Orders_Goods_Amount) + "</td>";
                                    strHTML += "<td align=\"center\">" + (Public_Class.DisplayCurrency(entity.Orders_Goods_Product_Price * entity.Orders_Goods_Amount)) + "</td>";
                                }
                                else
                                {
                                    strHTML += "<td align=\"center\">" + (entity.Orders_Goods_Amount) + "</td>";
                                }
                                //strHTML += "<td align=\"center\">" + (entity.Orders_Goods_Product_Price * entity.Orders_Goods_Amount) + "</td>";
                                strHTML += "</tr>";
                            }
                        }
                    }
                }
            }
        }
        strHTML += "</table>";
        return(strHTML);
    }