public void Execute(IDBAccess <Vehicle> database) { // increase all prices int percentage = InputHelper.GetValidIntegerInput("Please enter by how much percent you would like to increase the prices: "); UpdatePrices(database, percentage); }
/// <summary> /// 分库路由器,如果操作存在事务,返回的DB连接已在事务中 /// 数据库主从集群 /// </summary> /// <param name="ODASql"></param> /// <returns></returns> private IDBAccess DatabaseRouting(ODAScript ODASql) { ODAConnect conn = GetConnect(ODASql); if (_Tran == null) { return(ODAContext.NewDBConnect(conn.DBtype, conn.ConnectionString)); } else { this.CheckTransaction(ODASql); if (_Tran.TransDB.ContainsKey(conn.ConnectionString)) { return(_Tran.TransDB[conn.ConnectionString]); } else { IDBAccess DBA = ODAContext.NewDBConnect(conn.DBtype, conn.ConnectionString); DBA.BeginTransaction(); _Tran.DoCommit += DBA.Commit; _Tran.RollBacking += DBA.RollBack; _Tran.TransDB.Add(conn.ConnectionString, DBA); return(DBA); } } }
/// <summary> /// Creates an instance of this class. /// </summary> /// <param name="dbAccess">The object to access the database.</param> internal DatabaseListener(IDBAccess dbAccess) { this.dbAccess = dbAccess; jsonSettings = new JsonSerializerSettings { TypeNameHandling = TypeNameHandling.All }; }
public VendorDao(string connectionStr) { _dbAccess = DBFactory.getDBAccess(DBType.MySql, connectionStr); connStr = connectionStr; mysqlHelp = new Common.MySqlHelper(connectionStr); _serialDao = new SerialDao(connectionStr); }
public ScheduleItemDao(string connectionString) { //connectionString = "Server=127.0.0.1;database=test;user=root;pwd=198929;charset='utf8'"; //connectionString = "Server=192.168.18.166;database=test;user=root;pwd=198929;charset='utf8'"; _access = DBFactory.getDBAccess(DBType.MySql, connectionString); conStr = connectionString; }
public DeliverMasterMgr(string connectionString) { connection = connectionString; _ideliver = new DeliverMasterDao(connectionString); _access = DBFactory.getDBAccess(DBType.MySql, connectionString); }
internal string GenerateExpression(Type type, out List<DbParameter> parameters, IDBAccess dbAccess) { this.Init(type, dbAccess); parameters = new List<DbParameter>(); int i = 0; return " AND " + this.GenerateSQL(ref parameters, ref i); }
public CallerDao(string connectionString) { _access = DBFactory.getDBAccess(DBType.MySql, connectionString); _intCurrentTime = (int)BLL.gigade.Common.CommonFunction.GetPHPTime(); //_strIP = BLL.gigade.Common.CommonFunction.GetClientIP(); _strIP = CommonFunction.GetIP4Address(CommonFunction.GetClientIP()); }
private void btnTableInfo_Click(object sender, EventArgs e) { try { var config = DropdownBoxHelper.GetGenericFromComboBox <DatabaseConfig>(comboBoxDB); IDBAccess dbAccess = DBAccessManager.GetDBAccessInstance(config.DBID); var tableInfoList = dbAccess.Database.GetTableInfoList(ckGetFieldInfo.Checked); StringBuilder sb = new StringBuilder(); sb.AppendLine("----------------------------------------------------------------------------"); sb.AppendLine($"[{config.ConName}] [{tableInfoList.Count}]"); sb.AppendLine("----------------------------------------------------------------------------"); foreach (var tableInfo in tableInfoList) { sb.AppendLine($"[TableName:{tableInfo.Name}]"); sb.AppendLine($"[Comments:{tableInfo.Comments}]"); sb.AppendLine($"[PriKeyField:{string.Join(";", tableInfo.PriKeyFieldInfos.Select(t => { return t.FieldName; })) }]"); sb.AppendLine($"[Field:{string.Join(";", tableInfo.DbFieldInfos.Select(t => { return t.FieldName; })) }]"); string tmp = tableInfo.Indexs == null ? string.Empty : string.Join("; ", tableInfo.Indexs.Select(t => { return($"{t.IndexName}:{t.FieldName}"); })); sb.AppendLine($"[Index:{tmp }]"); sb.AppendLine("----------------------------------------------------------------------------"); } Loger.Info(sb.ToString()); } catch (Exception ex) { Loger.Error(ex); } }
public void Startup() { CurrentRequest.Resolver.AppName = "AdminUserData"; m_common = CurrentRequest.Resolver.Resolve <CMS.AMS.Common>(); if (m_common.LRT_Connection_State() == ConnectionState.Closed) { m_common.Open_LogixRT(); } if (m_common.LXS_Connection_State() == ConnectionState.Closed) { m_common.Open_LogixXS(); } CurrentRequest.Resolver.RegisterInstance <CommonBase>(m_common); m_common.Set_AppInfo(); m_connectorInc = new ConnectorInc(m_common); m_logger = CurrentRequest.Resolver.Resolve <ILogger>(); m_phraseLib = CurrentRequest.Resolver.Resolve <IPhraseLib>(); m_errHandler = CurrentRequest.Resolver.Resolve <IErrorHandler>(); m_authInc = new CMS.AMS.AuthLib(m_common); m_adminUser = CurrentRequest.Resolver.Resolve <IAdminUserData>(); m_dbaccess = CurrentRequest.Resolver.Resolve <IDBAccess>(); m_commonInc = new Copient.CommonInc(); }
/// <summary> /// 初始化ModifyCommandCreator,dbAccess不能为空 /// </summary> /// <exception cref="RException(DatabaseErrorCode.ConnectDbServerError - 0x00010001)"> /// 传入的dbAccess为空,引发此异常 /// </exception> /// <param name="dbAccess">数据库访问接口</param> public SelectCommandCreator(IDBAccess dbAccess) { this.DbAccess = dbAccess; FilterProterties = new string[0]; OrderBy = new SortInfo[0]; }
public VipUserMgr(string connStr) { _vipUserDao = new VipUserDao(connStr); _usersDao = new UsersDao(connStr); _dbAccess = DBFactory.getDBAccess(DBType.MySql, connStr); conn = connStr; }
public ProductTempDao(string connectStr) { _dbAccess = DBFactory.getDBAccess(DBType.MySql, connectStr); this.strConn = connectStr; reProductDao = new RecommendedProductAttributeDao(connectStr); }
/// <summary> /// 查询数据并转换为对象列表 /// </summary> /// <typeparam name="T">对象的类型</typeparam> /// <param name="Cols">查询的字段,可为空,空则返回所有字段</param> /// <returns></returns> public virtual List <T> Select <T>(params IODAColumns[] Cols) where T : class { try { ODAScript sql = this.GetSelectSql(Cols); IDBAccess db = this.GetDBAccess(sql); if (db == null) { throw new ODAException(10009, "ODACmd Select 没有执行程序"); } var prms = sql.ParamList.ToArray(); if (string.IsNullOrEmpty(_StartWithExpress) || string.IsNullOrEmpty(_ConnectByParent) || string.IsNullOrEmpty(_PriorChild)) { return(db.Select <T>(sql.SqlScript.ToString(), prms)); } else { return(db.Select <T>(sql.SqlScript.ToString(), prms, _StartWithExpress, _ConnectByParent, _PriorChild, _ConnectColumn, _ConnectStr, _MaxLevel)); } } finally { this.Clear(); } }
public PromotionBannerMgr(string connectionStr) { _promotionBannerDao = new PromotionBannerDao(connectionStr); _promotionBannerRelationDao = new PromotionBannerRelationDao(connectionStr); _mysqlDao = new MySqlDao(connectionStr); _vendorBrandDao = new VendorBrandDao(connectionStr); _accessMySql = DBFactory.getDBAccess(DBType.MySql, connectionStr); }
public PackageService(IDBAccess <SensorBatchData> sensorBatchDataStore, IDBAccess <PackageInfo> packageStore, IDBAccess <Sensor> sensorStore) { _sensorBatchDataStore = sensorBatchDataStore; _packageStore = packageStore; _sensorStore = sensorStore; }
public void Execute(IDBAccess <Vehicle> database) { int num = InputHelper.GetValidIntegerInput("Enter ID of vehicle to delete: "); Vehicle v = database.GET(num); InputHelper.GetValidConfirmationInput($"Vehicle: {v.LicensePlate}, [{v.YearBuilt}]\nAre you sure you want to remove vehicle {v.VehicleId}? (y/n): "); database.DELETE(num); }
private void ResolveDepedencies() { m_StoredValueCondition = CurrentRequest.Resolver.Resolve <CMS.AMS.Contract.IStoredValueCondition>(); m_Offer = CurrentRequest.Resolver.Resolve <CMS.AMS.Contract.IOffer>(); m_StoredValueProgram = CurrentRequest.Resolver.Resolve <IStoredValueProgramService>(); m_dbAccess = CMS.AMS.CurrentRequest.Resolver.Resolve <IDBAccess>(); m_OAWService = CurrentRequest.Resolver.Resolve <IOfferApprovalWorkflowService>(); }
public PackageController(IPackageService packageService, IDBAccess <Device> deviceStore, IDBAccess <Sensor> sensorStore) { _packageService = packageService; _deviceStore = deviceStore; _sensorStore = sensorStore; }
private void UpdatePrices(IDBAccess <Vehicle> database, int percentage) { foreach (var vehicle in database.GET()) { vehicle.PriceStrategy = new InflatedPriceStrategy(percentage); database.PUT(vehicle); } }
DataLayerAccessManager() { database = PostgresSqlConnector.Instance(); tourDAO = new TourSqlPostgresDAO(database); logDAO = new LogSqlPostgresDAO(database); fileManager = Filemanager.GetInstance(tourDAO, logDAO); mapQuest = RestDataClass.Instance(); }
/// <summary> /// 快速创建命令 /// </summary> /// <param name="dbAccess">IDBAccess</param> /// <param name="con">连接对象</param> /// <param name="sqlStr">SQL语句</param> /// <param name="parameterNameValueDic">参数名名称及对应的值字典集合[key:参数名称,含参数符号;value:参数值]</param> /// <param name="transaction">事务对象</param> /// <returns>命令</returns> public static IDbCommand CreateCommand(this IDBAccess dbAccess, IDbConnection con, string sqlStr, Dictionary <string, object> parameterNameValueDic = null, IDbTransaction transaction = null) { IDbCommand cmd = CreateCommand(dbAccess, con, parameterNameValueDic); cmd.Transaction = transaction; cmd.CommandText = sqlStr; return(cmd); }
public App(IDBAccess dbAccess, IStager stager, IScriptRunner scriptRunner, IMessageBroker messageBroker, IDataValidation dataValidation, ILogger <App> log) { Stager = stager; ScriptRunner = scriptRunner; DBAccess = dbAccess; MessageBroker = messageBroker; DataValidation = dataValidation; _log = log; }
/// <summary> /// /// </summary> /// <param name="dbaccess"></param> protected void setConnectString(IDBAccess dbaccess) { #region if (!string.IsNullOrEmpty(this._connectionString)) { dbaccess.SetConnectString(this._connectionString); } #endregion }
public ProductItemMapExcelMgr(string connectionString) { _productItemMapMgr = new ProductItemMapMgr(connectionString); _productItemMapDao = new ProductItemMapDao(connectionString); _productItemMgr = new ProductItemMgr(connectionString); _productItemDao = new ProductItemDao(connectionString); _callerMgr = new CallerMgr(connectionString); _priceMasterMgr = new PriceMasterMgr(connectionString); _access = DBAccess.DBFactory.getDBAccess(DBType.MySql, connectionString); }
/// <summary> /// 方法 /// </summary> /// <param name="connectionString">連接字符串</param> /// <param name="particularsSrcType">particularsSrcType = 1 表示使用 db數據庫 particularsSrcType = 2 表示 使用 xml 資料庫</param> public ParticularsSrcDao(string connectionString, int particularsSrcType) { this.connectionString = connectionString; this.particularsSrcType = particularsSrcType; if (particularsSrcType == 1) { _dbAccess = DBFactory.getDBAccess(DBType.MySql, connectionString); } }
public void Execute(IDBAccess <Vehicle> database) { database = (InMemoryDB)database; // list all vehicles Console.WriteLine("\nAll Cars:\n"); PrintCars(database.GET().Where(x => x.Type == VehicleType.CAR).Cast <Car>()); PrintTrucks(database.GET().Where(x => x.Type == VehicleType.TRUCK).Cast <Truck>()); Console.WriteLine("\nAll Trucks:\n\n"); }
public PromoPairDao(string connectionstring) { _access = DBFactory.getDBAccess(DBType.MySql, connectionstring); this.connStr = connectionstring; _proCateDao = new ProductCategoryDao(connectionstring); _prodCategSet = new ProductCategorySetDao(connectionstring); _prodPromoDao = new ProdPromoDao(connectionstring); _promoAllDao = new PromoAllDao(connectionstring); _serialDao = new SerialDao(connectionstring); }
public ProductSearchDao(string connectionstring, string sphinxHost, string sphinxPort) { _accessMySql = DBFactory.getDBAccess(DBType.MySql, connectionstring); _sphinxHost = GetParameterCode(sphinxHost); _sphinxPort = 0; if (!string.IsNullOrEmpty(GetParameterCode(sphinxPort))) { _sphinxPort = Convert.ToInt32(GetParameterCode(sphinxPort)); } }
public EdmContentMgr(string connectionString) { _IEdmContentDao = new EdmContentDao(connectionString); _edmContentDao = new EdmContentDao(connectionString); _edmEmailDao = new EdmEmailDao(connectionString); _vipUserDao = new VipUserDao(connectionString); _usersDao = new UsersDao(connectionString); _accessMySql = DBFactory.getDBAccess(DBType.MySql, connectionString); _edmGroupEmailDao = new EdmGroupEmailDao(connectionString); conn = connectionString; }
/// <summary> /// 有參構造函數 /// </summary> /// <param name="connectionstring">數據庫連接字符串</param> public PromotionsAmountFareDao(string connectionstring) { _access = DBFactory.getDBAccess(DBType.MySql, connectionstring); this.connStr = connectionstring; _cateDao = new ProductCategoryDao(connectionstring); _prodCateSetDao = new ProductCategorySetDao(connectionstring); _prodPromoDao = new ProdPromoDao(connectionstring); _promoAllDao = new PromoAllDao(connectionstring); _promAmountReduceDao = new PromotionsAmountReduceDao(connectionstring); _usconDao = new UserConditionDao(connectionstring); _serialDao = new SerialDao(connectionstring); }
private void FinalizeCommand(IDBAccess <Vehicle> database, Vehicle v) { PrintSummary(v); if (InputHelper.GetValidConfirmationInput("\n--> Are you sure you want to add this vehicle to the database? (y/n): ")) { database.POST(v); } else { Console.WriteLine("\tCommand aborted."); } }
public void Execute(IDBAccess <Vehicle> database) { //display impportant info Console.WriteLine("Company Overview:"); IEnumerable <Vehicle> cars = database.GET(); PrintVehicleCount(cars); PrintCarCount(cars); PrintTruckCount(cars); PrintTotalValue(cars); }
public OrderReturnStatusDao(string connectionstring) { _access = DBFactory.getDBAccess(DBType.MySql, connectionstring); _ordermasterdao = new OrderMasterDao(connectionstring); _orderDetailDao = new OrderDetailDao(connectionstring); _orderMoneyReturnDao = new OrderMoneyReturnDao(connectionstring); _vipuserGroupDao = new VipUserGroupDao(connectionstring); _itemDao = new ProductItemDao(connectionstring); _userRecommendDao = new UserRecommendDao(connectionstring); _mySqlDao = new MySqlDao(connectionstring); this.connStr = connectionstring; }
/// <summary> /// 有參構造函數 /// </summary> /// <param name="connectionstring">數據庫連接字符串</param> public PromotionsAmountDiscountDao(string connectionstring) { _access = DBFactory.getDBAccess(DBType.MySql, connectionstring); this.connStr = connectionstring; _prodpromoDao = new ProdPromoDao(connectionstring); _proCateDao = new ProductCategoryDao(connectionstring); _prodCategSet = new ProductCategorySetDao(connectionstring); _proAllDao = new PromoAllDao(connectionstring); _usconDao = new UserConditionDao(connectionstring); _promoDisDao = new PromoDiscountDao(connectionstring); _mySql = new MySqlDao(connectionstring); }
protected void Page_Load(object sender, EventArgs e) { if (IsMultiLanguageEnabled) { systemSettings = CurrentRequest.Resolver.Resolve <ISystemSettings>(); dbAccess = CurrentRequest.Resolver.Resolve <IDBAccess>(); //tbRdesc.Attributes.Add("onfocus","javascript:ShowMLI('"+ tbRdesc.ClientID + "', event, false);"); Int32.TryParse(systemSettings.GetGeneralSystemOption(125).Result.OptionValue, out CustomerFacingLangID); if (!this.Page.IsPostBack) { defaultLanguageId = ((AuthenticatedUI)this.Page).LanguageID; LoadTranslations(MLIdentifierValue); } if (repMLIInputs != null) { foreach (RepeaterItem rep in repMLIInputs.Items) { if (rep != null) { TextBox tbTranslation = ((TextBox)rep.FindControl("tbTranslation")); int langId = Convert.ToInt32(((HiddenField)rep.FindControl("hfLangId")).Value); if (tbTranslation != null && CustomerFacingLangID == langId) { if ((tbTranslation.ID.IndexOf("_default")) == -1) { tbTranslation.ID += "_default"; } } } } } //LoadTranslations(358); tbMLI.Attributes.Add("onfocus", "javascript:ShowMLI('" + tbMLI.ClientID + "','" + divML.ClientID + "','" + divMLWrap.ClientID + "', event);"); btnMLClose.Attributes.Add("onclick", "return HideMLI('" + tbMLI.ClientID + "','" + divML.ClientID + "', event);"); imgMLI.Attributes.Add("onmouseout", "return HideMLI('" + tbMLI.ClientID + "','" + divML.ClientID + "', event);"); imgMLI.Attributes.Add("onmouseover", "javascript:ShowMLI('" + tbMLI.ClientID + "','" + divML.ClientID + "','" + divMLWrap.ClientID + "', event);"); imgMLI.Attributes.Add("onclick", "javascript:ShowMLI('" + tbMLI.ClientID + "','" + divML.ClientID + "','" + divMLWrap.ClientID + "', event);"); tbMLI.Attributes.Add("onBlur", "javascript:return findHTMLTags('" + tbMLI.ClientID + "','" + Copient.PhraseLib.Lookup("categories.invalidname", defaultLanguageId) + "',event);"); TextBox tb = (TextBox)repMLIInputs.Controls[0].FindControl("tbTranslation_default"); if (tb == null) { tb = (TextBox)repMLIInputs.Controls[0].FindControl("tbTranslation"); } tb.Attributes.Add("onBlur", "javascript:return findHTMLTags('" + tb.ClientID + "','" + Copient.PhraseLib.Lookup("categories.invalidname", defaultLanguageId) + "',event);"); } else { imgMLI.Visible = false; //tbMLI.Text = MLDefaultLanguageStandardValue; } }
private void btnPagingQuery_Click(object sender, EventArgs e) { try { var config = DropdownBoxHelper.GetGenericFromComboBox <DatabaseConfig>(comboBoxDB); this._dbAccess = DBAccessManager.GetDBAccessInstance(config.DBID); this.QueryPageInfo(this._dbAccess); } catch (Exception ex) { Loger.Error(ex); } }
private void btnDataBaseName_Click(object sender, EventArgs e) { try { var config = DropdownBoxHelper.GetGenericFromComboBox <DatabaseConfig>(comboBoxDB); IDBAccess dbAccess = DBAccessManager.GetDBAccessInstance(config.DBID); string databaseName = dbAccess.Database.GetDatabaseName(); Loger.Info($"[{config.ConName}] [DatabaseName:{databaseName}]"); } catch (Exception ex) { Loger.Error(ex); } }
public PrepayViewModel( IFcsService fcsService, IMvxLog log, IMvxNavigationService navigationService, IDBAccess dbService, PosManager posManager, IMessageBoxService messageBoxService) { this.fcsService = fcsService; this.log = log; this.navigationService = navigationService; this.dbService = dbService; this.posManager = posManager; this.messageBoxService = messageBoxService; }
private void btnQuery_Click(object sender, EventArgs e) { try { var config = DropdownBoxHelper.GetGenericFromComboBox <DatabaseConfig>(comboBoxDB); IDBAccess dbAccess = DBAccessManager.GetDBAccessInstance(config.DBID); string sql = @"SELECT ID,SensNo,SensLocation,SensType,AddTime FROM Sensors"; DataTable dt = dbAccess.QueryDataToDataTable(sql); dgv.ShowData(dt); } catch (Exception ex) { Loger.Error(ex); } }
internal virtual void Init(Type objectType, IDBAccess dbAccess) { TypeSchema entityInfo = ORMSchemaCache.GetTypeSchema(objectType); SchemaItem fieldInfo = entityInfo.GetFieldInfoByPropertyName(this._propertyName); if (fieldInfo == null) { throw new ArgumentException(string.Format("{0} - Property \"{1}\" not define a mapping field.", this.GetType(), _propertyName)); } Type type = fieldInfo.ProInfo.PropertyType; type = Nullable.GetUnderlyingType(type) ?? type; this._dbType = ORMHelper.GetDbTypeByName(type); this._fieldName = fieldInfo.MappingFieldAttribute.FieldName; this._dbAccess = dbAccess; }
/// <summary> /// 有參構造函數 /// </summary> /// <param name="connectionstring">數據庫連接字符串</param> public PromotionsAmountGiftDao(string connectionstring) { _access = DBFactory.getDBAccess(DBType.MySql, connectionstring); this.connStr = connectionstring; _proCateDao = new ProductCategoryDao(connectionstring); _prodCategSetDao = new ProductCategorySetDao(connectionstring); _prodpromoDao = new ProdPromoDao(connectionstring); _proAllDao = new PromoAllDao(connectionstring); _usconDao = new UserConditionDao(connectionstring); _promoDisDao = new PromoDiscountDao(connectionstring); _serialDao = new SerialDao(connectionstring); _ptDao = new PromoTicketDao(connectionstring); _prodDao = new ProductDao(connectionstring); _promoMainDao = new PromotionsMaintainDao(connectionstring); _vendorBrandDao = new VendorBrandDao(connectionstring); }
public PosManager(IAppSettings appSettings, IFcsService fcsService, IMvxLog log, IDBAccess dbAccess) { this.appSettings = appSettings; this.fcsService = fcsService; this.log = log; this.dbAccess = dbAccess; oldSaleFileLocation = Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location); oldSaleFileLocation = Path.Combine(oldSaleFileLocation, "OldSales.xml"); PosCompany = this.dbAccess.GetCompany(); CanCloseApp = true; basketQueue = new Queue <BasketRequest>(); }
private void btnLoad_Click(object sender, EventArgs e) { try { var dbConfig = DropdownBoxHelper.GetGenericFromComboBox <DatabaseConfig>(comboBoxDB); var para = new PartAsynWaitPara <DatabaseConfig, object>(); para.Caption = "查询数据库结构"; para.IsShowCancel = false; para.Para = dbConfig; para.Function = (p) => { p.AsynWait.Hint = $"正在查询数据库[{dbConfig.ConName}]结构,请稍候..."; IDBAccess dbAccess = DBAccessManager.GetDBAccessInstance(p.Para.DBID); this._tableList = dbAccess.Database.GetTableInfoList(true).OrderBy(t => { return(t.Name); }).Select(t => { return(new DBTableInfoEx(t)); }).ToList(); if (p.AsynWait.InvokeRequired) { p.AsynWait.Invoke(new Action(() => { this._tableBindingList.Clear(); this._tableBindingList.AddRange(this._tableList); })); } else { this._tableBindingList.Clear(); this._tableBindingList.AddRange(this._tableList); } return(null); }; para.Completed = (ret) => { if (ret.Status == PartAsynExcuteStatus.Exception) { Loger.Error(ret.Exception); } }; PartAsynWaitHelper.Wait(para, this); } catch (Exception ex) { Loger.Error(ex); MessageBox.Show(ex.Message); } }
protected virtual IDBAccess GetDBAccess(ODAScript ODASql) { IDBAccess DBA = DatabaseRouting(ODASql); if (DBA.ExecutingCommand == null) { DBA.ExecutingCommand = ExecutingCommand; } ExecuteEventArgs arg = new ExecuteEventArgs() { DBA = DBA, SqlParams = ODASql, }; FireODASqlEvent(arg); return(arg.DBA); }
/// <summary> /// 快速创建命令 /// </summary> /// <param name="dbAccess">IDBAccess</param> /// <param name="con">连接对象</param> /// <param name="parameterNameValueDic">参数名名称及对应的值字典集合[key:参数名称,含参数符号;value:参数值]</param> /// <returns>命令</returns> public static IDbCommand CreateCommand(this IDBAccess dbAccess, IDbConnection con, Dictionary <string, object> parameterNameValueDic = null) { var cmd = con.CreateCommand(); if (parameterNameValueDic != null && parameterNameValueDic.Count > 0) { foreach (var kv in parameterNameValueDic) { AddParameter(cmd, kv.Key, kv.Value); } } var config = dbAccess.Config; SetCommandPara(cmd, config); return(cmd); }
private IDBAccess NewDBConnect(DbAType dbtype, string Connecting) { IDBAccess DBA = null; switch (dbtype) { case DbAType.DB2: DBA = new DbADB2(Connecting); break; case DbAType.MsSQL: DBA = new DbAMsSQL(Connecting); break; case DbAType.MySql: DBA = new DbAMySql(Connecting); break; #if NET_FW case DbAType.OdbcInformix: DBA = new DbAOdbcInformix(Connecting); break; case DbAType.OledbAccess: DBA = new DbAOledbAccess(Connecting); break; #endif case DbAType.Oracle: DBA = new DbAOracle(Connecting); break; case DbAType.SQLite: DBA = new DbASQLite(Connecting); break; case DbAType.Sybase: DBA = new DbASybase(Connecting); break; } if (this.CommandTimeOut != 0) { DBA.CommandTimeOut = this.CommandTimeOut; } return(DBA); }
public EventChinatrustDao(string connectionString) { _access = DBFactory.getDBAccess(DBType.MySql, connectionString); }
public CalendarDao(string connectionString) { _access = DBFactory.getDBAccess(DBType.MySql, connectionString); connStr = connectionString; }
public TrialPictureDao(string connectionString) { _access = DBFactory.getDBAccess(DBType.MySql, connectionString); this.connStr = connectionString; }
/// <summary> /// ��ʼ��ModifyCommandCreator��dbAccess����Ϊ�� /// </summary> /// <exception cref="RException(DatabaseErrorCode.ConnectDbServerError - 0x00010001)"> /// �����dbAccessΪ�գ��������쳣 /// </exception> /// <param name="dbAccess">���ݿ���ʽӿ�</param> public InsertCommandCreator(IDBAccess dbAccess) { DbAccess = dbAccess; }
public CheckOrderAmountMgr(string connectionString) { _accessMySql = DBFactory.getDBAccess(DBType.MySql, connectionString); mySqlConnectionString = connectionString; }
public SiteDao(string connectionString) { _groupAuthMapMgr = new GroupAuthMapMgr(connectionString); _access = DBFactory.getDBAccess(DBType.MySql, connectionString); }
public BannerCategoryDao(string connectionString) { _access = DBFactory.getDBAccess(DBType.MySql, connectionString); }
public WebContentType1Dao(string connectionString) { _connStr = connectionString; _access = DBFactory.getDBAccess(DBType.MySql, connectionString); }
public AseldMasterDao(string connectionString) { _access = DBFactory.getDBAccess(DBType.MySql, connectionString); }
public ShippingVoucherDao(string connectionString) { accessMySql = DBFactory.getDBAccess(DBType.MySql, connectionString); this.connStr = connectionString; }
internal override void Init(Type objectType, IDBAccess dbAccess) { this._objectType = objectType; this._dbAccess = dbAccess; }
public UserRecommendDao(string connectionstring) { _access = DBFactory.getDBAccess(DBType.MySql, connectionstring); this.connStr = connectionstring; }