Пример #1
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());
            }
        }
Пример #2
0
        public ActionResult Edit(int id, FrontCameraViewModel collection)
        {
            try
            {
                // TODO: Add update logic here
                dtbs15Entities db = new dtbs15Entities();
                Front_Camera   fc = new Front_Camera();
                var            c  = db.Front_Camera.Where(x => x.Id == id).SingleOrDefault();
                c.Pixel = collection.Pixel;
                db.SaveChanges();

                // TODO: Add update logic here

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