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