protected virtual bool AskForConfirmationForAddress(Document row, ChangedData data) { return(row.AllowOverrideContactAddress == true && !IsDefaultContactAdress() && IsThereSomeContactAddressSourceValue(Documents.Cache, row) && !IsContactAddressNoChanged(data)); }
void DefaultEditor_DataChanged(ChangedData data) { if (_systemEditor != null) { switch (data.Type) { case ChangedType.Add: _systemEditor.Add(data.NewBlocks); break; case ChangedType.Delete: _systemEditor.Delete(data.NewBlocks); break; case ChangedType.Edit: _systemEditor.SetValues(data.NewBlocks); break; case ChangedType.AddAndEdit: _systemEditor.Add(data.NewBlocks); _systemEditor.SetValues(data.NewAdditionalBlocks); break; case ChangedType.DeleteAndEdit: _systemEditor.Delete(data.NewBlocks); _systemEditor.SetValues(data.NewAdditionalBlocks); break; } } }
private void DefaultEditorDataChanged(ChangedData data) { if (this.systemEditorForm != null) { switch (data.Type) { case ChangedType.Add: this.systemEditorForm.Add(data.NewBlocks); break; case ChangedType.Delete: this.systemEditorForm.Delete(data.NewBlocks); break; case ChangedType.Edit: this.systemEditorForm.SetValues(data.NewBlocks); break; case ChangedType.AddAndEdit: this.systemEditorForm.Add(data.NewBlocks); this.systemEditorForm.SetValues(data.NewAdditionalBlocks); break; case ChangedType.DeleteAndEdit: this.systemEditorForm.Delete(data.NewBlocks); this.systemEditorForm.SetValues(data.NewAdditionalBlocks); break; } } }
void OnDataChanged(ChangedData data) { if (DataChanged != null) { DataChanged(data); } }
private void ExecuteDataChanged(ChangedData data, bool undo) { switch (data.Type) { case ChangedType.Add: this.BlocksAdded(data.NewBlocks); break; case ChangedType.Edit: this.BlocksChanged(data.NewBlocks, data.OldBlocks); break; case ChangedType.Move: this.BlocksMoved(data.NewBlocks, data.OldBlocks); break; case ChangedType.Delete: this.BlocksDeleted(data.NewBlocks); break; case ChangedType.AddAndEdit: this.BlocksAdded(data.NewBlocks); this.BlocksChanged(data.NewAdditionalBlocks, data.OldBlocks); break; case ChangedType.DeleteAndEdit: this.BlocksDeleted(data.NewBlocks); this.BlocksChanged(data.NewAdditionalBlocks, data.OldBlocks); break; } this.OnDataChanged(data); }
void UndoManager_DataChanged(ChangedData data, bool undo) { ExecuteDataChanged(undo ? data.GetUndoData() : data, undo); SetFile(File); //OnDocumentChanged(this); is already called in SetFile }
private void UndoManagerDataChanged(ChangedData data, bool undo) { this.ExecuteDataChanged(undo ? data.GetUndoData() : data, undo); this.SetFile(this.File); // OnDocumentChanged(this); is already called in SetFile }
private void Publish() { IImdbTopRatedEvents e = GetEvent <IImdbTopRatedEvents>(); var items = State; var data = new ChangedData { Kind = _type, Items = items }; e.Changed(data); }
protected override void OnNodeModified(object sender, NodeEventArgs e) { _log.Append("TestObserver.OnNodeModified").AppendLine(); _lastDescriptionChanges = null; foreach (var x in e.ChangedData) { if (x.Name == "Description") { _lastDescriptionChanges = new ChangedData { Name = x.Name, Original = x.Original, Value = x.Value }; break; } } }
public void Changed(ChangedData data) { try { Clients.All.BroadcastChanged(data); } #region Exception Handling catch (Exception ex) { ServiceEventSource.Current.ErrorMessage(ex); } #endregion // Exception Handling }
protected virtual void _(Events.RowInserted <Document> e) { var row = e.Row as Document; if (row == null) { return; } bool oldContactDirty = GetContactCache().IsDirty; bool oldAddressDirty = GetAddressCache().IsDirty; Contact oldContact = null; Address oldAddress = null; if (row.ContactID != null) { oldContact = PXSelect <Contact, Where <Contact.contactID, Equal <Current <Document.contactID> > > > .Select(Base); oldAddress = PXSelectJoin <Address, LeftJoin <Contact, On <Contact.defAddressID, Equal <Address.addressID> > >, Where <Contact.contactID, Equal <Current <Document.contactID> > > > .Select(Base); } else if (row.LocationID != null) { oldContact = PXSelectJoin <Contact, LeftJoin <Location, On <Location.locationID, Equal <Current <Document.locationID> > > >, Where <Contact.contactID, Equal <Location.defContactID> > > .Select(Base); oldAddress = PXSelectJoin <Address, LeftJoin <Contact, On <Contact.defAddressID, Equal <Address.addressID> >, LeftJoin <Location, On <Location.locationID, Equal <Current <Document.locationID> > > > >, Where <Address.addressID, Equal <Location.defAddressID> > > .Select(Base); } ChangedData forContactInfo = new ChangedData(); forContactInfo.OldContact = oldContact; forContactInfo.OldAddress = oldAddress; DefaultRecords(row, forContactInfo, new ChangedData(false)); GetContactCache().IsDirty = oldContactDirty; GetAddressCache().IsDirty = oldAddressDirty; }
public void Changed(ChangedData data) { switch (data.Kind) { case ImdbType.Unknown: break; case ImdbType.Movie: MoviesRates = data.Items; break; case ImdbType.Star: StarsRates = data.Items; break; default: break; } }
protected virtual void _(Events.FieldUpdated <Document, Document.locationID> e) { var row = e.Row as Document; if (row == null) { return; } ChangedData forShippingInfo = new ChangedData(); ChangedData forContactInfo = new ChangedData(false); int?oldLocationID = (int?)e.OldValue; if (oldLocationID != null) { forShippingInfo.OldContact = PXSelectJoin <Contact, LeftJoin <Location, On <Location.locationID, Equal <Required <Document.locationID> > > >, Where <Contact.contactID, Equal <Location.defContactID> > > .Select(Base, oldLocationID); forShippingInfo.OldAddress = PXSelectJoin <Address, LeftJoin <Contact, On <Contact.defAddressID, Equal <Address.addressID> >, LeftJoin <Location, On <Location.locationID, Equal <Required <Document.locationID> > > > >, Where <Address.addressID, Equal <Location.defAddressID> > > .Select(Base, oldLocationID); } Location oldLocation = PXSelect <Location, Where <Location.locationID, Equal <Required <Location.locationID> > > > . Select(Base, oldLocationID); if (row.BAccountID != oldLocation?.BAccountID) { forContactInfo = forShippingInfo; } if (row.LocationID != null) { DefaultRecords(row, forContactInfo, forShippingInfo); } }
public async Task <ChangedData> ScheduleChangedTableManager(GetRouteInformationTableRequest input) { ChangedData result = new ChangedData(); switch (input.TimelineTypeEnum) { //case (int)TimelineTypeEnum.TimeRangeTo2: // result = await GetTo1Table(input.PlanedRouteTrainId, _logger); // break; case (int)TimelineTypeEnum.TimeRangeTo2: case (int)TimelineTypeEnum.Cto: result.To2 = await GetTo2OrCto(input, _logger); break; case (int)TimelineTypeEnum.TimeRangeTrip: case (int)TimelineTypeEnum.TimeRangeTripTransfer: result.TimeRangeTrip = await GetTripData(input, _logger); break; //case (int)ScheludeChangedTableEnum.PriemkaPr: // result = await GetPriemshikiInspectionsTable(input, planedRouteTrainId, _logger); // break; case (int)TimelineTypeEnum.TimeBrigade: result.TimeBrigade = await GetBrigadeData(input, _logger); break; //case (int)ScheludeChangedTableEnum.Incidents: // result = await GetNotClosedTrainTaskTable(input, planedRouteTrainId, _logger); // break; //case (int)ScheludeChangedTableEnum.Depo: // result = await GetDepoEventsTable(input, planedRouteTrainId, _logger); // break; default: throw new ValidationException("Неизвестный TimelineTypeEnum"); } //PagingFilteringSorting(input, result); return(result); }
public ActionResult ChangeItemForm(ChangedData data) { if (ModelState.IsValid) { var items = data.CreateListOfPersonView(); try { SqlQuery.ChangeData("ReplaceValue", items[0], items[1], ConnString); } catch (SqlExecutionException e) { return(View("OperationFailed", e)); } return(View("OperationSuccessful")); } else { return(View()); } }
protected virtual void _(Events.FieldUpdated <Document, Document.contactID> e) { var row = e.Row as Document; if (row == null) { return; } Contact oldContact = null; Address oldAddress = null; ChangedData forContactInfo = new ChangedData(); ChangedData forShippingInfo = new ChangedData(false); if (e.OldValue != null) { oldContact = PXSelect <Contact, Where <Contact.contactID, Equal <Required <Document.contactID> > > > .Select(Base, (int?)e.OldValue); oldAddress = PXSelectJoin <Address, LeftJoin <Contact, On <Contact.defAddressID, Equal <Address.addressID> > >, Where <Contact.contactID, Equal <Required <Document.contactID> > > > .Select(Base, (int?)e.OldValue); } else if (row.LocationID != null) { oldContact = PXSelectJoin <Contact, LeftJoin <Location, On <Location.locationID, Equal <Current <Document.locationID> > > >, Where <Contact.contactID, Equal <Location.defContactID> > > .Select(Base); oldAddress = PXSelectJoin <Address, LeftJoin <Contact, On <Contact.defAddressID, Equal <Address.addressID> >, LeftJoin <Location, On <Location.locationID, Equal <Current <Document.locationID> > > > >, Where <Address.addressID, Equal <Location.defAddressID> > > .Select(Base); } forContactInfo.OldContact = oldContact; forContactInfo.OldAddress = oldAddress; DefaultRecords(row, forContactInfo, forShippingInfo); }
public ServerResponse Post([FromBody] ChangedData <User> objs) { return(objs.Save(items => repoUser.SaveAll(trans, items.NewItems, items.ModifiedItems, items.DeletedItems, null, delegate(EntityEventArgs <User> args) { if (args.Entity.UserRoles != null && args.Entity.UserRoles.Count > 0) { args.Entity.UserRoles.ForEach(ur => repoUr.Insert(ur)); } }, null, delegate(EntityEventArgs <User> args) { repoUr.DeleteBatch(ur => ur.UserId == args.Entity.UserId); if (args.Entity.UserRoles != null && args.Entity.UserRoles.Count > 0) { args.Entity.UserRoles.ForEach(ur => repoUr.Insert(ur)); } }, delegate(EntityEventArgs <User> args) { repoUr.DeleteBatch(ur => ur.UserId == args.Entity.UserId); }, null) )); }
public bool Save(ChangedData <AppSetting> items) { return(repoAppSetting.SaveAll(trans, items.NewItems, items.ModifiedItems, items.DeletedItems)); }
public bool Save(ChangedData<SiteMenuItem> items) { return repoMenuItem.SaveAll(trans, items.NewItems, items.ModifiedItems, items.DeletedItems); }
public bool Save(ChangedData<BasicDataItem> items) { return repoBasicDataItem.SaveAll(trans, items.NewItems, items.ModifiedItems, items.DeletedItems); }
public SettingsChangedEventArgs(ChangedData changedData) : base() { ChangedData = changedData; }
public void NotifySettingsChanged(ChangedData changedData) { var args = new SettingsChangedEventArgs(changedData); SettingsChanged?.Invoke(this, args); }
public bool Save(ChangedData<WebPageWidget> items) { return repoControl.SaveAll(trans, items.NewItems, items.ModifiedItems, items.DeletedItems); }
public ServerResponse Post([FromBody] ChangedData <Role> items) { return(items.Save(o => repoRole.SaveAll(trans, items.NewItems, items.ModifiedItems, items.DeletedItems))); }
public ChangedDataDecorator(string n, ChangedData changedData) : base(n) { this.ChangedData = changedData; }
public bool Save(ChangedData <Category> items) { return(repoCategory.SaveAll(trans, items.NewItems, items.ModifiedItems, items.DeletedItems)); }
public bool Save(ChangedData<Category> items) { return repoCategory.SaveAll(trans, items.NewItems, items.ModifiedItems, items.DeletedItems); }
public ServerResponse SaveFlows([FromBody] ChangedData <BizFlow> objs) { return(objs.Save(items => flowManager.SaveFlows(items.NewItems, items.ModifiedItems, items.DeletedItems))); }
public bool Save(ChangedData<UserGroup> items) { return repoUg.SaveAll(trans, items.NewItems, items.ModifiedItems, items.DeletedItems); }
public ServerResponse Save([FromBody] ChangedData <SiteMenuItem> items) { return(items.Save(o => provider.Save(items))); }
public ServerResponse Save([FromBody] ChangedData <BasicDataItem> items) { return(items.Save(o => provider.Save(o))); }
public bool Save(ChangedData <UserGroup> items) { return(repoUg.SaveAll(trans, items.NewItems, items.ModifiedItems, items.DeletedItems)); }
protected void SetDefaultContactAndAddress(PXCache cache, object Row, int?oldContactID, int?oldLocationID, int?oldBranchLocationID, ContacAddressCallerEnum callerID) { Extensions.ContactAddress.Document row; FSServiceOrder fsServiceOrderRow = null; if (Row is FSServiceOrder) { row = cache.GetExtension <Extensions.ContactAddress.Document>(Row); fsServiceOrderRow = (FSServiceOrder)Row; } else { row = Row as Extensions.ContactAddress.Document; fsServiceOrderRow = (FSServiceOrder)cache.GetMain <Extensions.ContactAddress.Document>(row); } if (row == null) { return; } Contact oldContact = null; Address oldAddress = null; FSSrvOrdType fsSrvOrdTypeRow = null; if (cache.Graph is ServiceOrderEntry) { fsSrvOrdTypeRow = ((ServiceOrderEntry)cache.Graph).ServiceOrderTypeSelected.Current; } else if (cache.Graph is AppointmentEntry) { fsSrvOrdTypeRow = ((AppointmentEntry)cache.Graph).ServiceOrderTypeSelected.Current; } if (fsSrvOrdTypeRow != null && fsSrvOrdTypeRow.AppAddressSource == ID.SrvOrdType_AppAddressSource.BRANCH_LOCATION && oldBranchLocationID != null) { oldContact = ContactAddressHelper.GetContact( (FSContact)PXSelectJoin < FSContact, InnerJoin <FSBranchLocation, On <FSBranchLocation.branchLocationContactID, Equal <FSContact.contactID> > >, Where <FSBranchLocation.branchLocationID, Equal <Required <FSBranchLocation.branchLocationID> > > > .Select(Base, oldBranchLocationID)); oldAddress = ContactAddressHelper.GetAddress( (FSAddress)PXSelectJoin < FSAddress, InnerJoin <FSBranchLocation, On <FSBranchLocation.branchLocationAddressID, Equal <FSAddress.addressID> > >, Where <FSBranchLocation.branchLocationID, Equal <Required <FSBranchLocation.branchLocationID> > > > .Select(Base, oldBranchLocationID)); } else if (fsSrvOrdTypeRow != null && fsSrvOrdTypeRow.AppAddressSource == ID.SrvOrdType_AppAddressSource.CUSTOMER_CONTACT && oldContactID != null) { oldContact = PXSelect <Contact, Where <Contact.contactID, Equal <Required <Extensions.ContactAddress.Document.contactID> > > > .Select(Base, oldContactID); oldAddress = PXSelectJoin <Address, LeftJoin <Contact, On <Contact.defAddressID, Equal <Address.addressID> > >, Where <Contact.contactID, Equal <Required <Extensions.ContactAddress.Document.contactID> > > > .Select(Base, oldContactID); } else if (fsSrvOrdTypeRow != null && fsSrvOrdTypeRow.AppAddressSource == ID.SrvOrdType_AppAddressSource.BUSINESS_ACCOUNT && oldLocationID != null) { oldContact = PXSelectJoin <Contact, LeftJoin <Location, On <Location.locationID, Equal <Required <Extensions.ContactAddress.Document.locationID> > > >, Where <Contact.contactID, Equal <Location.defContactID> > > .Select(Base, oldLocationID); oldAddress = PXSelectJoin <Address, LeftJoin <Contact, On <Contact.defAddressID, Equal <Address.addressID> >, LeftJoin <Location, On <Location.locationID, Equal <Required <Extensions.ContactAddress.Document.locationID> > > > >, Where <Address.addressID, Equal <Location.defAddressID> > > .Select(Base, oldLocationID); } bool CallDefaults = false; switch (callerID) { case ContacAddressCallerEnum.Insert: CallDefaults = true; break; case ContacAddressCallerEnum.BranchLocationID: CallDefaults = fsSrvOrdTypeRow?.AppAddressSource == ID.SrvOrdType_AppAddressSource.BRANCH_LOCATION && fsServiceOrderRow.BranchLocationID != null; break; case ContacAddressCallerEnum.BAccountID: CallDefaults = fsSrvOrdTypeRow?.AppAddressSource != ID.SrvOrdType_AppAddressSource.BRANCH_LOCATION && fsServiceOrderRow.CustomerID != null; break; case ContacAddressCallerEnum.ContactID: CallDefaults = fsSrvOrdTypeRow?.AppAddressSource == ID.SrvOrdType_AppAddressSource.CUSTOMER_CONTACT && fsServiceOrderRow.ContactID != null; break; case ContacAddressCallerEnum.LocationID: CallDefaults = fsSrvOrdTypeRow?.AppAddressSource == ID.SrvOrdType_AppAddressSource.BUSINESS_ACCOUNT && fsServiceOrderRow.LocationID != null; break; } if (CallDefaults) { ChangedData forContactInfo = new ChangedData(); forContactInfo.OldContact = oldContact; forContactInfo.OldAddress = oldAddress; DefaultRecords(row, forContactInfo, new ChangedData(false)); } }
public bool Save(ChangedData<AppSetting> items) { return repoAppSetting.SaveAll(trans, items.NewItems, items.ModifiedItems, items.DeletedItems); }
public bool SaveSubSites(ChangedData<SubSite> items) { return repoLocSite.SaveAll(trans, items.NewItems, items.ModifiedItems, items.DeletedItems); }
public ServerResponse Save(ChangedData<AppSetting> items) { return items.Save(o => provider.Save(o)); }
public ServerResponse Save([FromBody] ChangedData <WebPageWidget> items) { return(items.Save(o => pageProvider.Save(items))); }
protected bool IsShippingContactAddressNoChanged(ChangedData replaceData) { if (replaceData == null || !replaceData.CanBeReplace) { return(true); } Contact etalonContact = replaceData.OldContact; Address etalonAddress = replaceData.OldAddress; if (etalonContact == null || etalonAddress == null) { return(false); } var shippingContact = GetCurrentShippingContact(); var shippingAddress = GetCurrentShippingAddress(); if (shippingContact != null && shippingAddress != null) { if (shippingContact.FullName != etalonContact.FullName) { return(false); } if (shippingContact.Attention != etalonContact.Attention) { return(false); } if (shippingContact.Email != etalonContact.EMail) { return(false); } if (shippingContact.Phone1 != etalonContact.Phone1) { return(false); } if (shippingContact.Phone1Type != etalonContact.Phone1Type) { return(false); } if (shippingContact.Phone2 != etalonContact.Phone2) { return(false); } if (shippingContact.Phone2Type != etalonContact.Phone2Type) { return(false); } if (shippingAddress.AddressLine1 != etalonAddress.AddressLine1) { return(false); } if (shippingAddress.AddressLine2 != etalonAddress.AddressLine2) { return(false); } if (shippingAddress.City != etalonAddress.City) { return(false); } if (shippingAddress.State != etalonAddress.State) { return(false); } if (shippingAddress.CountryID != etalonAddress.CountryID) { return(false); } if (shippingAddress.PostalCode != etalonAddress.PostalCode) { return(false); } } else { return(false); } return(true); }