QueryExpression query = new QueryExpression()
{
EntityName = "contact",
ColumnSet = new ColumnSet("contactid"),
Criteria =
{
Conditions =
{
new ConditionExpression("dpo_username",ConditionOperator.Equal,TextBox1.Text),
new ConditionExpression("demo_password",ConditionOperator.Equal,TextBox2.Text),
}
}
};
EntityCollection entityCollection = _service.RetrieveMultiple(query);
string fetchxmlContact = @"<fetch version='1.0' output-format='xml-platform' mapping='logical' distinct='false'>
<entity name='contact'>
<attribute name='fullname' />
<attribute name='telephone1' />
<attribute name='contactid' />
<attribute name='lastname' />
<attribute name='demo_username' />
<attribute name='firstname' />
<order attribute='fullname' descending='false' />
<filter type='and'>
<condition attribute='demo_username' operator='eq' value='" + userName + "' /><condition attribute='demo_password' operator='eq' value='" + password + "' /></filter></entity></fetch>";
EntityCollection contactCollection = service.RetrieveMultiple(new FetchExpression(fetchxmlContact));
{
EntityName = "contact",
ColumnSet = new ColumnSet("contactid"),
Criteria =
{
Conditions =
{
new ConditionExpression("dpo_username",ConditionOperator.Equal,TextBox1.Text),
new ConditionExpression("demo_password",ConditionOperator.Equal,TextBox2.Text),
}
}
};
EntityCollection entityCollection = _service.RetrieveMultiple(query);
f(entity.Attributes.Contains("money_field1")) { a=((Money)entity.Attributes["money_field1"]).Value; } if(entity.Attributes.Contains("money_field2")) { b=((Money)entity.Attributes["money_field2"]).Value; }
string fetchxmlContact = @"<fetch version='1.0' output-format='xml-platform' mapping='logical' distinct='false'>
<entity name='contact'>
<attribute name='fullname' />
<attribute name='telephone1' />
<attribute name='contactid' />
<attribute name='lastname' />
<attribute name='demo_username' />
<attribute name='firstname' />
<order attribute='fullname' descending='false' />
<filter type='and'>
<condition attribute='demo_username' operator='eq' value='" + userName + "' /><condition attribute='demo_password' operator='eq' value='" + password + "' /></filter></entity></fetch>";
EntityCollection contactCollection = service.RetrieveMultiple(new FetchExpression(fetchxmlContact));
No comments:
Post a Comment