Tutorial On How To Build An Add-In in C# in RMS 2.0
Tutorial On How To Build An Add-In in C# in RMS 2.0
0 Michael Lawrenc posted on Tuesday, July 24, 2007 1216 PM I'll try to make this brief. I did this in VS2005 using C#. 1) Create a new C# project of the Class Library type. 2) Right click your project and select Properties. 3) Select the Build tab and check the box for Register for COM interop. 4) Select the Signing tab and select the combo box Choose a strong name key file and select New.... Next type in a key file name and uncheck the Protect my file with a password checkbox. 5) Hit Ctrl+S to save your properties and close the properties page. 6) Add a reference to the QSRules.dll file (should be located in CProgram FilesMicrosoft Retail Management SystemStore Operations, or wherever you installed RMS) 7) Create a class with the following code using using using using using using System; System.Collections.Generic; System.Runtime.InteropServices; System.IO; System.Text; System.Windows.Forms;
namespace RMSAddinTest { [Guid(6080A35A-8026-4c37-AC5A-933882B31186)] public interface Addin_Interface { [DispId(1)] bool Process(QSRules.SessionClass mySession); } [Guid(8497F5C5-0317-49e4-A636-61B4016CE905), InterfaceType(ComInterfaceType.InterfaceIsIDispatch)] public interface Addin_Events {} [Guid(8C780B6F-F16F-49ff-B1AB-1093E788E26A), ClassInterface(ClassInterfaceType.None), ComSourceInterfaces(typeof(Addin_Events))] public class Addin Addin_Interface { public bool Process(QSRules.SessionClass mySession) { if(DialogResult.OK==MessageBox.Show(String.Format(The current cashier is {0}., mySession.Cashier.Name))) return true; else return false; } } } 8) Compile your project. 9) Copy the DLLs you created from your project to your RMS install folder. 10) Open the Store Operations Manager. 11) Choose Database - Registers - Custom POS Buttons (from the toolbar) 12) Select the New button 13) The number will be unique, select a number that hasn't been chosen. 14) Caption is whatever you want the button to say. 15) Command is RMSAddinTest.Addin (if you change your namespace and classname you need to change this as well). 16) Select OK and close the Store Operations Manager. 17) Open Store Operations POS. You should now see your custom button on the
right. When you select the button it will show a MessageBox alerting the current cashier. I hope this helps. Took me a bit to figure it out.