public async Task <ActionResult> DeleteConfirmed(Guid id)
        {
            PhotoBoothEntity photoBoothEntity = await this.db.PhotoBooths.FindAsync(id);

            this.db.PhotoBooths.Remove(photoBoothEntity);
            await this.db.SaveChangesAsync();

            return(this.RedirectToAction("Index"));
        }
        public async Task <ActionResult> Edit([Bind(Include = "Id,Name,PathToDSLRSettings,IPadDeviceId,LastAvailableDate")] PhotoBoothEntity photoBoothEntity)
        {
            if (this.ModelState.IsValid)
            {
                this.db.Entry(photoBoothEntity).State = EntityState.Modified;
                await this.db.SaveChangesAsync();

                return(this.RedirectToAction("Index"));
            }
            return(this.View(photoBoothEntity));
        }
예제 #3
0
        public async Task <IHttpActionResult> GetPhotoBoothEntity(Guid id)
        {
            PhotoBoothEntity photoBoothEntity = await db.PhotoBooths.FindAsync(id);

            if (photoBoothEntity == null)
            {
                return(NotFound());
            }

            return(Ok(photoBoothEntity));
        }
        public async Task <ActionResult> Create([Bind(Include = "Id,Name,PathToDSLRSettings,IPadDeviceId,LastAvailableDate")] PhotoBoothEntity photoBoothEntity)
        {
            if (this.ModelState.IsValid)
            {
                photoBoothEntity.Id = Guid.NewGuid();
                this.db.PhotoBooths.Add(photoBoothEntity);
                await this.db.SaveChangesAsync();

                return(this.RedirectToAction("Index"));
            }

            return(this.View(photoBoothEntity));
        }
        // GET: PhotoBoothEntities/Edit/5
        public async Task <ActionResult> Edit(Guid?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            PhotoBoothEntity photoBoothEntity = await this.db.PhotoBooths.FindAsync(id);

            if (photoBoothEntity == null)
            {
                return(this.HttpNotFound());
            }
            return(this.View(photoBoothEntity));
        }