コード例 #1
0
ファイル: TakaDB.cs プロジェクト: SCIMTA/group-5
 public void UpdateType(int id, string name)
 {
     Enitities.Type type = takaDB.Types.Where(x => x.ID == id).First();
     if (type == null)
     {
         return;
     }
     type.Name = name;
     takaDB.SaveChanges();
 }
コード例 #2
0
ファイル: TakaDB.cs プロジェクト: SCIMTA/group-5
 public void AddType(string name)
 {
     if (takaDB.Types.Where(e => e.Name.Equals(name)).Count() > 0)
     {
         return;
     }
     Enitities.Type author = new Enitities.Type();
     author.Name = name;
     takaDB.Types.Add(author);
     takaDB.SaveChanges();
 }
コード例 #3
0
ファイル: TakaDB.cs プロジェクト: SCIMTA/group-5
 public void RemoveType(int id)
 {
     try
     {
         Enitities.Type author = takaDB.Types.Where(x => x.ID == id).First();
         takaDB.Types.Remove(author);
         takaDB.SaveChanges();
     }
     catch (Exception)
     {
     }
 }