protected void btnReinstate_Click(object sender, EventArgs e) { CRM_FundraisingGiftProfile.IsArchived = false; db.SubmitChanges(); NoticeManager.SetMessage("Item reinstated"); }
protected void Button1_Click(object sender, EventArgs e) { if (this.TextBox1.Text != "" && this.TextBox2.Text != "") { string title = this.TextBox1.Text; //string name=Session int type = Convert.ToInt32(this.DropDownList1.SelectedValue); string time = DateTime.Now.ToString(); string Info = this.TextBox2.Text; string username = Session["username"].ToString(); int rows = NoticeManager.NoticeInsert(type, title, username, time, Info); if (rows > 0) { Response.Write("<script>alert('添加成功!');</script>"); this.TextBox1.Text = ""; this.TextBox2.Text = ""; this.DropDownList1.SelectedIndex = 1; } else { Response.Write("<script>alert('添加失败!');</script>"); } } else { Response.Write("<script>alert('标题、内容不能为空!');</script>"); } }
public async Task <ActionResult> Results(string q) { Tuple <List <NoticeBoardViewModel>, List <NoticeViewModel> > results = new Tuple <List <NoticeBoardViewModel>, List <NoticeViewModel> >( new List <NoticeBoardViewModel>(), new List <NoticeViewModel>() ); using (NoticeBoardManager m = new NoticeBoardManager()) { var boards = await m.SearchAsync(q); foreach (var i in boards) { results.Item1.Add(NoticeBoardMappings.To <NoticeBoardViewModel>(i)); } } using (NoticeManager m = new NoticeManager()) { var notices = await m.SearchAsync(q); foreach (var i in notices) { results.Item2.Add(NoticeMappings.To <NoticeViewModel>(i)); } } return(View(results)); }
protected void lnkAutoSearch(object sender, EventArgs e) { IContact Item = new ContactManager().Contacts.SingleOrDefault(c => c.Reference == acContact.SelectedID); if (Item != null) { if (!Entity.CRM_CalendarInvites.Any((a => a.Reference == Item.Reference))) { CRM_CalendarInvite CRM_CalendarInvite = new CRM_CalendarInvite() { CRM_CalendarID = Entity.ID, IsAttended = false, IsBooked = false, IsCancelled = false, IsInvited = false, LastAmendedAdminID = AdminUser.ID, Reference = Item.Reference, ContactName = Item.DisplayName, LastUpdated = UKTime.Now }; db.CRM_CalendarInvites.InsertOnSubmit(CRM_CalendarInvite); db.SubmitChanges(); } } NoticeManager.SetMessage(Item.DisplayName + " tagged to " + Entity.DisplayName); }
protected void lnkNew_Click(object sender, EventArgs e) { if (String.IsNullOrEmpty(txtCurrent_New.Text) || String.IsNullOrEmpty(txtRedirect_New.Text)) { if (String.IsNullOrEmpty(txtCurrent_New.Text)) { txtCurrent_New.addStyle("border:1px solid red;"); } if (String.IsNullOrEmpty(txtRedirect_New.Text)) { txtRedirect_New.addStyle("border:1px solid red;"); } } else { CRM.Code.Models.Redirect redirect = new CRM.Code.Models.Redirect(); db.Redirects.InsertOnSubmit(redirect); redirect.CurrentUrl = (txtCurrent_New.Text.StartsWith("/") || txtCurrent_New.Text.StartsWith("http")) ? txtCurrent_New.Text : "/" + txtCurrent_New.Text; redirect.RedirectUrl = (txtRedirect_New.Text.StartsWith("/") || txtRedirect_New.Text.StartsWith("http")) ? txtRedirect_New.Text : "/" + txtRedirect_New.Text; db.SubmitChanges(); NoticeManager.SetMessage("404 Redirect Added"); } }
protected void Page_Load(object sender, EventArgs e) { if (!String.IsNullOrEmpty(Request.QueryString["attend"]) && Request.QueryString["attend"] == "true") { CanAttend = true; } ucNavCal.Entity = Entity; btnSendRSVP.EventHandler = btnSendRSVP_Click; myInvite = Entity.CRM_CalendarAdmins.FirstOrDefault(f => f.AdminID == AdminUser.ID); if (!Page.IsPostBack) { ddlStatus.DataSource = Enumeration.GetAll <CRM_CalendarAdmin.StatusTypes>(); ddlStatus.DataBind(); if (CanAttend) { ddlStatus.SelectedValue = ((byte)CRM_CalendarAdmin.StatusTypes.Attending).ToString(); } else { ddlStatus.SelectedValue = ((byte)CRM_CalendarAdmin.StatusTypes.NotAttending).ToString(); } } if (myInvite == null) { NoticeManager.SetMessage("You are no longer tagged on this event to RSVP, or are not logged in as the person who received this email", "/admin"); } else { Admin = db.Admins.Single(c => c.ID == myInvite.CRM_Calendar.CreatedByAdminID); } }
protected void btnRealDelete_Click(object sender, EventArgs e) { db.CRM_AnnualPassTypes.DeleteOnSubmit(Entity); db.SubmitChanges(); NoticeManager.SetMessage("Item removed", "list.aspx"); }
protected void lbtnSave_Click(object sender, EventArgs e) { if (Page.IsValid) { notice = new Notice(); notice.NoticeId = Convert.ToInt32(txtNoticeID.Text.Trim()); notice.NoticeTitle = txtNoticeTitle.Text.Trim(); notice.NoticeContent = txtNoContent.Text.Trim(); try { if (ViewState["object"] == null) { if (NoticeManager.updateId(notice) == 1) { Page.ClientScript.RegisterStartupScript(this.GetType(), "message", "<script>alert('保存成功!');</script>"); } else { Page.ClientScript.RegisterStartupScript(this.GetType(), "message", "<script>alert('保存失败!');</script>"); } } } catch (Exception ex) { Response.Write("错误原因:" + ex.Message); } } }
void Awake() { skillManager_cs = GetComponent <SkillManager>(); noticemanager_cs = GetComponent <NoticeManager>(); createMonster_cs = GetComponent <CreateMonster>(); Singleton.GetInstance().InGameState = IngameState_enum.none; }
public void ModifyNotice(NoticeInfo noticeInfo) { try { using (ILHDBTran tran = BeginTran()) { NoticeManager manager = new NoticeManager(tran); NoticeEntity entity = manager.GetNotice(noticeInfo.Id); if (entity == null) { throw new ArgumentNullException("通知数据不存在!!"); } entity.Name = noticeInfo.Name; entity.Title = noticeInfo.Title; entity.IsHasDetail = noticeInfo.IsHasDetail; entity.Message = noticeInfo.Message; entity.IsForeRed = noticeInfo.IsForeRed; entity.IsForeBold = noticeInfo.IsForeBold; entity.StartTime = noticeInfo.StartTime; entity.EndTime = noticeInfo.EndTime; entity.IsEnd = noticeInfo.IsEnd; manager.ModifyNotice(entity); tran.Commit(); } } catch (Exception ex) { throw HandleException("Notice", "Modify", ex); } }
public async Task <ActionResult> Edit(NoticeViewModel vm) { using (NoticeManager nm = new NoticeManager()) { var postedBy = await nm.PostedBy(vm.Id); var current = await User.Identity.GetApplicationUserAsync(); var notice = await nm.GetAsync(vm.Id); if (notice.Status == NoticeStatus.Approved) { return(Json(JsonViewModel.Error)); } if ((postedBy.Id == current.Id && notice.IsPendingApproval) || await User.Identity.IsModeratorAsync()) { notice.NoticeId = vm.Id; notice.HighPriority = vm.isHighPriority; notice.NoticeBoardId = vm.NoticeBoardId; notice.Title = vm.Title; notice.Description = vm.Description; notice.Status = NoticeStatus.PendingApproval; var res = await nm.UpdateAsync(notice); //if (res > 0) ; // return Json(JsonViewModel.Success); } } // return Json(JsonViewModel.Error); return(RedirectToAction("Index", "MyPosts")); }
public CommunicationObject AddNotify(string xml) { try { CommunicationObject notifyInfo = XmlAnalyzer.AnalyseXmlToCommunicationObject <CommunicationObject>(xml); NoticeEntity noticeEntity = new NoticeEntity(); noticeEntity.NoticeId = notifyInfo.Id; noticeEntity.NoticeVersion = notifyInfo.Version; noticeEntity.MessengerId = notifyInfo.MessengerId; noticeEntity.Timestamp = notifyInfo.Timestamp; noticeEntity.TranType = (int)notifyInfo.TransactionType; noticeEntity.Digest = notifyInfo.Digest; noticeEntity.ResponseText = xml; noticeEntity.NotifyTime = DateTime.Now; noticeEntity.XmlHeader = notifyInfo.XmlHeader; NoticeManager noticeManager = new NoticeManager(DbAccess); noticeManager.AddNotice(noticeEntity); return(notifyInfo); } catch (Exception ex) { string errMsg = "添加通知XML到数据库失败!" + xml; throw HandleException(LogCategory.Notice, errMsg, ex); } }
protected void lnkRunQuery_Click(object sender, EventArgs e) { foreach (RepeaterItem item in rptQuery.Items) { DataQuery dq = (DataQuery)item.FindControl("ucDataQuery"); dq.lnkSave_Click(sender, e); } var query = HttpUtility.ParseQueryString(Request.Url.Query); if (query["query"] != null) { query.Remove("query"); query.Remove("data"); query.Remove("mailout"); query.Remove("emailing"); query.Remove("groupbyrel"); query.Remove("groupbyaddress"); } string redirect = Request.Url.AbsolutePath + (query.Count == 0 ? "?" : "?" + query + "&") + "query=" + ddlExistingQueries.SelectedValue; redirect += "&data=" + rbNone.Checked + "&mailout=" + rbMailOut.Checked + "&emailing=" + rbEmail.Checked + "&groupbyrel=" + chkGroupByRelationship.Checked + "&groupbyaddress=" + chkGroupByAddress.Checked; NoticeManager.SetMessage("Query Complete", redirect); }
protected void btnRealDelete_Click(object sender, EventArgs e) { FormField.IsArchived = true; db.SubmitChanges(); NoticeManager.SetMessage("Form Field Deleted", "list.aspx"); }
void Start() { theNotice = FindObjectOfType <NoticeManager>(); theOddEven = FindObjectOfType <OddEvenGame>(); theStat = FindObjectOfType <PlayerStatManager>(); InitMoneyChange(); }
protected void BindNotice() { DataTable dt = NoticeManager.selectAll(); ListView1.DataSource = dt; ListView1.DataBind(); }
/*Home/GetTopNotice * 1、获取置顶公告信息 * 2、不存在返回失败 * 3、存在返回信息(json)*/ public ActionResult GetTopNotice() { //json += "\"name\":\"name\","; Notices notice = new Notices(); notice = new NoticeManager().GetTopNotice(); if (notice == null) { return(Content("false")); } else { string json = "{"; json += "\"id\":\"" + notice.id + "\","; json += "\"title\":\"" + notice.NoticeTitle + "\","; //json += "\"main\":\"" + notice.NoticeMain + "\","; json += "\"date\":\"" + Convert.ToDateTime(notice.NoticeDate).ToString("yyyy-MM-dd") + "\","; json += "\"publisher\":\"" + notice.NoticePublisher.Name + "\","; json += "\"belong\":\"" + notice.NoticeBelong.DName + "\","; json += "\"hits\":\"" + notice.NoticeHits + "\""; json += "}"; return(Content(json)); } }
// GET: MyPosts public async Task <ActionResult> Index() { using (NoticeManager nm = new NoticeManager()) { var user = await User.Identity.GetApplicationUserAsync(); var approved = await nm.GetUserNoticesAsync(user.Id, 0, 6, Entities.Data.NoticeStatus.Approved); var pending = await nm.GetUserNoticesAsync(user.Id, 0, 6, Entities.Data.NoticeStatus.PendingApproval); var disapproved = await nm.GetUserNoticesAsync(user.Id, 0, 6, Entities.Data.NoticeStatus.Disapproved); MyPostViewModel pvm = new MyPostViewModel(); foreach (var n in approved) { pvm.ApprovedPosts.Add(NoticeMappings.To <DetailedNoticeViewModel>(n)); } foreach (var n in pending) { pvm.PendingPosts.Add(NoticeMappings.To <PendingNoticeViewModel>(n)); } foreach (var n in disapproved) { pvm.AmendedPosts.Add(NoticeMappings.To <AmendedNoticeViewModel>(n)); } return(View(pvm)); } }
private void FrmUpLoad_Load(object sender, EventArgs e) { CmpSetDgv(); cboSelectClub.SelectedIndex = 0; dgvNoticeList.AutoGenerateColumns = false; dgvNoticeList.DataSource = NoticeManager.SelectNoticeAll(); }
async private void WindowX_ContentRendered(object sender, EventArgs e) { notifyicon.Visible = true; notifyicon.BalloonTipText = "Music Downloader UI"; notifyicon.Icon = System.Drawing.Icon.ExtractAssociatedIcon(System.Windows.Forms.Application.ExecutablePath); notifyicon.MouseClick += Notifyicon_MouseClick; System.Windows.Forms.MenuItem menu1 = new System.Windows.Forms.MenuItem("关闭"); menu1.Click += Menu1_Click; notifyicon.ContextMenu = new System.Windows.Forms.ContextMenu(new System.Windows.Forms.MenuItem[] { menu1 }); string result = ""; NoticeManager.Initialize(); await Task.Run(() => { result = music.Update(); }); if (result == "Error") { NotifyError(); } if (result == "Needupdate") { NotifyUpdate(); } }
protected void btnRealDelete_Click(object sender, EventArgs e) { Entity.IsArchived = true; db.SubmitChanges(); NoticeManager.SetMessage("Item removed", "list.aspx"); }
protected void btnReinstate_Click(object sender, EventArgs e) { PersonOrganisation.IsArchived = false; db.SubmitChanges(); NoticeManager.SetMessage("Item reinstated"); }
protected void Button1_Click(object sender, EventArgs e) { Session["username"] = TextBox1.Text; Session["password"] = TextBox2.Text; Session.Timeout = 1; s.UserName = Session["username"].ToString(); s.Password = Session["password"].ToString(); int row = t_UserManages.getlogin(s); if (row > 0) { Session["typeid"] = t_UserManages.getLoginTypeid(s); int a = Convert.ToInt32(Session["typeid"]); //日志 string time = DateTime.Now.ToString(); string del = "用户" + Session["username"].ToString() + ":登录进入系统"; NoticeManager.LogInsert(time, del); Response.Redirect("MagWeb/index.aspx"); } else { Label1.Text = "账号或者密码不正确"; Label1.Visible = true; } }
public string save222(string cn, string tw, string en, string th, string vn, string disu, string disa, string winu, string wina) { if (Session[Util.ProjectConfig.ADMINUSER] == null) { return(""); } admin.PageBase page = new admin.PageBase(); DateTime time = DateTime.Now; Notice no = new Notice(); no.Createdate = time; no.Createuser = page.CurrentManager.ManagerId; no.Displayagent = disa; no.Displayuser = disu; no.Msgcn = cn; no.Msgen = en; no.Msgth = th; no.Msgtw = tw; no.Msgvn = vn; no.Windowagent = wina; no.Windowuser = winu; string reval = NoticeManager.AddNotice(no).ToString(); if (reval == "True") { AddUpdatematches(); } return(reval); }
protected void lnkSelectNew_Click(object sender, EventArgs e) { CRM_Person person = db.CRM_Persons.Single(c => c.ID.ToString() == ucACNewPerson.SelectedID); AddPersonToPass(person.Reference); NoticeManager.SetMessage(person.Fullname + " added to pass " + Entity.MembershipNumber); }
public void AddUpdatematches() { if (Session[Util.ProjectConfig.ADMINUSER] == null) { return; } string str = "13"; IList <Model.Notice> notices = NoticeManager.GetMutilILNotice(); foreach (Model.Notice info in notices) { str += "`" + info.Msgcn; str += "|" + info.Msgtw; str += "|" + info.Msgen; str += "|" + info.Msgth; str += "|" + info.Msgvn; str += "|" + info.Displayagent + info.Windowagent + info.Displayuser + info.Windowuser; } Model.Updatematches updatematches = new Updatematches(); updatematches.Type1 = 13; updatematches.Content = str; updatematches.Updatetime = DateTime.Now; UpdatematchesManager.AddUpdatematches(updatematches); }
/*Home/ShowAddList * 1、根据url获取分页的列表信息(存储过程) * 2、获取指定分类、页数的信息 * 3、返回信息(json)*/ public ActionResult ShowAllList(string type, int pagesize, int pageindex) { int pagecount = 0; int datacount = 0; int i = 0; string json = "{"; if (type == "notice") { List <Notices> listnotice = new List <Notices>(); listnotice = new NoticeManager().GetNoticeByPage(pagesize, pageindex, ref pagecount, datacount); json += "\"type\":\"notice\","; json += "\"listnotice\":["; foreach (var notice in listnotice) { i++; json += "{"; json += "\"id\":\"" + notice.id + "\","; json += "\"title\":\"" + notice.NoticeTitle + "\","; //json += "\"main\":\"" + notice.NoticeMain + "\","; json += "\"date\":\"" + Convert.ToDateTime(notice.NoticeDate).ToString("yyyy-MM-dd") + "\","; //json += "\"publisher\":\"" + notice.NoticePublisher.Name + "\","; json += "\"belong\":\"" + notice.NoticeBelong.DName + "\","; json += "\"hits\":\"" + notice.NoticeHits + "\""; json += "},"; } } else { List <News> listnews = new List <News>(); listnews = new NewsManager().GetNewsByPage(pagesize, pageindex, ref pagecount, datacount); json += "\"type\":\"news\","; json += "\"listnews\":["; foreach (var news in listnews) { i++; json += "{"; json += "\"id\":\"" + news.id + "\","; json += "\"title\":\"" + news.NewsTitle + "\","; //json += "\"main\":\"" + news.NewsMain + "\","; json += "\"date\":\"" + Convert.ToDateTime(news.NewsDate).ToString("yyyy-MM-dd") + "\","; json += "\"publisher\":\"" + news.NewsPublisher.Name + "\","; json += "\"hits\":\"" + news.NewsHits + "\""; json += "},"; } } json = json.Substring(0, json.Length - 1); json += "],\"number\":\"" + i + "\","; json += "\"datacount\":\"" + datacount + "\","; json += "\"pagesize\":\"" + pagesize + "\","; json += "\"pagecount\":\"" + pagecount + "\","; json += "\"pageindex\":\"" + pageindex + "\"}"; return(Content(json)); }
// Start is called before the first frame update void Start() { theDate = FindObjectOfType <DateManager>(); theNotice = FindObjectOfType <NoticeManager>(); theStock = FindObjectOfType <StockManager>(); newsList = new List <News>(); SetAlert(); }
protected void btnRealDelete_Click(object sender, EventArgs e) { db.Admins.DeleteOnSubmit(Entity); db.SubmitChanges(); NoticeManager.SetMessage("Admin Deleted", "list.aspx"); }
private void WindowX_Closed(object sender, EventArgs e) { Tool.Config.Write("H", ((int)this.Height).ToString()); Tool.Config.Write("W", ((int)this.Width).ToString()); notifyicon.Dispose(); NoticeManager.ExitNotifiaction(); Application.Current.Shutdown(); }
static NoticeManager() { m_instance = new NoticeManager(); }
public IList<string> GetRequestTextList(DateTime fromTime) { NoticeManager noticeManager = new NoticeManager(DbAccess); IList<NoticeEntity> list = noticeManager.GetNoticeListFrom(fromTime); IList<string> rtn = new List<string>(); foreach (NoticeEntity entity in list) { rtn.Add("transType=" + entity.TranType + "&transMessage=" + entity.ResponseText); } return rtn; }
public CommunicationObject AddNotify(string xml) { try { CommunicationObject notifyInfo = XmlAnalyzer.AnalyseXmlToCommunicationObject<CommunicationObject>(xml); NoticeEntity noticeEntity = new NoticeEntity(); noticeEntity.NoticeId = notifyInfo.Id; noticeEntity.NoticeVersion = notifyInfo.Version; noticeEntity.MessengerId = notifyInfo.MessengerId; noticeEntity.Timestamp = notifyInfo.Timestamp; noticeEntity.TranType = (int)notifyInfo.TransactionType; noticeEntity.Digest = notifyInfo.Digest; noticeEntity.ResponseText = xml; noticeEntity.NotifyTime = DateTime.Now; noticeEntity.XmlHeader = notifyInfo.XmlHeader; NoticeManager noticeManager = new NoticeManager(DbAccess); noticeManager.AddNotice(noticeEntity); return notifyInfo; } catch (Exception ex) { string errMsg = "添加通知XML到数据库失败!" + xml; throw HandleException(LogCategory.Notice, errMsg, ex); } }
public void AddNotifyResponse(CommunicationObject notifyInfo, string fullResponse, string responseXml) { try { NoticeResponseEntity entity = new NoticeResponseEntity(); entity.NoticeId = notifyInfo.Id; entity.NoticeVersion = notifyInfo.Version; entity.MessengerId = notifyInfo.MessengerId; entity.Timestamp = notifyInfo.Timestamp; entity.TranType = (int)notifyInfo.TransactionType; entity.FullResponseText = fullResponse; entity.ResponseXml = responseXml; NoticeManager noticeManager = new NoticeManager(DbAccess); noticeManager.AddNoticeResponse(entity); } catch (Exception ex) { string errMsg = "添加响应到数据库失败!" + responseXml; throw HandleException(LogCategory.Notice, errMsg, ex); } }