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


C# IDRequest.Get方法代码示例

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

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

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

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

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

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

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

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

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

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

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


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