Ejemplo n.º 1
0
        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());
        }
Ejemplo n.º 2
0
        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();
            }
        }
Ejemplo n.º 3
0
 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());
 }
Ejemplo n.º 4
0
 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());
 }
Ejemplo n.º 5
0
 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());
 }
Ejemplo n.º 6
0
        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();
            }
        }
Ejemplo n.º 7
0
 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());
 }
Ejemplo n.º 8
0
        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());
        }
Ejemplo n.º 10
0
 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());
 }
Ejemplo n.º 11
0
        public YuqiweijieancaigoudanConfig(DBServerType dbType, string connName, string notification)
        {
            PrepareDBUtil(dbType, Base.GetDBConnectionString(connName));
            this.ds = new YuqiweijieancaigoudanDS();

            this.args = Base.GetParameter(notification, this.ToString());
        }
Ejemplo n.º 12
0
 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());
 }
Ejemplo n.º 15
0
 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());
 }
Ejemplo n.º 16
0
 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));
     }
 }
Ejemplo n.º 17
0
 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());
 }
Ejemplo n.º 18
0
 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());
 }
Ejemplo n.º 19
0
        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());
        }
Ejemplo n.º 20
0
 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());
 }
Ejemplo n.º 21
0
 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));
 }
Ejemplo n.º 22
0
        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);
        }
Ejemplo n.º 23
0
        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());
            }
        }
Ejemplo n.º 24
0
        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));
            }
        }
Ejemplo n.º 25
0
        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);
        }
Ejemplo n.º 26
0
        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());
            }
        }
Ejemplo n.º 27
0
        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);
        }
Ejemplo n.º 28
0
        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));
        }
Ejemplo n.º 29
0
        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();
            }
        }
Ejemplo n.º 30
0
        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);
        }