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

連鎖中心配送系統:產品信息維護[2]

2013-11-13 11:09:34  來源: .NET編程 
    ——此文章摘自《ASPNET +SQL Server網絡應用系統開發案例精解》定價 特價 詳細>>

             {
                       ResponseRedirect(/Indexaspx);
             }
    }
    public void BindGrid()
    {
             string STNickName = Session[STNickName]ToString();
             //創建查詢指定連鎖店產品信息的sql語句
             STmysql = select STProDeIDSTProDeSTProdIDSTProDeSTProdName STProDeSTProdPrice STProDeSTProdBZSTProDeSTProdSHSTProDeSTProdInfo from STProDeSTUser where STProDeSTDepID = STUserSTDepID and STUserSTNickName = + STNickName + ;
             //創建SqlDataAdapter的實例
             SqlDataAdapter STsda=new SqlDataAdapter(STmysqlSTconn);
             //創建DataSet的實例
             DataSet STds=new DataSet();
             //將信息填充到DataSet
             STsdaFill(STds);
             //將信息綁定到DataGrid
             STmyGridDataSource = STds;
             STmyGridDataBind();
    }
    //處理分頁
    public void STmyGrid_Page(object senderDataGridPageChangedEventArgs e)
    {
             //獲取DataGrid的當前顯示頁的索引
             STmyGridCurrentPageIndex=eNewPageIndex;
             //重新顯示數據
             BindGrid();
    }
    單擊編輯按鈕彈出一個Window窗口用來編輯產品信息單擊刪除按鈕直接刪除指定ID的產品信息
    public void dgItem(object source DataGridCommandEventArgs e)
    {
             //獲取要編輯的ID號
             int ID = intParse(eItemCells[]Text);
             //單擊編輯按鈕所觸發的事件
             if(eCommandName==edit)
             {
                       //彈出用於編輯的窗口
                       ResponseWrite(<script language=javascript defer>ret = windowshowModalDialog(STAddProduct
aspx?Action=edit&id=+ID+windowdialogHeight:px;dialogWidth:px;center:Yes;Help:No;Resizable:No;Scroll:auto;Status:no;);</script>);   
             }

[]  []  []  


From:http://tw.wingwit.com/Article/program/net/201311/15284.html
    推薦文章
    Copyright © 2005-2013 電腦知識網 Computer Knowledge   All rights reserved.