Exemplo n.º 1
0
        /// <summary>
        /// Application's Constructor
        /// </summary>
        public uiWndMain()
        {
            InitializeComponent();

            //OnCheckCompleted += new EventHandler<ExchangeEventArgs>(PostActionOnCheckComplete);
            // DoSomething.OnNeedsUI += new EventHandler<EventArgs>(DoSomething_OnNeedsUI);

            dataContainer2 = DataWorkShared.GetDataContainer();

            // initialize statements
            dataContainer2.Structures[CoreConst.CONTAINER_STATE, CoreConst.STATE_CALC_USE_TOTAL_DISC] = true;

            dataContainer2.Structures[CoreConst.CONTAINER_STATE].UpdateMethod = this.GetAppStatements;
            //dataContainer2.Structures[CoreConst.CONTAINER_STATE] = this.GetAppStatements;
            dataContainer2.Structures[CoreConst.CONTAINER_STATE].Update();

            //Program.AppPlugins.GetActive<IAppUI>().Execute(this);

               // Settings1.Default["test"] = "gfdgdgdf";
            //Settings1.Default.Save();
            /*
            Properties.Settings.Default.Context.Add("gdfgdfg", "gdfgdfg");
            Properties.Settings.Default.Save();

            System.Configuration.ConfigXmlDocument f = new System.Configuration.ConfigXmlDocument();
            f.LoadXml("PayDesk.exe.config");
            System.Configuration.SettingElement g = new System.Configuration.SettingElement("gfdgf", System.Configuration.SettingsSerializeAs.Xml);
            System.Configuration.SettingsContext sc = new System.Configuration.SettingsContext();
            System.Configuration.LocalFileSettingsProvider lfs = new System.Configuration.LocalFileSettingsProvider();
            System.Collections.Specialized.NameValueCollection nvc = new System.Collections.Specialized.NameValueCollection();
            nvc.Add("test2", "tttt"); lfs.Initialize("PayDesk.xml", nvc);
            lfs.Reset(sc);

            */

            /*
            System.Runtime.Serialization.Formatters.Binary.BinaryFormatter bf = new BinaryFormatter();

            XmlPO.XmlParserObject xobj = new XmlPO.XmlParserObject();
            */
            /*
            System.Collections.Hashtable _driverData = new System.Collections.Hashtable();
            _driverData.Add("Status", 1);
            _driverData.Add("ErrorStatus", 1);
            _driverData.Add("ArtMemorySize", (uint)11800);
            _driverData.Add("UserNo", (byte)1);
            _driverData.Add("UserPwd", "0000");
            _driverData.Add("DeskNo", (byte)1);

            System.Collections.Hashtable _driverData2 = new System.Collections.Hashtable();
            _driverData2.Add("LastFunc", "");
            _driverData2.Add("LastArtNo", (uint)1);
            _driverData2.Add("LastFOrderNo", (uint)0);
            _driverData2.Add("LastNOrderNo", (uint)0);
            _driverData2.Add("LastROrderNo", (uint)0);

            System.Collections.Hashtable _xData = new System.Collections.Hashtable();
            _xData.Add("testBlock", _driverData);
            _xData.Add("testBlock2", _driverData2);
            _xData.Add("listtest", new int[] { 1, 2, 3, 5, 7, 0 });

            xobj.ParseDataToXml("myxmlfile.xml", _xData);
            */
            /*
            System.Collections.Hashtable ldata = xobj.ParseXmlToData("AppConfig.xml");
            ;

            XmlPO.Components.Objects.SectionElement section = new XmlPO.Components.Objects.SectionElement("simple");
            section.Comment = "demo test";

            XmlPO.Components.Objects.BlockElement b = new XmlPO.Components.Objects.BlockElement("b1");
            XmlPO.Components.Objects.PropertyElement p = new XmlPO.Components.Objects.PropertyElement("p1");
            p.Value = 12345;
            b.Add(p);
            section.Add(b);
            XmlPO.Components.Objects.DocumentElement doc = new XmlPO.Components.Objects.DocumentElement();
            doc.AddContainer(section);

            xobj.ParseDocumentToXml("t.xml", doc);
            */
            //System.Collections.Hashtable ldata = xobj.ParseXmlToData("myxmlfile.xml");

            //ComPort _cport = new ComPort();
            //PayDesk.Config.AppSettings sett = new Config.AppSettings();

               /* ConfigManager cm = new ConfigManager();
            sett.Tax_AppTaxChar = new char[] { 'a' };
            sett.Tax_AppTaxDisc = new bool[] { true };
            sett.PRN_Templates = new Dictionary<string, object>();
            sett.PRN_Templates.Add("test", new Dictionary<string, object>(2));
            string rez = cm.SerializeObject(sett, sett.GetType());
            cm.Save(rez);*/

            timerDataImportSynchronizer = new System.Windows.Forms.Timer();
            timerDataImportSynchronizer.Interval = 50000;
            timerDataImportSynchronizer.Tick += new EventHandler(timerDataImportSynchronizer_Tick);
        }
Exemplo n.º 2
0
        public static components.Components.DataContainer.DataContainer GetDataContainer()
        {
            // general data container
            components.Components.DataContainer.DataContainer dc = new components.Components.DataContainer.DataContainer();

            // properties
            //  -- statements
            // sources
            //  --
            dc.Structures.Add(new components.Components.DataContainer.DataStructureItem(CoreConst.CONTAINER_STATE, GetStandartStatementsInfoStructure2()));

            //dc.Storages.Add(new components.Components.DataStorage.DataSourceItem());

            return dc;
        }