コード例 #1
0
        public async Task <ActionResult> Add(int credId, string dataSetIndexId, string dataSetId)
        {
            ExcludeDirectoryViewModel viewModel = new ExcludeDirectoryViewModel();

            ViewBag.dataSetId      = dataSetId;
            ViewBag.credId         = credId;
            ViewBag.dataSetIndexId = dataSetIndexId;

            await viewModel.dataSetName(Session, dataSetId);

            viewModel.objDataSetIndexCredExcludeDirPost = new DataSetIndexCredExcludeDirPost();

            return(View(viewModel));
        }
コード例 #2
0
        public async Task <ActionResult> Delete(string id, string dataSetIndexId, string dataSetId, int credId)
        {
            ExcludeDirectoryViewModel vmview = new ExcludeDirectoryViewModel();

            await vmview.DeleteExcludeDirectory(Session, id);

            if (vmview.errorOccurred == true)
            {
                vmview.ErrorMessage = "Something wrong please try again.";
                return(View(vmview));
            }
            vmview.ErrorMessage = "Record deleted successfully.";
            return(Redirect("/ExcludeDirectory/Index?credId=" + credId + "&dataSetIndexId=" + dataSetIndexId + "&dataSetId=" + dataSetId));
        }
コード例 #3
0
        public async Task <ActionResult> Edit(string id, int credId, string dataSetIndexId, string dataSetId)
        {
            ExcludeDirectoryViewModel viewModel = new ExcludeDirectoryViewModel();

            ViewBag.dataSetId      = dataSetId;
            ViewBag.credId         = credId;
            ViewBag.dataSetIndexId = dataSetIndexId;
            ViewBag.id             = id;

            await viewModel.dataSetName(Session, dataSetId);

            await viewModel.GetExcludeDirectory(Session, id, credId);

            if (viewModel.errorOccurred == true)
            {
                return(Redirect("/ExcludeDirectory/Index?credId=" + credId + "&dataSetIndexId=" + dataSetIndexId + "&dataSetId=" + dataSetId));
            }
            return(View(viewModel));
        }
コード例 #4
0
        public async Task <ActionResult> Index(string credId, string dataSetIndexId, string dataSetId)
        {
            ExcludeDirectoryViewModel viewModel = new ExcludeDirectoryViewModel();

            ViewBag.dataSetId      = dataSetId;
            ViewBag.dataSetIndexId = dataSetIndexId;
            await viewModel.dataSetName(Session, dataSetId);

            await viewModel.GetAllExcludeDirectory(Session, credId);

            if (viewModel.errorOccurred)
            {
                return(RedirectToAction("Index", "Authenticate"));
            }
            else
            {
                return(View(viewModel));
            }
        }
コード例 #5
0
        public async Task <ActionResult> Patch(DataSetIndexCredExcludeDirPatch obj, string id, string dataSetIndexId, string dataSetId, int credId)
        {
            ExcludeDirectoryViewModel viewmodel = new ExcludeDirectoryViewModel();

            viewmodel.objDataSetIndexCredExcludeDirPatch = new DataSetIndexCredExcludeDirPatch();
            viewmodel.objDataSetIndexCredExcludeDirPatch.directoryExclude = obj.directoryExclude;

            if (!ModelState.IsValid)
            {
                return(View(viewmodel));
            }

            await viewmodel.EditExcludeDirectory(Session, id);

            if (viewmodel.errorOccurred == true)
            {
                viewmodel.ErrorMessage = "Something wrong please try again.";
                return(View(viewmodel));
            }
            viewmodel.ErrorMessage = "Data save successfully.";
            return(Redirect("/ExcludeDirectory/Index?credId=" + credId + "&dataSetIndexId=" + dataSetIndexId + "&dataSetId=" + dataSetId));
        }