Example #1
0
 protected void btnACStop_Click(object sender, EventArgs e)
 {
     try
     {
         WorkflowRuntime  workflowRuntime = (WorkflowRuntime)Application["WokflowRuntime"];
         WorkflowInstance instance        = workflowRuntime.GetWorkflow(new Guid(Application["AttendanceWF"].ToString()));
         instance.Resume();
         objAttendanceCheckerService = (AttendanceCheckerService)workflowRuntime.GetService(typeof(AttendanceCheckerService));
         objAttendanceCheckerService.RaiseStopEvent(instance.InstanceId);
         Application["AttendanceWF"]       = "";
         btnACStart.Enabled                = true;
         btnACStop.Enabled                 = false;
         btnOnDemandAttendencCheck.Enabled = false;
     }
     catch (V2Exceptions ex)
     {
         throw;
     }
     catch (System.Exception ex)
     {
         Application["AttendanceWF"] = "";
         FileLog objFileLog = FileLog.GetLogger();
         objFileLog.WriteLine(LogType.Error, ex.Message, "LeaveApplicationForm.aspx.cs", "StartWorkflow", ex.StackTrace);
         throw new V2Exceptions(ex.ToString(), ex);
     }
 }