// GET: Dashboard
        /// <summary>
        /// Provides action method for /Application/Dashboard request.
        /// </summary>
        /// <returns>Return action result for /Application/Dashboard request.</returns>
        public ActionResult Dashboard()
        {
            // Set the view captions for this action method...
            ViewBag.Title        = "Dashboard Page";
            ViewBag.PageTitle    = "Dashboard";
            ViewBag.PageSubTitle = "Provide at-a-glance views of KPIs (key performance indicators) relevant to online drive system of arcanys.";

            // Set the menus for the navigation side panel...
            using (MenuProcess menuProcess = new MenuProcess())
            {
                ViewBag.NavigationLink = menuProcess.Get().Where(m => m.isEnabled == true);
            }

            // Set the total of files stored on the online drive...
            int totalFiles = GetOnlineDrive().Count();

            if (totalFiles <= 1)
            {
                ViewBag.TotalUploadedFile = String.Format("{0} {1}", totalFiles, "Total File on the Drive!");
            }
            else
            {
                ViewBag.TotalUploadedFile = String.Format("{0} {1}", totalFiles, "Total Files on the Drive!");
            }

            // Render the view as response to the request...
            return(View());
        }
        // GET: OnlineDriveUploadedDocumentSave
        /// <summary>
        /// Provides action method for /Home/OnlineDriveUploadedDocumentSave request.
        /// </summary>
        /// <param name="model">The ArcanysSystem.Models.OnlineDriveViewModel model</param>
        /// <param name="page">The index page to display with.</param>
        /// <returns>Return action result for /Home/OnlineDriveUploadedDocumentSave request.</returns>
        public ActionResult OnlineDriveUploadedDocumentSave(OnlineDriveViewModel model, int?page)
        {
            // Set the view captions for this action method...
            ViewBag.Title        = "Online Drive Upload Page";
            ViewBag.PageTitle    = "Upload Your Files Here...";
            ViewBag.PageSubTitle = "Simply drag en drop the file you'd like to upload on the drop box below.";
            ViewBag.TableTitle   = "Uploaded File List";
            ViewBag.ButtonAction = model.ButtonAction;

            // Set the menus for the navigation side panel...
            using (MenuProcess menuProcess = new MenuProcess())
            {
                ViewBag.NavigationLink = menuProcess.Get().Where(m => m.isEnabled == true);
            }

            // Gets the uploaded filename...
            this.OnlineDriveList = ApplicationSession.GlobalParameters.UploadedFileList;

            // Validate id there was a file uploaded...
            if (this.OnlineDriveList == null)
            {
                return(RedirectToAction("OnlineDriveUpload"));
            }
            if (this.OnlineDriveList.Count() > 0)
            {
                try
                {
                    // Save all the uploaded files...
                    if (model.ButtonAction == "Upload")
                    {
                        foreach (var item in this.OnlineDriveList)
                        {
                            model.Id            = item.Id;
                            model.FileNameGUID  = item.FileNameGUID;
                            model.FileName      = item.FileName;
                            model.FilePath      = item.FilePath;
                            model.UploadedOn    = DateTime.Now;
                            model.UploadedBy    = 1;
                            model.LastUpdatedOn = DateTime.Now;
                            model.LastUpdatedBy = 1;
                            model.DeletedOn     = DateTime.Now;
                            model.DeletedBy     = 1;

                            if (this.ModelState.IsValid)
                            {
                                this.PostOnlineDrive(model);
                            }
                        }
                    }
                    ApplicationSession.GlobalParameters.UploadedFileList = null;
                    this.OnlineDriveList.Clear();
                }
                catch (Exception) { }
            }

            // Redirect action to OnlineDriveUpload...
            return(RedirectToAction("OnlineDriveUpload"));
        }
Ejemplo n.º 3
0
        public ActionResult Index()
        {
            using (MenuProcess menuProcess = new MenuProcess())
            {
                ViewBag.NavigationLink = menuProcess.Get().Where(m => m.isEnabled == true);
            }

            ViewBag.DocumentationProvider = Configuration.Services.GetDocumentationProvider();
            return(View(Configuration.Services.GetApiExplorer().ApiDescriptions));
        }
        // GET: Dashboard
        /// <summary>
        /// Provides action method for /Home/Index request.
        /// </summary>
        /// <returns>Return action result for /Home/Index request.</returns>
        public ActionResult Index()
        {
            // Set the view captions for this action method...
            ViewBag.Title        = "Home Page";
            ViewBag.PageTitle    = string.Empty;
            ViewBag.PageSubTitle = string.Empty;

            // Set the menus for the navigation side panel...
            using (MenuProcess menuProcess = new MenuProcess())
            {
                ViewBag.NavigationLink = menuProcess.Get().Where(m => m.isEnabled == true);
            }

            // Render the view as response to the request...
            return(View());
        }
Ejemplo n.º 5
0
        public ActionResult Api(string apiId)
        {
            using (MenuProcess menuProcess = new MenuProcess())
            {
                ViewBag.NavigationLink = menuProcess.Get().Where(m => m.isEnabled == true);
            }

            if (!String.IsNullOrEmpty(apiId))
            {
                HelpPageApiModel apiModel = Configuration.GetHelpPageApiModel(apiId);
                if (apiModel != null)
                {
                    return(View(apiModel));
                }
            }

            return(View(ErrorViewName));
        }
Ejemplo n.º 6
0
        public ActionResult ResourceModel(string modelName)
        {
            using (MenuProcess menuProcess = new MenuProcess())
            {
                ViewBag.NavigationLink = menuProcess.Get().Where(m => m.isEnabled == true);
            }

            if (!String.IsNullOrEmpty(modelName))
            {
                ModelDescriptionGenerator modelDescriptionGenerator = Configuration.GetModelDescriptionGenerator();
                ModelDescription          modelDescription;
                if (modelDescriptionGenerator.GeneratedModels.TryGetValue(modelName, out modelDescription))
                {
                    return(View(modelDescription));
                }
            }

            return(View(ErrorViewName));
        }
        // GET: OnlineDriveUpload
        /// <summary>
        /// Provides action method for /Home/OnlineDriveUpload request.
        /// </summary>
        /// <returns>Return action result for /Home/OnlineDriveUpload request.</returns>
        public ActionResult OnlineDriveUpload(int?page)
        {
            // Set the view captions for this action method...
            ViewBag.Title        = "Online Drive File Uploading Page";
            ViewBag.PageTitle    = "Upload Your Files Here...";
            ViewBag.PageSubTitle = "Simply drag en drop any files that you'd like to upload.";
            ViewBag.TableTitle   = "Uploaded File List";

            // Reset all the uploaded file list first...
            ApplicationSession.GlobalParameters.UploadedFileList = new List <OnlineDriveViewModel>();
            ApplicationSession.GlobalParameters.UploadedFileList.Clear();
            this.OnlineDriveList = new List <OnlineDriveViewModel>();
            this.OnlineDriveList.Clear();

            // Set action button to default value is action is null...
            if (string.IsNullOrEmpty(ViewBag.ButtonAction))
            {
                ViewBag.ButtonAction = String.Empty;
            }

            // Set the menus for the navigation side panel...
            using (MenuProcess menuProcess = new MenuProcess())
            {
                ViewBag.NavigationLink = menuProcess.Get().Where(m => m.isEnabled == true);
            }

            // Populate the list of uploaded files...
            if (this.ModelState.IsValid)
            {
                try
                {
                    return(this.View(this.GetOnlineDrive().ToList().ToPagedList(page ?? 1, 10)));
                }
                catch (Exception ex) { throw ex; }
            }

            // Render the view as response to the request...
            return(View());
        }