public ActionResult Delete(string wikiname, int fid)
        {
            try
            {
                if (fid<=0)
                {
                    return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
                }
                WikiFile file = this.filemngr.GetFileById(wikiname, fid);
                if (file == null)
                {
                    return HttpNotFound();
                }

                ViewWikiFile vfile = new ViewWikiFile();
                vfile.ImportFromModel(file);

                return View(vfile);
            }
            catch (Exception ex)
            {

                CommonTools.ErrorReporting(ex);
                return null;
            }
        }
        public ActionResult GetTitleFiles(string wikiname,int tid)
        {
            try
            {
                if (CommonTools.isEmpty(wikiname) && tid <= 0)
                {
                    return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
                }

                List<WikiFile> lst = this.filemngr.GetFilesByTitle(wikiname, tid);
                 if ( lst== null && CommonTools.wkmngr.GetWiki(wikiname)==null)
                {
                    return new HttpStatusCodeResult(HttpStatusCode.NotFound);
                }

                List<ViewWikiFile> vlist = new List<ViewWikiFile>();
                foreach (var v in lst)
                {
                    ViewWikiFile vf = new ViewWikiFile();
                    vf.ImportFromModel(v);
                    vlist.Add(vf);

                }

                return View(vlist);

            }
            catch (Exception ex)
            {

                CommonTools.ErrorReporting(ex);
                return new HttpStatusCodeResult(System.Net.HttpStatusCode.InternalServerError);
            }
        }
        public ActionResult Index()
        {
            try {

                List<WikiFile> lst = this.filemngr.GetFiles();
                List<ViewWikiFile> vlist = new List<ViewWikiFile>();
                foreach ( var v in lst)
                {
                    ViewWikiFile vf = new ViewWikiFile();
                    vf.ImportFromModel(v);
                    vlist.Add(vf);

                }
                return View(vlist);
            }
            catch (Exception ex)
            {

                CommonTools.ErrorReporting(ex);
                return new HttpStatusCodeResult(System.Net.HttpStatusCode.InternalServerError);
            }
        }
        public ActionResult Details(string wikiname, int fid)
        {
            try
            {
                if (CommonTools.isEmpty(wikiname) && fid <= 0)
                {
                    return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
                }

                WikiFile lst = this.filemngr.GetFileById(wikiname, fid);
                if (lst == null && CommonTools.wkmngr.GetWiki(wikiname) == null)
                {
                    return new HttpStatusCodeResult(HttpStatusCode.NotFound);
                }

                ViewWikiFile vlst = new ViewWikiFile();
                vlst.ImportFromModel(lst);
                return View(vlst);

            }
            catch (Exception ex)
            {

                CommonTools.ErrorReporting(ex);
                return new HttpStatusCodeResult(System.Net.HttpStatusCode.InternalServerError);
            }
        }