Ejemplo n.º 1
0
        /// <summary>
        /// 返回文件列表
        /// </summary>
        /// <param name="applicationid">业务ID(一定是唯一的)</param>
        /// <returns></returns>
        public CallBackResult GetFileListByApplicationIDAndFileName(string applicationid, string FileName)
        {
            CallBackResult result = new CallBackResult();

            result.DownloadUrl = DownloadUrl;
            #region 代码
            try
            {
                var ents = from ent in base.GetObjects <SMT_FILELIST>()
                           where ent.APPLICATIONID == applicationid
                           //&& ent.FILEURL.Contains(FileName)
                           && FileName.Contains(ent.FILEURL)
                           orderby ent.INDEXL
                           select ent;
                if (ents.Count() > 0)
                {
                    result.FileList = ents.ToList();
                }
            }
            catch (Exception ex)
            {
                result.Error = ex.Message;
                throw (ex);
            }
            return(result);

            #endregion
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 返回文件列表
        /// </summary>
        /// <param name="applicationid">业务ID(一定是唯一的)</param>
        /// <returns></returns>
        public CallBackResult GetFileListByOnlyApplicationID(string applicationid)
        {
            CallBackResult result = new CallBackResult();

            result.DownloadUrl = DownloadUrl;
            #region 代码
            try
            {
                var ents = from ent in base.GetObjects <SMT_FILELIST>()
                           where ent.APPLICATIONID == applicationid
                           orderby ent.INDEXL, ent.CREATETIME
                select ent;
                if (ents.Count() > 0)
                {
                    result.FileList = ents.ToList();
                    SMT.Foundation.Log.Tracer.Debug("获取的数量" + result.FileList.ToList().Count());
                }
            }
            catch (Exception ex)
            {
                result.Error = ex.Message;
                throw (ex);
            }

            return(result);

            #endregion
        }
Ejemplo n.º 3
0
        /// <summary>
        /// 返回文件列表
        /// </summary>
        /// <param name="companycode">公司代号</param>
        /// <param name="systemcode">系统代号</param>
        /// <param name="modelcode">模块代号</param>
        /// <returns></returns>
        public CallBackResult GetFileListByModelCode(string companycode, string systemcode, string modelcode)
        {
            CallBackResult result = new CallBackResult();

            result.DownloadUrl = DownloadUrl;
            #region 代码
            try
            {
                var ents = from ent in base.GetObjects <SMT_FILELIST>()
                           where ent.COMPANYCODE == companycode && ent.SYSTEMCODE == systemcode && ent.MODELCODE == modelcode
                           orderby ent.INDEXL
                           select ent;
                if (ents.Count() > 0)
                {
                    //foreach (SMT_FILELIST file in ents)
                    //{
                    //    string path = file.FILEURL;
                    //    string filename = path.Substring(path.LastIndexOf('\\') + 1);
                    //    string filepath = HttpUtility.UrlEncode(file.FILEURL + "\\" + file.FILENAME);
                    //    file.FILEURL = DownloadUrl + "?filename=" + filepath;//文件地址
                    //}
                    result.FileList = ents.ToList();
                }
            }
            catch (Exception ex)
            {
                result.Error = ex.Message;
                throw (ex);
            }
            return(result);

            #endregion
        }
Ejemplo n.º 4
0
        /// <summary>
        /// 返回文件列表
        /// </summary>
        /// <param name="companycode">公司代号</param>
        /// <param name="systemcode">系统代号</param>
        /// <param name="modelcode">模块代号</param>
        /// <param name="applicationid">业务ID</param>
        /// <param name="createname">创建人</param>
        /// <returns></returns>
        public CallBackResult GetFileListByApplicationID(string companycode, string systemcode, string modelcode, string applicationid, string createname)
        {
            CallBackResult result = new CallBackResult();

            result.DownloadUrl = DownloadUrl;
            #region 代码
            try
            {
                var ents = from ent in base.GetObjects <T_SYS_FILELIST>()
                           where ent.MODELCODE == modelcode &&
                           ent.APPLICATIONID == applicationid
                           orderby ent.INDEXL
                           select ent;
                int allcount = ents.Count();
                if (allcount > 0)
                {
                    result.FileList = ents.ToList();
                }
            }
            catch (Exception ex)
            {
                result.Error = ex.Message;
                throw (ex);
            }
            return(result);

            #endregion
        }
Ejemplo n.º 5
0
        /// <summary>
        /// 返回文件列表
        /// </summary>
        /// <param name="companycode">公司代号</param>
        /// <param name="systemcode">系统代号</param>
        /// <param name="modelcode">模块代号</param>
        /// <param name="applicationid">业务ID</param>
        /// <param name="createname">创建人</param>
        /// <returns></returns>
        public CallBackResult GetFileListByApplicationID(string companycode, string systemcode, string modelcode, string applicationid, string createname)
        {
            CallBackResult result = new CallBackResult();

            result.DownloadUrl = DownloadUrl;
            #region 代码
            try
            {
                //var ents = from ent in base.GetObjects<SMT_FILELIST>()
                //           where (string.IsNullOrEmpty(companycode)?true:(ent.COMPANYCODE == companycode))
                //           && (string.IsNullOrEmpty(systemcode)?true:(ent.SYSTEMCODE == systemcode))
                //           && (string.IsNullOrEmpty(modelcode) ? true :(ent.MODELCODE == modelcode))
                //           && (string.IsNullOrEmpty(applicationid) ? true :(ent.APPLICATIONID == applicationid))
                //            && (string.IsNullOrEmpty(createname) ? true : (ent.CREATENAME == createname))
                //           orderby ent.CREATETIME descending
                //           select ent;
                var ents = from ent in base.GetObjects <SMT_FILELIST>()
                           where //(string.IsNullOrEmpty(companycode) ? true : (ent.COMPANYCODE == companycode))
                                 //&& (string.IsNullOrEmpty(systemcode) ? true : (ent.SYSTEMCODE == systemcode))
                           (string.IsNullOrEmpty(modelcode) ? true : (ent.MODELCODE == modelcode)) &&
                           (string.IsNullOrEmpty(applicationid) ? true : (ent.APPLICATIONID == applicationid))
                           //&& (string.IsNullOrEmpty(createname) ? true : (ent.CREATENAME == createname))
                           orderby ent.INDEXL
                           select ent;
                if (ents.Count() > 0)
                {
                    //foreach (SMT_FILELIST entity in ents)
                    //{
                    //    string path = entity.FILEURL;
                    //    string filename = path.Substring(path.LastIndexOf('\\') + 1);
                    //    string filepath = HttpUtility.UrlEncode(entity.FILEURL + "\\" + entity.FILENAME);
                    //    entity.FILEURL = DownloadUrl + "?filename=" + filepath;//文件地址
                    //}
                    result.FileList = ents.ToList();
                }
            }
            catch (Exception ex)
            {
                result.Error = ex.Message;
                throw (ex);
            }
            return(result);

            #endregion
        }