本文整理汇总了C#中FernBusinessBase.IDRequest.ContainsKey方法的典型用法代码示例。如果您正苦于以下问题:C# IDRequest.ContainsKey方法的具体用法?C# IDRequest.ContainsKey怎么用?C# IDRequest.ContainsKey使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FernBusinessBase.IDRequest
的用法示例。
在下文中一共展示了IDRequest.ContainsKey方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: 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);
}
}
示例2: 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);
}
}
示例3: 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);
}
}