Beispiel #1
0
 /// <summary>
 /// When implemented by a class, this method returns information on an error associated with a business object.
 /// </summary>
 /// <param name="info">
 /// An <see cref="T:DevExpress.XtraEditors.DXErrorProvider.ErrorInfo"/> object that contains information on an error.
 /// </param>
 public void GetError(ErrorInfo info)
 {
 }
Beispiel #2
0
        /// <summary>
        /// When implemented by a class, this method returns information on an error associated with a specific business object's property.
        /// </summary>
        /// <param name="propertyName">
        /// A string that identifies the name of the property for which information on an error is to be returned.
        /// </param>
        /// <param name="info">
        /// An <see cref="T:DevExpress.XtraEditors.DXErrorProvider.ErrorInfo"/> object that contains information on an error.
        /// </param>
        public void GetPropertyError(string propertyName, ErrorInfo info)
        {
            switch (propertyName)
            {
                case "Title":
                    if (this.Title == string.Empty)
                    {
                        info.ErrorText = "Title must not be empty";
                        info.ErrorType = ErrorType.Critical;
                    }

                    break;

                case "Year":
                    if (this.Year.ToString().Length != 4)
                    {
                        info.ErrorText = string.Format(
                            "This year is only {0} numbers long. It needs to be 4", this.Year.ToString().Length);

                        info.ErrorType = ErrorType.Critical;
                    }

                    break;

                case "YanfoeID":
                    if (string.IsNullOrEmpty(this.YanfoeID))
                    {
                        info.ErrorText =
                            "No YANFOE MovieUniqueId. It is recommended to use the quick search functionality to retrieve this value.";
                        info.ErrorType = ErrorType.Information;
                    }

                    break;

                case "ImdbId":
                    if (string.IsNullOrEmpty(this.YanfoeID))
                    {
                        info.ErrorText =
                            "No IMDB MovieUniqueId. It is recommended to use the quick search functionality to retrieve this value.";
                        info.ErrorType = ErrorType.Information;
                    }

                    break;
            }
        }
Beispiel #3
0
 public void GetError(DevExpress.XtraEditors.DXErrorProvider.ErrorInfo info)
 {
 }
 void SetErrorInfo(DevExpress.XtraEditors.DXErrorProvider.ErrorInfo Info, string ErrorText, ErrorType errorType)
 {
     Info.ErrorText = ErrorText;
     Info.ErrorType = errorType;
 }
Beispiel #5
0
 void IDXDataErrorInfo.GetError(DevExpress.XtraEditors.DXErrorProvider.ErrorInfo info)
 {
 }
 /// <summary>
 /// When implemented by a class, this method returns information on an error associated with a specific business object's property.
 /// </summary>
 /// <param name="propertyName">A string that identifies the name of the property for which information on an error is to be returned.</param>
 /// <param name="info">An <see cref="T:DevExpress.XtraEditors.DXErrorProvider.ErrorInfo"/> object that contains information on an error.</param>
 public void GetPropertyError(string propertyName, ErrorInfo info)
 {
 }
 /// <summary>
 /// When implemented by a class, this method returns information on an error associated with a business object.
 /// </summary>
 /// <param name="info">An <see cref="T:DevExpress.XtraEditors.DXErrorProvider.ErrorInfo"/> object that contains information on an error.</param>
 public void GetError(ErrorInfo info)
 {
 }
 /// <summary>
 /// When implemented by a class, this method returns information on an error associated with a specific business object's property.
 /// </summary>
 /// <param name="propertyName">A string that identifies the name of the property for which information on an error is to be returned.</param>
 /// <param name="info">An <see cref="T:DevExpress.XtraEditors.DXErrorProvider.ErrorInfo"/> object that contains information on an error.</param>
 public void GetPropertyError(string propertyName, ErrorInfo info)
 {
 }
Beispiel #9
0
            public void GetPropertyError(string propertyName, ErrorInfo info)
            {
                //throw new NotImplementedException();
                if (propertyName == "Total_Deduction")
                {
                    if (!FrmImports.IsNumeric(Total_Deduction))
                    {
                        info.ErrorText = "Total Deduction is not in the right format";
                    }
                    else if (Total_Deduction < 0)
                    {
                        info.ErrorText = "Total Deduction is negative ";
                    }
                }

                if (propertyName == "Tax_Deducted")
                {
                    if (!FrmImports.IsNumeric(Tax_Deducted))
                    {
                        info.ErrorText = "Total Deducted is not in the right format";
                    }
                    else if (Tax_Deducted < 0)
                    {
                        info.ErrorText = "Total Deducted is negative ";
                    }
                }

                if (propertyName == "Total_Income")
                {
                    if (!FrmImports.IsNumeric(Total_Income))
                    {
                        info.ErrorText = "Total Income is not in the right format";
                    }
                    else if (Total_Income < 0)
                    {
                        info.ErrorText = "Total Income is negative ";
                    }
                }

                if (propertyName == "Total_Relief")
                {
                    if (!FrmImports.IsNumeric(Total_Relief))
                    {
                        info.ErrorText = "Total Relief is not in the right format";
                    }
                    else if (Total_Relief < 0)
                    {
                        info.ErrorText = "Total Relief is negative ";
                    }
                }

                if (propertyName == "Months")
                {
                    if (!FrmImports.IsNumeric(Months))
                    {
                        info.ErrorText = "Months not in the right format";
                    }
                    else if (Months >= 13)
                    {
                        info.ErrorText = "Months Excced the Calander Months ";
                    }
                }
            }