public AddProduct GetProduct(int id)
        {
            var partId = (from d in db.ProductTables
                          where d.ProductId.Equals(id)
                          select d).FirstOrDefault();
            AddProduct member = new AddProduct
            {
                name   = partId.ProductName,
                price  = partId.Price,
                Col    = partId.Colour,
                Quant  = partId.Quantity,
                imgurl = partId.ImgUrl,
                desc   = partId.Desc,
                type   = partId.Type
            };

            return(member);
        }
        public bool EditProduct(AddProduct add, int Id)
        {
            var partId = (from d in db.ProductTables
                          where d.ProductId.Equals(Id)
                          select d).FirstOrDefault();

            partId.ProductName = add.name;
            partId.Price       = add.price;
            partId.Quantity    = add.Quant;
            partId.Colour      = add.Col;
            partId.Colour      = add.desc;
            partId.ImgUrl      = add.imgurl;
            partId.Type        = add.type;

            try
            {
                db.SubmitChanges();
                return(true);
            }catch (IndexOutOfRangeException es)
            {
                es.GetBaseException();
                return(false);
            }
        }