public WorkFlowInstanceList GetWorkFlowInstances() { //WindowsPrincipal principal = (WindowsPrincipal)Thread.CurrentPrincipal; //WindowsIdentity identity = (WindowsIdentity)principal.Identity; //TrackingLog.Log(identity.Name); WorkFlowInstanceList l = new WorkFlowInstanceList(); try { TrackingDataContext dataContext = new TrackingDataContext(); IQueryable <CommonResource.Tracking> trackingQuery = from tracking in dataContext.Trackings select tracking; foreach (CommonResource.Tracking t in trackingQuery) { using (TrackingWorkFlowInteraction interaction = new TrackingWorkFlowInteraction()) { WorkFlowInstance wfi = new WorkFlowInstance(); wfi.BugId = t.bugid; wfi.Id = t.wfinstanceid.ToString(); wfi.Title = t.title; wfi.WFName = t.wfname; wfi.LastModified = t.lastmodified.ToString(); wfi.QFEStatus = t.qfestatus; wfi.AssignedTo = t.assignedto; wfi.LastModified = t.lastmodified == null ? "N/A" : t.lastmodified.Value.ToString(); wfi.LastModifiedBy = t.lastmodifiedby; // //List<string> candiCmds = interaction.getCandidateCommands(t.wfname.Trim(), t.wfinstanceid.ToString()); //CandidateCommandList ccl = new CandidateCommandList(); //if (candiCmds != null) //{ // foreach (string cmd in candiCmds) // { // ccl.Add(cmd); // } //} //wfi.CandidateCommandList = ccl; l.Add(wfi); } } } catch (Exception e) { TrackingLog.Log(e.ToString() + "!!" + e.Message); } return(l); }
public WorkFlowInstanceList GetWorkFlowInstances() { //WindowsPrincipal principal = (WindowsPrincipal)Thread.CurrentPrincipal; //WindowsIdentity identity = (WindowsIdentity)principal.Identity; //TrackingLog.Log(identity.Name); WorkFlowInstanceList l = new WorkFlowInstanceList(); try { TrackingDataContext dataContext = new TrackingDataContext(); IQueryable<CommonResource.Tracking> trackingQuery = from tracking in dataContext.Trackings select tracking; foreach (CommonResource.Tracking t in trackingQuery) { using (TrackingWorkFlowInteraction interaction = new TrackingWorkFlowInteraction()) { WorkFlowInstance wfi = new WorkFlowInstance(); wfi.BugId = t.bugid; wfi.Id = t.wfinstanceid.ToString(); wfi.Title = t.title; wfi.WFName = t.wfname; wfi.LastModified = t.lastmodified.ToString(); wfi.QFEStatus = t.qfestatus; wfi.AssignedTo = t.assignedto; wfi.LastModified = t.lastmodified == null ? "N/A" : t.lastmodified.Value.ToString(); wfi.LastModifiedBy = t.lastmodifiedby; // //List<string> candiCmds = interaction.getCandidateCommands(t.wfname.Trim(), t.wfinstanceid.ToString()); //CandidateCommandList ccl = new CandidateCommandList(); //if (candiCmds != null) //{ // foreach (string cmd in candiCmds) // { // ccl.Add(cmd); // } //} //wfi.CandidateCommandList = ccl; l.Add(wfi); } } } catch (Exception e) { TrackingLog.Log(e.ToString() + "!!" + e.Message); } return l; }