Exemplo n.º 1
0
        ////Data Methods

        /// <summary>
        /// Take all product from DB-Generate DataTable-Bind
        /// Columns 0 is made visible and invisible to permit Bind without error
        /// Columns 0 correspond to sizeID
        /// </summary>
        protected void BindData()
        {
            productList = BL.GetAllProducts();
            List <ProductDTO> asList = productList.ToList();

            ItemListTable.Columns[0].Visible = true;
            ItemListTable.DataSource         = GetDataTable(asList);
            ItemListTable.DataBind();
            ItemListTable.Columns[0].Visible = false;
            lblItemList.Text = "There is " + ItemListTable.Rows.Count + " items in the list.";
        }
Exemplo n.º 2
0
        public int AddItemName(AddItemWBS addItemWBS)
        {
            using (var context = new INVENTORYEntities())
            {
                ItemListTable itemListTable = new ItemListTable();


                itemListTable.ItemName = addItemWBS.ItemName;


                context.ItemListTable.Add(itemListTable);
                context.SaveChanges();
                return(itemListTable.Id);
            }
        }