protected void gvMyDraft_RowDataBound(object sender, GridViewRowEventArgs e) { //对数据列进行赋值 if (e.Row.RowType == DataControlRowType.DataRow) { if ((e.Row.RowState & DataControlRowState.Edit) != DataControlRowState.Edit) { DataRowView drvDetail = (DataRowView)e.Row.DataItem; QueryDS.FormViewRow row = (QueryDS.FormViewRow)drvDetail.Row; LinkButton lblFormType = (LinkButton)e.Row.Cells[1].FindControl("lblFormType"); lblFormType.PostBackUrl = CommonUtility.GetFormPostBackUrl(row.FormID, row.PageType, row.StatusID, "&Source=~/Home.aspx"); Label lblApplyName = (Label)e.Row.FindControl("lblFormApplyName"); lblApplyName.Text = CommonUtility.GetNameByFormID(row.FormTypeID, row.FormID); LinkButton lbtnFormType = (LinkButton)e.Row.FindControl("lblFormType"); if (row.PageType == (int)SystemEnums.PageType.TravelReimburse) { lbtnFormType.Text = "差旅费报销申请"; } else { lbtnFormType.Text = row.FormTypeName; } } } }
protected void gvMySubmitted_RowDataBound(object sender, GridViewRowEventArgs e) { // 对数据列进行赋值 if (e.Row.RowType == DataControlRowType.DataRow) { if ((e.Row.RowState & DataControlRowState.Edit) != DataControlRowState.Edit) { DataRowView drvDetail = (DataRowView)e.Row.DataItem; QueryDS.FormViewRow row = (QueryDS.FormViewRow)drvDetail.Row; LinkButton lbFormNo = (LinkButton)e.Row.Cells[2].FindControl("lblFormNo"); lbFormNo.PostBackUrl = CommonUtility.GetFormPostBackUrl(row.FormID, row.PageType, row.StatusID, "&Source=~/Home.aspx"); Label lblStatus = (Label)e.Row.Cells[3].FindControl("lblStatus"); lblStatus.Text = CommonUtility.GetStatusName(row.StatusID); Label lblApplyName = (Label)e.Row.FindControl("lblFormApplyName"); lblApplyName.Text = CommonUtility.GetNameByFormID(row.FormTypeID, row.FormID); if (!row.IsApprovedDateNull()) { Label lblApproveDate = (Label)e.Row.FindControl("lblApproveDate"); lblApproveDate.Text = row.ApprovedDate.ToString("yyyy-MM-dd HH:mm"); } } } }
protected void gvMyAwaiting_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { if ((e.Row.RowState & DataControlRowState.Edit) != DataControlRowState.Edit) { DataRowView drvDetail = (DataRowView)e.Row.DataItem; QueryDS.FormViewRow row = (QueryDS.FormViewRow)drvDetail.Row; HtmlAnchor link = (HtmlAnchor)e.Row.FindControl("FormNo"); link.HRef = CommonUtility.GetFormPostBackUrl(row.FormID, row.PageType, row.StatusID, "&Source=~/Home.aspx"); } } }
protected void gvMyAwaiting_RowDataBound(object sender, GridViewRowEventArgs e) { //对数据列进行赋值 if (e.Row.RowType == DataControlRowType.DataRow) { if ((e.Row.RowState & DataControlRowState.Edit) != DataControlRowState.Edit) { DataRowView drvDetail = (DataRowView)e.Row.DataItem; QueryDS.FormViewRow row = (QueryDS.FormViewRow)drvDetail.Row; Label lblApplyName = (Label)e.Row.FindControl("lblFormApplyName"); lblApplyName.Text = CommonUtility.GetNameByFormID(row.FormTypeID, row.FormID); LinkButton lbFormNo = (LinkButton)e.Row.Cells[2].FindControl("lblFormNo"); lbFormNo.PostBackUrl = CommonUtility.GetFormPostBackUrl(row.FormID, row.PageType, row.StatusID, "&Source=~/Home.aspx"); } } }
protected void gvMyAwaiting_RowDataBound(object sender, GridViewRowEventArgs e) { //对数据列进行赋值 if (e.Row.RowType == DataControlRowType.DataRow) { if ((e.Row.RowState & DataControlRowState.Edit) != DataControlRowState.Edit) { DataRowView drvDetail = (DataRowView)e.Row.DataItem; QueryDS.FormViewRow row = (QueryDS.FormViewRow)drvDetail.Row; LinkButton lbFormNo = (LinkButton)e.Row.Cells[2].FindControl("lblFormNo"); lbFormNo.PostBackUrl = CommonUtility.GetFormPostBackUrl(row.FormID, row.PageType, row.StatusID, "&Source=~/Home.aspx"); } } List <int> checkedFormIds = (List <int>) this.ViewState["CheckedFormIds"]; if (checkedFormIds == null) { checkedFormIds = new List <int>(); } foreach (GridViewRow gridViewRow in this.gvMyAwaiting.Rows) { if (gridViewRow.RowType == DataControlRowType.DataRow) { int FormId = (int)this.gvMyAwaiting.DataKeys[gridViewRow.RowIndex].Value; CheckBox checkCtl = (CheckBox)gridViewRow.FindControl("CheckCtl"); if (checkedFormIds.Contains(FormId)) { checkCtl.Checked = true; } else { checkCtl.Checked = false; } } } }