无为清净楼资源网 Design By www.qnjia.com

DataGrid控件中替换标识值的使用:

<asp:DataGrid ID="dgList" runat="server" Width="100%" AutoGenerateColumns="False"> 
<Columns> 
<asp:BoundColumn DataField="COP_G_NO" HeaderText="物料号/成品货号"></asp:BoundColumn> 
<asp:BoundColumn DataField="QTY" HeaderText="数量"></asp:BoundColumn> 
<asp:TemplateColumn HeaderText="物料标识"> 
<ItemTemplate> 
<%#GetTransType(DataBinder.Eval(Container.DataItem, "FLAG"))%> 
</ItemTemplate> 
</asp:TemplateColumn> 
</Columns> 
</asp:DataGrid>
直接调用后台方法:
<asp:TemplateColumn HeaderText="原产地"> 
<ItemTemplate> 
<%# (Common.Constant.CountryList.ContainsKey(Eval("COUNTRY") + "")) "COUNTRY") + ""] : Eval("COUNTRY") + "" %> 
</ItemTemplate> 
</asp:TemplateColumn>
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控件中替换标识值的方法:

<asp:Repeater ID="rp_List" runat="server" OnItemCommand="rp_List_ItemCommand"> 
<ItemTemplate> 
<tr> 
<td> 
<input id="chk" type="checkbox" name="chkName" runat="server" /> 
</td> 
<td width="70"> 
<asp:HyperLink NavigateUrl='<%# getLink(Eval("CodeNameCn"),Eval("Guid"))%>' ID="hl_guid" 
runat="server"><%# Eval("OrderNo")%></asp:HyperLink> 
</td> 
<td> 
<%# Eval("CustomerNo")%><asp:HiddenField ID="hf_OrderNo" Value='<%# Eval("Guid") %>' 
runat="server" /> 
</td> 
<td> 
<%# getInOrOut(Eval("IeType"))%> 
</td> 
<td> 
<%# Eval("TradeMode")%> 
</td> 
<td> 
<%# Eval("TotalQuantity")%> 
</td> 
<td> 
<%# Eval("TotalAmount")%> 
</td> 
<td> 
<%# Eval("ShipPeople")%> 
</td> 
<td> 
<%# Eval("ReceivePeople")%> 
</td> 
<td> 
<asp:LinkButton ID="lb_xiadan" runat="server" CommandName="xiadan"><%#getIsShowXiadan(Eval("Status"))%></asp:LinkButton> 
</td> 
<td> 
<%# GetExistService(Eval("HasWMSService"), Eval("HasFreightAgent"), Eval("HasCustomsClearance"))%> 
</td> 
<td> 
<%# Eval("CodeNameCn")%> 
</td> 
<td> 
<%# Convert.ToDateTime(Eval("CreateTime")).ToString("yyyy-MM-dd")%> 
</td> 
</tr> 
</ItemTemplate> 
</asp:Repeater>

C#后台方法:

public string getLink(object objStatus, object objGuid) 
{ 
if (objStatus == null) 
{ 
return "#"; 
} 
else if (objStatus + "" == "未下单") 
{ 
return "GjmyOrderSave.aspx" + objGuid; 
} 
else 
{ 
return "GjmyOrderDetail.aspx" + 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; 
}
标签:
datagrid,repeader,标识值

无为清净楼资源网 Design By www.qnjia.com
广告合作:本站广告合作请联系QQ:858582 申请时备注:广告合作(否则不回)
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件! 如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
无为清净楼资源网 Design By www.qnjia.com

RTX 5090要首发 性能要翻倍!三星展示GDDR7显存

三星在GTC上展示了专为下一代游戏GPU设计的GDDR7内存。

首次推出的GDDR7内存模块密度为16GB,每个模块容量为2GB。其速度预设为32 Gbps(PAM3),但也可以降至28 Gbps,以提高产量和初始阶段的整体性能和成本效益。

据三星表示,GDDR7内存的能效将提高20%,同时工作电压仅为1.1V,低于标准的1.2V。通过采用更新的封装材料和优化的电路设计,使得在高速运行时的发热量降低,GDDR7的热阻比GDDR6降低了70%。