public void RemoveMatrixRow(IMatrix matrix, IDBDataSource dBDataSource, int row) { dBDataSource.RemoveRecord(row - 1); // Loads the user interface with current data from the matrix objects data source. matrix.LoadFromDataSource(); }
static DBDataSourceHelper() { try { //获取数据源类型 string strDBType = ConfigurationManager.AppSettings["DBType"]; if (string.IsNullOrWhiteSpace(strDBType)) { strDBType = "MySql"; } s_dbDataSource = ObjectFactoryHelper.CreateInstance <IDBDataSource>(strDBType + "DBDataSource", "DBDataSource", true); } catch (Exception ex) { string strMessage = SysLogHelper.GetErrorLogInfo(ex, true); SysLogHelper.LogMessage("DataSourceHelper.Static", strMessage, LogLevel.Error); } }
public void AddMatrixRow(IMatrix matrix, IDBDataSource dBDataSource, bool focusCell) { // Insere um novo registro vazio dentro do data source dBDataSource.InsertRecord(dBDataSource.Size); if (dBDataSource.Size == 1) { dBDataSource.InsertRecord(dBDataSource.Size); } if (matrix.VisualRowCount.Equals(0)) { dBDataSource.RemoveRecord(0); } // Loads the user interface with current data from the matrix objects data source. matrix.LoadFromDataSourceEx(false); if (focusCell) matrix.SetCellFocus(matrix.VisualRowCount, 1); }
public void AddMatrixRow(IMatrix matrix, IDBDataSource dBDataSource, bool focusCell) { // Insere um novo registro vazio dentro do data source dBDataSource.InsertRecord(dBDataSource.Size); if (dBDataSource.Size == 1) { dBDataSource.InsertRecord(dBDataSource.Size); } if (matrix.VisualRowCount.Equals(0)) { dBDataSource.RemoveRecord(0); } // Loads the user interface with current data from the matrix objects data source. matrix.LoadFromDataSourceEx(false); if (focusCell) { matrix.SetCellFocus(matrix.VisualRowCount, 1); } }