本文介绍了如何绑定数据一个条件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个项目表,其中包含不同品牌的项目.现在,我希望在下订单时仅将一个品牌的商品显示给该brandadmin.例如,xyz品牌商品只能由xyz管理员订购.但是xyz的某些品牌也可以由abc订购.
I have a items table which contains the items of diffrent brands . Now i want that when order is placed the item of one brand is shown to that brandadmin only . For example xyz brand item can be ordered by xyz admin only . But some of the brand of xyz can be order by abc also .
推荐答案
try
{
strCurrentRole = Request.QueryString["RoleId"].ToString();
if (Session["Admin"] == null || strCurrentRole != "11" || Session["Roles"].ToString().IndexOf("11") == -1)
{
Session.RemoveAll();
Response.Redirect("Default.aspx");
}
}
catch
{
Session.RemoveAll();
Response.Redirect("Default.aspx");
}
代码格式.
Code formatted.
这篇关于如何绑定数据一个条件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!