public void SaveSignData(IEnumerable <WFTrackerTable> trackerTables, TrackerType trackerType) { ApplicationUser userTable = _AccountService.FirstOrDefault(x => x.UserName == HttpContext.Current.User.Identity.Name); foreach (var trackerTable in trackerTables) { trackerTable.SignDate = DateTime.UtcNow; trackerTable.SignUserId = userTable.Id; trackerTable.TrackerType = trackerType; _WorkflowTrackerService.SaveDomain(trackerTable); } }
public void CreateTrackerRecord(DocumentState step, Guid documentId, string bookmarkName, List <WFTrackerUsersTable> listUser, string currentUser, string activityId, bool useManual, int slaOffset, bool executionStep) { if ((step != DocumentState.Cancelled) && (step != DocumentState.Closed)) { WFTrackerTable trackerTable = _WorkflowTrackerService.FirstOrDefault(x => x.ActivityID == activityId && x.DocumentTableId == documentId); trackerTable.ActivityName = bookmarkName.Replace(keyForStep, ""); trackerTable.Users = listUser; trackerTable.TrackerType = TrackerType.Waiting; trackerTable.ManualExecutor = useManual; trackerTable.SLAOffset = slaOffset; trackerTable.ExecutionStep = executionStep; _WorkflowTrackerService.SaveDomain(trackerTable, currentUser); } }
public ActionResult AddExecutor(Guid id, string activityId, string[] listdata, bool?isAjax) { if (isAjax == true) { WFTrackerTable tracker = _WorkflowTrackerService.FirstOrDefault(x => x.DocumentTableId == id && x.ActivityID == activityId); if (tracker != null) { ApplicationUser userTable = _AccountService.FirstOrDefault(x => x.UserName == User.Identity.Name); if (userTable == null) { return(HttpNotFound()); } foreach (string data in listdata) { if (tracker.Users.Exists(x => x.UserId == data) == false) { _EmailService.SendNewExecutorEmail(id, data); } } tracker.Users.RemoveAll(x => x.InitiatorUserId != null); if (listdata != null) { foreach (string data in listdata) { tracker.Users.Add(new WFTrackerUsersTable { UserId = data, InitiatorUserId = userTable.Id }); } } _WorkflowTrackerService.SaveDomain(tracker); } } return(RedirectToAction("ShowDocument", new { id = id })); }