Пример #1
0
        private void SetComboBox()
        {
            si = ScaleDefaultInfo.GetInstance();

            cbUseScale.Checked = si.UseScale;
            txtCommend.Text    = si.Commend;
            cbPortName.Text    = si.PortName;
            cbBaudRate.Text    = si.BaudRate;
            cbParity.Text      = si.Parity;
            cbDataBit.Text     = si.DataBit;
            cbStopBit.Text     = si.StopBit;
            if (!string.IsNullOrEmpty(si.ScaleType))
            {
                cbScaleType.SelectedIndex = Convert.ToInt32(si.ScaleType);
            }
            cbDefaultWeight.Checked = si.DefaultWeight;
            if (si.BarcodeSize.Equals("0"))
            {
                rbBY3.Checked = true;
            }
            else if (si.BarcodeSize.Equals("1"))
            {
                rbBY4.Checked = true;
            }

            if (cbUseScale.Checked)
            {
                cbDefaultWeight.Visible = false;
            }
            else
            {
                cbDefaultWeight.Visible = true;
            }
        }
Пример #2
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            ScaleDefaultInfo di = ScaleDefaultInfo.GetInstance();

            //string d = "data source = MIS007; initial catalog = SCMStoreIntranet; persist security info = True; user id = ipuser; password = 1069; MultipleActiveResultSets = True; ";
            //string ddd = Encryption.Encrypt(d, true);

            //Application.Run(new frmFedEx_Shipments());

            if (string.IsNullOrEmpty(di.PortName) || string.IsNullOrEmpty(di.BaudRate) ||
                string.IsNullOrEmpty(di.DataBit) || string.IsNullOrEmpty(di.StopBit) || string.IsNullOrEmpty(di.Parity))
            {
                Application.Run(new frmScaleSet());
                Application.Restart();
                //frmScaleSet configForm = new frmScaleSet();
                //configForm.ShowDialog();
                //Application.Restart();
                //return;
            }
            else
            {
                frmFedEx_Shipments frm = new frmFedEx_Shipments();
                string             rtn = frm.GetDefaultValues();
                if (!string.IsNullOrWhiteSpace(rtn))
                {
                    MessageBox.Show(rtn);
                    return;
                }

                Application.Run(frm);
                //Application.Run(new frmFedEx_Shipments());
            }
        }