コード例 #1
0
 public Laboratory add(Laboratory acc)
 {
     try
     {
         _context.Laboratories.Add(acc);
         _context.SaveChanges();
         Logger.Log(acc.Laboratory1 + " is Added", LogType.Info);
     }
     catch (Exception e)
     {
         Logger.Log(e.ToString(), LogType.Error);
     }
     return(acc);
 }
コード例 #2
0
 public Laboratory delete(Laboratory acc)
 {
     try
     {
         _context.Entry(acc).State = System.Data.Entity.EntityState.Deleted;
         _context.SaveChanges();
         Logger.Log(acc.Laboratory1 + " is Deleted", LogType.Info);
     }
     catch (Exception e)
     {
         Logger.Log(e.ToString(), LogType.Error);
     }
     return(acc);
 }
コード例 #3
0
        public Laboratory getByName(string name)
        {
            Laboratory acc = _context.Laboratories.FirstOrDefault(o => o.Laboratory1 == name);

            return(acc);
        }