COMPILE FUNCTION Comm_Dialog_Cust_Info(Method, Parm1)

/*
	Commuter module for Dialog_Cust_Info window.
	
	08/06/2004 - John C. Henry, J.C. Henry & Co., Inc.
*/

DECLARE SUBROUTINE Set_Property, End_Dialog, Set_Status, ErrMsg
DECLARE SUBROUTINE obj_Appwindow, Start_Window, Msg
DECLARE FUNCTION Get_Property, Get_Status, Dialog_Box

EQU CRLF$	TO \0D0A\


ErrTitle = 'Error in Comm_Dialog_Cust_Info'
ErrorMsg = ''

Result = ''

BEGIN CASE
	CASE Method = 'Create'			; GOSUB Create
	CASE Method = 'OK'				; GOSUB OK
	CASE Method = 'Cancel'			; GOSUB Cancel
	CASE Method = 'Refresh'			; GOSUB Refresh
	CASE 1
		ErrMsg(ErrTitle:@SVM:'Unknown method ':QUOTE(Method):' passed to routine.')
		
END CASE


RETURN Result


* * * * * * *
Create:
* * * * * * *

obj_AppWindow('Create')

Title 	= Parm1[1,@FM]

Set_Property(@WINDOW,'TEXT',Title)

Vals = FIELD(Parm1,@FM,2,99)
CONVERT @FM TO @RM IN Vals

Ctrls  = @WINDOW:'.COMPANY':@RM		; Props  = 'DEFPROP':@RM
Ctrls := @WINDOW:'.ATTENTION':@RM	; Props := 'DEFPROP':@RM
Ctrls := @WINDOW:'.ADDRESS':@RM		; Props := 'DEFPROP':@RM
Ctrls := @WINDOW:'.CITY':@RM		; Props := 'DEFPROP':@RM
Ctrls := @WINDOW:'.ST':@RM			; Props := 'DEFPROP':@RM
Ctrls := @WINDOW:'.ZIP':@RM			; Props := 'DEFPROP':@RM
Ctrls := @WINDOW:'.COUNTRY'			; Props := 'DEFPROP'

Set_Property(Ctrls,Props,Vals)


RETURN


* * * * * * *
Refresh:
* * * * * * *


RETURN



* * * * * * *
Close:
* * * * * * *


* * * * * * *
Cancel:
* * * * * * *

End_Dialog(@WINDOW,'Cancel')

RETURN



* * * * * * *
OK:
* * * * * * *

Ctrls  = @WINDOW:'.COMPANY':@RM		; Props  = 'DEFPROP':@RM
Ctrls := @WINDOW:'.ATTENTION':@RM	; Props := 'DEFPROP':@RM
Ctrls := @WINDOW:'.ADDRESS':@RM		; Props := 'DEFPROP':@RM
Ctrls := @WINDOW:'.CITY':@RM		; Props := 'DEFPROP':@RM
Ctrls := @WINDOW:'.ST':@RM			; Props := 'DEFPROP':@RM
Ctrls := @WINDOW:'.ZIP':@RM			; Props := 'DEFPROP':@RM
Ctrls := @WINDOW:'.COUNTRY'			; Props := 'DEFPROP'

Vals = Get_Property(Ctrls,Props)

CONVERT @RM TO @FM IN Vals

Addr = Vals<3>

LOOP
UNTIL Addr[-1,1] NE @TM OR Addr = ''
	Addr[-1,1] = ''
REPEAT

Vals<3> = Addr
CONVERT @FM TO @RM IN Vals

End_Dialog(@WINDOW,Vals)

RETURN


