Пример #1
0
        public void AddNewDataFile(string filename)
        {
            try
            {
                _dataDetailsService.AddDataDetails(new DataDetails
                {
                    FileName = filename
                });

                Notification = new NotificationModels("Success!", "File Uploaded", NotificationType.Success);
            }
            catch (InvalidOperationException iex)
            {
                Notification = new NotificationModels(
                    "Failed!",
                    "Failed to Upload File",
                    NotificationType.Fail);
            }
            catch (Exception ex)
            {
                Notification = new NotificationModels(
                    "Failed!",
                    "Failed to Upload File, please try again",
                    NotificationType.Fail);
            }
        }
Пример #2
0
        internal async Task AddNewRole()
        {
            await _roleManager.CreateAsync(new IdentityRole()
            {
                Name = RoleName
            });

            Notification = new NotificationModels("Success", "Role Added", NotificationType.Success);
        }