コード例 #1
0
        private void ProcessItemScheme()
        {
            AWS.NumSchm[] schemes = ServiceManager.ItemService.GetNumberingSchemesByType(AWS.NumSchmType.All);
            AWS.NumSchm   scheme  = schemes.FirstOrDefault(s => s.Name.Equals(Options.SchemeName, StringComparison.InvariantCultureIgnoreCase));

            if (scheme == null)
            {
                string message = string.Format("Unable to find scheme: {0}", Options.SchemeName);

                throw new InvalidOperationException(message);
            }
            Log(MessageCategory.Info, "Processing scheme '{0}'", scheme.Name);
            int fieldCount = 0;

            foreach (AWS.NumSchmField field in scheme.FieldArray)
            {
                if (field.FieldTyp != AWS.FieldType.PredefinedList)
                {
                    continue;
                }
                if (ProcessField((AWS.PredefListField)field))
                {
                    fieldCount++;
                }
            }
            if (fieldCount > 0)
            {
                Log(MessageCategory.Info, "Saving scheme changes");
                ServiceManager.ItemService.UpdateNumberingScheme(scheme);
            }
            else
            {
                Log(MessageCategory.Warning, "No scheme changes detected");
            }
        }
コード例 #2
0
 public Scheme(ACW.NumSchm scheme)
 {
     SchemeId        = scheme.SchmID;
     Name            = scheme.Name;
     FirstFieldType  = scheme.FieldArray.First().FieldTyp.ToString();
     GeneratedNumber = "";
     ErrorMessage    = "";
 }
        public SchemeFields(VDF.Vault.Currency.Connections.Connection connection, long schemeId)
        {
            InitializeComponent();

            ACW.NumSchm Scheme = connection.WebServiceManager.NumberingService.GetNumberingSchemeById(schemeId);

            this.Title += Scheme.Name;

            m_schemeParametersGrid.ItemsSource = Scheme.FieldArray;
        }
コード例 #4
0
        private void M_addSupported_Click(object sender, RoutedEventArgs e)
        {
            if (CustomNumberingProvider != null)
            {
                ACW.NumSchmField[] Fields = new ACW.NumSchmField[]
                {
                    new ACW.AutogenField {
                        Name = "Autogenerated Field", Len = 4, From = 1, To = 1000, StepSize = 1, ZeroPadding = true
                    }
                };

                string Name = "Supported-" + Guid.NewGuid().ToString();

                ACW.NumSchm AddedScheme = NumService.AddNumberingScheme(EntityClassId, Name, CustomNumberingProvider.SysName, Fields, toUpperCase: false, reuseNumbers: false);
                NumService.EnableNumberingSchemes(new long[] { AddedScheme.SchmID }, true);

                DataGridSchemes.Add(new Scheme(AddedScheme));
                m_numberSchemesGrid.Items.Refresh();
            }
        }
コード例 #5
0
        private void M_addUnsupported_Click(object sender, RoutedEventArgs e)
        {
            if (CustomNumberingProvider != null)
            {
                ACW.NumSchmField[] Fields = new ACW.NumSchmField[]
                {
                    new ACW.PredefListField {
                        Name = "Predefined List", CodeArray = new ACW.CodeWord[] { new ACW.CodeWord {
                                                                                       Code = "a", Descr = ""
                                                                                   } }, DfltVal = "a", PredefListVal = "a"
                    }
                };

                string Name = "Unupported-" + Guid.NewGuid().ToString();

                ACW.NumSchm AddedScheme = NumService.AddNumberingScheme(EntityClassId, Name, CustomNumberingProvider.SysName, Fields, toUpperCase: false, reuseNumbers: false);
                NumService.EnableNumberingSchemes(new long[] { AddedScheme.SchmID }, true);

                DataGridSchemes.Add(new Scheme(AddedScheme));
                m_numberSchemesGrid.Items.Refresh();
            }
        }