日期:2014-05-17 浏览次数:20535 次
//1.我们先写实体类
//新闻实体类
public class News
{
public int Id{get;set;}
public string Title{get;set;}
}
//2.数据操作类
//新闻数据操作类
public class NewsDAL
{
public void Add()
{
//写sql语句
//写参数,执行sql
}
}
//3.业务逻辑类
//新闻数据操作类
public class NewsBLL
{
public void AddNews()
{
}
}
//4.然后在UI层绑定一个实体,调用NewsBLL.AddNews()方法
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using CR;
namespace CR.Entity
{
/// <summary>
/// 新闻信息
/// </summary>
[Tab("t_news","newsid",true)]
public class News
{
/// <summary>
/// Id
/// </summary>
[Bind("newsid")]
public int Id { get; set; }
/// <summary>
/// 标题
/// </summary>