Exemplo n.º 1
0
        private void btnConfirm_Click(object sender, EventArgs e)
        {
            if (btnConfirm.Enabled == true)
            {
                record.RentStartDate = dateTimePickerRent.Value.Date;
                record.RentalPeriod  = (dateTimePickerDue.Value.Date - dateTimePickerRent.Value.Date).Days;

                using (TransactionScope ts = new TransactionScope())
                {
                    rentvehiclecontrol.UpdateVehicleStatus(record.RentedVehicle);
                    rentvehiclecontrol.CreateRentalRecord(record);
                    ts.Complete();
                }

                MessageBox.Show(VehicleMessage.RentalrRecordSuccessful);
                rentvehiclecontrol.Close(this);
            }
        }
Exemplo n.º 2
0
 private void btnClose_Click(object sender, EventArgs e)
 {
     rentvehiclecontrol.Close(this);
     rentvehiclecontrol.CloseUseCase();
 }