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

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

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

    單擊產品信息即可進入界面STUserProductaspx注意此產品信息是屬於某個特定連鎖分店用戶的產品信息不同於管理員用戶中的產品模塊管理這在下面代碼中有所體現如圖所示


  連鎖分店產品信息管理界面

    此產品信息管理類似於管理員用戶的產品模塊管理因此這裡只介紹STUserProductaspx cs文件
    private void Page_Load(object sender SystemEventArgs e)
    {
             if(Session[STNickName] != null)
             {
                       //獲得數據庫連接字符串
                       string STconnection = ConfigurationSettingsAppSettings[strconnection];
                       //創建數據庫連接
                       STconn = new SqlConnection(STconnection);
                       if(!IsPostBack)
                       {
                                //自定義BindGrid ()方法加載自己連鎖店產品的信息
                                BindGrid();
                                //打開連接
                                STconnOpen();
                                string STNickName = Session[STNickName]ToString();
                                STmysql = select STProDeIDSTProDeSTProdIDSTProDeSTProdName STProDeSTProdPrice STProDeSTProdBZSTProDeSTProdSHSTProDeSTProdInfo from STProDeSTUser where STProDeSTDepID = STUserSTDepID and STUserSTNickName = + STNickName + ;
                                //創建數據庫SqlCommand對象
                                SqlCommand STcmd = new SqlCommand(STmysqlSTconn);
                                SqlDataReader STsdr = STcmdExecuteReader();
                                if(STsdrRead())
                                {
                                         //將獲取的ID保存到會話中
                                         Session[ID] = STsdr[ID];
                                }
                                //關閉連接
                                STconnClose();
                       }
             }
             else

[]  []  []  


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