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


C# IDRequest.HasSome方法代码示例

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

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

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

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

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

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

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

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

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

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

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

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

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


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