コード例 #1
0
 private void CreateCatConfirmTableData()
 {
     foreach (string cat in CatConfirmation.GetCatagoryList())
     {
         ConfirmationCatagory catagory = new ConfirmationCatagory();
         catagory.Code = cat;
         catagory.Name = cat;
         SaveConfirmationCatagory(catagory);
     }
 }
コード例 #2
0
        private void SaveConfirmationCatagory(ConfirmationCatagory confirmationCatagory)
        {
            ConfirmationCatagory confirmation = db.ConfirmationCatagories.Find(confirmationCatagory.Code);

            if (confirmation == null)
            {
                db.ConfirmationCatagories.Add(confirmationCatagory);
                db.SaveChanges();
            }
        }