Exemplo n.º 1
0
        //data insert
        public string[] AddUpdateProductCat(EntityProductCategory EntProCat)
        {
            string[] returnValues = new string[2];
            using (DairyHubEntities db = new DairyHubEntities())
            {
                ProductCategory objtblprocat = new ProductCategory();
                objtblprocat.Catid   = EntProCat.Catid;
                objtblprocat.CatName = EntProCat.CatName;
                db.ProductCategories.Add(objtblprocat);
                string savevalue = db.SaveChanges().ToString();
                returnValues[0] = "Insert";
                returnValues[1] = objtblprocat.Catid.ToString();
            }

            return(returnValues);
        }
Exemplo n.º 2
0
        public string[] AddUpdateProductCat(EntityAddImage Entaddimg)
        {
            string[] returnValues = new string[2];
            using (DairyHubEntities db = new DairyHubEntities())
            {
                Product objtblpro = new Product();
                objtblpro.Catid       = Entaddimg.Catid;
                objtblpro.ProductName = Entaddimg.ProductName;
                db.Products.Add(objtblpro);
                string savevalue = db.SaveChanges().ToString();
                returnValues[0] = "Insert";
                returnValues[1] = objtblpro.Catid.ToString();
            }

            return(returnValues);
        }