usage of vfp code in the back-end of silverswitch applications

14
Uwe Habermann [email protected] Venelina Jordanova [email protected] Usage of VFP code in the back- end of Silverswitch applications

Upload: dylan-potter

Post on 30-Dec-2015

21 views

Category:

Documents


0 download

DESCRIPTION

Usage of VFP code in the back-end of Silverswitch applications. Venelina Jordanova [email protected]. Uwe Habermann [email protected]. VFP COM server. Can be used in any Silverlight application Browser At the client side OOB with elevated trust At the server side At the client side - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Usage  of VFP code in the back-end of  Silverswitch applications

Uwe [email protected]

Venelina [email protected]

Usage of VFP code in the back-end of Silverswitch

applications

Page 2: Usage  of VFP code in the back-end of  Silverswitch applications

VFP COM server

* Can be used in any Silverlight application* Browser

* At the client side

* OOB with elevated trust* At the server side* At the client side

* Silverlight client executes method in VFP COM server

Page 3: Usage  of VFP code in the back-end of  Silverswitch applications

VFP COM server

* Execution of FXP

* Execution of APP

* Advantages:* COM server need not be re-registered* IIS need not be restarted

Page 4: Usage  of VFP code in the back-end of  Silverswitch applications

VFP COM server* Data access

* Cursoradapter* VFP database* SQL database* All ODBC data sources

* MySQL* Oracle* DB2* …

* Set-up database to use

Page 5: Usage  of VFP code in the back-end of  Silverswitch applications

VFP COM server

* Business logic* Everything, but nothing visible

(no user interface)

Page 6: Usage  of VFP code in the back-end of  Silverswitch applications

VFP COM server

* DEFINE CLASS COMTastrade AS SESSION OLEPUBLIC

* Build as “Multi-threaded COM server (dll)”

* VFP9.exe must be started with Administrator rights explicitly!

Page 7: Usage  of VFP code in the back-end of  Silverswitch applications

VFP COM server

DEFINE CLASS COMTastrade AS SESSION OLEPUBLIC

PROCEDURE GetCustomers()USE Customer IN 0 SHARED CURSORTOXML("Customer", "lcXML", 1, 2, 0, "1")USE IN CustomerRETURN lcXML

Page 8: Usage  of VFP code in the back-end of  Silverswitch applications

Use VFP COM server at the server side

* “early binding” in Visual Studio

* COM server must work at development time

* Reference to COM server must be added to the server project

Page 9: Usage  of VFP code in the back-end of  Silverswitch applications

Call a VFP functionprivate void xpgfPageFramePage1cmdProper_Click(

object sender, RoutedEventArgs e){VfxSystemDomainContext context =

new VfxSystemDomainContext();EventHandler handler =

new EventHandler(ExecuteVFPCommand_Completed);var ExecuteVFPCommand = context.ExecuteCommandService("proper", xpgfPageFramePage1txtCustomername.Text.ToString(), VfxAppObject.CurrentConnectionInfo.ClientName);ExecuteVFPCommand.Completed += handler;}

Page 10: Usage  of VFP code in the back-end of  Silverswitch applications

Call a VFP function

void ExecuteVFPCommand_Completed(object sender, EventArgs e)

{var result = sender as InvokeOperation<string>;VfxCommandServiceResultBase ValueResult = (VfxCommandServiceResultBase)VfxSerializer.

DeserializeObject<VfxCommandServiceResultBase> (result.Value);

lblResult.Text = ValueResult.CommandServiceInfo.result;}

Page 11: Usage  of VFP code in the back-end of  Silverswitch applications

Action Button

* Progammatical call of COM server method, procedure or new instanceof an object from the client side

* Call from Button

* Demo

Page 12: Usage  of VFP code in the back-end of  Silverswitch applications

Action Button

* Pass multiple parameters

* Pass data as parameter

Page 13: Usage  of VFP code in the back-end of  Silverswitch applications

Any questions?

Page 14: Usage  of VFP code in the back-end of  Silverswitch applications

Thank you very much and have fun with Silverlight

Venelina & Uwe