public async Task <IActionResult> PutMovie(SoftwareDownload Software)
        {
            _context.Entry(Software).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                throw;
            }

            return(NoContent());
        }
        public async Task <ActionResult <SoftwareDownload> > PostSoftwareEMPAsync(SoftwareDownload data)
        {
            SMTPmail smptpMail = new SMTPmail(data);

            smptpMail.EmployeeSendRequest();
            smptpMail.TLRequest();


            _context.softwareDownloadsystem.Add(data);

            await _context.SaveChangesAsync();



            return(CreatedAtAction("Success ", new { id = data.ID }, data));
        }
        public async Task <ActionResult <SoftwareDownload> > PostSoftwareNSDAsync(SoftwareDownload data)
        {
            _context.softwareDownloadsystem.Add(data);

            await _context.SaveChangesAsync();

            SMTPmail smptpMail = new SMTPmail(data);

            if (data.NSD_Response_Status == "Accepted")
            {
                smptpMail.NSDAcceptRequest();       //Link sent to employee
            }
            else
            {
                smptpMail.NSDRejectRequest();    //Link not Found!! to TL and employee
            }


            return(CreatedAtAction("Success ", new { id = data.ID }, data));
        }
        public async Task <ActionResult <SoftwareDownload> > PostSoftwareTLAsync(SoftwareDownload data)
        {
            _context.softwareDownloadsystem.Add(data);

            await _context.SaveChangesAsync();

            SMTPmail smptpMail = new SMTPmail(data);


            if (data.Team_Lead_Status == "Approved")
            {
                smptpMail.TLApproveRequest();   // Request forwarded to NSD and approval mail sent to employee
            }
            else
            {
                smptpMail.TLRejectRequest();    //Rejection mail to Employee
            }

            return(CreatedAtAction("Success ", new { id = data.ID }, data));
        }
        public SMTPmail(SoftwareDownload softwareDownload)
        {
            this.softwareDownload = softwareDownload;

            //Fetching Settings from WEB.CONFIG file.

            /*  string emailSender = ConfigurationManager.AppSettings["username"];
             * string emailSenderPassword = ConfigurationManager.AppSettings["password"];*/



            message = new MailMessage(to, from);

            message.IsBodyHtml = true;


            System.Net.NetworkCredential basicCredential1 = new
                                                            System.Net.NetworkCredential("*****@*****.**", "qwerty1029");

            client.EnableSsl             = true;
            client.UseDefaultCredentials = true;
            client.Credentials           = basicCredential1;
        }