예제 #1
0
        private void SFIS_DCT_INPUT_Load(object sender, EventArgs e)
        {
            string C_RES = string.Empty;

            try
            {
                if (!Directory.Exists("C:\\SFIS"))
                {
                    Directory.CreateDirectory("C:\\SFIS");
                }
                C_RES  = "检查程序版本方法连接失败";
                chkver = new WebServices.Check_Version.Check_Version();
                if (!chkver.CheckPrgVsersion("SFIS_DCT_INPUT", this.ProductVersion, null, null, null))
                {
                    SendPrgMsg(mLogMsgType.Error, "该程序为版本不是最新版\r\n请更新后运行");
                    RunFile(System.Windows.Forms.Application.StartupPath + @"\", "AutoUpdate.exe", "ISCM.exe");
                    this.Enabled = false;
                }
                lbl = new ApplicationClass();
                SendPrgMsg(mLogMsgType.Incoming, "初始化CodeSoft成功");
                Initialization = new InitializationPrg(InitializationInfo);
                Initialization.BeginInvoke(null, null);
                txt_userid.Enabled = false;
                txt_sn.Enabled     = false;
                txt_kpsn.Enabled   = false;
            }
            catch
            {
                SendPrgMsg(mLogMsgType.Error, C_RES);
            }
        }
예제 #2
0
        private void Frm_Input_Load(object sender, EventArgs e)
        {
            if (!Directory.Exists("C:\\SFIS"))
            {
                Directory.CreateDirectory("C:\\SFIS");
            }
            string _StrErr = string.Empty;

            chkver = new WebServices.Check_Version.Check_Version();
            if (!chkver.CheckPrgVsersion("TEST_INPUT", this.ProductVersion, null, null, null, out _StrErr))
            {
                if (_StrErr == "OK")
                {
                    SendPrgMsg(Color.Red, "该程序为版本不是最新版\r\n请更新后运行");
                    RunFile(System.Windows.Forms.Application.StartupPath + @"\", "AutoUpdate.exe", "ISCM.exe");
                }
                else
                {
                    SendPrgMsg(Color.Red, "检查版本失败:" + _StrErr);
                }
                this.Enabled = false;
            }

            Initialization = new InitializationPrg(InitializationInfo);
            Initialization.BeginInvoke(null, null);
        }
예제 #3
0
        private void Frm_TEST_INPUT_Load(object sender, EventArgs e)
        {
            chkver = new WebServices.Check_Version.Check_Version();
            string _StrErr = string.Empty;

            if (!chkver.CheckPrgVsersion("TEST_INPUT", this.ProductVersion, null, null, null, out _StrErr))
            {
                if (_StrErr == "OK")
                {
                    MessageBox.Show("该程序为版本不是最新版\r\n请更新后运行");
                    this.Enabled = false;
                    RunFile(System.Windows.Forms.Application.StartupPath + @"\", "AutoUpdate.exe", appfilename);
                }
                else
                {
                    MessageBox.Show("检查版本发生异常:" + _StrErr, "提示", MessageBoxButtons.OK, MessageBoxIcon.Stop);
                }
                string    FileName = System.IO.Path.GetFileName(System.Windows.Forms.Application.ExecutablePath);
                Process[] prc      = Process.GetProcessesByName(FileName.Substring(0, FileName.LastIndexOf('.')));
                if (prc.Length > 0)
                {
                    foreach (Process pc in prc)
                    {
                        pc.Kill();
                    }
                }
                return;
            }


            this.Text = "PHICOMM TEST_INPUT " + this.ProductVersion;
            //System.DateTime d1 = System.DateTime.Parse("2015/07/30");
            //System.DateTime d2 = System.DateTime.Now;
            //System.TimeSpan ts = d1 - d2;
            //if (ts.Days <= 0)
            //{
            //    MessageBox.Show("试用时间超出,请联系系统开发人员");
            //    this.Close();
            //    return;
            //}

            Initialization = new InitializationPrg(InitializationInfo);
            Initialization.BeginInvoke(null, null);
            tb_Input.Focus();
        }
예제 #4
0
        private void FrmPrivliege_Load(object sender, EventArgs e)
        {
            try
            {
                #region 添加应用程序
                if (this.sMain.gUserInfo.rolecaption == "系统开发员")
                {
                    IList <IDictionary <string, object> > lsfunls = new List <IDictionary <string, object> >();
                    FrmBLL.publicfuntion.GetFromCtls(this, ref lsfunls);
                    Dictionary <string, object> dic = new Dictionary <string, object>();
                    dic.Add("PROGID", this.Name);
                    dic.Add("PROGNAME", this.Text);
                    dic.Add("PROGDESC", this.Text);
                    FrmBLL.publicfuntion.AddProgInfo(dic, lsfunls);
                }
                #endregion
            }
            catch (Exception ex)
            {
                this.sMain.ShowPrgMsg(ex.Message, MainParent.MsgType.Error);
            }
            Initialization = new InitializationPrg(InitializationInfo);
            Initialization.BeginInvoke(null, null);

            panelEx2.Width = panelEx4.Width / 2 - 100;
            panelEx5.Width = panelEx4.Width / 2 - 40;
            panelEx3.Dock  = DockStyle.Fill;


            //btntoleft.Location = new Point(panelEx3.Width - (panelEx3.Width - 10), panelEx3.Height - 100);
            //btntoright.Location = new Point(panelEx3.Width - (panelEx3.Width - 10), panelEx3.Height - 500);


            btntoleft.Location  = new Point(30, 158);
            btntoright.Location = new Point(30, 58);

            btntoleft.Width  = panelEx3.Width / 2 - 40;
            btntoright.Width = panelEx3.Width / 2 - 40;

            btntoleft.Size  = new Size(74, 48);
            btntoright.Size = new Size(74, 48);

            btn_modify.Location = new Point(panelEx4.Width - (panelEx4.Width) / 4, 22);
        }
예제 #5
0
        private void SFIS_DCT_V2_Load(object sender, EventArgs e)
        {
            chkver = new WebServices.Check_Version.Check_Version();
            string _StrErr = string.Empty;

            if (!chkver.CheckPrgVsersion("SFIS_DCT_V3", Application.ProductVersion, null, null, null, out _StrErr))
            {
                if (_StrErr == "OK")
                {
                    MessageBox.Show("该程序为版本不是最新版\r\n请更新后运行");
                    RunFile(System.Windows.Forms.Application.StartupPath + @"\", "AutoUpdate.exe", appfilename);
                }
                else
                {
                    MessageBox.Show("检查程序版本异常\r\n " + _StrErr);
                }
                string    FileName = System.IO.Path.GetFileName(Application.ExecutablePath);
                Process[] prc      = Process.GetProcessesByName(FileName.Substring(0, FileName.LastIndexOf('.')));
                if (prc.Length > 0)
                {
                    foreach (Process pc in prc)
                    {
                        pc.Kill();
                    }
                }

                return;
            }

            this.Text              = "SFIS_DCT_V3  Version: " + Application.ProductVersion;
            tbMessage.Text         = "正在初始......";
            this.PalConfig.Enabled = true;
            this.PalData.Enabled   = true;
            Initialization         = new InitializationPrg(InitializationInfo);
            Initialization.BeginInvoke(null, null);

            AutoRun.Interval = 100;
            AutoRun.Enabled  = false;
            AutoRun.Tick    += new EventHandler(AutoRun_Tick);
            btsetup.Enabled  = false;


            string filePath        = System.Environment.CurrentDirectory + "\\SFIS_DCT.ini";
            string _Port           = ReadIniFile.IniReadValue("DATABASE", "myport", filePath);
            string _BaudRate       = ReadIniFile.IniReadValue("DATABASE", "BaudRate", filePath);
            string _DataBits       = ReadIniFile.IniReadValue("DATABASE", "DataBits", filePath);
            string _Parity         = ReadIniFile.IniReadValue("DATABASE", "Parity", filePath);
            string _StopBits       = ReadIniFile.IniReadValue("DATABASE", "StopBits", filePath);
            string _ReadBufferSize = ReadIniFile.IniReadValue("DATABASE", "ReadBufferSize", filePath);

            LabDir = ReadIniFile.IniReadValue("LABEL", "Patch", filePath);
            try
            {
                sPort                = new System.IO.Ports.SerialPort();
                sPort.PortName       = "COM" + _Port;
                sPort.BaudRate       = int.Parse(_BaudRate);                              //串口通信波特率19200
                sPort.ReadBufferSize = int.Parse(_ReadBufferSize);
                sPort.DataBits       = int.Parse(_DataBits);                              //数据位 8
                sPort.Parity         = (Parity)Enum.Parse(typeof(Parity), _Parity);       //奇偶校验0
                sPort.StopBits       = (StopBits)Enum.Parse(typeof(StopBits), _StopBits); //System.IO.Ports.StopBits.One;//停止位
                sPort.ReadTimeout    = 1000;                                              //读超时
                sPort.WriteTimeout   = 1000;
                sPort.DataReceived  += new System.IO.Ports.SerialDataReceivedEventHandler(sPort_DataReceived);
                sPort.Open();
                comstatus.Text = "COM OK";
                PortFlag       = true;
            }
            catch
            {
                comstatus.Text = "COM FAIL";
                PortFlag       = false;
            }
        }