问题描述
- 在绑定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; } } } }