本文整理汇总了C#中FernBusinessBase.IDRequest.Get方法的典型用法代码示例。如果您正苦于以下问题:C# IDRequest.Get方法的具体用法?C# IDRequest.Get怎么用?C# IDRequest.Get使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FernBusinessBase.IDRequest
的用法示例。
在下文中一共展示了IDRequest.Get方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: 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);
}
}
示例2: 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);
}
}
示例3: GetSecurityEntity
public GetItemResponse<SecurityEntity> GetSecurityEntity(IDRequest request)
{
var response = new GetItemResponse<SecurityEntity>();
try
{
response = GenericGetEntity<SecurityEntity>(request);
if (response != null && response.Item != null)
{
SecurityEntity entity = response.Item;
Guid applicationID;
request.Get<Guid>("appid", out applicationID);
//fill in permission list
entity.PermissionList = GetSecurityPermissionList(applicationID, entity);
// fill in the parent id list
entity.ImmediateParentsIds = GetEntityRelationships(entity.ID);
response.Item = entity;
}
}
catch (Exception ex)
{
return ErrorHandler.Handle<GetItemResponse<SecurityEntity>>(ex);
}
return response;
}
示例4: GetEntitySecurityEntryListForIac
public GetListResponse<SecurityEntry> GetEntitySecurityEntryListForIac(IDRequest request)
{
try
{
Guid applicationID;
request.Get<Guid>("appid", out applicationID);
return GenericGetEntityList<SecurityEntry>("EntitySecurityEntryForIAC", true, applicationID, request.ID);
}
catch (Exception ex)
{
return ErrorHandler.Handle<GetListResponse<SecurityEntry>>(ex);
}
}
示例5: GetTopNLogonLogListBySecurityEntityID
public GetListResponse<LogonLog> GetTopNLogonLogListBySecurityEntityID(IDRequest request)
{
var response = new GetListResponse<LogonLog>();
response.List = new List<LogonLog>();
try
{
var db = ImardaDatabase.CreateDatabase(Util.GetConnName<LogonLog>());
int topN = request.Get("TopN", 50);
using (IDataReader dr = db.ExecuteDataReader("SPGetTopNLogonLogListBySecurityEntityID", request.ID, topN))
{
while (dr.Read()) response.List.Add(GetFromData<LogonLog>(dr));
return response;
}
}
catch (Exception ex)
{
return ErrorHandler.Handle<GetListResponse<LogonLog>>(ex);
}
}
示例6: 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);
}
}
示例7: 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);
}
}
示例8: GetSecurityObjectsByApplicationID
public GetListResponse<SecurityObject> GetSecurityObjectsByApplicationID(IDRequest request)
{
var response = new GetListResponse<SecurityObject>();
try
{
Guid applicationID;
request.Get<Guid>("appid", out applicationID);
var db = ImardaDatabase.CreateDatabase(Util.GetConnName<SecurityObject>());
object[] args = new object[] { applicationID };
using (IDataReader dr = db.ExecuteDataReader("SPGetSecurityObjectsByApplicationID", args))
{
response.List = new List<SecurityObject>();
while (dr.Read())
{
response.List.Add(GetFromData<SecurityObject>(dr));
}
return response;
}
}
catch (Exception ex)
{
return ErrorHandler.Handle<GetListResponse<SecurityObject>>(ex);
}
}
示例9: GetSecurityEntityByLoginUserName
public GetItemResponse<SecurityEntity> GetSecurityEntityByLoginUserName(IDRequest request)
{
try
{
var response = new GetItemResponse<SecurityEntity>();
var db = ImardaDatabase.CreateDatabase(Util.GetConnName<SecurityEntity>());
string username = request.Get("username", string.Empty);
using (IDataReader dr = db.ExecuteDataReader("SPGetSecurityEntityByLoginUserName", username,0))
{
if (dr.Read())
{
response.Item = GetFromData<SecurityEntity>(dr, false);
}
else
{
//failed to find login username
response.Status = false;
response.StatusMessage = "User name [" + username + "] was not found.";
}
return response;
}
}
catch (Exception ex)
{
return ErrorHandler.Handle<GetItemResponse<SecurityEntity>>(ex);
}
}
示例10: RemoveUnownedSecurityObjects
private void RemoveUnownedSecurityObjects(
ImardaSecurityBusiness.IImardaSecurity service,
IDRequest request,
GetListResponse<SecurityObject> response)
{
if (ServiceMessageHelper.IsSuccess(response))
{
Guid callerSecurityEntityID;
if (request.Get<Guid>("UserID", out callerSecurityEntityID))
{
GetListResponse<SecurityObject> resp1 = service.GetKnownSecurityObjects(new IDRequest(callerSecurityEntityID));
ErrorHandler.Check(resp1);
if (resp1.List != null)
{
List<Guid> maxlist = resp1.List.Select(known => known.ID).ToList();
response.List.RemoveAll(so => !maxlist.Contains(so.ID));
}
}
//Include APIAccessPermission only for companies
if (request.Get("Owner", "User") == "User")
response.List.Remove(response.List.Find(so => so.ID == APIAccessPermission));
}
}
示例11: SendNotification
/// <summary>
/// Send an email or sms
/// </summary>
/// <param name="request">.ID=Notification.ID, ["PersonID"] = Person.ID, ["Data"]=typedDataKV, ["TZ"]=Windows time zone name, ["Type"]="email" or "sms"</param>
/// <returns></returns>
public SolutionMessageResponse SendNotification(IDRequest request)
{
try
{
SolutionMessageResponse appResponse = null;
var service = ImardaProxyManager.Instance.IImardaCRMProxy;
ChannelInvoker.Invoke(delegate(out IClientChannel channel)
{
channel = service as IClientChannel;
Guid notificationItemID = request.ID;
var data = request.GetString("Data");
var tzid = request.GetString("TZ");
var personID = request.Get("PersonID", Guid.Empty);
var req = new GenericRequest(personID, notificationItemID, request.CompanyID, data, tzid);
string type = request.GetString("Type");
BusinessMessageResponse response = null;
if (type == "email")
{
response = service.SendNotificationEmail(req);
}
else if (type == "sms")
{
response = service.SendNotificationSMS(req);
}
else throw new ArgumentException("'Type' missing: 'sms' or 'email'");
ErrorHandler.Check(response);
//TODO more stuff here...?
appResponse = new SolutionMessageResponse();
});
return appResponse;
}
catch (Exception ex)
{
return ErrorHandler.Handle<SolutionMessageResponse>(ex);
}
}