Click here to Skip to main content
15,891,763 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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 .
Posted
Comments
nagendrathecoder 4-Oct-11 3:04am    
So what is the problem? What have you tried?
BobJanova 4-Oct-11 6:00am    
Unclear
Vimalrashamra 4-Oct-11 7:05am    
Actually i have a detail view for items in which i enter the item and its cost and other attributes which saved in itemmast table. Now items are of diffrent company like MS SQl is of Microsoft and Oracle is of Java . Now when admin or superadmin order that items . I want that if admin is of Java company then all java products are bind and viceversa but i want that a product like Jquery which is of Microsoft will be shown to Java Admin also when he went to select item. So, may be i have to change something in itemmast table or in the select item page i have to bind it with some query which i want to know .

1 solution

You Can Do This Via define the roleId, during page load by session you can pass the rloeid, If a user have role for particular product, then he can open otherwise he can't,for this during create user id you should be paas the roleeid also, and during login the page you can fetch the role id;
there is some code that will be helpfull for you,
string strCurrentRole;

C#
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");
}


Edit: Code formatted.
 
Share this answer
 
v2
Comments
Vimalrashamra 4-Oct-11 3:30am    
I want to do it for products
Vimalrashamra 4-Oct-11 3:34am    
sWhere = "brandid like " + TextUtilities.ToSql(Session["AdminCompanyId"].ToString(), "S") ;

On the page load i bind it through that . But i want to bind also the products whose itemshow value in item table is true . So what i have to edit in this query

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900