예제 #1
0
        public ActionResult Create(ProductViewModel collection)
        {
            try
            {
                dtbs15Entities db = new dtbs15Entities();
                Product        bc = new Product();
                bc.Add_Date        = collection.Add_Date;
                bc.Browser_Id      = collection.Browser_Id;
                bc.BcamId          = collection.BcamId;
                bc.Price           = collection.price;
                bc.Wifi            = collection.WIFI;
                bc.USB_Id          = collection.USB_Id;
                bc.Resolution      = collection.Resolution;
                bc.CategoryId      = collection.categoryID;
                bc.CardSupport     = collection.card_support;
                bc.Connectivity_Id = collection.Connectivity_Id;
                bc.FcamId          = collection.FcamId;


                db.Products.Add(bc);
                db.SaveChanges();

                return(RedirectToAction("Index"));
            }
            catch
            {
                return(View());
            }
        }
예제 #2
0
        // GET: FrontCamera/Delete/5
        public ActionResult Delete(int id)
        {
            dtbs15Entities db     = new dtbs15Entities();
            var            fc     = db.Front_Camera.Where(x => x.Id == id).SingleOrDefault();
            var            result = db.Front_Camera.Remove(fc);

            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
예제 #3
0
        // GET: Category/Delete/5
        public ActionResult Delete(int id)
        {
            dtbs15Entities db     = new dtbs15Entities();
            var            bc     = db.Categories.Where(x => x.id == id).SingleOrDefault();
            var            result = db.Categories.Remove(bc);

            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
예제 #4
0
 public ActionResult Delete(int id, FormCollection collection)
 {
     try
     {
         // TODO: Add delete logic here
         dtbs15Entities db     = new dtbs15Entities();
         var            bc     = db.Connectivities.Where(x => x.id == id).SingleOrDefault();
         var            result = db.Connectivities.Remove(bc);
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     catch
     {
         return(View());
     }
 }
 public ActionResult Create(DisplayViewModel collection)
 {
     try
     {
         dtbs15Entities db = new dtbs15Entities();
         Display        bc = new Display();
         bc.Technology = collection.Technology;
         db.Displays.Add(bc);
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     catch
     {
         return(View());
     }
 }
예제 #6
0
 public ActionResult Edit(int id, OSViewModel collection)
 {
     try
     {
         dtbs15Entities  db = new dtbs15Entities();
         OperatingSystem bc = new OperatingSystem();
         var             c  = db.OperatingSystems.Where(x => x.Id == id).SingleOrDefault();
         c.OS = collection.OS;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     catch
     {
         return(View());
     }
 }
 public ActionResult Create(BacKCameraVIewModel collection)
 {
     try
     {
         // TODO: Add insert logic here
         dtbs15Entities db = new dtbs15Entities();
         Back_Camera    bc = new Back_Camera();
         bc.Pixel = collection.Pixel;
         db.Back_Camera.Add(bc);
         db.SaveChanges();
         return(RedirectToAction("~/Home/AdminPanel"));
     }
     catch
     {
         return(View());
     }
 }
예제 #8
0
        public ActionResult Create(OSViewModel collection)
        {
            try
            {
                dtbs15Entities  db = new dtbs15Entities();
                OperatingSystem bc = new OperatingSystem();
                bc.OS = collection.OS;
                db.OperatingSystems.Add(bc);
                db.SaveChanges();

                return(RedirectToAction("Index"));
            }
            catch
            {
                return(View());
            }
        }
예제 #9
0
        public ActionResult Create(USBViewModel collection)
        {
            try
            {
                dtbs15Entities db = new dtbs15Entities();
                USB            bc = new USB();
                bc.Type = collection.Type;
                db.USBs.Add(bc);
                db.SaveChanges();

                return(RedirectToAction("Index"));
            }
            catch
            {
                return(View());
            }
        }
예제 #10
0
 public ActionResult Edit(int id, DisplayViewModel collection)
 {
     try
     {
         // TODO: Add update logic here
         dtbs15Entities db = new dtbs15Entities();
         Display        bc = new Display();
         var            c  = db.Displays.Where(x => x.id == id).SingleOrDefault();
         c.Technology = collection.Technology;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     catch
     {
         return(View());
     }
 }
예제 #11
0
        public ActionResult Edit(int id, RamViewModel collection)
        {
            try
            {
                // TODO: Add update logic here

                dtbs15Entities db = new dtbs15Entities();
                RAM            bc = new RAM();
                var            c  = db.RAMs.Where(x => x.Id == id).SingleOrDefault();
                c.Capacity = collection.Capacity;
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }
            catch
            {
                return(View());
            }
        }
예제 #12
0
        public ActionResult Create(FrontCameraViewModel Collection)
        {
            try
            {
                // TODO: Add insert logic here
                dtbs15Entities db = new dtbs15Entities();
                Front_Camera   fc = new Front_Camera();
                fc.Pixel = Collection.Pixel;
                db.Front_Camera.Add(fc);
                db.SaveChanges();

                return(RedirectToAction("Index"));
            }
            catch
            {
                return(View());
            }
        }
예제 #13
0
        public ActionResult Create(RamViewModel collection)
        {
            try
            {
                // TODO: Add insert logic here

                dtbs15Entities db = new dtbs15Entities();
                RAM            bc = new RAM();
                bc.Capacity = collection.Capacity;
                db.RAMs.Add(bc);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }
            catch
            {
                return(View());
            }
        }
        public ActionResult Edit(int id, BacKCameraVIewModel collection)
        {
            try
            {
                dtbs15Entities db = new dtbs15Entities();
                Back_Camera    bc = new Back_Camera();
                var            c  = db.Back_Camera.Where(x => x.Id == id).SingleOrDefault();
                c.Pixel = collection.Pixel;
                db.SaveChanges();

                // TODO: Add update logic here

                return(RedirectToAction("Index"));
            }
            catch
            {
                return(View());
            }
        }
예제 #15
0
        public ActionResult Edit(int id, FrequencyViewModel collection)
        {
            try
            {
                dtbs15Entities db  = new dtbs15Entities();
                Connectivity   con = new Connectivity();
                var            c   = db.Connectivities.Where(x => x.id == id).SingleOrDefault();
                c.C2G_Band = collection._2G_Band;
                c.C3G_Band = collection._3G_Band;
                c.C4G_Band = collection._4G_Band;
                db.SaveChanges();
                // TODO: Add update logic here

                return(RedirectToAction("Index"));
            }
            catch
            {
                return(View());
            }
        }
예제 #16
0
        public ActionResult Create(CategoryViewModel collection)
        {
            try
            {
                dtbs15Entities db = new dtbs15Entities();
                Category       c  = new Category();
                c.Add_Date     = DateTime.Now.Date;
                c.Manufacturer = collection.manufacturer;

                db.Categories.Add(c);
                db.SaveChanges();


                return(RedirectToAction("Index"));
            }
            catch
            {
                return(View());
            }
        }
예제 #17
0
        public ActionResult Create(FrequencyViewModel collection)
        {
            try
            {
                // TODO: Add insert logic here

                dtbs15Entities db = new dtbs15Entities();
                Connectivity   c  = new Connectivity();
                c.C2G_Band = collection._2G_Band;
                c.C3G_Band = collection._3G_Band;
                c.C4G_Band = collection._4G_Band;
                db.Connectivities.Add(c);
                db.SaveChanges();

                return(RedirectToAction("Index"));
            }
            catch
            {
                return(View());
            }
        }
예제 #18
0
        public ActionResult Edit(int id, CategoryViewModel collection)
        {
            try
            {
                // TODO: Add update logic here

                dtbs15Entities db  = new dtbs15Entities();
                Category       con = new Category();
                var            c   = db.Categories.Where(x => x.id == id).SingleOrDefault();
                c.Manufacturer = collection.manufacturer;
                c.Add_Date     = collection.Add_Date;
                c.Update_Date  = collection.Update_Date;
                db.SaveChanges();
                // TODO: Add update logic here

                return(RedirectToAction("Index"));
            }
            catch
            {
                return(View());
            }
        }