This is a public Forum  publicRSS

Topic

    Sergio Farias
    Insert data - Category
    Topic posted August 24, 2018 by Sergio FariasRookie 
    28 Views, 1 Comment
    Title:
    Insert data - Category
    Content:

    var criar = new criar_Objecto();
    ServiceReference1.ServiceCategory serviceCategory = new ServiceReference1.ServiceCategory();
      //************DESCRICAO CATEGORIA
                    ServiceReference1.Label serviceCategory_label = new ServiceReference1.Label();
                    List<ServiceReference1.Label> serviceCategory_labelList = new List<ServiceReference1.Label> { serviceCategory_label };
                    serviceCategory_label.LabelText = "nome_categoria";
                    serviceCategory_label.action = add_action;
                    serviceCategory_label.actionSpecified = true;
                    serviceCategory_label.Language = language_namedID;
                    serviceCategory.Descriptions = serviceCategory_labelList.ToArray();
                    //******************FIM DESCRICAO
                  
     Long    new_serviceCategory = criar.create(_service, serviceCategory, "Category");
                   

                

      public long create(ServiceReference1.RightNowSyncPortClient _conect, ServiceReference1.RNObject create_object, string no_object)
            {
                try
                {
                    ServiceReference1.RNObject[] _output;
                    _conect.Create(new ServiceReference1.ClientInfoHeader { AppID = "EDS  Create Service " + no_object },
                                    new ServiceReference1.APIAccessRequestHeader { Token = "" },
                                    new ServiceReference1.RNObject[] { create_object  },
                                    new ServiceReference1.CreateProcessingOptions { SuppressExternalEvents = false, SuppressRules = false },
                                    out _output);
                    return _output[0].ID.id;
                }
                catch (Exception ex)
                {
                    return 0;
                }
            }

    Answer