private Property SetGetEntitiesProperties(Property prop, CRMState task)
        {
            if (task != null)
            {
                switch (prop.Name.ToLower())
                {
                case "entity":
                    prop.Value = task.Entity;
                    break;

                case "entityid":
                    prop.Value = task.EntityId;
                    break;

                case "state":
                    prop.Value = task.State;
                    break;

                case "status":
                    prop.Value = task.Status;
                    break;
                }
            }
            return(prop);
        }
        private void SetStateStatus(ref ServiceObject so)
        {
            SourceCode.SmartObjects.Services.ServiceSDK.Objects.Method meth = so.Methods[0];

            CRMState state = new CRMState();

            state.Config = crmconfig;

            try
            {
                state.Entity   = NotNull(so.Properties["Entity"].Value);
                state.EntityId = NotNull(so.Properties["EntityId"].Value);
                state.State    = int.Parse(NotNull(so.Properties["State"].Value));
                state.Status   = int.Parse(NotNull(so.Properties["Status"].Value));

                CRMState response = CRMFunctions.CRMSetStateStatus(state);

                so.Properties.InitResultTable();

                for (int c = 0; c < meth.ReturnProperties.Count; c += 1)
                {
                    Property prop = so.Properties[meth.ReturnProperties[c]];
                    prop = SetStateStatusProperties(prop, response);
                }

                so.Properties.BindPropertiesToResultTable();
            }
            catch (Exception ex)
            {
                throw;
            }
        }
コード例 #3
0
        public RestResponse<CRMState> SetStateStatus(CRMState crmState, K2CRMConfig config)
        {
            var client = new RestClient(config.RESTUrl);

            var request = new RestRequest();
            request.Method = Method.POST;
            request.Credentials = config.CredentialCache;
            request.RequestFormat = RestSharp.DataFormat.Json;
            request.Resource = "K2CRM/CRMSetStateStatus";

            request.AddBody(crmState);

            RestResponse<CRMState> response = client.Execute<CRMState>(request);

            return response;
        }
コード例 #4
0
        public RestResponse <CRMState> SetStateStatus(CRMState crmState, K2CRMConfig config)
        {
            var client = new RestClient(config.RESTUrl);

            var request = new RestRequest();

            request.Method        = Method.POST;
            request.Credentials   = config.CredentialCache;
            request.RequestFormat = RestSharp.DataFormat.Json;
            request.Resource      = "K2CRM/CRMSetStateStatus";

            request.AddBody(crmState);

            RestResponse <CRMState> response = client.Execute <CRMState>(request);

            return(response);
        }