如何只选择一个号码并获取所有号码的名称

本文关键字:号码 获取 一个 选择 | 更新日期: 2023-09-27 18:19:50

  1. 样品:1份BEEF 1份FRIED RICE 1份SPECIALTY BEEF 2份Kitchen 3只狗
  2. 结果: 1啤酒、炒饭、特色啤酒2厨房3

假设qno(1)是数字代码等是name如何显示一个数字,获取所有名称并在一个div中返回。我只使用一个div来显示所有数据。提前谢谢。我知道这对你们来说很容易,但我花了太长时间来编码…

 **Here is the javascipt.**
  success: function (data) {
        $('#scrollIncoming').empty();
        for (var i in data) {
            var rc = '#' + (Math.random() * 0xFFFFFF << 0).toString(16);
            var qno = [data[i].QueueNo];
            for (var currentQueueNo = 0; currentQueueNo < qno.length; currentQueueNo++)
               $('#scrollIncoming').append(
                        '<span style="background-color:' + rc + ';width: 33%;border:1px solid black;height: 220px;float: left;">' +
                            '<span style="font-size: 60px;color:white; text-align: center;margin-top:30px;margin-left: 150px">' + qno[currentQueueNo] + '</span>' +
                            '<span style="font-size: 10px;width: 33%;text-align: center;color:black;margin-top:80px;margin-left: 80px">' +
                            data[i].Quantity + '&nbsp' + data[i].Code +
                            '<span style="font-size: 20px;width: 33%;text-align: center;margin-top:150px;margin-left: 50px">' +
                            '<img src="./resources/images/dispatch.png"/></a>' +
                            '<img src="./resources/images/dispatchingPage.png"/></a>' +
                            '<img src="./resources/images/undo.png"/></a>' + '</span>' +
                '<div id="div1">' +
                    '</div>'                   
                    );              
        $('#lblIncomingCounter').text(data.length);
        }
    }
**Here is the aspx.**
    <form id="form1" runat="server">
            <div style="background-color: #ecf0f1; width: 100%; border: black 1px solid; margin: auto">
                <div id="scrollIncoming">
                    <div id='container'>
                    </div>
                </div>
            </div>
        </form>

**Here is the code behind**
listTransactions.Add(new ....()          {
    QueueNo = Convert.ToInt32(rdr["dd_queue_no"]),
    RefNo = Convert.ToInt32(rdr["key"]),
   Quantity =Convert.ToInt32(rdr["quantity"]),
   Code = Convert.ToString(rdr["name"]),
   OrderStatus = Convert.ToInt32(rdr[".."])
  });
 **Here is the sp**
@cluster int,
    @order_status int
..
 declare
    @datetoday datetime
    set @datetoday = CONVERT (date, GETDATE())
    select 
        DISTINCT (t.dd_queue_no),
        t.[key],
        p.name,
        pt.quantity,
        t.dd_order_status
    from 
        transactions t
    inner join 
        product_transactions pt
    on 
        t.[key] = pt.transactions_key
    inner join
        products p
    ON 
        pt.[products_key] = p.[key]
    where 
        t.dd_cluster_key = @cluster and t.dd_order_status = @order_status
    and
        t.[datetime]
    between 
        cast(@datetoday+' 00:00:00' as datetime) and cast(@datetoday+' 23:59:00' as datetime)
    order BY
         [dd_queue_no]  

如何只选择一个号码并获取所有号码的名称

  var append = $('#scrollIncoming').append(
                              '<div  onclick="javascript:fnc' +
                              'UpdateStatus(' + data[j].RefNo + ',' + data[j].OrderStatus + ')">' +
                              '<div id="scrollIncoming' + data[j].QueueNo + '" class="mainDiv">' +
                              '<div class="mainDivHead"><span  class="detailsSpanHead">' + ata[j].QueueNo + '</span></div>' +
                              '<div id="innermo' + data[j].QueueNo + '" class="mainDivBody">' +
                              '<span class="detailsSpan">' + data[j].Quantity + ' - ' + data[j].Code + '</span></br>' +
                              '</div>' +
                              '</div>'
                                );

抱歉,回复晚了。。顺便说一句,我已经解决了。谢谢bdw