SambaPOS Forum

English Boards => Tutorials => Topic started by: JohnS on February 01, 2012, 06:32:21 am

Title: SambaPOS Training Mode
Post by: JohnS on February 01, 2012, 06:32:21 am
Welcome to SambaPOS Training Mode.

What I have created is a tool to enable a SambaPOS Training Mode on SambaPOS.
What the tool actually does is to copy the SambaPOS Microsoft SQL Express 2005/2008 Server instance or Microsoft Compact SQL Server database to a Microsoft Compact SQL Server database file called SambaTrain.sdf, and change the SambaPOS data source settings automatically with the click of a single icon and once you exit SambaPOS, the data source settings are returned to the live settings.

Latest version - V4.0 - http://forum2.sambapos.org/index.php/topic,184.msg6222.html#msg6222 (http://forum2.sambapos.org/index.php/topic,184.msg6222.html#msg6222)


You can also have the database refresh each time you run SambaPOS Training Mode, or to refresh on-demand if you are developing new features, or expanding the POS system.

Title: Re: SambaPOS Training Mode
Post by: jenem on February 01, 2012, 08:32:50 am
Cheers John,

I'll try it out later.

By the way, Thanks!

Edgar
Title: Re: SambaPOS Training Mode
Post by: emre on February 02, 2012, 03:34:20 am
John your latest update is a big improvement and that makes you a SambaPOS Dev :)
I want to include your script in SambaPOS setup. Is it possible to get rid of c:\sambatrain and use current directory instead?
Title: Re: SambaPOS Training Mode
Post by: JohnS on February 02, 2012, 03:49:27 am
I was thinking the same.

Do you want it in a sub directory under SambaPOS2 called Training or just in the main directory?
Title: Re: SambaPOS Training Mode
Post by: emre on February 02, 2012, 03:58:57 am
It will be fine if it works under a sub directory. If it helps during setup I can call install.vbs with current installation directory information or anything else.
Title: Re: SambaPOS Training Mode
Post by: JohnS on February 02, 2012, 04:12:35 am
The install script is designed to be run once you have SambaPOS up and running in your production environment.

As it is right now, if you change the database connection or location of the SambaSettings.txt file, after you have run install.vbs, the training scripts will not work.
I will change this to read the settings each time you run training mode, that way if you change databases or location of the settings file, it will work it out and run training mode.
Title: Re: SambaPOS Training Mode
Post by: JohnS on February 02, 2012, 09:54:43 am
Emre,

Well its at V3.0 now. Rewrote most of it so it's now just one script to do everything.
The script discovers its location and folder name, but it has to be placed in a sub directory under SambaPOS2 to work.

Test it, and let me know if you have any issues.

Features
- Will work with SQL Server Compact & SQL Server Express Databases (both local and networked)
- Checks if SQL Compact Server is installed
- Dynamic execution - no configuration required

Title: Re: SambaPOS Training Mode
Post by: emre on February 02, 2012, 10:11:26 am
On my first test it worked great... Really good idea, awesome solution.
I'll test it more but I think it is ready for next release.. Thank you very much!
Title: Re: SambaPOS Training Mode
Post by: emre on February 08, 2012, 10:59:10 am
For the record: Training script included in setup.
Title: Re: SambaPOS Training Mode
Post by: jenem on February 09, 2012, 12:50:36 am
Hi John,
Tried running training mode today and got error shown on screen shot.

What are the conditions for the script to work.

Could it be because I have sql server and sql compact on my laptop?

Edgar
Title: Re: SambaPOS Training Mode
Post by: JohnS on February 09, 2012, 01:39:08 am
Edgar,

Its a file permission error.

You need SQL CE on the system to run training mode. Both MS SQL & SQL CE can exist on the same system.
Are you logged in as an administrator or restricted user?

Try this
1. Log into SambaPOS, go to Local Settings and make sure you are using MS SQL and not CE and exit.
2. Run Training.vbs again

I just tested and it has worked fine, but I did need to log into SambaPOS first.
Title: Re: SambaPOS Training Mode
Post by: JohnS on February 12, 2012, 10:43:45 pm
Updated version to fix file permission errors on restricted user accounts.

I have tested on both Win 7 and Server 2003 with both standard and administrator accounts.
Please let me know if you have any issues.

Notes
- Training Compact SQL file is now located in the same folder as SambaSettings.txt file.
- Training SQL file called SambaTrain.sdf
Title: Re: SambaPOS Training Mode
Post by: emre on February 14, 2012, 04:45:00 am
Thank you John. Good solution.
I'll update your script on next release.
Title: Re: SambaPOS Training Mode
Post by: jenem on February 14, 2012, 07:49:11 am
Hi John,

Run training mode script shortcut on desk top and found sambapos would start up in normal mode, ie ticket no would increment and when I restarted Sambapos from normal shortcut, found the next ticket no was incremented the last ticket no generated in training mode.

Edgar
Title: Re: SambaPOS Training Mode
Post by: JohnS on February 14, 2012, 07:55:53 am
Edgar,

Are you running Compact SQL ? If so, whats the location of your sdf file.
Whats the location of your SambaSettings.txt file ?
Title: Re: SambaPOS Training Mode
Post by: jenem on February 15, 2012, 01:50:35 am
Hi John,

C:\Users\Edgar\Documents\SambaPOS2

SQL Server compact edition.

Hope this helps!

Edgar
Title: Re: SambaPOS Training Mode
Post by: JohnS on February 15, 2012, 01:56:35 am
Edgar,

Is SambaSettings.txt in the same folder?
Title: Re: SambaPOS Training Mode
Post by: jenem on February 15, 2012, 03:43:05 am
Hi John,

No, It is in "C:\ProgramData\Ozgu Tech\SambaPOS2\SambaSettings.txt"

Edgar
Title: Re: SambaPOS Training Mode
Post by: JohnS on February 15, 2012, 07:30:02 am
Edgar,

Confirmed file permission issues with V3.0.

V3.1 & V3.2 both working with standard user account - I could not replicate your issue.

V3.2 uses SambaTrain.sdf instead of SambaData2.sdf to make sure we are using different databases.


My Testing.
- Win 7 64 Bit Ultimate.
- Created standard user with password.
- Installed SambaPOS + .NET + Compact SQL as administrator.
- Logged in as standard user and ran SambaPOS.
- Saved local settings file.
- Ran SambaPOS Training Mode, checked local settings to confirm correct database was used.
- Started work period, Logout & Exit
- Ran live version of SambaPOS and work period had not started.

I am out of ideas why you are having issues. Try V3.2 and make sure that your Desktop icon for SambaPOS Training Mode is pointing to the training.vbs script and not Samba.Presentation.exe.
Title: Re: SambaPOS Training Mode
Post by: JohnS on February 15, 2012, 09:02:28 am
Latest version of SambaPOS Training Mode.

Notes
- Includes /Training command line switch which when used with the Application Subtitle Action, can display at the top of the screen 'Training Mode'

How to setup 'Training Mode' title.

1. The Action
- Create a new Action called Training Mode
- Action Type = Update Application Subtitle
- Title = Training Mode
- Color = your choice

2. The Rule
- Create a new Rule called Training Mode
- Event Name = Application Started
- Conditions - CommandLineArguments = /Training
- Actions - Select Training Mode action

Now when you run SambaPOS Training Mode, you will see Training Mode at the top of the screen.


Note - If you want to refresh the training database file every time you run SambaPOS Training Mode, edit the Training.vbs file in the Training folder under C:\Program Files\SambaPos2, and change strDelTrSQLCE = False to True on the 10th line.


Emre,

Can we please get a link in the Samba POS 2 start menu group for SambaPOS Training Mode during the installation.
Title: Re: SambaPOS Training Mode
Post by: limeypacker on March 05, 2013, 05:21:45 pm
how do i know im in training mode i clicked on the training.vbs and sambapos started but it didnt show it was running in training mode?
Title: Re: SambaPOS Training Mode
Post by: JohnS on March 28, 2013, 03:11:49 am
how do i know im in training mode i clicked on the training.vbs and sambapos started but it didnt show it was running in training mode?

By using the setup in the post above yours.
Title: Re: SambaPOS Training Mode
Post by: JohnS on March 28, 2013, 03:16:46 am
Latest version of SambaPOS Training Mode.

I have made some changes to the script due to smaller 32bit systems splitting the sqlce files which would cause the SambaTrain.sdf file not to build properly.

All other features of the script stay the same.
Title: Re: SambaPOS Training Mode
Post by: Cazaus on May 28, 2013, 10:21:26 pm
hello, I'd like to know how can I change the currency symbol or: $, €, £, how can I change this part in SAMBAPOS? please help me. Gidy Cazaus