Наследование: System.Windows.Controls.ChildWindow
Пример #1
0
        void registroConvenio_Closed(object sender, EventArgs e)
        {
            RegistroConvenioPlanoSaude registro = (RegistroConvenioPlanoSaude)sender;
            AdministracaoContext       context  = (AdministracaoContext)convenioPlanoSaudeSetDomainDataSource.DomainContext;

            if (registro.DialogResult == true && registro.novoConvenio != null)
            {
                context.ConvenioPlanoSaudeSets.Add(registro.novoConvenio);
                convenioPlanoSaudeSetDomainDataSource.SubmitChanges();
                dfrConvenio.CurrentItem = registro.novoConvenio;

                ConvenioPlanoSaudeSet convenio = (ConvenioPlanoSaudeSet)registro.novoConvenio;
                ConvenioServicoSet    desconto = null;

                AdministracaoContext             administracaoContext  = new AdministracaoContext();
                LoadOperation <ServicoMedicoSet> loadOpServicosMedicos = administracaoContext.Load <ServicoMedicoSet>(administracaoContext.GetServicoMedicoSetQuery());
                loadOpServicosMedicos.Completed += (s2, e2) =>
                {
                    foreach (ServicoMedicoSet servico in ((LoadOperation)s2).Entities)
                    {
                        desconto = new ConvenioServicoSet();
                        desconto.ConvenioPlanoSaude_codigo = convenio.codigo;
                        desconto.ServicoMedicoSet_codigo   = servico.codigo;
                        desconto.porcentagem_desconto      = 0;

                        context.ConvenioServicoSets.Add(desconto);
                    }
                    convenioPlanoSaudeSetDomainDataSource.SubmitChanges();
                };
            }
        }
Пример #2
0
        private void btnRegistrar_Click(object sender, RoutedEventArgs e)
        {
            RegistroConvenioPlanoSaude registroConvenio = new RegistroConvenioPlanoSaude();

            registroConvenio.Closed += new EventHandler(registroConvenio_Closed);
            registroConvenio.Show();
        }
 private void btnRegistrar_Click(object sender, RoutedEventArgs e)
 {
     RegistroConvenioPlanoSaude registroConvenio = new RegistroConvenioPlanoSaude();
     registroConvenio.Closed += new EventHandler(registroConvenio_Closed);
     registroConvenio.Show();
 }