protected void Button1_Click(object sender, EventArgs e) { YYCMS.BLL.WorkLog WorkLogBll = new YYCMS.BLL.WorkLog(); YYCMS.Model.WorkLog WorkLogModel = new YYCMS.Model.WorkLog(); WorkLogModel.checkstate = 0; WorkLogModel.contents = FCKContent.Value; WorkLogModel.ctime = DateTime.Now; WorkLogModel.Title = tbTitle.Text; WorkLogModel.userid = Convert.ToInt32(BasePage.GetUserId()); int i = WorkLogBll.Add(WorkLogModel); if (i > 0) { YYCMS.Components.MessageBox.Show(this.Page, "保存成功!"); } else { YYCMS.Components.MessageBox.Show(this.Page, "保存失败!"); } }
/// <summary> /// 初始化 /// </summary> protected void PageInit() { YYCMS.BLL.WorkLog WorkLogBll = new YYCMS.BLL.WorkLog(); int recordcount = 0; int _pageindex = YYCMS.Components.Request.GetQueryInt("p", 1); string strWhere = " 1=1 "; int userid = BasePage.GetUserId(); int groupid = BasePage.GetUserGroupId(); if (groupid != 1) { strWhere += string.Format(" and userid={0} ", userid); } int typeid = YYCMS.Components.Request.GetQueryInt("type", 1); DataSet ds = WorkLogBll.Pager(_pageindex, 20, strWhere, out recordcount); Repeater1.DataSource = ds; Repeater1.DataBind(); Pager1.PageSize = 20; Pager1.PageIndex = _pageindex; Pager1.RecordCount = recordcount; }