Beispiel #1
0
        protected void btnSave_ServerClick(object sender, EventArgs e)
        {
            string strTitle = txt_Title.Value.Trim();
            string strContent = txt_Content.Value.Trim();
            SystemNotice addItem = SystemNotice.Get(nId);
            if (null == addItem)
            {
                addItem = new SystemNotice();
            }
            addItem.Title = strTitle;
            addItem.Content = strContent;
            DateTime dtBeginTime = new DateTime();
            DateTime.TryParse(txt_BeginTime.Value.Trim(), out dtBeginTime);
            addItem.BeginTime = dtBeginTime;
            DateTime.TryParse(txt_EndTime.Value.Trim(), out dtBeginTime);
            addItem.EndTime = dtBeginTime;

            addItem.RangeType = 0;
            addItem.TargetObject = 0;

            int nNewId = SystemNotice.Save(addItem);
            PageUtil.PageAlert(this.Page, nNewId > 0 ? "保存成功!" : "保存失败!");
            PageUtil.PageClosePopupWindow(this.Page, true);
        }
Beispiel #2
0
 public static int Save(SystemNotice _Entity)
 {
     if (null != _Entity)
     {
         return EntityAccess<SystemNotice>.Access.Save(_Entity);
     }
     return -1;
 }