日期:2014-05-17 浏览次数:20561 次
//DAL层 public EasyFastCMS.Model.UserGroup GetModel(int ID) { Model.UserGroup model = new Model.UserGroup(); using (var edm = new EasyFastCMSEntities()) { var query = edm.EasyFastCMS_UserGroup.Where(ug => ug.ID == ID); foreach (EasyFastCMS_UserGroup ug in query) { model.ID = ug.ID; model.GroupName = ug.GroupName; } } return model; } //BLL层 private readonly SQLServerDAL.UserGroup dal = new SQLServerDAL.UserGroup(); public Model.UserGroup GetModel(int id) { return dal.GetModel(id); } //Web层 protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { LoadInfo(); } } private void LoadInfo() { BLL.UserGroup bll = new BLL.UserGroup(); Model.UserGroup model = bll.GetModel(Convert.ToInt32(Request.QueryString["id"])); this.Admin_Users_UserGroup_UserGroupUpDate_ltlID.Text = model.ID.ToString(); this.Admin_Users_UserGroup_UserGroupUpDate_txtGroupName.Text=model.GroupName; this.Admin_Users_UserGroup_UserGroupUpDate_txtGroupIntro.Text=model.GroupIntro; this.Admin_Users_UserGroup_UserGroupUpDate_txtOrderID.Text = model.OrderID.ToString(); ViewState["model"] = model; }