internal override void PrepareForUpdate() { IgnoreProperties.Add(nameof(baccount)); IgnoreProperties.Add("baccountId"); IgnoreProperties.Add(nameof(locationId)); base.PrepareForUpdate(); }
public void GameFilter() { //AreaRegistration.RegisterAllAreas(); //WebApiConfig.Register(GlobalConfiguration.Configuration); //FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters); //RouteConfig.RegisterRoutes(RouteTable.Routes); //BundleConfig.RegisterBundles(BundleTable.Bundles); //AuthConfig.RegisterAuth(); //Database.SetInitializer<SelectumContext>(new SelectumInitializer()); Database.SetInitializer <SelectumContext>(null); int id = 0; // expecteds string messageToUser = "******"; var resultsViewModel = new ResultsByGame(); resultsViewModel.Results.Add(new ResultByGame()); ResultsByGameController controller = new ResultsByGameController(); ViewResult result = controller.GameFilter(id) as ViewResult; Assert.AreEqual(messageToUser, result.ViewBag.MessageToUser); IgnoreProperties ignoreProps = new IgnoreProperties(); ignoreProps.Add(new PropertyComparisonExclusion(typeof(List <string>), "Capacity")); UnitTestingHelper.AssertPublicPropertiesEqual(resultsViewModel, result.Model, ignoreProps); }
protected virtual void RaiseErrorsChanged(DataErrorsChangedEventArgs args) { OnPropertyChanged(Empty.HasErrorsChangedArgs); OnPropertyChanged(Empty.IsValidChangedArgs); OnPropertyChanged(Empty.IndexerPropertyChangedArgs); if (ErrorsChanged != null) { ThreadManager.Invoke(Settings.EventExecutionMode, this, args, RaiseErrorsChangedDelegate); } #if NONOTIFYDATAERROR string ignoreProperty = args.PropertyName ?? string.Empty; lock (_locker) { //Disable validation to prevent cycle var contains = IgnoreProperties.Contains(ignoreProperty); if (!contains) { IgnoreProperties.Add(ignoreProperty); } try { OnPropertyChanged(ignoreProperty); } finally { if (!contains) { IgnoreProperties.Remove(ignoreProperty); } } } #endif }
public CustomerInvoice() { DtoFields.Add("documentDueDate", new DtoValue(DateTime.Today.AddDays(14))); DtoFields.Add("cashDiscountDate", new DtoValue(DateTime.Today)); IgnoreProperties.Add(nameof(this.number)); IgnoreProperties.Add(nameof(this.referenceNumber)); }
public Location(string baccountId, string locationId) { this.baccount = new Baccount(); this.baccount.number = baccountId; this.locationId = locationId; IgnoreProperties.Add(nameof(baccount)); IgnoreProperties.Add("baccountId"); IgnoreProperties.Add(nameof(locationId)); }
internal override void PrepareForUpdate() { foreach (var salesOrderLine in lines) { salesOrderLine.operation = ApiOperation.Update; } IgnoreProperties.Add(nameof(customer)); if (lines.Count > 0) { IgnoreProperties.Add(nameof(currency)); } }
public Location(string baccountId, string locationId, bool standAloneLocation = false) { this.baccount = new Baccount(); this.baccount.number = baccountId; this.locationId = locationId; IgnoreProperties.Add(nameof(baccount)); if (!standAloneLocation) { IgnoreProperties.Add("baccountId"); IgnoreProperties.Add(nameof(locationId)); } }
private void HandleValidationInternal(object sender, object message) { var validationMessage = message as AsyncValidationMessage; if (validationMessage != null) { RaiseErrorsChanged(new DataErrorsChangedEventArgs(validationMessage.PropertyName)); OnHandleAsyncValidationMessage(sender, validationMessage); return; } var errorsMessage = message as DataErrorsChangedMessage; if (errorsMessage == null) { return; } OnErrorsChanged(sender, errorsMessage); #if NONOTIFYDATAERROR //To update property error in UI. ThreadManager.InvokeOnUiThreadAsync(() => { string ignoreProperty = errorsMessage.PropertyName ?? string.Empty; lock (_locker) { //Disable validation to prevent cycle var contains = IgnoreProperties.Contains(ignoreProperty); if (!contains) { IgnoreProperties.Add(ignoreProperty); } try { OnPropertyChanged(errorsMessage.PropertyName, ExecutionMode.None); } finally { if (!contains) { IgnoreProperties.Remove(ignoreProperty); } } } }); #endif }
public SupplierInvoice() { IgnoreProperties.Add(nameof(referenceNumber)); }
protected void AddIgnoreProperty <TModel>(Func <Expression <Func <TModel, object> > > getProperty) { IgnoreProperties.Add(getProperty.GetMemberName()); }
public Project(string projectNumber) { projectID = projectNumber; IgnoreProperties.Add(nameof(this.internalID)); }
public Customer() { IgnoreProperties.Add(nameof(this.number)); }
public SalesOrder() { IgnoreProperties.Add(nameof(orderNo)); IgnoreProperties.Add("orderNumber"); RequiredFields.Add(nameof(orderType), new DtoValue("SO")); }
public Project() { IgnoreProperties.Add(nameof(this.projectID)); IgnoreProperties.Add(nameof(this.internalID)); }
public Supplier() { IgnoreProperties.Add(nameof(this.number)); }
public CustomerInvoice() { IgnoreProperties.Add(nameof(referenceNumber)); }
public InsertSqlOptions(TableInfo info) : base(info) { IdentityColumn = info.GetIdentityColumnName(); info.Columns.Where(d => d.IgnoreWrite).ForEach(d => IgnoreProperties.Add(d.Name)); }
public void GameFilter() { //AreaRegistration.RegisterAllAreas(); //WebApiConfig.Register(GlobalConfiguration.Configuration); //FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters); //RouteConfig.RegisterRoutes(RouteTable.Routes); //BundleConfig.RegisterBundles(BundleTable.Bundles); //AuthConfig.RegisterAuth(); //Database.SetInitializer<SelectumContext>(new SelectumInitializer()); Database.SetInitializer<SelectumContext>(null); int id = 0; // expecteds string messageToUser = "******"; var resultsViewModel = new ResultsByGame(); resultsViewModel.Results.Add(new ResultByGame()); ResultsByGameController controller = new ResultsByGameController(); ViewResult result = controller.GameFilter(id) as ViewResult; Assert.AreEqual(messageToUser, result.ViewBag.MessageToUser); IgnoreProperties ignoreProps = new IgnoreProperties(); ignoreProps.Add(new PropertyComparisonExclusion(typeof(List<string>), "Capacity")); UnitTestingHelper.AssertPublicPropertiesEqual(resultsViewModel, result.Model, ignoreProps); }
public Inventory() { IgnoreProperties.Add(nameof(inventoryNumber)); }
/// <summary> /// Adds a property name to the <see cref="ValidatableViewModel.IgnoreProperties" />. /// </summary> protected void AddIgnoreProperty <TValue>(Expression <Func <T, TValue> > getProperty) { IgnoreProperties.Add(getProperty.GetMemberInfo().Name); }
public CustomerCreditNote() { IgnoreProperties.Add(nameof(this.referenceNumber)); }
public CustomerInvoice() { IgnoreProperties.Add(nameof(this.referenceNumber)); IgnoreProperties.Add(nameof(this.exchangeRate)); }
public PurchaseOrder() { IgnoreProperties.Add(nameof(orderNbr)); IgnoreProperties.Add("orderNbr"); }