本文整理汇总了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);
}
}
示例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;
});
}
示例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);
}
示例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);
}
}
示例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);
}
}
示例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;
}
示例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);
}
}
示例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);
}
}
示例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;
}
示例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;
});
}
示例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);
}
}
示例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;
}
示例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;
}
示例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);
}
}
示例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;
});
}