Пример #1
0
        public ActionResult CreateProductSold(ProductSold newPS)
        {
            using (ProductFirstVersionEntities dbobj = new ProductFirstVersionEntities())
            {
                dbobj.ProductSolds.Add(newPS);
                dbobj.SaveChanges();

                return(RedirectToAction("ProductSold"));
            }
        }
Пример #2
0
 public ActionResult DeleteStore(int id, Store s)
 {
     using (ProductFirstVersionEntities dbobj = new ProductFirstVersionEntities())
     {
         var store = dbobj.Stores.Where(x => x.StoreId == id).FirstOrDefault();
         dbobj.Stores.Remove(store);
         dbobj.SaveChanges();
         return(RedirectToAction("Store"));
     }
 }
Пример #3
0
        public ActionResult DeleteProduct(int id, Product newproduct)
        {
            using (ProductFirstVersionEntities dbobj = new ProductFirstVersionEntities())
            {
                var product = dbobj.Products.Where(x => x.ProductId == id).FirstOrDefault();
                dbobj.Products.Remove(product);

                dbobj.SaveChanges();
                return(RedirectToAction("Product"));
            }
        }
Пример #4
0
        public ActionResult DeleteCustomer(int id, Customer newcustomer)
        {
            using (ProductFirstVersionEntities dbobj = new ProductFirstVersionEntities())
            {
                var customer = dbobj.Customers.Where(x => x.CustomerId == id).FirstOrDefault();
                dbobj.Customers.Remove(customer);

                dbobj.SaveChanges();

                return(RedirectToAction("Customer"));
            }
        }
Пример #5
0
 public ActionResult CreateStore(Store newstore)
 {
     if (ModelState.IsValid)
     {
         using (ProductFirstVersionEntities dbobj = new ProductFirstVersionEntities())
         {
             dbobj.Stores.Add(newstore);
             dbobj.SaveChanges();
             return(RedirectToAction("Store"));
         }
     }
     return(View());
 }
Пример #6
0
        public ActionResult EditCustomer(int id, Customer newcustomer)
        {
            if (ModelState.IsValid)
            {
                using (ProductFirstVersionEntities dbobj = new ProductFirstVersionEntities())
                {
                    dbobj.Entry(newcustomer).State = EntityState.Modified;
                    dbobj.SaveChanges();

                    return(RedirectToAction("Customer"));
                }
            }
            return(View());
        }
Пример #7
0
        public ActionResult CreateCustomer(Customer newcustomer)
        {
            if (ModelState.IsValid)
            {
                using (ProductFirstVersionEntities dbobj = new ProductFirstVersionEntities())
                {
                    dbobj.Customers.Add(newcustomer);
                    dbobj.SaveChanges();

                    return(RedirectToAction("Customer"));
                }
            }
            return(View());
        }
Пример #8
0
        public ActionResult EditStore(int id, Store newstore)
        {
            if (ModelState.IsValid)
            {
                using (ProductFirstVersionEntities dbobj = new ProductFirstVersionEntities())
                {
                    dbobj.Entry(newstore).State = EntityState.Modified;
                    dbobj.SaveChanges();

                    return(RedirectToAction("Store"));
                }
            }
            return(View());
        }
Пример #9
0
        public ActionResult CreateProduct(Product newproduct)
        {
            if (ModelState.IsValid)
            {
                using (ProductFirstVersionEntities dbobj = new ProductFirstVersionEntities())
                {
                    dbobj.Products.Add(newproduct);
                    dbobj.SaveChanges();

                    return(RedirectToAction("Product"));
                }
            }
            return(View());
        }