public void SendMailToParticipatedUser(DataTable particaipateduserTable)
        {
            try
            {
                RegisteredVolunteerRepository registeredVolunteerRepository = new RegisteredVolunteerRepository();
                foreach (DataRow row in particaipateduserTable.Rows)
                {
                    string body    = "";
                    string subject = "";
                    if (!row.IsNull("Employee ID") && !row.IsNull("Event ID"))
                    {
                        RegisteredVolunteer registeredVolunteer = registeredVolunteerRepository.GetRegisteredVolunteerByAssociateID(row["Employee ID"].ToString());
                        Event outreachEvent = eventRepository.FindEvent(row["Event ID"].ToString());

                        if (registeredVolunteer != null && outreachEvent != null)
                        {
                            string Creds   = outreachEvent.EventId + "\n" + registeredVolunteer.EmployeeID + "\n" + ConstantValues.Participated;
                            string encrypt = AESCrypt.EncryptString(Creds);
                            string url     = ConfigurationManager.AppSettings["URL"].ToString() + "Feedback?FeedbackValue=" + encrypt + "";

                            subject = "Feedback for {0} Dated {1}";
                            subject = string.Format(subject, outreachEvent.EventName, outreachEvent.EventDate.Value.ToShortDateString());

                            body = new System.IO.StreamReader(HttpContext.Current.Server.MapPath("~/MailTemplate/Participate_Mail.html")).ReadToEnd();
                            body = body.Replace("{UserName}", string.IsNullOrEmpty(registeredVolunteer.EmployeeName) ? "-" : registeredVolunteer.EmployeeName)
                                   .Replace("{EventName}", string.IsNullOrEmpty(outreachEvent.EventName) ? "-" : outreachEvent.EventName)
                                   .Replace("{EventDate}", string.IsNullOrEmpty(outreachEvent.EventDate.Value.ToShortDateString()) ? "-" : outreachEvent.EventDate.Value.ToShortDateString())
                                   .Replace("{Url}", string.IsNullOrEmpty(url) ? "-" : url);

                            SendMail(subject, body, ConfigurationManager.AppSettings["CommonMail"].ToString());
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                ExceptionLogger logger = new ExceptionLogger()
                {
                    ControllerName      = "OutreachMail",
                    ActionrName         = "SendMailToParticipatedUser",
                    ExceptionMessage    = ex.Message,
                    ExceptionStackTrace = ex.StackTrace,
                    LogDateTime         = DateTime.Now
                };
                ExceptionRepository exceptionRepository = new ExceptionRepository();
                exceptionRepository.AddException(logger);
            }
        }
 private void InsertParticipatedUserDetails(DataTable particaipateduserTable)
 {
     try
     {
         foreach (DataRow row in particaipateduserTable.Rows)
         {
             RegisteredVolunteer registeredVolunteer = new RegisteredVolunteer();
             registeredVolunteer.EventId = row["Event ID"].ToString();
             if (!row.IsNull("Employee ID"))
             {
                 registeredVolunteer.EmployeeID = row["Employee ID"].ToString();
             }
             if (!row.IsNull("Employee Name"))
             {
                 registeredVolunteer.EmployeeName = row["Employee Name"].ToString();
             }
             if (!row.IsNull("Business Unit"))
             {
                 registeredVolunteer.BusinessUnit = row["Business Unit"].ToString();
             }
             if (!row.IsNull("Volunteer Hours"))
             {
                 registeredVolunteer.VolunteerHours = Convert.ToInt32(row["Volunteer Hours"]);
             }
             if (!row.IsNull("Travel Hours"))
             {
                 registeredVolunteer.TravelHours = Convert.ToInt32(row["Travel Hours"]);
             }
             RegisteredVolunteerRepository registeredVolunteerRepository = new RegisteredVolunteerRepository();
             registeredVolunteerRepository.AddRegisteredVolunteer(registeredVolunteer);
         }
         outreachMail.SendMailToParticipatedUser(particaipateduserTable);
     }
     catch (Exception ex)
     {
         ExceptionLogger logger = new ExceptionLogger()
         {
             ControllerName      = "ExcelToDB",
             ActionrName         = "InsertParticipatedUserDetails",
             ExceptionMessage    = ex.Message,
             ExceptionStackTrace = ex.StackTrace,
             LogDateTime         = DateTime.Now
         };
         ExceptionRepository exceptionRepository = new ExceptionRepository();
         exceptionRepository.AddException(logger);
     }
 }