Example #1
0
        private void RentOrdering_Click(object sender, EventArgs e)
        {
            var createRent = new RentCreateEdit();

            if (createRent.ShowDialog() == DialogResult.OK)
            {
                using (var context = new ApplicationDBContext())
                {
                    context.AddRent(createRent.Rent);
                }
            }
        }
Example #2
0
        private void EditButton_Click(object sender, EventArgs e)
        {
            var edit = new RentCreateEdit(Rent);

            if (edit.ShowDialog() == DialogResult.OK)
            {
                using (var context = new ApplicationDBContext())
                {
                    context.EditRent(edit.Rent);
                }
                Rent = edit.Rent;
                this.Close();
            }
        }