Ejemplo n.º 1
0
        public string EntityGroupCreate(string entityType, string name, string id)
        {
            log.LogEverything("Not Specified", t.GetMethodName() + " called");
            log.LogVariable("Not Specified", nameof(entityType), entityType);
            log.LogVariable("Not Specified", nameof(name), name);
            log.LogVariable("Not Specified", nameof(id), id);

            try
            {
                if (entityType == "EntitySearch")
                {
                    string microtingUId = http.EntitySearchGroupCreate(name, id);

                    if (microtingUId == null)
                    {
                        throw new Exception("EntityGroupCreate failed, due to microtingUId:'null'");
                    }
                    else
                    {
                        return(microtingUId);
                    }
                }

                if (entityType == "EntitySelect")
                {
                    string microtingUId = http.EntitySelectGroupCreate(name, id);

                    if (microtingUId == null)
                    {
                        throw new Exception("EntityGroupCreate failed, due to microtingUId:'null'");
                    }
                    else
                    {
                        return(microtingUId);
                    }
                }

                throw new Exception("entityType:'" + entityType + "' not known");
            }
            catch (Exception ex)
            {
                throw new Exception("EntityGroupCreate failed", ex);
            }
        }
Ejemplo n.º 2
0
        public async Task <string> EntityGroupCreate(string entityType, string name, string id)
        {
            log.LogEverything("Communicator.EntityGroupCreate", "called");
            log.LogVariable("Communicator.EntityGroupCreate", nameof(entityType), entityType);
            log.LogVariable("Communicator.EntityGroupCreate", nameof(name), name);
            log.LogVariable("Communicator.EntityGroupCreate", nameof(id), id);

            try
            {
                if (entityType == Constants.FieldTypes.EntitySearch)
                {
                    string microtingUId = await http.EntitySearchGroupCreate(name, id);

                    if (microtingUId == null)
                    {
                        throw new Exception("EntityGroupCreate failed, due to microtingUId:'null'");
                    }
                    else
                    {
                        return(microtingUId);
                    }
                }

                if (entityType == Constants.FieldTypes.EntitySelect)
                {
                    string microtingUId = await http.EntitySelectGroupCreate(name, id);

                    if (microtingUId == null)
                    {
                        throw new Exception("EntityGroupCreate failed, due to microtingUId:'null'");
                    }
                    else
                    {
                        return(microtingUId);
                    }
                }

                throw new Exception("entityType:'" + entityType + "' not known");
            }
            catch (Exception ex)
            {
                throw new Exception("EntityGroupCreate failed", ex);
            }
        }