public BusinessMessageResponse SaveSolutionList(SaveListRequest<Solution> request) { var response = new BusinessMessageResponse(); try { foreach (Solution item in request.List) { response = GenericSaveEntity<Solution>("Solution", new object[] { item.ID, item.SolutionName }); } } catch (Exception ex) { return ErrorHandler.Handle(ex); } return response; }
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); } }
public BusinessMessageResponse SaveSecurityEntityParentList(SaveListRequest<SecurityEntityParent> request) { var response = new BusinessMessageResponse(); try { BusinessMessageResponse itemRespnse = new BusinessMessageResponse(); foreach (SecurityEntityParent it in request.List) { itemRespnse = GenericSaveEntity<SecurityEntityParent>("SecurityEntityParent", it.RelationId, it.EntityId, it.ParentId, it.Active, it.Deleted); } response.Status = true; } catch (Exception ex) { return ErrorHandler.Handle(ex); } return response; }
//List<WidgetDef> widgets) public BusinessMessageResponse SaveWidgetDefList(SaveListRequest<WidgetDef> request) { var response = new BusinessMessageResponse(); try { var service = ImardaProxyManager.Instance.IImardaCRMProxy; ChannelInvoker.Invoke(delegate(out IClientChannel channel) { channel = service as IClientChannel; response = service.SaveWidgetDefList(request); }); } catch (Exception ex) { return ErrorHandler.Handle(ex); } return response; }
public BusinessMessageResponse AddSecurityObjectList(SaveListRequest<SecurityObjectInfo> SecurityObjectInfo) { var response = new BusinessMessageResponse(); try { List<SecurityObject> allSecurityObjects = GetAllSecurityObjectList(true).List; SaveListRequest<SecurityObject> saveRq = new SaveListRequest<SecurityObject>(); saveRq.List = new List<SecurityObject>(); foreach (SecurityObjectInfo pti in SecurityObjectInfo.List) { Predicate<SecurityObject> find = new Predicate<SecurityObject>( delegate(SecurityObject match) { return match.DisplayName == pti.Name; }); SecurityObject found = allSecurityObjects.Find(find); if (found == null) { // this Security Object doesn't exist, add it SecurityObject newObject = new SecurityObject(); newObject.DisplayName = pti.Name; newObject.ParentID = findSecurityObjectParentId(pti.Parent, ref allSecurityObjects); saveRq.List.Add(newObject); } else { // this Security Object does exist } } response = SaveSecurityObjectList(saveRq); } catch (Exception ex) { return ErrorHandler.Handle(ex); } return response; }
/// <summary> /// Delete security entries not by SecurityEntry.ID but by (.EntityID, .SecurityID) /// </summary> /// <param name="request"></param> /// <returns></returns> public BusinessMessageResponse DeleteSecurityEntryList(SaveListRequest<SecurityEntryKey> request) { try { Guid userID; if (!request.Get<Guid>("UserID", out userID)) userID = Guid.Empty; var db = ImardaDatabase.CreateDatabase(Util.GetConnName<SecurityEntry>()); foreach (SecurityEntryKey key in request.List) { db.ExecuteNonQuery("SPDeleteSecurityEntryByFKey", key.EntityID, key.SecurityObjectID, userID); } return new BusinessMessageResponse(); } catch (Exception ex) { return ErrorHandler.Handle(ex); } }
public SolutionMessageResponse InstallNotificationItemsToNotificationPlan(SaveListRequest<NotificationItem> entities) { Guid notificationPlanID; if (entities.Get<Guid>("NotificationPlanID", out notificationPlanID)) { Guid companyID = entities.CompanyID; Guid userID = entities.Get<Guid>("UserID", Guid.Empty); SolutionMessageResponse response = new SolutionMessageResponse(); ImardaCRMBusiness.IImardaCRM service = ImardaProxyManager.Instance.IImardaCRMProxy; ChannelInvoker.Invoke(delegate(out IClientChannel channel) { channel = service as IClientChannel; //Delete NotificationItems first associated with the NotificationPlanID IDRequest req = new IDRequest(notificationPlanID) { CompanyID = companyID }; service.DeleteNotificationPlanItemsByPlanID(req); var links = new List<NotificationPlanItem>(); var piRequest = new SaveListRequest<NotificationPlanItem>(); foreach (NotificationItem entity in entities.List) { links.Add(new NotificationPlanItem { ID = SequentialGuid.NewDbGuid(), CRMID = entity.CRMID, CompanyID = companyID, UserID = userID, DeliveryMethod = entity.DeliveryMethod, NotificationItemID = entity.ID, NotificationPlanID = notificationPlanID, }); } piRequest.List = links; BusinessMessageResponse busResponse = service.SaveNotificationPlanItemList(piRequest); ServiceMessageHelper.Copy(busResponse, response); }); return response; } else return new SolutionMessageResponse { Status = false, StatusMessage = "No PlanID" }; }
public BusinessMessageResponse SaveWidgetDefList(SaveListRequest<WidgetDef> request) { //save to storage var response = new BusinessMessageResponse(); try { foreach (WidgetDef entity in request.List) { BaseEntity.ValidateThrow(entity); object[] properties = new object[] { entity.ID, entity.Active, entity.Deleted, entity.DateCreated, entity.DateModified = DateTime.UtcNow, entity.CompanyID, entity.UserID, entity.Title, entity.Type, entity.Row, entity.Column, entity.RowSpan, entity.ColumnSpan #if EntityProperty_NoDate ,entity.`field` #endif #if EntityProperty_Date ,BusinessBase.ReadyDateForStorage(entity.`field`) #endif }; response = GenericSaveEntity<WidgetDef>(entity.CompanyID, entity.Attributes, properties); //Review IM-3747 } } catch (Exception ex) { return ErrorHandler.Handle(ex); } return response; }
public BusinessMessageResponse SaveRouteWayPointList(SaveListRequest<RouteWaypoint> request) { var response = new BusinessMessageResponse(); try { foreach (RouteWaypoint entity in request.List) { 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 }; response = GenericSaveEntity<RouteWaypoint>(entity.CompanyID, entity.Attributes, properties); //Review IM-3747 } return response; } catch (Exception ex) { return ErrorHandler.Handle(ex); } }
public BusinessMessageResponse ChangeReportTypeListOwner(SaveListRequest<ReportType> request) { Initialize(); BusinessMessageResponse response = new BusinessMessageResponse(); string sNewOwnerID = request["NewOwnerID"].ToLower(); Guid newOwnerID = new Guid(sNewOwnerID); string pathFrom = null; string pathTo = null; bool moved = false; try { foreach (ReportType reportType in request.List) { SaveRequest<ReportType> req = new SaveRequest<ReportType>(); moved = false; string ownerPath = InstancesFolder + '/' + sNewOwnerID.ToLower(); CreateFolder(sNewOwnerID.ToLower(), InstancesFolder); pathFrom = InstancesFolder + '/' + reportType.OwnerID.ToString().ToLower() + '/' + reportType.Name; pathTo = ownerPath + '/' + reportType.Name; _Rs2005.MoveItem(pathFrom, pathTo); moved = true; reportType.OwnerID = newOwnerID; req.Item = reportType; ChangeReportTypeOwner(req); } } catch (Exception ex) { if (moved) _Rs2005.MoveItem(pathTo, pathFrom); // reverse the move return ErrorHandler.Handle(ex); } return response; }
public BusinessMessageResponse SaveCompanyLocationList(SaveListRequest<CompanyLocation> request) { try { BusinessMessageResponse response = null; var service = ImardaProxyManager.Instance.IImardaCRMProxy; ChannelInvoker.Invoke(delegate(out IClientChannel channel) { channel = service as IClientChannel; response = service.SaveCompanyLocationList(request); }); return response; } catch (Exception ex) { return ErrorHandler.Handle(ex); } }
public BusinessMessageResponse SaveSecurityObjectList(SaveListRequest<SecurityObject> request) { try { BusinessMessageResponse bmr = new BusinessMessageResponse(); foreach (SecurityObject it in request.List) { bmr = GenericSaveEntity<SecurityObject>("SecurityObject", it.ID, it.SolutionID, it.ApplicationID, it.DisplayName, it.ParentID, it.ObjectGroupID, it.Description, it.PermissionsConfigurable, it.ObjectType, it.UserID , it.Active, it.Deleted, it.FeatureID); } return bmr; } catch (Exception ex) { return ErrorHandler.Handle(ex); } }
public BusinessMessageResponse SaveProfileAdmissionList(SaveListRequest<ProfileAdmission> request) { var response = new BusinessMessageResponse(); try { foreach (ProfileAdmission entity in request.List) { 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 }; response = GenericSaveEntity<ProfileAdmission>(entity.CompanyID, entity.Attributes, properties); //Review IM-3747 } return response; } catch (Exception ex) { return ErrorHandler.Handle(ex); } }
public BusinessMessageResponse SaveReportList(SaveListRequest<Report> request) { var response = new BusinessMessageResponse(); try { foreach (Report report in request.List) { object[] properties = new object[] { report.ID, report.ReportTypeID, report.ReportNumber, report.SnapshotName, report.ScheduledTaskID, report.Expiry, report.Notes, report.Status, report.CompanyID, report.UserID, report.DateCreated, report.DateModified, report.Deleted, report.Active }; response = GenericSaveEntity<Report>(report.CompanyID, report.Attributes, properties); //Review IM-3747 } } catch (Exception ex) { return ErrorHandler.Handle(ex); } return response; }
public BusinessMessageResponse SaveNotificationList(SaveListRequest<Notification> request) { var response = new BusinessMessageResponse(); try { foreach (Notification entity in request.List) { BaseEntity.ValidateThrow(entity); object[] properties = new object[] { entity.ID, entity.CompanyID, entity.UserID, entity.NotificationPlanID, entity.Description, entity.Status, entity.DateCreated, entity.DateModified = DateTime.UtcNow, entity.Active, entity.Deleted #if EntityProperty_NoDate ,entity.`field` #endif #if EntityProperty_Date ,BusinessBase.ReadyDateForStorage(entity.`field`) #endif }; response = GenericSaveEntity<Notification>(entity.CompanyID, entity.Attributes, properties); //Review IM-3747 } return response; } catch (Exception ex) { return ErrorHandler.Handle(ex); } }
//#region GetAllAttributeValues //public GetListResponse<AttributeValue> GetAttributeValueList(IDRequest request) //{ // try // { // var response = GenericGetCachedEntityList<AttributeValue>(request); // return response; // } // catch (Exception ex) // { // return ErrorHandler.Handle<GetListResponse<AttributeValue>>(ex); // } //} //#endregion //#region Get Attribute Values for the one entity type and entity GUID e.g. "Unit",4ABB7A8D-30A3-4FC4-BA12-08CE46585F2B (so e.g. all attributes for a specific Unit) //public GetListResponse<AttributeValue> GetAttributeValueListByEntityType_EntityID(IDRequest request) //{ // try // { // return GenericGetCachedEntityListByParams<AttributeValue>("SPGetAttributeValueByEntityType_EntityID", false, request); // } // catch (Exception ex) // { // return ErrorHandler.Handle<GetListResponse<AttributeValue>>(ex); // } //} //#endregion //#region GetAttributeValue //public AttributeValue GetAttributeValue(FullBusinessEntity entity, string attributeName) //{ // var entityTypeName = entity.GetType().Name; // var request = new IDRequest(entity.ID, "EntityTypeName", entityTypeName, "VarName", attributeName); // var response = GetAttributeValueByEntityType_EntityID_Name(request); // return response.Item; //} //#endregion //#region Get AttributeValue by ID //public GetItemResponse<AttributeValue> GetAttributeValueByID(IDRequest request) //{ // try // { // //return GenericGetEntity<AttributeValue>(request); // return GenericGetCachedEntity<AttributeValue>(request); // //var response = GenericGetCachedEntityByParams<AttributeValue>("SPGetVehicleByName", false, request); // } // catch (Exception ex) // { // return ErrorHandler.Handle<GetItemResponse<AttributeValue>>(ex); // } //} //#endregion //#region Get AttributeValue by EntityType, EntityID, Attribute name //public GetItemResponse<ImardaAttributingBusiness.AttributeValue> GetAttributeValueByEntityType_EntityID_Name(IDRequest request) //{ // try // { // return GenericGetCachedEntityByParams<AttributeValue>("SPGetAttributeValueByEntityType_EntityID_Name", false, request); // } // catch (Exception ex) // { // return ErrorHandler.Handle<GetItemResponse<AttributeValue>>(ex); // } //} //#endregion // GenericGetCachedEntityByParams //public GetItemResponse<AttributeValue> GetAttributeValueByNameAndEntityType(IDRequest request) //{ // try // { // return ImardaDatabase.GetItem<AttributeValue>("SPGetAttributeValueByName", request.ID, request.GetString("VarName")); // } // catch (Exception ex) // { // return ErrorHandler.Handle<GetItemResponse<AttributeValue>>(ex); // } //} public BusinessMessageResponse SaveAttributeValueList(SaveListRequest<FernBusinessBase.AttributeValue> request) { var response = new BusinessMessageResponse(); try { foreach (FernBusinessBase.AttributeValue item in request.List) { AttributeValue attributeValue = ConvertToBusinessAttributeValue(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); if (!response.Status) { break; } } return response; } catch (Exception ex) { return ErrorHandler.Handle(ex); } }
public BusinessMessageResponse SaveTrackStopList(SaveListRequest<TrackStop> request) { throw new NotImplementedException(); }
public BusinessMessageResponse SaveApplicationFeatureOwnerList(SaveListRequest<ApplicationFeatureOwner> request) { try { var response = new BusinessMessageResponse(); var service = ImardaProxyManager.Instance.IImardaSecurityProxy; ChannelInvoker.Invoke(delegate(out IClientChannel channel) { channel = service as IClientChannel; response = service.SaveApplicationFeatureOwnerList(request); }); return response; } catch (Exception ex) { return ErrorHandler.Handle(ex); } }
public BusinessMessageResponse SaveUsageLogList(SaveListRequest<UsageLog> request) { var response = new BusinessMessageResponse(); try { foreach (UsageLog entity in request.List) { var properties = new object[] { entity.ID, entity.CompanyID, entity.UserID, entity.DateCreated, entity.DateModified = DateTime.UtcNow, entity.Active, entity.Deleted ,entity.ApiID ,entity.ApiVersion ,entity.Method ,entity.ExecutionTime #if EntityProperty_NoDate ,entity.`field` #endif #if EntityProperty_Date ,BusinessBase.ReadyDateForStorage(entity.`field`) #endif }; response = GenericSaveEntity<UsageLog>(entity.CompanyID, entity.Attributes, properties); //Review IM-3747 } return response; } catch (Exception ex) { return ErrorHandler.Handle(ex); } }
public BusinessMessageResponse UpdateShortcutList(SaveListRequest<Shortcut> request) { var companyID = request.CompanyID; var ownerID = new Guid(request["OwnerID"]); var itemType = request["ItemType"]; if (itemType == null) itemType = "0"; try { var db = ImardaDatabase.CreateDatabase(Util.GetConnName<Shortcut>()); db.ExecuteNonQuery("SPClearShortcutList", companyID, ownerID, itemType); return SaveShortcutList(request); } catch (Exception ex) { return ErrorHandler.Handle(ex); } }
public BusinessMessageResponse SaveAttributeDefinitionList(SaveListRequest<FernBusinessBase.AttributeDefinition> request) { var response = new BusinessMessageResponse(); try { foreach (FernBusinessBase.AttributeDefinition item in request.List) { AttributeDefinition ad = ConvertToBusinessAttributeDefinition(item); BaseEntity.ValidateThrow(ad); 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 }; response = GenericSaveEntity<AttributeDefinition>("AttributeDefinition", adProperties); if (!response.Status) { break; } } return response; } catch (Exception ex) { return ErrorHandler.Handle(ex); } }
public BusinessMessageResponse SaveApiMethodList(SaveListRequest<ApiMethod> request) { var response = new BusinessMessageResponse(); try { foreach (ApiMethod entity in request.List) { var properties = new object[] { entity.ID, entity.CompanyID, entity.UserID, entity.DateCreated, entity.DateModified = DateTime.UtcNow, entity.Active, entity.Deleted ,entity.Name ,entity.Description ,entity.ApiID #if EntityProperty_NoDate ,entity.`field` #endif #if EntityProperty_Date ,BusinessBase.ReadyDateForStorage(entity.`field`) #endif }; response = GenericSaveEntity<ApiMethod>(entity.CompanyID, entity.Attributes, properties); } return response; } catch (Exception ex) { return ErrorHandler.Handle(ex); } }
public BusinessMessageResponse SavePersonList(SaveListRequest<Person> request) { try { BusinessMessageResponse response = null; foreach (Person entity in request.List) { BaseEntity.ValidateThrow(entity); object[] properties = new object[] { entity.ID, entity.CompanyID, entity.Path, //& gs-351 entity.Active, entity.Deleted, entity.DateCreated, entity.DateModified = DateTime.UtcNow, entity.UserID, //entity.UserName, //$ IM-3609 entity.FullName, entity.Email, entity.Phone, entity.MobilePhone, entity.JobTitle, entity.Picture #if EntityProperty_NoDate ,entity.`field` #endif #if EntityProperty_Date ,BusinessBase.ReadyDateForStorage(entity.`field`) #endif }; response = GenericSaveEntity<Person>(entity.CompanyID, entity.Attributes, properties); //Review IM-3747 } return response; } catch (Exception ex) { return ErrorHandler.Handle(ex); } }
public BusinessMessageResponse SaveTaskParameterList(SaveListRequest<TaskParameter> request) { var response = new BusinessMessageResponse(); try { foreach (TaskParameter entity in request.List) { BaseEntity.ValidateThrow(entity); object [] properties=new object[] { entity.ID, entity.TaskID, entity.Output, entity.Fixed, entity.Ord, entity.Name, entity.DataType, entity.DisplayName, entity.Value, entity.CompanyID, entity.UserID, entity.DateCreated, entity.DateModified = DateTime.UtcNow, entity.Deleted, entity.Active #if EntityProperty_NoDate ,entity.`field` #endif #if EntityProperty_Date ,BusinessBase.ReadyDateForStorage(entity.`field`) #endif }; response = GenericSaveEntity<TaskParameter>(entity.Attributes, properties); } } catch (Exception ex) { return ErrorHandler.Handle(ex); } return response; }
public BusinessMessageResponse SaveCompanyList(SaveListRequest<Company> request) { var response = new BusinessMessageResponse(); try { foreach (Company entity in request.List) { 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; }
public BusinessMessageResponse SaveEmailGroupList(SaveListRequest<EmailGroup> request) { var response = new BusinessMessageResponse(); try { foreach (EmailGroup entity in request.List) { BaseEntity.ValidateThrow(entity); object [] properties=new object[] { entity.ID, entity.Active, entity.Deleted, entity.DateCreated, entity.DateModified = DateTime.UtcNow, entity.CompanyID, entity.UserID, entity.GroupName, entity.GroupDescription, entity.GroupEmailRecipients, entity.GroupEmailAddresses #if EntityProperty_NoDate ,entity.`field` #endif #if EntityProperty_Date ,BusinessBase.ReadyDateForStorage(entity.`field`) #endif }; response = GenericSaveEntity<EmailGroup>(entity.CompanyID, entity.Attributes, properties); //Review IM-3747 } } catch (Exception ex) { return ErrorHandler.Handle(ex); } return response; }
public BusinessMessageResponse SaveSMSPendingList(SaveListRequest<SMSPending> request) { var response = new BusinessMessageResponse(); try { foreach (SMSPending entity in request.List) { BaseEntity.ValidateThrow(entity); object[] properties = new object[] { entity.ID, entity.CompanyID, entity.UserID, entity.SMSDraftID, entity.Subject, entity.Message, entity.NotificationID, entity.RecipientName, entity.ToPhoneNumber, 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 }; response = GenericSaveEntity<SMSPending>(entity.CompanyID, entity.Attributes, properties); //Review IM-3747 } return response; } catch (Exception ex) { return ErrorHandler.Handle(ex); } }
public BusinessMessageResponse SaveSecurityEntryList(SaveListRequest<SecurityEntry> request) { var response = new BusinessMessageResponse(); try { foreach (SecurityEntry it in request.List) { object[] properties = new object[] { it.ID, it.ApplicationID, it.EntityID, it.SecurityObjectID, it.PermissionsGranted, it.PermissionsDenied, it.EntryType, it.Active, it.Deleted }; response = GenericSaveEntity<SecurityEntry>(properties); } } catch (Exception ex) { return ErrorHandler.Handle(ex); } return response; }
public BusinessMessageResponse SaveProfileList(SaveListRequest<Profile> request) { var response = new BusinessMessageResponse(); try { foreach (Profile entity in request.List) { var properties = new object[] { entity.ID, entity.CompanyID, entity.UserID, entity.DateCreated, entity.DateModified = DateTime.UtcNow, entity.Active, entity.Deleted ,entity.Name ,entity.Description ,BusinessBase.ReadyDateForStorage(entity.StartDate) ,BusinessBase.ReadyDateForStorage(entity.ExpiryDate) ,entity.AreaType ,entity.ProfileType ,entity.SettingsLinkID ,entity.Settings #if EntityProperty_NoDate ,entity.`field` #endif #if EntityProperty_Date ,BusinessBase.ReadyDateForStorage(entity.`field`) #endif }; response = GenericSaveEntity<Profile>(entity.CompanyID, entity.Attributes, properties); //Review IM-3747 } return response; } catch (Exception ex) { return ErrorHandler.Handle(ex); } }
public BusinessMessageResponse SaveTaskList(SaveListRequest<Task> request) { var response = new BusinessMessageResponse(); try { foreach (Task entity in request.List) { BaseEntity.ValidateThrow(entity); object [] properties=new object[] { entity.ID, entity.ParentID, entity.Ord, entity.IsTemplate, entity.Precondition, entity.Program, entity.Worker, entity.Status, entity.EstimatedDuration, entity.EndTime, entity.CompanyID, entity.UserID, entity.DateCreated, entity.DateModified = DateTime.UtcNow, entity.Deleted, entity.Active #if EntityProperty_NoDate ,entity.`field` #endif #if EntityProperty_Date ,BusinessBase.ReadyDateForStorage(entity.`field`) #endif }; response = GenericSaveEntity<Task>(entity.Attributes, properties); } } catch (Exception ex) { return ErrorHandler.Handle(ex); } return response; }