///<summary> /// Method Invocation of wrapper classes ///<summary> protected static FR_L3FE_GFDDMI_1652_Array Invoke(DbConnection Connection, DbTransaction Transaction, string ConnectionString, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { bool cleanupConnection = Connection == null; bool cleanupTransaction = Transaction == null; FR_L3FE_GFDDMI_1652_Array functionReturn = new FR_L3FE_GFDDMI_1652_Array(); try { if (cleanupConnection == true) { Connection = CSV2Core_MySQL.Support.DBSQLSupport.CreateConnection(ConnectionString); Connection.Open(); } if (cleanupTransaction == true) { Transaction = Connection.BeginTransaction(); } functionReturn = Execute(Connection, Transaction, securityTicket); #region Cleanup Connection/Transaction //Commit the transaction if (cleanupTransaction == true) { Transaction.Commit(); } //Close the connection if (cleanupConnection == true) { Connection.Close(); } #endregion } catch (Exception ex) { try { if (cleanupTransaction == true && Transaction != null) { Transaction.Rollback(); } } catch { } try { if (cleanupConnection == true && Connection != null) { Connection.Close(); } } catch { } throw new Exception("Exception occured in method cls_Get_Features_DropDownMenuItems", ex); } return(functionReturn); }
protected static FR_L3FE_GFDDMI_1652_Array Execute(DbConnection Connection, DbTransaction Transaction, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null) { //Leave UserCode region to enable user code saving #region UserCode var returnValue = new FR_L3FE_GFDDMI_1652_Array(); returnValue.Result = new L3FE_GFDDMI_1652[0]; //Put your code here List <L3FE_GFDDMI_1652> DropDownList = new List <L3FE_GFDDMI_1652>(); List <L2PR_GAPfTID_1700> Projects = cls_Get_AllProjects_for_TenantID.Invoke(Connection, Transaction, securityTicket).Result.ToList(); List <L2BT_GBTPfT_1127> AllBusinessTaskPackages = cls_Get_BusinessTaskPackages_for_Tenant.Invoke(Connection, Transaction, securityTicket).Result.ToList(); foreach (var project in Projects) { if (project.IsArchived == false) { DropDownList.Add(new L3FE_GFDDMI_1652(project.Name, "", project.TMS_PRO_ProjectID)); } } foreach (var package in AllBusinessTaskPackages) { String Path = package.BTP_Name; P_L2PR_GPfPID_0857 parameter = new P_L2PR_GPfPID_0857(); parameter.ProjectID = package.Project_RefID; L2PR_GPfPID_0857 packageProject = cls_Get_Project_for_ProjectID.Invoke(Connection, Transaction, parameter, securityTicket).Result; if (packageProject != null && packageProject.TMS_PRO_ProjectID != Guid.Empty && packageProject.Name != null) { if (package.Parent_RefID == null || package.Parent_RefID == Guid.Empty) { DropDownList.Add(new L3FE_GFDDMI_1652(packageProject.Name, Path, package.TMS_PRO_BusinessTaskPackageID)); } if (package.Parent_RefID != null && package.Parent_RefID != Guid.Empty) { P_L2BT_GBTPP_1544 parentPackageParam = new P_L2BT_GBTPP_1544(); do { parentPackageParam.BT_Parent_ID = package.Parent_RefID; L2BT_GBTPP_1544 currentPackageParent = cls_Get_BusinessTaskPackage_Parent.Invoke(Connection, Transaction, parentPackageParam, securityTicket).Result; Path = currentPackageParent.BTP_Name + "/" + Path; DropDownList.Add(new L3FE_GFDDMI_1652(packageProject.Name, Path, package.TMS_PRO_BusinessTaskPackageID)); if (currentPackageParent.Parent_RefID != null && currentPackageParent.Parent_RefID != Guid.Empty) { parentPackageParam.BT_Parent_ID = currentPackageParent.Parent_RefID; } else { parentPackageParam.BT_Parent_ID = Guid.Empty; } }while (cls_Get_BusinessTaskPackage_Parent.Invoke(Connection, Transaction, parentPackageParam, securityTicket).Result != null && cls_Get_BusinessTaskPackage_Parent.Invoke(Connection, Transaction, parentPackageParam, securityTicket).Result.Parent_RefID != Guid.Empty); } } } if (DropDownList.Count != 0 && DropDownList != null) { returnValue.Result = DropDownList.ToArray(); } return(returnValue); #endregion UserCode }