protected void Page_Load(object sender, EventArgs e) { (Master as MasterPage).ShowPositionBar(false); if (!IsPostBack) { ltlName.Text = LoginUser.UName; ltlCnt.Text = LoginUser.LoginCount.ToString(); ltlIP.Text = LoginUser.LastIp; ltlTime.Text = LoginUser.LastTime.HasValue ? LoginUser.LastTime.Value.ToString("yyyy-MM-dd HH:mm:ss") : DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); // 服务器信息 ltlVer.Text = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString(); ltlMem.Text = PhisicalMemory(); ltlPST.Text = ProcessStartTime(); ltlANM.Text = AspNetMemory(); ltlANCT.Text = AspNetCPUTime(); Literal1.Text = NewsService.GetInstance().Count(1).ToString(); Literal2.Text = NewsService.GetInstance().Count(2).ToString(); Literal3.Text = NewsService.GetInstance().Count(3).ToString(); Literal4.Text = NewsService.GetInstance().Count(4).ToString(); Literal5.Text = FeedbackService.GetInstance().Count(null).ToString(); Literal6.Text = JobService.GetInstance().Count(null).ToString(); Literal7.Text = LinkService.GetInstance().Count(null).ToString(); } LastedFeedbacks = GetLastedFeedbackList(); LastedProducts = GetLastedProductList(); LastedNewses = GetLastedNewsList(); }
private void DoLinkActions(string action) { LinkService ls = LinkService.GetInstance(); if (action.Equals("LinkOrder")) { string id = Request["Id"]; string order = Request["Order"]; int r = ls.ChangeOrder(id, int.Parse(order)); if (r > 0) { json = "{\"result\":1}"; } else { json = "{\"result\":0, \"msg\":\"服务器发生错误,排序失败!\"}"; } } else if (action.Equals("LinkDelete")) { string id = Request["Id"]; int r = ls.Delete(id); if (r > 0) { json = "{\"result\":1}"; } else { json = "{\"result\":0, \"msg\":\"服务器发生错误,删除失败!\"}"; } } }