how to execute a task on monday in windows application

May 11 2016 2:07 AM
how to execute a task on monday in windows application..here below my code i want to exceute this logic exceute every monday automatically..how we use timer in this approach..plz dnt give me links ..just send code 
 
private void Form1_Load(object sender, EventArgs e)
{
DataClasses1DataContext db = new DataClasses1DataContext();
EmailConfig ec = new EmailConfig();
var ss= db.Employees.ToList();
// var ds = db.EmpProfessionalDetails.ToList();
// var data = ss.Select(sss => sss.Email).ToList();
var msgsubject = "Remaind employees to complete Timesheet";
var subge= " Timesheet Remainder";
var data = (from u in ss
select new
{
Email = u.Email,
Empid = u.EmpId,
CompanyId = u.CompanyId,
Empname = u.Name,
}).ToList();
foreach (var h in data)
{
ec.SendRemainderMail("[email protected]", h.Email, subge, msgsubject, h.Empname);
}
var holidays = db.EmpHolidays.Where(eh => eh.CompanyId == 1 && eh.IsActive == true).ToList();
var Empleaves = db.EmpLeaves.Where(kk => kk.CompanyId == 1 && kk.IsApproved == true).ToList();
var sss = db.EmpTimesheetMasters.ToList();
}
 

Answers (5)