本文整理汇总了C#中DataService.FindAll方法的典型用法代码示例。如果您正苦于以下问题:C# DataService.FindAll方法的具体用法?C# DataService.FindAll怎么用?C# DataService.FindAll使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DataService
的用法示例。
在下文中一共展示了DataService.FindAll方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Index
/// <summary>
/// Action Results for Index
/// </summary>
/// <returns>Action Result.</returns>
public ActionResult Index()
{
realmId = Session["realm"].ToString();
accessToken = Session["accessToken"].ToString();
accessTokenSecret = Session["accessTokenSecret"].ToString();
consumerKey = ConfigurationManager.AppSettings["consumerKey"].ToString();
consumerSecret = ConfigurationManager.AppSettings["consumerSecret"].ToString();
dataSourcetype = Session["dataSource"].ToString().ToLower();
try
{
IntuitServicesType intuitServicesType = new IntuitServicesType();
switch (dataSourcetype)
{
case "qbo":
intuitServicesType = IntuitServicesType.QBO;
break;
case "qbd":
intuitServicesType = IntuitServicesType.QBD;
break;
default:
throw new Exception("Data source type not found.");
break;
}
OAuthRequestValidator oauthValidator = new OAuthRequestValidator(accessToken, accessTokenSecret, consumerKey, consumerSecret);
ServiceContext context = new ServiceContext(realmId, intuitServicesType, oauthValidator);
DataService dataService = new DataService(context);
List<Customer> customers = dataService.FindAll(new Customer(), 1, 100).ToList();
ViewBag.MyCollection = customers;
ViewBag.CustomerCount = customers.Count();
}
catch (InvalidTokenException exp)
{
//Remove the Oauth access token from the OauthAccessTokenStorage.xml
OauthAccessTokenStorageHelper.RemoveInvalidOauthAccessToken(Session["FriendlyEmail"].ToString(), this);
Session["show"] = true;
return Redirect("/Home/index");
}
catch (System.Exception exp)
{
throw exp;
}
return View();
}
开发者ID:nberisha,项目名称:QuickbooksV3API-DotNet-Mvc3-Sample,代码行数:54,代码来源:QuickBooksCustomersController.cs