Ejemplo n.º 1
0
        internal override ReturnProperties GetReturnProperties(string method)
        {
            ReturnProperties props = base.GetReturnProperties(method);

            switch (method)
            {
            case "GetWorklistItems":
            case "LoadWorklistItem":
            {
                #region GetWorklistItems

                props.Add(base._svcObject.Properties["ActivityDescription"]);
                props.Add(base._svcObject.Properties["ActivityMetaData"]);
                props.Add(base._svcObject.Properties["ActivityExpectedDuration"]);

                props.Add(base._svcObject.Properties["ProcessDescription"]);
                props.Add(base._svcObject.Properties["ProcessMetaData"]);
                props.Add(base._svcObject.Properties["ProcessExpectedDuration"]);
                props.Add(base._svcObject.Properties["ProcessPriority"]);
                props.Add(base._svcObject.Properties["ProcessInstanceStartDate"]);
                break;

                #endregion
            }
            }
            return(props);
        }
        private ReturnProperties GetReturnProperties(string method)
        {
            ReturnProperties properties = new ReturnProperties();

            switch (method)
            {
            case "GetWorklistItemActions":
            {
                properties.Add(_so.Properties["ActionName"]);
                break;
            }

            case "OpenWorklistItem":
            {
                properties.Add(_so.Properties["ErrorMessageBlankIfNoError"]);
                break;
            }

            case "ReleaseWorklistItem":
            {
                properties.Add(_so.Properties["ErrorMessageBlankIfNoError"]);
                break;
            }
            }
            return(properties);
        }
Ejemplo n.º 3
0
        private ReturnProperties GetReturnProperties(string method)
        {
            ReturnProperties properties = new ReturnProperties();

            switch (method)
            {
            case "IsInRole":
                properties.Add(new Property("IsinRole", "System.Boolean", SoType.YesNo, new MetaData("IsinRole", "IsinRole")));
                break;

            case "GetRoleUsersEmailAddress":
                properties.Add(new Property("EmailAddress", "System.String", SoType.Text, new MetaData("EmailAddress", "EmailAddress")));
                break;

            case "GetRoleUsersEmailsonIndex":
                properties.Add(new Property("EmailAddress", "System.String", SoType.Text, new MetaData("EmailAddress", "EmailAddress")));
                break;

            case "GetRoleUsersEmails":
                properties.Add(new Property("EmailAddress", "System.String", SoType.Text, new MetaData("EmailAddress", "EmailAddress")));
                //properties.Add(new Property("UserIndex", "System.Int32", SoType.Number, new MetaData("UserIndex", "UserIndex")));
                break;
            }
            return(properties);
        }
Ejemplo n.º 4
0
        private void DoReturnStatuses()
        {
            var LTaxApp = (IAppTaxApplicationService)_appInstance;
            var LReturn = LTaxApp.GetCurrentDocReturn();

            if (LReturn == null)
            {
                MessageBox.Show("Please Open a Client File first");
            }
            else
            {
                ReturnProperties.ShowReturnproperties(LReturn);
            }
        }
        private ReturnProperties GetReturnProperties(string method)
        {
            ReturnProperties properties = new ReturnProperties();

            switch (method)
            {
            case "ExcelList":
                for (int i = 1; i <= _NoOfColumns; i++)
                {
                    properties.Add(new Property("Column" + i, "System.String", SoType.Text, new MetaData("Column" + i, "Column" + i)));
                }
                break;

            case "SaveData":
                properties.Add(new Property("FilterData", "System.Guid", SoType.Guid, new MetaData("FilterData", "FilterData")));
                break;
            }
            return(properties);
        }
Ejemplo n.º 6
0
        internal virtual ReturnProperties GetReturnProperties(Method method)
        {
            var props = new ReturnProperties();

            switch (method)
            {
            case Method.ExcelBulkImport:
            case Method.ExcelBulkImportWithTransaction:
            case Method.ExcelImport:
            case Method.ExcelImportWithTransaction:
            case Method.CsvBulkImport:
            case Method.CsvBulkImportWithTransaction:
            case Method.CsvImport:
            case Method.CsvImportWithTransaction:
                props.Add(_serviceObject.Properties[PropertyConstants.Result]);
                props.Add(_serviceObject.Properties[PropertyConstants.ImportStatus]);
                props.Add(_serviceObject.Properties[PropertyConstants.UploadStatus]);
                break;
            }

            return(props);
        }
        internal virtual ReturnProperties GetReturnProperties(string method)
        {
            ReturnProperties props = new ReturnProperties();

            switch (method)
            {
            case "GetWorklistItems":
            case "LoadWorklistItem":
            {
                #region GetWorklistItems
                // worklistitem properties
                props.Add(this._svcObject.Properties["AllocatedUser"]);
                props.Add(this._svcObject.Properties["Data"]);
                props.Add(this._svcObject.Properties["ID"]);
                props.Add(this._svcObject.Properties["Link"]);
                props.Add(this._svcObject.Properties["SerialNumber"]);
                props.Add(this._svcObject.Properties["Status"]);

                // activity instance destination properties
                props.Add(this._svcObject.Properties["ActivityID"]);
                props.Add(this._svcObject.Properties["ActivityInstanceID"]);
                props.Add(this._svcObject.Properties["ActivityInstanceDestinationID"]);
                props.Add(this._svcObject.Properties["ActivityName"]);
                props.Add(this._svcObject.Properties["Priority"]);
                props.Add(this._svcObject.Properties["StartDate"]);

                // process instance properties
                props.Add(this._svcObject.Properties["ProcessInstanceID"]);
                props.Add(this._svcObject.Properties["ProcessFullName"]);
                props.Add(this._svcObject.Properties["Folio"]);
                props.Add(this._svcObject.Properties["EventInstanceName"]);
                break;
                #endregion
            }
            }
            return(props);
        }
Ejemplo n.º 8
0
 public static void AsRead(this Methods methods, string name, string displayName, Validation validation, MethodParameters parameters, InputProperties inputs, ReturnProperties returns)
 {
     Create(methods, name, displayName, MethodType.Read, validation, parameters, inputs, returns);
 }
Ejemplo n.º 9
0
        private static void Create(this Methods methods, string name, MethodType methodType, MetaData metaData, Validation validation, MethodParameters parameters, InputProperties inputs, ReturnProperties returns)
        {
            if (methods.Contains(name))
            {
                return;
            }

            methods.Create(new Method
            {
                Name             = name,
                Type             = methodType,
                MetaData         = metaData ?? new MetaData(),
                Validation       = validation ?? new Validation(),
                MethodParameters = parameters ?? new MethodParameters(),
                InputProperties  = inputs ?? new InputProperties(),
                ReturnProperties = returns ?? new ReturnProperties()
            });
        }
Ejemplo n.º 10
0
        private static void Create(this Methods methods, string name, string displayName, MethodType methodType, Validation validation, MethodParameters parameters, InputProperties inputs, ReturnProperties returns)
        {
            var meta = new MetaData
            {
                DisplayName = displayName,
                Description = ""
            };

            Create(methods, name, methodType, meta, validation, parameters, inputs, returns);
        }
        /// <summary>
        /// This method is specifically written to discover the schema of a XML file
        /// we are only catering for a simple datatable where the XML file contains a single repeating structure
        /// We will load the XML file into a dataSet, extract DataTables from the dataset and then create
        /// Service Objects for each data table. We will then create Properties for each column in the data set, and finally
        /// create two Methods (List and Read) for each Service Object.
        /// </summary>
        private void DiscoverXMLFileSchema(string xmlFilePath)
        {
            //read the type mappings so that we can convert the DataTable's property types into
            //equivalent Service Object Property types
            TypeMappings map = (TypeMappings)this.Service.ServiceConfiguration["Type Mappings"];

            //load the XML file specified in the service instance configuration into a dataset so that we can discover it
            try
            {
                //read the target XML file into a dataset so we can discover it
                DataSet pseudoDataSource = new DataSet("PseudoDataSource");
                pseudoDataSource.ReadXml(xmlFilePath);

                //iterate through each DataTable in the DataSource
                foreach (DataTable table in pseudoDataSource.Tables)
                {
                    //1. CREATE SERVICE OBJECTS
                    //we will create a Service Object for each table in the DataSet
                    ServiceObject svcObject = new ServiceObject();
                    //clean up the System Name
                    svcObject.Name = table.TableName.Replace(" ", "");
                    svcObject.MetaData.DisplayName = table.TableName;

                    //2. CREATE SERVICE OBJECT PROPERTIES
                    //we will create Service Object Properties for each column in the Table
                    foreach (DataColumn column in table.Columns)
                    {
                        //note that the Name cannot have spaces
                        Property svcProperty = new Property(column.ColumnName.Replace(" ", ""));
                        svcProperty.MetaData.DisplayName = column.ColumnName;
                        //set the property type based on the type mappings defined for the service
                        svcProperty.SoType = map[column.DataType.Name];
                        //svcObject.Properties.Add(svcProperty);
                        svcObject.Properties.Create(svcProperty);
                    }

                    //3. CREATE SERVICE OBJECT METHODS
                    //we will only create Read and List methods for the XML Service Broker

                    //LIST Method.
                    Method svcListMethod = new Method();
                    //note that the Name should not contain spaces
                    svcListMethod.Name = "List" + table.TableName.Replace(" ", "");
                    svcListMethod.MetaData.DisplayName = "List " + table.TableName;
                    svcListMethod.Type = MethodType.List;
                    //Set up the return properties for the List Method
                    ReturnProperties listReturnProperties = new ReturnProperties();
                    //for this method we'll return each column as a property.
                    foreach (Property svcProperty in svcObject.Properties)
                    {
                        listReturnProperties.Add(svcProperty);
                    }
                    svcListMethod.ReturnProperties = listReturnProperties;

                    //Set up the input properties for the List Method
                    InputProperties listInputProperties = new InputProperties();
                    //for this method we'll return each column as a property.
                    foreach (Property svcProperty in svcObject.Properties)
                    {
                        listInputProperties.Add(svcProperty);
                    }
                    svcListMethod.InputProperties = listInputProperties;

                    //call the create factory to add the service object method
                    svcObject.Methods.Create(svcListMethod);

                    //READ Method
                    Method svcReadMethod = new Method();
                    //note that the Name should not contain spaces
                    svcReadMethod.Name = "Read" + table.TableName.Replace(" ", "");
                    svcReadMethod.MetaData.DisplayName = "Read " + table.TableName;
                    svcReadMethod.Type = MethodType.Read;


                    //Set up the return properties for the Read Method
                    ReturnProperties readReturnProperties = new ReturnProperties();
                    //for this method we will return each column as a property.
                    foreach (Property svcProperty in svcObject.Properties)
                    {
                        readReturnProperties.Add(svcProperty);
                    }
                    svcReadMethod.ReturnProperties = readReturnProperties;

                    //Set up the input properties for the method
                    InputProperties inputProperties = new InputProperties();
                    //for this method we will define the first column in the data table as the input property
                    inputProperties.Add(svcObject.Properties[0]);
                    svcReadMethod.InputProperties = inputProperties;

                    //define the required properties for the method.
                    //in this case, we will assume that the first property of the item is also the Key value for the item
                    //which we will require to locate the specified item in the XML file
                    svcReadMethod.Validation.RequiredProperties.Add(inputProperties[0]);

                    //add the Read method to the Service Object using the create factory
                    svcObject.Methods.Create(svcReadMethod);

                    //Use Method parameters if you want to define a parameter for the method
                    //Parameters are used when the required input value is not already a Property of the Service Object.
                    //if the required input value is already defined as a property for the SmartObject, use RequiredProperties instead
                    //MethodParameter readMethodParameter = new MethodParameter();
                    //readMethodParameter.Name = "SomeName";
                    //readMethodParameter.MetaData.DisplayName = "SomeDisplayName";
                    //readMethodParameter.SoType = one of the available SO Types];
                    //svcReadMethod.MethodParameters.Add(readMethodParameter);

                    //4. ADD THE SERVICE OBJECT TO THE SERVICE INSTANCE
                    // Activate Service Object for use, otherwise you cannot create SmartObjects for the service object
                    svcObject.Active = true;
                    //add the Service Object to the Service Type, using the create factory
                    this.Service.ServiceObjects.Create(svcObject);
                }
            }

            catch (Exception ex)
            {
                throw new Exception("Error while attempting to DiscoverXMLFileSchema. Error: " + ex.Message, ex);
            }
        }
        private ReturnProperties GetReturnProperties(string method)
        {
            ReturnProperties properties = new ReturnProperties();
            switch (method)
            {
                case "GetWorklistItems":
                case "LoadWorklistItem":
                    {
                        #region GetWorklistItems
                        // worklistitem properties
                        properties.Add(new Property("AllocatedUser", "System.String", SoType.Text, new MetaData("Allocated User", "AllocatedUser")));
                        properties.Add(new Property("Data", "System.String", SoType.Text, new MetaData("Data", "Data")));
                        properties.Add(new Property("Link", "System.String", SoType.HyperLink, new MetaData("Link", "Link")));
                        properties.Add(new Property("ID", "System.Int32", SoType.Autonumber, new MetaData("ID", "ID")));
                        properties.Add(new Property("SerialNumber", "System.String", SoType.Text, new MetaData("SerialNumber", "SerialNumber")));
                        properties.Add(new Property("Status", "System.String", SoType.Text, new MetaData("Status", "Status")));

                        // activity instance destination properties
                        properties.Add(new Property("ActivityID", "System.Int32", SoType.Number, new MetaData("Activity ID", "Activity ID")));
                        properties.Add(new Property("ActivityInstanceID", "System.Int32", SoType.Number, new MetaData("Activity Instance ID", "Activity Instance ID")));
                        properties.Add(new Property("ActivityInstanceDestinationID", "System.Int32", SoType.Number, new MetaData("Activity Instance Destination ID", "Activity Instance Destination ID")));
                        properties.Add(new Property("ActivityName", "System.String", SoType.Text, new MetaData("Activity Name", "Activity Name")));
                        properties.Add(new Property("Priority", "System.String", SoType.Text, new MetaData("Priority", "Priority")));
                        properties.Add(new Property("StartDate", "System.DateTime", SoType.DateTime, new MetaData("StartDate", "StartDate")));

                        // process instance properties
                        properties.Add(new Property("ProcessInstanceID", "System.Int32", SoType.Number, new MetaData("Process Instance ID", "Process Instance ID")));
                        properties.Add(new Property("ProcessFullName", "System.String", SoType.Text, new MetaData("Process Full Name", "Process Full Name")));
                        properties.Add(new Property("ProcessName", "System.String", SoType.Text, new MetaData("Process Name", "Process Name")));
                        properties.Add(new Property("Folio", "System.String", SoType.Text, new MetaData("Folio", "Folio")));
                        properties.Add(new Property("EventInstanceName", "System.String", SoType.Text, new MetaData("Event Instance Name", "Event Instance Name")));
                        break;
                        #endregion
                    }
            }
            return properties;
        }
 private ReturnProperties GetReturnProperties(string method)
 {
     ReturnProperties properties = new ReturnProperties();
     switch (method)
     {
         case "GetWorklistItemActions":
             {
                 properties.Add(_so.Properties["ActionName"]);
                 break;
             }
         case "OpenWorklistItem":
             {
                 properties.Add(_so.Properties["ErrorMessageBlankIfNoError"]);
                 break;
             }
         case "ReleaseWorklistItem":
             {
                 properties.Add(_so.Properties["ErrorMessageBlankIfNoError"]);
                 break;
             }
     }
     return properties;
 }
        internal virtual ReturnProperties GetReturnProperties(string method)
        {
            ReturnProperties props = new ReturnProperties();
            switch (method)
            {
                case "GetWorklistItems":
                case "LoadWorklistItem":
                    {
                        #region GetWorklistItems
                        // worklistitem properties
                        props.Add(this._svcObject.Properties["AllocatedUser"]);
                        props.Add(this._svcObject.Properties["Data"]);
                        props.Add(this._svcObject.Properties["ID"]);
                        props.Add(this._svcObject.Properties["Link"]);
                        props.Add(this._svcObject.Properties["SerialNumber"]);
                        props.Add(this._svcObject.Properties["Status"]);

                        // activity instance destination properties
                        props.Add(this._svcObject.Properties["ActivityID"]);
                        props.Add(this._svcObject.Properties["ActivityInstanceID"]);
                        props.Add(this._svcObject.Properties["ActivityInstanceDestinationID"]);
                        props.Add(this._svcObject.Properties["ActivityName"]);
                        props.Add(this._svcObject.Properties["Priority"]);
                        props.Add(this._svcObject.Properties["StartDate"]);

                        // process instance properties
                        props.Add(this._svcObject.Properties["ProcessInstanceID"]);
                        props.Add(this._svcObject.Properties["ProcessFullName"]);
                        props.Add(this._svcObject.Properties["Folio"]);
                        props.Add(this._svcObject.Properties["EventInstanceName"]);
                        break;
                        #endregion
                    }
            }
            return props;
        }