コード例 #1
0
        /// <summary>
        /// 获取订单打印内容
        /// </summary>
        /// <param name="orderNo"></param>
        /// <param name="templateId"></param>
        /// <returns></returns>
        public ActionResult GetOrderPrintContent(string orderNo, string templateId)
        {
            PrintService printService = new PrintService();
            var          order        = _orderBll.GetOrderViewModel(orderNo);
            var          orderItems   = _orderBll.GetOrderItemViewModel(orderNo);

            if (order != null && orderItems.Count > 0)
            {
            }
            IOrderPrint template        = printService.GetOrderPrintTemplate(templateId);
            string      templateContent = "";

            if (template != null)
            {
                templateContent = template.GetTemplateContent(order, orderItems);
            }
            var jsonData = new
            {
                TemplateContent = templateContent
            };

            return(Content(jsonData.ToJson()));
        }