예제 #1
0
        /// <summary>
        /// Get the value to Enable/Disable the action idientified by the Key
        /// </summary>
        /// <param name="context"></param>
        /// <param name="row">Instance values</param>
        /// <param name="actionKey">Action Identifier</param>
        /// <returns></returns>
        private static string GetEnabledAction(IUQueryContext context, DataRow row, string actionKey)
        {
            try
            {
                switch (actionKey)
                {
                case "Clas_1348178542592658AccOfer_AutoElemAcc_1_Alias":
                {
                    return(Action_Pasajero_SIU_create_instance(context, row, actionKey));
                }

                case "Clas_1348178542592658AccOfer_AutoElemAcc_2_Alias":
                {
                    return(Action_Pasajero_SIU_delete_instance(context, row, actionKey));
                }

                case "Clas_1348178542592658AccOfer_AutoElemAcc_3_Alias":
                {
                    return(Action_Pasajero_SIU_edit_instance(context, row, actionKey));
                }

                case "Clas_1348178542592658AccOfer_AutoElemAcc_4_Alias":
                {
                    return(Action_Pasajero__Auto_(context, row, actionKey));
                }

                default:
                    return("1");
                }
            }
            catch
            {
                return("1");
            }
        }
예제 #2
0
        /// <summary>
        /// Get the value to Enable/Disable the action idientified by the Key
        /// </summary>
        /// <param name="context"></param>
        /// <param name="row">Instance values</param>
        /// <param name="actionKey">Action Identifier</param>
        /// <returns></returns>
        private static string GetEnabledAction(IUQueryContext context, DataRow row, string actionKey)
        {
            try
            {
                switch (actionKey)
                {
                case "Clas_1347649273856884AccOfer_AutoElemAcc_1_Alias":
                {
                    return(Action_NaveNodriza_Crear_NaveNodriza(context, row, actionKey));
                }

                case "Clas_1347649273856884AccOfer_AutoElemAcc_2_Alias":
                {
                    return(Action_NaveNodriza_SIU_delete_instance(context, row, actionKey));
                }

                case "Clas_1347649273856884AccOfer_AutoElemAcc_3_Alias":
                {
                    return(Action_NaveNodriza_SIU_edit_instance(context, row, actionKey));
                }

                case "Clas_1347649273856884AccOfer_AutoElemAcc_4_Alias":
                {
                    return(Action_NaveNodriza__Auto_(context, row, actionKey));
                }

                default:
                    return("1");
                }
            }
            catch
            {
                return("1");
            }
        }
예제 #3
0
        private static string GetEnabledNavigation(IUQueryContext context, DataRow row, string navigationKey)
        {
            try
            {
                switch (navigationKey)
                {
                case "Clas_1348178673664478NavOfer_AutoElemNav_1_Alias":
                {
                    return(getNavigation_Revision_IIU_Revision_Revision(context, row, navigationKey));
                }

                case "Clas_1348178673664478NavOfer_AutoElemNav_2_Alias":
                {
                    return(getNavigation_PasajeroAeronave_IIU_PasajeroAeronave_PasajeroAeronave(context, row, navigationKey));
                }

                default:
                    return("1");
                }
            }
            catch
            {
                return("1");
            }
        }
예제 #4
0
 /// <summary>
 /// Execute a query to retrieve an instance.
 /// </summary>
 /// <param name="context">Current context.</param>
 /// <returns>A DataTable with the instance searched.</returns>
 public static DataTable ExecuteQueryInstance(IUQueryContext context)
 {
     RevisionPasajeroOid lOid = null;
     if (context.ExchangeInformation != null && context.ExchangeInformation.SelectedOids.Count > 0)
     {
         lOid = new RevisionPasajeroOid(context.ExchangeInformation.SelectedOids[0]);
     }
     return ExecuteQueryInstance(context.Agent, lOid, context.DisplaySetAttributes);
 }
예제 #5
0
        /// <summary>
        /// Execute a query to retrieve an instance.
        /// </summary>
        /// <param name="context">Current context.</param>
        /// <returns>A DataTable with the instance searched.</returns>
        public static DataTable ExecuteQueryInstance(IUQueryContext context)
        {
            PasajeroOid lOid = null;

            if (context.ExchangeInformation != null && context.ExchangeInformation.SelectedOids.Count > 0)
            {
                lOid = new PasajeroOid(context.ExchangeInformation.SelectedOids[0]);
            }
            return(ExecuteQueryInstance(context.Agent, lOid, context.DisplaySetAttributes));
        }
예제 #6
0
        /// <summary>
        /// Execute a query related with other instance.
        /// </summary>
        /// <param name="context">Current context.</param>
        /// <returns>A DataTable with the instances searched.</returns>
        public static DataTable ExecuteQueryRelated(IUQueryContext context)
        {
            // Parameter values
            object[] lParameters = new object[1];
            lParameters[0] = context;

            // Parameter types
            Type[] lTypes = new Type[1];
            lTypes[0] = typeof(IUQueryContext);

            return(ExecuteMethod(GetClassTypeName(context.ClassName), "ExecuteQueryRelated", lTypes, lParameters) as DataTable);
        }
예제 #7
0
 private static string GetEnabledNavigation(IUQueryContext context, DataRow row, string navigationKey)
 {
     try
     {
         switch (navigationKey)
         {
         default:
             return("1");
         }
     }
     catch
     {
         return("1");
     }
 }
예제 #8
0
        public static void GetActionsNavigationsEnabledState(IUQueryContext context, DataTable data, List <string> actionList, List <string> navigationList)
        {
            if (data == null)
            {
                return;
            }

            // Add control columns to the DataTable
            if (!data.Columns.Contains(Constants.ACTIONS_ACTIVATION_COLUMN_NAME))
            {
                data.Columns.Add(Constants.ACTIONS_ACTIVATION_COLUMN_NAME, typeof(string));
            }

            if (!data.Columns.Contains(Constants.NAVIGATIONS_ACTIVATION_COLUMN_NAME))
            {
                data.Columns.Add(Constants.NAVIGATIONS_ACTIVATION_COLUMN_NAME, typeof(string));
            }

            string activationActionsValue;
            string activationNavigationsValue;

            foreach (System.Data.DataRow lRow in data.Rows)
            {
                activationActionsValue = "";
                if (actionList != null)
                {
                    foreach (string actionKey in actionList)
                    {
                        activationActionsValue += GetEnabledAction(context, lRow, actionKey);
                    }
                }
                lRow[Constants.ACTIONS_ACTIVATION_COLUMN_NAME] = activationActionsValue;

                activationNavigationsValue = "";
                if (navigationList != null)
                {
                    foreach (string navigationKey in navigationList)
                    {
                        activationNavigationsValue += GetEnabledNavigation(context, lRow, navigationKey);
                    }
                }
                lRow[Constants.NAVIGATIONS_ACTIVATION_COLUMN_NAME] = activationNavigationsValue;
            }
        }
예제 #9
0
        private static string GetEnabledNavigation(IUQueryContext context, DataRow row, string navigationKey)
        {
            try
            {
                switch (navigationKey)
                {
                case "Clas_1348178542592347NavOfer_AutoElemNav_1_Alias":
                {
                    return(getNavigation_RevisionPasajero__Auto__RevisionPasajero(context, row, navigationKey));
                }

                default:
                    return("1");
                }
            }
            catch
            {
                return("1");
            }
        }
예제 #10
0
        /// <summary>
        /// Copy constructor
        /// </summary>
        /// <param name="nodeToBeCopied"></param>
        /// <param name="newExchangeInfo"></param>
        public TreeNodeController(TreeNodeController nodeToBeCopied, ExchangeInfoNavigation newExchangeInfo)
        {
            mRecursiveNodes   = new List <TreeNodeController>();
            mParentNodeId     = nodeToBeCopied.ParentNodeId;
            mNodeId           = nodeToBeCopied.NodeId;
            mIsMainMaster     = false;
            mShowGroupingNode = nodeToBeCopied.ShowGroupingNode;
            Filters           = new FilterControllerList();
            mQueryContext     = new IUPopulationContext(newExchangeInfo, nodeToBeCopied.QueryContext.ClassName, "");
            mQueryContext.DisplaySetAttributes = nodeToBeCopied.QueryContext.DisplaySetAttributes;
            mOriginalNode = nodeToBeCopied;
            IUPopulationContext lPopContext = nodeToBeCopied.QueryContext as IUPopulationContext;

            if (lPopContext != null)
            {
                ((IUPopulationContext)QueryContext).BlockSize = lPopContext.BlockSize;
            }
            mShowInTree  = nodeToBeCopied.ShowInTree;
            mFinalNodeID = nodeToBeCopied.FinalNodeID;
        }
예제 #11
0
        /// <summary>
        /// Gets the state formulas (enabled or disabled) for action and navigation items (preconditions).
        /// </summary>
        /// <param name="context">Context.</param>
        /// <param name="data">Datatable.</param>
        /// <param name="actionList">Action list.</param>
        /// <param name="navigationList">Navigation list.</param>
        public static void GetActionsNavigationsEnabledStateFormulas(IUQueryContext context, DataTable data, List <string> actionList, List <string> navigationList)
        {
            try
            {
                // Parameter values.
                object[] lParameters = new object[4];
                lParameters[0] = context;
                lParameters[1] = data;
                lParameters[2] = actionList;
                lParameters[3] = navigationList;

                // Parameter types.
                Type[] lTypes = new Type[4];
                lTypes[0] = typeof(IUQueryContext);
                lTypes[1] = typeof(DataTable);
                lTypes[2] = typeof(List <string>);
                lTypes[3] = typeof(List <string>);

                ExecuteMethod(GetClassTypeName(context.ClassName), "GetActionsNavigationsEnabledState", lTypes, lParameters);
            }
            catch
            {
            }
        }
예제 #12
0
        /// <summary>
        /// Configures the controller from the data context.
        /// </summary>
        /// <param name="context">IU context</param>
        public void ConfigureByContext(IUQueryContext context)
        {
            if (AssociatedServiceController != null && context != null && context.AssociatedServiceContext != null)
            {
                AssociatedServiceController.ConfigureByContext(context.AssociatedServiceContext);
            }

            base.ConfigureByContext(context);
        }
예제 #13
0
 private static string GetEnabledNavigation(IUQueryContext context, DataRow row, string navigationKey)
 {
     try
     {
         switch (navigationKey)
         {
             case "Clas_1348178673664478NavOfer_AutoElemNav_1_Alias":
                 {
                     return getNavigation_Revision_IIU_Revision_Revision(context, row, navigationKey);
                 }
             case "Clas_1348178673664478NavOfer_AutoElemNav_2_Alias":
                 {
                     return getNavigation_PasajeroAeronave_IIU_PasajeroAeronave_PasajeroAeronave(context, row, navigationKey);
                 }
             default:
                 return "1";
         }
     }
     catch
     {
         return "1";
     }
 }
예제 #14
0
 /// <summary>
 /// Decides if the navigation element has to be enabled/disabled ("1" / "0").
 /// By default it is always enabled
 /// </summary>
 /// <param name="context">IUQueryContext object received.</param>
 /// <param name="row">DataRow that contains the data of the instance selected.</param>
 /// <param name="navigationItemIdXML">XML identificator of the navigation element.</param>
 /// <returns>A string indicating if the navigation element has to be enabled "1" or disabled "0".</returns>
 private static string getNavigation_Revision_IIU_Revision_Revision(IUQueryContext context, DataRow row, string navigationItemIdXML)
 {
     return "1";
 }
예제 #15
0
 /// <summary>
 /// Decides if the action MDIU_PasajeroAeronave of PasajeroAeronave has to be enabled or disabled ("1" / "0").
 /// </summary>
 /// <param name="context">IUQueryContext object received.</param>
 /// <param name="row">DataRow that contains the data of the instance selected.</param>
 /// <param name="actionItemIdXML">XML identificator of the action element.</param>
 /// <returns>A string indicating if the action element has to be enabled "1" or disabled "0".</returns>
 private static string Action_PasajeroAeronave_MDIU_PasajeroAeronave(IUQueryContext context, DataRow row, string actionItemIdXML)
 {
     return("1");
 }
예제 #16
0
 /// <summary>
 /// Decides if the action _Auto_ of RevisionPasajero has to be enabled or disabled ("1" / "0").
 /// </summary>
 /// <param name="context">IUQueryContext object received.</param>
 /// <param name="row">DataRow that contains the data of the instance selected.</param>
 /// <param name="actionItemIdXML">XML identificator of the action element.</param>
 /// <returns>A string indicating if the action element has to be enabled "1" or disabled "0".</returns>
 private static string Action_RevisionPasajero__Auto_(IUQueryContext context, DataRow row, string actionItemIdXML)
 {
     return "1";
 }
예제 #17
0
 /// <summary>
 /// Decides if the navigation element has to be enabled/disabled ("1" / "0").
 /// By default it is always enabled
 /// </summary>
 /// <param name="context">IUQueryContext object received.</param>
 /// <param name="row">DataRow that contains the data of the instance selected.</param>
 /// <param name="navigationItemIdXML">XML identificator of the navigation element.</param>
 /// <returns>A string indicating if the navigation element has to be enabled "1" or disabled "0".</returns>
 private static string getNavigation_Aeronave__Auto__Aeronave(IUQueryContext context, DataRow row, string navigationItemIdXML)
 {
     return "1";
 }
예제 #18
0
 /// <summary>
 /// Decides if the action _Auto_ of Aeronave has to be enabled or disabled ("1" / "0").
 /// </summary>
 /// <param name="context">IUQueryContext object received.</param>
 /// <param name="row">DataRow that contains the data of the instance selected.</param>
 /// <param name="actionItemIdXML">XML identificator of the action element.</param>
 /// <returns>A string indicating if the action element has to be enabled "1" or disabled "0".</returns>
 private static string Action_Aeronave__Auto_(IUQueryContext context, DataRow row, string actionItemIdXML)
 {
     return "1";
 }
예제 #19
0
 /// <summary>
 /// Decides if the action Crear_Aeronave of Aeronave has to be enabled or disabled ("1" / "0").
 /// </summary>
 /// <param name="context">IUQueryContext object received.</param>
 /// <param name="row">DataRow that contains the data of the instance selected.</param>
 /// <param name="actionItemIdXML">XML identificator of the action element.</param>
 /// <returns>A string indicating if the action element has to be enabled "1" or disabled "0".</returns>
 private static string Action_Aeronave_Crear_Aeronave(IUQueryContext context, DataRow row, string actionItemIdXML)
 {
     return("1");
 }
예제 #20
0
 /// <summary>
 /// Refresh one instance using the context and Oid received as arguments.
 /// </summary>
 /// <param name="queryContext">Contexto del nodo.</param>
 /// <param name="nodeId">List of Oid to be refreshed.</param>
 /// <param name="oid">Oid of the instance to be refreshed.</param>
 /// <param name="displaySetInfo">DisplaySet information used to represent the instance data.</param>
 private void RefreshInstance(IUQueryContext queryContext, string nodeId, Oid oid, DisplaySetInformation displaySetInfo)
 {
     try
     {
         DataTable lInstance = Logic.ExecuteQueryInstance(Logic.Agent, oid, queryContext.DisplaySetAttributes);
         Tree.UpdateNodeValues(nodeId, oid, lInstance, displaySetInfo);
     }
     catch
     {
     }
 }
예제 #21
0
 /// <summary>
 /// Decides if the navigation element has to be enabled/disabled ("1" / "0").
 /// By default it is always enabled
 /// </summary>
 /// <param name="context">IUQueryContext object received.</param>
 /// <param name="row">DataRow that contains the data of the instance selected.</param>
 /// <param name="navigationItemIdXML">XML identificator of the navigation element.</param>
 /// <returns>A string indicating if the navigation element has to be enabled "1" or disabled "0".</returns>
 private static string getNavigation_RevisionPasajero__Auto__RevisionPasajero(IUQueryContext context, DataRow row, string navigationItemIdXML)
 {
     return("1");
 }
예제 #22
0
 private static string GetEnabledNavigation(IUQueryContext context, DataRow row, string navigationKey)
 {
     try
     {
         switch (navigationKey)
         {
             default:
                 return "1";
         }
     }
     catch
     {
         return "1";
     }
 }
예제 #23
0
 /// <summary>
 /// Decides if the action SIU_delete_instance of Revision has to be enabled or disabled ("1" / "0").
 /// </summary>
 /// <param name="context">IUQueryContext object received.</param>
 /// <param name="row">DataRow that contains the data of the instance selected.</param>
 /// <param name="actionItemIdXML">XML identificator of the action element.</param>
 /// <returns>A string indicating if the action element has to be enabled "1" or disabled "0".</returns>
 private static string Action_Revision_SIU_delete_instance(IUQueryContext context, DataRow row, string actionItemIdXML)
 {
     return "1";
 }
예제 #24
0
 /// <summary>
 /// Decides if the action SIU_create_instance of Revision has to be enabled or disabled ("1" / "0").
 /// </summary>
 /// <param name="context">IUQueryContext object received.</param>
 /// <param name="row">DataRow that contains the data of the instance selected.</param>
 /// <param name="actionItemIdXML">XML identificator of the action element.</param>
 /// <returns>A string indicating if the action element has to be enabled "1" or disabled "0".</returns>
 private static string Action_Revision_SIU_create_instance(IUQueryContext context, DataRow row, string actionItemIdXML)
 {
     return("1");
 }
예제 #25
0
 /// <summary>
 /// Decides if the navigation element has to be enabled/disabled ("1" / "0").
 /// By default it is always enabled
 /// </summary>
 /// <param name="context">IUQueryContext object received.</param>
 /// <param name="row">DataRow that contains the data of the instance selected.</param>
 /// <param name="navigationItemIdXML">XML identificator of the navigation element.</param>
 /// <returns>A string indicating if the navigation element has to be enabled "1" or disabled "0".</returns>
 private static string getNavigation_Aeronave__Auto__Aeronave(IUQueryContext context, DataRow row, string navigationItemIdXML)
 {
     return("1");
 }
예제 #26
0
        /// <summary>
        /// Retunrs the instances related with the received Oid using the received context
        /// </summary>
        /// <param name="relatedOid"></param>
        /// <param name="queryContext"></param>
        /// <returns></returns>
        private DataTable GetPopulationRelatedWith(Oid relatedOid, IUQueryContext queryContext)
        {
            if (relatedOid == null || queryContext == null)
                return null;

            List<Oid> lOids = new List<Oid>();
            lOids.Add(relatedOid);

            // Assign the exchange info to the context
            queryContext.ExchangeInformation.SelectedOids = lOids;
            queryContext.SelectedOids = lOids;

            // Clear the last oid
            IUPopulationContext populationContext = queryContext as IUPopulationContext;
            if (populationContext != null)
            {
                populationContext.LastOids.Clear();
            }

            DataTable lData = null;
            try
            {
                lData = Logic.ExecuteQueryRelated(queryContext);
            }
            catch (Exception exc)
            {
                ScenarioManager.LaunchErrorScenario(exc);
                return null;
            }

            return lData;
        }
예제 #27
0
 /// <summary>
 /// Copy constructor
 /// </summary>
 /// <param name="nodeToBeCopied"></param>
 /// <param name="newExchangeInfo"></param>
 public TreeNodeController(TreeNodeController nodeToBeCopied, ExchangeInfoNavigation newExchangeInfo)
 {
     mRecursiveNodes = new List<TreeNodeController>();
     mParentNodeId = nodeToBeCopied.ParentNodeId;
     mNodeId = nodeToBeCopied.NodeId;
     mIsMainMaster = false;
     mShowGroupingNode = nodeToBeCopied.ShowGroupingNode;
     Filters = new FilterControllerList();
     mQueryContext = new IUPopulationContext(newExchangeInfo, nodeToBeCopied.QueryContext.ClassName, "");
     mQueryContext.DisplaySetAttributes = nodeToBeCopied.QueryContext.DisplaySetAttributes;
     mOriginalNode = nodeToBeCopied;
     IUPopulationContext lPopContext = nodeToBeCopied.QueryContext as IUPopulationContext;
     if (lPopContext != null)
     {
         ((IUPopulationContext)QueryContext).BlockSize = lPopContext.BlockSize;
     }
     mShowInTree = nodeToBeCopied.ShowInTree;
     mFinalNodeID = nodeToBeCopied.FinalNodeID;
 }
예제 #28
0
 /// <summary>
 /// Get the value to Enable/Disable the action idientified by the Key
 /// </summary>
 /// <param name="context"></param>
 /// <param name="row">Instance values</param>
 /// <param name="actionKey">Action Identifier</param>
 /// <returns></returns>
 private static string GetEnabledAction(IUQueryContext context, DataRow row, string actionKey)
 {
     try
     {
         switch (actionKey)
         {
             case "Clas_1348178542592177AccOfer_AutoElemAcc_1_Alias":
                 {
                     return Action_PasajeroAeronave_SIU_create_instance(context, row, actionKey);
                 }
             case "Clas_1348178542592177AccOfer_AutoElemAcc_2_Alias":
                 {
                     return Action_PasajeroAeronave_SIU_delete_instance(context, row, actionKey);
                 }
             case "Clas_1348178542592177AccOfer_AutoElemAcc_3_Alias":
                 {
                     return Action_PasajeroAeronave_SIU_edit_instance(context, row, actionKey);
                 }
             case "Clas_1348178542592177AccOfer_AutoElemAcc_4_Alias":
                 {
                     return Action_PasajeroAeronave_IIU_PasajeroAeronave(context, row, actionKey);
                 }
             case "Clas_1348178542592177AccOfer_AutoElemAcc_5_Alias":
                 {
                     return Action_PasajeroAeronave_MDIU_PasajeroAeronave(context, row, actionKey);
                 }
             default:
                 return "1";
         }
     }
     catch
     {
         return "1";
     }
 }
예제 #29
0
        /// <summary>
        /// Execute a query related with other instance.
        /// </summary>
        /// <param name="context">Current context.</param>
        /// <returns>A DataTable with the instances searched.</returns>
        public static DataTable ExecuteQueryRelated(IUQueryContext context)
        {
            try
            {
                ExchangeInfo lExchangeInfo = context.ExchangeInformation;

                if (lExchangeInfo.ExchangeType != ExchangeType.Navigation || lExchangeInfo.SelectedOids.Count == 0)
                {
                    return null;
                }

                IUPopulationContext lIUContext = context as IUPopulationContext;
                int blockSize=1;
                if (lIUContext != null)
                {
                    blockSize = lIUContext.BlockSize;
                }
                ExchangeInfoNavigation lNavInfo = lExchangeInfo as ExchangeInfoNavigation;
                // Specific case. No role name indicates Query by Instance.
                if (lNavInfo.RolePath == "")
                {
                    if (lIUContext != null)
                    {
                        lIUContext.LastBlock = true;
                    }

                    RevisionPasajeroOid lOidInstance = new RevisionPasajeroOid(lNavInfo.SelectedOids[0]);
                    return ExecuteQueryInstance(context.Agent, lOidInstance, context.DisplaySetAttributes);
                }

                // Get link items.
                Oid lOid = lNavInfo.SelectedOids[0];
                Dictionary<string, Oid> lLinkItems = new Dictionary<string, Oid>(StringComparer.CurrentCultureIgnoreCase);
                lLinkItems.Add(lNavInfo.RolePath, lOid);

                bool lLastBlock = true;
                RevisionPasajeroOid lLastOid = null;
                string lOrderCriteria = string.Empty;

                // Get population members.
                if (lIUContext != null)
                {
                    if (lIUContext.LastOid != null)
                    {
                        lLastOid = new RevisionPasajeroOid(lIUContext.LastOid);
                    }
                    lOrderCriteria = lIUContext.OrderCriteriaNameSelected;
                }
                NavigationalFiltering navigationalFiltering = NavigationalFiltering.GetNavigationalFiltering(context);
                DataTable lDataTable = ExecuteQueryRelated(context.Agent, lLinkItems, context.DisplaySetAttributes, lOrderCriteria, navigationalFiltering, lLastOid, blockSize, ref lLastBlock);

                if (lIUContext != null)
                {
                    lIUContext.LastBlock = lLastBlock;
                }

                return lDataTable;
            }
            catch (Exception e)
            {
                ScenarioManager.LaunchErrorScenario(e);
                return null;
            }
        }
예제 #30
0
 /// <summary>
 /// Decides if the navigation element has to be enabled/disabled ("1" / "0").
 /// By default it is always enabled
 /// </summary>
 /// <param name="context">IUQueryContext object received.</param>
 /// <param name="row">DataRow that contains the data of the instance selected.</param>
 /// <param name="navigationItemIdXML">XML identificator of the navigation element.</param>
 /// <returns>A string indicating if the navigation element has to be enabled "1" or disabled "0".</returns>
 private static string getNavigation_RevisionPasajero__Auto__RevisionPasajero(IUQueryContext context, DataRow row, string navigationItemIdXML)
 {
     return "1";
 }
예제 #31
0
 /// <summary>
 /// Decides if the action SIU_edit_instance of Aeronave has to be enabled or disabled ("1" / "0").
 /// </summary>
 /// <param name="context">IUQueryContext object received.</param>
 /// <param name="row">DataRow that contains the data of the instance selected.</param>
 /// <param name="actionItemIdXML">XML identificator of the action element.</param>
 /// <returns>A string indicating if the action element has to be enabled "1" or disabled "0".</returns>
 private static string Action_Aeronave_SIU_edit_instance(IUQueryContext context, DataRow row, string actionItemIdXML)
 {
     return "1";
 }
예제 #32
0
 /// <summary>
 /// Decides if the navigation element has to be enabled/disabled ("1" / "0").
 /// By default it is always enabled
 /// </summary>
 /// <param name="context">IUQueryContext object received.</param>
 /// <param name="row">DataRow that contains the data of the instance selected.</param>
 /// <param name="navigationItemIdXML">XML identificator of the navigation element.</param>
 /// <returns>A string indicating if the navigation element has to be enabled "1" or disabled "0".</returns>
 private static string getNavigation_Revision_IIU_Revision_Revision(IUQueryContext context, DataRow row, string navigationItemIdXML)
 {
     return("1");
 }
예제 #33
0
 private static string GetEnabledNavigation(IUQueryContext context, DataRow row, string navigationKey)
 {
     try
     {
         switch (navigationKey)
         {
             case "Clas_1348178542592347NavOfer_AutoElemNav_1_Alias":
                 {
                     return getNavigation_RevisionPasajero__Auto__RevisionPasajero(context, row, navigationKey);
                 }
             default:
                 return "1";
         }
     }
     catch
     {
         return "1";
     }
 }
예제 #34
0
        /// <summary>
        /// Returns true if the context indicates that the last block has been received
        /// </summary>
        /// <param name="queryContext"></param>
        /// <returns></returns>
        private bool IsLastBlock(IUQueryContext queryContext)
        {
            IUPopulationContext popContext = queryContext as IUPopulationContext;
            if (popContext == null)
            {
                return true;
            }

            return popContext.LastBlock;
        }
예제 #35
0
 /// <summary>
 /// Decides if the action SIU_delete_instance of NaveNodriza has to be enabled or disabled ("1" / "0").
 /// </summary>
 /// <param name="context">IUQueryContext object received.</param>
 /// <param name="row">DataRow that contains the data of the instance selected.</param>
 /// <param name="actionItemIdXML">XML identificator of the action element.</param>
 /// <returns>A string indicating if the action element has to be enabled "1" or disabled "0".</returns>
 private static string Action_NaveNodriza_SIU_delete_instance(IUQueryContext context, DataRow row, string actionItemIdXML)
 {
     return("1");
 }
예제 #36
0
        public static void GetActionsNavigationsEnabledState(IUQueryContext context, DataTable data, List<string> actionList, List<string> navigationList)
        {
            if (data == null)
            {
                return;
            }

            // Add control columns to the DataTable
            if (!data.Columns.Contains(Constants.ACTIONS_ACTIVATION_COLUMN_NAME))
            {
                data.Columns.Add(Constants.ACTIONS_ACTIVATION_COLUMN_NAME, typeof(string));
            }

            if (!data.Columns.Contains(Constants.NAVIGATIONS_ACTIVATION_COLUMN_NAME))
            {
                data.Columns.Add(Constants.NAVIGATIONS_ACTIVATION_COLUMN_NAME, typeof(string));
            }

            string activationActionsValue;
            string activationNavigationsValue;
            foreach (System.Data.DataRow lRow in data.Rows)
            {
                activationActionsValue = "";
                if (actionList != null)
                {
                    foreach (string actionKey in actionList)
                    {
                        activationActionsValue += GetEnabledAction(context, lRow, actionKey);
                    }
                }
                lRow[Constants.ACTIONS_ACTIVATION_COLUMN_NAME] = activationActionsValue;

                activationNavigationsValue = "";
                if (navigationList != null)
                {
                    foreach (string navigationKey in navigationList)
                    {
                        activationNavigationsValue += GetEnabledNavigation(context, lRow, navigationKey);
                    }
                }
                lRow[Constants.NAVIGATIONS_ACTIVATION_COLUMN_NAME] = activationNavigationsValue;
            }
        }
예제 #37
0
 /// <summary>
 /// Get the value to Enable/Disable the action idientified by the Key
 /// </summary>
 /// <param name="context"></param>
 /// <param name="row">Instance values</param>
 /// <param name="actionKey">Action Identifier</param>
 /// <returns></returns>
 private static string GetEnabledAction(IUQueryContext context, DataRow row, string actionKey)
 {
     try
     {
         switch (actionKey)
         {
             case "Clas_1348178411520734AccOfer_AutoElemAcc_1_Alias":
                 {
                     return Action_Aeronave_Crear_Aeronave(context, row, actionKey);
                 }
             case "Clas_1348178411520734AccOfer_AutoElemAcc_2_Alias":
                 {
                     return Action_Aeronave_SIU_delete_instance(context, row, actionKey);
                 }
             case "Clas_1348178411520734AccOfer_AutoElemAcc_3_Alias":
                 {
                     return Action_Aeronave_SIU_edit_instance(context, row, actionKey);
                 }
             case "Clas_1348178411520734AccOfer_AutoElemAcc_4_Alias":
                 {
                     return Action_Aeronave__Auto_(context, row, actionKey);
                 }
             default:
                 return "1";
         }
     }
     catch
     {
         return "1";
     }
 }
예제 #38
0
 /// <summary>
 /// Decides if the action SIU_edit_instance of RevisionPasajero has to be enabled or disabled ("1" / "0").
 /// </summary>
 /// <param name="context">IUQueryContext object received.</param>
 /// <param name="row">DataRow that contains the data of the instance selected.</param>
 /// <param name="actionItemIdXML">XML identificator of the action element.</param>
 /// <returns>A string indicating if the action element has to be enabled "1" or disabled "0".</returns>
 private static string Action_RevisionPasajero_SIU_edit_instance(IUQueryContext context, DataRow row, string actionItemIdXML)
 {
     return "1";
 }
예제 #39
0
 /// <summary>
 /// Decides if the action _Auto_ of Pasajero has to be enabled or disabled ("1" / "0").
 /// </summary>
 /// <param name="context">IUQueryContext object received.</param>
 /// <param name="row">DataRow that contains the data of the instance selected.</param>
 /// <param name="actionItemIdXML">XML identificator of the action element.</param>
 /// <returns>A string indicating if the action element has to be enabled "1" or disabled "0".</returns>
 private static string Action_Pasajero__Auto_(IUQueryContext context, DataRow row, string actionItemIdXML)
 {
     return("1");
 }
예제 #40
0
 /// <summary>
 /// Get the value to Enable/Disable the action idientified by the Key
 /// </summary>
 /// <param name="context"></param>
 /// <param name="row">Instance values</param>
 /// <param name="actionKey">Action Identifier</param>
 /// <returns></returns>
 private static string GetEnabledAction(IUQueryContext context, DataRow row, string actionKey)
 {
     try
     {
         switch (actionKey)
         {
             case "Clas_1348178673664478AccOfer_AutoElemAcc_1_Alias":
                 {
                     return Action_RevisionPasajero_SIU_create_instance(context, row, actionKey);
                 }
             case "Clas_1348178673664478AccOfer_AutoElemAcc_2_Alias":
                 {
                     return Action_RevisionPasajero_SIU_delete_instance(context, row, actionKey);
                 }
             case "Clas_1348178673664478AccOfer_AutoElemAcc_3_Alias":
                 {
                     return Action_RevisionPasajero_SIU_edit_instance(context, row, actionKey);
                 }
             case "Clas_1348178673664478AccOfer_AutoElemAcc_4_Alias":
                 {
                     return Action_RevisionPasajero__Auto_(context, row, actionKey);
                 }
             default:
                 return "1";
         }
     }
     catch
     {
         return "1";
     }
 }
예제 #41
0
 /// <summary>
 /// Get the value to Enable/Disable the action idientified by the Key
 /// </summary>
 /// <param name="context"></param>
 /// <param name="row">Instance values</param>
 /// <param name="actionKey">Action Identifier</param>
 /// <returns></returns>
 private static string GetEnabledAction(IUQueryContext context, DataRow row, string actionKey)
 {
     try
     {
         switch (actionKey)
         {
             case "Clas_1347649273856884AccOfer_AutoElemAcc_1_Alias":
                 {
                     return Action_NaveNodriza_Crear_NaveNodriza(context, row, actionKey);
                 }
             case "Clas_1347649273856884AccOfer_AutoElemAcc_2_Alias":
                 {
                     return Action_NaveNodriza_SIU_delete_instance(context, row, actionKey);
                 }
             case "Clas_1347649273856884AccOfer_AutoElemAcc_3_Alias":
                 {
                     return Action_NaveNodriza_SIU_edit_instance(context, row, actionKey);
                 }
             case "Clas_1347649273856884AccOfer_AutoElemAcc_4_Alias":
                 {
                     return Action_NaveNodriza__Auto_(context, row, actionKey);
                 }
             default:
                 return "1";
         }
     }
     catch
     {
         return "1";
     }
 }
예제 #42
0
 /// <summary>
 /// Decides if the navigation element has to be enabled/disabled ("1" / "0").
 /// By default it is always enabled
 /// </summary>
 /// <param name="context">IUQueryContext object received.</param>
 /// <param name="row">DataRow that contains the data of the instance selected.</param>
 /// <param name="navigationItemIdXML">XML identificator of the navigation element.</param>
 /// <returns>A string indicating if the navigation element has to be enabled "1" or disabled "0".</returns>
 private static string getNavigation_PasajeroAeronave_IIU_PasajeroAeronave_PasajeroAeronave(IUQueryContext context, DataRow row, string navigationItemIdXML)
 {
     return "1";
 }
예제 #43
0
        /// <summary>
        /// Gets the state formulas (enabled or disabled) for action and navigation items (preconditions).
        /// </summary>
        /// <param name="context">Context.</param>
        /// <param name="data">Datatable.</param>
        /// <param name="actionList">Action list.</param>
        /// <param name="navigationList">Navigation list.</param>
        public static void GetActionsNavigationsEnabledStateFormulas(IUQueryContext context, DataTable data, List<string> actionList, List<string> navigationList)
        {
            try
            {
                // Parameter values.
                object[] lParameters = new object[4];
                lParameters[0] = context;
                lParameters[1] = data;
                lParameters[2] = actionList;
                lParameters[3] = navigationList;

                // Parameter types.
                Type[] lTypes = new Type[4];
                lTypes[0] = typeof(IUQueryContext);
                lTypes[1] = typeof(DataTable);
                lTypes[2] = typeof(List<string>);
                lTypes[3] = typeof(List<string>);

                ExecuteMethod(GetClassTypeName(context.ClassName), "GetActionsNavigationsEnabledState", lTypes, lParameters);
            }
            catch
            {
            }
        }
예제 #44
0
        /// <summary>
        /// Execute a query related with other instance.
        /// </summary>
        /// <param name="context">Current context.</param>
        /// <returns>A DataTable with the instances searched.</returns>
        public static DataTable ExecuteQueryRelated(IUQueryContext context)
        {
            try
            {
                ExchangeInfo lExchangeInfo = context.ExchangeInformation;

                if (lExchangeInfo.ExchangeType != ExchangeType.Navigation || lExchangeInfo.SelectedOids.Count == 0)
                {
                    return(null);
                }

                IUPopulationContext lIUContext = context as IUPopulationContext;
                int blockSize = 1;
                if (lIUContext != null)
                {
                    blockSize = lIUContext.BlockSize;
                }
                ExchangeInfoNavigation lNavInfo = lExchangeInfo as ExchangeInfoNavigation;
                // Specific case. No role name indicates Query by Instance.
                if (lNavInfo.RolePath == "")
                {
                    if (lIUContext != null)
                    {
                        lIUContext.LastBlock = true;
                    }

                    PasajeroOid lOidInstance = new PasajeroOid(lNavInfo.SelectedOids[0]);
                    return(ExecuteQueryInstance(context.Agent, lOidInstance, context.DisplaySetAttributes));
                }

                // Get link items.
                Oid lOid = lNavInfo.SelectedOids[0];
                Dictionary <string, Oid> lLinkItems = new Dictionary <string, Oid>(StringComparer.CurrentCultureIgnoreCase);
                lLinkItems.Add(lNavInfo.RolePath, lOid);

                bool        lLastBlock     = true;
                PasajeroOid lLastOid       = null;
                string      lOrderCriteria = string.Empty;

                // Get population members.
                if (lIUContext != null)
                {
                    if (lIUContext.LastOid != null)
                    {
                        lLastOid = new PasajeroOid(lIUContext.LastOid);
                    }
                    lOrderCriteria = lIUContext.OrderCriteriaNameSelected;
                }
                NavigationalFiltering navigationalFiltering = NavigationalFiltering.GetNavigationalFiltering(context);
                DataTable             lDataTable            = ExecuteQueryRelated(context.Agent, lLinkItems, context.DisplaySetAttributes, lOrderCriteria, navigationalFiltering, lLastOid, blockSize, ref lLastBlock);

                if (lIUContext != null)
                {
                    lIUContext.LastBlock = lLastBlock;
                }

                return(lDataTable);
            }
            catch (Exception e)
            {
                ScenarioManager.LaunchErrorScenario(e);
                return(null);
            }
        }
예제 #45
0
 /// <summary>
 /// Decides if the action SIU_delete_instance of PasajeroAeronave has to be enabled or disabled ("1" / "0").
 /// </summary>
 /// <param name="context">IUQueryContext object received.</param>
 /// <param name="row">DataRow that contains the data of the instance selected.</param>
 /// <param name="actionItemIdXML">XML identificator of the action element.</param>
 /// <returns>A string indicating if the action element has to be enabled "1" or disabled "0".</returns>
 private static string Action_PasajeroAeronave_SIU_delete_instance(IUQueryContext context, DataRow row, string actionItemIdXML)
 {
     return "1";
 }
예제 #46
0
 /// <summary>
 /// Decides if the action _Auto_ of NaveNodriza has to be enabled or disabled ("1" / "0").
 /// </summary>
 /// <param name="context">IUQueryContext object received.</param>
 /// <param name="row">DataRow that contains the data of the instance selected.</param>
 /// <param name="actionItemIdXML">XML identificator of the action element.</param>
 /// <returns>A string indicating if the action element has to be enabled "1" or disabled "0".</returns>
 private static string Action_NaveNodriza__Auto_(IUQueryContext context, DataRow row, string actionItemIdXML)
 {
     return("1");
 }
예제 #47
0
        /// <summary>
        /// Returns the next data block using the context and the last Oid received as arguments
        /// </summary>
        /// <param name="queryContext"></param>
        /// <param name="lastOid"></param>
        /// <returns></returns>
        private DataTable GetNextDataBlock(IUQueryContext queryContext, Oid lastOid)
        {
            if (queryContext == null)
            {
                return null;
            }

            DataTable lData = null;

            try
            {
                IUPopulationContext populationContext = queryContext as IUPopulationContext;
                if (populationContext != null)
                {

                    populationContext.LastOids.Clear();
                    populationContext.LastOid = lastOid;

                    // Depending on the ExchangeInfo Type
                    switch (populationContext.ExchangeInformation.ExchangeType)
                    {
                        case ExchangeType.Navigation:
                            if (populationContext.ExecutedFilter.Equals(""))
                            {
                                // If this Population doesn't contain filters, search all related population
                                lData = Logic.ExecuteQueryRelated(populationContext);
                            }
                            else
                            {
                                // Search using the executed filter.
                                lData = Logic.ExecuteQueryFilter(populationContext);
                            }
                            break;
                        case ExchangeType.Action:
                        case ExchangeType.SelectionForward:
                            // If this Population doesn't contain filters, search all population
                            if (populationContext.Filters.Count == 0)
                            {
                                lData = Logic.ExecuteQueryPopulation(populationContext);
                            }
                            else
                            {
                                // Search using the executed filter.
                                if (!populationContext.ExecutedFilter.Equals(""))
                                {
                                    lData = Logic.ExecuteQueryFilter(populationContext);
                                }
                            }
                            break;
                        default:
                            lData = null;
                            break;
                    }

                    // Assign the LastOid to the context
                    populationContext.LastOid = Adaptor.ServerConnection.GetLastOid(lData);

                }
                else
                {
                    // Instance
                    lData = Logic.ExecuteQueryRelated(queryContext);
                }
            }
            catch (Exception logicException)
            {
                ScenarioManager.LaunchErrorScenario(logicException);
            }
            return lData;
        }
예제 #48
0
 /// <summary>
 /// Decides if the action SIU_edit_instance of Pasajero has to be enabled or disabled ("1" / "0").
 /// </summary>
 /// <param name="context">IUQueryContext object received.</param>
 /// <param name="row">DataRow that contains the data of the instance selected.</param>
 /// <param name="actionItemIdXML">XML identificator of the action element.</param>
 /// <returns>A string indicating if the action element has to be enabled "1" or disabled "0".</returns>
 private static string Action_Pasajero_SIU_edit_instance(IUQueryContext context, DataRow row, string actionItemIdXML)
 {
     return("1");
 }
예제 #49
0
        /// <summary>
        /// Execute a query related with other instance.
        /// </summary>
        /// <param name="context">Current context.</param>
        /// <returns>A DataTable with the instances searched.</returns>
        public static DataTable ExecuteQueryRelated(IUQueryContext context)
        {
            // Parameter values
            object[] lParameters = new object[1];
            lParameters[0] = context;

            // Parameter types
            Type[] lTypes = new Type[1];
            lTypes[0] = typeof(IUQueryContext);

            return ExecuteMethod(GetClassTypeName(context.ClassName), "ExecuteQueryRelated", lTypes, lParameters) as DataTable;
        }
예제 #50
0
 /// <summary>
 /// Decides if the navigation element has to be enabled/disabled ("1" / "0").
 /// By default it is always enabled
 /// </summary>
 /// <param name="context">IUQueryContext object received.</param>
 /// <param name="row">DataRow that contains the data of the instance selected.</param>
 /// <param name="navigationItemIdXML">XML identificator of the navigation element.</param>
 /// <returns>A string indicating if the navigation element has to be enabled "1" or disabled "0".</returns>
 private static string getNavigation_PasajeroAeronave_IIU_PasajeroAeronave_PasajeroAeronave(IUQueryContext context, DataRow row, string navigationItemIdXML)
 {
     return("1");
 }
예제 #51
0
 /// <summary>
 /// Decides if the action Crear_NaveNodriza of NaveNodriza has to be enabled or disabled ("1" / "0").
 /// </summary>
 /// <param name="context">IUQueryContext object received.</param>
 /// <param name="row">DataRow that contains the data of the instance selected.</param>
 /// <param name="actionItemIdXML">XML identificator of the action element.</param>
 /// <returns>A string indicating if the action element has to be enabled "1" or disabled "0".</returns>
 private static string Action_NaveNodriza_Crear_NaveNodriza(IUQueryContext context, DataRow row, string actionItemIdXML)
 {
     return "1";
 }