public ActionResult Edit(tbl_Req_PDJMINI02 tbl_Req_PDJMINI02)
        {
            if (ModelState.IsValid)
            {
                var         email = Session["USER_EMAIL"].ToString();
                MailMessage mm    = new MailMessage();
                mm.To.Add("*****@*****.**");
                mm.From    = new MailAddress(email);
                mm.Subject = "การขอสิทธิ การใช้เครื่อง PDJMINI 02";

                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_PDJMINI02).State = EntityState.Modified;
                db.SaveChanges();
                return(RedirectToAction("Trace"));
            }
            return(View(tbl_Req_PDJMINI02));
        }
Exemplo n.º 2
0
 public ActionResult Edit(tbl_user tbl_user)
 {
     if (ModelState.IsValid)
     {
         db.Entry(tbl_user).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(tbl_user));
 }
Exemplo n.º 3
0
        public ActionResult Edit([Bind(Include = "INC_ID,INC_CODE,INC_DATE,INC_TOPIC,INC_REQUESTER,INC_OPEN_BY,INC_ASSIGN_TO,INC_STATUS,INC_CATEGORIES,INC_PRIORITY,INC_BILL_NO,INC_BILL_DATE,INC_OPEN_DATE,INC_DUE_DATE,INC_RESOLVE_DATE,INC_COST,INC_WARANTEE,INC_DESCRIPTION,INC_COMMENTS,USER_CREATE,USER_UPDATE,CREATE_DATE,UPDATE_DATE,upsize_ts,HW_CODE,INC_CLOSE_DATE,COST_ID,INC_SUBMIT_DATE,INC_ASSIGN_DATE,COST_SECTION,INC_CANCEL_DATE")] tbl_incident_case tbl_incident_case)
        {
            if (ModelState.IsValid)
            {
                db.Entry(tbl_incident_case).State = EntityState.Modified;
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(tbl_incident_case));
        }
Exemplo n.º 4
0
        public ActionResult Edit(tbl_req_sd tbl_req_sd)
        {
            if (ModelState.IsValid)
            {
                db.Entry(tbl_req_sd).State = EntityState.Modified;
                db.SaveChanges();
                ViewBag.EmpCount = tbl_req_sd.SD_CODE.ToString();
                var         email = Session["USER_EMAIL"].ToString();
                MailMessage mm    = new MailMessage();
                mm.To.Add("*****@*****.**");
                mm.From    = new MailAddress(email);
                mm.Subject = "แบบฟอร์มการขอและยกเลิกรหัสผู้ใช้ เพื่อการกำหนดเข้าสู่ Share 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);
                return(RedirectToAction("IndexSD"));
            }
            return(View(tbl_req_sd));
        }
        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));
        }