private void EditEndingLookup(object sender, System.Windows.Controls.DataFormEditEndingEventArgs e) { if (m_gridReady) { DataForm dataForm = sender as DataForm; if (dataForm.CurrentItem != null) { int lookupType = (int)SIPDialPlanLookupTypes.SpeedDial; if (dataForm == m_enumsDataForm) { lookupType = (int)SIPDialPlanLookupTypes.ENUM; } else if (dataForm == m_cnamDataForm) { lookupType = (int)SIPDialPlanLookupTypes.CNAM; } if (dataForm.Mode == DataFormMode.AddNew) { SIPDialplanLookup lookup = dataForm.CurrentItem as SIPDialplanLookup; lookup.ID = Guid.NewGuid().ToString(); lookup.DialPlanID = m_dialPlan.ID; lookup.Owner = m_owner; lookup.LookupType = lookupType; } } } }
public void UpdateSIPDialplanLookupTest() { SIPEntitiesDomainService target = new SIPEntitiesDomainService(); // TODO: Initialize to an appropriate value SIPDialplanLookup currentSIPDialplanLookup = null; // TODO: Initialize to an appropriate value target.UpdateSIPDialplanLookup(currentSIPDialplanLookup); Assert.Inconclusive("A method that does not return a value cannot be verified."); }
public void UpdateSIPDialplanLookup(SIPDialplanLookup currentSIPDialplanLookup) { if (currentSIPDialplanLookup.Owner != this.ServiceContext.User.Identity.Name) { throw new ApplicationException("You are not authorised to update this record."); } else { this.ObjectContext.SIPDialplanLookups.AttachAsModified(currentSIPDialplanLookup, this.ChangeSet.GetOriginal(currentSIPDialplanLookup)); } }
public void InsertSIPDialplanLookup(SIPDialplanLookup sipDialplanLookup) { sipDialplanLookup.Owner = this.ServiceContext.User.Identity.Name; if ((sipDialplanLookup.EntityState != EntityState.Detached)) { this.ObjectContext.ObjectStateManager.ChangeObjectState(sipDialplanLookup, EntityState.Added); } else { this.ObjectContext.SIPDialplanLookups.AddObject(sipDialplanLookup); } }
public void DeleteSIPDialplanLookup(SIPDialplanLookup sipDialplanLookup) { if (sipDialplanLookup.Owner != this.ServiceContext.User.Identity.Name) { throw new ApplicationException("You are not authorised to delete this record."); } else { if ((sipDialplanLookup.EntityState == EntityState.Detached)) { this.ObjectContext.SIPDialplanLookups.Attach(sipDialplanLookup); } this.ObjectContext.SIPDialplanLookups.DeleteObject(sipDialplanLookup); } }
private void DeleteCNAM(object sender, System.ComponentModel.CancelEventArgs e) { SIPDialplanLookup cnamEntry = m_cnamDataGrid.SelectedItem as SIPDialplanLookup; MessageBoxResult confirmDelete = MessageBox.Show("Press Ok to delete CNAM " + cnamEntry.LookupKey + ".", "Confirm Delete", MessageBoxButton.OKCancel); if (confirmDelete == MessageBoxResult.OK) { e.Cancel = true; m_riaContext.SIPDialplanLookups.Remove(cnamEntry); m_riaContext.SubmitChanges(SubmitComplete, null); } else { e.Cancel = true; } }
private void DeleteSpeedDial(object sender, System.ComponentModel.CancelEventArgs e) { SIPDialplanLookup speedDial = m_speedDialsDataForm.CurrentItem as SIPDialplanLookup; MessageBoxResult confirmDelete = MessageBox.Show("Press Ok to delete speed dial " + speedDial.LookupKey + ".", "Confirm Delete", MessageBoxButton.OKCancel); if (confirmDelete == MessageBoxResult.OK) { e.Cancel = true; m_riaContext.SIPDialplanLookups.Remove(speedDial); m_riaContext.SubmitChanges(SubmitComplete, null); } else { e.Cancel = true; } }