コード例 #1
0
 internal dloUserGroup(dloUserGroups groups)
 {
     Id      = Guid.NewGuid().ToString();
     _groups = groups;
     _app    = _groups.Application;
     _rights = new dloUserRights(this);
 }
コード例 #2
0
ファイル: dloUserRight.cs プロジェクト: lulzzz/DCAnalytics
 internal dloUserRight(dloUserRights rights)
 {
     Id           = Guid.NewGuid().ToString();
     _rights      = rights;
     _application = _rights.Application;
     EditMode     = ObjectStates.Added;
 }
コード例 #3
0
 internal dloApplicationLog(dloDataApplication application)
 {
     _application = application;
     Id           = Guid.NewGuid().ToString();
     Severity     = 1;
     CreatedOn    = DateTime.Now;
     // CreatedBy = _application.CurrentUser.FullName;
 }
コード例 #4
0
ファイル: dloUser.cs プロジェクト: lulzzz/DCAnalytics
        internal dloUser(dloUsers users)
        {
            Id      = Guid.NewGuid().ToString();
            _users  = users;
            _app    = _users.Application;
            _rights = new dloUserRights(this);

            EditMode = ObjectStates.None;
        }
コード例 #5
0
        public bool CheckDeviceState(dloDataApplication application)
        {
            _application = application;
            bool result = false;

            try
            {
                DbCommand cmd = null;
                cmd = _application.DbInfo.Connection.CreateCommand();
                var provider = _application.Provider;
                int count    = 0;
                switch (_application.Provider)
                {
                case DataProviders.SQL:
                case DataProviders.SQLite:
                    cmd.CommandText = string.Format("SELECT COUNT(*) FROM dsto_devices WHERE IMEI ='{0}' AND Status = 1", Imei);
                    if (_application.DbInfo.Connection.State == System.Data.ConnectionState.Closed)
                    {
                        _application.DbInfo.Connection.Open();
                    }
                    count  = (int)_application.DbInfo.ExecuteScalar(cmd);
                    result = count > 0;
                    break;

                case DataProviders.MYSQL:
                    cmd.CommandText = string.Format("SELECT COUNT(*) FROM dsto_devices WHERE IMEI ='{0}' AND Status = 1", Imei);
                    if (_application.DbInfo.Connection.State == System.Data.ConnectionState.Closed)
                    {
                        _application.DbInfo.Connection.Open();
                    }
                    count  = (int)_application.DbInfo.ExecuteScalar(cmd);
                    result = count > 0;
                    break;
                }
            }
            catch (Exception ex)
            {
                result = false;
            }
            finally
            {
                _application.DbInfo.Connection.Close();
            }
            return(result);
        }
コード例 #6
0
        internal static bool Exists(this dsoDataRow row, dloDataApplication app)
        {
            bool exists = false;

            DataTable     dt = null;
            DbDataAdapter da = null;
            DataRow       dr = null;

            string tableName = row.Table.TableName;
            string guid      = (string)row["Guid"];

            DbCommand cmd = app.DbInfo.CreateSqlCommand();

            switch (app.DbInfo.Provider)
            {
            case DataProviders.SQL:
                da = new SqlDataAdapter();
                break;

            case DataProviders.MYSQL:
                da = new MySqlDataAdapter();
                break;

            case DataProviders.SQLCE:
                // da = new SqlCeDataAdapter();
                break;
            }

            cmd.CommandType = CommandType.Text;
            cmd.CommandText = string.Format("SELECT * FROM {0} WHERE Guid = '{1}'", tableName, guid);

            dt = new DataTable(tableName);

            da.SelectCommand = cmd;
            da.Fill(dt);

            if (dt != null && dt.Rows.Count > 0)
            {
                dr = dt.Rows[0];
            }


            return(exists);
        }
コード例 #7
0
        public bool ActivateDevice(dloDataApplication application)
        {
            //_application = application;
            //DbCommand cmd = null;
            //bool result = false;
            //try
            //{
            //    cmd = _application.DbInfo.Connection.CreateCommand();
            //    var provider = _application.Configuration.DataStores.Default.Settings.Provider;

            //    switch (provider)
            //    {
            //        case DataProviders.SQL:
            //        case DataProviders.SQLite:
            //            cmd.CommandText = string.Format("UPDATE dsto_devices SET Status = 1 WHERE IMEI ='{0}' ", Imei);
            //            break;
            //        case DataProviders.MYSQL:
            //             cmd.CommandText = string.Format("UPDATE dsto_devices SET Status = 1 WHERE IMEI ='{0}' ", Imei);
            //            break;
            //    }
            //    if (_application.DbInfo.Connection.State == System.Data.ConnectionState.Closed)
            //        _application.DbInfo.Connection.Open();
            //    var res = _application.DbInfo.ExecuteNonQuery(cmd.CommandText);
            //    if (res > -1)
            //    {
            //        result = true;
            //    }
            //    else
            //    {
            //        result = false;
            //    }
            //}
            //catch(Exception ex)
            //{
            //    result = false;

            //}
            //finally
            //{
            //    _application.DbInfo.Connection.Close();
            //}
            return(false);
        }
コード例 #8
0
 internal dloDevice(dloDataApplication application) : base(null)
 {
     _application = application;
 }
コード例 #9
0
ファイル: dloUserRights.cs プロジェクト: lulzzz/DCAnalytics
 internal dloUserRights(dloUserGroup group)
 {
     _group         = group;
     _app           = _group.Application;
     UserRightsType = UserRightsTypes.Group;
 }
コード例 #10
0
ファイル: dloUserRights.cs プロジェクト: lulzzz/DCAnalytics
 internal dloUserRights(dloUser user)
 {
     _user          = user;
     _app           = _user.Application;
     UserRightsType = UserRightsTypes.User;
 }
コード例 #11
0
 internal dloClosedQueston(dloDataApplication application) : base(null)
 {
     _application = application;
 }
コード例 #12
0
ファイル: dloDevices.cs プロジェクト: lulzzz/DCAnalytics
 internal dloDevices(dloDataApplication application)
 {
     _app = application;
 }
コード例 #13
0
ファイル: dloUsers.cs プロジェクト: lulzzz/DCAnalytics
 internal dloUsers(dloDataApplication app)
 {
     _app = app;
 }
コード例 #14
0
 internal dloApplicationLogs(dloDataApplication application)
 {
     _application = application;
 }
コード例 #15
0
        // public TableStatisticsCollection TableStatistics { get; private set; }
        #endregion

        internal DatabaseAnalysis(dloDataApplication application)
        {
            _application = application;
            ///TableStatistics = new TableStatisticsCollection();
        }
コード例 #16
0
ファイル: dloDbInfo.cs プロジェクト: lulzzz/DCAnalytics
 public dloDbInfo(dloDataApplication app)
 {
     //Application = app;
 }