Juestree 2014-09-12 06:48 采纳率: 0%
浏览 881

在绑定GridView数据的时候发现有一个字段的值无法绑定

问题如上

if (e.Row.RowType == DataControlRowType.DataRow && e.Row.DataItem != null)
{
Ali0rderModel orderModel = e.Row.DataItem as Ali0rderModel;
if (null != orderModel)
{
Label lblVersionType = e.Row.FindControl("lblVersionType") as Label;
Label lblOrderID = e.Row.FindControl("lblOrderID") as Label;
Label lblProviderFlg = e.Row.FindControl("lblProviderFlg") as Label;
Label lblBeginDate = e.Row.FindControl("lblBeginDate") as Label;
Label lblCompanyName = e.Row.FindControl("lblCompanyName") as Label;
Label lblEndDate = e.Row.FindControl("lblEndDate") as Label;
Label lblLogType = e.Row.FindControl("lblLogType") as Label;
Label lblIsCancel = e.Row.FindControl("lblIsCancel") as Label;
Label lblAverageTime = e.Row.FindControl("lblAverageTime") as Label;
Label lblLogUser = e.Row.FindControl("lblLogUser") as Label;
Label lblWrongMsg = e.Row.FindControl("lblWrongMsg") as Label;
List orderlogList = orderlogBLL.GetModelList("orderid=" + orderModel.OrderId + " and IsActive=1");
AliOrderInfoModel orderInfo = orderinfoBLL.GetModel(orderModel.OrderId);
if (null != lblOrderID)
{
lblOrderID.Text = orderModel.OrderId.ToString();
}
if (null != lblProviderFlg)
{
if (orderModel.ProviderFlg != 1)
{
lblProviderFlg.Text = "中供";
}
else
{
lblProviderFlg.Text = "GGS";
}
}
if (null != lblCompanyName)
{
lblCompanyName.Text = orderInfo.CompnayChineseName;
}
if (null != lblBeginDate)
{
lblBeginDate.Text = orderModel.ModifiedDate.ToString();
}
if (null != lblEndDate)
{
lblEndDate.Text = orderModel.FinishDate.ToString();
}
if (null != lblLogType)
{
switch (orderlogList[0].LogType)
{
case 0:
lblLogType.Text = "新订单";
break;
case 4:
lblLogType.Text = "认证完成";
break;
case 20:
lblLogType.Text = "指派中文录入人员进行录入";
break;
case 21:
lblLogType.Text = "中文录入完成提交";
break;
case 22:
lblLogType.Text = "中文审核开始审核";
break;
case 23:
lblLogType.Text = "中文审核完成提交";
break;
case 24:
lblLogType.Text = "英文录入人员开始录入";
break;
case 25:
lblLogType.Text = "报告开始进行终审";
break;
case 26:
lblLogType.Text = "审核退单中文录入";
break;
case 27:
lblLogType.Text = "审核退单中文录入完成";
break;
case 28:
lblLogType.Text = "审核退单英文录入";
break;
case 29:
lblLogType.Text = "审核推到英文录入完成";
break;
}
}
//判断操作人
if (null != lblLogUser)
{
string person = "";
if (String.IsNullOrEmpty(person))
{
person = orderModel.BAName;
}
else
{
person = person + "," + orderModel.BAName;
}
if (String.IsNullOrEmpty(person))
{
person = orderModel.AuditName;
}
else
{
person = person + "," + orderModel.AuditName;
}
if (String.IsNullOrEmpty(person))
{
person = orderModel.TranslatorName;
}
else
{
person = person + "," + orderModel.TranslatorName;
}
lblLogUser.Text = person;

            }
            //判断是否取消
            if (null != lblIsCancel)
            {
                if (orderModel.IsCancel != true)
                {
                    lblIsCancel.Text = "否";
                }
                else
                {
                    lblIsCancel.Text = "是";
                }
            }
            //错误备注
            if (null != lblWrongMsg)
            {
                IList<ALI_OrderProblemMemoModel> pList = bll.GetModelList(orderModel.OrderId, "problem", false);
                if (pList.Count > 0)
                {
                    lblWrongMsg.Text = pList[0].RecordContent;
                }
            }

            认证版本
            if (null != lblVersionType)
            {
                if (String.IsNullOrEmpty(orderModel.VType))
                {

                    lblVersionType.Text = "查不到数据";
                }
                else
                {
                    lblVersionType.Text = orderModel.VType;
                }
            }
        }
    }
  • 写回答

0条回答

    报告相同问题?

    悬赏问题

    • ¥15 关于#matlab#的问题:在模糊控制器中选出线路信息,在simulink中根据线路信息生成速度时间目标曲线(初速度为20m/s,15秒后减为0的速度时间图像)我想问线路信息是什么
    • ¥15 banner广告展示设置多少时间不怎么会消耗用户价值
    • ¥16 mybatis的代理对象无法通过@Autowired装填
    • ¥15 可见光定位matlab仿真
    • ¥15 arduino 四自由度机械臂
    • ¥15 wordpress 产品图片 GIF 没法显示
    • ¥15 求三国群英传pl国战时间的修改方法
    • ¥15 matlab代码代写,需写出详细代码,代价私
    • ¥15 ROS系统搭建请教(跨境电商用途)
    • ¥15 AIC3204的示例代码有吗,想用AIC3204测量血氧,找不到相关的代码。