/// <summary>
        /// Populate all dropdown value on VID page and render view
        /// </summary>
        /// <returns>Vid View</returns>
        public ActionResult Vid()
        {
            var vid             = new VIDMgt();
            var vidModel        = _service.GetDropDownValue();
            var vidSearchValues = _service.GetSearchValue();

            vid.VID       = vidModel;
            vid.VIDSearch = vidSearchValues;
            return(View(vid));
        }
        /// <summary>
        /// Export VID to .xlsx file
        /// </summary>
        /// <param name="vidSearch">VidSearch contains the filter value to export VID. If vidSearch is null then all VID data get exported</param>
        /// <returns>FileResult which help to download file in browser</returns>
        public ActionResult Export(VIDSearch vidSearch)
        {
            var vid             = new VIDMgt();
            var vidSearchValues = _service.GetSearchValue();

            vid.VIDSearch = vidSearchValues;
            DownLoadFile downloadFile = _export.ExportVidReport(vidSearch);
            var          vidModel     = _service.GetDropDownValue();

            vid.VID       = vidModel;
            vid.VIDSearch = vidSearch;
            //return View("Vid", vid);
            string path = App.Config.ReportDirectoryPath;

            return(File(downloadFile.bufferByte, "application/vnd.ms-excel", downloadFile.FileName));
        }
        /// <summary>
        /// Add Title in VID through the UI
        /// </summary>
        /// <param name="vid">This consists of all the required information need to form VID object which is further inserted into the database</param>
        /// <returns>Error or Success results to the UI</returns>
        public ActionResult Add(VIDModel vid)
        {
            var vids = new VIDMgt();

            vid.UserName = CurrentUser.FullName;
            SaveResult result   = _service.AddVid(vid);
            var        vidModel = _service.GetDropDownValue();

            vids.VID = vidModel;
            if (!result.Success)
            {
                ModelState.AddModelError("", result.Message);
                return(View("Vid", vids));
            }
            else
            {
                TempData["VidAddSuccess"] = "VID is added successfully";
            }
            return(RedirectToAction("Vid"));
        }