Exemplo n.º 1
0
            protected override void OnValueChanged(StoredProcedureBase element, string oldValue, string newValue)
            {
                if (element.nHydrateModel != null && !element.nHydrateModel.IsLoading)
                {
                    if (string.IsNullOrEmpty(newValue))
                    {
                        throw new Exception("The name must have a value.");
                    }

                    var count = element.nHydrateModel.StoredProcedures.Count(x => x.Name.ToLower() == newValue.ToLower() && x.Id != element.Id);
                    if (count > 0)
                    {
                        throw new Exception("There is already an object with the specified name. The change has been cancelled.");
                    }
                }
                base.OnValueChanged(element, oldValue, newValue);
            }
            protected override void OnValueChanged(StoredProcedureBase element, string oldValue, string newValue)
            {
                if (element.nHydrateModel != null && !element.nHydrateModel.IsLoading)
                {
                    if (string.IsNullOrEmpty(newValue))
                        throw new Exception("The name must have a value.");

                    var count = element.nHydrateModel.StoredProcedures.Count(x => x.Name.ToLower() == newValue.ToLower() && x.Id != element.Id);
                    if (count > 0)
                        throw new Exception("There is already an object with the specified name. The change has been cancelled.");
                }
                base.OnValueChanged(element, oldValue, newValue);
            }