Пример #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            UploadDesign uploadDesign = db.UploadDesigns.Find(id);

            db.UploadDesigns.Remove(uploadDesign);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Пример #2
0
 public ActionResult Edit([Bind(Include = "UploadId,UploadName,PrintImage,PrintSizeId,PrintAreaId")] UploadDesign uploadDesign)
 {
     if (ModelState.IsValid)
     {
         db.Entry(uploadDesign).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.PrintAreaId = new SelectList(db.DesignAreas, "DesignAreaId", "AreaName", uploadDesign.PrintAreaId);
     ViewBag.PrintSizeId = new SelectList(db.DesignSizes, "DsizeId", "SizeName", uploadDesign.PrintSizeId);
     return(View(uploadDesign));
 }
Пример #3
0
        // GET: UploadDesigns/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            UploadDesign uploadDesign = db.UploadDesigns.Find(id);

            if (uploadDesign == null)
            {
                return(HttpNotFound());
            }
            return(View(uploadDesign));
        }
Пример #4
0
        // GET: UploadDesigns/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            UploadDesign uploadDesign = db.UploadDesigns.Find(id);

            if (uploadDesign == null)
            {
                return(HttpNotFound());
            }
            ViewBag.PrintAreaId = new SelectList(db.DesignAreas, "DesignAreaId", "AreaName", uploadDesign.PrintAreaId);
            ViewBag.PrintSizeId = new SelectList(db.DesignSizes, "DsizeId", "SizeName", uploadDesign.PrintSizeId);
            return(View(uploadDesign));
        }
Пример #5
0
        public ActionResult Create([Bind(Include = "UploadId,UploadName,PrintImage,PrintSizeId,PrintAreaId,Include")] UploadDesign uploadDesign, HttpPostedFileBase upload, FormCollection frm)
        {
            if (ModelState.IsValid)
            {
                UploadDesign Ud = new UploadDesign();

                Ud.Include = Ud.CheckRadio(frm);

                if (upload != null && upload.ContentLength > 0)
                {
                    int    fileLength = upload.ContentLength;
                    Byte[] array      = new Byte[fileLength];
                    upload.InputStream.Read(array, 0, fileLength);
                    uploadDesign.PrintImage = array;
                    db.UploadDesigns.Add(uploadDesign);
                    db.SaveChanges();
                    return(RedirectToAction("Thanks2"));
                }
            }

            ViewBag.PrintAreaId = new SelectList(db.DesignAreas, "DesignAreaId", "AreaName", uploadDesign.PrintAreaId);
            ViewBag.PrintSizeId = new SelectList(db.DesignSizes, "DsizeId", "SizeName", uploadDesign.PrintSizeId);
            return(View(uploadDesign));
        }