private string GetNeedMeApproveTaskIDs() { if (MCSTabControl1.SelectedIndex == 0) { int organizecity = int.Parse(tr_OrganizeCity.SelectValue); int level = int.Parse(ddl_Level.SelectedValue); int state = int.Parse(ddl_State.SelectedValue); int rtchannel = int.Parse(ddl_RTChannel.SelectedValue); string taskids = ""; DataTable dt = CM_ContractBLL.GetPMList(organizecity, level, state, (int)Session["UserID"], rtchannel); for (int i = 0; i < dt.Rows.Count; i++) { if (dt.Rows[i]["ApproveTask"].ToString() != "" && dt.Rows[i]["ApproveTask"].ToString() != "NULL") { taskids += dt.Rows[i]["ApproveTask"].ToString() + ","; } } if (taskids.EndsWith(",")) { taskids = taskids.Substring(0, taskids.Length - 1); } return(taskids); } else if (MCSTabControl1.SelectedIndex == 1) { string ids = ""; foreach (GridViewRow row in gv_ListDetail.Rows) { Object cbx = row.FindControl("chk_ID"); if (cbx != null && ((CheckBox)cbx).Checked) { if (ids != "") { ids += ","; } ids += gv_ListDetail.DataKeys[row.RowIndex][1].ToString(); } } return(ids); } return(""); }