Example #1
0
        /// <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.ElmahUserChainedQueryCriteriaCommon 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.ElmahUserRequestMessageUserDefinedOfCommon(
                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);
        }
Example #2
0
/*
 *      /// <summary>
 *      /// Inserts the specified input.
 *      /// </summary>
 *      /// <param name="request">The request.</param>
 *      /// <returns>a message with action result</returns>
 *      public async Task<Elmah.CommonBLLEntities.ElmahUserResponseMessageBuiltIn> InsertEntity(Elmah.CommonBLLEntities.ElmahUserRequestMessageBuiltIn request)
 *      {
 *          var _retval = new Elmah.CommonBLLEntities.ElmahUserResponseMessageBuiltIn();
 *              _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.ElmahUser>>(_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.ElmahUserResponseMessageBuiltIn> UpdateEntity(Elmah.CommonBLLEntities.ElmahUserRequestMessageBuiltIn request)
 *      {
 *          var  _retval = new Elmah.CommonBLLEntities.ElmahUserResponseMessageBuiltIn();
 *          _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.ElmahUser>>(_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.ElmahUserResponseMessageBuiltIn> BatchInsert(Elmah.CommonBLLEntities.ElmahUserRequestMessageBuiltIn request)
 *      {
 *          //log.Info(string.Format("{0}: BatchInsert", Framework.Models.LoggingOptions.Business_Logic_Layer_Process_Started.ToString()));
 *          var _retval = new Elmah.CommonBLLEntities.ElmahUserResponseMessageBuiltIn();
 *          _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.ElmahUser>>(_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.ElmahUserResponseMessageBuiltIn> BatchDelete(Elmah.CommonBLLEntities.ElmahUserRequestMessageBuiltIn request)
 *      {
 *          //log.Info(string.Format("{0}: BatchDelete", Framework.Models.LoggingOptions.Business_Logic_Layer_Process_Started.ToString()));
 *          var _retval = new Elmah.CommonBLLEntities.ElmahUserResponseMessageBuiltIn();
 *          _retval.BusinessLogicLayerRequestID = request.BusinessLogicLayerRequestID;
 *
 *          if (request != null)
 *          {
 *              try
 *              {
 *                  var _resultFromDAL = await this.DALClassInstance.BatchDelete(request.Criteria);
 *
 *                  Framework.Services.BusinessLogicLayerResponseMessageBaseHelper.MapDataAccessLayerMessageToBusinessLogicLayerResponseMessage<List<Elmah.DataSourceEntities.ElmahUser>>(_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.ElmahUserResponseMessageBuiltIn> BatchUpdate(Elmah.CommonBLLEntities.ElmahUserRequestMessageBuiltIn request)
 *      {
 *          //log.Info(string.Format("{0}: BatchUpdate", Framework.Models.LoggingOptions.Business_Logic_Layer_Process_Started.ToString()));
 *          var _retval = new Elmah.CommonBLLEntities.ElmahUserResponseMessageBuiltIn();
 *          _retval.BusinessLogicLayerRequestID = request.BusinessLogicLayerRequestID;
 *
 *          if (request != null)
 *          {
 *              try
 *              {
 *                  var _resultFromDAL = await this.DALClassInstance.BatchDelete(request.Criteria);
 *
 *                  Framework.Services.BusinessLogicLayerResponseMessageBaseHelper.MapDataAccessLayerMessageToBusinessLogicLayerResponseMessage<List<Elmah.DataSourceEntities.ElmahUser>>(_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="isToCompareUser">will compare/filter user property/field/column if true, otherwise false</param>
        /// <param name="user" > value to compare/filter with user 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.ElmahUserChainedQueryCriteriaCommon _GetElmahUserChainedQueryCriteriaCommon(
            bool isToCompareUser, string user
            )
        {
            var criteria = new Elmah.CommonBLLEntities.ElmahUserChainedQueryCriteriaCommon();

            criteria.Common.User = new QuerySystemStringContainsCriteria(isToCompareUser, user);
            return(criteria);
        }