Esempio n. 1
0
        private int DeleteTblStyleAttachment(TblStyleAttachment row)
        {
            using (var context = new WorkFlowManagerDBEntities())
            {
                var oldRow = (from e in context.TblStyleAttachments
                              where e.Iserial == row.Iserial
                              select e).SingleOrDefault();
                if (oldRow != null)
                {
                    context.DeleteObject(oldRow);
                }

                context.SaveChanges();
            }
            return(row.Iserial);
        }
Esempio n. 2
0
        public List <TblStyleAttachment> GetDocumentationFiles()
        {
            //   var uri =MapPath("~");
            var uri  = HttpContext.Current.Server.MapPath("~/");
            var temp = Path.Combine(uri, SharedOperation.GetChainSetup("DocumentationFolder"));


            var dInfo = new DirectoryInfo(@temp);    //your path

            FileInfo[] FilesList = dInfo.GetFiles(); //can filter here with appropriate extentions
            var        list      = new List <TblStyleAttachment>();

            foreach (var fileInfo in FilesList)
            {
                var newFile = new TblStyleAttachment();
                newFile.AttachmentPath        = SharedOperation.GetChainSetup("DocumentationFolder") + "/" + fileInfo.Name;
                newFile.AttachmentDescription = fileInfo.Name;
                newFile.OrginalFileName       = fileInfo.Name;
                list.Add(newFile);
            }
            return(list);//you can also return more generic xml
        }