示例#1
0
/*----------------------------------------------------*/

        public static void  Validate_For_WfTA_Update(cWfTaskAssignment aWfTA)
        {
            cXMLDoc            aXMLDoc;
            XmlNode            aDataObjectNode;
            XmlNode            aFiltersNode;
            XmlNode            aArgNode;
            cDataObject        aGranteeProjectOutcomes;
            cDataObjectFactory aDataObjectFactory;

            aDataObjectFactory = aWfTA.DataObjectFactory;

            aXMLDoc  = aDataObjectFactory.CreateDataObjectNode("GranteeProjectOutcomes", out aDataObjectNode, out aFiltersNode);
            aArgNode = aDataObjectFactory.CreateArgumentNode(aXMLDoc, "Data", "GranteeProjectID", aWfTA.GetPropertyString("GranteeProjectID"));
            aFiltersNode.AppendChild(aArgNode);
            aArgNode = aDataObjectFactory.CreateArgumentNode(aXMLDoc, "Data", "WfTaskID", aWfTA.GetPropertyString("WfTaskID"));
            aFiltersNode.AppendChild(aArgNode);
            aGranteeProjectOutcomes = (cGranteeProjectOutcomes)aDataObjectFactory.GetDataObject(aDataObjectNode);
            if (aGranteeProjectOutcomes != null)
            {
                //Update the Outcome
                if (aWfTA.GetPropertyInt("WfTaskOutcomeID", 0) > 0)
                {
                    aGranteeProjectOutcomes["OutcomeID"] = aWfTA.GetPropertyInt("WfTaskOutcomeID");
                }
            }
            else
            {
                //Create a new data object.
                aGranteeProjectOutcomes = aDataObjectFactory.CreateNewDataObjectFromKey("GranteeProjectOutcomes");
                aGranteeProjectOutcomes["GranteeProjectID"] = aWfTA.GetPropertyInt("GranteeProjectID");
                aGranteeProjectOutcomes["WfTaskID"]         = aWfTA.GetPropertyInt("WfTaskID");
                if (aWfTA.GetPropertyInt("WfTaskOutcomeID", 0) > 0)
                {
                    aGranteeProjectOutcomes["OutcomeID"] = aWfTA.GetPropertyInt("WfTaskOutcomeID");
                }
                aGranteeProjectOutcomes["Complete"] = false;
            }
            aGranteeProjectOutcomes.SaveData();
        }
示例#2
0
		public void Notify_DataModified_HHMI(cDataObjectFactory aDataObjectFactory) {
			cWfTaskAssignment aApplWfTA = this;

			//find the applicant WfTaskAssignment
			int aRoleID = this.GetPropertyInt("WfTaskRoleID", 0);
			if (aRoleID != 1) {
				cDataObject aGP = this.GetRelatedPropertyDataObject("GranteeProject");
				cDataObjectList aDOL;
				aDOL = aGP.GetRelatedPropertyDataObjectList("ApplWfTaskAssignments");
				foreach (cDataObject aDO in aDOL) {
					if (aDO.GetRelatedPropertyInt("WfTask.WfTaskTypeID", 0) == 1) {
						aApplWfTA = (cWfTaskAssignment) aDO;
						break;
					}
				}
			}

			cDataObjectList aWfProjectPDFList = aApplWfTA.GetRelatedPropertyDataObjectList("GranteeProject.WfProjectPDF");
			foreach (cDataObject aWfProjectPDF in aWfProjectPDFList) {
				if (aWfProjectPDF.GetPropertyInt("PDFGenerationID", 0) == 1) {
					string aReportOutputDefinitionID = aWfProjectPDF.GetRelatedPropertyString("FinalPDFReportKeyLink.ReportOutputDefinitionID");
					cDataObject aReportOutputDO = aDataObjectFactory.GetDataObjectListWithFilter("ReportOutput", "DefinitionID", aReportOutputDefinitionID, "EntityID", aApplWfTA.GetPropertyString("WfTaskAssignmentID"))[0];
					if (aReportOutputDO != null) {
						if (aRoleID != 1 && aWfProjectPDF.GetPropertyInt("ReportOutputDefinitionTypeID", 1) == 1)
							continue; //skip applicant pdf when make changes to third party data
						//delete existing pdf
						aDataObjectFactory.DeleteData(aReportOutputDO);
					}
				}
			}
		}