/// <summary> /// 添加公告信息 /// </summary> /// <param name="Id"></param> /// <param name="NDate"></param> /// <param name="NTheme"></param> /// <param name="Content"></param> /// <param name="NAddress"></param> /// <returns></returns> public JsonResult AddNoticeData(string Id, string NDate, string NTheme, string Content, int NAddress) { ResultModel result = new ResultModel(); try { tb_notice newData = new tb_notice(); newData.Id = String.IsNullOrEmpty(Id)?Guid.NewGuid().ToString("N"):Id; newData.NDate = Convert.ToDateTime(NDate); newData.NTheme = NTheme; newData.Content = Content; newData.NAddress = NAddress; newData.NoticeNO = ""; newData.InsertTime = DateTime.Now; newData.UdateTime = DateTime.Now; newData.ContactAccount = loginUser.Id; newData.IsUsed = true; ef.tb_notice.Add(newData); ef.SaveChanges(); result.ResultCode = 1; result.ResultData = newData; } catch (DbEntityValidationException dex) { dex.ToString(); } catch (Exception ex) { throw; } return(Json(result)); }
public JsonResult EditNoticeData(string Id, string NDate, string NTheme, string Content, int NAddress) { ResultModel result = new ResultModel(); try { tb_notice newData = _NoticeBusiness.GetNoticeByID(Id).FirstOrDefault(); newData.NDate = Convert.ToDateTime(NDate); newData.NTheme = NTheme; newData.Content = Content; newData.NAddress = NAddress; newData.UdateTime = DateTime.Now; ef.SaveChanges(); result.ResultCode = 1; result.ResultData = newData; } catch (DbEntityValidationException dex) { dex.ToString(); } catch (Exception ex) { throw; } return(Json(result)); }
private void GetPopupNotice()//wolf2 { if (pubvar.HomeStart) { tb_notice pnotce = aideNewTroyFacade.GetNoticeByHome(1); if (pnotce != null) { PNOTICE = pnotce.Content; } pnotce = aideNewTroyFacade.GetNoticeByHome(2); if (pnotce != null) { PNOTICE2 = pnotce.Content; } //var notce = aideNewTroyFacade.GetNoticeByIdx(135); //if (notce != null) // EVENT = notce.Content; Event1 = aideNewTroyFacade.GetNoticeByIdx(135); Event2 = aideNewTroyFacade.GetNoticeByIdx(136); pubvar.HomeStart = false; } }
/// <summary> /// 添加投资人公告 /// </summary> /// <param name="notice"></param> public void InsertNoticeInfo(tb_notice notice) { try { //tb_notice notice = new tb_notice(); string noticeId = Guid.NewGuid().ToString(); notice.Id = noticeId; notice.NoticeNO = CreateNotieceNo(); notice.NDate = DateTime.Now; ef.tb_notice.Add(notice); } catch (Exception ex) { throw; } }
private void BindNewsData() { string strParm = Request.QueryString["param"].ToString(); if (strParm == "") { Redirect("EventList.aspx"); } //获取活动信息 tb_notice notice = aideNewTroyFacade.GetNoticeByTitle(strParm); if (notice == null) { Response.Write("<script language='javascript'>alert('공지사항은 존재하지 않습니다');window.location.href='EventList.aspx';</script>"); } CtrlHelper.SetText(ltTitle, notice.Title); CtrlHelper.SetText(ltTime, notice.Create_Date.ToString("yyyy-MM-dd")); CtrlHelper.SetText(ltContent, notice.Content); }
/// <summary> /// 删除公告信息 /// </summary> /// <param name="noID"></param> public bool DeleteNoticeInfo(string NoID, string remark, string account) { bool result = false; try { tb_notice _Notice = ef.tb_notice.Where(n => n.Id == NoID).FirstOrDefault(); if (_Notice != null) { _Notice.Id = NoID; _Notice.IsUsed = false; _Notice.DelRemark = remark; _Notice.DeleteTime = DateTime.Now; _Notice.DelAccount = account; result = true; } } catch (Exception) { } return(result); }
/// <summary> /// 绑定活动 /// </summary> private void BindNewsData() { tb_notice notice = aideNewTroyFacade.GetNoticeByIdx(76); ScrollContents = notice.Content; }