Example #1
0
        public IEnumerable <ValidationResult> Validate(ValidationContext validationContext)
        {
            if (ConstructionId.GetValueOrDefault() <= 0)
            {
                yield return(new ValidationResult("Konstruksi harus diisi", new List <string> {
                    "Construction"
                }));
            }

            if (GradeId.GetValueOrDefault() <= 0)
            {
                yield return(new ValidationResult("Grade harus diisi", new List <string> {
                    "Grade"
                }));
            }

            if (ProcessTypeId.GetValueOrDefault() <= 0)
            {
                yield return(new ValidationResult("Jenis Proses harus diisi", new List <string> {
                    "ProcessType"
                }));
            }

            if (UOMId.GetValueOrDefault() <= 0)
            {
                yield return(new ValidationResult("Satuan harus diisi", new List <string> {
                    "UOM"
                }));
            }

            if (WarpId.GetValueOrDefault() <= 0)
            {
                yield return(new ValidationResult("Lusi harus diisi", new List <string> {
                    "Warp"
                }));
            }

            if (WeftId.GetValueOrDefault() <= 0)
            {
                yield return(new ValidationResult("Pakan harus diisi", new List <string> {
                    "Weft"
                }));
            }

            if (WidthId.GetValueOrDefault() <= 0)
            {
                yield return(new ValidationResult("Lebar harus diisi", new List <string> {
                    "Width"
                }));
            }

            if (WovenTypeId.GetValueOrDefault() <= 0)
            {
                yield return(new ValidationResult("Jenis Anyaman harus diisi", new List <string> {
                    "WovenType"
                }));
            }

            if (YarnTypeId.GetValueOrDefault() <= 0)
            {
                yield return(new ValidationResult("Jenis Benang harus diisi", new List <string> {
                    "YarnType"
                }));
            }
        }
Example #2
0
        public IEnumerable <ValidationResult> Validate(ValidationContext validationContext)
        {
            if (ColorWayId.GetValueOrDefault() > 0)
            {
                yield return(new ValidationResult("Warna harus diisi", new List <string> {
                    "ColorWay"
                }));
            }

            if (ConstructionTypeId.GetValueOrDefault() > 0)
            {
                yield return(new ValidationResult("Konstruksi harus diisi", new List <string> {
                    "ConstructionType"
                }));
            }

            if (GradeId.GetValueOrDefault() > 0)
            {
                yield return(new ValidationResult("Grade harus diisi", new List <string> {
                    "Grade"
                }));
            }

            if (ProcessTypeId.GetValueOrDefault() > 0)
            {
                yield return(new ValidationResult("Jenis Proses harus diisi", new List <string> {
                    "ProcessType"
                }));
            }

            if (UOMId.GetValueOrDefault() > 0)
            {
                yield return(new ValidationResult("Satuan harus diisi", new List <string> {
                    "Satuan"
                }));
            }

            if (WarpThreadId.GetValueOrDefault() > 0)
            {
                yield return(new ValidationResult("Benang Lusi harus diisi", new List <string> {
                    "WarpThread"
                }));
            }

            if (WeftThreadId.GetValueOrDefault() > 0)
            {
                yield return(new ValidationResult("Benang Pakan harus diisi", new List <string> {
                    "WeftThread"
                }));
            }

            if (WidthId.GetValueOrDefault() > 0)
            {
                yield return(new ValidationResult("Lebar harus diisi", new List <string> {
                    "Lebar"
                }));
            }

            if (WovenTypeId.GetValueOrDefault() > 0)
            {
                yield return(new ValidationResult("Jenis Anyaman harus diisi", new List <string> {
                    "WovenType"
                }));
            }
        }