/// <summary> /// 保存,保存后关闭 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btnOK_Click(object sender, EventArgs e) { try { Rss rss = new Rss(); rss.CreateDate = DateTime.Now.ToString(); rss.DateType = ddlDateType.SelectedItem.Text; rss.SendDay = ddlDate.SelectedIndex + 1; rss.SendTime += ddlTime.SelectedIndex.ToString().PadLeft(2, '0') + ":00:00"; rss.SendTo = txtCC.Text; rss.TemplateID = hideTempID.Value; rss.UserID = Request.QueryString["userid"]; rss.SendType = ddlSendType.SelectedItem.Text; if (!String.IsNullOrEmpty(rss.TemplateID)) { SubscribeDB.DeleteSubScribe(rss); } SubscribeDB.InsertSubScribe(rss); lblError.Text = "成功"; string userID = Request.QueryString["userid"]; if (!string.IsNullOrEmpty(userID)) { BindSubscribeList(userID); } } catch (Exception ex) { lblError.Text = ex.Message; lblError.Visible = true; } }
protected void gridSubscribe_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "Setting") { int rowindex = int.Parse(e.CommandArgument.ToString()); gridSubscribe.SelectedIndex = rowindex; string reportID = gridSubscribe.DataKeys[rowindex].Value.ToString(); InitSelectSubscribe(Request.QueryString["userid"], reportID); } else if (e.CommandName == "DelRss") { int rowindex = int.Parse(e.CommandArgument.ToString()); string reportID = gridSubscribe.DataKeys[rowindex].Value.ToString(); Rss rss = new Rss(); string userID = Request.QueryString["userid"]; rss.UserID = userID; rss.TemplateID = reportID; SubscribeDB.DeleteSubScribe(rss); BindSubscribeList(userID); divSetting.Visible = false; } }