SGGL_JT/SUBQHSE/FineUIPro.Web/Workflow/WorkflowTodo.aspx.cs

106 lines
3.0 KiB
C#

using BLL;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace FineUIPro.Web.Workflow
{
public partial class WorkflowTodo : PageBase
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
this.ddlPageSize.SelectedValue = this.Grid1.PageSize.ToString();
// 绑定表格
this.BindGrid();
//异步延时调用BindGrid()方法
}
}
#region
/// <summary>
/// 绑定数据
/// </summary>
private void BindGrid()
{
var tb = BLL.WorkflowTodoitemsService.GetWorkflow_TodoItemsByReceiver(this.CurrUser.UserId, int.Parse(rbtodoState.SelectedValue) );
Grid1.RecordCount = tb.Count;
Grid1.DataSource = tb;
Grid1.DataBind();
}
#endregion
#region GV
/// <summary>
/// 分页
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>w
protected void Grid1_PageIndexChange(object sender, GridPageEventArgs e)
{
this.Grid1.PageIndex = e.NewPageIndex;
this.BindGrid();
}
/// <summary>
/// 排序
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Grid1_Sort(object sender, GridSortEventArgs e)
{
this.Grid1.SortDirection = e.SortDirection;
this.Grid1.SortField = e.SortField;
this.BindGrid();
}
/// <summary>
/// 分页显示条数下拉框
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void ddlPageSize_SelectedIndexChanged(object sender, EventArgs e)
{
this.Grid1.PageSize = Convert.ToInt32(this.ddlPageSize.SelectedValue);
this.BindGrid();
}
#endregion
#region
/// <summary>
/// 关闭弹出窗
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Window1_Close(object sender, WindowCloseEventArgs e)
{
BindGrid();
}
#endregion
protected void Grid1_RowCommand(object sender, GridCommandEventArgs e)
{
if (e.CommandName == "ToDo")
{
object[] keys = Grid1.DataKeys[e.RowIndex];
var item =WorkflowTodoitemsService.GetWorkflow_TodoItemsById(keys[0].ToString());
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format(item.PCUrl, ID, "编辑 - ")));
}
}
protected void RadioButtonList1_SelectedIndexChanged(object sender, EventArgs e)
{
BindGrid();
}
}
}