当前位置: 首页>>代码示例>>C#>>正文


C# IDRequest.ContainsKey方法代码示例

本文整理汇总了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);
     }
 }
开发者ID:ashish-antil,项目名称:Products,代码行数:31,代码来源:Contact.cs

示例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);
            }
        }
开发者ID:ashish-antil,项目名称:Products,代码行数:27,代码来源:SMSPending.cs

示例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);
            }
        }
开发者ID:ashish-antil,项目名称:Products,代码行数:27,代码来源:Contact.cs


注:本文中的FernBusinessBase.IDRequest.ContainsKey方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。