Beispiel #1
0
 /// <summary>
 /// Create a new Lembretes object.
 /// </summary>
 /// <param name="texto">Initial value of the Texto property.</param>
 /// <param name="id">Initial value of the Id property.</param>
 public static Lembretes CreateLembretes(global::System.String texto, global::System.Guid id)
 {
     Lembretes lembretes = new Lembretes();
     lembretes.Texto = texto;
     lembretes.Id = id;
     return lembretes;
 }
Beispiel #2
0
        private void txtAddLembrete_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Enter)
            {
                if (txtAddLembrete.Text.Trim() != "")
                {
                    Lembretes novo = new Lembretes();
                    novo.Id = Guid.NewGuid();
                    novo.Texto = txtAddLembrete.Text.Trim();
                    DBInstance.DB.Lembretes.AddObject(novo);
                    DBInstance.DB.SaveChanges();
                    BindLembretes();

                    txtAddLembrete.Text = "";
                }
                else
                {
                    MessageBox.Show("Atenção!", "Você não pode inserir um lembrete sem antes informar um texto.",
                        MessageBox.MessageBoxButtons.Ok, MessageBox.MessageBoxIcon.Error);
                    txtAddLembrete.Focus();
                }
            }
        }
Beispiel #3
0
 /// <summary>
 /// Deprecated Method for adding a new object to the Lembretes EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToLembretes(Lembretes lembretes)
 {
     base.AddObject("Lembretes", lembretes);
 }