private string CheckValue(IChecker <Equipment> cheker, Equipment equipment, string oldValue, string newValue, string field) { return(!cheker.CheckField(equipment, oldValue, newValue, out string message) ? throw new Exception($"{field}: {message}") : newValue); }
/*public User ChekReal(string userName) * { * foreach (var user in UsersList.UsersEntityNew.UsersNew) * { * if (user.UserName == userName) * { * return user; * } * } * return null; * }*/ private string CheckValue(IChecker <User> cheker, User user, string oldValue, string newValue, string field) { //MessageBox.Show("Вход в проверки"); return(!cheker.CheckField(user, oldValue, newValue, out string message) ? throw new Exception($"{field}: {message}") : newValue); }