コード例 #1
0
        /*====================================================*/

        public virtual int ValidateUploads(cWfTaskAssignment aWfTaskAssignment, XmlElement aValidationItemNode)
        {
            cDataObjectList aSubmittedFileList;
            cDataObjectList aProjectTaskUploadsList;
            XmlElement      aResultEl;
            string          aWfProjectTaskUploadID;
            String          aMessage    = "";
            int             aResultCode = 0;

            aProjectTaskUploadsList = aWfTaskAssignment.GetRelatedPropertyDataObjectList("WfProjectTask.TaskUploadType");
            foreach (cDataObject aUploadDO in aProjectTaskUploadsList)
            {
                //Checking if grantee primary organization's eligibility is status is one of the project task upload eligbility status's
                int             aPrimaryOrgEligStatusID     = aWfTaskAssignment.GetRelatedPropertyInt("Person.PersonPrimaryAffiliation.Organization.EligibilityStatusID", 0);
                cDataObjectList aWfProjectTaskUploadEligDOL = aUploadDO.GetRelatedPropertyDataObjectList("WfProjectTaskUploadOrganizationEligibility");
                bool            aIsOrgEligible = false;
                foreach (cDataObject aWfProjectTaskUploadEligDO in aWfProjectTaskUploadEligDOL)
                {
                    if (aWfProjectTaskUploadEligDO.GetPropertyInt("OrganizationEligibilityID", -1) == aPrimaryOrgEligStatusID)
                    {
                        aIsOrgEligible = true;
                    }
                }
                if (aIsOrgEligible)
                {
                    continue;
                }
                aWfProjectTaskUploadID = aUploadDO.GetPropertyString("WfProjectTaskUploadID", "0");
                bool IsRequired   = aUploadDO.GetPropertyBool("IsRequired", false);
                int  UploadStatus = EvaluateUploadItem(aWfProjectTaskUploadID, aWfTaskAssignment.GetPropertyString("WfTaskAssignmentID", "0"), IsRequired);
                if (UploadStatus == -1 || UploadStatus == 0)
                {
                    if (IsRequired)
                    {
                        aMessage = aMessage + aUploadDO.GetRelatedPropertyString("Upload.UploadName") + " was not uploaded or file conversion was not successful.<br />";
                    }
                    else
                    {
                        aMessage = aMessage + aUploadDO.GetRelatedPropertyString("Upload.UploadName") + " file conversion was not successful.<br />";
                    }
                    aResultCode = 3;
                }
            }
            if (aResultCode == 3)
            {
                aResultEl = cXMLDoc.GetResultElement(aValidationItemNode, aResultCode);
                if (aResultEl != null)
                {
                    cXMLDoc.SetValidationResultMessage(ref aResultEl, aMessage);
                }
                return(aResultCode);
            }
            else
            {
                return(1);
            }
        }
コード例 #2
0
        /*-----------------------------------------------------*/

        public bool Get_SubmissionModulePage_Submitted()
        {
            cWfTaskAssignment aWfTaskAssignment = (cWfTaskAssignment)WebSession.DataObjectFactory.GetDataObjectFromPrimaryKey("WfTaskAssignment", WfTaskAssignmentID);

            if (aWfTaskAssignment.GetPropertyInt("WfTaskStatusID") == 2)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
コード例 #3
0
        /*-----------------------------------------------------*/

        public virtual void Submit_UpdateData(cXMLDoc aOutcomeConfigDoc)
        {
            cWfTaskAssignment aWfTaskAssignment = (cWfTaskAssignment)WebSession.DataObjectFactory.GetDataObjectFromPrimaryKey("WfTaskAssignment", WfTaskAssignmentID);

            aWfTaskAssignment.RaiseProcessEvents = true;     //flag to raise pre and post submission processing events
            cDataObject aSubmissionHistory = null;

            if (WebAppl.CreateSubmissionHistory)
            {
                aSubmissionHistory = WebSession.DataObjectFactory.CreateNewDataObjectFromKey("SubmissionHistory");
                aSubmissionHistory["WfTaskAssignmentID"] = WfTaskAssignmentID;
                aSubmissionHistory["WfTaskID"]           = aWfTaskAssignment.GetPropertyInt("WfTaskID");
                aSubmissionHistory["PersonID"]           = aWfTaskAssignment.GetPropertyInt("PersonID");
                //aSubmissionHistory["StartDate"] = (System.DateTime)aWfTaskAssignment.GetPropertyValue("StartDate");
                aSubmissionHistory["OpenDate"]  = aWfTaskAssignment.GetPropertyValue("OpenDate");
                aSubmissionHistory["DueDate"]   = aWfTaskAssignment.GetPropertyValue("DueDate");
                aSubmissionHistory["CloseDate"] = aWfTaskAssignment.GetPropertyValue("CloseDate");
                //aSubmissionHistory["EndDate"] = (System.DateTime)aWfTaskAssignment.GetPropertyValue("EndDate");
                aSubmissionHistory["PreWfTaskStatusID"] = aWfTaskAssignment.GetPropertyValue("WfTaskStatusID");
                aSubmissionHistory.SaveData();
            }
            aWfTaskAssignment["WfTaskStatusID"] = 2;
            aWfTaskAssignment["SubmittedDate"]  = System.DateTime.Now;
            aWfTaskAssignment["SubmittedBy"]    = WebSession.DataObjectFactory.User.UserID;
            aWfTaskAssignment["ModifyUser"]     = WebSession.DataObjectFactory.User.UserID;
            aWfTaskAssignment["ModifyDate"]     = System.DateTime.Now;
            WebSession.DataObjectFactory.SaveDataObject(aWfTaskAssignment);
            aWfTaskAssignment.RaiseProcessEvents = false;
            //Continue processing the post submission workflow tasks only if the ContinueProcessing is still true
            if (aWfTaskAssignment.ContinueProcessing)
            {
                aWfTaskAssignment.SetWfTaskOutcome(aOutcomeConfigDoc);
            }
            if (WebAppl.CreateSubmissionHistory)
            {
                aSubmissionHistory["SubmittedDate"]      = aWfTaskAssignment.GetPropertyValue("SubmittedDate");
                aSubmissionHistory["WfTaskOutcomeID"]    = aWfTaskAssignment.GetPropertyValue("WfTaskOutcomeID");
                aSubmissionHistory["PostWfTaskStatusID"] = aWfTaskAssignment.GetPropertyValue("WfTaskStatusID");
                aSubmissionHistory.SaveData();
            }
            WebSession.DataObjectFactory.CopyDataObject(aWfTaskAssignment, ((cEGUser)ModuleUser).WfTaskAssignmentObject);
        }
コード例 #4
0
        /*-----------------------------------------------------*/

        public virtual void Submit_UpdateData(cDataObjectList aDataObjectList, bool aRaiseSingleEvent)
        {
            foreach (cWfTaskAssignment aDataObject in aDataObjectList)
            {
                aDataObject.RaiseProcessEvents = true;         //flag to raise pre and post submission processing events
                aDataObject["WfTaskStatusID"]  = 2;
                aDataObject["SubmittedDate"]   = System.DateTime.Now;
                aDataObject["ModifyUser"]      = WebSession.DataObjectFactory.User.UserID;
                aDataObject["ModifyDate"]      = System.DateTime.Now;
                WebSession.DataObjectFactory.SaveDataObject(aDataObject);
                aDataObject.RaiseProcessEvents = false;
            }
            //WebSession.DataObjectFactory.SaveDataObject(aDataObjectList);

            //Process outcomes for only one data object so that e-mails and tasks can be processed.
            //Since e-mail events use the entire data object list, we must create a new list containing only
            //one of these data objects

            for (int Pos = 0; Pos < aDataObjectList.Count; Pos++)
            {
                int aWfTaskAssignmentID             = aDataObjectList[Pos].GetPropertyInt("WfTaskAssignmentID");
                cWfTaskAssignment aWfTaskAssignment = (cWfTaskAssignment)WebSession.DataObjectFactory.GetDataObjectFromPrimaryKey("WfTaskAssignment", aWfTaskAssignmentID);
                if (aRaiseSingleEvent && (Pos == 0))
                {
                    aWfTaskAssignment.SetWfTaskOutcome(OutcomeConfigDoc, false, true, true);
                }
                else if (aRaiseSingleEvent && (Pos > 0))
                {
                    aWfTaskAssignment.SetWfTaskOutcome(OutcomeConfigDoc, false, true, false);
                }
                else
                {
                    aWfTaskAssignment.SetWfTaskOutcome(OutcomeConfigDoc, false, true, true);
                }
            }


            //Set WfTaskStatusID property of WfTaskAssignmentObject in memory (this allows the post-submission content control to be displayed to the reviewer on redirect)
            WfTaskAssignmentObject["WfTaskStatusID"] = 2;
        }