本文整理汇总了C#中FernBusinessBase.IDRequest类的典型用法代码示例。如果您正苦于以下问题:C# IDRequest类的具体用法?C# IDRequest怎么用?C# IDRequest使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IDRequest类属于FernBusinessBase命名空间,在下文中一共展示了IDRequest类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetProfileListForExtension
public List<IProfile> GetProfileListForExtension(Guid companyId, Guid extensionId)
{
var request = new IDRequest(extensionId) { CompanyID = companyId };
var response = _proxy.Invoke(service => service.GetProfileListForExtension(request));
ErrorHandler.Check(response);
return response.List.OfType<IProfile>().ToList();
}
示例2: GetNotificationTemplateList
public GetListResponse<NotificationItem> GetNotificationTemplateList(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.ID };
using (IDataReader dr = db.ExecuteDataReader("SPGetNotificationTemplateList", 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);
}
}
示例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: GetReportListByReportTypeID
public GetListResponse<Report> GetReportListByReportTypeID(IDRequest request)
{
Initialize();
var response = new GetListResponse<Report>();
try
{
var db = ImardaDatabase.CreateDatabase(Util.GetConnName<Report>());
object[] args = new object[] { request.ID };
using (IDataReader dr = db.ExecuteDataReader("SPGetReportListByReportTypeID", args))
{
response.List = new List<Report>();
while (dr.Read())
{
var report = GetFromData<Report>(dr);
SetAccessInformation(report);
response.List.Add(report);
}
response.Status = true;
return response;
}
}
catch (Exception ex)
{
return ErrorHandler.Handle<GetListResponse<Report>>(ex);
}
}
示例5: DeleteContact
public BusinessMessageResponse DeleteContact(IDRequest request)
{
try
{
BusinessMessageResponse appResponse = null;
var service = ImardaProxyManager.Instance.IImardaCRMProxy;
ChannelInvoker.Invoke(delegate(out IClientChannel channel)
{
channel = service as IClientChannel;
var response = service.DeleteContact(request);
ErrorHandler.Check(response);
if (!request.ContainsKey("contactType") || !((int)Contact.ContactType.ContactPerson).ToString().Equals(request["contactType"]))
{
response = service.DeleteContactRelatedPersons(request);
ErrorHandler.Check(response);
}
appResponse = response;
});
return appResponse;
}
catch (Exception ex)
{
return ErrorHandler.Handle<BusinessMessageResponse>(ex);
}
}
示例6: DeleteLinkedReports
public BusinessMessageResponse DeleteLinkedReports(IDRequest request)
{
try
{
Initialize();
int countDB = 0;
int countRS = 0;
var db = ImardaDatabase.CreateDatabase(Util.GetConnName<ReportType>());
IDataReader dr;
if (request.ID == Guid.Empty)
{
string name = request["name"];
dr = db.ExecuteDataReader("GetReportsByNamePattern", name);
}
else
{
dr = db.ExecuteDataReader("SPGetReportType", request.ID);
}
using (dr)
{
while (dr.Read())
{
DeleteOneLinkedReport(db, dr, ref countDB, ref countRS);
}
return new BusinessMessageResponse { StatusMessage = string.Format("{0}|{1}", countDB, countRS) };
}
}
catch (Exception ex)
{
return ErrorHandler.Handle(ex);
}
}
示例7: GetContactByName
public GetItemResponse<Contact> GetContactByName(IDRequest request)
{
try
{
var response = new GetItemResponse<Contact>();
var db = ImardaDatabase.CreateDatabase(Util.GetConnName<Contact>());
string custName = request.GetString("custName");
using (IDataReader dr = db.ExecuteDataReader("SPGetContactByName", request.ID, custName))
{
response = new GetItemResponse<Contact>();
if (dr.Read())
{
response.Item = (GetFromData<Contact>(dr));
}
return response;
}
}
catch (Exception ex)
{
return ErrorHandler.Handle<GetItemResponse<Contact>>(ex);
}
}
示例8: 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);
}
}
示例9: 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);
}
}
示例10: GetBillableFeaturesByCompanyID
public GetListResponse<BillableFeature> GetBillableFeaturesByCompanyID(IDRequest request)
{
try
{
var response = new GetListResponse<BillableFeature>();
var db = ImardaDatabase.CreateDatabase(Util.GetConnName<BillableFeature>());
object[] args = new object[] { request.ID };
using (IDataReader dr = db.ExecuteDataReader("SPGetBillableFeaturesByCompanyID", args))
{
response.List = new List<BillableFeature>();
while (dr.Read())
{
response.List.Add(GetFromData<BillableFeature>(dr));
}
return response;
}
}
catch (Exception ex)
{
return ErrorHandler.Handle<GetListResponse<BillableFeature>>(ex);
}
}
示例11: GetFtpFailedDueList
//public GetListResponse<FtpFailed> GetFtpFailedListByNotificationID(IDRequest request)
//{
// try
// {
// return GenericGetRelated<FtpFailed>("NotificationID", request.ID, false);
// }
// catch (Exception ex)
// {
// return ErrorHandler.Handle<GetListResponse<FtpFailed>>(ex);
// }
//}
public GetListResponse<FtpFailed> GetFtpFailedDueList(IDRequest request)
{
var result = new GetListResponse<FtpFailed>();
try
{
var db = ImardaDatabase.CreateDatabase(Util.GetConnName<FtpFailed>());
object[] args = new object[] { DateTime.UtcNow };
using (IDataReader dr = db.ExecuteDataReader("SPGetFtpFailedDueList", args))
{
while (dr.Read())
{
result.List.Add(GetFromData<FtpFailed>(dr));
}
return result;
}
}
catch (Exception ex)
{
return ErrorHandler.Handle<GetListResponse<FtpFailed>>(ex);
}
}
示例12: CancelScheduledAppTask
/// <summary>
/// Cancel the scheduled task.
/// </summary>
/// <param name="request">ID = ScheduledTask.ID, ["QueueID"]=queue where scheduled</param>
/// <returns></returns>
public SolutionMessageResponse CancelScheduledAppTask(IDRequest request)
{
try
{
Guid id = request.ID;
ScheduledTask task = null;
var service = ImardaTaskProxyManager.Instance.IImardaTaskProxy;
ChannelInvoker.Invoke(delegate(out IClientChannel channel)
{
channel = service as IClientChannel;
var resp1 = service.GetScheduledTask(new IDRequest(id));
ErrorHandler.CheckItem(resp1);
task = resp1.Item;
if (task.Status == (byte)TaskStatus.Queued)
{
var resp2 = service.SetScheduledTaskStatus(new GenericRequest(id, (byte)AppTaskStatus.Cancelled));
ErrorHandler.Check(resp2);
}
});
return new SolutionMessageResponse { StatusMessage = task.QueueID };
}
catch (Exception ex)
{
return ErrorHandler.Handle<SolutionMessageResponse>(ex);
}
}
示例13: 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;
}
示例14: GetSMSPendingList
public GetListResponse<SMSPending> GetSMSPendingList(IDRequest request)
{
var result = new GetListResponse<SMSPending>();
try
{
var db = ImardaDatabase.CreateDatabase(Util.GetConnName<SMSPending>());
int numRecords = 100; //process 100 SMS at a time
if (request.ContainsKey("NumRecords")) //! IM-2342
int.TryParse(request["NumRecords"], out numRecords);
object[] args = new object[] { numRecords };
using (IDataReader dr = db.ExecuteDataReader("SPGetSMSPendingList", args))
{
while (dr.Read())
{
result.List.Add(GetFromData<SMSPending>(dr));
}
return result;
}
}
catch (Exception ex)
{
return ErrorHandler.Handle<GetListResponse<SMSPending>>(ex);
}
}
示例15: GetProfile
public IProfile GetProfile(Guid profileId)
{
var request = new IDRequest(profileId);
var response = _proxy.Invoke(service => service.GetExtensionProfile(request));
ErrorHandler.Check(response);
return response.Item;
}