using System;
using System.Collections;
using guestbook.data;
using guestbook.Dal;
namespace guestbook.BLL
{
/// <summary>
/// guestbookbll 的摘要说明。
/// </summary>
public class guestbookbll
{
public void AddGuestBook(guestbooks gb)
{
if((gb.title.Trim()==string.Empty)||(gb.username.Trim()==string.Empty))
return;
guestbookdal dal=new guestbookdal();
dal.addGuestBook(gb);
}
public void UpdateGuestBook(guestbooks gb,int Id)
{
if((gb.title.Trim()==string.Empty)||(gb.username.Trim()==string.Empty))
return;
guestbookdal dal=new guestbookdal();
dal.updateGuestBook(gb,Id);
}
public void DelGuestBook(guestbooks gb)
{
guestbookdal dal=new guestbookdal();
dal.DelGuestBook(gb);
}
}
}
using System.Collections;
using guestbook.data;
using guestbook.Dal;
namespace guestbook.BLL
{
/// <summary>
/// guestbookbll 的摘要说明。
/// </summary>
public class guestbookbll
{
public void AddGuestBook(guestbooks gb)
{
if((gb.title.Trim()==string.Empty)||(gb.username.Trim()==string.Empty))
return;
guestbookdal dal=new guestbookdal();
dal.addGuestBook(gb);
}
public void UpdateGuestBook(guestbooks gb,int Id)
{
if((gb.title.Trim()==string.Empty)||(gb.username.Trim()==string.Empty))
return;
guestbookdal dal=new guestbookdal();
dal.updateGuestBook(gb,Id);
}
public void DelGuestBook(guestbooks gb)
{
guestbookdal dal=new guestbookdal();
dal.DelGuestBook(gb);
}
}
}
using System;
using System.Collections;
using guestbook.data;
using guestbook.Dal;
namespace guestbook.BLL
{
/// <summary>
/// usersbll 的摘要说明。
/// </summary>
public class usersbll
{
public users login(string username,string password)
{
//简单的业务验证
if((username.Trim()==string.Empty)||(password.Trim()==string.Empty))
return null;
usersdal dal=new usersdal();
users user=dal.login(username,password);
return user;
}
public void UserAdd(users user)
{
if((user.Name.Trim()==string.Empty)||(user.password.Trim()==string.Empty))
return;
usersdal dal=new usersdal();
dal.addUser(user);
}
}
}
using System.Collections;
using guestbook.data;
using guestbook.Dal;
namespace guestbook.BLL
{
/// <summary>
/// usersbll 的摘要说明。
/// </summary>
public class usersbll
{
public users login(string username,string password)
{
//简单的业务验证
if((username.Trim()==string.Empty)||(password.Trim()==string.Empty))
return null;
usersdal dal=new usersdal();
users user=dal.login(username,password);
return user;
}
public void UserAdd(users user)
{
if((user.Name.Trim()==string.Empty)||(user.password.Trim()==string.Empty))
return;
usersdal dal=new usersdal();
dal.addUser(user);
}
}
}
只是加了一些非常简单的验证,还有在web上不想完成的功能, 在这里也就不加上了,呵呵
编译一下,继续用Nunit 测试,绿色,爽!!!!!!!!!!!!!