Inheritance: System.Data.Objects.DataClasses.EntityObject
 public RegistroServicoMedico()
 {
     InitializeComponent();
     novoServico = new ServicoMedicoSet();
     dfrNovoServico.CurrentItem = novoServico;
     dfrNovoServico.BeginEdit();
 }
Exemple #2
0
        /// <summary>
        /// Create a new ServicoMedicoSet object.
        /// </summary>
        /// <param name="codigo">Initial value of the codigo property.</param>
        /// <param name="nome">Initial value of the nome property.</param>
        /// <param name="descricao">Initial value of the descricao property.</param>
        /// <param name="preco">Initial value of the preco property.</param>
        public static ServicoMedicoSet CreateServicoMedicoSet(global::System.Int32 codigo, global::System.String nome, global::System.String descricao, global::System.Double preco)
        {
            ServicoMedicoSet servicoMedicoSet = new ServicoMedicoSet();

            servicoMedicoSet.codigo    = codigo;
            servicoMedicoSet.nome      = nome;
            servicoMedicoSet.descricao = descricao;
            servicoMedicoSet.preco     = preco;
            return(servicoMedicoSet);
        }
 /// <summary>
 /// Create a new ServicoMedicoSet object.
 /// </summary>
 /// <param name="codigo">Initial value of the codigo property.</param>
 /// <param name="nome">Initial value of the nome property.</param>
 /// <param name="descricao">Initial value of the descricao property.</param>
 /// <param name="preco">Initial value of the preco property.</param>
 public static ServicoMedicoSet CreateServicoMedicoSet(global::System.Int32 codigo, global::System.String nome, global::System.String descricao, global::System.Double preco)
 {
     ServicoMedicoSet servicoMedicoSet = new ServicoMedicoSet();
     servicoMedicoSet.codigo = codigo;
     servicoMedicoSet.nome = nome;
     servicoMedicoSet.descricao = descricao;
     servicoMedicoSet.preco = preco;
     return servicoMedicoSet;
 }
 /// <summary>
 /// Deprecated Method for adding a new object to the ServicoMedicoSet EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToServicoMedicoSet(ServicoMedicoSet servicoMedicoSet)
 {
     base.AddObject("ServicoMedicoSet", servicoMedicoSet);
 }
        private void servicoMedicoSetDataGrid_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            if (servicoAnteriorEscolhido == null)
            {
                servicoAnteriorEscolhido = new ServicoMedicoSet();
                servicoAnteriorEscolhido.nome = ((ServicoMedicoSet)dfrServico.CurrentItem).nome;
                servicoAnteriorEscolhido.descricao = ((ServicoMedicoSet)dfrServico.CurrentItem).descricao;
                servicoAnteriorEscolhido.preco = ((ServicoMedicoSet)dfrServico.CurrentItem).preco;
            }

            if (dfrServico.CurrentItem != null)
            {
                if (dfrServico.CancelEdit())
                {
                    if (!((ServicoMedicoSet)dfrServico.CurrentItem).Equals(servicoAnteriorEscolhido))
                    {
                        ((ServicoMedicoSet)dfrServico.CurrentItem).nome = servicoAnteriorEscolhido.nome;
                        ((ServicoMedicoSet)dfrServico.CurrentItem).descricao = servicoAnteriorEscolhido.descricao;
                        ((ServicoMedicoSet)dfrServico.CurrentItem).preco = servicoAnteriorEscolhido.preco;
                    }
                }
                else
                {
                    dfrServico.CurrentItem = servicoMedicoSetDataGrid.SelectedItem;
                }
            }
        }
 private bool FilterServicoMedicoSet(ServicoMedicoSet entity)
 {
     return (entity.codigo == this.ServicoMedicoSet_codigo);
 }
 private void CancelButton_Click(object sender, RoutedEventArgs e)
 {
     novoServico = null;
     dfrNovoServico.CancelEdit();
     this.DialogResult = false;
 }
Exemple #8
0
 /// <summary>
 /// Deprecated Method for adding a new object to the ServicoMedicoSet EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToServicoMedicoSet(ServicoMedicoSet servicoMedicoSet)
 {
     base.AddObject("ServicoMedicoSet", servicoMedicoSet);
 }