Beispiel #1
0
        public bool IsValid(AlamatKirim obj, ref ValidationError validationError)
        {
            var validatorResults = _validator.Validate(obj);

            if (!validatorResults.IsValid)
            {
                foreach (var failure in validatorResults.Errors)
                {
                    validationError.Message      = failure.ErrorMessage;
                    validationError.PropertyName = failure.PropertyName;
                    return(false);
                }
            }

            return(true);
        }
        public FrmEntryAlamatKirim(string header, Customer customer, JualProduk jual)
            : base()
        {
            InitializeComponent();
            ColorManagerHelper.SetTheme(this, this);
            base.SetHeader(header);

            this._alamatKirim = new AlamatKirim();
            this._customer    = customer;
            this._jual        = jual;

            if (this._jual == null)
            {
                chkIsSdac.Checked = true;
            }
            else
            {
                chkIsSdac.Checked = this._jual.is_sdac;
            }

            chkIsSdac_CheckedChanged(chkIsSdac, new EventArgs());
        }