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); } } }
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)); } } }
public Docs findSDoc(string uid) { DocsC d = new DocsC(); return(d.findSfdoc(uid)); }
public Docs findDocById(int id) { DocsC d = new DocsC(); return(d.findProofdoc(id)); }
public List <Docs> UploadDocs(string cid) { DocsC d = new DocsC(); return(d.findList(cid)); }
public void DeleteDoc(int id) { DocsC r = new DocsC(); r.deleteDb(id); }
public List <Docs> findList(string cId) { DocsC r = new DocsC(); return(r.findList(cId)); }