Beispiel #1
0
 //获取资料
 public void File_Search(HttpContext context)
 {
     string Searchkey = context.Request.Params["Searchkey"];
     int OCID = Convert.ToInt32(context.Request.Params["OCID"]);
     int CourseID = Convert.ToInt32(context.Request.Params["CourseID"]);
     int FolderID = Convert.ToInt32(context.Request.Params["FolderID"]);
     int FileType = Convert.ToInt32(context.Request.Params["FileType"]);
     int ShareRange=-1;
     int UserID = UserService.CurrentUser.UserID;
     int OwnerUserID = 1;
     int PageSize = 999999;
     int PageIndex = 1;
     File file = new File();
     file.Keys = Searchkey;
     file.OCID = OCID;
     file.CourseID = CourseID;
     file.FolderID = FolderID;
     file.FileType = FileType;
     file.ShareRange = -1;
     file.CreateUserID = UserID;
     file.UploadTime = DateTime.Now.AddMonths(-1000);
     IES.G2S.Resource.BLL.FileBLL filebll = new IES.G2S.Resource.BLL.FileBLL();
     //List<File> filelist = filebll.File_Search(file, PageSize, PageIndex);
     DataTable dt = IES.Common.ListToDateUtil.ListToDataTable<File>(filebll.File_Search(file, PageSize, PageIndex));
     if (dt != null && dt.Rows.Count > 0)
     {
         context.Response.Write(Tools.JsonConvert.GetJSON(dt));
     }
     else
     {
         context.Response.Write("False");
     }
 }
Beispiel #2
0
        //获取资料
        public void File_Search(HttpContext context)
        {
            string Searchkey   = context.Request.Params["Searchkey"];
            int    OCID        = Convert.ToInt32(context.Request.Params["OCID"]);
            int    CourseID    = Convert.ToInt32(context.Request.Params["CourseID"]);
            int    FolderID    = Convert.ToInt32(context.Request.Params["FolderID"]);
            int    FileType    = Convert.ToInt32(context.Request.Params["FileType"]);
            int    ShareRange  = -1;
            int    UserID      = UserService.CurrentUser.UserID;
            int    OwnerUserID = 1;
            int    PageSize    = 999999;
            int    PageIndex   = 1;
            File   file        = new File();

            file.Keys         = Searchkey;
            file.OCID         = OCID;
            file.CourseID     = CourseID;
            file.FolderID     = FolderID;
            file.FileType     = FileType;
            file.ShareRange   = -1;
            file.CreateUserID = UserID;
            file.UploadTime   = DateTime.Now.AddMonths(-1000);
            IES.G2S.Resource.BLL.FileBLL filebll = new IES.G2S.Resource.BLL.FileBLL();
            //List<File> filelist = filebll.File_Search(file, PageSize, PageIndex);
            DataTable dt = IES.Common.ListToDateUtil.ListToDataTable <File>(filebll.File_Search(file, PageSize, PageIndex));

            if (dt != null && dt.Rows.Count > 0)
            {
                context.Response.Write(Tools.JsonConvert.GetJSON(dt));
            }
            else
            {
                context.Response.Write("False");
            }
        }
Beispiel #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string fid = Request.QueryString["fid"];

            if (!string.IsNullOrEmpty(fid))
            {
                IES.G2S.Resource.BLL.FileBLL filebll = new IES.G2S.Resource.BLL.FileBLL();
                IES.Resource.Model.IFile     file    = filebll.File_Simple_Get(fid);
                Response.Redirect(IES.Service.FileService.FileViewURL(file));
            }

            string aid = Request.QueryString["aid"];

            if (!string.IsNullOrEmpty(aid))
            {
                IES.G2S.Resource.BLL.AttachmentBLL abll = new IES.G2S.Resource.BLL.AttachmentBLL();
                IES.Resource.Model.IFile           file = abll.Attachment_Get(aid);
                Response.Redirect(IES.Service.FileService.FileViewURL(file));
            }
        }