예제 #1
0
        /// <summary>
        ///
        /// </summary>
        static void doNext()
        {
            FormLogin frmLogin = new FormLogin();

            frmLogin.ShowDialog();
            if (DialogResult.OK != frmLogin.DialogResult)
            {
                //结束程序
                return;
            }
            FrmMainOfAttendanceRecord frmMainOfAttendanceRecord = new FrmMainOfAttendanceRecord();

            Application.Run(frmMainOfAttendanceRecord);
        }
예제 #2
0
        /// <summary>
        ///
        /// </summary>
        static void doNextStep()
        {
            #region 数据库联接测试。
            string host_Name    = XmlFlexflow.ReadXmlNodeValue("SERVER_NAME");
            string service_Name = XmlFlexflow.ReadXmlNodeValue("SERVICE_NAME");
            string user_Id      = XmlFlexflow.ReadXmlNodeValue("USER_ID");
            string password     = XmlFlexflow.ReadXmlNodeValue("PASSWORD");

            string mes_host_Name = XmlFlexflow.ReadXmlNodeValue("MES_SERVER_NAME");
            string mes_db_Name   = XmlFlexflow.ReadXmlNodeValue("MES_DATABASE_NAME");
            string mes_user_Id   = XmlFlexflow.ReadXmlNodeValue("MES_USER_ID");
            string mes_password  = XmlFlexflow.ReadXmlNodeValue("MES_PASSWORD");
            //先测试是否可以ping通
            if (!ConnectByPing.pingTheAddress(host_Name))
            {
                MessageBox.Show("与" + host_Name + " 连接失败!", "提示: ", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }
            #endregion
            //再这个启动类里,对对象进行初始化。
            OracleDaoHelper daoHelper = new OracleDaoHelper(host_Name, service_Name, user_Id, password);
            SqlDaoHelper    sqlHelper = new SqlDaoHelper(mes_host_Name, mes_db_Name, mes_user_Id, mes_password);
            SqlConnection   sqlConn   = new SqlConnection(SqlDaoHelper.conn_str);
            try
            {
                sqlConn.Open();
                sqlConn.Close();
                sqlConn.Dispose();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
                MessageBox.Show("基于MES_制卡系统中的所属部门,组将无法获取");
            }
            FormLogin frmLogin = new FormLogin();
            frmLogin.ShowDialog();
            if (DialogResult.OK != frmLogin.DialogResult)
            {
                //结束程序
                return;
            }
            FrmMainOfAttendanceRecord frmMainOfAttendanceRecord = new FrmMainOfAttendanceRecord();
            Application.Run(frmMainOfAttendanceRecord);
        }