熱點推薦:
您现在的位置: 電腦知識網 >> 編程 >> .NET編程 >> 正文

ASP.NET項目開發指南:經營狀況統計(1)

2022-06-13   來源: .NET編程 

    經營狀況統計(

  在管理員界面中單擊經營狀況統計超鏈接將進入經營狀況統計頁面ST_TurnOverStataspx如圖所示

  經營狀況統計頁面

  ST_ TurnoverStataspx的主要代碼

  ST_TurnoverStataspx的HTML代碼參見配書光盤在此重點介紹控件<Module:TurnOverStat id= ModuleTurnOverStat runat=server />ST_TurnOverStatModuleascx的HTML代碼如程序所示

  程序  ST_TurnOverStatModuleascx

    <TABLE cellSpacing= cellPadding= width=%>

        <TBODY>

            <TR class=rheader>

                <TD class=rheadercol align=left colSpan=

                    height=>經營狀況統計

                </TD>

            </TR> <! SPACER ROW >

    …

  在此頁面中按日期查詢的代碼與客戶信息查詢頁面中的查詢代碼一樣這裡不再贅述

    …

            <TR>

                <TD class=rbodycol align=left width=% colSpan=

                    height=>按房間類型

                    <asp:dropdownlist id=RCategoryNameList

                    runat=server>

                    <asp:ListItem Value=>請選擇</asp:ListItem>

                    </asp:dropdownlist><asp:button id=Calculate

    runat=server Text=開始統計 BorderStyle=Groove></asp:button></TD>

            </TR>

            <TR class=rbody>

                <TD class=rbodycol align=center colSpan=

                height=>

            <!GridView控件>

            <asp:GridView id=dg_TurnOverList runat=server Width=%

                PageSize=

                    AutoGenerateColumns=False BorderColor=Black

                        onpageindexchanging=GridView_Page>

                    <AlternatingRowStyle

                        BackColor=#CCCCFF></AlternatingRowStyle>

                    <HeaderStyle FontBold=True

                        BackColor=#CCCCFF></HeaderStyle>

                    <Columns>

                        <asp:BoundField DataField=ST_BeginTime

            SortExpression= HeaderText=訂房時間></asp:BoundField>

                        <asp:BoundField DataField=ST_EndTime

                            HeaderText=退房時間></asp:BoundField>

                        <asp:BoundField DataField=ST_RoomId HeaderText=

                            房間號></asp:BoundField>

                        <asp:BoundField DataField=ST_Name HeaderText=

                            房間類型></asp:BoundField>

                        <asp:BoundField DataField=ST_CName HeaderText=

                            客戶姓名></asp:BoundField>

                        <asp:BoundField DataField=ST_CIdentityId

                            HeaderText=身份證號></asp:BoundField>

                        <asp:BoundField DataField=ST_CPhone HeaderText=

                            聯系電話></asp:BoundField>

                        <asp:BoundField DataField=ST_TotalPrice

                            HeaderText=金額></asp:BoundField>

                    </Columns>

                    <PagerSettings Mode=NextPrevious NextPageText=下一

                            頁 PreviousPageText=上一頁 />

                </asp:GridView></TD>

            </TR>

            <TR>

                <td width=% height=><b><font color=red>營業

                    額<asp:label id=TurnOverLabel

                Runat=server></asp:label></font></b></td>

                <TD align=right><asp:button id=ShowAll runat=server

                    Text=全部顯示 BorderStyle=Groove

                    Visible=False></asp:button></TD></TR>

        </TBODY>

    </TABLE>

  【代碼說明】上述代碼中的第~行是一個GridView其中第行的onpageindexchanging是GridView的翻頁事件(後面章節中將介紹翻頁事件中的代碼)~行是在GridView中綁定需要的字段通過DataField屬性決定要綁定哪一個字段

  說明翻頁樣式有數字的漢字的符號的等具體使用哪一種通過Mode屬性來決定

       返回目錄ASPNET項目開發指南

       編輯推薦

       ASPNET MVC 框架揭秘

       ASPNET開發寶典

       ASP NET開發培訓視頻教程


From:http://tw.wingwit.com/Article/program/net/201311/15962.html
    Copyright © 2005-2022 電腦知識網 Computer Knowledge   All rights reserved.