public ICompanyDAO CreateCompanyDAO() { ICompanyDAO dao = null; if (_DbType == DatabaseType.SqlServer) { dao = new SqlServer.CompanyDAO(); } else if (_DbType == DatabaseType.MySql) { dao = new SqlServer.CompanyDAO(); } else if (_DbType == DatabaseType.Oracole) { dao = new SqlServer.CompanyDAO(); } else if (_DbType == DatabaseType.DB2) { dao = new SqlServer.CompanyDAO(); } else if (_DbType == DatabaseType.Postgre) { dao = new SqlServer.CompanyDAO(); } return(dao); }
/// <summary> /// 根据条件进行模糊搜索 /// </summary> /// <param name="searchCond">搜索条件</param> /// <returns></returns> public List <Company> SearchCompanies(string searchCond) { using (IDbConnection conn = DAOFactory.Instance.OpenConnection()) { ICompanyDAO dao = DAOFactory.Instance.CreateCompanyDAO(); return(dao.SearchCompanies(searchCond, searchCond, conn)); } }
/// <summary> /// 根据ID获取关联单位(客户/供应商) /// </summary> /// <param name="id">ID</param> /// <returns></returns> public Company RetrieveCompany(int id) { using (IDbConnection conn = DAOFactory.Instance.OpenConnection()) { ICompanyDAO dao = DAOFactory.Instance.CreateCompanyDAO(); return(dao.SelectCompany(id, conn)); } }
/// <summary> /// 获取所有单位(客户/供货商) /// </summary> /// <returns>所有单位(客户/供货商)</returns> public List <Company> GetAllCompanies() { using (IDbConnection conn = DAOFactory.Instance.OpenConnection()) { ICompanyDAO dao = DAOFactory.Instance.CreateCompanyDAO(); return(dao.SelectAllCompanies(conn)); } }
/// <summary> /// 删除一个关联单位(客户/供货商) /// </summary> /// <param name="company">客户/供货商</param> /// <param name="deleter">删除人</param> public void DeleteCompany(Company company, string deleter) { using (IDbConnection conn = DAOFactory.Instance.OpenConnection()) { ICompanyDAO dao = DAOFactory.Instance.CreateCompanyDAO(); dao.DeleteCompany(company.ID, conn); } }
/// <summary> /// 保存一个修改的关联单位(客户/供货商) /// </summary> /// <param name="company">修改的关联单位</param> /// <param name="Modifier">修改人</param> public void SaveCompany(Company company, string Modifier) { using (IDbConnection conn = DAOFactory.Instance.OpenConnection()) { ICompanyDAO dao = DAOFactory.Instance.CreateCompanyDAO(); dao.UpdateCompany(company, conn); } }
public CompanyController(ILogger <CompanyController> logger, ICompanyDAO companyDAO, ITickerDAO tickerDAO, IExchangeDAO exchangeDAO, ICompanyExchangeDAO companyExchangeDAO) { _logger = logger; this.companyDAO = companyDAO; this.tickerDAO = tickerDAO; this.exchangeDAO = exchangeDAO; this.companyExchangeDAO = companyExchangeDAO; }
public Company GetCompanyByCode(string code) { using (IDbConnection conn = DAOFactory.Instance.OpenConnection()) { ICompanyDAO dao = DAOFactory.Instance.CreateCompanyDAO(); return(dao.SelectCompany(code, conn)); } }
/// <summary> /// 增加一个关联单位(客户/供货商) /// </summary> /// <param name="company">创建的单位</param> /// <param name="creator">创建人</param> public void CreateCompany(Company company, string creator) { using (IDbConnection conn = DAOFactory.Instance.OpenConnection()) { ICompanyDAO dao = DAOFactory.Instance.CreateCompanyDAO(); dao.InsertCompany(company, conn); } }
public SubscriptionNotificationService(ISubscriptionDAO subscriptionDao, IMapper mapper, SubscriptionUtils subscriptionUtils, IUserDAO userDao, ICompanyDAO companyDao) { _subscriptionDao = subscriptionDao; _mapper = mapper; _subscriptionUtils = subscriptionUtils; _userDao = userDao; _companyDao = companyDao; }
public AdministrationService(IProjectDAO projectDao, IUserDAO userDao, ICompanyDAO companyDao, IProjectStaffDAO projectStaffDao, ITaskDAO taskDao) { this._projectDao = projectDao; this._userDao = userDao; this._companyDao = companyDao; this._projectStaffDao = projectStaffDao; this._taskDao = taskDao; }
public SubscriptionUtils(IUserDAO userDao, ITaskDAO taskDao, ISubscriptionDAO subscriptionDao, IProjectStaffDAO projectStaffDao, IProjectDAO projectDao, IMapper mapper, ICompanyDAO companyDao, ICategoryDAO categoryDao) { _userDao = userDao; _taskDao = taskDao; _subscriptionDao = subscriptionDao; _projectStaffDao = projectStaffDao; _projectDao = projectDao; _mapper = mapper; _companyDao = companyDao; _categoryDao = categoryDao; }
public ICompanyDAO CreateCompanyDAO() { ICompanyDAO dao = null; if (_DbType == DatabaseType.SqlServer) { dao = new SqlServer.CompanyDAO(); } else if (_DbType == DatabaseType.MySQL) { //dao = new MySQL.EventLogDAO(); } return(dao); }
public void Setup() { // Insert seed data into the database using one instance of the context using (var context = new CompanyDBContext(options)) { context.Database.EnsureDeleted(); context.Companys.Add(new Models.Company { Id = 1, Name = "Company1", ISIN = "ER00001", Website = "test1.com" }); context.Companys.Add(new Models.Company { Id = 2, Name = "Company2", ISIN = "ER00002", Website = "test2.com" }); context.Companys.Add(new Models.Company { Id = 3, Name = "Company3", ISIN = "ER00003", Website = "test3.com" }); context.Companys.Add(new Models.Company { Id = 4, Name = "Company4", ISIN = "ER00004", Website = "test4.com" }); context.SaveChanges(); } dao = new CompanyDAO(new CompanyDBContext(options)); }
public PinzAdminService(ICompanyDAO companyDao) { this._companyDao = companyDao; }
public AdminController(IAdminDAO _adminDAO, ICompanyDAO _companyDAO) { adminDAO = _adminDAO; companyDAO = _companyDAO; }
public ResponseController(IResponseProcessingDAO _response, ICompanyDAO _company) { responseProcessing = _response; company = _company; }
public CompanyService() { _companyDAO = new CompanyDAO(); }