예제 #1
0
        public void UpdateFile(filemanager record)
        {
            frssdbEntities entities = new frssdbEntities();
            var            data     = entities.Entry(record).State = System.Data.Entity.EntityState.Modified;

            entities.SaveChanges();
        }
예제 #2
0
        public void AddFile(filemanager record)
        {
            frssdbEntities entities = new frssdbEntities();
            var            data     = entities.filemanagers.Add(record);

            entities.SaveChanges();
        }
예제 #3
0
        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);
        }
예제 #4
0
        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);
        }