Esempio n. 1
0
        /// <summary>
        /// To Retun the Delegation List Based on the Type
        /// </summary>
        /// <param name="Type">Delegation or Sharing</param>
        /// <returns></returns>
        public string WorklistAction(string UserId, string SN, string ActionName, string Comment, string forwardUserID)
        {
            string result = "";

            try
            {
                if (!string.IsNullOrEmpty(forwardUserID))
                {
                    int    underScorePos     = SN.IndexOf("_");
                    string procInstID        = SN.Substring(0, underScorePos);
                    var    forwardUserInfo   = Db.VW_EMPLOYEE.Where(p => p.UserID == forwardUserID).FirstOrDefault();
                    var    actionTakerRecord = Db.RequestFormTaskActioners.Where(p => p.ProcInstID.ToString() == procInstID).FirstOrDefault();
                    if (!string.IsNullOrEmpty(actionTakerRecord.ActionTakerUserID))
                    {
                        actionTakerRecord.ActionTakerUserID     = forwardUserInfo.UserID;
                        actionTakerRecord.ActionTakerEmployeeID = forwardUserInfo.EmployeeID;
                        actionTakerRecord.ActionTakerFullName   = forwardUserInfo.FullName;
                        actionTakerRecord.ActionTakerDeptName   = forwardUserInfo.DEPT;
                        Db.SaveChanges();
                    }
                }
                WorkflowFacade workfacade = new WorkflowFacade();
                workfacade.ExecuteAction(UserId, SN, ActionName, Comment);
                result = "Success";
            }
            catch (Exception ex)
            {
                result = "Failed";
                throw ex;
            }

            return(result);
        }
Esempio n. 2
0
        public string RecallAction(string UserId, string ProcInstID, string ActionName, string Comment)
        {
            string result = "";

            try
            {
                WorkflowFacade workfacade = new WorkflowFacade();
                WorklistItem   worklist   = workfacade.GetWorklistItemsWithRecallByProcess(UserId, ProcInstID, "Applicant Recall");
                if (worklist != null)
                {
                    workfacade.ExecuteAction(UserId, worklist.SN, ActionName, Comment);
                    result = "Success";
                }
                else
                {
                    result = "Failed";
                    throw new System.ArgumentException("Unable to recall the task");
                }
            }
            catch (Exception ex)
            {
                result = "Failed";
                throw ex;
            }

            return(result);
        }