Beispiel #1
0
        static void CheckDBConnection()
        {
            OTEntities ctx = new OTEntities();

                var q = from p in ctx.OT_APP1 select p;
                if (q.Count() >-1)
                {
                    Console.Write("db connection is good");
                }
                ctx.Database.Connection.Close();
                ctx.Dispose();
        }
Beispiel #2
0
 public override long findSeqNumByCode(string code)
 {
     OTEntities context = new OTEntities();
     var q = from p in context.SYS_SEQ where p.SEQ_CODE == code select p;
     if(q.FirstOrDefault()!=null)
     {
         SYS_SEQ seq = q.FirstOrDefault();
         long num =(long)seq.SEQ_NUM;
         seq.SEQ_NUM ++;
         context.SaveChanges();
         return num;
     }
        /* SysSeq ss = sysSeqDao.findBySeqCode(code);
     long seqNum = ss.getSeqNum();
     ss.setSeqNum(ss.getSeqNum() + 1);
     sysSeqDao.save(ss);
     return seqNum;*/
     return 0;
 }