public void Merge(DataValidateResult result) { foreach (ValidationItem item in result.Items) { Items.Add(item); } }
public DataValidateResult Validate(string value) { DataValidateResult result = new DataValidateResult(); if (value == null || value.Trim().Length == 0) { result.AddItem(Message); } return(result); }
public DataValidateResult Validate(string value) { DataValidateResult result = new DataValidateResult(); if (value != null && value.Trim().Length > 0) { try { decimal v = Convert.ToDecimal(value); } catch { result.AddItem(Message); } } return(result); }
public DataValidateResult Validate(string value) { DataValidateResult result = new DataValidateResult(); string message = string.Empty; if (value == null || value.Trim().Length < Length) { message = string.Format("Length < {0}", Length); } else if (value.Trim().Length > Length) { message = string.Format("Length > {0}", Length); } if (message.Length > 0) { result.AddItem(message); } return(result); }
public DataValidateResult Validate(string value) { DataValidateResult result = new DataValidateResult(); if (value != null && value.ToString().Trim().Length > 0) { try { Char c = Convert.ToChar(value); if (!CharSet.Contains(c)) { result.AddItem(Message); } } catch { result.AddItem(Message); } } return(result); }