Garmin Fleet Management Controller  2.19.0
CAobrdDriverShipmentsDlg.cpp
Go to the documentation of this file.
1 /*********************************************************************
2 *
3 * MODULE NAME:
4 * CAobrdDriverShipmentsDlg.cpp
5 *
6 * Copyright 2012 by Garmin Ltd. or its subsidiaries.
7 *---------------------------------------------------------------------
8 * $NoKeywords$
9 *********************************************************************/
10 #include "stdafx.h"
11 #include "CFmiApplication.h"
13 #include "util.h"
14 #include "garmin_types.h"
15 
16 using namespace std;
17 
18 IMPLEMENT_DYNAMIC(CAobrdDriverShipmentsDlg, CDialog)
19 
20 BEGIN_MESSAGE_MAP( CAobrdDriverShipmentsDlg, CDialog )
21  ON_BN_CLICKED( IDC_DRIVER_SHIPMENTS_BTN_NEW, OnBnClickedNew )
22  ON_BN_CLICKED( IDC_DRIVER_SHIPMENTS_BTN_DELETE, OnBnClickedDelete )
23  ON_BN_CLICKED( IDC_DRIVER_SHIPMENTS_BTN_SET, OnBnClickedSet )
24  ON_EN_CHANGE( IDC_DRIVER_SHIPMENTS_EDIT_SHIPPER, OnChangeShipmentData )
25  ON_EN_CHANGE( IDC_DRIVER_SHIPMENTS_EDIT_DOC_NUM, OnChangeShipmentData )
26  ON_EN_CHANGE( IDC_DRIVER_SHIPMENTS_EDIT_COMMODITY, OnChangeShipmentData )
27  ON_EN_CHANGE( IDC_DRIVER_SHIPMENTS_TIMESTAMP_DATE, OnChangeShipmentData )
28  ON_EN_CHANGE( IDC_DRIVER_SHIPMENTS_TIMESTAMP_TIME, OnChangeShipmentData )
29  ON_EN_CHANGE( IDC_DRIVER_SHIPMENTS_START_TIME_DATE, OnChangeShipmentData )
30  ON_EN_CHANGE( IDC_DRIVER_SHIPMENTS_START_TIME_TIME, OnChangeShipmentData )
31  ON_EN_CHANGE( IDC_DRIVER_SHIPMENTS_END_TIME_DATE, OnChangeShipmentData )
32  ON_EN_CHANGE( IDC_DRIVER_SHIPMENTS_END_TIME_TIME, OnChangeShipmentData )
33  ON_BN_CLICKED( IDOK, OnBnClickedOk )
34  ON_EN_SETFOCUS( IDC_DRIVER_SHIPMENTS_EDIT_SHIPPER, OnEnSetfocusLoginEdit )
35  ON_EN_KILLFOCUS( IDC_DRIVER_SHIPMENTS_EDIT_SHIPPER, OnEnKillfocusLoginEdit )
36  ON_EN_SETFOCUS( IDC_DRIVER_SHIPMENTS_EDIT_DOC_NUM, OnEnSetfocusLoginEdit )
37  ON_EN_KILLFOCUS( IDC_DRIVER_SHIPMENTS_EDIT_DOC_NUM, OnEnKillfocusLoginEdit )
38  ON_EN_SETFOCUS( IDC_DRIVER_SHIPMENTS_EDIT_COMMODITY, OnEnSetfocusLoginEdit )
39  ON_EN_KILLFOCUS( IDC_DRIVER_SHIPMENTS_EDIT_COMMODITY, OnEnKillfocusLoginEdit )
40  ON_NOTIFY( NM_SETFOCUS, IDC_DRIVER_SHIPMENTS_TIMESTAMP_DATE, OnDateTimeCtrlSetFocus )
41  ON_NOTIFY( NM_KILLFOCUS, IDC_DRIVER_SHIPMENTS_TIMESTAMP_DATE, OnDateTimeCtrlKillFocus )
42  ON_NOTIFY( NM_SETFOCUS, IDC_DRIVER_SHIPMENTS_TIMESTAMP_TIME, OnDateTimeCtrlSetFocus )
43  ON_NOTIFY( NM_KILLFOCUS, IDC_DRIVER_SHIPMENTS_TIMESTAMP_TIME, OnDateTimeCtrlKillFocus )
44  ON_NOTIFY( NM_SETFOCUS, IDC_DRIVER_SHIPMENTS_START_TIME_DATE, OnDateTimeCtrlSetFocus )
45  ON_NOTIFY( NM_KILLFOCUS, IDC_DRIVER_SHIPMENTS_START_TIME_DATE, OnDateTimeCtrlKillFocus )
46  ON_NOTIFY( NM_SETFOCUS, IDC_DRIVER_SHIPMENTS_START_TIME_TIME, OnDateTimeCtrlSetFocus )
47  ON_NOTIFY( NM_KILLFOCUS, IDC_DRIVER_SHIPMENTS_START_TIME_TIME, OnDateTimeCtrlKillFocus )
48  ON_NOTIFY( NM_SETFOCUS, IDC_DRIVER_SHIPMENTS_END_TIME_DATE, OnDateTimeCtrlSetFocus )
49  ON_NOTIFY( NM_KILLFOCUS, IDC_DRIVER_SHIPMENTS_END_TIME_DATE, OnDateTimeCtrlKillFocus )
50  ON_NOTIFY( NM_SETFOCUS, IDC_DRIVER_SHIPMENTS_END_TIME_TIME, OnDateTimeCtrlSetFocus )
51  ON_NOTIFY( NM_KILLFOCUS, IDC_DRIVER_SHIPMENTS_END_TIME_TIME, OnDateTimeCtrlKillFocus )
52  ON_LBN_SELCHANGE( IDC_DRIVER_SHIPMENTS_LST_SHIPMENTS, OnLbnSelchangeShipmentList )
53  ON_LBN_SETFOCUS( IDC_DRIVER_SHIPMENTS_LST_SHIPMENTS, OnLbnSetfocusShipmentList )
54  ON_LBN_KILLFOCUS( IDC_DRIVER_SHIPMENTS_LST_SHIPMENTS, OnLbnKillfocusShipmentList )
55 END_MESSAGE_MAP()
56 
57 //----------------------------------------------------------------------
61 //----------------------------------------------------------------------
62 BOOL CAobrdDriverShipmentsDlg::ShowShipments( CWnd * aParent, AobrdDriverItem * aDriver )
63 {
64  CAobrdDriverShipmentsDlg dlg( aParent, aDriver );
65  INT_PTR r = dlg.DoModal();
66  return ( IDOK == r );
67 }
68 
69 //----------------------------------------------------------------------
73 //----------------------------------------------------------------------
75  (
76  CWnd * aParent,
77  AobrdDriverItem * aDriver
78  )
79  : CDialog( IDD_AOBRD_DRIVER_SHIPMENTS, aParent )
80  , mDriver( aDriver )
81  , mSelectedIndex( -1 )
82  , mShipperName( _T("") )
83  , mDocumentNumber( _T("") )
84  , mCommodity( _T("") )
85  , mTimestampDate( COleDateTime::GetCurrentTime() )
86  , mTimestampTime( COleDateTime::GetCurrentTime() )
87  , mStartTimeDate( COleDateTime::GetCurrentTime() )
88  , mStartTimeTime( COleDateTime::GetCurrentTime() )
89  , mEndTimeDate( COleDateTime::GetCurrentTime() )
90  , mEndTimeTime( COleDateTime::GetCurrentTime() )
91 {
92 }
93 
94 //----------------------------------------------------------------------
96 //----------------------------------------------------------------------
98 {
99 }
100 
101 //----------------------------------------------------------------------
104 //----------------------------------------------------------------------
106  (
107  CDataExchange * aDataExchange
108  )
109 {
110  CDialog::DoDataExchange( aDataExchange );
111  DDX_Control( aDataExchange, IDC_DRIVER_SHIPMENTS_LST_SHIPMENTS, mListBox );
112  DDX_Text( aDataExchange, IDC_DRIVER_SHIPMENTS_EDIT_SHIPPER, mShipperName );
113  DDX_Text( aDataExchange, IDC_DRIVER_SHIPMENTS_EDIT_DOC_NUM, mDocumentNumber );
114  DDX_Text( aDataExchange, IDC_DRIVER_SHIPMENTS_EDIT_COMMODITY, mCommodity );
115  DDX_DateTimeCtrl( aDataExchange, IDC_DRIVER_SHIPMENTS_TIMESTAMP_DATE, mTimestampDate );
116  DDX_DateTimeCtrl( aDataExchange, IDC_DRIVER_SHIPMENTS_TIMESTAMP_TIME, mTimestampTime );
117  DDX_DateTimeCtrl( aDataExchange, IDC_DRIVER_SHIPMENTS_START_TIME_DATE, mStartTimeDate );
118  DDX_DateTimeCtrl( aDataExchange, IDC_DRIVER_SHIPMENTS_START_TIME_TIME, mStartTimeTime );
119  DDX_DateTimeCtrl( aDataExchange, IDC_DRIVER_SHIPMENTS_END_TIME_DATE, mEndTimeDate );
120  DDX_DateTimeCtrl( aDataExchange, IDC_DRIVER_SHIPMENTS_END_TIME_TIME, mEndTimeTime );
121 } /* DoDataExchange */
122 
123 //----------------------------------------------------------------------
129 //----------------------------------------------------------------------
131 {
132  CDialog::OnInitDialog();
133 
134  updateListBox();
135 
136  GetDlgItem( IDC_DRIVER_SHIPMENTS_BTN_NEW )->EnableWindow( FALSE );
137  GetDlgItem( IDC_DRIVER_SHIPMENTS_BTN_DELETE )->EnableWindow( FALSE );
138 
139  SetWindowPos( NULL, 700, 350, 0, 0, SWP_NOSIZE | SWP_NOZORDER );
140 
141  ( ( CEdit* ) GetDlgItem( IDC_DRIVER_SHIPMENTS_EDIT_SHIPPER ) )->LimitText( 39 );
142  ( ( CEdit* ) GetDlgItem( IDC_DRIVER_SHIPMENTS_EDIT_DOC_NUM ) )->LimitText( 39 );
143  ( ( CEdit* ) GetDlgItem( IDC_DRIVER_SHIPMENTS_EDIT_COMMODITY ) )->LimitText( 39 );
144 
145  CString title;
146  title.Format( _T( "AOBRD Driver Shipments for %s %s (%s)" ), mDriver->getFirstName(), mDriver->getLastName(), mDriver->getDriverId() );
147  SetWindowText( title );
148 
149  return TRUE;
150 } /* OnInitDialog */
151 
152 //----------------------------------------------------------------------
154 //----------------------------------------------------------------------
156 {
157  mShipperName = _T( "" );
158  mDocumentNumber = _T( "" );
159  mCommodity = _T( "" );
160  mTimestampDate = COleDateTime::GetCurrentTime();
161  mTimestampTime = COleDateTime::GetCurrentTime();
162  mStartTimeDate = COleDateTime::GetCurrentTime();
163  mStartTimeTime = COleDateTime::GetCurrentTime();
164  mEndTimeDate = COleDateTime::GetCurrentTime();
165  mEndTimeTime = COleDateTime::GetCurrentTime();
166 } /* clearData */
167 
168 //----------------------------------------------------------------------
171 //----------------------------------------------------------------------
173 {
174  CString listItem;
175 
176  //must keep track of where the list was scrolled to
177  //since we reset content we must reinitialize these
178  mSelectedIndex = mListBox.GetCurSel();
179  int topIndex = mListBox.GetTopIndex();
180 
181  //reset content and then add current drivers
182  mListBox.ResetContent();
183 
184  std::vector<AobrdShipment> shipments = mDriver->getShipments();
185  std::vector<AobrdShipment>::iterator iter;
186 
187  for( iter = shipments.begin(); iter != shipments.end(); ++iter )
188  {
189  AobrdShipment shipment = ( *iter );
190  listItem.Format( _T( "%s, %s, %s" ), shipment.getShipperName(), shipment.getDocNumber(), shipment.getCommodity() );
191  mListBox.AddString( listItem );
192  }
193 
194  //reset scroll and selection
195  mSelectedIndex = -1;
196 
197  //reset scroll and selection
198  mListBox.SetCurSel( mSelectedIndex );
199  mListBox.SetTopIndex( topIndex );
200 
201 } /* updateListBox */
202 
203 //----------------------------------------------------------------------
207 //----------------------------------------------------------------------
209 {
210  UpdateData( TRUE );
211 
212  mSelectedIndex = -1;
213 
214  clearData();
215 
216  mListBox.SetCurSel( mSelectedIndex );
217 
218  GetDlgItem( IDC_DRIVER_SHIPMENTS_BTN_NEW )->EnableWindow( FALSE );
219  GetDlgItem( IDC_DRIVER_SHIPMENTS_BTN_DELETE )->EnableWindow( FALSE );
220  GetDlgItem( IDC_DRIVER_SHIPMENTS_BTN_SET )->EnableWindow( FALSE );
221 
222  UpdateData( FALSE );
223 } /* OnBnClickedNew */
224 
225 //----------------------------------------------------------------------
228 //----------------------------------------------------------------------
230 {
231  UpdateData( TRUE );
232  if( mSelectedIndex >= 0 )
233  {
234  mDriver->deleteShipment( mSelectedIndex );
235  updateListBox();
236  }
237 
238  if( mSelectedIndex < 0 )
239  {
240  GetDlgItem( IDC_DRIVER_SHIPMENTS_BTN_NEW )->EnableWindow( FALSE );
241  GetDlgItem( IDC_DRIVER_SHIPMENTS_BTN_DELETE )->EnableWindow( FALSE );
242  GetDlgItem( IDC_DRIVER_SHIPMENTS_BTN_SET )->EnableWindow( FALSE );
243  clearData();
244  }
245 
246  UpdateData(FALSE);
247 
248 } /* OnBnClickedDelete */
249 
250 //----------------------------------------------------------------------
252 //----------------------------------------------------------------------
253 static time_type convertToTimeType( COleDateTime & datePart, COleDateTime & timePart )
254 {
255  date_time_data_type date_time;
256  time_type time, date;
257  time_type timestamp;
258  date_time.date.year = ( uint16 ) ( 0xFFFF & datePart.GetYear() );
259  date_time.date.month = ( uint8 ) ( 0x00FF & datePart.GetMonth() );
260  date_time.date.day = ( uint8 ) ( 0x00FF & datePart.GetDay() );
261  date_time.time.hour = ( sint16 ) ( 0xFFFF & timePart.GetHour() );
262  date_time.time.minute = ( uint8 ) ( 0x00FF & timePart.GetMinute() );
263  date_time.time.second = ( uint8 ) ( 0x00FF & timePart.GetSecond() );
264  UTIL_convert_time_type_to_seconds( &date_time, &time );
265  UTIL_convert_date_time_to_seconds( &date_time, &date );
266  timestamp = date + time;
267  UTIL_convert_local_to_UTC( &timestamp, &timestamp );
268  return timestamp;
269 } /* convertToTimeType */
270 
271 //----------------------------------------------------------------------
273 //----------------------------------------------------------------------
274 static COleDateTime convertFromTimeType( time_type aTimestamp )
275 {
276  date_time_data_type date_time;
277  UTIL_convert_UTC_to_local( &aTimestamp, &aTimestamp );
278  UTIL_convert_seconds_to_date_type( &aTimestamp, &date_time );
279  UTIL_convert_seconds_to_time_type( &aTimestamp, &date_time );
280  if( 0 == date_time.time.hour )
281  {
282  date_time.time.hour = 12;
283  }
284 
285  COleDateTime dt(
286  date_time.date.year, date_time.date.month, date_time.date.day,
287  date_time.time.hour, date_time.time.minute, date_time.time.second
288  );
289 
290  return dt;
291 } /* convertFromTimeType */
292 
293 //----------------------------------------------------------------------
296 //----------------------------------------------------------------------
298 {
299  UpdateData( TRUE );
300 
301  AobrdShipment shipment;
302  if( 0 <= mSelectedIndex )
303  {
304  shipment = mDriver->getShipments().at( mSelectedIndex );
305  }
306 
307  char shipperName[40];
308  char docNumber[40];
309  char commodity[40];
310 
311  WideCharToMultiByte( CP_UTF8, 0, mShipperName, -1, shipperName, sizeof( shipperName ), NULL, NULL );
312  WideCharToMultiByte( CP_UTF8, 0, mDocumentNumber, -1, docNumber, sizeof( docNumber ), NULL, NULL );
313  WideCharToMultiByte( CP_UTF8, 0, mCommodity, -1, commodity, sizeof( commodity ), NULL, NULL );
314 
315  shipment.setShipperName( shipperName );
316  shipment.setDocNumber( docNumber );
317  shipment.setCommodity( commodity );
318 
319  shipment.setServerTimestamp( convertToTimeType( mTimestampDate, mTimestampTime ) );
320  shipment.setServerStartTime( convertToTimeType( mStartTimeDate, mStartTimeTime ) );
321  shipment.setServerEndTime( convertToTimeType( mEndTimeDate, mEndTimeTime ) );
322 
323  if( 0 <= mSelectedIndex )
324  {
325  mDriver->replaceShipment( shipment, mSelectedIndex );
326  }
327  else
328  {
329  mDriver->addShipment( shipment );
330  }
331 
332  updateListBox();
333  clearData();
334  UpdateData( FALSE );
335 
336 } /* OnBnClickedSet */
337 
338 //----------------------------------------------------------------------
342 //----------------------------------------------------------------------
344 {
345  UpdateData( TRUE );
346  if( ( "" != mShipperName ) && ( "" != mDocumentNumber ) &&
347  ( "" != mCommodity ) &&
348  ( COleDateTime::valid == mTimestampDate.GetStatus() ) && ( COleDateTime::valid == mTimestampTime.GetStatus() ) &&
349  ( COleDateTime::valid == mStartTimeDate.GetStatus() ) && ( COleDateTime::valid == mStartTimeTime.GetStatus() ) &&
350  ( COleDateTime::valid == mEndTimeDate.GetStatus() ) && ( COleDateTime::valid == mEndTimeTime.GetStatus() ) )
351  {
352  GetDlgItem( IDC_DRIVER_SHIPMENTS_BTN_SET )->EnableWindow( TRUE );
353  }
354  else
355  {
356  GetDlgItem( IDC_DRIVER_SHIPMENTS_BTN_SET )->EnableWindow( FALSE );
357  }
358 } /* OnChangeShipmentData */
359 
360 
361 //----------------------------------------------------------------------
365 //----------------------------------------------------------------------
367 {
368  CListBox * listBox = ( CListBox* ) GetDlgItem( IDC_DRIVER_SHIPMENTS_LST_SHIPMENTS );
369  mSelectedIndex = listBox->GetCurSel();
370 
371  if( mSelectedIndex >= 0 && mSelectedIndex < listBox->GetCount() )
372  {
373  AobrdShipment shipment = mDriver->getShipments().at( mSelectedIndex );
374 
375  mShipperName = shipment.getShipperName();
376  mDocumentNumber = shipment.getDocNumber();
377  mCommodity = shipment.getCommodity();
378 
379  mTimestampDate = mTimestampTime = convertFromTimeType( shipment.getServerTimestamp() );
380  mStartTimeDate = mStartTimeTime = convertFromTimeType( shipment.getServerStartTime() );
381  mEndTimeDate = mEndTimeTime = convertFromTimeType( shipment.getServerEndTime() );
382 
383  UpdateData( FALSE );
384  GetDlgItem( IDC_DRIVER_SHIPMENTS_BTN_NEW )->EnableWindow( TRUE );
385  GetDlgItem( IDC_DRIVER_SHIPMENTS_BTN_DELETE )->EnableWindow( TRUE );
386 
387  OnChangeShipmentData();
388  }
389  else
390  {
391  GetDlgItem( IDC_DRIVER_SHIPMENTS_BTN_NEW )->EnableWindow( FALSE );
392  GetDlgItem( IDC_DRIVER_SHIPMENTS_BTN_DELETE )->EnableWindow( FALSE );
393  }
394 
395  listBox->SetCurSel( mSelectedIndex );
396 } /* OnLbnSelchangeShipmentList */
397 
398 //----------------------------------------------------------------------
401 //----------------------------------------------------------------------
403 {
404  CDialog::OnOK();
405 } /* OnBnClickedOk */
406 
407 //----------------------------------------------------------------------
410 //----------------------------------------------------------------------
412 {
413  CDialog::OnCancel();
414 } /* OnCancel */
415 
416 //----------------------------------------------------------------------
419 //----------------------------------------------------------------------
421 {
422  CDialog::PostNcDestroy();
423 } /* PostNcDestroy */
424 
425 //----------------------------------------------------------------------
430 //----------------------------------------------------------------------
432 {
433  SendMessage( DM_SETDEFID, IDC_DRIVER_SHIPMENTS_BTN_SET );
434 } /* OnEnSetfocusLoginEdit */
435 
436 //----------------------------------------------------------------------
440 //----------------------------------------------------------------------
442 {
443  SendMessage( DM_SETDEFID, IDC_DRIVER_SHIPMENTS_BTN_SET );
444 } /* OnDateTimeCtrlSetFocus */
445 
446 //----------------------------------------------------------------------
451 //----------------------------------------------------------------------
453 {
454  SendMessage( DM_SETDEFID, IDOK );
455 } /* OnEnKillfocusLoginEdit */
456 
457 //----------------------------------------------------------------------
461 //----------------------------------------------------------------------
463 {
464  SendMessage( DM_SETDEFID, IDOK );
465 } /* OnDateTimeCtrlKillFocus */
466 
467 //----------------------------------------------------------------------
471 //----------------------------------------------------------------------
473 {
474  SendMessage( DM_SETDEFID, IDC_DRIVER_SHIPMENTS_BTN_DELETE );
475 } /* OnLbnSetfocusShipmentList */
476 
477 //----------------------------------------------------------------------
481 //----------------------------------------------------------------------
483 {
484  SendMessage( DM_SETDEFID, IDOK );
485 } /* OnLbnKillfocusShipmentList */
486 
void setServerEndTime(const time_type &aTimestamp)
Set the Server End Time for this item.
struct date_time_data_type::_date date
afx_msg void OnBnClickedSet()
Button handler for the Set button.
void setDocNumber(const std::string &aDocNumber)
Set the Document Number for this item.
uint8 second
second (0-59)
Definition: garmin_types.h:162
void setServerTimestamp(const time_type &aTimestamp)
Set the Server Timestamp for this item.
#define IDC_DRIVER_SHIPMENTS_START_TIME_DATE
Definition: resource.h:423
Data structure to holds an AOBRD shipment info. Used by the FmiApplicationLayer to provision shipment...
Definition: AobrdShipment.h:23
time_type getServerTimestamp() const
Get item&#39;s server timestamp.
#define IDC_DRIVER_SHIPMENTS_EDIT_DOC_NUM
Definition: resource.h:418
uint8 minute
minute (0-59)
Definition: garmin_types.h:161
void setCommodity(const std::string &aCommodity)
Set the Commodity for this item.
#define IDC_DRIVER_SHIPMENTS_TIMESTAMP_DATE
Definition: resource.h:421
#define IDC_DRIVER_SHIPMENTS_TIMESTAMP_TIME
Definition: resource.h:420
STL namespace.
afx_msg void OnDateTimeCtrlKillFocus(NMHDR *pNotifyStruct, LRESULT *result)
Handles the kill focus event for date time controls.
#define FALSE
Definition: garmin_types.h:46
afx_msg void OnLbnSelchangeShipmentList()
Selection Changed handler for the Shipments List box.
struct date_time_data_type::_time time
void UTIL_convert_time_type_to_seconds(const date_time_data_type *aDateTime, time_type *aSeconds)
Converts a time_type to seconds since midnight.
Definition: util.cpp:295
#define IDC_DRIVER_SHIPMENTS_BTN_DELETE
Definition: resource.h:409
afx_msg void OnBnClickedNew()
Button handler for the New button.
#define TRUE
Definition: garmin_types.h:45
void UTIL_convert_seconds_to_time_type(const time_type *aSeconds, date_time_data_type *aDateTime)
Converts from a Garmin time to a structure containing separate members for hour, minute, and second (time_type).
Definition: util.cpp:274
signed short int sint16
16-bit signed integer
Definition: garmin_types.h:57
Date & time data type with separate fields for month, day, year, hour, minute, and second...
Definition: garmin_types.h:150
time_type getServerStartTime() const
Get item&#39;s server start time.
virtual void DoDataExchange(CDataExchange *pDX)
Perform dialog data exchange and validation.
CString getShipperName() const
Get item&#39;s shipper name.
void setServerStartTime(const time_type &aTimestamp)
Set the Server Start Time for this item.
#define IDC_DRIVER_SHIPMENTS_EDIT_SHIPPER
Definition: resource.h:417
void updateListBox()
Update the shipments list box from the list owned by the driver.
virtual ~CAobrdDriverShipmentsDlg()
Destructor.
BOOL OnInitDialog()
This function is called when the window is created.
void UTIL_convert_seconds_to_date_type(const time_type *aSeconds, date_time_data_type *aDateTime)
Converts a Garmin date to a structure containing year, month, and day.
Definition: util.cpp:39
#define IDC_DRIVER_SHIPMENTS_END_TIME_TIME
Definition: resource.h:424
#define IDC_DRIVER_SHIPMENTS_END_TIME_DATE
Definition: resource.h:425
boolean UTIL_convert_date_time_to_seconds(const date_time_data_type *aDateTime, time_type *aSeconds)
Converts a date from from a structure to a Garmin date.
Definition: util.cpp:114
#define IDC_DRIVER_SHIPMENTS_BTN_NEW
Definition: resource.h:428
CString getCommodity() const
Get item&#39;s commodity.
unsigned short int uint16
16-bit unsigned integer
Definition: garmin_types.h:64
afx_msg void OnEnKillfocusLoginEdit()
Handles the kill focus event for the driver ID and password edit boxes.
#define IDC_DRIVER_SHIPMENTS_LST_SHIPMENTS
Definition: resource.h:426
#define IDC_DRIVER_SHIPMENTS_START_TIME_TIME
Definition: resource.h:422
afx_msg void OnLbnSetfocusShipmentList()
Handles the set focus event for the driver list.
static time_type convertToTimeType(COleDateTime &datePart, COleDateTime &timePart)
Convert COleDateTime pairs to time_type.
Data structure to holds an AOBRD driver info. Used by the FmiApplicationLayer to validate logins when...
void PostNcDestroy()
Called by MFC after the window has been destroyed; performs final termination activities.
uint16 year
Real year (1990 means 1990!)
Definition: garmin_types.h:156
afx_msg void OnEnSetfocusLoginEdit()
Handles the set focus event for the driver ID and password edit boxes.
#define IDC_DRIVER_SHIPMENTS_BTN_SET
Definition: resource.h:427
afx_msg void OnBnClickedOk()
Button handler for the OK button.
uint8 month
month (1-12)
Definition: garmin_types.h:154
unsigned char uint8
8-bit unsigned integer
Definition: garmin_types.h:62
#define IDD_AOBRD_DRIVER_SHIPMENTS
Definition: resource.h:51
void setShipperName(const std::string &aShipperName)
Set the Shipper Name for this item.
static COleDateTime convertFromTimeType(time_type aTimestamp)
Convert time_type to COleDateTime for use with CDateTimeCtrl.
time_type getServerEndTime() const
Get item&#39;s server end time.
#define IDC_DRIVER_SHIPMENTS_EDIT_COMMODITY
Definition: resource.h:419
afx_msg void OnBnClickedDelete()
Button handler for the Delete button.
afx_msg void OnDateTimeCtrlSetFocus(NMHDR *pNotifyStruct, LRESULT *result)
Handles the set focus event for any date time ctrl.
void UTIL_convert_UTC_to_local(const time_type *aUtcTime, time_type *aLocalTime)
Converts a time_type from UTC to local time.
Definition: util.cpp:526
CAobrdDriverShipmentsDlg(CWnd *aParent, AobrdDriverItem *aDriver)
Constructor.
uint32 time_type
Absolute time (number of seconds since 12/31/1989 12:00 am UTC)
Definition: garmin_types.h:97
afx_msg void OnCancel()
Handler for the Cancel action.
void clearData()
Clear values from the editable fields.
Dialog allowing the user to manage AOBRD driver shipments.
afx_msg void OnLbnKillfocusShipmentList()
Handles the kill focus event for the driver list.
sint16 hour
hour (0-65535), range required for correct ETE conversion
Definition: garmin_types.h:160
void UTIL_convert_local_to_UTC(const time_type *aLocalTime, time_type *aUtcTime)
Converts a time_type from local to UTC time.
Definition: util.cpp:549
afx_msg void OnChangeShipmentData()
Edit/Change handler for the shipment-specific data controls.
CString getDocNumber() const
Get item&#39;s document number.