#region 页面事件处理程序 --- gridView事件
    //数据列绑定时
    protected void gvList_RowDataBound(object sender, GridViewRowEventArgs e)
    {
        if (e.Row.RowType == DataControlRowType.DataRow)
        {
            if (e.Row.RowIndex % 2 == 1)
            {
                e.Row.Attributes.Add("onmouseover", "this.style.backgroundColor='#E7FFDD'");//#FFFF00 黄
                e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor='White'");
            }
            else
            {
                e.Row.Attributes.Add("onmouseover", "this.style.backgroundColor='#E7FFDD'");
                e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor='#F1F1F1'");
            }
      
      
            e.Row.Cells[1].Attributes.Add("style", "vnd.ms-excel.numberformat:@;");
       

        if (e.Row.Cells[4].Text.Trim() == "1")//问题状态
        {
            e.Row.Cells[4].Text = "新建";
        }
        if (e.Row.Cells[4].Text.Trim() == "2")//问题状态
        {
            e.Row.Cells[4].Text = "暂停";
        }
        if (e.Row.Cells[4].Text.Trim() == "3")//问题状态
        {
            e.Row.Cells[4].Text = "处理";
        }
        if (e.Row.Cells[4].Text.Trim() == "4")//问题状态
        {
            e.Row.Cells[4].Text = "结束";
        }


        ErpCompany objErpCompany = new ErpCompany();
        ErpCompanyDAO objErpCompanyDAO = ErpCompanyDAO.GetInstance();
        if (e.Row.Cells[3].Text.Trim() != "" || e.Row.Cells[3].Text != "来源部门")//部门列数据
        {
            objErpCompany.COMPANY_ID = Convert.ToInt32(e.Row.Cells[3].Text);
            objErpCompany = objErpCompanyDAO.GetModel(objErpCompany);
            e.Row.Cells[3].Text = objErpCompany.COMPANY_NAME;
        }

        ErpUser objErpUser = new ErpUser();
        ErpUserDAO objErpUserDAO = ErpUserDAO.GetInstance();
        if (e.Row.Cells[5].Text.Trim() != "")
        {
            objErpUser.USER_ID = Convert.ToInt32(e.Row.Cells[5].Text);
            objErpUser = objErpUserDAO.GetModel(objErpUser.USER_ID);
            e.Row.Cells[5].Text = objErpUser.USER_NAME;
        }

    }

 posted on 2006-12-11 09:56  心有灵犀  阅读(1310)  评论(0编辑  收藏  举报