当前位置: 编程技术>.net/c#/asp.net
datagrid和repeader控件中替换标识值的方法
来源: 互联网 发布时间:2014-08-25
本文导语: DataGrid控件中替换标识值的使用: 直接调用后台方法: public string GetTransType(object obj) { string type_flag = Convert.ToString(obj); string strReturn = ""; switch (type_flag) { case "1": strReturn = "在厂产...
DataGrid控件中替换标识值的使用:
直接调用后台方法:
public string GetTransType(object obj) { string type_flag = Convert.ToString(obj); string strReturn = ""; switch (type_flag) { case "1": strReturn = "在厂产品"; break; case "2": strReturn = "在厂半成品"; break; case "3": strReturn = "已出库未报关成品"; break; case "I": strReturn = "在厂原材料数量"; break; case "Y": strReturn = "已报关未入库料件数量"; break; case "W": strReturn = "已入库未报关料件数量"; break; default: ; break; } return strReturn; }
repeader控件中替换标识值的方法:
C#后台方法:
public string getLink(object objStatus, object objGuid) { if (objStatus == null) { return "#"; } else if (objStatus + "" == "未下单") { return "GjmyOrderSave.aspx?guid=" + objGuid; } else { return "GjmyOrderDetail.aspx?guid=" + objGuid; } }
public string GetExistService(object objHasWMSService, object objHasFreightAgent, object objHasCustomsClearance) { string serviceHtml = ""; if (objHasWMSService != DBNull.Value) { if (Convert.ToBoolean(objHasWMSService) == true) { serviceHtml += " 仓库发货 "; } } if (objHasFreightAgent != DBNull.Value) { if (Convert.ToBoolean(objHasFreightAgent) == true) { serviceHtml += " 货运代理 "; } } if (objHasCustomsClearance != DBNull.Value) { if (Convert.ToBoolean(objHasCustomsClearance) == true) { serviceHtml += " 报关报检 "; } } return serviceHtml; }