public bool SurplusRemoveDocs(string filePath) { try { SitedeclDocuments structDocs = _context.SitedeclDocuments.Where(x => x.Path.Contains(filePath)).FirstOrDefault(); _context.SitedeclDocuments.Remove(structDocs); _context.SaveChanges(); return(true); } catch (Exception ex) { throw ex; } }
public bool SiteDeclDocsUpload(Upload_Docs StrucDocReq, int Id) { try { SitedeclDocuments strDocdb = new SitedeclDocuments(); strDocdb.FileName = StrucDocReq.fileName; strDocdb.FileType = StrucDocReq.fileType; strDocdb.Path = StrucDocReq.filepath; strDocdb.SitedecId = Id; _context.SitedeclDocuments.Add(strDocdb); _context.SaveChanges(); return(true); } catch (Exception ex) { throw ex; } }