摘要: 表现层:由需求网页构成,调用业务逻辑层的方法。该层一般不出现SQL语句相关的内容,就算出现,也不能出现能执行的SQL语句。using System;using System.Collections.Generic;using System.Linq;using System.Web;using System.Web.UI;using System.Web.UI.WebControls;using HotelManager.Models;using HotelManager.BLL;namespace HotelManager{ public partial class RoomTypeA... 阅读全文
posted @ 2013-06-13 17:56 Big.Eagle 阅读(175) 评论(0) 推荐(0) 编辑
摘要: 1、以单个项目的结构搭建好三层结构2、建好模型层《使用代码生成器生成模型层》3、准备数据层,做增删改查 3.1、数据层一般有DBhelper 3.2、添加查询Students类《不担心名字冲突,因为我直接用命名空间来操作的 》,使用到Model,故导入using Model;4、做登录功能5、做显示学生列表功能6、做删除功能7、做修改功能注:《我们每做一个操作都是从数据层开始做》------------------------------------------------------------------------写三层的顺序:从下往上写,即:Model-》DAL-->BL... 阅读全文
posted @ 2013-06-13 16:09 Big.Eagle 阅读(157) 评论(0) 推荐(0) 编辑
摘要: 模型层(ORM):数据库中每一个表都在模型层创建一个类,一般情况类的名称和数据表名相同,如果数据库中表名为复数型式,一般模型层类名为单数。表中的字段在类中建成属性。using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace HotelManager.Models{ public class RoomType { int typeId; public int TypeId { get { retur... 阅读全文
posted @ 2013-06-13 16:07 Big.Eagle 阅读(462) 评论(0) 推荐(0) 编辑
摘要: 业务逻辑层:业务逻辑层中的类名由业务决定,一般情况下也可以与数据访问层的类相对应,类名一般由表名+Manager命名。<业务逻辑层中的类以业务为主,不一定和表一一对应>using System;using System.Collections.Generic;using System.Linq;using System.Text;using HotelManager.Models;using HotelManager.DAL;namespace HotelManager.BLL{ public class RoomTypeManager { RoomTypeServi... 阅读全文
posted @ 2013-06-13 16:05 Big.Eagle 阅读(323) 评论(0) 推荐(0) 编辑
摘要: using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Data.SqlClient;using System.Data;namespace HotelManager.DAL{ public class DBHelpSQL { static string connctionString = System.Configuration.ConfigurationManager.ConnectionStrings["ConnString"].... 阅读全文
posted @ 2013-06-13 15:20 Big.Eagle 阅读(195) 评论(0) 推荐(0) 编辑