protected void btnRefresh_Click(object sender, EventArgs e) { string[] values = Request.Form.GetValues("cbxSelect"); string msg = ""; if (values == null || values.Length < 1) { Tz888.Common.MessageBox.Show(this.Page, "请选择要刷新的资源!"); return; } Tz888.BLL.Info.MainInfoBLL bll = new Tz888.BLL.Info.MainInfoBLL(); foreach (string str in values) { long InfoID = Convert.ToInt64(str); if (!bll.UpdateRefresh(InfoID)) { msg += "[" + InfoID.ToString() + "]刷新失败!\n"; } } if (!string.IsNullOrEmpty(msg)) { Tz888.Common.MessageBox.Show(this.Page, msg); } else { Tz888.Common.MessageBox.Show(this.Page, "刷新成功!"); } }
protected void btnSubmit_Click(object sender, EventArgs e) { if (chkRefreshMsg.Checked == true) { Tz888.BLL.Login.MemberBLL bll = new Tz888.BLL.Login.MemberBLL(); string LoginName = Page.User.Identity.Name; //string LoginName = "heyi"; int IsRefresh = 0; bool HasLoad = bll.RefreshMemberInfo(LoginName, IsRefresh); if (!HasLoad) { Tz888.Common.MessageBox.Show(this.Page, "没有找到您需要的数据!"); return; } else { Tz888.Common.MessageBox.Show(this.Page, "已经设置为:以后不再提醒!"); btnClose.Visible = true; return; } } else { int intSelect = 0; int intSuccess = 0; CheckBox chkSelect; Label lblInfo; Tz888.BLL.Info.MainInfoBLL bll = new Tz888.BLL.Info.MainInfoBLL(); for (int i = 0; i < dlrefresh.Items.Count; i++) { chkSelect = (CheckBox)dlrefresh.Items[i].FindControl("chkSelect"); lblInfo = (Label)dlrefresh.Items[i].FindControl("lblInfo"); if (chkSelect.Checked) { intSelect++; //将选中的信息的时间更新为此刻时间 long InfoID = Convert.ToInt64(lblInfo.Text.Trim()); if (bll.UpdateRefresh(InfoID)) { intSuccess++; } } } if (intSelect.ToString().Trim() == "0") { Tz888.Common.MessageBox.Show(this.Page, "您没有选择信息!"); return; } else { //报告操作成功 Tz888.Common.MessageBox.Show(this.Page, "选择信息" + intSelect.ToString() + "条,实际更新 " + intSuccess.ToString() + "条"); } } }