本文整理汇总了C#中FernBusinessBase.IDRequest.HasSome方法的典型用法代码示例。如果您正苦于以下问题:C# IDRequest.HasSome方法的具体用法?C# IDRequest.HasSome怎么用?C# IDRequest.HasSome使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FernBusinessBase.IDRequest
的用法示例。
在下文中一共展示了IDRequest.HasSome方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetNotificationItemListByPlanID
public GetListResponse<NotificationItem> GetNotificationItemListByPlanID(IDRequest request)
{
try
{
var response = new GetListResponse<NotificationItem>();
var db = ImardaDatabase.CreateDatabase(Util.GetConnName<NotificationItem>());
bool includeInactive = request.HasSome(RetrievalOptions.IncludeInactive);
object[] args = new object[] { includeInactive, request.CompanyID, request.ID };
using (IDataReader dr = db.ExecuteDataReader("SPGetNotificationItemListByPlanID", args))
{
response.List = new List<NotificationItem>();
while (dr.Read())
{
response.List.Add(GetFromData<NotificationItem>(dr));
}
return response;
}
}
catch (Exception ex)
{
return ErrorHandler.Handle<GetListResponse<NotificationItem>>(ex);
}
}
示例2: GetContactList
//get contact list by type
public GetListResponse<Contact> GetContactList(IDRequest request)
{
var response = new GetListResponse<Contact>();
response.List = new List<Contact>();
try
{
var db = ImardaDatabase.CreateDatabase(Util.GetConnName<Contact>());
string spName = "SPGetContactList";
byte type = 0;
if (request.ContainsKey("Type")) type = byte.Parse(request["Type"]);
int size = 0;
if (request.ContainsKey("TopN")) int.TryParse(request["TopN"], out size);
bool includeInactive = request.HasSome(RetrievalOptions.IncludeInactive);
Guid id = request.ID;
var args = new object[] { includeInactive, id, type };
using (IDataReader dr = db.ExecuteDataReader(spName, args))
{
while (dr.Read()) response.List.Add(GetFromData<Contact>(dr));
if (size > 0 && response.List.Count > size)
{
response.List.RemoveRange(size - 1, response.List.Count - size);
}
return response;
}
}
catch (Exception ex)
{
return ErrorHandler.Handle<GetListResponse<Contact>>(ex);
}
}
示例3: GetApplicationFeatureListByOwnerID
public GetListResponse<ApplicationFeature> GetApplicationFeatureListByOwnerID(IDRequest request)
{
try
{
var response = new GetListResponse<ApplicationFeature>();
var db = ImardaDatabase.CreateDatabase(Util.GetConnName<ApplicationFeature>());
bool includeInactive = request.HasSome(RetrievalOptions.IncludeInactive);
int topn = request.Get<int>("TopN", int.MaxValue);
Guid ownerid = Guid.Empty;
request.Get<Guid>("OwnerID", out ownerid);
using (IDataReader dr = db.ExecuteDataReader("SPGetApplicationFeatureListByOwnerID", includeInactive, topn, request.CompanyID, ownerid))
{
response.List = new List<ApplicationFeature>();
while (dr.Read())
{
response.List.Add(GetFromData<ApplicationFeature>(dr));
}
return response;
}
}
catch (Exception ex)
{
return ErrorHandler.Handle<GetListResponse<ApplicationFeature>>(ex);
}
}
示例4: GetContactListByParentId
public GetListResponse<Contact> GetContactListByParentId(IDRequest request)
{
try
{
var response = new GetListResponse<Contact>();
var db = ImardaDatabase.CreateDatabase(Util.GetConnName<Contact>());
bool includeInactive = request.HasSome(RetrievalOptions.IncludeInactive);
int topn = request.Get<int>("TopN", int.MaxValue);
int contactType = request.Get<int>("ContactType", 0);
Guid parentId = request.Get("ParentId", Guid.Empty);
using (IDataReader dr = db.ExecuteDataReader("SPGetContactListByParentId", includeInactive, request.CompanyID, topn, contactType, parentId))
{
response.List = new List<Contact>();
while (dr.Read())
{
response.List.Add(GetFromData<Contact>(dr));
}
return response;
}
}
catch (Exception ex)
{
return ErrorHandler.Handle<GetListResponse<Contact>>(ex);
}
}
示例5: GetScopeAccessLimitList
public GetListResponse<ScopeAccessLimit> GetScopeAccessLimitList(IDRequest request)
{
try
{
bool includeAttributes = request.HasSome(RetrievalOptions.Attributes);
return ImardaDatabase.GetList<ScopeAccessLimit>("SPGetScopeAccessLimitList", includeAttributes, request.ID);
}
catch (Exception ex)
{
return ErrorHandler.Handle<GetListResponse<ScopeAccessLimit>>(ex);
}
}
示例6: GetApiMethodList
public GetListResponse<UsageLog> GetApiMethodList(IDRequest request)
{
try
{
bool includeInactive = request.HasSome(RetrievalOptions.IncludeInactive);
//request.ID contains ApiScopeID
return ImardaDatabase.GetList<UsageLog>("SPGetApiMethodList", includeInactive, request.ID);
}
catch (Exception ex)
{
return ErrorHandler.Handle<GetListResponse<UsageLog>>(ex);
}
}
示例7: GetRouteByExternalID
public GetItemResponse<Route> GetRouteByExternalID(IDRequest request)
{
try
{
bool includeInactive = request.HasSome(RetrievalOptions.IncludeInactive);
Guid companyID = request.CompanyID;
string externalID = request.GetString("ExternalID");
return ImardaDatabase.GetItem<Route>("SPGetRouteByExternalID", request.ID, includeInactive, externalID);
}
catch (Exception ex)
{
return ErrorHandler.Handle<GetItemResponse<Route>>(ex);
}
}
示例8: DeleteContactRelatedPersons
public BusinessMessageResponse DeleteContactRelatedPersons(IDRequest request)
{
try
{
var response = new GetListResponse<Contact>();
var db = ImardaDatabase.CreateDatabase(Util.GetConnName<Contact>());
bool includeInactive = request.HasSome(RetrievalOptions.IncludeInactive);
db.ExecuteNonQuery("SPDeleteContactRelatedPersons", includeInactive, request.CompanyID, request.ID);
response.Status = true;
return response;
}
catch (Exception ex)
{
return ErrorHandler.Handle<GetListResponse<Contact>>(ex);
}
}
示例9: GetApiScopeList
public GetListResponse<Scope> GetApiScopeList(IDRequest request)
{
try
{
var response = new GetListResponse<Scope>();
var db = ImardaDatabase.CreateDatabase(Util.GetConnName<Scope>());
bool includeInactive = request.HasSome(RetrievalOptions.IncludeInactive);
using (IDataReader dr = db.ExecuteDataReader("SPGetApiScopeList", includeInactive, request.CompanyID))
{
response.List = new List<Scope>();
while (dr.Read()) response.List.Add(GetFromData<Scope>(dr));
return response;
}
}
catch (Exception ex)
{
return ErrorHandler.Handle<GetListResponse<Scope>>(ex);
}
}
示例10: GetCustomerCommunicationNodes
public GetListResponse<CustomerCommunicationNode> GetCustomerCommunicationNodes(IDRequest request)
{
var response = new GetListResponse<CustomerCommunicationNode>();
try
{
var db = ImardaDatabase.CreateDatabase(Util.GetConnName<CustomerCommunicationNode>());
bool includeInactive = request.HasSome(RetrievalOptions.IncludeInactive);
var spName = "SPGetCustomerCommunicationNodes";
using (IDataReader dr = db.ExecuteDataReader(spName, request.CompanyID))
{
response.List = new List<CustomerCommunicationNode>();
while (dr.Read())
{
response.List.Add(GetFromData<CustomerCommunicationNode>(dr));
}
}
return response;
}
catch (Exception ex)
{
return ErrorHandler.Handle<GetListResponse<CustomerCommunicationNode>>(ex);
}
}
示例11: GetCompanyListManagedBy
public GetListResponse<Company> GetCompanyListManagedBy(IDRequest request)
{
try
{
var response = new GetListResponse<Company>();
var db = ImardaDatabase.CreateDatabase(Util.GetConnName<Company>());
bool includeInactive = request.HasSome(RetrievalOptions.IncludeInactive);
//int topn = request.Get<int>("TopN", int.MaxValue);
using (IDataReader dr = db.ExecuteDataReader("SPGetCompaniesManagedBy", includeInactive, request.ID))
{
response.List = new List<Company>();
while (dr.Read())
{
response.List.Add(GetFromData<Company>(dr));
}
return response;
}
}
catch (Exception ex)
{
return ErrorHandler.Handle<GetListResponse<Company>>(ex);
}
}
示例12: GetUsageLogSummary
public GetListResponse<UsageLog> GetUsageLogSummary(IDRequest request)
{
try
{
bool includeInactive = request.HasSome(RetrievalOptions.IncludeInactive);
var companyID = request.CompanyID;
var apiID = request.Get("ApiID", Guid.Empty);
return ImardaDatabase.GetList<UsageLog>("SPGetUsageLogListSummary", includeInactive, companyID, apiID);
}
catch (Exception ex)
{
return ErrorHandler.Handle<GetListResponse<UsageLog>>(ex);
}
}
示例13: GetUsageLogSummaryByDateRange
public GetListResponse<UsageLog> GetUsageLogSummaryByDateRange(IDRequest request)
{
try
{
bool includeInactive = request.HasSome(RetrievalOptions.IncludeInactive);
var startDate = request.Get("StartDate", DateTime.UtcNow.Date.AddMonths(-3));
var endDate = request.Get("EndDate", DateTime.UtcNow.Date);
var companyID = request.CompanyID;
var apiID = request.Get("ApiID", Guid.Empty);
return ImardaDatabase.GetList<UsageLog>("SPGetUsageLogListSummary", includeInactive, startDate, endDate, companyID, apiID);
}
catch (Exception ex)
{
return ErrorHandler.Handle<GetListResponse<UsageLog>>(ex);
}
}