private bool UpdateAccountState(Guid accid, string astatuscode, string astatecode)
{
bool checkflag = false;
try
{
CrmService Crm4_service = connect();
// Create the request object.
SetStateAccountRequest state = new SetStateAccountRequest();
// Set the properties of the request object.
if (astatecode == "Inactive")
{
state.AccountState = AccountState.Inactive;
}
if (astatecode == "Active")
{
state.AccountState = AccountState.Active;
}
state.AccountStatus = Convert.ToInt32(astatuscode);
// EntityId is the GUID of the account whose state is being changed.
state.EntityId = accid;
// Execute the request.
SetStateAccountResponse stateSet = (SetStateAccountResponse)Crm4_service.Execute(state);
checkflag = true;
}
catch
{
return checkflag;
}
return checkflag;
}
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment