zoukankan      html  css  js  c++  java
  • NetPetshop 研究学习(一)


    NetPetshop 研究学习(一)


    1  NetPetshop是采用了数据库持久层采用O/RM工具iBatisNet。
      采用了典型的三层结构。分层如下:
      数据访问层:NPetshop.Service,NPetshop.Persistence,NPetshop.Domain
      业务逻辑层:NPetshop.Presentation
      表示层:NPetshop.Web
    2 以用户帐户注册页面的为例说明调用关系:
    D:/NPetShop/NPetshop/NPetshop.Web/Default.aspx.cs
    调用如下类:
    D:/NPetShop/NPetshop/NPetshop.Web/UserControls/Accounts/NewAccount.ascx.cs
    调用如下类:
    D:/NPetShop/NPetshop/NPetshop.Presentation/UserActions/AccountAction.cs
    调用如下类:
    D:/NPetShop/NPetshop/NPetshop.Service/AccountService.cs
    调用如下类:
    D:/NPetShop/NPetshop/NPetshop.Persistence/MapperDao/Accounts/AccountSqlMapDao.cs
    调用如下类:
    D:/NPetShop/NPetshop/NPetshop.Persistence/MapperDao/BaseSqlMapDao.cs 

    3 如何读取dao.config,SqlMap.config配置文件

    D:/NPetShop/NPetshop/NPetshop.Service/ServiceConfig.cs
    如下代码:
            static public ServiceConfig GetInstance()
            {
                if (_instance == null)
                {
                    lock (_synRoot)
                    {
                        if (_instance == null)
                        {
                            ConfigureHandler handler = new ConfigureHandler(ServiceConfig.Reset);

                            DomDaoManagerBuilder builder = new DomDaoManagerBuilder();
                            builder.ConfigureAndWatch("dao.config", handler);

                            _instance = new ServiceConfig();
                            _instance._daoManager = IBatisNet.DataAccess.DaoManager.GetInstance("SqlMapDao");
                        }
                    }
                }
                return _instance;
            }

           
           
    5 利用<asp:repeater/>控件绑定数据
    <asp:repeater id="RepeaterItems" runat="server">
          <headertemplate>
           <table cellpadding="0" cellspacing="1">
            <tr class="gridHead">
             <td>Line</td>
             <td>Item</td>
             <td>Product</td>
             <td>Price</td>
             <td>Quantity</td>
             <td>Subtotal</td>
            </tr>
          </headertemplate>
          <itemtemplate>
           <tr class="gridItem">
            <td><%# DataBinder.Eval(Container.DataItem, "LineNumber") %></td>
            <td><%# DataBinder.Eval(Container.DataItem, "Item.Id") %></td>
            <td><%# DataBinder.Eval(Container.DataItem, "Item.Product.Id") %></td>
            <td class="num"><%# DataBinder.Eval(Container.DataItem, "Item.ListPrice", "{0:c}") %></td>
            <td class="num"><%# DataBinder.Eval(Container.DataItem, "Quantity") %></td>
            <td class="num"><%# DataBinder.Eval(Container.DataItem, "Total", "{0:c}") %></td>
           </tr>
          </itemtemplate>
          <footertemplate></table></footertemplate>
    </asp:repeater>

  • 相关阅读:
    多测师讲解python _函数的传递_高级讲师肖sir
    多测师讲解pthon _函数__return_高级讲师肖sir
    多测师讲解python _函数中参数__高级讲师肖sir
    前端 HTML body标签相关内容 常用标签 图片标签 <img/>
    mysql 操作sql语句 操作数据库
    python web框架 MVC MTV
    linux dmesg 查看系统故障信息
    linux uniq 命令
    linux md5sum命令
    Python 字典 items() 方法
  • 原文地址:https://www.cnblogs.com/dbasys/p/2127571.html
Copyright © 2011-2022 走看看