internal static void AddProfession() { string newProfessionName = InputDialog.Show("Введите название профессии", "Создание профессии"); if (!String.IsNullOrWhiteSpace(newProfessionName)) { ITSkillsDataContext dataContext = new ITSkillsDataContext(); var alreadyInDB = from p in dataContext.Professions where p.Profession == newProfessionName select p; if (alreadyInDB.Count() == 0) { Professions newProfession = new Professions(); newProfession.Profession = newProfessionName; dataContext.Professions.InsertOnSubmit(newProfession); dataContext.SubmitChanges(); } } }
partial void DeleteProfessions(Professions instance);
partial void UpdateProfessions(Professions instance);
partial void InsertProfessions(Professions instance);