public Protocols.ToolkitResultProtocol CreateLead(Protocols.Sales.CreateLeadSetupProtocol setupParam) { ClarifySession session = Global.GetSession( AuthHeader ); FChoice.Toolkits.Clarify.Sales.SalesToolkit toolkit = new FChoice.Toolkits.Clarify.Sales.SalesToolkit( session ); FChoice.Toolkits.Clarify.Sales.CreateLeadSetup setup; switch( setupParam.ConstructorCue ) { case 0: setup = new FChoice.Toolkits.Clarify.Sales.CreateLeadSetup(setupParam.State, setupParam.Country, setupParam.TimeZone, setupParam.SiteType, setupParam.LeadSource); break; default: throw new InvalidOperationException(string.Format("Constructor index '{0}' does not exist.", setupParam.ConstructorCue)); } if( Global.IsPropertyDirty(1, setupParam.DirtyFieldFlags) ) { setup.LeadObjid = setupParam.LeadObjid; } if( Global.IsPropertyDirty(2, setupParam.DirtyFieldFlags) ) { setup.ContactFirstName = setupParam.ContactFirstName; } if( Global.IsPropertyDirty(4, setupParam.DirtyFieldFlags) ) { setup.ContactLastName = setupParam.ContactLastName; } if( Global.IsPropertyDirty(8, setupParam.DirtyFieldFlags) ) { setup.ContactPhone = setupParam.ContactPhone; } if( Global.IsPropertyDirty(16, setupParam.DirtyFieldFlags) ) { setup.Fax = setupParam.Fax; } if( Global.IsPropertyDirty(32, setupParam.DirtyFieldFlags) ) { setup.Address = setupParam.Address; } if( Global.IsPropertyDirty(64, setupParam.DirtyFieldFlags) ) { setup.Address2 = setupParam.Address2; } if( Global.IsPropertyDirty(128, setupParam.DirtyFieldFlags) ) { setup.City = setupParam.City; } if( Global.IsPropertyDirty(256, setupParam.DirtyFieldFlags) ) { setup.State = setupParam.State; } if( Global.IsPropertyDirty(512, setupParam.DirtyFieldFlags) ) { setup.PostalCode = setupParam.PostalCode; } if( Global.IsPropertyDirty(1024, setupParam.DirtyFieldFlags) ) { setup.Country = setupParam.Country; } if( Global.IsPropertyDirty(2048, setupParam.DirtyFieldFlags) ) { setup.TimeZone = setupParam.TimeZone; } if( Global.IsPropertyDirty(4096, setupParam.DirtyFieldFlags) ) { setup.Email = setupParam.Email; } if( Global.IsPropertyDirty(8192, setupParam.DirtyFieldFlags) ) { setup.Title = setupParam.Title; } if( Global.IsPropertyDirty(16384, setupParam.DirtyFieldFlags) ) { setup.CompanyName = setupParam.CompanyName; } if( Global.IsPropertyDirty(32768, setupParam.DirtyFieldFlags) ) { setup.SiteName = setupParam.SiteName; } if( Global.IsPropertyDirty(65536, setupParam.DirtyFieldFlags) ) { setup.SiteType = setupParam.SiteType; } if( Global.IsPropertyDirty(131072, setupParam.DirtyFieldFlags) ) { setup.Rating = setupParam.Rating; } if( Global.IsPropertyDirty(262144, setupParam.DirtyFieldFlags) ) { setup.ContactRole = setupParam.ContactRole; } if( Global.IsPropertyDirty(524288, setupParam.DirtyFieldFlags) ) { setup.LeadSource = setupParam.LeadSource; } if( Global.IsPropertyDirty(1048576, setupParam.DirtyFieldFlags) ) { setup.UserName = setupParam.UserName; } if( Global.IsPropertyDirty(2097152, setupParam.DirtyFieldFlags) ) { setup.CreateDate = setupParam.CreateDate; } if( Global.IsPropertyDirty(4194304, setupParam.DirtyFieldFlags) ) { setup.GenerateTimeBombs = setupParam.GenerateTimeBombs; } if( Global.IsPropertyDirty(8388608, setupParam.DirtyFieldFlags) ) { foreach(Protocols.AdditionalFieldProtocol field in setupParam.AdditionalFields){setup.AdditionalFields.Append( field.FieldName, field.FieldType, field.FieldValue);} } return new Protocols.ToolkitResultProtocol( toolkit.CreateLead(setup) ); }
public Protocols.ToolkitResultProtocol CreateLead(System.String state, System.String country, System.String timeZone, FChoice.Toolkits.Clarify.LeadSiteType siteType, System.String leadSource) { ClarifySession session = Global.GetSession( AuthHeader ); FChoice.Toolkits.Clarify.Sales.SalesToolkit toolkit = new FChoice.Toolkits.Clarify.Sales.SalesToolkit( session ); return new Protocols.ToolkitResultProtocol( toolkit.CreateLead(state, country, timeZone, siteType, leadSource) ); }