protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e) { TaskInfo t = new TaskInfo(); if (e.CommandName == "del") { t.TaskID = Convert.ToInt32(e.CommandArgument); bool flag = new GetMsgBLL().DelGridBLL(t); if (flag) { Response.Write("<script>alert('删除成功')</script>"); LoadGrid(); } else { Response.Write("<script>alert('删除失败')</script>"); } } if (e.CommandName == "fns") { t.TaskID = Convert.ToInt32(e.CommandArgument); bool flag = new GetMsgBLL().finnish(t); if (flag) { Response.Write("<script>alert('修改成功')</script>"); LoadGrid(); } else { Response.Write("<script>alert('修改失败')</script>"); } } }
private void LoadGrid() { DataTable dt = new GetMsgBLL().GridMsgBLL(); this.GridView1.DataSource = dt; this.GridView1.DataBind(); }
private void LoadDpd() { DataTable dt = new GetMsgBLL().DpdMsgBLL(); this.DropDownList1.DataTextField = "ProjectName"; this.DropDownList1.DataValueField = "ProjectID"; this.DropDownList1.DataSource = dt; this.DropDownList1.DataBind(); }
private void DpdMsg() { DataTable dt = new GetMsgBLL().DpdMsgBLL(); this.dplXiangmu.DataTextField = "ProjectName"; this.dplXiangmu.DataValueField = "ProjectID"; this.dplXiangmu.DataSource = dt; this.dplXiangmu.DataBind(); }
protected void Button1_Click(object sender, EventArgs e) { TaskInfo t = new TaskInfo(); t.ProjectID = Convert.ToInt32(this.dplXiangmu.SelectedValue.ToString()); t.Content = this.txtRenwu.Text; t.TaskState = this.RadioButton1.Checked ? 1 : this.RadioButton2.Checked ? 2 : 0; DataTable dt = new GetMsgBLL().CheckGrid(t); this.GridView1.DataSource = dt; this.GridView1.DataBind(); }
protected void Button1_Click(object sender, EventArgs e) { TaskInfo t = new TaskInfo(); t.TaskID = Convert.ToInt32(this.DropDownList1.SelectedValue.ToString()) + 1; t.TaskPriority = this.RadioButton1.Checked ? 1 : this.RadioButton2.Checked ? 2 : 3; t.Content = this.TextBox1.Text; bool flag = new GetMsgBLL().AddMsg(t); if (flag) { Response.Write("<script>alert('添加成功')</script>"); } else { Response.Write("<script>alert('添加失败')</script>"); } }