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); } }
private void btnClose_Click(object sender, EventArgs e) { rentvehiclecontrol.Close(this); rentvehiclecontrol.CloseUseCase(); }