How to run a job in ASP.NET MVC? - asp.net

I'm writing an application ASP.NET MVC. I have some people records that expire after 2 year (their Status field changes to expired). I need to run a check daily to check for expired records. I do not have permission to create a job on the database, so i need to find a way to do it on my application.
Is there something equivalent to the database job or a workaround to let this run daily without any user intervention and without blocking the application ?

Please take a look at Quartz. I've used it in several projects to solve these kind of problems.
http://www.quartz-scheduler.net/

Nice article about Background Jobs in ASP.NET
http://www.hanselman.com/blog/HowToRunBackgroundTasksInASPNET.aspx
I really like HANGFIRE. Which is really easy to use and has nice front end for managing tasks.

You must be logged on as an administrator to perform these steps. If you aren't logged on as an administrator, you can only change settings that apply to your user account.
If you use a specific program on a regular basis, you can use the Task Scheduler wizard to create a task that opens the program for you automatically according to the schedule you choose.
Open Task Scheduler by clicking the Start button , clicking Control Panel, clicking System and Security, clicking Administrative Tools, and then double-clicking Task Scheduler. If you're prompted for an administrator password or confirmation, type the password or provide confirmation.
Click the Action menu, and then click Create Basic Task.
Type a name for the task and an optional description, and then click Next.
Do one of the following:
• To select a schedule based on the calendar, click Daily, Weekly, Monthly, or One time, click Next; specify the schedule you want to use, and then click Next.
• To select a schedule based on common recurring events, click When the computer starts or When I log on, and then click Next.
• To select a schedule based on specific events, click When a specific event is logged, click Next; specify the event log and other information using the drop-down lists, and then click Next.
To schedule a program to start automatically, click Start a program, and then click Next.
Click Browse to find the program you want to start, and then click Next.
Click Finish.
Reference

Related

How do I manually sync a Mesibo profile with latest changes from server if that user published its data with LAZY mode?

I made a page where users can update their names and status just like WhatsApp & Telegram.
These changes are published using LAZY mode since I don't want to update every user using the app right away. I just want to fetch it manually when necessary (for example when the user open the chat view with that user). (https://mesibo.com/documentation/api/real-time-api/profiles/#profile-publishing-mode)
The problem is: how can I fetch the updated profile of other users?
Whenever I get the profiles with Mesibo.getProfile("address") the data is still not updated.
since I don't want to update every user using the app right away.
Even if you use real-time mode, updates don't go to every user but only those users who have subscribed to it.
https://mesibo.com/documentation/api/real-time-api/profiles/#subscribing-to-a-profile
In lazy mode, it may be updated along with other profiles or when the message is received from the users. Before that, getProfile may not return the latest profile.
If you are starting with mesibo, recommend using real-time mode and optimizing later using the lazy mode

SP2013 Workflow Suspend

I am facing issue with work flow where Workflow goes to Suspend mode.
It is SP2013 Custom Workflow developed using Visual Studio 2012.Objective of the Custom workflow: User fills the form and submit, list get updated and workflow will initiate and go for the process.
Issue: After the deployment of WF, for first time when user is filling the form and submit, list is getting updated. But the Workflow Goes to "Suspend" mode. (
This Custom Workflow has a configuration file where we are providing other details including ID of Impersonator (farm is running under Claim Based Authentication).
Work flow works fine once when the Impersonator initiate the workflow (Fill the form and submit for approval) and everything works fine after that.
Click on the information icon next to the Suspended status. The error message should be listed there. If it is sitting in a suspended state saying Activity in Progress, this is usually an issue with the certificate chain between SharePoint and the Workflow Server.

Checking if the web appication is started/browsed for the first time in current date

I want to find out if my web app is started for the first time. I need to check it on daily basis so that i could send reminder emails.As soon as my app is browsed for the first time the mails should be sent.How to check it? Help Me..
Thanks in advance..
The best option for you is to create a database backend. You might even already have one to store user information.
Once you have that, you'll want to utilize the Page_Load event on either each individual page, or a master page if you have one. In that, you can update your database with the latest login time for the current user (or in this case, likely, the latest page view--you'll want to be wary of "remember me" situations if you're dealing with logins--and send your email as appropriate.

State managemet through session in online exam website

I am working on an asp.net application. "Online Examination".
my application will uses the concept of session to maintain the state of user who is giving the exam. , since in case browser shut down, system crash i do not want my user should start from the 1st question.
Infact, i want my user should start from where he left. Now i am not able to think on this.
How to test this. Is there any easy way so that i can simply test my concept.
CASE1: USER WANT TO QUIT FROM EXAM. SO HE/SHE CAN INTENTIONALLY CLOSE THE BROWSER.
CASE2: BY MISTAKE USER CLOSE THE BROWSER, SO WHEN HE RETURN BACK HE/SHE WILL START THE EXAM FROM WHERE HE/SHE LEFT.
he just have to enter the url> enter his exam id> continue the exam.
Plssss help me in this respect. give me some idea how to apply session management.
You cannot distinguish between Case1 and Case2. Typically in these scenarios there is a button on the web page like Logout or Finish that would mark the exam as completed. Simply closing the browser would mean that the exam is still in progress.
Also note that you cannot use standard Session state management - that lasts only while the browser is open. You have to store the exam progress data in a database based on the user's ID.
Use application variables so that we can easily remove this when the user suddenly closes the browser or tab.

Can workflow process be accomplished with asp.net?

We currently have workflow app built with infopath, sharepoint and bitztalk.
Basically, an empployee fills out a form, saves it and clicks "Forward to Manager"
His/her receives an email notification that a form is waiting in his/her queue to be completed.
Manager completes and forwards to next higher up.
The process continues until the final manager sign off and the process is now considered complete.
The cycle can begin again with new form.
The company hired a contractor to do this and is nowwhere to be found.
Unfortunately, we have no one inhouse with the knowledge to maintain this.
I have been asked to try and find out from you experts if it is possible to do this in asp.net.
If yes, can you please provide me with some links to get me started?
Many thanks in advance

Resources