/// <summary> /// Gets message of the collection of entity of common. /// </summary> /// <param name="criteria"></param> /// <param name="queryPagingSetting"></param> /// <param name="queryOrderBySettingCollection"></param> /// <returns>business layer built-in message <see cref="List<Framework.Models.NameValuePair>"/></returns> public async Task <Framework.Services.BusinessLogicLayerResponseMessageNameValuePairCollection> GetMessageOfNameValuePairByCommon( Elmah.CommonBLLEntities.ElmahTypeChainedQueryCriteriaCommon criteria , Framework.Queries.QueryPagingSetting queryPagingSetting , Framework.Queries.QueryOrderBySettingCollection queryOrderBySettingCollection , Framework.Models.DataServiceTypes dataServiceType = Framework.Models.DataServiceTypes.DataSourceResult) { //log.Info(string.Format("{0}: GetMessageOfNameValuePairByCommon", Framework.Models.LoggingOptions.UI_Process_Started.ToString())); var _Request = new Elmah.CommonBLLEntities.ElmahTypeRequestMessageUserDefinedOfCommon( Framework.Services.BusinessLogicLayerRequestTypes.Search , "GetMessageOfNameValuePairByCommon" , Guid.NewGuid().ToString() ); _Request.Criteria = criteria; _Request.QueryPagingSetting = queryPagingSetting; if (queryOrderBySettingCollection == null || queryOrderBySettingCollection.Count == 0) { _Request.QueryOrderBySettingCollection = new Framework.Queries.QueryOrderBySettingCollection(); _Request.QueryOrderBySettingCollection.Add("Name", Framework.Queries.QueryOrderDirections.Ascending); } else { _Request.QueryOrderBySettingCollection = queryOrderBySettingCollection; } _Request.DataServiceType = dataServiceType; Framework.Services.BusinessLogicLayerResponseMessageNameValuePairCollection _Response = await GetCollectionOfNameValuePairByCommon(_Request); return(_Response); }
/* * /// <summary> * /// Inserts the specified input. * /// </summary> * /// <param name="request">The request.</param> * /// <returns>a message with action result</returns> * public async Task<Elmah.CommonBLLEntities.ElmahTypeResponseMessageBuiltIn> InsertEntity(Elmah.CommonBLLEntities.ElmahTypeRequestMessageBuiltIn request) * { * var _retval = new Elmah.CommonBLLEntities.ElmahTypeResponseMessageBuiltIn(); * _retval.BusinessLogicLayerRequestID = request.BusinessLogicLayerRequestID; * * if (request != null && request.Criteria.Count == 1) * { * try * { * //log.Info(string.Format("{0}: InsertEntity", Framework.Models.LoggingOptions.Business_Logic_Layer_Process_Started.ToString())); * var _resultFromDAL = await this.DALClassInstance.Insert(request.Criteria[0]); * * Framework.Services.BusinessLogicLayerResponseMessageBaseHelper.MapDataAccessLayerMessageToBusinessLogicLayerResponseMessage<List<Elmah.DataSourceEntities.ElmahType>>(_resultFromDAL, _retval); * //log.Info(string.Format("{0}: InsertEntity", Framework.Models.LoggingOptions.Business_Logic_Layer_Process_Ended.ToString())); * } * catch(Exception ex) * { * _retval.BusinessLogicLayerResponseStatus = Framework.Services.BusinessLogicLayerResponseStatus.MessageErrorDetected; * _retval.ServerErrorMessage = ex.Message; * } * } * else * { * _retval.BusinessLogicLayerResponseStatus = Framework.Services.BusinessLogicLayerResponseStatus.RequestError; * } * * return _retval; * } * * /// <summary> * /// Updates the specified input. * /// </summary> * /// <param name="request">The request.</param> * /// <returns>a message with action result</returns> * public async Task<Elmah.CommonBLLEntities.ElmahTypeResponseMessageBuiltIn> UpdateEntity(Elmah.CommonBLLEntities.ElmahTypeRequestMessageBuiltIn request) * { * var _retval = new Elmah.CommonBLLEntities.ElmahTypeResponseMessageBuiltIn(); * _retval.BusinessLogicLayerRequestID = request.BusinessLogicLayerRequestID; * * if (request != null && request.Criteria.Count == 1) * { * try * { * //log.Info(string.Format("{0}: UpdateEntity", Framework.Models.LoggingOptions.Business_Logic_Layer_Process_Started.ToString())); * var _resultFromDAL = await this.DALClassInstance.Update(request.Criteria[0]); * * Framework.Services.BusinessLogicLayerResponseMessageBaseHelper.MapDataAccessLayerMessageToBusinessLogicLayerResponseMessage<List<Elmah.DataSourceEntities.ElmahType>>(_resultFromDAL, _retval); * //log.Info(string.Format("{0}: UpdateEntity", Framework.Models.LoggingOptions.Business_Logic_Layer_Process_Ended.ToString())); * } * catch(Exception ex) * { * _retval.BusinessLogicLayerResponseStatus = Framework.Services.BusinessLogicLayerResponseStatus.MessageErrorDetected; * _retval.ServerErrorMessage = ex.Message; * } * } * else * { * _retval.BusinessLogicLayerResponseStatus = Framework.Services.BusinessLogicLayerResponseStatus.RequestError; * } * * return _retval; * } * * /// <summary> * /// Batches the insert. * /// </summary> * /// <param name="request">The request.</param> * /// <returns>a message with action result</returns> * public async Task<Elmah.CommonBLLEntities.ElmahTypeResponseMessageBuiltIn> BatchInsert(Elmah.CommonBLLEntities.ElmahTypeRequestMessageBuiltIn request) * { * //log.Info(string.Format("{0}: BatchInsert", Framework.Models.LoggingOptions.Business_Logic_Layer_Process_Started.ToString())); * var _retval = new Elmah.CommonBLLEntities.ElmahTypeResponseMessageBuiltIn(); * _retval.BusinessLogicLayerRequestID = request.BusinessLogicLayerRequestID; * * if (request != null) * { * try * { * //log.Info(string.Format("{0}: GetCountOfEntityOfCommon", Framework.Models.LoggingOptions.Business_Logic_Layer_Process_Started.ToString())); * var _resultFromDAL = await this.DALClassInstance.BatchInsert(request.Criteria); * * Framework.Services.BusinessLogicLayerResponseMessageBaseHelper.MapDataAccessLayerMessageToBusinessLogicLayerResponseMessage<List<Elmah.DataSourceEntities.ElmahType>>(_resultFromDAL, _retval); * //log.Info(string.Format("{0}: GetCountOfEntityOfCommon", Framework.Models.LoggingOptions.Business_Logic_Layer_Process_Ended.ToString())); * } * catch(Exception ex) * { * _retval.BusinessLogicLayerResponseStatus = Framework.Services.BusinessLogicLayerResponseStatus.MessageErrorDetected; * _retval.ServerErrorMessage = ex.Message; * } * } * else * { * _retval.BusinessLogicLayerResponseStatus = Framework.Services.BusinessLogicLayerResponseStatus.RequestError; * } * //log.Info(string.Format("{0}: BatchInsert", Framework.Models.LoggingOptions.Business_Logic_Layer_Process_Ended.ToString())); * return _retval; * } * * /// <summary> * /// Batches the delete. * /// </summary> * /// <param name="request">The request.</param> * /// <returns>a message with action result</returns> * public async Task<Elmah.CommonBLLEntities.ElmahTypeResponseMessageBuiltIn> BatchDelete(Elmah.CommonBLLEntities.ElmahTypeRequestMessageBuiltIn request) * { * //log.Info(string.Format("{0}: BatchDelete", Framework.Models.LoggingOptions.Business_Logic_Layer_Process_Started.ToString())); * var _retval = new Elmah.CommonBLLEntities.ElmahTypeResponseMessageBuiltIn(); * _retval.BusinessLogicLayerRequestID = request.BusinessLogicLayerRequestID; * * if (request != null) * { * try * { * var _resultFromDAL = await this.DALClassInstance.BatchDelete(request.Criteria); * * Framework.Services.BusinessLogicLayerResponseMessageBaseHelper.MapDataAccessLayerMessageToBusinessLogicLayerResponseMessage<List<Elmah.DataSourceEntities.ElmahType>>(_resultFromDAL, _retval); * } * catch(Exception ex) * { * _retval.BusinessLogicLayerResponseStatus = Framework.Services.BusinessLogicLayerResponseStatus.MessageErrorDetected; * _retval.ServerErrorMessage = ex.Message; * } * } * else * { * _retval.BusinessLogicLayerResponseStatus = Framework.Services.BusinessLogicLayerResponseStatus.RequestError; * } * //log.Info(string.Format("{0}: BatchDelete", Framework.Models.LoggingOptions.Business_Logic_Layer_Process_Ended.ToString())); * return _retval; * } * * /// <summary> * /// Batches the update. * /// </summary> * /// <param name="request">The request.</param> * /// <returns>a message with action result</returns> * public async Task<Elmah.CommonBLLEntities.ElmahTypeResponseMessageBuiltIn> BatchUpdate(Elmah.CommonBLLEntities.ElmahTypeRequestMessageBuiltIn request) * { * //log.Info(string.Format("{0}: BatchUpdate", Framework.Models.LoggingOptions.Business_Logic_Layer_Process_Started.ToString())); * var _retval = new Elmah.CommonBLLEntities.ElmahTypeResponseMessageBuiltIn(); * _retval.BusinessLogicLayerRequestID = request.BusinessLogicLayerRequestID; * * if (request != null) * { * try * { * var _resultFromDAL = await this.DALClassInstance.BatchDelete(request.Criteria); * * Framework.Services.BusinessLogicLayerResponseMessageBaseHelper.MapDataAccessLayerMessageToBusinessLogicLayerResponseMessage<List<Elmah.DataSourceEntities.ElmahType>>(_resultFromDAL, _retval); * } * catch(Exception ex) * { * _retval.BusinessLogicLayerResponseStatus = Framework.Services.BusinessLogicLayerResponseStatus.MessageErrorDetected; * _retval.ServerErrorMessage = ex.Message; * } * } * else * { * _retval.BusinessLogicLayerResponseStatus = Framework.Services.BusinessLogicLayerResponseStatus.RequestError; * } * //log.Info(string.Format("{0}: BatchUpdate", Framework.Models.LoggingOptions.Business_Logic_Layer_Process_Ended.ToString())); * return _retval; * } */ #endregion InsertEntity/UpdateEntity/DeleteEntity/BatchInsert/BatchUpdate/BatchDelete /// <summary> /// Gets the collection of entity of common. /// </summary> /// <param name="isToCompareType">will compare/filter type property/field/column if true, otherwise false</param> /// <param name="type" > value to compare/filter with type property/field/column</param> /// <param name="currentIndex">Index of the current.</param> /// <param name="pageSize">Size of the page.</param> /// <param name="queryOrderByExpression">The query order by expression.</param> /// <returns></returns> private static Elmah.CommonBLLEntities.ElmahTypeChainedQueryCriteriaCommon _GetElmahTypeChainedQueryCriteriaCommon( bool isToCompareType, string type ) { var criteria = new Elmah.CommonBLLEntities.ElmahTypeChainedQueryCriteriaCommon(); criteria.Common.Type = new QuerySystemStringContainsCriteria(isToCompareType, type); return(criteria); }