public ActionResult DeleteConfirmed(string id) { tbl_Req_Nav tbl_Req_Nav = db.tbl_Req_Nav.Find(id); db.tbl_Req_Nav.Remove(tbl_Req_Nav); db.SaveChanges(); return(RedirectToAction("Index")); }
// GET: tbl_Req_Nav/Delete/5 public ActionResult Delete(string id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } tbl_Req_Nav tbl_Req_Nav = db.tbl_Req_Nav.Find(id); if (tbl_Req_Nav == null) { return(HttpNotFound()); } return(View(tbl_Req_Nav)); }
// GET: tbl_Req_Nav/Edit/5 public ActionResult Edit(string id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } tbl_Req_Nav tbl_Req_Nav = db.tbl_Req_Nav.Find(id); if (tbl_Req_Nav == null) { return(HttpNotFound()); } ViewData["Allow_STATUS"] = new SelectList(db.tbl_req_allow_status, "Allow_STATUS", "Allow_DESCRIPTION", tbl_Req_Nav.Allow_STATUS); ViewData["SECTION_ID"] = new SelectList(db.tbl_section, "SECTION_ID", "SECTION_DESC", tbl_Req_Nav.SECTION_ID); return(View(tbl_Req_Nav)); }
public ActionResult Edit(tbl_Req_Nav tbl_Req_Nav) { if (ModelState.IsValid) { var email = Session["USER_EMAIL"].ToString(); MailMessage mm = new MailMessage(); mm.To.Add("*****@*****.**"); mm.From = new MailAddress(email); mm.Subject = "การขอสิทธิและแก้ไขเพิ่มเติมการใช้ระบบ NAV"; mm.IsBodyHtml = true; mm.Body = GetFormattedMessageIT(); SmtpClient smtp = new SmtpClient(); smtp.Host = "mail01.pranda.co.th"; smtp.Port = 25; smtp.EnableSsl = false; smtp.UseDefaultCredentials = true; smtp.Credentials = new System.Net.NetworkCredential(); System.Net.ServicePointManager.ServerCertificateValidationCallback = delegate(object s, System.Security.Cryptography.X509Certificates.X509Certificate certificate, System.Security.Cryptography.X509Certificates.X509Chain chain, System.Net.Security.SslPolicyErrors sslPolicyErrors) { return(true); }; smtp.Send(mm); db.Entry(tbl_Req_Nav).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Trace")); } return(View(tbl_Req_Nav)); }