public bool Validate(BusinessObject otherObject) { String errorMsg = String.Format("{0} validation failed", otherObject.GetType().Name); this.AddRule(new ValidateCompare(otherObject, ValidationOperator.Equal, errorMsg)); return Validate(); }
public override bool Validate(BusinessObject thisObject) { try { switch (Operator) { case ValidationOperator.Equal: return thisObject.Equals(OtherObject); case ValidationOperator.NotEqual: return !thisObject.Equals(OtherObject); } } catch { ; } return false; }
public static BusinessObject Update(BusinessObject obj) { if (obj is Address) return GetAddressInfo((Address)obj); else if (obj is Supplier) return GetSupplierInfo((Supplier)obj); else if (obj is Category) return GetCategoryInfo((Category)obj); else if (obj is Customer) return GetCustomerInfo((Customer)obj); else if (obj is Product) return GetProductInfo((Product)obj); else if (obj is Order) return GetOrderInfo((Order)obj); else if (obj is OrderDetail) return GetOrderDetailInfo((OrderDetail)obj); else return null; }
public bool ValidateOrderDetail(BusinessObject bObject) { OrderDetail ordDetail = (OrderDetail)bObject; return ordDetail.Validate(GetOrderDetail(ordDetail.OrderId, ordDetail.ProductId)); }
public bool ValidateOrder(BusinessObject bObject) { Order order = (Order)bObject; return order.Validate(GetOrder(order.OrderId)); }
public bool ValidateProduct(BusinessObject bObject) { Product product = (Product)bObject; return product.Validate(GetProduct(product.ProductId)); }
public bool ValidateCustomer(BusinessObject bObject) { Customer customer = (Customer)bObject; return customer.Validate(GetCustomer(customer.CustomerId)); }
public bool ValidateCategory(BusinessObject bObject) { Category category = (Category)bObject; return category.Validate(GetCategory(category.CategoryId)); }
public bool ValidateSupplier(BusinessObject bObject) { Supplier supplier = (Supplier)bObject; return supplier.Validate(GetSupplier(supplier.SupplierId)); }
public bool ValidateAddress(BusinessObject bObject) { Address address = (Address)bObject; return address.Validate(GetAddress(address.AddressId)); }