示例#1
0
        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);
            }
        }
示例#2
0
 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);
     }
 }
示例#3
0
        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 }));
        }