internal dloUserGroup(dloUserGroups groups) { Id = Guid.NewGuid().ToString(); _groups = groups; _app = _groups.Application; _rights = new dloUserRights(this); }
internal dloUserRight(dloUserRights rights) { Id = Guid.NewGuid().ToString(); _rights = rights; _application = _rights.Application; EditMode = ObjectStates.Added; }
internal dloApplicationLog(dloDataApplication application) { _application = application; Id = Guid.NewGuid().ToString(); Severity = 1; CreatedOn = DateTime.Now; // CreatedBy = _application.CurrentUser.FullName; }
internal dloUser(dloUsers users) { Id = Guid.NewGuid().ToString(); _users = users; _app = _users.Application; _rights = new dloUserRights(this); EditMode = ObjectStates.None; }
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); }
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); }
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); }
internal dloDevice(dloDataApplication application) : base(null) { _application = application; }
internal dloUserRights(dloUserGroup group) { _group = group; _app = _group.Application; UserRightsType = UserRightsTypes.Group; }
internal dloUserRights(dloUser user) { _user = user; _app = _user.Application; UserRightsType = UserRightsTypes.User; }
internal dloClosedQueston(dloDataApplication application) : base(null) { _application = application; }
internal dloDevices(dloDataApplication application) { _app = application; }
internal dloUsers(dloDataApplication app) { _app = app; }
internal dloApplicationLogs(dloDataApplication application) { _application = application; }
// public TableStatisticsCollection TableStatistics { get; private set; } #endregion internal DatabaseAnalysis(dloDataApplication application) { _application = application; ///TableStatistics = new TableStatisticsCollection(); }
public dloDbInfo(dloDataApplication app) { //Application = app; }