• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# SaveRequest类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中SaveRequest的典型用法代码示例。如果您正苦于以下问题:C# SaveRequest类的具体用法?C# SaveRequest怎么用?C# SaveRequest使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



SaveRequest类属于命名空间,在下文中一共展示了SaveRequest类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: SaveProfileAdmission

        public BusinessMessageResponse SaveProfileAdmission(SaveRequest<ProfileAdmission> request)
        {
            try
            {
                ProfileAdmission entity = request.Item;
                var properties = new object[]
                {
                        entity.ID,
                        entity.CompanyID,
                        entity.UserID,
                        entity.DateCreated,
                        entity.DateModified = DateTime.UtcNow,
                        entity.Active,
                        entity.Deleted

                        ,entity.ProfileID
                        ,entity.AllowCustomersToUse

            #if EntityProperty_NoDate
                        ,entity.`field`
            #endif

            #if EntityProperty_Date
                        ,BusinessBase.ReadyDateForStorage(entity.`field`)
            #endif
                    };
                var response = GenericSaveEntity<ProfileAdmission>(entity.CompanyID, entity.Attributes, properties);   //Review IM-3747
                return response;
            }
            catch (Exception ex)
            {
                return ErrorHandler.Handle(ex);
            }
        }
开发者ID:ashish-antil,项目名称:Products,代码行数:34,代码来源:ProfileAdmission.cs


示例2: SaveAppSetting

        public BaseResponse SaveAppSetting(SaveRequest request)
        {
            return Execute(_repository, r =>
            {
                var response = new BaseResponse();

                if (request.Entity.IsNew && r.CheckExist(request.Entity.SettingType, request.Entity.Name))
                {
                    response.Success = false;
                    response.Messages.Add("NameIsExisted"); //resource key
                    return response;
                }

                if (!request.Entity.IsNew && r.CheckExist(request.Entity.SettingType, request.Entity.Name, request.Entity.Id))
                {
                    response.Success = false;
                    response.Messages.Add("NameIsExisted"); //resource key
                    return response;
                }

                if (request.Entity.IsNew)
                {
                    request.Entity.InitId();
                }

                r.SaveAppSetting(request);

                return response;
            });
        }
开发者ID:huutoannht,项目名称:mart,代码行数:30,代码来源:AppSettingService.cs


示例3: SaveAttributeDefinition

        public BusinessMessageResponse SaveAttributeDefinition(SaveRequest<FernBusinessBase.AttributeDefinition> request)
        {
            var ad = request.Item;

            object[] adProperties = new object[]
            {
                ad.ID,
                ad.CompanyID,
                ad.UserID,
                ad.DateCreated,
                ad.DateModified,
                ad.Active,
                ad.Deleted,
                ad.VarName,
                ad.FriendlyName,
                ad.Description,
                ad.GroupID,
                ad.VarType,
                ad.Format,
                ad.CaptureHistory,
                ad.Viewable,
                ad.EntityTypeName
            };
            return GenericSaveEntity<AttributeDefinition>("AttributeDefinition", adProperties);
        }
开发者ID:ashish-antil,项目名称:Products,代码行数:25,代码来源:AttributeDefinition.cs


示例4: SaveMessageOwner

        public BusinessMessageResponse SaveMessageOwner(SaveRequest<MessageOwner> request)
        {
            try
            {
                MessageOwner entity = request.Item;
                var properties = new object[]
                {
                        entity.ID,
                        entity.MessageID,
                        entity.CRMID,
                        entity.DateCreated,
                        entity.DateModified = DateTime.UtcNow,
                        entity.Active,
                        entity.Deleted,
                        entity.Viewed

                    };
                var response = GenericSaveEntity<MessageOwner>(entity.CompanyID, entity.Attributes, properties);  //Review IM-3747
                return response;
            }
            catch (Exception ex)
            {
                return ErrorHandler.Handle(ex);
            }
        }
开发者ID:ashish-antil,项目名称:Products,代码行数:25,代码来源:MessageOwner.cs


示例5: SaveRelationShipType

        public BusinessMessageResponse SaveRelationShipType(SaveRequest<RelationShipType> request)
        {
            try
            {
                RelationShipType entity = request.Item;
                var properties = new object[]
                {
                        entity.ID,
                        entity.CompanyID,
                        entity.UserID,
                        entity.DateCreated,
                        entity.DateModified = DateTime.UtcNow,
                        entity.Active,
                        entity.Deleted

                        ,entity.Name
                        ,entity.Description

            #if EntityProperty_NoDate
                        ,entity.`field`
            #endif

            #if EntityProperty_Date
                        ,BusinessBase.ReadyDateForStorage(entity.`field`)
            #endif
                    };
                var response = GenericSaveEntity<RelationShipType>(entity.CompanyID, entity.Attributes, properties);   //Review IM-3747
                return response;
            }
            catch (Exception ex)
            {
                return ErrorHandler.Handle(ex);
            }
        }
开发者ID:ashish-antil,项目名称:Products,代码行数:34,代码来源:RelationShipType.cs


示例6: SaveAttributeValue

        public BusinessMessageResponse SaveAttributeValue(SaveRequest<FernBusinessBase.AttributeValue> request)
        {
            var response = new BusinessMessageResponse();
            try
            {
                AttributeValue attributeValue = ConvertToBusinessAttributeValue(request.Item);
                BaseEntity.ValidateThrow(attributeValue);

                object[] properties = new object[]
                {
                    attributeValue.ID,
                    attributeValue.AttributeID,
                    attributeValue.EntityID, //& gs-351
                    attributeValue.Value,
                    attributeValue.DateModified = DateTime.UtcNow,
                    attributeValue.PrevValue,
                    BusinessBase.ReadyDateForStorage(attributeValue.PrevDateModified),
                    attributeValue.Deleted,
                };
                response = GenericSaveEntity<AttributeValue>("AttributeValue", properties);
            }
            catch (Exception ex)
            {
                return ErrorHandler.Handle(ex);
            }
            return response;
        }
开发者ID:ashish-antil,项目名称:Products,代码行数:27,代码来源:AttributeValue.cs


示例7: SaveRouteWayPoint

        public BusinessMessageResponse SaveRouteWayPoint(SaveRequest<RouteWaypoint> request)
        {
            try
            {
                RouteWaypoint entity = request.Item;
                BaseEntity.ValidateThrow(entity);

                var properties = new object[]
                {
                        entity.ID,
                        entity.CompanyID,
                        entity.UserID,
                        entity.DateCreated,
                        entity.DateModified = DateTime.UtcNow,
                        entity.Active,
                        entity.Deleted,
                        entity.RouteId,
                        entity.WayPointId

            #if EntityProperty_NoDate
                        ,entity.`field`
            #endif

            #if EntityProperty_Date
                        ,BusinessBase.ReadyDateForStorage(entity.`field`)
            #endif
                    };
                var response = GenericSaveEntity<RouteWaypoint>(entity.CompanyID, entity.Attributes, properties);   //Review IM-3747
                return response;
            }
            catch (Exception ex)
            {
                return ErrorHandler.Handle(ex);
            }
        }
开发者ID:ashish-antil,项目名称:Products,代码行数:35,代码来源:RouteWaypoint.cs


示例8: SaveIncidentConfigurationCompany

        public BusinessMessageResponse SaveIncidentConfigurationCompany(SaveRequest<IncidentConfigurationCompany> request)
        {
            try
            {
                IncidentConfigurationCompany entity = request.Item;
                var properties = new object[]
                {
                        entity.ID,
                        entity.CompanyID,
                        entity.UserID,
                        entity.DateCreated,
                        entity.DateModified = DateTime.UtcNow,
                        entity.Active,
                        entity.Deleted
                        ,entity.IncidentConfigurationID

            #if EntityProperty_NoDate
                        ,entity.`field`
            #endif

            #if EntityProperty_Date
                        ,BusinessBase.ReadyDateForStorage(entity.`field`)
            #endif
                    };
                var response = GenericSaveEntity<IncidentConfigurationCompany>(entity.CompanyID, entity.Attributes, properties);
                return response;
            }
            catch (Exception ex)
            {
                return ErrorHandler.Handle(ex);
            }
        }
开发者ID:ashish-antil,项目名称:Products,代码行数:32,代码来源:IncidentConfigurationCompany.cs


示例9: SaveCompany

        public BusinessMessageResponse SaveCompany(SaveRequest<Company> request)
        {
            var response = new BusinessMessageResponse();
            try
            {
                Company entity = request.Item;
                BaseEntity.ValidateThrow(entity);

                object[] properties = new object[]{
                        entity.ID,
                        entity.CompanyID,
                        entity.Path,
                        entity.Active,
                        entity.Deleted,
                        entity.DateCreated,
                        entity.DateModified = DateTime.UtcNow,
                        entity.UserID,
                        entity.Name,
                        entity.StreetAddress,
                        entity.Suburb,
                        entity.City,
                        entity.State,
                        entity.PostCode,
                        entity.DisplayName,
                        entity.Phone,
                        entity.Fax,
                        entity.Mobile,
                        entity.Email,
                        entity.ServiceEmail,
                        entity.RunPrograms,
                        entity.AccountManagerID,
                        entity.AutoLogoffPeriod,
                        entity.GracePeriod,
                        entity.MinorBreak,
                        entity.MajorBreak,
                        entity.WorkPeriod,
                        entity.MapLocationID,
                        entity.MasterPassword,
                        entity.Country ?? "XX",
                        entity.FatigueRuleDefault
                        ,entity.UnlockCode
                        ,entity.LinkID
                        ,entity.ClientType
                        ,entity.TimeZone
            #if EntityProperty_NoDate
                        ,entity.`field`
            #endif
            #if EntityProperty_Date
                        ,BusinessBase.ReadyDateForStorage(entity.`field`)
            #endif
                    };
                response = GenericSaveEntity<Company>(entity.CompanyID, entity.Attributes, properties);    //Review IM-3747
            }
            catch (Exception ex)
            {
                return ErrorHandler.Handle(ex);
            }
            return response;
        }
开发者ID:ashish-antil,项目名称:Products,代码行数:59,代码来源:Company.cs


示例10: Insert

        public BaseResponse Insert(SaveRequest request)
        {
            return Execute(_repository, r =>
            {
                if (request.Entity.IsNew)
                {
                    request.Entity.InitId();
                }

                var res = r.Insert(request);
                return res;
            });
        }
开发者ID:huutoannht,项目名称:mart,代码行数:13,代码来源:DataLogService.cs


示例11: SaveHistory

        public BusinessMessageResponse SaveHistory(SaveRequest<History> request)
        {
            try
            {
                History entity = request.Item;
                var properties = new object[]
                {
                        entity.ID,
                        entity.CompanyID,
                        entity.Path,
                        entity.UserID,
                        entity.DateCreated,
                        entity.DateModified = DateTime.UtcNow,
                        entity.Active,
                        entity.Deleted

                        ,BusinessBase.ReadyDateForStorage(entity.Date)
                        ,entity.Subject
                        ,entity.Description
                        ,entity.EventType
                        ,entity.OwnerType
                        ,entity.OwnerID

                        ,entity.ContactID
                        ,entity.EmployeeID
                        ,entity.JobID
                        ,entity.TaskID
                        ,entity.TaskType

                        ,entity.AttachmentID
                        ,entity.Completed
                        ,BusinessBase.ReadyDateForStorage(entity.CompleteDate)

            #if EntityProperty_NoDate
                        ,entity.`field`
            #endif

            #if EntityProperty_Date
                        ,BusinessBase.ReadyDateForStorage(entity.`field`)
            #endif
                    };
                var response = GenericSaveEntity<History>(entity.CompanyID, entity.Attributes, properties);  //Review IM-3747
                return response;
            }
            catch (Exception ex)
            {
                return ErrorHandler.Handle(ex);
            }
        }
开发者ID:ashish-antil,项目名称:Products,代码行数:49,代码来源:History.cs


示例12: ChangeReportTypeOwner

 private BusinessMessageResponse ChangeReportTypeOwner(SaveRequest<ReportType> request)
 {
     BusinessMessageResponse response = new BusinessMessageResponse();
     try
     {
         var db = ImardaDatabase.CreateDatabase(Util.GetConnName<ReportType>());
         object[] args = new object[] { request.Item.ID, request.Item.OwnerID };
         db.ExecuteNonQuery("SPChangeReportTypeOwner", args);
     }
     catch (Exception ex)
     {
         return ErrorHandler.Handle(ex);
     }
     return response;
 }
开发者ID:ashish-antil,项目名称:Products,代码行数:15,代码来源:ReportType.Extra.cs


示例13: Insert

        public BaseResponse Insert(SaveRequest request)
        {
            var response = new BaseResponse();

            using (var db = DbContext)
            {
                var entityDb = request.Entity.Map<DataLog, Entity.DataLog>();

                db.DataLogs.Add(entityDb);

                response.Success = db.SaveChanges() > 0;
            }

            return response;
        }
开发者ID:huutoannht,项目名称:mart,代码行数:15,代码来源:DataLogRepository.cs


示例14: SaveMessageItem

        public BusinessMessageResponse SaveMessageItem(SaveRequest<MessageItem> request)
        {
            try
            {
                BusinessMessageResponse busresp = null;
                MessageItem msgitem = request.Item;

                var service = ImardaProxyManager.Instance.IImardaCRMProxy;
                ChannelInvoker.Invoke(delegate(out IClientChannel channel)
                {
                    channel = service as IClientChannel;
                    busresp = service.SaveMessageItem(request);

                });
                string[] usersId = null;
                usersId = !string.IsNullOrEmpty(request.Item.Users) ? request.Item.Users.Split(',') : usersId;
                MessageOwner ow;
                List<MessageOwner> listMessageOwner = new List<MessageOwner>();

                foreach (string userid in usersId)
                {
                    ow = new MessageOwner();
                    MessageOwner.Copy(msgitem,ow);
                    ow.CRMID = new Guid(userid);
                    ow.MessageID = request.Item.ID;
                    ow.ID = SequentialGuid.NewDbGuid();
                    listMessageOwner.Add(ow);
                }
                SaveListRequest<MessageOwner> ownerRequest = new SaveListRequest<MessageOwner>(listMessageOwner);

                service = ImardaProxyManager.Instance.IImardaCRMProxy;
                ChannelInvoker.Invoke(delegate(out IClientChannel channel)
                {
                    channel = service as IClientChannel;
                    busresp = service.SaveMessageOwnerList(ownerRequest);

                });

                return busresp;
            }
            catch (Exception ex)
            {
                return ErrorHandler.Handle<GetItemResponse<MessageItem>>(ex);
            }
        }
开发者ID:ashish-antil,项目名称:Products,代码行数:45,代码来源:MessageItem.cs


示例15: SaveRole

        public BaseResponse SaveRole(SaveRequest request)
        {
            return Execute(_repository, r =>
            {
                var response = new BaseResponse();

                var isNew = !r.IsExists(request.Entity.Id);

                if (isNew && r.NameIsExist(request.Entity.Name.ToStr().Trim()))
                {
                    response.Success = false;
                    response.Messages.Add("NameIsExisted"); //resource key
                    return response;
                }

                if(r.NameIsExist(request.Entity.Name.ToStr().Trim(), request.Entity.Id))
                {
                    response.Success = false;
                    response.Messages.Add("NameIsExisted"); //resource key
                    return response;
                }

                request.Entity.Permissions.ForEach(m =>
                {
                    if (m.IsNew) m.InitId();
                    m.RoleId = request.Entity.Id;
                });

                var pages = typeof(BePage).EnumToList();
                if (request.Entity.Permissions.Count > pages.Count)
                {
                    response.Success = false;
                    response.Messages.Add("DataIsInvalid"); //resource key
                    return response;
                }

                var res = r.SaveRole(request);

                _cacheHelper.ClearGetRole(request.Entity.Id);

                return res;
            });
        }
开发者ID:huutoannht,项目名称:mart,代码行数:43,代码来源:RoleService.cs


示例16: SaveFtpSent

        //public GetItemResponse<FtpSent> GetFtpSent(IDRequest request)
        //{
        //    try
        //    {
        //        return GenericGetEntity<FtpSent>(request);
        //    }
        //    catch (Exception ex)
        //    {
        //        return ErrorHandler.Handle<GetItemResponse<FtpSent>>(ex);
        //    }
        //}
        //public GetUpdateCountResponse GetFtpSentUpdateCount(GetUpdateCountRequest request)
        //{
        //    try
        //    {
        //        var response = GenericGetEntityUpdateCount<FtpSent>("FtpSent", request.TimeStamp, true, request.ID, request.LastRecordID);
        //        return response;
        //    }
        //    catch (Exception ex)
        //    {
        //        return ErrorHandler.Handle<GetUpdateCountResponse>(ex);
        //    }
        //}
        //public GetListResponse<FtpSent> GetFtpSentListByTimeStamp(GetListByTimestampRequest request)
        //{
        //    try
        //    {
        //        return GenericGetEntityListByTimestamp<FtpSent>("FtpSent", request.TimeStamp, request.Cap, true, request.ID, request.LastRecordID);
        //    }
        //    catch (Exception ex)
        //    {
        //        return ErrorHandler.Handle<GetListResponse<FtpSent>>(ex);
        //    }
        //}
        //public GetListResponse<FtpSent> GetFtpSentList(IDRequest request)
        //{
        //    try
        //    {
        //        return GenericGetEntityList<FtpSent>(request);
        //    }
        //    catch (Exception ex)
        //    {
        //        return ErrorHandler.Handle<GetListResponse<FtpSent>>(ex);
        //    }
        //}
        public BusinessMessageResponse SaveFtpSent(SaveRequest<FtpSent> request)
        {
            try
            {
                FtpSent entity = request.Item;
                BaseEntity.ValidateThrow(entity);

                object[] properties = new object[]
                {
                        entity.ID,
                        entity.CompanyID,
                        entity.UserID,
                        entity.IPAddress,
                        entity.Port,
                        entity.Username,
                        entity.Password,
                        entity.PSK,
                        entity.AttachmentFiles,
                        entity.DestinationPath,
                        entity.Retry,
                        entity.TimeToSend,
                        entity.Status,
                        entity.DateCreated,
                        entity.DateModified = DateTime.UtcNow,
                        entity.LastRetryAt,
                        entity.Active,
                        entity.Deleted
            #if EntityProperty_NoDate
                        ,entity.`field`
            #endif
            #if EntityProperty_Date
                        ,BusinessBase.ReadyDateForStorage(entity.`field`)
            #endif
                    };
                var response = GenericSaveEntity<FtpSent>(entity.CompanyID, entity.Attributes, properties);  //Review IM-3747
                return response;
            }
            catch (Exception ex)
            {
                return ErrorHandler.Handle(ex);
            }
        }
开发者ID:ashish-antil,项目名称:Products,代码行数:87,代码来源:FtpSent.cs


示例17: SaveContactMap

        public BusinessMessageResponse SaveContactMap(SaveRequest<ContactMap> request)
        {
            try
            {
                BusinessMessageResponse response = null;
                var service = ImardaProxyManager.Instance.IImardaCRMProxy;
                ChannelInvoker.Invoke(delegate(out IClientChannel channel)
                {
                    channel = service as IClientChannel;
                    response = service.SaveContactMap(request);
                    ErrorHandler.Check(response);

                });
                return response;
            }
            catch (Exception ex)
            {
                return ErrorHandler.Handle<BusinessMessageResponse>(ex);
            }
        }
开发者ID:ashish-antil,项目名称:Products,代码行数:20,代码来源:ContactMap.Extra.cs


示例18: SaveHtmlContent

        public BaseResponse SaveHtmlContent(SaveRequest request)
        {
            using (var db = DbContext)
            {
                var entityDb = request.Entity.Map<HtmlContent, Entity.HtmlContent>();

                if (!db.HtmlContents.Any(e => e.Id == entityDb.Id))
                {
                    db.HtmlContents.Add(entityDb);
                }
                else
                {
                    db.Entry(entityDb).State = EntityState.Modified;
                }

                var success = db.SaveChanges() > 0;
                return new BaseResponse
                {
                    Success = success
                };
            }
        }
开发者ID:huutoannht,项目名称:mart,代码行数:22,代码来源:HtmlContentRepository.cs


示例19: SaveSnippet

        public Snippet SaveSnippet(SaveRequest request, bool clone)
        {
            // get username
            var currentUser = GetCurrentUserId(HttpContext);

            Snippet snippet = null;
            var snippetExists = !String.IsNullOrWhiteSpace(request.SnippetId);
            if (snippetExists)
            {
                snippet = _repository.FindSnippet(request.SnippetId);
                snippetExists = (snippet != null);
            }

            // See if we are cloning or not
            if (snippetExists)
            {
                var userOwnsSnippet = snippet.CreatedBy.Equals(currentUser, StringComparison.OrdinalIgnoreCase);
                clone = clone || !userOwnsSnippet;
            }

            var shouldCreateNewSnippet = !snippetExists || clone;
            if (shouldCreateNewSnippet)
            {
                snippet = new Snippet()
                              {
                                  CreatedBy = currentUser,
                                  Language = request.Language,
                                  Model = request.Model,
                                  Notes = request.Notes,
                                  Title = request.Title,
                                  View = request.Template,
                                  CloneOf = clone ? request.SnippetId : null
                              };
            }

            _repository.Save(snippet);

            return snippet;
        }
开发者ID:RazorPad,项目名称:RazorPad.Website,代码行数:39,代码来源:SnippetsController.cs


示例20: SaveArtice

        public BaseResponse SaveArtice(SaveRequest request)
        {
            var response = new BaseResponse();

            using (var db = DbContext)
            {
                var entityDb = request.Entity.Map<Artice, Entity.Artice>();

                if (!db.Artices.Any(e => e.Id == entityDb.Id))
                {
                    db.Artices.Add(entityDb);
                }
                else
                {
                    db.Entry(entityDb).State = EntityState.Modified;
                }

                response.Success = db.SaveChanges() > 0;
            }

            return response;
        }
开发者ID:huutoannht,项目名称:mart,代码行数:22,代码来源:ArticeRepository.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# SavedOrigin类代码示例发布时间:2022-05-24
下一篇:
C# SaveOptions类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap