Beispiel #1
0
        public ActionResult NotificationSummary(Nullable <Int64> MomId, string CallFor, Nullable <Int64> R, string D, Nullable <Int64> Total)
        {
            NotificationBusinessService obj            = new NotificationBusinessService();
            ViewNotification            objViewDetails = new ViewNotification();

            objViewDetails = obj.NotificationSummary(MomId, CallFor, R, D);
            if (objViewDetails != null)
            {
                return(RedirectToAction("NotificationView", new { Id = objViewDetails.NotificationId, MomId = objViewDetails.MomId, CallFor = objViewDetails.CallFor, R = objViewDetails.RowNum, D = D, Total = Total }));
            }
            else
            {
                return(View());
            }
        }
Beispiel #2
0
        public async Task <IActionResult> Index()
        {
            // With local context
            await unitOfWork.Run(async (r, context) =>
            {
                r.ConvertContextOfRepository(categoryRepository).ToUse(context);
                var categoriesWithLocalContext = await categoryRepository.GetCategories();
            });

            // Without local context
            var categories    = (await categoryRepository.GetCategories()).ToList();
            var subcategories = categories[0].Subcategories.Value;

            AddNotification(ViewNotification.Make("Alert sukses terbentuk", ViewNotification.SUCCESS));
            AddNotification(ViewNotification.Make("Alert Error terbentuk", ViewNotification.ERROR));
            return(View());
        }
Beispiel #3
0
        public async Task <IActionResult> Login(IndexViewModel viewModels)
        {
            if (!ModelState.IsValid)
            {
                return(View("Index", viewModels));
            }

            User user = await userService.Login(new User
            {
                UserEmail    = viewModels.UserEmail,
                UserPassword = viewModels.UserPassword
            });

            if (user == null)
            {
                AddNotification(ViewNotification.Make("User Tidak Ditemukan", ViewNotification.ERROR));
                return(View("Index", viewModels));
            }

            return(RedirectToAction("Index", "Home"));
        }
        public IActionResult Save(IndexViewModel indexViewModel)
        {
            if (!ModelState.IsValid)
            {
                return(View("Index", indexViewModel));
            }

            try
            {
                if (indexViewModel.SubCategoryId == 0)
                {
                    // Insert
                    ExecuteResult insertResult = subCategoryService.InsertSubCategory(new InsertSubCategory
                    {
                        CategoryId      = indexViewModel.CategoryId,
                        SubCategoryName = indexViewModel.SubCategoryName
                    });
                    AddNotification(ViewNotification.Make("Insert Success", "Success"));
                }
                else
                {
                    // Update
                    ExecuteResult updateResult = subCategoryService.UpdateSubCategory(new UpdateSubCategory
                    {
                        SubCategoryId   = indexViewModel.SubCategoryId,
                        CategoryId      = indexViewModel.CategoryId,
                        SubCategoryName = indexViewModel.SubCategoryName
                    });
                    AddNotification(ViewNotification.Make("Update Success", ViewNotification.SUCCESS));
                }
            }
            catch (Exception e)
            {
                AddNotification(ViewNotification.Make("Error", ViewNotification.ERROR));
                return(View("Index", indexViewModel));
            }

            return(RedirectToAction("Index", "SubCategory"));
        }
Beispiel #5
0
 private void RefreshNavigationBar(ViewNotification obj)
 {
     PNB.Refresh();
 }
 public NotificationCell1()
 {
     InitializeComponent();
     VN = BindingContext as ViewNotification;
 }
 public IActionResult SubCategoryTableViewComponentOnSearch(SubCategoriesTableViewModel subCategoriesTableViewModel)
 {
     AddNotification(ViewNotification.Make("Success Search", ViewNotification.SUCCESS));
     return(ViewComponent("SubCategoryTable", subCategoriesTableViewModel.CategoryId));
 }
 private void Remove_ntf(ViewNotification VN)
 {
     ViewNotifications.Remove(VN);
     CheckLabel();
 }
 void ViewTeam(ViewNotification obj)
 {
     Navigation.PushAsync(new TeamPage(obj.Team));
 }
 private void ViewProfile(ViewNotification obj)
 {
     Navigation.PushAsync(new ProfileTabbedPage(obj.Sender));
 }
Beispiel #11
0
 public void AddNotification(ViewNotification viewNotification)
 {
     viewNotifications.Add(viewNotification);
     TempData["viewNotifications"] = viewNotifications;
 }
Beispiel #12
0
 public void AddNotification(ViewNotification viewNotification)
 {
     viewNotifications.Add(viewNotification);
     TempData["viewNotifications"] = JsonConvert.SerializeObject(viewNotifications);
 }