Пример #1
0
        private void button1_Click(object sender, EventArgs e)
        {
            try
            {
                if (richTextBox1.Text == string.Empty)
                    return;

                CoreLib fn = new CoreLib();
                object[] article = new object[7];

                article[0] = fn.GetDouble(maskedTextBox1.Text);//total
                article[1] = byte.Parse(comboBox2.Text);//dose_ppt 0..15
                article[2] = Convert.ToDouble(textBox1.Text);//price
                article[3] = comboBox1.Text;//pdv
                article[4] = richTextBox1.Text.Replace('³', 'i').Replace('²', 'I');//name
                article[5] = textBox2.Text;//id
                article[6] = byte.Parse(comboBox3.Text);//money_ppt 0..15

                Array.Resize<object>(ref articles, articles.Length + 1);
                articles[articles.Length - 1] = article;

                ClearAll();
            }
            catch { }
        }
Пример #2
0
 protected override bool OnProcessMessageCustom(CoreLib.ILogMethod method, IFreeformEntity_Msg request)
 {
     // initiate a key exchange (ticket)
     var msgTicket = this.Factory.SecurityTables.InitKeyExchangeStartG2H_SIM(request.IpAddress, FF_AppId_SessionIds.Security, this.NewTransactionId);
     var msgEFT = this.Factory.SecurityTables.InitKeyExchangeStartG2H_SIM(request.IpAddress, FF_AppId_SessionIds.ECash, this.NewTransactionId);
     this.ExecuteCurrentRequests(msgTicket, msgEFT);
     return true;
 }
Пример #3
0
 void Log_GlobalWriteToExternalLog(string formattedMessage, CoreLib.Diagnostics.LogEntryType type, object extra)
 {
     if (ScreenInitialized)
     {
         Log.GlobalWriteToExternalLog -= Log_GlobalWriteToExternalLog;
         return;
     }
     SbLog.AppendLine(DateTime.Now.ToFullString() + "\t" + formattedMessage);
 }
Пример #4
0
 private void button1_Click(object sender, EventArgs e)
 {
     try
     {
         CoreLib fn = new CoreLib();
         copecks = Convert.ToUInt32(fn.GetDouble(textBox1.Text) * 100);
         DialogResult = DialogResult.OK;
         Close();
     }
     catch { }
 }
        void Log_GlobalWriteToExternalLog(string formattedMessage, CoreLib.Diagnostics.LogEntryType type, object extra)
        {
            using (ILogMethod method = Log.LogMethod(this.DYN_MODULE_NAME, "Log_GlobalWriteToExternalLog"))
            {
                try
                {
                    Dispatcher.Invoke(new Action(() =>
                    {
                        if (type == CoreLib.Diagnostics.LogEntryType.Exception)
                        {
                            if (axConsole.Exceptions.Count >= 32767)
                                axConsole.Exceptions.Clear();

                            ExceptionModel item = new ExceptionModel()
                            {
                                SNo = axConsole.Exceptions.Count + 1,
                                ReceivedTime = DateTime.Now,
                                Exception = formattedMessage,
                            };
                            axConsole.Exceptions.Add(item);
                        }

                        if (axConsole.Output.Length > 32767)
                        {
                            axConsole.Output = string.Empty;
                        }

                        axConsole.Output += DateTime.Now.ToFullString() + "\t" + formattedMessage + Environment.NewLine;
                        axConsole.ScrollToEnd();
                    }));
                }
                catch (Exception ex)
                {
                    method.Exception(ex);
                }
            }
        }
        // Driver Components
        private void InitializeDriverComponents()
        {
            // initialize objects
            port = new Com_SerialPort();
            func = new CoreLib();

            // perforom configation com-port
            port.LoadPortConfig();
            //port.Open();

            // perform configuration user's interfaces
            portui = new UI.AppUI.Port(ref port);
            driverui = new UI.AppUI.Tree();
            ((TreeView)driverui.Controls["functionsTree"]).NodeMouseDoubleClick += new TreeNodeMouseClickEventHandler(this.NodeMouseDoubleClick);
        }
 internal override ExecutionStep ExecuteInternal(CoreLib.ILogMethod method, IFreeformEntity_Msg request)
 {
     this.ExecuteNextStep(request);
     return this;
 }
 internal override ExecutionStep ExecuteInternal(CoreLib.ILogMethod method, IFreeformEntity_Msg request)
 {
     return base.ExecuteInternal(method, request);
 }
        protected override bool WriteInternal(CoreLib.Win32.IAsyncProgress2 o, object[,] values, ExternalExcelRangeInfo rangeInfo)
        {
            Range writeRange = null;

            try
            {
                writeRange = this.GetRange(rangeInfo);
                writeRange.Value2 = values;
                return true;
            }
            finally
            {
                Extensions.DisposeComObject(writeRange);
            }
        }
Пример #10
0
        private void button1_Click(object sender, EventArgs e)
        {
            double value = 0;
            byte ppt = 0;

            try
            {
                CoreLib fn = new CoreLib();
                value = fn.GetDouble(textBox1.Text);

                switch (comboBox1.SelectedIndex)
                {
                    case 1: { value = -value; break; }
                }

                switch (comboBox2.SelectedIndex)
                {
                    case 0:
                        {
                            try
                            {
                                ppt = byte.Parse(numericUpDown1.Value.ToString());
                                if (ppt > 127)//7bit
                                    ppt = 127;
                            }
                            catch { return; }

                            if (value > 16777215)//3 byte
                                value = 16777215;
                            if (value < -16777215)//3 byte
                                value = -16777215;

                            switch (comboBox3.SelectedIndex)
                            {
                                case 0:
                                    {
                                        discInfo[0] = (byte)0;
                                        break;
                                    }
                                case 1:
                                    {
                                        discInfo[0] = (byte)2;
                                        break;
                                    }
                            }
                            break;
                        }
                    case 1:
                        {
                            if ((int)(value*100) > 2147483647)//31bit
                                value = 2147483647;
                            if ((int)(value * 100) < -2147483647)//31bit
                                value = -2147483647;

                            switch (comboBox3.SelectedIndex)
                            {
                                case 0:
                                    {
                                        discInfo[0] = (byte)1;
                                        break;
                                    }
                                case 1:
                                    {
                                        discInfo[0] = (byte)3;
                                        break;
                                    }
                            }
                            break;
                        }
                }

                discInfo[1] = value;
                discInfo[2] = ppt;
                discInfo[3] = richTextBox1.Text;

                DialogResult = DialogResult.OK;
                Close();
            }
            catch { return; }
        }