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; }
public CRMState CRMSetStateStatus(CRMState crmState) { CRMFunctions function = new CRMFunctions(crmState.Config); return(function.CRMSetStateStatus(crmState)); }
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; } }