コード例 #1
0
        private static DomainAdditionOptions GetOptions(string[] args)
        {
            var options       = ContractorOptionsLoader.Load(Directory.GetCurrentDirectory());
            var domainOptions = new DomainAdditionOptions(options)
            {
                Domain = args[2]
            };

            domainOptions.Domain = domainOptions.Domain.UpperFirstChar();
            return(domainOptions);
        }
コード例 #2
0
        public static void Perform(string[] args)
        {
            if (args.Length < 3)
            {
                Console.WriteLine("Bitte geben sie alle Informationen an. Beispiel: contractor add entity Bankwesen.Bank:Banken [-s|--scope MandantenTrennung.Mandant:Mandanten]");
                return;
            }

            var options = ContractorOptionsLoader.Load(Directory.GetCurrentDirectory());
            EntityAdditionOptions entityOptions = new EntityAdditionOptions(options);

            ParseOptions(entityOptions, args);

            try
            {
                ContractorCoreApi contractorCoreApi = new ContractorCoreApi();
                contractorCoreApi.AddEntity(entityOptions);
                Console.WriteLine($"Entity '{entityOptions.EntityName} ({entityOptions.EntityNamePlural})' zur Domain '{entityOptions.Domain}' hinzugefügt'");
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
        }
コード例 #3
0
        public static void Perform(string[] args)
        {
            if (args.Length < 5)
            {
                Console.WriteLine("Bitte geben sie alle Informationen an. Beispiel: contractor add relation 1:n Bankwesen.Bank:Banken Kundenstamm.Kunde:Kunden [-n|--alternative-property-names Vertragsbank:Vertragskunden]");
                return;
            }

            var options = ContractorOptionsLoader.Load(Directory.GetCurrentDirectory());
            RelationAdditionOptions relationOptions = new RelationAdditionOptions(options);

            ParseOptions(relationOptions, args);

            try
            {
                ContractorCoreApi contractorCoreApi = new ContractorCoreApi();
                contractorCoreApi.Add1ToNRelation(relationOptions);
                Console.WriteLine($"1-zu-N Relation zwischen '{relationOptions.EntityNameFrom}' und '{relationOptions.EntityNamePluralTo}' hinzugefügt");
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
        }
コード例 #4
0
        public static void Perform(string[] args)
        {
            if (args.Length < 6)
            {
                Console.WriteLine("Bitte geben sie einen Domain Name an: contractor add property string:256 Name -e Bankwesen.Bank:Banken [-o | --optional]");
                return;
            }

            var options         = ContractorOptionsLoader.Load(Directory.GetCurrentDirectory());
            var propertyOptions = new PropertyAdditionOptions(options);

            ParseOptions(propertyOptions, args);

            try
            {
                ContractorCoreApi contractorCoreApi = new ContractorCoreApi();
                contractorCoreApi.AddProperty(propertyOptions);
                Console.WriteLine($"Property '{propertyOptions.PropertyName}' zur Entity '{propertyOptions.EntityName}' hinzugefügt'");
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
        }