public YidianshouweiyanshouConfig_K(DBServerType dbType, string connName, string notification) { PrepareDBUtil(dbType, Base.GetDBConnectionString(connName)); this.ds = new Yidianshouweiyanshou_KDS(); this.args = Base.GetParameter(notification, this.ToString()); }
public void Fill(DBServerType dbType, string connectionString, string sqlstr, DataSet ds, String tbl) { DbConnection sqlconn = CreateDbConnection(dbType, connectionString); DbCommand sqlcomm = CreateDbCommand(dbType); DbDataAdapter sqlda = CreateDbDataAdapter(dbType); sqlcomm.CommandType = CommandType.Text; sqlcomm.CommandText = sqlstr; sqlcomm.Connection = sqlconn; sqlda.SelectCommand = sqlcomm; try { if (sqlconn.State == ConnectionState.Closed) { sqlconn.Open(); } sqlda.Fill(ds, tbl); } catch (Exception ex) { throw ex; } finally { if (sqlconn.State == ConnectionState.Open) { sqlconn.Close(); } sqlda.Dispose(); sqlcomm.Dispose(); sqlconn.Dispose(); } }
public UnreturnConfig(DBServerType dbType, string ConnName, string notifaction) { PrepareDBUtil(dbType, Base.GetDBConnectionString(ConnName)); this.ds = new UnreturnDS(); this.reportList.Add(new UnreturnReport()); this.args = Base.GetParameter(notifaction, this.ToString()); }
public SalesOrderScheduleConfig_R_GZ(DBServerType dbType, string connName, string notification) { PrepareDBUtil(dbType, Base.GetDBConnectionString(connName)); this.ds = new SalesOrderScheduleDS(); //this.reportList.Add(new SalesOrderScheduleReport()); this.args = Base.GetParameter(notification, this.ToString()); }
public Dianshouweiyanshou_zhuweiConfig(DBServerType dbType, string connName, string notification) { PrepareDBUtil(dbType, Base.GetDBConnectionString(connName)); this.ds = new Dianshouweiyanshou_zhuweiDS(); this.reportList.Add(new Dianshouweiyanshou_zhuweiReport()); this.args = Base.GetParameter(notification, this.ToString()); }
public string GetQueryString(DBServerType dbType, string connectionString, string sqlstr) { DbConnection sqlconn = CreateDbConnection(dbType, connectionString); DbCommand sqlcomm = CreateDbCommand(dbType); sqlcomm.CommandType = CommandType.Text; sqlcomm.CommandText = sqlstr; sqlcomm.Connection = sqlconn; try { if (sqlconn.State == ConnectionState.Closed) { sqlconn.Open(); } return(sqlcomm.ExecuteScalar().ToString()); } catch (Exception) { return(null); } finally { if (sqlconn.State == ConnectionState.Open) { sqlconn.Close(); } sqlcomm.Dispose(); sqlconn.Dispose(); } }
public AccountReceivableDelayConfig(DBServerType dbType, string connName, string notification) { PrepareDBUtil(dbType, Base.GetDBConnectionString(connName)); this.ds = new DSAccountReceivableDelay(); this.reportList.Add(new AccountReceivableDelayReport()); this.args = Base.GetParameter(notification, this.ToString()); }
public int ExecSql(DBServerType dbType, string connectionString, string sqlstr) { DbConnection sqlconn = CreateDbConnection(dbType, connectionString); DbCommand sqlcomm = CreateDbCommand(dbType); sqlcomm.CommandType = CommandType.Text; sqlcomm.CommandText = sqlstr; sqlcomm.Connection = sqlconn; try { if (sqlconn.State == ConnectionState.Closed) { sqlconn.Open(); } sqlcomm.ExecuteNonQuery(); return(1); } catch (Exception) { return(0); } finally { if (sqlconn.State == ConnectionState.Open) { sqlconn.Close(); } sqlcomm.Dispose(); sqlconn.Dispose(); } }
public NianDuCaiGouPaiMingConfig(DBServerType dbType, string connName, string notification) { PrepareDBUtil(dbType, Base.GetDBConnectionString(connName)); this.ds = new NianDuCaiGouPaiMingDS(); this.args = Base.GetParameter(notification, this.ToString()); }
public INV520NegativeStockConfig(DBServerType dbType, string connName, string notification) { PrepareDBUtil(dbType, Base.GetDBConnectionString(connName)); this.ds = new InvbalAgingReportDS(); this.reportList.Add(new AccountReceivableDelayReport()); this.args = Base.GetParameter(notification, this.ToString()); }
public YuqiweijieancaigoudanConfig(DBServerType dbType, string connName, string notification) { PrepareDBUtil(dbType, Base.GetDBConnectionString(connName)); this.ds = new YuqiweijieancaigoudanDS(); this.args = Base.GetParameter(notification, this.ToString()); }
public FWKCGLConfig(DBServerType dbType, string connName, string notification) { PrepareDBUtil(dbType, Base.GetDBConnectionString(connName)); this.ds = new FWKCGLDS(); this.reportList.Add(new FWKCGLReport()); this.args = Base.GetParameter(notification, this.ToString()); }
public SpecOrderNotificationConfig(DBServerType dbType, string connName, string notification) { PrepareDBUtil(dbType, Base.GetDBConnectionString(connName)); this.ds = new DSSpecOrderNotification(); this.reportList.Add(new SpecOrderNotificationReport()); this.args = Base.GetParameter(notification, this.ToString()); }
public ProductionOrderNeedCloseConfig(DBServerType dbType, string connName, string notification) { PrepareDBUtil(dbType, Base.GetDBConnectionString(connName)); this.ds = new ProductionOrderNeedCloseDS(); this.reportList.Add(new ProductionOrderNeedCloseReport()); this.args = Base.GetParameter(notification, this.ToString()); }
public CDR_R_YwyMxConfig(DBServerType dbType, string connName, string notification) { PrepareDBUtil(dbType, Base.GetDBConnectionString(connName)); this.ds = new DSCDR_R_YwyMx(); //this.reportList.Add(new BxdmxReport()); //this.reportList.Add(new MisWorkReport2()); this.args = Base.GetParameter(notification, this.ToString()); }
public static object ExecuteScalar(DBServerType type, string connectionString, CommandType commandType, string commandText, params IDbDataParameter[] commandParameters) { using (IDbConnection connection = I3DBUtil.CreateConnection(type, connectionString)) { connection.Open(); return(ExecuteScalar(connection, commandType, commandText, commandParameters)); } }
public ZjzlConfig(DBServerType dbType, string connName, string notification) { PrepareDBUtil(dbType, Base.GetDBConnectionString(connName)); this.ds = new DSZjzl(); this.reportList.Add(new ZjzlReport()); //this.reportList.Add(new MisWorkReport2()); this.args = Base.GetParameter(this.ToString()); }
public FddxgbConfig(DBServerType dbType, string connName) { PrepareDBUtil(dbType, Base.GetDBConnectionString(connName)); this.ds = new DSFddxgb(); //this.reportList.Add(new BxdmxReport()); //this.reportList.Add(new MisWorkReport2()); this.args = Base.GetParameter(this.ToString()); }
public SHBNianDuCaiGouPaiMingConfig(DBServerType dbType, string connName, string notification) { PrepareDBUtil(dbType, Base.GetDBConnectionString(connName)); this.ds = new ComerNDCGPMDS(); //this.reportList.Add(new NianDuCaiGouPaiMingReport()); this.args = Base.GetParameter(notification, this.ToString()); }
public MisConfig(DBServerType dbType, string connName) { PrepareDBUtil(dbType, Base.GetDBConnectionString(connName)); this.ds = new DS(); this.reportList.Add("MisWorkReport.rdlc"); this.reportList.Add("MisReport.rdlc"); this.args = Base.GetParameter(this.ToString()); }
public static DataSet ExecuteDataset(DBServerType type, string connectionString, string spName, params object[] parameterValues) { if ((parameterValues != null) && (parameterValues.Length > 0)) { IDbDataParameter[] spParameterset = I3DBHelperParameterCache.GetSpParameterSet(connectionString, spName); AssignParameterValues(spParameterset, parameterValues); return(ExecuteDataset(type, connectionString, CommandType.StoredProcedure, spName, spParameterset)); } return(ExecuteDataset(type, connectionString, CommandType.StoredProcedure, spName)); }
public static DBServerType GetDBServerType(this ICURDProperties cURDProperties, int id = 0) { var tableAttribute = cURDProperties.GetMatchedTableAttribute(); if (tableAttribute == null) { throw new Exception("TableAttribute Not Found"); } DBServerType dBServerType = tableAttribute.DBServerType; return(dBServerType); }
protected DbParameter CreateDbParameter(DBServerType dbType) { switch (dbType) { case DBServerType.MSSQL: return(new SqlParameter()); case DBServerType.OLEDB: return(new OleDbParameter()); case DBServerType.SybaseASE: return(new AseParameter()); default: return(new SqlParameter()); } }
protected DbConnection CreateDbConnection(DBServerType dbType, string connectionString) { switch (dbType) { case DBServerType.MSSQL: return(new SqlConnection(connectionString)); case DBServerType.OLEDB: return(new OleDbConnection(connectionString)); case DBServerType.SybaseASE: return(new AseConnection(connectionString)); default: return(new SqlConnection(connectionString)); } }
public static DbDataReader ExecuteReader(DBServerType type, string connectionString, CommandType commandType, string commandText, params IDbDataParameter[] commandParameters) { DbDataReader reader; IDbConnection connection = I3DBUtil.CreateConnection(type, connectionString); connection.Open(); try { reader = ExecuteReader(connection, null, commandType, commandText, commandParameters, I3DbConnectionOwnership.Internal); } catch (Exception ex) { connection.Close(); throw; } return(reader); }
protected DbCommand CreateDbCommand(DBServerType dbType) { switch (dbType) { case DBServerType.MSSQL: return(new SqlCommand()); case DBServerType.OLEDB: return(new OleDbCommand()); case DBServerType.SybaseASE: return(new AseCommand()); default: return(new SqlCommand()); } }
public DBConnect GetDBConnect(DBServerType type) { DBConnect connect = null; switch (type) { case DBServerType.NoSQL: connect = new MongDBConnect(); break; case DBServerType.PostgreSQL: connect = new PostgreSQLConnect(); break; default: break; } return(connect); }
public static IDbConnection GetDBConnection(this ICURDProperties cURDProperties, int id = 0) { var tableAttribute = cURDProperties.GetMatchedTableAttribute(); if (tableAttribute == null) { throw new Exception("TableAttribute Not Found"); } DBServerType dBServerType = tableAttribute.DBServerType; string connectionKey = tableAttribute.ConnectionKey; string connectionString = AppSetting.GetConfig(connectionKey); string connectionStringFormat = connectionString; var IDataBaseSharding = cURDProperties as IDataBaseSharding; if (IDataBaseSharding != null) { connectionStringFormat = string.Format(connectionString, IDataBaseSharding.__DataBaseIndex__); } return(DBConnectionFactory.GetDbConnection(connectionStringFormat, dBServerType)); }
public DataTable GetQueryTable(DBServerType dbType, string connectionString, string sqlstr) { DbConnection sqlconn = CreateDbConnection(dbType, connectionString); DbCommand sqlcomm = CreateDbCommand(dbType); DbDataAdapter sqlda = CreateDbDataAdapter(dbType); sqlcomm.CommandType = CommandType.Text; sqlcomm.CommandText = sqlstr; sqlcomm.Connection = sqlconn; sqlda.SelectCommand = sqlcomm; DataTable tbl = new DataTable("tbl"); try { if (sqlconn.State == ConnectionState.Closed) { sqlconn.Open(); } sqlda.Fill(tbl); return(tbl); } catch (Exception) { return(null); } finally { if (sqlconn.State == ConnectionState.Open) { sqlconn.Close(); } sqlda.Dispose(); sqlcomm.Dispose(); sqlconn.Dispose(); } }
public static IDbConnection GetDbConnection(string connectionString, DBServerType dbType = DBServerType.SqlServer) { IDbConnection dbConnection = null; switch (dbType) { case DBServerType.SqlServer: dbConnection = new SqlConnection(connectionString); break; case DBServerType.MySql: dbConnection = new MySqlConnection(connectionString); break; case DBServerType.Oracle: dbConnection = new OracleConnection(connectionString); break; default: dbConnection = new SqlConnection(connectionString); break; } return(dbConnection); }