protected void GridDpt_PreRowDataBound(object sender, GridPreRowEventArgs e) { // 如果绑定到 DataTable,那么这里的 DataItem 就是 DataRowView DataRowView row = e.DataItem as DataRowView; string TaskLevel = row["TaskLevel"].ToString(); FineUIPro.BoundField bfEntranceYear = GridDpt.FindColumn("TaskLevel") as FineUIPro.BoundField; // 首先清空 data-color 属性 bfEntranceYear.Attributes.Remove("data-color"); // 然后添加 data-color 属性 if (TaskLevel == "普通") { bfEntranceYear.Attributes["data-color"] = "color1"; } else if (TaskLevel == "紧急") { bfEntranceYear.Attributes["data-color"] = "color2"; } else { bfEntranceYear.Attributes["data-color"] = "color3"; } }
protected void LoadData() { string dptList = GetChildrenBySelft(); Maticsoft.BLL.tTask BLL = new Maticsoft.BLL.tTask(); string sortField = GridDpt.SortField; string sortDirection = GridDpt.SortDirection; string where = ""; where += " SaveDpt in (" + dptList + ")"; if (drpSearch.SelectedValue != "") { where += " and IsCheck='" + drpSearch.SelectedValue + "' "; } if (txtValue.Text.Trim() != "") { where += " and Title like '%" + txtValue.Text.Trim() + "%' "; } GridDpt.RecordCount = BLL.GetRecordCount(where); DataView view = BLL.GetListByPage(where, " SaveTime desc ", GridDpt.PageIndex * GridDpt.PageSize, (GridDpt.PageIndex + 1) * GridDpt.PageSize).Tables[0].DefaultView; view.Sort = String.Format("{0} {1}", sortField, sortDirection); GridDpt.DataSource = view.ToTable(); GridDpt.DataBind(); }
protected void LoadData() { Maticsoft.BLL.tTopic BLLGET = new Maticsoft.BLL.tTopic(); string sortField = GridDpt.SortField; string sortDirection = GridDpt.SortDirection; StringBuilder sb = new StringBuilder(); string dptlist = GetTreeNode(TreeDpt.SelectedNode, sb, true).ToString(); string where = ""; where += " policyDptId in (" + dptlist.Substring(0, dptlist.Length - 1) + ")"; if (drpSearch.SelectedValue != "") { where += " and isCheck='" + drpSearch.SelectedValue + "' "; } if (txtValue.Text.Trim() != "") { where += " and topicTitle like '%" + txtValue.Text.Trim() + "%' "; } where += " and policyType=" + tId + " "; GridDpt.RecordCount = BLLGET.GetRecordCount(where); DataView view = BLLGET.GetListByPage(where, " Id desc ", GridDpt.PageIndex * GridDpt.PageSize, (GridDpt.PageIndex + 1) * GridDpt.PageSize).Tables[0].DefaultView; view.Sort = String.Format("{0} {1}", sortField, sortDirection); GridDpt.DataSource = view.ToTable(); GridDpt.DataBind(); }
protected void GridDpt_PreRowDataBound(object sender, GridPreRowEventArgs e) { // 如果绑定到 DataTable,那么这里的 DataItem 就是 DataRowView DataRowView row = e.DataItem as DataRowView; LinkButtonField checkField = GridDpt.FindColumn("checkField") as LinkButtonField; LinkButtonField editField = GridDpt.FindColumn("editField") as LinkButtonField; LinkButtonField deleteField = GridDpt.FindColumn("deleteField") as LinkButtonField; if (row["isCheck"].ToString() == "已审核") { deleteField.Enabled = false; checkField.Text = "取消"; checkField.Icon = Icon.Cancel; editField.Text = "查看"; editField.Icon = Icon.Lock; } else { deleteField.Enabled = true; checkField.Text = "通过"; checkField.Icon = Icon.Accept; editField.Text = "编辑"; editField.Icon = Icon.Pencil; } if (!haveRight(GetIdentityUser().userId, "三重一大审批")) { checkField.Enabled = false; } else { checkField.Enabled = true; } }
protected void GridDpt_PreRowDataBound(object sender, GridPreRowEventArgs e) { DataRowView row = e.DataItem as DataRowView; LinkButtonField checkField = GridDpt.FindColumn("checkField") as LinkButtonField; LinkButtonField editField = GridDpt.FindColumn("editField") as LinkButtonField; LinkButtonField deleteField = GridDpt.FindColumn("deleteField") as LinkButtonField; if (row["IsCheck"].ToString() == "已审核") { deleteField.Enabled = false; checkField.Text = "取消"; checkField.Icon = Icon.Cancel; editField.Text = "查看"; editField.Icon = Icon.Lock; } else { deleteField.Enabled = true; checkField.Text = "通过"; checkField.Icon = Icon.Accept; editField.Text = "编辑"; editField.Icon = Icon.Pencil; } if (!haveRight(GetIdentityUser().userId, "及时任务审批")) { checkField.Enabled = false; } else { checkField.Enabled = true; } string TaskLevel = row["TaskLevel"].ToString(); FineUIPro.BoundField bfEntranceYear = GridDpt.FindColumn("TaskLevel") as FineUIPro.BoundField; // 首先清空 data-color 属性 bfEntranceYear.Attributes.Remove("data-color"); // 然后添加 data-color 属性 if (TaskLevel == "普通") { bfEntranceYear.Attributes["data-color"] = "color1"; } else if (TaskLevel == "紧急") { bfEntranceYear.Attributes["data-color"] = "color2"; } else if (TaskLevel == "非常紧急") { bfEntranceYear.Attributes["data-color"] = "color3"; } }
protected void LoadData() { Maticsoft.BLL.tPictureType BLL = new Maticsoft.BLL.tPictureType(); string sortField = GridDpt.SortField; string sortDirection = GridDpt.SortDirection; GridDpt.RecordCount = BLL.GetRecordCount(""); DataView view = BLL.GetListByPage("", "", GridDpt.PageIndex * GridDpt.PageSize, (GridDpt.PageIndex + 1) * GridDpt.PageSize).Tables[0].DefaultView; view.Sort = String.Format("{0} {1}", sortField, sortDirection); GridDpt.DataSource = view.ToTable(); GridDpt.DataBind(); }
protected void LoadData() { if (TreeDpt.SelectedNode == null) { getAll(); } else { string NodeId = TreeDpt.SelectedNodeID; if (NodeId == "10000") { getAll(); } else { getAllById(); } } GridDpt.DataBind(); }
protected void LoadData() { int dptId = GetIdentityUser().dptId; Maticsoft.BLL.tTask BLL = new Maticsoft.BLL.tTask(); string sortField = GridDpt.SortField; string sortDirection = GridDpt.SortDirection; string where = " IsCheck='已审核' "; if (drpSearch.SelectedValue == "") { where += string.Format(" and Id in (select TaskId from v_task_save where DptId={0}) ", dptId); } else if (drpSearch.SelectedValue == "已上报") { where += string.Format(" and Id in (select TaskId from v_task_save where DptId={0} and SavaDpt={1}) ", dptId, dptId); } else { where += string.Format(" and Id in (select TaskId from v_task_save where DptId={0} and SavaDpt is null) ", dptId); } if (txtValue.Text.Trim() != "") { where += " and (Title like '%" + txtValue.Text.Trim() + "%') or (TaskLevel like '%" + txtValue.Text.Trim() + "%') "; } GridDpt.RecordCount = BLL.GetRecordCount(where); DataView view = BLL.GetListByPage(where, " SaveTime desc ", GridDpt.PageIndex * GridDpt.PageSize, (GridDpt.PageIndex + 1) * GridDpt.PageSize).Tables[0].DefaultView; view.Sort = String.Format("{0} {1}", sortField, sortDirection); GridDpt.DataSource = view.ToTable(); GridDpt.DataBind(); }
protected void LoadData() { Maticsoft.BLL.tDepartMent BLL = new Maticsoft.BLL.tDepartMent(); string sortField = GridDpt.SortField; string sortDirection = GridDpt.SortDirection; if (TreeDpt.SelectedNode == null) { GridDpt.RecordCount = BLL.GetRecordCount(" dptId<>10000 "); DataView view = BLL.GetListByPage(" dptId<>10000 ", " dptId asc ", GridDpt.PageIndex * GridDpt.PageSize, (GridDpt.PageIndex + 1) * GridDpt.PageSize).Tables[0].DefaultView; view.Sort = String.Format("{0} {1}", sortField, sortDirection); GridDpt.DataSource = view.ToTable(); } else { string NodeId = TreeDpt.SelectedNodeID; GridDpt.RecordCount = BLL.GetRecordCount(" dptFatherId=" + NodeId); DataView view = BLL.GetListByPage(" dptFatherId=" + NodeId, " dptId asc ", GridDpt.PageIndex * GridDpt.PageSize, (GridDpt.PageIndex + 1) * GridDpt.PageSize).Tables[0].DefaultView; view.Sort = String.Format("{0} {1}", sortField, sortDirection); GridDpt.DataSource = view.ToTable(); } GridDpt.DataBind(); }