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


C# SaveRequest类代码示例

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


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


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