Ejemplo n.º 1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                //Set Dropdown
                ProductType_ddl.DataSource     = ProductTypeHandler.GetProductTypes();
                ProductType_ddl.DataTextField  = "Name";
                ProductType_ddl.DataValueField = "ID";
                ProductType_ddl.SelectedIndex  = -1;
                ProductType_ddl.DataBind();

                ProductType_ddl.Items.Insert(0, new ListItem("--Select Product Type--", "-1"));

                //fill data in repeater
                RptProductListByType.DataSource = new ProductHandler().GetAllProduct();
                RptProductListByType.DataBind();
            }
            //jika admin
            if (Session.Keys.Count != 0)
            {
                if (Session["RoleID"].ToString().Equals("1"))
                {
                    Btn_InsertNewProd.Visible = true;
                }
            }
        }
Ejemplo n.º 2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                //ProductType_ddl.DataSource = ProductHandler
                ProductType_ddl.DataSource     = ProductTypeHandler.GetProductTypes();
                ProductType_ddl.DataTextField  = "Name";
                ProductType_ddl.DataValueField = "ID";
                ProductType_ddl.SelectedIndex  = 0;
                ProductType_ddl.DataBind();

                //ProductType_ddl.Items.Insert(0, new ListItem("--Select Item Product--", "-1"));
            }
        }
Ejemplo n.º 3
0
 public static List <Product_Type> GetProductTypes()
 {
     return(ProductTypeHandler.GetProductTypes());
 }
Ejemplo n.º 4
0
 public void PopulateData()
 {
     tableProductType.DataSource = ProductTypeHandler.GetProductTypes();
     tableProductType.DataBind();
 }