Example #1
0
        public List<T_SYS_FILEUPLOAD> Get_ParentID(string parentID)
        {
            //using (fileUploadBll = new FileUploadManagementBll())
            //{
            //    if (fileUploadBll.Get_ParentID(parentID) != null)
            //        return fileUploadBll.Get_ParentID(parentID).ToList();
            //    else
            //        return null;
            //}
            fileUploadBll = new FileUploadManagementBll();

            if (fileUploadBll.Get_ParentID(parentID) != null)
            {
                List<T_SYS_FILEUPLOAD> fs=new List<T_SYS_FILEUPLOAD>();
                foreach (var q in fileUploadBll.Get_ParentID(parentID).ToList())
                {
                    string uploadFolder = GetUploadFolder();
                    string fileName= uploadFolder+"\\"+q.FILENAME;
                    string filePath = "http://" + System.Web.HttpContext.Current.Request.Url.Host + System.Web.HttpContext.Current.Request.ApplicationPath +"\\"+ fileName;
                    q.FILENAME = filePath;
                    fs.Add(q);
                }
                return fs;
            }

            else
                return null;
            
        }
Example #2
0
        public List <T_SYS_FILEUPLOAD> Get_ParentID(string parentID)
        {
            //using (fileUploadBll = new FileUploadManagementBll())
            //{
            //    if (fileUploadBll.Get_ParentID(parentID) != null)
            //        return fileUploadBll.Get_ParentID(parentID).ToList();
            //    else
            //        return null;
            //}
            fileUploadBll = new FileUploadManagementBll();

            if (fileUploadBll.Get_ParentID(parentID) != null)
            {
                List <T_SYS_FILEUPLOAD> fs = new List <T_SYS_FILEUPLOAD>();
                foreach (var q in fileUploadBll.Get_ParentID(parentID).ToList())
                {
                    string uploadFolder = GetUploadFolder();
                    string fileName     = uploadFolder + "\\" + q.FILENAME;
                    string filePath     = "http://" + System.Web.HttpContext.Current.Request.Url.Host + System.Web.HttpContext.Current.Request.ApplicationPath + "\\" + fileName;
                    q.FILENAME = filePath;
                    fs.Add(q);
                }
                return(fs);
            }

            else
            {
                return(null);
            }
        }
Example #3
0
        public int Delete(T_SYS_FILEUPLOAD obj)
        {
            //using (fileUploadBll = new FileUploadManagementBll())
            //{
            //    return fileUploadBll.Del(obj.FILEUPLOADID);
            //}
            fileUploadBll = new FileUploadManagementBll();

            return(fileUploadBll.Del(obj.FILEUPLOADID));
        }
Example #4
0
        public void Upd(T_SYS_FILEUPLOAD obj)
        {
            //using (fileUploadBll = new FileUploadManagementBll())
            //{
            //    fileUploadBll.Update(obj);
            //}
            fileUploadBll = new FileUploadManagementBll();

            fileUploadBll.Update(obj);
        }
Example #5
0
        public int DelTB_ParentID(string[] parentIDs)
        {
            //using (fileUploadBll = new FileUploadManagementBll())
            //{
            //    return fileUploadBll.DelTB_ParentID(parentIDs);
            //}
            fileUploadBll = new FileUploadManagementBll();

            return(fileUploadBll.DelTB_ParentID(parentIDs));
        }
Example #6
0
        public int DelTB(string[] ids)
        {
            //using (fileUploadBll = new FileUploadManagementBll())
            //{
            //    return fileUploadBll.DelTB(ids);
            //}
            fileUploadBll = new FileUploadManagementBll();

            return(fileUploadBll.DelTB(ids));
        }
Example #7
0
        public int Del(string id)
        {
            //using (fileUploadBll = new FileUploadManagementBll())
            //{
            //    return fileUploadBll.Del(id);
            //}
            fileUploadBll = new FileUploadManagementBll();

            return(fileUploadBll.Del(id));
        }
Example #8
0
 public void Del_FileAndID(string fileName, string ID)
 {
     using (fileUploadBll = new FileUploadManagementBll())
     {
         string uploadFolder = GetUploadFolder();
         if (File.Exists(@HostingEnvironment.ApplicationPhysicalPath + "\\" + uploadFolder + "\\" + fileName))
         {
             File.Delete(@HostingEnvironment.ApplicationPhysicalPath + "\\" + uploadFolder + "\\" + fileName);
         }
         fileUploadBll.Del(ID);
     }
 }
Example #9
0
 public void Add(T_SYS_FILEUPLOAD obj)
 {
     //using (fileUploadBll = new FileUploadManagementBll())
     //{
     //    bool sucess = fileUploadBll.Add(obj);
     //    if (sucess == false)
     //        throw new Exception("添加数据失败");
     //}
     fileUploadBll = new FileUploadManagementBll();
     
         bool sucess = fileUploadBll.Add(obj);
         if (sucess == false)
             throw new Exception("添加数据失败");
     
 }
Example #10
0
        public void Add(T_SYS_FILEUPLOAD obj)
        {
            //using (fileUploadBll = new FileUploadManagementBll())
            //{
            //    bool sucess = fileUploadBll.Add(obj);
            //    if (sucess == false)
            //        throw new Exception("添加数据失败");
            //}
            fileUploadBll = new FileUploadManagementBll();

            bool sucess = fileUploadBll.Add(obj);

            if (sucess == false)
            {
                throw new Exception("添加数据失败");
            }
        }
Example #11
0
 public int Delete(T_SYS_FILEUPLOAD obj)
 {
     //using (fileUploadBll = new FileUploadManagementBll())
     //{
     //    return fileUploadBll.Del(obj.FILEUPLOADID);
     //}
     fileUploadBll = new FileUploadManagementBll();
     
         return fileUploadBll.Del(obj.FILEUPLOADID);
     
 }
Example #12
0
 public void Del_FileAndID(string fileName, string ID)
 {
     using (fileUploadBll = new FileUploadManagementBll())
     {
         string uploadFolder = GetUploadFolder();
         if (File.Exists(@HostingEnvironment.ApplicationPhysicalPath + "\\" + uploadFolder + "\\" + fileName))
             File.Delete(@HostingEnvironment.ApplicationPhysicalPath + "\\" + uploadFolder + "\\" + fileName);
         fileUploadBll.Del(ID);
     }
 }
Example #13
0
 public void Upd(T_SYS_FILEUPLOAD obj)
 {
     //using (fileUploadBll = new FileUploadManagementBll())
     //{
     //    fileUploadBll.Update(obj);
     //}
     fileUploadBll = new FileUploadManagementBll();
     
         fileUploadBll.Update(obj);
     
 }
Example #14
0
 public int DelTB_ParentID(string[] parentIDs)
 {
     //using (fileUploadBll = new FileUploadManagementBll())
     //{
     //    return fileUploadBll.DelTB_ParentID(parentIDs);
     //}
     fileUploadBll = new FileUploadManagementBll();
     
         return fileUploadBll.DelTB_ParentID(parentIDs);
     
 }
Example #15
0
 public int DelTB(string[] ids)
 {
     //using (fileUploadBll = new FileUploadManagementBll())
     //{
     //    return fileUploadBll.DelTB(ids);
     //}
     fileUploadBll = new FileUploadManagementBll();
     
         return fileUploadBll.DelTB(ids);
     
 }
Example #16
0
 public int Del(string id)
 {
     //using (fileUploadBll = new FileUploadManagementBll())
     //{
     //    return fileUploadBll.Del(id);
     //}
     fileUploadBll = new FileUploadManagementBll();
     
         return fileUploadBll.Del(id);
     
 }