public void UpdateFile(filemanager record) { frssdbEntities entities = new frssdbEntities(); var data = entities.Entry(record).State = System.Data.Entity.EntityState.Modified; entities.SaveChanges(); }
public void AddFile(filemanager record) { frssdbEntities entities = new frssdbEntities(); var data = entities.filemanagers.Add(record); entities.SaveChanges(); }
public filemanager GetFileManagerById(string fileid, string custid) { frssdbEntities entities = new frssdbEntities(); filemanager filemgr = entities.filemanagers.FirstOrDefault(s => s.fileid == fileid && s.custid == custid); if (filemgr == null) { return(null); } return(filemgr); }
public long GetLastFileId() { long lastFieldId = 0; string value = string.Empty; using (frssdbEntities entities = new frssdbEntities()) { filemanager lastRecord = entities.filemanagers.OrderByDescending(fm => fm.fileid1).FirstOrDefault(); if (lastRecord != null) { lastFieldId = lastRecord.fileid1.Value; } } return(lastFieldId); }