Quantcast
Channel: ASP.NET Core
Viewing all articles
Browse latest Browse all 9386

Call Action Method based on timer

$
0
0

I have two action method DayStart() and DayEnd() and I have to call DayStart()
at 8:05 am (Mon-Fri) and DayEnd() at 8:04 am (Mon-Fri) and for this the best option so far in Quartz.net but i don't know how do i call these two action method in jobExecution method is there any way to achieve this?

 public ActionResult StartDay()
        {
            int userid = Auth.UserID;
            daysServices.StartDay(userid);
            return RedirectToAction("Index", "Home", new { isdayClose = false });

        }
        public ActionResult CloseDay()
        {
            int userid = Auth.UserID;
            int dayId = daysServices.getActiveDay();
            int shiftId = daysServices.getActiveShift();
            daysServices.CLoseDay(dayId, userid, shiftId);           
            return RedirectToAction("TokenDayAmount", "Home", new { isdayClose = true });
        }
    public async Task Execute(IJobExecutionContext context)
        {
            await Console.Out.WriteLineAsync("HelloJob is executing.");
            //i hope something like this? DayStart();
        }


Or is there any other way to solve this kindly let me know


Viewing all articles
Browse latest Browse all 9386

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>