Esempio n. 1
0
        public virtual MainViewModel <M> SearchList(T SearchContext)
        {
            var      message           = new ExceptionMessage("Enter->" + MethodBase.GetCurrentMethod());
            List <M> results           = null;
            var      searchContextList = new List <SearchContextEntity>();

            if (NotValidIdentity())
            {
                SessionExpired(message);
            }
            else
            {
                try
                {
                    results = GridSearch(SearchContext, message);
                    if (results.Count > _config.RowsLimit)
                    {
                        message.Fail();
                        message.LastUserMessage = Messages.GeneriLargeDataErrorMsg;
                        return(new MainViewModel <M>(new List <M>(), message));
                    }
                }
                catch (Exception ex)
                {
                    LogBaseControllerMessage(ex, message);
                }
            }
            return(new MainViewModel <M>(results, message));
        }
Esempio n. 2
0
 public void LogBaseControllerMessage(Exception ex, ExceptionMessage message)
 {
     message.Fail();
     message.LastMessage = ex.Message;
     if (message.UserMessages.Count == 0)
     {
         message.LastUserMessage = GenericSessionErrorMsg;
     }
     if (Logger == null)
     {
         Logger = new ExceptionWriteLog();
     }
     Logger.LogException(message, LogFormat, ex);
 }
Esempio n. 3
0
 protected void SessionExpired(ExceptionMessage message)
 {
     message.Fail();
 }