Exemplo n.º 1
0
        public void createDoc(string cid, string filename, string contentType, string kind, FileUpload FileUpload1)
        {
            if (filename == "")
            {
                throw new Exception("The File Name Is Empty ");
            }
            if (contentType == "")
            {
                throw new Exception("The Content Type Name Is Empty ");
            }
            if (kind == "")
            {
                throw new Exception("The Kind Name Is Empty ");
            }

            DocsC d = new DocsC();

            using (Stream fs = FileUpload1.PostedFile.InputStream)
            {
                using (BinaryReader br = new BinaryReader(fs))
                {
                    byte[] bytes = br.ReadBytes((Int32)fs.Length);
                    d.insertDb(new Docs(cid, filename, contentType, bytes, kind));
                    deleteReqDoc(cid, kind);
                }
            }
        }
Exemplo n.º 2
0
 public void SaveUploadFile(string filename, string contentType, string uid, FileUpload FileUpload1, string kind)
 {
     using (Stream fs = FileUpload1.PostedFile.InputStream)
     {
         using (BinaryReader br = new BinaryReader(fs))
         {
             byte[]   bytes = br.ReadBytes((Int32)fs.Length);
             DocsC    p     = new DocsC();
             ReqDocsC rd    = new ReqDocsC();
             p.insertDb(new Docs(uid, filename, contentType, bytes, kind));
             rd.deleteDB(rd.findByUserAndKind(uid, kind));
         }
     }
 }
Exemplo n.º 3
0
        public Docs findSDoc(string uid)
        {
            DocsC d = new DocsC();

            return(d.findSfdoc(uid));
        }
Exemplo n.º 4
0
        public Docs findDocById(int id)
        {
            DocsC d = new DocsC();

            return(d.findProofdoc(id));
        }
Exemplo n.º 5
0
        public List <Docs> UploadDocs(string cid)
        {
            DocsC d = new DocsC();

            return(d.findList(cid));
        }
Exemplo n.º 6
0
        public void DeleteDoc(int id)
        {
            DocsC r = new DocsC();

            r.deleteDb(id);
        }
Exemplo n.º 7
0
        public List <Docs> findList(string cId)
        {
            DocsC r = new DocsC();

            return(r.findList(cId));
        }