62,266
社区成员
发帖
与我相关
我的任务
分享

void GridView_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
string userid = e.Row.Cells[1].Text;
string userid1 = e.Row.Cells[9].Text;
//e.Row.Cells[4].Text = "<a href='AddUser.aspx?UserID=" + e.Row.Cells[4].Text + "'><font color='blue'>编辑</font></a>";
//string str = "";
string str= "<a href='LeaderTourMain.aspx?leaderid=" +userid1 + "&LeaderName=" + e.Row.Cells[2].Text + "&starttime=" + e.Row.Cells[3].Text + "&endtime=" + e.Row.Cells[4].Text + "&leaderlocation="+e.Row.Cells[5].Text.Trim()+"&maincontext="+e.Row.Cells[6].Text.Trim()+"&message="+e.Row.Cells[7].Text.Trim()+ "'><font color='blue'>修改</font></a>";
// str += "<a href='AddUser.aspx?UserID=" + e.Row.Cells[4].Text + "'><font color='blue'> 授权</font></a>";
e.Row.Cells[10].Text = str;
//e.Row.Cells[9].Visible = false;
e.Row.Cells[9].Visible = false;
e.Row.Cells[8].Visible = false;
e.Row.Cells[3].Text = e.Row.Cells[3].Text.Substring(0, e.Row.Cells[3].Text.Length-8);
e.Row.Cells[4].Text = e.Row.Cells[4].Text.Substring(0, e.Row.Cells[4].Text.Length-8);
if (e.Row.Cells[6].Text.Length > 20)
{
e.Row.Cells[6].Text = e.Row.Cells[6].Text.Substring(0, 20);
}
}
if (e.Row.RowType == DataControlRowType.Header)
{
e.Row.Cells[8].Visible = false;
e.Row.Cells[9].Visible = false;
}
} protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
if (Request.QueryString["leaderid"] != null)
{
leaderName.Text = Request.QueryString["LeaderName"].ToString();
newBtn.Visible = false;
submitBtn.Visible = false;
if (Request.QueryString["starttime"] != null)
{
beginTime.SelectedDate = Convert.ToDateTime(Request.QueryString["starttime"].ToString());
}
if (Request.QueryString["endtime"] != null)
{
endTime.SelectedDate = Convert.ToDateTime(Request.QueryString["endtime"].ToString());
}
}
if (Request.QueryString["leaderlocation"] != null)
{
curLocation.Text = Request.QueryString["leaderlocation"].ToString();
}
if (Request.QueryString["maincontext"] != null)
{
travelContent.InnerText = Request.QueryString["maincontext"].ToString();
}
if (Request.QueryString["message"] != null)
{
leaderAttachment.Text = Request.QueryString["message"].ToString();
}
else
{
modifyBtn.Visible = false;
returnBtn.Visible = false;
}
}
}