示例#1
0
    protected void GridView3_RowDataBound(object sender, GridViewRowEventArgs e)
    {
        if (e.Row.RowType == DataControlRowType.DataRow)
        {
            ReceiptAuditAdapter raa = new ReceiptAuditAdapter();
            string type             = e.Row.Cells[3].Text;
            e.Row.Cells[3].Text = raa.getTypeNameByCode(type);
            CommonAdapter ca         = new CommonAdapter();
            int           currencyID = Int32.Parse(e.Row.Cells[6].Text);
            e.Row.Cells[6].Text = ca.getCurrencyByID(currencyID);
            //0-未核销,1-部分核销,2-完全核销
            int check_status = Int32.Parse(e.Row.Cells[14].Text);
            switch (check_status)
            {
            case 1:
                e.Row.Cells[14].Text = "部分核销";
                break;

            case 2:
                e.Row.Cells[14].Text = "完全核销";
                break;

            default:
                e.Row.Cells[14].Text = "未核销";
                break;
            }

            int DepartmentID = Int32.Parse(e.Row.Cells[8].Text);
            e.Row.Cells[8].Text = ca.getDepartmentNameByID(DepartmentID);

            int EmpID = Int32.Parse(e.Row.Cells[9].Text);
            e.Row.Cells[9].Text = ca.getEmpNameByID(EmpID);

            int CheckerID = Int32.Parse(e.Row.Cells[10].Text);
            e.Row.Cells[10].Text = ca.getEmpNameByID(CheckerID);



            string auditstatus = e.Row.Cells[13].Text.ToLower();
            if (auditstatus == "3")
            {
                e.Row.Cells[13].Text = "通过";
                Button btnDelete = e.Row.Cells[0].FindControl("btnDelete") as Button;
                btnDelete.Enabled = false;
            }
            else if (auditstatus == "2")
            {
                e.Row.Cells[13].Text = "不通过";
            }
            else if (auditstatus == "1")
            {
                e.Row.Cells[13].Text = "待审核";
            }
            else
            {
                e.Row.Cells[13].Text = "未提交";
            }
        }
    }