コード例 #1
0
 public CRMEntityList CRMGetAllEntities(CRMEntityList EntityList)
 {
     CRMFunctions function = new CRMFunctions(EntityList.Config);
     return function.CRMGetAllEntities(EntityList);
 }
コード例 #2
0
 public CRMEntityMetadata CRMGetEntityMetadata(CRMEntityMetadata crmEntityMetadata)
 {
     CRMFunctions function = new CRMFunctions(crmEntityMetadata.Config);
     return function.CRMGetEntityMetadata(crmEntityMetadata);
 }
コード例 #3
0
 public CRMRetrieveMultiple CRMRetrieveMultiple(CRMRetrieveMultiple crmRetrieveMultiple)
 {
     CRMFunctions function = new CRMFunctions(crmRetrieveMultiple.Config);
     return function.CRMRetrieveMultiple(crmRetrieveMultiple);
 }
コード例 #4
0
 public CRMUser CRMGetUser(CRMUser crmUser)
 {
     CRMFunctions function = new CRMFunctions(crmUser.Config);
     return function.CRMGetUser(crmUser);
 }
コード例 #5
0
 public CRMWorkflow CRMStartWorkflowByID(CRMWorkflow crmWF)
 {
     CRMFunctions function = new CRMFunctions(crmWF.Config);
     return function.CRMStartWorkflowByID(crmWF);
 }
コード例 #6
0
 public CRMBulkActionTask CRMBulkActionTasks(CRMBulkActionTask crmBulkActionTask)
 {
     CRMFunctions function = new CRMFunctions(crmBulkActionTask.Config);
     return function.CRMBulkActionTasks(crmBulkActionTask);
 }
コード例 #7
0
 public CRMTask CRMCreateTask(CRMTask crmTask)
 {
     CRMFunctions function = new CRMFunctions(crmTask.Config);
     return function.CRMCreateTask(crmTask);
 }
コード例 #8
0
    public CRMFetchXML CRMGetEntities(CRMFetchXML crmFetchXML)
    {
        CRMFunctions function = new CRMFunctions(crmFetchXML.Config);
        return function.CRMGetEntities(crmFetchXML);

    }
コード例 #9
0
 public CRMState CRMSetStateStatus(CRMState crmState)
 {
     CRMFunctions function = new CRMFunctions(crmState.Config);
     return function.CRMSetStateStatus(crmState);
 }
コード例 #10
0
 public CRMEntityOwnership CRMChangeOwner(CRMEntityOwnership crmEntityOwnership)
 {
     CRMFunctions function = new CRMFunctions(crmEntityOwnership.Config);
     return function.CRMChangeOwner(crmEntityOwnership);
 }
コード例 #11
0
 public CRMPicklist CRMGetStateStatus(CRMPicklist picklist)
 {
     CRMFunctions function = new CRMFunctions(picklist.Config);
     return function.CRMGetStateStatus(picklist);
 }
        public void Execute()
        {
            SvcI = SvcBase.Service;

            //config = GetK2CRMConfig(SvcI.ServiceConfiguration.ServiceAuthentication.UserName, SvcI.ServiceConfiguration.ServiceAuthentication.Password, GetConfigPropertyValue("RESTServiceURL"));
            crmconfig = new CRMConfig
            {
                CRMURL = GetConfigPropertyValue("CRMURL"),
                CRMOrganization = GetConfigPropertyValue("CRMOrganization")
            };

            if (!SvcI.ServiceConfiguration.ServiceAuthentication.Impersonate && !string.IsNullOrEmpty(SvcI.ServiceConfiguration.ServiceAuthentication.UserName.Trim()) && !string.IsNullOrEmpty(SvcI.ServiceConfiguration.ServiceAuthentication.Password.Trim()))
            {
                // Static credentials
                if (SvcI.ServiceConfiguration.ServiceAuthentication.UserName.Contains("\\"))
                {
                    char[] sp = { '\\' };
                    string[] user = SvcI.ServiceConfiguration.ServiceAuthentication.UserName.Split(sp);
                    crmconfig.CRMDomain = user[0].Trim();
                    crmconfig.CRMUsername = user[1].Trim();
                }
                else
                {
                    crmconfig.CRMUsername = SvcI.ServiceConfiguration.ServiceAuthentication.UserName.Trim();
                }
                crmconfig.CRMPassword = SvcI.ServiceConfiguration.ServiceAuthentication.Password;
            }

            CRMFunctions = new Functions.CRMFunctions(crmconfig);

            ServiceObject so = SvcI.ServiceObjects[0];
            string methodName = so.Methods[0].Name;
            switch (methodName.ToLower())
            {
                case "changeowner":
                    ChangeOwner(ref so);
                    break;
                case "setstatestatus":
                    SetStateStatus(ref so);
                    break;
                case "getentities":
                    GetEntities(ref so);
                    break;
                case "bulkactiontasks":
                    BulkActionTasks(ref so);
                    break;
                case "createtask":
                    CreateTask(ref so);
                    break;
                case "getcrmuser":
                    GetCRMUser(ref so);
                    break;
                case "startcrmworkflow":
                    StartCRMWorkflow(ref so);
                    break;
                case "getentitymetadata":
                    GetEntityMetadata(ref so);
                    break;
                case "bulkactiontaskssetcriteria":
                    BulkActionTasksSetCriteria(ref so);
                    break;
                case "retrievemultiple":
                    RetrieveMultiple(ref so);
                    break;
                case "getallentities":
                    GetAllEntities(ref so);
                    break;
                case "getentityattributes":
                    GetEntityAttributes(ref so);
                    break;
                case "getpicklist":
                    GetPicklist(ref so);
                    break;
                case "getstatestatuspicklist":
                    GetStateStatusPicklist(ref so);
                    break;
                    
            }
        }