コード例 #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            SEELahoreTeam sEELahoreTeam = db.SEELahoreTeams.Find(id);

            db.SEELahoreTeams.Remove(sEELahoreTeam);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
コード例 #2
0
        // GET: SEELahoreTeams/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            SEELahoreTeam sEELahoreTeam = db.SEELahoreTeams.Find(id);

            if (sEELahoreTeam == null)
            {
                return(HttpNotFound());
            }
            return(View(sEELahoreTeam));
        }
コード例 #3
0
        // GET: SEELahoreTeams/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            SEELahoreTeam sEELahoreTeam = db.SEELahoreTeams.Find(id);

            if (sEELahoreTeam == null)
            {
                return(HttpNotFound());
            }
            ViewBag.CreatedBy = new SelectList(db.AspNetUsers, "Id", "Email", sEELahoreTeam.CreatedBy);
            return(View(sEELahoreTeam));
        }
コード例 #4
0
 public ActionResult Edit([Bind(Include = "Id,CreatedBy,CreatedAt,ContactNo,Email,Name,Designation,Photo")] SEELahoreTeam sEELahoreTeam, HttpPostedFileBase Photo)
 {
     if (ModelState.IsValid)
     {
         if (Photo != null && Photo.ContentLength > 0)
         {
             var fileName = Path.GetFileName(Photo.FileName);
             var path     = Path.Combine(Server.MapPath("~/UploadedImages/"), fileName);
             Photo.SaveAs(path);
             sEELahoreTeam.Photo = fileName;
         }
         sEELahoreTeam.CreatedAt       = DateTime.Now;
         sEELahoreTeam.CreatedBy       = User.Identity.GetUserId();
         db.Entry(sEELahoreTeam).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.CreatedBy = new SelectList(db.AspNetUsers, "Id", "Email", sEELahoreTeam.CreatedBy);
     return(View(sEELahoreTeam));
 }