资源简介

使用vs2010+sqlserver2008进行开发的 两个人写的 其中一个写的是代码都揉一起的(BookStore) 一个是分层的(QzwBookStore) 里面使用了spring.net linq to entity等 三层架构(面向接口) 参照这个:http://developer.51cto.com/art/200806/77172.htm 一两天赶出来的东西 要求就别太高了 俺自己的课设 *数据库使用 需要创建一个BookStore的数据库 然后执行BookStore.sql

资源截图

代码片段和文件信息

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Factory;
using IDAL;
using IBLL;
using Model;
using SQLServerDAL;

namespace BLL
{
    public class BookBLL : IBookBLL
    {
        public IQueryable GetAll()
        {
            IBookDAL bookDAL = DALFactory.CreateBookDAL();
            return bookDAL.GetAll();
        }
        public IQueryable GetByName(string name)
        {
            IBookDAL bookDAL = DALFactory.CreateBookDAL();
            return bookDAL.GetUsingByName(name);
        }
        public BookInfo GetByFullName(string name)
        {
            IBookDAL bookDAL = DALFactory.CreateBookDAL();
            return bookDAL.GetUsingByFullName(name);
        }

        public IQueryable GetAllUsing()
        {
            IBookDAL bookDAL = DALFactory.CreateBookDAL();
            return bookDAL.GetAllUsing();
        }

        public IQueryable GetAllUnUsing()
        {
            IBookDAL bookDAL = DALFactory.CreateBookDAL();
            return bookDAL.GetAllUnUsing();
        }


        public bool AddBookOrder(BookOrder_P bookOrderP List bookOrderDs)
        {

            IBookOrder_PDAL bookOrderPDAL = DALFactory.CreateBookOrder_PDAL();
            IBookOrder_DDAL bookOrderDDAL = DALFactory.CreateBookOrder_DDAL();

            try
            {
                bookOrderP = bookOrderPDAL.AddOne(bookOrderP);

                for (int i = 0; i < bookOrderDs.Count; i++)
                {
                    bookOrderDs[i].BookOrder_P_ID = bookOrderP.BookOrder_P_ID;
                }
                bookOrderDs = bookOrderDDAL.AddSome(bookOrderDs);

                DBHelper.Entity.SaveChanges();
                return true;

            }
            catch (Exception)
            {
                return false;
            }

        }

        public bool AddStock(Stock_P stockP List stockDs)
        {
            IStock_PDAL stockPDAL = DALFactory.CreateStock_PDAL();
            IStock_DDAL stockDDAL = DALFactory.CreateStock_DDAL();

            try
            {
                stockP = stockPDAL.AddOne(stockP);

                for(int i=0;i                {
                    stockDs[i].Stock_P_ID = stockP.Stock_P_ID;
                }

                stockDs = stockDDAL.AddSome(stockDs);

                DBHelper.Entity.SaveChanges();
                return true;

            }
            catch (Exception)
            {
                return false;
                throw;
            }
        }
    }
}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件        505  2011-05-29 17:33   qzw-hf-bookstoretest\BLL\App.Config

     文件       7680  2011-05-29 21:10   qzw-hf-bookstoretest\BLL\bin\Debug\BLL.dll

     文件        505  2011-05-29 17:33   qzw-hf-bookstoretest\BLL\bin\Debug\BLL.dll.config

     文件      19968  2011-05-29 21:10   qzw-hf-bookstoretest\BLL\bin\Debug\BLL.pdb

     文件      28672  2009-07-21 01:50   qzw-hf-bookstoretest\BLL\bin\Debug\Common.Logging.dll

     文件       5632  2011-05-29 21:10   qzw-hf-bookstoretest\BLL\bin\Debug\Factory.dll

     文件      17920  2011-05-29 21:10   qzw-hf-bookstoretest\BLL\bin\Debug\Factory.pdb

     文件       4608  2011-05-29 21:10   qzw-hf-bookstoretest\BLL\bin\Debug\IBLL.dll

     文件       7680  2011-05-29 21:10   qzw-hf-bookstoretest\BLL\bin\Debug\IBLL.pdb

     文件       5120  2011-05-29 21:10   qzw-hf-bookstoretest\BLL\bin\Debug\IDAL.dll

     文件       7680  2011-05-29 21:10   qzw-hf-bookstoretest\BLL\bin\Debug\IDAL.pdb

     文件      99328  2011-05-29 21:10   qzw-hf-bookstoretest\BLL\bin\Debug\Model.dll

     文件     134656  2011-05-29 21:10   qzw-hf-bookstoretest\BLL\bin\Debug\Model.pdb

     文件     839680  2009-12-17 03:23   qzw-hf-bookstoretest\BLL\bin\Debug\Spring.Core.dll

     文件    2801152  2009-12-17 03:23   qzw-hf-bookstoretest\BLL\bin\Debug\Spring.Core.pdb

     文件    2444176  2009-12-17 03:23   qzw-hf-bookstoretest\BLL\bin\Debug\Spring.Core.xml

     文件        891  2011-05-29 17:33   qzw-hf-bookstoretest\BLL\bin\Debug\Spring.xml.config

     文件       9728  2011-05-29 21:10   qzw-hf-bookstoretest\BLL\bin\Debug\SQLServerDAL.dll

     文件      30208  2011-05-29 21:10   qzw-hf-bookstoretest\BLL\bin\Debug\SQLServerDAL.pdb

     文件       3541  2011-05-29 17:35   qzw-hf-bookstoretest\BLL\BLL.csproj

     文件        142  2011-06-02 09:48   qzw-hf-bookstoretest\BLL\BLL.csproj.vs10x

     文件       2703  2011-05-29 15:05   qzw-hf-bookstoretest\BLL\BookBLL.cs

     文件       1853  2011-05-29 18:28   qzw-hf-bookstoretest\BLL\obj\Debug\BLL.csproj.FileListAbsolute.txt

     文件       7680  2011-05-29 21:10   qzw-hf-bookstoretest\BLL\obj\Debug\BLL.dll

     文件      19968  2011-05-29 21:10   qzw-hf-bookstoretest\BLL\obj\Debug\BLL.pdb

     文件       6203  2011-05-29 21:10   qzw-hf-bookstoretest\BLL\obj\Debug\DesignTimeResolveAssemblyReferencesInput.cache

     文件       1054  2011-05-28 10:28   qzw-hf-bookstoretest\BLL\PricePolicyBLL.cs

     文件       1436  2011-05-24 13:27   qzw-hf-bookstoretest\BLL\Properties\AssemblyInfo.cs

     文件        891  2011-05-29 17:33   qzw-hf-bookstoretest\BLL\Spring.xml.config

     文件        535  2011-05-28 15:29   qzw-hf-bookstoretest\BLL\VIPBLL.cs

............此处省略544个文件信息

评论

共有 条评论