private void CreateCatConfirmTableData() { foreach (string cat in CatConfirmation.GetCatagoryList()) { ConfirmationCatagory catagory = new ConfirmationCatagory(); catagory.Code = cat; catagory.Name = cat; SaveConfirmationCatagory(catagory); } }
private void SaveConfirmationCatagory(ConfirmationCatagory confirmationCatagory) { ConfirmationCatagory confirmation = db.ConfirmationCatagories.Find(confirmationCatagory.Code); if (confirmation == null) { db.ConfirmationCatagories.Add(confirmationCatagory); db.SaveChanges(); } }