Exemple #1
0
        /// <summary>
        /// 连接参数初始化
        /// </summary>
        /// <param name="DataSourceType"></param>
        public dbaFactory()
        {

            switch (Common._datasourcetype)
            {
                case Common.DataSourceType .SQLServer:

                    m_Connect = new CSQLServerConnect();
                    //数据库连接参数设置
                    m_Connect.SetParameter(Common._sysrun.ServerName, Common._sysrun.DataBaseName,
                                            Common._sysrun.UserName, Common._sysrun.PassWord);
                    if (Framework.DataAccess.SqlHelper.CONN_STRING == null || Framework.DataAccess.SqlHelper.CONN_STRING == string.Empty)
                    {
                        Framework.DataAccess.SqlHelper.CONN_STRING = m_Connect.strConnectString;
                    }
                    break;

                //case Common.DataSourceType .MySQL:

                //    break;
                //case Common.DataSourceType .Oracle:

                //    break;
                //case Common.DataSourceType .Access:
                //    break;

                //case Common.DataSourceType .TXT:
                //    break;

            } 
        }
Exemple #2
0
        /// <summary>
        /// 连接参数初始化
        /// </summary>
        /// <param name="strConString"></param>
        /// <param name="DataSourceType"></param>
        public dbaFactory( string strConString ,Common.DataSourceType DataSourceType)
        {

            switch (DataSourceType)
            {
                case Common.DataSourceType.SQLServer:

                    m_Connect = new CSQLServerConnect();
                    //数据库连接参数设置
                    m_Connect.strConnectString = strConString;
                    break;

                //case Common.DataSourceType .MySQL:

                //    break;
                //case Common.DataSourceType .Oracle:

                //    break;
                //case Common.DataSourceType .Access:
                //    break;

                //case Common.DataSourceType .TXT:
                //    break;

            }

        }
Exemple #3
0
        /// <summary>
        /// 连接参数初始化
        /// </summary>
        /// <param name="DataSourceType"></param>
        public dbaFactory()
        {
            switch (Common._datasourcetype)
            {
                case Common.DataSourceType.SQLServer:

                    m_Connect = new CSQLServerConnect();
                    //数据库连接参数设置
                    m_Connect.SetParameter(Common._sysrun.ServerName, Common._sysrun.DataBaseName,
                                            Common._sysrun.UserName, Common._sysrun.PassWord);
                    break;

                case Common.DataSourceType.MySQL:

                    m_Connect = new CMySqlConnect();
                    //数据库连接参数设置
                    m_Connect.SetParameter(Common._sysrun.ServerName, Common._sysrun.DataBaseName,
                                            Common._sysrun.UserName, Common._sysrun.PassWord);

                    break;
                //case Common.DataSourceType .Oracle:

                //    break;
                //case Common.DataSourceType .Access:
                //    break;

                //case Common.DataSourceType .TXT:
                //    break;

            }
        }
Exemple #4
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="m_daoCommon"></param>
        /// <param name="message"></param>
        /// <param name="type">0:入库、1:出库、2:上架、3:基本信息</param>
        /// <param name="result"></param>
        /// <param name="mod_id"></param>
        /// <returns></returns>

        public static bool InserToLog(CBaseConnect m_daoCommon, string message, string type, string result, string mod_id)
        {
            try
            {
                StringDictionary dicItemValue = new StringDictionary();
                //user
                StringDictionary DidUserCollum = new StringDictionary();
                //log for use
                DidUserCollum[t_syslogrecd.adduser] = "true";
                DidUserCollum[t_syslogrecd.addtime] = "true";
                //DidUserCollum[t_alarmdata.updtime] = "true";
                //DidUserCollum[t_alarmdata.upduser] = "true";

                var guid = Guid.NewGuid();
                var rand = new Random();

                dicItemValue[t_syslogrecd.log_id] = DateTime.Now.ToString("yyyyMMddhhmmss") + "D" + rand.Next(100000).ToString();

                dicItemValue[t_syslogrecd.operatorid] = Common._personid;//Common._personname; //DateTime.Now.ToString("yyyyMMddHHmmss") + "R" + item.rfid;
                dicItemValue[t_syslogrecd.message]    = message;
                dicItemValue[t_syslogrecd.type]       = type;
                dicItemValue[t_syslogrecd.mod_id]     = mod_id;
                dicItemValue[t_syslogrecd.result]     = result;
                dicItemValue[t_syslogrecd.org_no]     = "RFID";

                m_daoCommon.SetInsertDataItem(ViewOrTable.t_syslogrecd, dicItemValue, DidUserCollum);
                return(true);
            }
            catch (Exception ex)
            {
                //throw ex;
                return(false);
            }
        }
Exemple #5
0
        /// <summary>
        /// 连接参数初始化
        /// </summary>
        /// <param name="strConString"></param>
        /// <param name="DataSourceType"></param>
        public dbaFactory(string strConString, Common.DataSourceType DataSourceType)
        {
            switch (DataSourceType)
            {
            case Common.DataSourceType.SQLServer:

                m_Connect = new CSQLServerConnect();
                //数据库连接参数设置
                m_Connect.strConnectString = strConString;

                break;

            case Common.DataSourceType.MySQL:

                m_Connect = new CMySqlConnect();
                //数据库连接参数设置
                m_Connect.strConnectString = strConString;

                break;
                //case Common.DataSourceType .Oracle:

                //    break;
                //case Common.DataSourceType .Access:
                //    break;

                //case Common.DataSourceType .TXT:
                //    break;
            }
        }
Exemple #6
0
        /// <summary>
        /// 连接参数初始化
        /// </summary>
        /// <param name="DataSourceType"></param>
        public dbaFactory()
        {
            switch (Common._datasourcetype)
            {
            case Common.DataSourceType.SQLServer:

                m_Connect = new CSQLServerConnect();
                //数据库连接参数设置
                m_Connect.SetParameter(Common._sysrun.ServerName, Common._sysrun.DataBaseName,
                                       Common._sysrun.UserName, Common._sysrun.PassWord);
                break;

            case Common.DataSourceType.MySQL:

                m_Connect = new CMySqlConnect();
                //数据库连接参数设置
                m_Connect.SetParameter(Common._sysrun.ServerName, Common._sysrun.DataBaseName,
                                       Common._sysrun.UserName, Common._sysrun.PassWord);

                break;
                //case Common.DataSourceType .Oracle:

                //    break;
                //case Common.DataSourceType .Access:
                //    break;

                //case Common.DataSourceType .TXT:
                //    break;
            }
        }
Exemple #7
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="m_daoCommon"></param>
        /// <param name="message"></param>
        /// <param name="type">0:入库、1:出库、2:上架、3:基本信息</param>
        /// <param name="result"></param>
        /// <param name="mod_id"></param>
        /// <returns></returns>
        public static bool InserToLog(CBaseConnect m_daoCommon, string message, string type, string result, string mod_id)
        {
            try
            {
                StringDictionary dicItemValue = new StringDictionary();
                //user
                StringDictionary DidUserCollum = new StringDictionary();
                //log for use
                DidUserCollum[t_syslogrecd.adduser] = "true";
                DidUserCollum[t_syslogrecd.addtime] = "true";
                //DidUserCollum[t_alarmdata.updtime] = "true";
                //DidUserCollum[t_alarmdata.upduser] = "true";

                var guid=Guid.NewGuid();
                var rand= new Random();

                dicItemValue[t_syslogrecd.log_id] = DateTime.Now.ToString("yyyyMMddhhmmss") + "D" + rand.Next(100000).ToString();

                dicItemValue[t_syslogrecd.operatorid] = Common._personid;//Common._personname; //DateTime.Now.ToString("yyyyMMddHHmmss") + "R" + item.rfid;
                dicItemValue[t_syslogrecd.message] = message;
                dicItemValue[t_syslogrecd.type] = type;
                dicItemValue[t_syslogrecd.mod_id] = mod_id;
                dicItemValue[t_syslogrecd.result] = result;
                dicItemValue[t_syslogrecd.org_no] = "RFID";

                m_daoCommon.SetInsertDataItem(ViewOrTable.t_syslogrecd, dicItemValue, DidUserCollum);
                return true;
            }
            catch (Exception ex)
            {
                //throw ex;
                return false;
            }
        }
Exemple #8
0
        /// <summary>
        /// 获取数据库业务对象
        /// </summary>
        /// <returns></returns>
        public static void GetDaoCommon(ref CBaseConnect daoCommon)
        {
            switch (Common._datasourcetype)
            {
            case Common.DataSourceType.SQLServer:

                daoCommon = new daoCommonSQLServer();

                break;

            case Common.DataSourceType.MySQL:

                daoCommon = new daoCommonMySql();

                break;
                //case Common.DataSourceType .Oracle:

                //    break;
                //case Common.DataSourceType .Access:
                //    break;

                //case Common.DataSourceType .TXT:
                //    break;
            }
        }
Exemple #9
0
        /// <summary>
        /// 获取数据库业务对象
        /// </summary>
        /// <returns></returns>
        public static void GetDaoCommon(ref CBaseConnect daoCommon)
        {
            switch (Common._datasourcetype)
            {
            case Common.DataSourceType.SQLServer:

                daoCommon = new daoCommonSQLServer();

                break;

            case Common.DataSourceType.MySQL:

                daoCommon = new daoCommonMySql();

                break;
            //case Common.DataSourceType .Oracle:

            //    break;
            //case Common.DataSourceType .Access:
            //    break;

            //case Common.DataSourceType .TXT:
            //    break;

            }
        }