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); } } } }
/*====================================================*/ public void SetEmailArgs(cDataObjectList aDataObjList){ cEmailArgsDataObject aEmailArgsDataObject=new cEmailArgsDataObject(aDataObjList); SetEmailArgs(aEmailArgsDataObject); }
/*----------------------------------------------------*/ protected cDataObjectList GetEvents(ProcessType aProcessType, WorkflowEventType aWorkflowEventType) { cXMLDoc aXmlDoc; XmlNode aDataObjectNode, aFiltersNode, aSortNode; string aWfProjectTaskID = ""; //if (aProcessType == ProcessType.PreAssignment) { // cDataObject aGranteeProjectDO = this.DataObjectFactory.GetDataObjectFromPrimaryKey("GranteeProject", this.GetPropertyString("GranteeProjectID")); // cDataObjectList aWfProjectTaskDOL = this.DataObjectFactory.GetDataObjectListWithFilter("WfProjectTask", "WfProjectID", aGranteeProjectDO.GetPropertyString("WfProjectID"), "WfTaskID", this.GetPropertyString("WfTaskID")); // if (aWfProjectTaskDOL != null && aWfProjectTaskDOL.Count > 0) // aWfProjectTaskID = aWfProjectTaskDOL[0].GetPropertyString("WfProjectTaskID"); //} //else { // aWfProjectTaskID = this.GetWfProjectTask().GetPropertyString("WfProjectTaskID"); //} cDataObject aGranteeProjectDO = this.DataObjectFactory.GetDataObjectFromPrimaryKey("GranteeProject", this.GetPropertyString("GranteeProjectID")); cDataObjectList aWfProjectTaskDOL = this.DataObjectFactory.GetDataObjectListWithFilter("WfProjectTask", "WfProjectID", aGranteeProjectDO.GetPropertyString("WfProjectID"), "WfTaskID", this.GetPropertyString("WfTaskID")); if (aWfProjectTaskDOL != null && aWfProjectTaskDOL.Count > 0) aWfProjectTaskID = aWfProjectTaskDOL[0].GetPropertyString("WfProjectTaskID"); aXmlDoc = this.DataObjectFactory.CreateDataObjectNode("WorkflowEvents", out aDataObjectNode, out aFiltersNode); aFiltersNode.AppendChild(this.DataObjectFactory.CreateArgumentNode(aXmlDoc, "Data", "ProcessTypeID", Convert.ToString((Int32)aProcessType))); aFiltersNode.AppendChild(this.DataObjectFactory.CreateArgumentNode(aXmlDoc, "Data", "WorkflowEventTypeID", Convert.ToString((Int32)aWorkflowEventType))); aFiltersNode.AppendChild(this.DataObjectFactory.CreateArgumentNode(aXmlDoc, "Data", "WorkflowID", aWfProjectTaskID)); aSortNode = aDataObjectNode.AppendChild(aXmlDoc.CreateSortNode()); aSortNode.AppendChild(this.DataObjectFactory.CreateArgumentNode(aXmlDoc, "Data", "SortOrder", "")); return this.DataObjectFactory.GetDataObjectList(aDataObjectNode); }
/*----------------------------------------------------*/ public void GenerateAssignments_AllToAll(cDataObjectList aReviewerList, cDataObjectList aGranteeProjList) { cDataObject aWFTA; int aAssignmentOrdinal; foreach (cGranteeProject aGranteeProject in aGranteeProjList) { aAssignmentOrdinal = 0; foreach (cReviewCommitteeMember aReviewer in aReviewerList) { aWFTA = DataObjectFactory.CreateNewDataObjectFromKey("WfTaskAssignment"); aWFTA["WfTaskID"] = this.GetRelatedPropertyInt("WfProjectTask.WfTaskID"); aWFTA["PersonID"] = aReviewer["PersonID"]; aWFTA["WfTaskRoleID"] = 7; aWFTA["GranteeProjectID"] = aGranteeProject["GranteeProjectID"]; aWFTA["WfTaskStatusID"] = 1; //incomplete aWFTA["AssignmentOrdinal"] = aAssignmentOrdinal; //used to identify primary, secondary reviewer aWFTA.SaveData(); aAssignmentOrdinal += 1; } } //Create GranteeProjectReviewStage data objects for this stage foreach (cGranteeProject aGranteeProject in aGranteeProjList) { aGranteeProject.GetGranteeProjectReviewStageDO(this.GetPropertyInt("WfProjectTaskID")); } }
/*----------------------------------------------------*/ protected void WfTaskOutcome_UpdateData(XmlNodeList aUpdateDataNodeList) { foreach (XmlNode aUpdateDataNode in aUpdateDataNodeList) { WfTaskOutcome_SetRelatedDataObjectArgValues(null, aUpdateDataNode); String aPropertyKey = cXMLDoc.AttributeToString(aUpdateDataNode, "PropertyKey"); String aFinalKey; int aIndex = aPropertyKey.LastIndexOf("."); if (aIndex == -1) { cDataObject aDataObject = this; aFinalKey = aPropertyKey; if (cXMLDoc.AttributeToBool(aUpdateDataNode, "Null")) aDataObject[aFinalKey] = System.DBNull.Value; else aDataObject[aFinalKey] = cXMLDoc.AttributeToString(aUpdateDataNode, "Value"); aDataObject.SaveData(); } else { aFinalKey = aPropertyKey.Substring(aIndex + 1); cDataObjectList aDataObjectList = this.GetRelatedPropertyDataObjectList(aPropertyKey.Substring(0, aIndex)); foreach (cDataObject aDataObject in aDataObjectList) { if (cXMLDoc.AttributeToBool(aUpdateDataNode, "Null")) aDataObject[aFinalKey] = System.DBNull.Value; else aDataObject[aFinalKey] = cXMLDoc.AttributeToString(aUpdateDataNode, "Value"); aDataObject.SaveData(); } } } }
public override void ProcessEvent(string aFilterName, string aFilterID) { string[] aFilterNames = { aFilterName }; string[] aFilterIDs = { aFilterID }; string aFilterName1 = "UserID"; string aFilterID1 = DataObjectFactory.User.UserID.ToString(); string[] aFilterNames1 = { aFilterName, aFilterName1 }; string[] aFilterIDs1 = { aFilterID, aFilterID1 }; cDataObjectList aProcessEventDOL = null; if (DataObjectFactory.CreateNewDataObjectFromKey(DefinitionKey).HasProperty("UserID")) { aProcessEventDOL = DataObjectFactory.GetDataObjectListWithFilter(DefinitionKey, aFilterNames1, aFilterIDs1); } else { aProcessEventDOL = DataObjectFactory.GetDataObjectListWithFilter(DefinitionKey, aFilterNames, aFilterIDs); } if (aProcessEventDOL != null && aProcessEventDOL.Count > 0) { cDataObject aProcessEventDO = aProcessEventDOL[0]; SetMemberVariables(aProcessEventDO); } }
/*----------------------------------------------------*/ public int SaveReviewAssignment(int aWfTaskID, int aReviewerPersonID, int aRole, int aReviewStageID, String aApplTaskID) { cXMLDoc aXMLDoc; cDataObject aWFTADataObject; //workflow task assignment XmlNode aNewDataObjectNode; cDataObject aGPRSDataObject; aXMLDoc = DataObjectFactory.CreateDataObjectNode("WfTaskAssignment", out aNewDataObjectNode); aWFTADataObject = DataObjectFactory.GetNewDataObject(aNewDataObjectNode); aWFTADataObject["WfTaskID"] = aWfTaskID; aWFTADataObject["PersonID"] = aReviewerPersonID; aWFTADataObject["GranteeProjectID"] = GetPropertyInt("GranteeProjectID"); aWFTADataObject["WfTaskRoleID"] = aRole; //originally 7 aWFTADataObject["ReviewStageID"] = aReviewStageID; aWFTADataObject["WfTaskStatusID"] = 1; if (aApplTaskID != "") { aWFTADataObject["ReportTaskID"] = aApplTaskID; } DataObjectFactory.SaveDataObject(aWFTADataObject); //Create GranteeProjectReviewStage object if it does not already exist. cDataObjectList aObjList = this.DataObjectFactory.GetDataObjectListWithFilter("WfProjectTask", "WfProjectID", GetPropertyString("WfProjectID"), "WfTaskID", aWfTaskID.ToString()); aGPRSDataObject = GetGranteeProjectReviewStageDO(aObjList[0].GetPropertyInt("WfProjectTaskID", 0)); //aGPRSDataObject = GetGranteeProjectReviewStageDO(aWFTADataObject.GetPropertyInt("WfTaskID")); return(aWFTADataObject.GetPropertyInt("WfTaskAssignmentID")); }
/*-----------------------------------------------------*/ public cDataObjectList Person_Updated_WorkgroupTaskList() { cXMLDoc aXmlDoc; XmlNode aDataObjectNode, aFiltersNode, aArgNode; cDataObjectList aWorkGroupList, aWorkGroupTaskListL; cDataObjectList aWFTAList = new cDataObjectList(DataObjectFactory); aXmlDoc = DataObjectFactory.CreateDataObjectNode("WorkGroup", out aDataObjectNode, out aFiltersNode); aArgNode = aFiltersNode.AppendChild(DataObjectFactory.CreateArgumentNode(aXmlDoc, "Data", "PersonID", this.GetPropertyString("PersonID"))); aArgNode = aArgNode.AppendChild(DataObjectFactory.CreateArgumentRelatedPropertyNode(aXmlDoc, "WorkGroupMembers")); aWorkGroupList = DataObjectFactory.GetDataObjectList(aDataObjectNode); foreach (cDataObject aWorkGroup in aWorkGroupList) { aWorkGroupTaskListL = DataObjectFactory.GetDataObjectListWithFilter("WorkGroupTaskList", "WorkGroupID", aWorkGroup.GetPropertyString("WorkGroupID")); foreach (cDataObject aWorkGroupTaskLst in aWorkGroupTaskListL) { cDataObjectList aCurWFTAList; aCurWFTAList = aWorkGroupTaskLst.GetRelatedPropertyDataObjectList("WfTaskAssignments"); aWFTAList.AddList(aCurWFTAList); } } return aWFTAList; }
/*====================================================*/ public override void PopulateDataSet(cDataObjectList aObjList) { String aXPathStr; aXPathStr = DataProviderXML_Generate_XPath(aObjList.ObjDefNode, aObjList.DataObjectNode); //Populate rows in DataTable XmlNodeList aPropertiesNodeList = aObjList.ObjDefNode.SelectNodes("Properties/Property"); XmlNodeList aDataRowNL = DataDoc.DocElement.SelectNodes(aXPathStr); DataTable aDataTable = aObjList.ObjDataSet.Tables[aObjList.DefinitionKey]; foreach (XmlElement aDataRowEl in aDataRowNL) { DataRow aDataRow = aDataTable.NewRow(); foreach (XmlNode aPropertyNode in aPropertiesNodeList) { String aColumnName = cXMLDoc.AttributeToString(aPropertyNode, "ColumnSource"); XmlElement aColumnEl; if (aColumnName != "") { aColumnEl = (XmlElement)cXMLDoc.FindNode(aDataRowEl, "Column", "Name", aColumnName); //Debug.WriteLine("Value: " + aColumnEl.FirstChild.Value); aDataRow[aColumnName] = aColumnEl.FirstChild.Value; } } //foreach aPropertyNode aDataTable.Rows.Add(aDataRow); } //foreach aDataRowEl }
/*----------------------------------------------------*/ public cCoreCtl GetControl(HtmlControl aContainerCtl, XmlNode aControlNode, String aControlID) { cCoreCtl aCtl; XmlNode aEGControlNode= null; String aControlType=""; //create new control if container is empty; there is always one control in HTMLGenericControl if(aContainerCtl.Controls.Count == 0) { //Here we are checking whether the SharePoint Integration is Active Boolean IsSPActive = false; cDataObjectList aSharePointList = WebSession.DataObjectFactory.GetDataObjectListWithFilter("SharePointIntegration" , "Active" , "True"); if(aSharePointList.Count > 0) IsSPActive = true; //Load control by getting the type of control from aControlNode //and the location of control from EGConfig.xml = WebAppl.ConfigDoc if (IsSPActive == true){ aEGControlNode = WebAppl.ConfigDoc.DocElement.SelectSingleNode("Controls/Control[@Key='" + aControlNode.Attributes["Type"].Value + "']"); aControlType=cXMLDoc.AttributeToString(aEGControlNode, "Type", ""); } aCtl = (cCoreCtl)LoadControl(WebAppl.Get_ControlSrc(aControlType, aControlNode.Attributes["Type"].Value, IsSPActive)); if(aControlID != null && aControlID != "") aCtl.ID = aControlID; aContainerCtl.Controls.Add(aCtl); } else aCtl = (cCoreCtl)aContainerCtl.FindControl(aControlID); return aCtl; }
/*====================================================*/ public void WriteDataObjectList(StringBuilder aTable, cDataObjectList aDataObjectList) { bool anAltRow = false; for (int i = 0; i < aDataObjectList.Count; i++) { cDataObject aDataObject = aDataObjectList[i]; if (anAltRow) { aTable.Append("<tr bgColor='" + RowBgColor + "' class='" + RowClass + "'>"); anAltRow = false; } else { aTable.Append("<tr bgColor='" + AltRowBgColor + "' class='" + AltRowClass + "'>"); anAltRow = true; } foreach (XmlNode aDisplayPropertyNode in AdHocQueryDefXMLDoc.DocElement.SelectNodes("DisplayProperties/DisplayProperty")) { String aPropertyKey; aPropertyKey = cXMLDoc.AttributeToString(aDisplayPropertyNode, "PropertyKey"); aTable.Append("<td>" + aDataObject.GetAliased_RelatedPropertyDefaultFormattedString(aPropertyKey) + "</td>"); //PL 12/17/03 aTable.Append("<td width='10'> </td>"); } aTable.Append("</tr>"); } }
/*====================================================*/ public int EvaluateUploadItem(string aWfProjectTaskUploadID, string EntitityID, bool IsRequired) { //1 Successful conversion or Zero non-required uploads //-1 Un successful conversion //0 Missing upload // cDataObjectList aSubmittedFileDO = WebSession.DataObjectFactory.GetDataObjectListWithFilter("SubmittedFile", "EntityID", EntitityID, "UploadID", aWfProjectTaskUploadID); if (aSubmittedFileDO.Count > 0) { if (aSubmittedFileDO[0].GetPropertyInt("ConversionStatus", 0) == -1) { return(1); } else { return(-1); } } else if (IsRequired) { return(0); } else { return(1); } }
/*====================================================*/ protected override XmlNode Get_MailParamNode(cDataObjectList aDataObjectList) { XmlNode aEMailParamNode; aEMailParamNode = cXMLDoc.FindNode(((cWebAppl)aDataObjectList.DataObjectFactory.Appl).Get_ApplNode(), "EMailParams/DataObjectEmailProperties", "Key", aDataObjectList.DefinitionKey); return aEMailParamNode; }
/*-----------------------------------------------------*/ public cEGUser ValidateLoginCredentials(String aLoginID, String aPassword, bool aEnforceUserNameCase, bool aEnforcePasswordCase, out cXMLDoc aModuleDoc) { XmlNode aDataObjectNode; XmlNode aFiltersNode; //Construct User data object node cXMLDoc aXmlDoc = DataObjectFactory.CreateDataObjectNode("User", out aDataObjectNode, out aFiltersNode); aFiltersNode.AppendChild(DataObjectFactory.CreateArgumentNode(aXmlDoc, "Data", "UserName", aLoginID)); cDataObjectList aDOL = DataObjectFactory.GetDataObjectList(aDataObjectNode); cDataObject aDataObject = null; foreach (cDataObject aDO in aDOL) { if (aDO.GetPropertyString("Password").ToLower() == aPassword.ToLower()) { aDataObject = aDO; break; } } if (aDataObject!=null && (!aEnforceUserNameCase || aDataObject.GetPropertyString("UserName") == aLoginID) && (!aEnforcePasswordCase || aDataObject.GetPropertyString("Password") == aPassword)){ cEGUser aUser = EGUser_From_UserDataobject(aDataObject, out aModuleDoc); return aUser; } aModuleDoc = null; return null; }
/*----------------------------------------------------*/ public void RaiseSingleEvent(int aEventID, int aUserID, cDataObjectList aEventDataObjectList, string aRcptPersonIDPropertyKey) { if (aEventDataObjectList[0] != null) { if (aRcptPersonIDPropertyKey != "") { aEventDataObjectList[0].RaiseSingleEvent(aEventID, aUserID, aRcptPersonIDPropertyKey); } else { aEventDataObjectList[0].RaiseSingleEvent(aEventID, aUserID); } } }
/*====================================================*/ 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); } }
/*-----------------------------------------------------*/ public virtual void DeleteThirdPartyEMF(String aWfTaskAssignmentID, String aPersonRelationshipID, String aRedirectFlag) { cWfTaskAssignment aWfTaskAssgObject; cXMLDoc aXMLDoc; XmlNode aDataObjNode, aFiltersNode; cDataObject aWfTaskPerson; aWfTaskAssgObject = (cWfTaskAssignment)WebSession.DataObjectFactory.GetDataObjectFromPrimaryKey("WfTaskAssignment", aWfTaskAssignmentID); aXMLDoc = WebSession.DataObjectFactory.CreateDataObjectNode("WfTaskAssignmentPersonRelationship", out aDataObjNode, out aFiltersNode); aFiltersNode.AppendChild(WebSession.DataObjectFactory.CreateArgumentNode(aXMLDoc, "Data", "WfTaskAssignmentID", aWfTaskAssignmentID)); aWfTaskPerson = WebSession.DataObjectFactory.GetDataObject(aDataObjNode); //aWfTaskAssgObject["WfTaskStatusID"] = 3; //inactive //WebSession.DataObjectFactory.SaveDataObject(aWfTaskAssgObject); //aWfTaskAssgObject.SetWfTaskOutcome(); cDataObject aPersonRelationshipDO; aPersonRelationshipDO = WebSession.DataObjectFactory.GetDataObjectFromPrimaryKey("PersonRelationship", aPersonRelationshipID); try { cDataObjectList aList = this.WebSession.DataObjectFactory.GetDataObjectListWithFilter("WfTaskAssignment", "WfTaskAssignmentID", aWfTaskAssignmentID); cDataObjectList aTempList = this.WebSession.DataObjectFactory.GetDataObjectListWithFilter("CorrespondenceDefinition", "CorrespondenceDefinitionID", "26"); cCorrespondenceJob aJob = new cCorrespondenceJob(aPersonRelationshipDO.GetRelatedPropertyInt("RelatedPerson.User.UserID", 0)); aJob.EmailArgs = new cEmailArgsDataObject(aList); aJob.CorrespondenceDefinition = aTempList[0]; aJob.SendEmail(this.WebSession.DataObjectFactory.Appl); } catch { } WebSession.DataObjectFactory.DeleteData(aWfTaskPerson); WebSession.DataObjectFactory.DeleteData("WfTaskAssignment", aWfTaskAssignmentID); if (aPersonRelationshipDO != null) { /* * cDataObject aPersonDO; * aPersonDO = WebSession.DataObjectFactory.GetDataObjectFromPrimaryKey("Person", aPersonRelationshipDO.GetPropertyInt("RelatedPersonID", 0)); * if (aPersonDO != null){ * cDataObject aUserDO; * aUserDO = aPersonDO.GetRelatedPropertyDataObject("User"); * if (aUserDO != null){ * WebSession.DataObjectFactory.DeleteData(aUserDO); * } * WebSession.DataObjectFactory.DeleteData(aPersonDO); * } */ WebSession.DataObjectFactory.DeleteData(aPersonRelationshipDO); } if (aRedirectFlag == "True") { ModulePage.Redirect(); } }
public override void CoreCtl_Configure(XmlNode aDisplayControlNode, cDataObjectList aDataObjectList) { base.CoreCtl_Configure(aDisplayControlNode, aDataObjectList); if (UploadValidator == null) { UploadValidator = new cUploadValidator(WebSession, FileTypeControlID); } AddValidators(); }
/*====================================================*/ public override void RaiseEvent(cDataObjectList aDataObjectList, int aUserID){ cCorrespondenceJob aCorrespondenceJob = new cCorrespondenceJob(aUserID); aCorrespondenceJob.EmailArgs = new cEmailArgsDataObject(aDataObjectList); aCorrespondenceJob.CorrespondenceDefinition = this.mEventData.GetRelatedPropertyDataObject("EventCorrespondence.CorrespondenceDefinition"); aCorrespondenceJob.SendEmail(this.DataObjectFactory.Appl); cDataObject aRevAddInfoDO = aDataObjectList[0]; aRevAddInfoDO["ResponseDate"] = System.DateTime.Now.ToShortDateString(); this.DataObjectFactory.SaveDataObject(aRevAddInfoDO); }
/*====================================================*/ public override void RaiseEvent(cDataObjectList aDataObjectList, int aUserID){ cCorrespondenceJob aCorrespondenceJob = new cCorrespondenceJob(aUserID); aCorrespondenceJob.EmailArgs = new cEmailArgsDataObject(aDataObjectList); //aCorrespondenceJob.CorrespondenceDefinition = this.GetRelatedPropertyDataObject("EventCorrespondence.CorrespondenceDefinition"); aCorrespondenceJob.CorrespondenceDefinition = this.mEventData.GetRelatedPropertyDataObject("EventCorrespondence.CorrespondenceDefinition"); aCorrespondenceJob.SendEmail(this.DataObjectFactory.Appl); }
/*-----------------------------------------------------*/ public cDataObjectList Person_Updated_WorkgroupTaskList(XmlElement aDataObjectElement) { cXMLDoc aXmlDoc; XmlNode aDataObjectNode, aFiltersNode, aArgNode; cDataObjectList aWorkGroupList, aWorkGroupTaskListL; cDataObjectList aWFTAList = DataObjectFactory.CreateDataObjectList(aDataObjectElement); //This is the object that will be returned. aXmlDoc = DataObjectFactory.CreateDataObjectNode("WorkGroup", out aDataObjectNode, out aFiltersNode); aArgNode = aFiltersNode.AppendChild(DataObjectFactory.CreateArgumentNode(aXmlDoc, "Data", "PersonID", this.GetPropertyString("PersonID"))); aArgNode = aArgNode.AppendChild(DataObjectFactory.CreateArgumentRelatedPropertyNode(aXmlDoc, "WorkGroupMembers")); aWorkGroupList = DataObjectFactory.GetDataObjectList(aDataObjectNode); ArrayList wgArrayL = new ArrayList(); int wfALIdx = 0; foreach (cDataObject aWorkGroup in aWorkGroupList) { aWorkGroupTaskListL = DataObjectFactory.GetDataObjectListWithFilter("WorkGroupTaskList", "WorkGroupID", aWorkGroup.GetPropertyString("WorkGroupID")); if (aWorkGroupTaskListL.Count == 0) continue; foreach (cDataObject aWorkGroupTaskLst in aWorkGroupTaskListL) { cDataObjectList aCurWFTAList; aCurWFTAList = aWorkGroupTaskLst.GetRelatedPropertyDataObjectList("WfTaskAssignments"); if (aCurWFTAList.Count == 0) continue; foreach (cDataObject aCurWFTA in aCurWFTAList) { wfALIdx = wgArrayL.BinarySearch(aCurWFTA.GetPropertyInt("WfTaskAssignmentID")); if (wfALIdx >= 0) break; if (aCurWFTA.GetPropertyInt("WfTaskStatusID") == 1 && aCurWFTA.GetPropertyString("PersonID") == "") { aWFTAList.Add(aCurWFTA); wgArrayL.Insert(~wfALIdx, aCurWFTA.GetPropertyInt("WfTaskAssignmentID")); aCurWFTA.DataObjectList = aWFTAList; } } } } XmlElement aSortEl = (XmlElement)aDataObjectElement.SelectSingleNode("Sort"); if(aSortEl != null) { aWFTAList.SortEl = aSortEl; aWFTAList.Sort(); } return aWFTAList; }
/*----------------------------------------------------*/ public double CalculateBudget(cDataObjectList aTopLevelBudgetCategoryList) { double aBPAmount; cBudget aBudget; aBudget = (cBudget) this.DataObjectFactory.GetDataObjectFromPrimaryKey("Budget",this.GetPropertyInt("BudgetID")); aBPAmount = CalculateBudgetCategory(aTopLevelBudgetCategoryList, aBudget.GetPropertyInt("GranteeProjectID")); /* store aBPAmount in this BudgetPeriod */ return aBPAmount; }
/*====================================================*/ public override void RaiseSingleEvent(cDataObjectList aDataObjectList, int aUserID, string aRcptPersonIDPropertyKey) { cCorrespondenceJob aCorrespondenceJob = new cCorrespondenceJob(aUserID); aCorrespondenceJob.EmailArgs = new cEmailArgsDataObject(aDataObjectList[0]); if (aRcptPersonIDPropertyKey != "") { aCorrespondenceJob.EmailArgs.RcptPersonIDPropertyKey = aRcptPersonIDPropertyKey; } //aCorrespondenceJob.CorrespondenceDefinition = this.GetRelatedPropertyDataObject("EventCorrespondence.CorrespondenceDefinition"); aCorrespondenceJob.CorrespondenceDefinition = this.mEventData.GetRelatedPropertyDataObject("EventCorrespondence.CorrespondenceDefinition"); aCorrespondenceJob.SendEmail(this.DataObjectFactory.Appl); }
public double CalBudgetExpenseCategory(cDataObjectList aBudgetCategoryList, int aGranteeProjectID, int aTaskID) { cDataObject aBudgetItem; double anAmount = 0.0; double budgetAmount = 0.0; if (aBudgetCategoryList.Count == 0) return anAmount; foreach (cDataObject aBudgetCategory in aBudgetCategoryList) { if (aBudgetCategory.GetPropertyBool("HasChild") == true) { anAmount += CalBudgetExpenseCategory((cDataObjectList)aBudgetCategory.GetRelatedPropertyValue("Children"), aGranteeProjectID, aTaskID); } else { aBudgetItem = this.Get_BudgetItemExpense(aBudgetCategory["BudgetCategoryID"].ToString(), false, aTaskID); if (aBudgetItem != null) { anAmount += aBudgetItem.GetPropertyDouble("Expense", 0); } } } aBudgetItem = this.Get_BudgetItemExpense(aBudgetCategoryList[0]["ParentID"].ToString(), true, aTaskID); aBudgetItem["BudgetItemID"] = this.Get_BudgetItem(aBudgetCategoryList[0]["ParentID"].ToString(), true).GetPropertyString("BudgetItemID"); aBudgetItem["Expense"] = anAmount; //aBudgetItem["BudgetPeriodID"] = this["BudgetPeriodID"]; //aBudgetItem["BudgetCategoryID"] = aBudgetCategoryList[0]["ParentID"]; budgetAmount = this.Get_BudgetItem(aBudgetCategoryList[0]["ParentID"].ToString(), true).GetPropertyDouble("Amount"); aBudgetItem["Balance"] = budgetAmount - anAmount; if (budgetAmount > 0) aBudgetItem["CarryOver"] = ((budgetAmount - anAmount)/budgetAmount) * 100; aBudgetItem["GranteeProjectID"] = aGranteeProjectID; aBudgetItem["TaskID"] = aTaskID; // if (aBudgetCategoryList[0]["ParentID"].ToString() != "0" && anAmount != 0) // this.DataObjectFactory.SaveDataObject(aBudgetItem); if (aBudgetCategoryList[0]["ParentID"].ToString() != "0") this.DataObjectFactory.SaveDataObject(aBudgetItem); // if (aBudgetCategoryList[0]["ParentID"].ToString() == "0") // { // this["Total"] = anAmount; // this.DataObjectFactory.SaveDataObject(this); // } return anAmount; }
/*====================================================*/ public override void RaiseEvent(cDataObjectList aDataObjectList, int aUserID){ cCorrespondenceJob aCorrespondenceJob = new cCorrespondenceJob(aUserID); aCorrespondenceJob.EmailArgs = new cEmailArgsDataObject(aDataObjectList); aCorrespondenceJob.CorrespondenceDefinition = this.mEventData.GetRelatedPropertyDataObject("EventCorrespondence.CorrespondenceDefinition"); aCorrespondenceJob.SendEmail(this.DataObjectFactory.Appl); cDataObject aRevAddInfoDO = aDataObjectList[0]; aRevAddInfoDO["RequestDate"] = System.DateTime.Now.ToShortDateString(); aRevAddInfoDO["ResponseDate"] = System.DBNull.Value; aRevAddInfoDO["ResponseComment"] = System.DBNull.Value; this.DataObjectFactory.SaveDataObject(aRevAddInfoDO); cDataObject aWfDO = DataObjectFactory.GetDataObjectFromPrimaryKey("WfTaskAssignment", aRevAddInfoDO.GetPropertyString("AppWfTaskAssignmentID")); aWfDO["WfTaskStatusID"] = 1; //Incomplete this.DataObjectFactory.SaveDataObject(aWfDO); }
/*-----------------------------------------------------*/ public void BuildConfigurableLabels() { mConfigLabelsCollection = new NameValueCollection(); cXMLDoc aXmlDoc; XmlNode aDataObjectNode; XmlNode aFiltersNode; cDataObjectFactory aFactory = new cDataObjectFactory(this, DataDefinitionDoc); aXmlDoc = aFactory.CreateDataObjectNode("HeaderLabel", out aDataObjectNode, out aFiltersNode); cDataObjectList aLabelHeaderDOL = aFactory.GetDataObjectList(aDataObjectNode); foreach (cDataObject aLabelHeaderDO in aLabelHeaderDOL) { mConfigLabelsCollection.Add((String)aLabelHeaderDO["LabelName"], (String)aLabelHeaderDO["LabelText"]); } }
/*----------------------------------------------------*/ public double[] CalculateBudgetExpenseCategory(cDataObjectList aBudgetCategoryList, int aGranteeProjectID, int aTaskID) { cDataObject aBudgetItem; double[] anAmount = new double[2] {0.0, 0.0}; if (aBudgetCategoryList.Count == 0) return anAmount; foreach (cDataObject aBudgetCategory in aBudgetCategoryList) { if (aBudgetCategory.GetPropertyBool("HasChild") == true) { anAmount[0] += CalculateBudgetExpenseCategory((cDataObjectList)aBudgetCategory.GetRelatedPropertyValue("Children"), aGranteeProjectID, aTaskID)[0]; anAmount[1] += CalculateBudgetExpenseCategory((cDataObjectList)aBudgetCategory.GetRelatedPropertyValue("Children"), aGranteeProjectID, aTaskID)[1]; } else { aBudgetItem = this.Get_BudgetItemExpense(aBudgetCategory["BudgetCategoryID"].ToString(), false, aTaskID); if (aBudgetItem != null) { anAmount[0] += aBudgetItem.GetPropertyDouble("Expense", 0); anAmount[1] += aBudgetItem.GetPropertyDouble("ExpenseNext", 0); } } } aBudgetItem = this.Get_BudgetItemExpense(aBudgetCategoryList[0]["ParentID"].ToString(), true, aTaskID); aBudgetItem["BudgetItemID"] = this.Get_BudgetItem(aBudgetCategoryList[0]["ParentID"].ToString(), true).GetPropertyString("BudgetItemID"); aBudgetItem["Expense"] = anAmount[0]; aBudgetItem["ExpenseNext"] = anAmount[1]; aBudgetItem["BudgetPeriodID"] = this["BudgetPeriodID"]; aBudgetItem["BudgetCategoryID"] = aBudgetCategoryList[0]["ParentID"]; aBudgetItem["GranteeProjectID"] = aGranteeProjectID; aBudgetItem["TaskID"] = aTaskID; // if (aBudgetCategoryList[0]["ParentID"].ToString() != "0" && anAmount != 0) // this.DataObjectFactory.SaveDataObject(aBudgetItem); if (aBudgetCategoryList[0]["ParentID"].ToString() != "0") this.DataObjectFactory.SaveDataObject(aBudgetItem); // if (aBudgetCategoryList[0]["ParentID"].ToString() == "0") // { // this["Total"] = anAmount; // this.DataObjectFactory.SaveDataObject(this); // } return anAmount; }
/*----------------------------------------------------*/ public static int GetReviewStageIDFromWfProjectTaskID(int aWfProjectTaskID, cDataObjectFactory aDataObjectFactory) { cXMLDoc aXMLDoc; XmlNode aDataObjectNode; XmlNode aFiltersNode; XmlNode aArgNode; cDataObject aDataObject; aXMLDoc = aDataObjectFactory.CreateDataObjectNode("ReviewStage", out aDataObjectNode, out aFiltersNode); cDataObjectList aObjList = aDataObjectFactory.GetDataObjectListWithFilter("WfProjectTask", "WfProjectTaskID", aWfProjectTaskID.ToString()); aArgNode = aDataObjectFactory.CreateArgumentNode(aXMLDoc, "Data", "WfProjectTaskID", aObjList[0].GetPropertyString("WfProjectTaskID")); aFiltersNode.AppendChild(aArgNode); aDataObject = aDataObjectFactory.GetDataObject(aDataObjectNode); return(aDataObject.GetPropertyInt("ReviewStageID")); }
public void GetSystemSettingsFromDB() { mSystemSettings = new NameValueCollection(); cXMLDoc aXmlDoc; XmlNode aDataObjectNode; XmlNode aFiltersNode; cDataObjectFactory aFactory = new cDataObjectFactory(this, DataDefinitionDoc); aXmlDoc = aFactory.CreateDataObjectNode("Systemsettings", out aDataObjectNode, out aFiltersNode); aFiltersNode.AppendChild(aFactory.CreateArgumentNode(aXmlDoc, "Data", "Value", "null", "And", "NotEqual")); cDataObjectList aSystemsettingsDOL = aFactory.GetDataObjectList(aDataObjectNode); foreach (cDataObject aSystemsettingsDO in aSystemsettingsDOL) { mSystemSettings.Add((String)aSystemsettingsDO["SysSettingName"], (String)aSystemsettingsDO["Value"]); } }
/*====================================================*/ public void ValidateNavigationForReopened() { cDataObject aWfTaskAssignment = WebSession.DataObjectFactory.GetDataObjectFromPrimaryKey("WfTaskAssignment", WfTaskAssignmentID); if (aWfTaskAssignment.GetPropertyInt("WfTaskStatusID") == 4) { //Check to see if there is an active reopen request. If so, cDataObject aReopenRequest = aWfTaskAssignment.GetRelatedPropertyDataObject("ActiveRequestToReopenThis"); if (aReopenRequest != null) { //Check to see if there are reopen sections. If so, cDataObjectList aReopenSectionList = aReopenRequest.GetRelatedPropertyDataObjectList("WftaReopenSections"); if (aReopenSectionList.Count > 0) { ModuleUser.MasterNavElement.NavElement_FirstLevel_ValidateForReopened(aReopenSectionList); } } } }