Пример #1
0
        /// <summary>
        /// Checks the submit.
        /// </summary>
        /// <param name="dao">The DAO.</param>
        /// <param name="view">The view.</param>
        /// <returns></returns>
        public static bool CheckSubmit(GenericDao dao, IErrorView view)
        {
            if (!dao.CanSubmitChanges())
            {
                foreach (var error in dao.InvalidEntities.SelectMany(entity => entity.Errors).Distinct())
                {
                    view.AddError(error);
                }

                return false;
            }

            return true;
        }