Spring.net的初次使用(2)--关于Bll类
BaseManager.cs
using System;
using System.Collections.Generic;
using System.Text;
using System.Collections;
using Ivan.Spring.Dao;
using Ivan.Spring.Model;
namespace Ivan.Spring.Bll
{
public abstract class BaseManager : IBaseManager
{
// Methods
public bool DeleteObject(Entity entity)
{
return this.getBaseDAO().DeleteObject(entity);
}
![]()
public IList GetAllObjectsList()
{
return this.getBaseDAO().GetAllObjectsList();
}
![]()
protected abstract DaoBase getBaseDAO();
![]()
public Entity Load(object ID)
{
return this.getBaseDAO().Load(ID);
}
![]()
public Entity SaveObject(Entity entity)
{
return this.getBaseDAO().SaveObject(entity);
}
![]()
public bool UpdateObject(Entity entity)
{
return this.getBaseDAO().UpdateObject(entity);
}
![]()
}
}
IBaseManager.cs
using System;
using System.Collections.Generic;
using System.Text;
using System.Collections;
using Ivan.Spring.Dao;
using Ivan.Spring.Model;
namespace Ivan.Spring.Bll
{
public abstract class BaseManager : IBaseManager
{
// Methods
public bool DeleteObject(Entity entity)
{
return this.getBaseDAO().DeleteObject(entity);
}
![]()
public IList GetAllObjectsList()
{
return this.getBaseDAO().GetAllObjectsList();
}
![]()
protected abstract DaoBase getBaseDAO();
![]()
public Entity Load(object ID)
{
return this.getBaseDAO().Load(ID);
}
![]()
public Entity SaveObject(Entity entity)
{
return this.getBaseDAO().SaveObject(entity);
}
![]()
public bool UpdateObject(Entity entity)
{
return this.getBaseDAO().UpdateObject(entity);
}
![]()
}
}
UserManager.cs
using System;
using System.Collections.Generic;
using System.Text;
using System.Collections;
using Ivan.Spring.Dao;
namespace Ivan.Spring.Bll
{
IUserManager接口
![]()
UserManager类
}
using System;
using System.Collections.Generic;
using System.Text;
using System.Collections;
using Ivan.Spring.Dao;
using Ivan.Spring.Model;
namespace Ivan.Spring.Bll
{
public abstract class BaseManager : IBaseManager
{
// Methods
public bool DeleteObject(Entity entity)
{
return this.getBaseDAO().DeleteObject(entity);
}
public IList GetAllObjectsList()
{
return this.getBaseDAO().GetAllObjectsList();
}
protected abstract DaoBase getBaseDAO();
public Entity Load(object ID)
{
return this.getBaseDAO().Load(ID);
}
public Entity SaveObject(Entity entity)
{
return this.getBaseDAO().SaveObject(entity);
}
public bool UpdateObject(Entity entity)
{
return this.getBaseDAO().UpdateObject(entity);
}
}
}
using System;
using System.Collections.Generic;
using System.Text;
using System.Collections;
using Ivan.Spring.Dao;
using Ivan.Spring.Model;
namespace Ivan.Spring.Bll
{
public abstract class BaseManager : IBaseManager
{
// Methods
public bool DeleteObject(Entity entity)
{
return this.getBaseDAO().DeleteObject(entity);
}
public IList GetAllObjectsList()
{
return this.getBaseDAO().GetAllObjectsList();
}
protected abstract DaoBase getBaseDAO();
public Entity Load(object ID)
{
return this.getBaseDAO().Load(ID);
}
public Entity SaveObject(Entity entity)
{
return this.getBaseDAO().SaveObject(entity);
}
public bool UpdateObject(Entity entity)
{
return this.getBaseDAO().UpdateObject(entity);
}
}
}
UserManager.cs
using System;
using System.Collections.Generic;
using System.Text;
using System.Collections;
using Ivan.Spring.Dao;
namespace Ivan.Spring.Bll
{
IUserManager接口
UserManager类
}



浙公网安备 33010602011771号