Пример #1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        IBusinessFunctions ibf = GenericFactory <BusinessLayer, IBusinessFunctions> .CreateInstance();

        dt = ibf.getProductCategories();
        if (SessionFacade.ROLE != null)
        {
            if (SessionFacade.ROLE == "ElectronicsManager")
            {
                lblCategory.Text = dt.Rows[0]["CatDesc"].ToString();
                category         = dt.Rows[0]["CatID"].ToString();
            }

            else if (SessionFacade.ROLE == "LuggageManager")
            {
                lblCategory.Text = dt.Rows[2]["CatDesc"].ToString();
                category         = dt.Rows[2]["CatID"].ToString();
            }
            else if (SessionFacade.ROLE == "BeautyManager")
            {
                lblCategory.Text = dt.Rows[4]["CatDesc"].ToString();
                category         = dt.Rows[4]["CatID"].ToString();
            }
            else if (SessionFacade.ROLE == "SportsManager")
            {
                lblCategory.Text = dt.Rows[3]["CatDesc"].ToString();
                category         = dt.Rows[3]["CatID"].ToString();
            }
            else if (SessionFacade.ROLE == "KitchenManager")
            {
                lblCategory.Text = dt.Rows[1]["CatDesc"].ToString();
                category         = dt.Rows[1]["CatID"].ToString();
            }
        }
    }
Пример #2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            IBusinessFunctions ibf = GenericFactory <BusinessLayer, IBusinessFunctions> .CreateInstance();

            dt = ibf.getProductCategories();
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                ddlCategory.Items.Add(dt.Rows[i]["CatDesc"].ToString());
                ddlCategory.Items[i].Value = dt.Rows[i]["CatID"].ToString();
            }
        }
    }