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 drone 推送镜像时候 purge: true 推送完毕后没有删除对应的镜像,手动拷贝到服务器执行结果正确在样才能让指令自动执行成功删除对应镜像,如何解决?
    • ¥15 求daily translation(DT)偏差订正方法的代码
    • ¥15 js调用html页面需要隐藏某个按钮
    • ¥15 ads仿真结果在圆图上是怎么读数的
    • ¥20 Cotex M3的调试和程序执行方式是什么样的?
    • ¥20 java项目连接sqlserver时报ssl相关错误
    • ¥15 一道python难题3
    • ¥15 牛顿斯科特系数表表示
    • ¥15 arduino 步进电机
    • ¥20 程序进入HardFault_Handler