public ActionResult Edit(tbl_Req_SharDrive tbl_Req_SharDrive) { if (ModelState.IsValid) { var email = Session["USER_EMAIL"].ToString(); MailMessage mm = new MailMessage(); mm.To.Add("*****@*****.**"); mm.From = new MailAddress(email); mm.Subject = "การขอสิทธิและยกเลิกรหัสผู้ใช้เพื่อเข้าสู่ Shar Drive"; 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_SharDrive).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Trace")); } return(View(tbl_Req_SharDrive)); }
public ActionResult DeleteConfirmed(string id) { tbl_Req_SharDrive tbl_Req_SharDrive = db.tbl_Req_SharDrive.Find(id); db.tbl_Req_SharDrive.Remove(tbl_Req_SharDrive); db.SaveChanges(); return(RedirectToAction("Index")); }
// GET: tbl_Req_SharDrive/Delete/5 public ActionResult Delete(string id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } tbl_Req_SharDrive tbl_Req_SharDrive = db.tbl_Req_SharDrive.Find(id); if (tbl_Req_SharDrive == null) { return(HttpNotFound()); } return(View(tbl_Req_SharDrive)); }
// GET: tbl_Req_SharDrive/Edit/5 public ActionResult Edit(string id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } tbl_Req_SharDrive tbl_Req_SharDrive = db.tbl_Req_SharDrive.Find(id); if (tbl_Req_SharDrive == null) { return(HttpNotFound()); } ViewData["Allow_STATUS"] = new SelectList(db.tbl_req_allow_status, "Allow_STATUS", "Allow_DESCRIPTION", tbl_Req_SharDrive.Allow_STATUS); ViewData["ID_Authen"] = new SelectList(db.tbl_Req_Authen, "ID_Authen", "Authen_DESCRIPTION", tbl_Req_SharDrive.ID_Authen); return(View(tbl_Req_SharDrive)); }