Exemple #1
0
        private bool IsEventForMessage(BLLEventArgs eventArgs, out string messageText)
        {
            messageText = "";
            bool isEventForMessage = true;

            if (string.IsNullOrWhiteSpace(eventArgs.MessageKey) && string.IsNullOrWhiteSpace(eventArgs.MessageDescription))
            {
                isEventForMessage = false;
            }
            if (!new[] { EventType.Error, EventType.Information, EventType.Success, EventType.Warning }.Contains(eventArgs.EventType))
            {
                isEventForMessage = false;
            }

            if (isEventForMessage)
            {
                messageText = ConfigValues.Get(eventArgs.MessageKey);
                if (string.IsNullOrWhiteSpace(messageText))
                {
                    messageText = eventArgs.MessageDescription;
                }
            }

            return(isEventForMessage);
        }
Exemple #2
0
        public IActionResult Index()
        {
            var watch = System.Diagnostics.Stopwatch.StartNew();

            IEnumerable <ListData> lists = _dataService.listDatas();

            // the code that you want to measure comes here
            watch.Stop();
            var          elapsedMs  = watch.ElapsedMilliseconds;
            ConfigValues configTest = new ConfigValues();
            string       test       = configTest.Get("connectionString");
            BLL          bLL        = new BLL();
            SortedList   sl         = new SortedList();
            DataTable    dt         = bLL.GetDashboardCount(sl);

            return(View());
        }
Exemple #3
0
        public string GetColorCode(MessageType messageType)
        {
            string key = "";

            switch (messageType)
            {
            case MessageType.Error:
                key = "ErrorColorCode";
                break;

            case MessageType.Information:
                key = "InformationColorCode";
                break;

            case MessageType.Success:
                key = "SuccessColorCode";
                break;

            case MessageType.Warning:
                key = "WarningColorCode";
                break;
            }
            return(ConfigValues.Get(key));
        }
Exemple #4
0
 public DAL()
 {
     strCon = configTest.Get("connectionString");
 }
Exemple #5
0
 public Message Get(string key, MessageType messageType)
 {
     return(CreateMessageInstance(ConfigValues.Get(key), messageType));
 }