コード例 #1
0
ファイル: OrdersPayment.cs プロジェクト: Abnertd/public
    public string GetOrdersPayments()
    {
        string listtype = tools.CheckStr(Request.QueryString["listtype"]);
        string keyword, date_start, date_end;
        int    orders_ID;

        orders_ID = 0;
        //关键词
        keyword = tools.CheckStr(Request["keyword"]);

        //开始时间
        date_start = tools.CheckStr(Request["date_start"]);

        //结束时间
        date_end = tools.CheckStr(Request["date_end"]);

        OrdersInfo ordersinfo = null;
        QueryInfo  Query      = new QueryInfo();

        Query.PageSize    = tools.CheckInt(Request["rows"]);
        Query.CurrentPage = tools.CheckInt(Request["page"]);
        Query.ParamInfos.Add(new ParamInfo("AND", "str", "OrdersPaymentInfo.Orders_Payment_Site", "=", Public.GetCurrentSite()));
        if (keyword != "")
        {
            ordersinfo = Myorder.GetOrdersBySN(keyword);
            if (ordersinfo != null)
            {
                orders_ID = ordersinfo.Orders_ID;
            }
            if (orders_ID > 0)
            {
                Query.ParamInfos.Add(new ParamInfo("AND", "int", "OrdersPaymentInfo.Orders_Payment_OrdersID", "=", orders_ID.ToString()));
            }
        }

        if (date_start != "")
        {
            Query.ParamInfos.Add(new ParamInfo("AND", "funint", "DATEDIFF(d, '" + date_start + "',{OrdersPaymentInfo.Orders_Payment_Addtime})", ">=", "0"));
        }
        if (date_end != "")
        {
            Query.ParamInfos.Add(new ParamInfo("AND", "funint", "DATEDIFF(d, '" + date_end + "',{OrdersPaymentInfo.Orders_Payment_Addtime})", "<=", "0"));
        }
        //Query.ParamInfos.Add(new ParamInfo("AND", "str", "PayWayInfo.Pay_Way_Site", "=", Public.GetCurrentSite()));
        Query.OrderInfos.Add(new OrderInfo(tools.CheckStr(Request["sidx"]), tools.CheckStr(Request["sord"])));

        if (listtype == "payment")
        {
            Query.ParamInfos.Add(new ParamInfo("AND", "int", "OrdersPaymentInfo.Orders_Payment_PaymentStatus", "=", "1"));
        }
        else if (listtype == "refund")
        {
            Query.ParamInfos.Add(new ParamInfo("AND", "int", "OrdersPaymentInfo.Orders_Payment_PaymentStatus", "=", "2"));
            Query.ParamInfos.Add(new ParamInfo("AND", "int", "OrdersPaymentInfo.Orders_Payment_Status", "=", "1"));
        }

        PageInfo pageinfo = MyBLL.GetPageInfo(Query);

        IList <OrdersPaymentInfo> entitys = MyBLL.GetOrdersPayments(Query);

        if (entitys != null)
        {
            StringBuilder jsonBuilder = new StringBuilder();
            jsonBuilder.Append("{\"page\":" + pageinfo.CurrentPage + ",\"total\":" + pageinfo.PageCount + ",\"records\":" + pageinfo.RecordCount + ",\"rows\"");
            jsonBuilder.Append(":[");
            foreach (OrdersPaymentInfo entity in entitys)
            {
                jsonBuilder.Append("{\"id\":" + entity.Orders_Payment_ID + ",\"cell\":[");
                //各字段
                jsonBuilder.Append("\"");
                jsonBuilder.Append(entity.Orders_Payment_ID);
                jsonBuilder.Append("\",");

                jsonBuilder.Append("\"");
                ordersinfo = Myorder.GetOrdersByID(entity.Orders_Payment_OrdersID);
                if (ordersinfo != null)
                {
                    jsonBuilder.Append("<a href=\\\"/orders/orders_view.aspx?orders_id=" + entity.Orders_Payment_OrdersID + "\\\">" + ordersinfo.Orders_SN + "</a>");
                }
                else
                {
                    jsonBuilder.Append("未知");
                }
                ordersinfo = null;
                jsonBuilder.Append("\",");
                jsonBuilder.Append("\"");
                jsonBuilder.Append(entity.Orders_Payment_DocNo);
                jsonBuilder.Append("\",");

                jsonBuilder.Append("\"<span class=\\\"t12_red\\\">");
                jsonBuilder.Append(Public.DisplayCurrency(entity.Orders_Payment_Amount));
                jsonBuilder.Append("</span>\",");

                jsonBuilder.Append("\"");
                jsonBuilder.Append(entity.Orders_Payment_Name);
                jsonBuilder.Append("\",");

                jsonBuilder.Append("\"");
                jsonBuilder.Append(entity.Orders_Payment_Addtime);
                jsonBuilder.Append("\",");

                jsonBuilder.Append("\"");
                jsonBuilder.Append("<a href=\\\"orders_payment_view.aspx?orders_payment_id=" + entity.Orders_Payment_ID + "\\\"><img src=\\\"/images/btn_view.gif\\\" alt=\\\"查看\\\" border=\\\"0\\\" align=\\\"absmiddle\\\"></a>");
                jsonBuilder.Append("\",");

                jsonBuilder.Remove(jsonBuilder.Length - 1, 1);
                jsonBuilder.Append("]},");
            }
            jsonBuilder.Remove(jsonBuilder.Length - 1, 1);
            jsonBuilder.Append("]");
            jsonBuilder.Append("}");
            return(jsonBuilder.ToString());
        }
        else
        {
            return(null);
        }
    }
コード例 #2
0
ファイル: Orders.cs プロジェクト: Abnertd/public
 public OrdersInfo GetOrdersByID(int ID)
 {
     return(MyOrders.GetOrdersByID(ID));
 }