コード例 #1
0
 public ActionResult DeleteConfirmed(int id)
 {
     Models.SendEmail sendEmail = db.SendEmail.Find(id);
     db.SendEmail.Remove(sendEmail);
     db.SaveChanges();
     return(RedirectToAction("Index"));
 }
コード例 #2
0
 public ActionResult Edit([Bind(Include = "Id,From,To,Text")] Models.SendEmail sendEmail)
 {
     if (ModelState.IsValid)
     {
         db.Entry(sendEmail).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(sendEmail));
 }
コード例 #3
0
        public ActionResult Create([Bind(Include = "Id,From,To,Text")] Models.SendEmail sendEmail)
        {
            Index(sendEmail);
            if (ModelState.IsValid)
            {
                db.SendEmail.Add(sendEmail);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(sendEmail));
        }
コード例 #4
0
 // GET: SendEmails/Edit/5
 public ActionResult Edit(int?id)
 {
     if (id == null)
     {
         return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
     }
     Models.SendEmail sendEmail = db.SendEmail.Find(id);
     if (sendEmail == null)
     {
         return(HttpNotFound());
     }
     return(View(sendEmail));
 }