public Sale(double txValue, Card card, string password) { this.Value = txValue; this.Card = card; this.Password = password; this.DateTimeSale = DateTime.Now; }
private void timer_Tick(object sender, EventArgs e) { if (this.InvokeRequired) { /* Not on UI thread, reenter there... */ this.BeginInvoke(new EventHandler(timer_Tick), sender, e); } else { lock (timer) { /* only work when this is no reentry while we are already working */ if (this.timer.Enabled) { this.timer.Stop(); this.ReturnValueCard = new Card(this.label2.Text, 123); this.DialogResult = DialogResult.OK; this.Close(); } } } }
public void Update(Card card) { ITransaction transacao = session.BeginTransaction(); session.Update(card); transacao.Commit(); }
public void Add(Card card) { ITransaction transacao = session.BeginTransaction(); session.Save(card); transacao.Commit(); }
private void buttonCard_Click(object sender, EventArgs e) { double value; if (double.TryParse(textBoxValue.Text, out value)) { FormCard formCard = new FormCard(); DialogResult showFormCard; this.Hide(); showFormCard = formCard.ShowDialog(); if (showFormCard == DialogResult.OK) { this.card = formCard.ReturnValueCard; PasswordForm passwordForm = new PasswordForm(); this.Hide(); showFormCard = passwordForm.ShowDialog(); if (showFormCard == DialogResult.OK) { this.password = passwordForm.ReturnValuePassword; Sale sale = new Sale(value, this.card, this.password); MessageBox.Show(sale.send()); this.Close(); } } else this.Show(); } else MessageBox.Show("Insira um valor válido."); }