private void AddPromptParameter(PromptElement prompt, TransactionLevel level)
        {
            foreach (TransactionAttribute ta in level.PrimaryKey)
            {
                bool carrega = true;
                bool notnull = false;
                foreach (SettingsDefaultFilterElement filter in settings.DefaultFilters.DefaultFilters)
                {
                    if (filter.Prompt)
                    {
                        if (filter.Attribute != null)
                        {
                            if (filter.Attribute.Name == ta.Name)
                            {
                                if (!filter.Parm)
                                {
                                    carrega = false;
                                }
                                else
                                {
                                    if (filter.ParmNotNull)
                                    {
                                        notnull = true;
                                    }

                                }

                            }
                        }
                    }
                }
                if (carrega)
                {
                    ParameterElement par = prompt.AddParameter(ta.Name);
                    if (notnull)
                    {
                        par.Null = false;
                    }
                }
            }
            if (settings.Template.PromptSuggestParmDescription)
            {
                if (level.DescriptionAttribute != null)
                {
                    prompt.AddParameter(level.DescriptionAttribute.Name);
                }
            }
        }
Beispiel #2
0
 public string PromptName(PromptElement prompt)
 {
     return (String.IsNullOrEmpty(prompt.GetObjectName()) ? prompt.Name : prompt.GetObjectName());
 }
        private void AddPrompt(Transaction trn, LevelElement levelElement)
        {
            PromptElement prompt = new PromptElement();
            levelElement.Prompts.Add(prompt);
            string plulralDescription = trn.Description; //(Pluralizer.IsNounPlural(trn.Description) ? trn.Description : Pluralizer.ToPlural(trn.Description));
            if (String.IsNullOrEmpty(levelElement.Instance.Settings.Objects.Prompt))
            {
                prompt.Name = String.Format("Prompt{0}", trn.Name);
            }
            else
            {
                prompt.Name = levelElement.Instance.Settings.Objects.Prompt.Replace("<Object>", trn.Name);
            }
            prompt.Description = FormatString(levelElement.Instance.Settings.Labels.PromptTitle, plulralDescription);
            prompt.Page = PromptElement.PageValue.Default;
            prompt.MasterPage = PromptElement.MasterPageValue.Default;
            prompt.Modes.InsertCondition = levelElement.Instance.Settings.StandardActions.Insert.Condition;
            prompt.Modes.UpdateCondition = levelElement.Instance.Settings.StandardActions.Update.Condition;
            prompt.Modes.DeleteCondition = levelElement.Instance.Settings.StandardActions.Delete.Condition;
            prompt.Modes.DisplayCondition = levelElement.Instance.Settings.StandardActions.Display.Condition;
            prompt.Modes.ExportCondition = levelElement.Instance.Settings.StandardActions.Export.Condition;

            AddSuggestActions(prompt.Actions, levelElement.Instance.Settings);

            AddPromptParameter(prompt, trn.Structure.Root);
            AddPromptAttributes(prompt.Attributes, trn.Structure.Root, trn.Structure.Root.Attributes, AttributeTitle.Column);
            AddGridOrders(prompt, trn, trn.Structure.Root);
            AddGridFilter(prompt, trn, trn.Structure.Root);
        }