예제 #1
0
        public async Task <ActionResult> Edit([Bind(Include = "ServicePhotoTitleId,FileName,Title")] ServicePhotoTitle servicePhotoTitle)
        {
            if (ModelState.IsValid)
            {
                db.Entry(servicePhotoTitle).State = EntityState.Modified;
                await db.SaveChangesAsync();

                return(RedirectToAction("Index", "CompanyServices"));
            }
            ViewBag.ServicePhotoTitleId = new SelectList(db.CompanyServices, "CompanyServiceId", "Name", servicePhotoTitle.ServicePhotoTitleId);
            return(View(servicePhotoTitle));
        }
예제 #2
0
        public async Task <ActionResult> DeleteConfirmed(int id, string deleteFileName)
        {
            PhotoFileManager manager = new PhotoFileManager(PhotoManagerType.ServiceTitle);

            manager.Delete(deleteFileName, false);

            ServicePhotoTitle servicePhotoTitle = await db.ServicePhotoTitles.FindAsync(id);

            db.ServicePhotoTitles.Remove(servicePhotoTitle);
            await db.SaveChangesAsync();

            return(RedirectToAction("Index", "CompanyServices"));
        }
예제 #3
0
        // GET: ServicePhotoTitles/Details/5
        public async Task <ActionResult> Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            ServicePhotoTitle servicePhotoTitle = await db.ServicePhotoTitles.FindAsync(id);

            if (servicePhotoTitle == null)
            {
                return(HttpNotFound());
            }
            return(View(servicePhotoTitle));
        }
예제 #4
0
        // GET: ServicePhotoTitles/Edit/5
        public async Task <ActionResult> Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            ServicePhotoTitle servicePhotoTitle = await db.ServicePhotoTitles.FindAsync(id);

            if (servicePhotoTitle == null)
            {
                return(HttpNotFound());
            }
            ViewBag.ServicePhotoTitleId = new SelectList(db.CompanyServices, "CompanyServiceId", "Name", servicePhotoTitle.ServicePhotoTitleId);
            return(View(servicePhotoTitle));
        }