BLL设计

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace LC.BLL
{
using Entity;
using IDAL;
public class VIPUsersBLL:IBLLBase<VIPUsers>
{
public static string typeName = "VIPUsersDAL";
public static IVIPUsers iVIPUsers;
public VIPUsersBLL():base(typeName)
{
iVIPUsers = (IVIPUsers)idal;
}
public int Add(VIPUsers t)
{
var result = iVIPUsers.Add(t);
return result;
}

public int Delete(int Id)
{
var result = iVIPUsers.Delete(Id);
return result;
}

public List<VIPUsers> Query()
{
var result = iVIPUsers.Query();
return result;
}

public VIPUsers QueryById(int Id)
{
var result = iVIPUsers.QueryById(Id);
return result;
}

public int Update(VIPUsers t)
{
var result = iVIPUsers.Update(t);
return result;
}
}
}

///反射

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace LC.BLL
{
using IDAL;
using Factory;
public class IBLLBase<T> where T:class,new()
{
public static IDALBase<T> idal;
public IBLLBase(string typeName)
{
idal = DataAccess<IDALBase<T>>.GetFactory(typeName);
}
}
}

posted @ 2018-11-22 18:25  嘻嘻哈哈嘿嘿呀  阅读(159)  评论(0编辑  收藏  举报