/[H6]/ResultDetailsDialog.cpp
ViewVC logotype

Diff of /ResultDetailsDialog.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 54 by torben, Tue Sep 12 09:09:30 2006 UTC revision 55 by torben, Tue Sep 12 10:15:12 2006 UTC
# Line 204  void ResultDetailsDialog::OnBnClickedChe Line 204  void ResultDetailsDialog::OnBnClickedChe
204          check.m_checkoutMode = true;              check.m_checkoutMode = true;    
205    
206          Reservation  topReservation;          Reservation  topReservation;
207          if (m_equipment.status == "Reserveret") {          if (m_equipment.statusid == StatusReserved) {
208                                    
209                  topReservation = m_equipment.reservations[0];                  topReservation = m_equipment.reservations[0];
210                  check.m_reservedTo = topReservation.inits;                  check.m_reservedTo = topReservation.inits;
# Line 217  void ResultDetailsDialog::OnBnClickedChe Line 217  void ResultDetailsDialog::OnBnClickedChe
217    
218                  Equipment eq;                  Equipment eq;
219                  GetDlgItem(IDC_BARCODE)->GetWindowText(eq.barcode);                  GetDlgItem(IDC_BARCODE)->GetWindowText(eq.barcode);
220                    
221                  dblayer->CheckoutEquipment(p, eq, atoi(check.m_numdays) );                  dblayer->CheckoutEquipment(p, eq, atoi(check.m_numdays) );
222    
223                  if (m_equipment.status == "Reserveret") { //if the equipment was reserved, we must delete the reservation                  if (m_equipment.statusid == StatusReserved) { //if the equipment was reserved, we must delete the reservation
224                          dblayer->DeleteReservation(eq.barcode, topReservation.reservationID);                          dblayer->DeleteReservation(eq.barcode, topReservation.reservationID);
225                  }                  }
226                  this->ReloadData();                  this->ReloadData();
# Line 271  void ResultDetailsDialog::ReloadData(voi Line 271  void ResultDetailsDialog::ReloadData(voi
271  void ResultDetailsDialog::EnableControls(void)  void ResultDetailsDialog::EnableControls(void)
272  {  {
273          if (CommonStorage::Instance()->getAdmin() ) {          if (CommonStorage::Instance()->getAdmin() ) {
274                  if (m_equipment.status == "Ledig") {                  if (m_equipment.statusid == StatusAvailable) {
275                          GetDlgItem(IDC_CHECKOUT)->EnableWindow(true);                          GetDlgItem(IDC_CHECKOUT)->EnableWindow(true);
276                          GetDlgItem(IDC_RETURN)->EnableWindow(false);                          GetDlgItem(IDC_RETURN)->EnableWindow(false);
277                          GetDlgItem(IDC_RESERVE)->EnableWindow(false);                          GetDlgItem(IDC_RESERVE)->EnableWindow(false);
278                  } else if (m_equipment.status == "Udlånt") {                  } else if (m_equipment.statusid == StatusCheckedout) {
279                          GetDlgItem(IDC_CHECKOUT)->EnableWindow(false);                          GetDlgItem(IDC_CHECKOUT)->EnableWindow(false);
280                          GetDlgItem(IDC_RETURN)->EnableWindow(true);                          GetDlgItem(IDC_RETURN)->EnableWindow(true);
281                          GetDlgItem(IDC_RESERVE)->EnableWindow(true);                          GetDlgItem(IDC_RESERVE)->EnableWindow(true);
282                  } else { //m_equipment.status == "Reserveret"                  } else { //m_equipment.statusid == StatusReserved
283                          GetDlgItem(IDC_CHECKOUT)->EnableWindow(true);                          GetDlgItem(IDC_CHECKOUT)->EnableWindow(true);
284                          GetDlgItem(IDC_RETURN)->EnableWindow(false);                          GetDlgItem(IDC_RETURN)->EnableWindow(false);
285                          GetDlgItem(IDC_RESERVE)->EnableWindow(true);                          GetDlgItem(IDC_RESERVE)->EnableWindow(true);

Legend:
Removed from v.54  
changed lines
  Added in v.55

  ViewVC Help
Powered by ViewVC 1.1.20