private void GridViewIssueBind() { IssueFreeBiz issueFreeBiz = new IssueFreeBiz(); IList <BfIssueinfo> listBfIssueinfo = issueFreeBiz.GetIssueinfo(CrID, MinID); GridViewIssue.DataSource = listBfIssueinfo; GridViewIssue.DataBind(); }
protected void gridViewMeetingMinute_RowDataBound(object sender, GridViewRowEventArgs e) { try { GridView gridView = sender as GridView; if (gridView == null) { return; } if (e.Row.RowType != DataControlRowType.DataRow) { return; } PmsMinHead dataItem = (PmsMinHead)e.Row.DataItem; if (dataItem == null) { return; } e.Row.Attributes["PmsId"] = dataItem.PmsId.ToString(); e.Row.Attributes["Mnid"] = dataItem.Mnid.ToString(); Label labelTypeName = e.Row.FindControl("labelTypeName") as Label; labelTypeName.Text = GetMeetingMinuteTypeDesc(dataItem.MeetingType); PmsMinHead pmsMinHead = new PmsMinHeadBiz().SelectPmsMinHeadByPmsIdMinId(dataItem.PmsId.ToString(), dataItem.Mnid.ToString()).FirstOrDefault(); PmsHead pmsHead = new PmsHeadBiz().SelectPmsHeadByPmsId(dataItem.PmsId.ToString()).FirstOrDefault(); PmsItarmMapping pmsItarmMapping = new PmsItarmMappingBiz().SelectPmsItarmMappingOther(dataItem.PmsId.ToString()).FirstOrDefault(); string crId = pmsItarmMapping.CrId; if (LoginName.Equals(pmsMinHead.Creator) || LoginName.Equals(pmsHead.Sd)) { ImageButton imageButtonEdit = e.Row.FindControl("imageButtonEdit") as ImageButton; if (imageButtonEdit != null) { imageButtonEdit.Attributes.Add("onclick", string.Format("return OpenEditMeetingMinute('{0}','{1}','{2}');", dataItem.PmsId.ToString(), crId, dataItem.Mnid.ToString())); } } ImageButton imageButtonDetail = e.Row.FindControl("imageButtonDetail") as ImageButton; if (imageButtonDetail != null) { imageButtonDetail.Attributes.Add("onclick", string.Format("return OpenViewMeetingMinute('{0}','{1}','{2}');", dataItem.PmsId.ToString(), crId, dataItem.Mnid.ToString())); } IssueFreeBiz issueFreeBiz = new IssueFreeBiz(); IList <BfIssueinfo> listBfIssueinfo = issueFreeBiz.GetIssueinfo(crId, dataItem.Mnid); string returnIssueID = string.Empty; int i = 1; string issueViewUrl = ConfigurationManager.AppSettings["IssueViewUrl"]; if (listBfIssueinfo.Count > 0) { returnIssueID += "<table cellSpacing='0' cellPadding='0' border='0'>"; foreach (BfIssueinfo bfIssueinfo in listBfIssueinfo) { string issueID = bfIssueinfo.Issueid.ToString(); string url = issueViewUrl + issueID; returnIssueID = returnIssueID + "<tr><td>" + "<a id='FileList" + i + "' style='color:Blue;cursor:hand;white-space:nowrap;text-overflow:ellipsis;overflow:hidden' " + "HREF = '" + url + "' Target='_blank'>" + issueID + "</a></td></tr>"; i++; } returnIssueID += "</table>"; HtmlContainerControl divOpenIssue = e.Row.FindControl("divOpenIssue") as HtmlContainerControl; divOpenIssue.InnerHtml = returnIssueID; } } catch (Exception) { Msgbox("GridView Bind Fail!"); } }