Esempio n. 1
0
 internal void AddCaregory()
 {
     try
     {
         _categoryService.AddANewCategory(new Category
         {
             Name = this.Name
         });
         Notification = new NotificationModel("Success!",
                                              "Category added successfully.",
                                              Notificationtype.Success);
     }
     catch (InvalidOperationException iex)
     {
         Notification = new NotificationModel("Failed!",
                                              "Failed to add category, please provide valid name.",
                                              Notificationtype.Fail);
     }
     catch (Exception ex)
     {
         Notification = new NotificationModel("Failed!",
                                              "Failed to add category, please try again.",
                                              Notificationtype.Fail);
     }
 }