Sending alert to pages in asp.net - asp.net

I am working on web application , in my project there is some type of testing and task assignment to employees.
Now when an employee complete a task and assigned to a user the user automatically get the message on his page ( there is 3 user accessing application , one is admin , second is tester and third is verifier ...both of them works on different pages , now when admin assign a task the tester automatically get a notification " new message " ( for this i am using master page)..on whatever page the tester is on working... now if the tester is completes it 's task and assign to verifier , verifier must get notification "new message" ... and so on..)
for this a have put a button on master page ..and also i have make a windows service that runs on every minute , now my problem is how i sent the message from windows service to my master page button ( that i change text of button).
Is this idea working ?

Why do you need to window service to run in background? Is there any specific reason to have the windows service for these requirements?
As per your detailed description what I understood is that when the employee completes a task and assigned to a user the user automatically get the message on his page. So when the employee is working and completed means they will click on some button that their work is completed. Then while clicking on the button, you just write the code for sending the mail to the tester. like the same way, when the tester is completed their work and click on the testing completes, send a mail to the reviewer and so on..Then where is the need to have a window service for this to send the mails?
All the requirements can be achieved through the simple send mail code.
Let us know if you need any more help or if you don't understand the exact scenario or if anything is missing in the requirements.
Hope it will be helpful to you.

I don't think it is possible to send from a windows service informations to asp.page. You can create a button that can query a webservice about new tasks (but you are counting on the user to press it).
Another more "friendly" way is to have a timer in javascript that uses ajax requests to get new tasks.

Related

Send HTTP request when a computer is added to Active Directory

I'm going to start working with Active Directory (first time in my life) with python ldap3 library. I've searched the internet for a while but couldn't find any solution for my question. I want to send a request when a computer is added to AD. I've found this event that might solve my problem but I've no idea what is this or how can I use this for my problem.
Thanks for answers.
That is an event in the Windows Security Event Log on the domain controller.
Windows does allow you to trigger a scheduled task on an event. To do what you want to do, you could set up a scheduled task on each domain controller.
In Task Scheduler:
Click "Create Task"
Click the "Triggers" tab, then "New..."
For "Begin the task", select "On an event"
In "Log", select "Security, and for "Event ID" put "4741"
Click "OK"
Then on the "Actions" tab is where you tell it what you want it to do when that event happens. You can run anything you want. You can write a PowerShell script if you want. Just search Google for "run PowerShell script from scheduled task" if that's the way you want to go.

Find out the transport request of an application

I Have created a application, in SAP ABAP and also I have generated a request number for that application, no I have forgot which is my request number since there are many requests in development server.
So, can someone help me how I can find out my request number, from my application.
Either you start transaction SE10, if necessary enter your user name (should be there by default) and hit Enter. You'll get a complete list if your transports, you just have to find the one, you need.
Or you start the transaction where you developed your application (you did not specify, if it is a program than SE38 or SE80, if it is a function module than SE37, SE24 for classes, etc (however in SE80 you can see everything)) enter the program name and go to menu: Goto / Object directory entry, a popup comes up, now click the button 'Lock overview'. Another popup comes up and tells you, which transport contains your object.
Steps to Identify all the request numbers of an object/application.
Open 'SE38'.
Provide your object/application name.
Click on 'Display Button'.
In the Menu bar click on 'Utilities'.
Click on 'Versions' --> 'Version Management'.
Now we can find all the request numbers of that object/application.

How to get the user who initiated the process in IBM BPM 8.5?

How to get the user who initiated the process in IBM BPM 8.5. I want to reassign my task to the user who actually initiated the process. How it can be achieved in IBM BPM?
There are several ways to get that who initiated a Task , But who initiated a process Instance is somewhat different.
You can perform one out of the following :
Add a private variable and assign it tw.system.user_loginName at the POST of start. you can access that variable for user who initiated the process.(It will be null or undefined for the scenario if task is initiated by some REST API or UCA.)
Place a Tracking group after Start event . Add a input variable to it as username , assign it a value same as tw.system.user_loginName. So whenever Process is started entry will be inserted to DB Table.You can retrieve this value from that view in PerformanceDB.
Also there might be some table ,logging the process Instances details , where you can find the user_id directly.
I suggest you to look in getStarter() method of ProcessInstanceData API.
Official Documentation on API
This link on IBM Developerworks should help you too: Process Starter
Unfortunately there's not an Out Of The Box way to do this - nothing is recorded in the Process Instance that indicates "who" started a process. I presume this is because there are many ways to launch a process instance - from the Portal, via a Message Event, from an API call, etc.
Perhaps the best way to handle this is to add a required Input parameter to your BPD, and supply "who" started the process when you launch it. Unfortunately you can't supply any inputs from the OOTB Portal "New", but you can easilty build your own "launcher".
If you want to route the first task in process to the user that started the process the easiest approach is to simply put the start point in the lane, and on the activity select routing to "Last User In Lane". This will take care of the use case for you without requiring that you do the book keeping to track the user.
Its been a while since I've implemented this, so I can't remember if it will work elegantly if you have system steps before the first task, but this can easily be handled by moving the system steps into the human service to be executed as part of that call, rather than as a separate step in the BPD.
Define variable as string type and using script task to define the login user that use this task and assign it to your defined variable to keep to you in all of the process as initiator of the task.
You can use this line of code to achieve the same:
tw.system.user_loginName

How to send only one email when error occurs in aspx.net

So I have an aspx application that generates an error when the database goes down. I would like the application to send one and only one error when this occurs. Otherwise if multiple users hit the application I could get tons of emails, especially because the page refreshes.
I don’t want to use a database because that may be the reason for the error. I tried using a session variable, but it didn’t work. Any ideas?
My session variable code:
'We only want to send out this email if we it has not yet been sent this session
If Session("AlreadySentStaleDBemail") Is Nothing Then
SendEmailToTeam("The Results Database has not inserted any entries in over 60 minutes.")
Session("AlreadySentStaleDBemail") = "email sent already"
End If
Try using an application variable:
Application("AlreadySentStaleDBemail")

Stop Processing Of ASP.Net Web Form on Opening an Exe

In my ASP.net application, i have to open a EXE on click of button. When the EXE is open, User should not be allowed to perform any action on the web form, i.e. the exe should behave like a modal popup. I am using the current code to open and return value from EXE.
Dim p As Process
p = Process.Start("D:\VS2010Projects\SignatureCaptureWindows\bin\Debug\SignatureCaptureWindows.exe")
p.WaitForExit()
If (Not p.ExitCode.Equals(0)) Then
Response.Write("Image Successfully saved in Database with ID = " + p.ExitCode.ToString())
DisplaySavedImage(p.ExitCode)
End If
The Exe is opening fine and returning the correct value. However, the user is able to perform action on the web form when the exe is open...
What will be the best way to handle such a scenario ??
Its impossible to do the way you won it. From the moment the user send a submit, or try to open the page, and on code behind you run this exe, then user is wait for the results - in this time you can not make the user to not do anything else - you can not lock the browser, user can close it, reload it, open again the same page, etc.
What you can do is to lock this process using Mutex and not allow to run again if all ready run it.
Mutex on msdn with example : http://msdn.microsoft.com/en-us/library/system.threading.mutex.aspx

Resources