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); }
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()); }
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)); }
public DAL() { strCon = configTest.Get("connectionString"); }
public Message Get(string key, MessageType messageType) { return(CreateMessageInstance(ConfigValues.Get(key), messageType)); }