public static string SendEmail(string CandidatesID) { DBManagerHRIS dbMan = new DBManagerHRIS(); int[] MailTo = new int[50]; int TotalEmailID = 0; for (int i = 0; i < CandidatesID.Split(',').Length - 1; i++) { MailTo[i] = Convert.ToInt32(CandidatesID.Split(',')[i]); TotalEmailID++; } for (int Index = 0; Index < TotalEmailID; Index++) { Fn.SendEmail(Fn.GetRecords("SELECT EmailAddress FROM tbl_Candidates WHERE (CandidateID = " + MailTo[Index] + ")")[0], "Job Offer Letter", Fn.GetRecordCandidate(MailTo[Index]), Fn.GetRecords("SELECT distinct tbl_Company.CompanyEmail FROM tbl_Candidates INNER JOIN tbl_JobRequirements ON tbl_Candidates.RequirementID = tbl_JobRequirements.JobRequirementID inner join tbl_Company on tbl_Company.CompanyID = tbl_JobRequirements.CompanyID where tbl_Candidates.CandidateID = " + MailTo[Index])[0], dbMan.GetInterviewerPannelEmail(CandidatesID)); } return(string.Empty); }
public static string JoiningSaveData(string IsJoined, string JoiningRespoinsible, string EmailTo, string CandidateID) { DBManagerHRIS dbMan = new DBManagerHRIS(); DataTable dt = new DataTable(); int[] MailTo = new int[50]; int TotalEmailID = 0; for (int i = 0; i < EmailTo.Split(',').Length - 1; i++) { MailTo[i] = Convert.ToInt32(EmailTo.Split(',')[i]); TotalEmailID++; } for (int Index = 0; Index < TotalEmailID; Index++) { Fn.SendEmail(Fn.GetRecords("Select Email from TblHResources where User_ID = " + MailTo[Index])[0], "New Joining", dbMan.JoiningEmailBody(CandidateID), Fn.GetRecords("Select Email from TblHResources where User_ID = " + UserID)[0], dt); } Fn.Exec("UPDATE tbl_SelectedCandidates SET Is_Joined = '" + IsJoined + "', JoiningResponsible = '" + JoiningRespoinsible + "', JoiningEmail = 1, JoiningEntryDate = GETDATE() where SelectedCandidateID = " + CandidateID); return(Fn.Exec("INSERT INTO tbl_JoiningOrentationMail (JoiningOrientation, MailTo, MaiFrom, CandidateSelectedID, EntryDate) Select 'Joining', items, '" + UserID + "', '" + CandidateID + "', GETDATE() from SplitString('" + EmailTo + "', ','); ")); }