Example #1
0
        public ActionResult TestUploadFile(HttpPostedFileBase uploadedFile, string TempRelatedID)
        {
            if (uploadedFile != null)
            {
                int fileSize = uploadedFile.ContentLength;

                byte[] data;
                using (BinaryReader reader = new BinaryReader(uploadedFile.InputStream))
                {
                    data = reader.ReadBytes(uploadedFile.ContentLength);
                }
                string fileType = Path.GetExtension(uploadedFile.FileName);

                ICommonHandler        handler = ServiceContainer.GetService <ICommonHandler>() as ICommonHandler;
                List <tbt_AttachFile> attach  = handler.InsertAttachFile(TempRelatedID,
                                                                         uploadedFile.FileName,
                                                                         fileType,
                                                                         fileSize,
                                                                         data,
                                                                         false);

                List <tbt_AttachFile> list = handler.GetAttachFile(TempRelatedID);

                ViewBag.AttachFileList = list;
            }
            return(View("Upload"));
        }
Example #2
0
        public ActionResult Upload()
        {
            ICommonHandler        handler = ServiceContainer.GetService <ICommonHandler>() as ICommonHandler;
            List <tbt_AttachFile> list    = handler.GetAttachFile(Session.SessionID);

            ViewBag.AttachFileList = list;
            return(View());
        }
Example #3
0
        public ActionResult CopyAttachFile(string newId = "TestCopy")
        {
            ICommonHandler handler = ServiceContainer.GetService <ICommonHandler>() as ICommonHandler;

            handler.CopyAttachFile(AttachmentModule.Contract, Session.SessionID, newId);
            List <tbt_AttachFile> list = handler.GetAttachFile(Session.SessionID);

            ViewBag.AttachFileList = list;
            return(View("Upload"));
        }
Example #4
0
        public ActionResult DeleteFile(int id)
        {
            ICommonHandler handler = ServiceContainer.GetService <ICommonHandler>() as ICommonHandler;

            handler.DeleteAttachFileByID(id, Session.SessionID);
            List <tbt_AttachFile> list = handler.GetAttachFile(Session.SessionID);

            ViewBag.AttachFileList = list;
            return(View("Upload"));
        }