public void eFRLogin() { CompanyPage cmp = new CompanyPage(driver); cmp.EnterCompany("optum"); browser.StepPassed("Entered Company Name as -optum"); }
/// <summary> /// Run the code example. /// </summary> /// <param name="user">The DFP user object running the code example.</param> public override void Run(DfpUser user) { // Get the CompanyService. CompanyService companyService = (CompanyService) user.GetService(DfpService.v201508.CompanyService); // Create a statement to only select companies that are advertisers sorted // by name. StatementBuilder statementBuilder = new StatementBuilder() .Where("type = :advertiser") .OrderBy("name ASC") .Limit(StatementBuilder.SUGGESTED_PAGE_LIMIT) .AddValue("advertiser", CompanyType.ADVERTISER.ToString()); CompanyPage page = new CompanyPage(); try { do { // Get companies by statement. page = companyService.getCompaniesByStatement(statementBuilder.ToStatement()); if (page.results != null && page.results.Length > 0) { int i = page.startIndex; foreach (Company company in page.results) { Console.WriteLine("{0}) Company with ID = {1}, name = {2} and type = {3} was found", i, company.id, company.name, company.type); i++; } } statementBuilder.IncreaseOffsetBy(StatementBuilder.SUGGESTED_PAGE_LIMIT); } while (statementBuilder.GetOffset() < page.totalResultSetSize); Console.WriteLine("Number of results found: {0}", page.totalResultSetSize); } catch (Exception e) { Console.WriteLine("Failed to get companies. Exception says \"{0}\"", e.Message); } }
/// <summary> /// Run the code example. /// </summary> public void Run(DfpUser user) { // Get the CompanyService. CompanyService companyService = (CompanyService) user.GetService(DfpService.v201608.CompanyService); // Set the ID of the company to update. int companyId = int.Parse(_T("INSERT_COMPANY_ID_HERE")); // Create a statement to select the company by ID. StatementBuilder statementBuilder = new StatementBuilder() .Where("id = :companyId") .OrderBy("id ASC") .Limit(1) .AddValue("companyId", companyId); try { // Get the companies by statement. CompanyPage page = companyService.getCompaniesByStatement(statementBuilder.ToStatement()); Company company = page.results[0]; // Update the company comment company.comment = company.comment + " Updated."; // Update the company on the server. Company[] companies = companyService.updateCompanies(new Company[] {company}); foreach (Company updatedCompany in companies) { Console.WriteLine("Company with ID = {0}, name = {1}, and comment \"{2}\" was updated.", updatedCompany.id, updatedCompany.name, updatedCompany.comment); } } catch (Exception e) { Console.WriteLine("Failed to update companies. Exception says \"{0}\"", e.Message); } }
/// <summary> /// Run the code example. /// </summary> /// <param name="user">The DFP user object running the code example.</param> public override void Run(DfpUser user) { // Get the CompanyService. CompanyService companyService = (CompanyService) user.GetService(DfpService.v201511.CompanyService); // Set defaults for page and statement. CompanyPage page = new CompanyPage(); StatementBuilder statementBuilder = new StatementBuilder() .OrderBy("id ASC") .Limit(StatementBuilder.SUGGESTED_PAGE_LIMIT); try { do { // Get companies by statement. page = companyService.getCompaniesByStatement(statementBuilder.ToStatement()); if (page.results != null && page.results.Length > 0) { int i = page.startIndex; foreach (Company company in page.results) { Console.WriteLine("{0}) Company with ID = {1}, name = {2} and type = {3} was found", i, company.id, company.name, company.type); i++; } } statementBuilder.IncreaseOffsetBy(StatementBuilder.SUGGESTED_PAGE_LIMIT); } while (statementBuilder.GetOffset() < page.totalResultSetSize); Console.WriteLine("Number of results found: {0}", page.totalResultSetSize); } catch (Exception e) { Console.WriteLine("Failed to get companies. Exception says \"{0}\"", e.Message); } }
/// <summary> /// Run the code example. /// </summary> /// <param name="user">The DFP user object running the code example.</param> public override void Run(DfpUser user) { // Get the CompanyService. CompanyService companyService = (CompanyService)user.GetService(DfpService.v201311.CompanyService); // Create a Statement to only select companies that are advertisers sorted // by name. Statement statement = new StatementBuilder("WHERE type = :advertiser ORDER BY name " + "LIMIT 500").AddValue("advertiser", CompanyType.ADVERTISER.ToString()).ToStatement(); try { // Get companies by Statement. CompanyPage page = companyService.getCompaniesByStatement(statement); if (page.results != null) { int i = page.startIndex; foreach (Company company in page.results) { Console.WriteLine("{0}) Company with ID = {1}, name = {2} and type = {3} was found", i, company.id, company.name, company.type); i++; } } Console.WriteLine("Number of results found: {0}", page.totalResultSetSize); } catch (Exception ex) { Console.WriteLine("Failed to get companies. Exception says \"{0}\"", ex.Message); } }
public void WhenIAmAbletoVerifyEditedCompanyWithEditedName() { var editcompanyPage = new CompanyPage(); var result = CompanyPage.IsEditRecordCreated(driver); Assert.IsTrue(result, "NO TM Record created for code : "); }
public void ThenIAmAbleToVerifyEditedCompanyGotDeleted() { var deletecompanyPage = new CompanyPage(); var result = CompanyPage.IsRecordDeleted(driver); Assert.IsTrue(result, "NO TM Record created for code : "); }
public void SetUp() { loginPage = new LoginPage(); _addNewLead = new AddNewLead(); _dashboardPage = new DashboardPage(); companyPage = new CompanyPage(); headerPanel = new HeaderPanel(); }
public void DeleteCompanyTest() { HomePage homeObj = new HomePage(); homeObj.NavigateToCompany(driver); CompanyPage companyObj = new CompanyPage(); companyObj.DeleteCompany(driver); }
public void DeleteCompanyTests() { //obj init and define for home page HomePage homepageobj = new HomePage(); homepageobj.NavigateToCompany(driver); // Test 3- check if the user is able to delete Company successfully CompanyPage deleteCompanyObj = new CompanyPage(); deleteCompanyObj.DeleteCompany(driver); }
/// <summary> /// Run the code example. /// </summary> /// <param name="user">The DFP user object running the code example.</param> public override void Run(DfpUser user) { // Get the CompanyService. CompanyService companyService = (CompanyService)user.GetService(DfpService.v201311.CompanyService); // Create a Statement to only select companies that are advertisers. Statement statement = new StatementBuilder("WHERE type = :advertiser LIMIT 500").AddValue( "advertiser", CompanyType.ADVERTISER.ToString()).ToStatement(); try { // Get the companies by Statement. CompanyPage page = companyService.getCompaniesByStatement(statement); if (page.results != null && page.results.Length > 0) { Company[] companies = page.results; // Update each local company object by appending LLC. to its name. foreach (Company company in companies) { company.name = company.name + " LLC."; } // Update the companies on the server. companies = companyService.updateCompanies(companies); if (companies != null && companies.Length > 0) { int i = 0; foreach (Company company in companies) { Console.WriteLine("{0}) Company with ID = {1}, name = {2} was updated", i, company.id, company.name, company.type); i++; } } else { Console.WriteLine("No companies updated."); } } else { Console.WriteLine("No companies found to update."); } } catch (Exception ex) { Console.WriteLine("Failed to update companies. Exception says \"{0}\"", ex.Message); } }
public void DeleteCompanyTest() { // Object init and define for home page HomePage homeObj = new HomePage(); homeObj.NavigateToCompany(driver); // Test 3 - Check if the user is able to delete company successfully // Object init and define for TM page CompanyPage companyObj = new CompanyPage(); companyObj.DeleteCompany(driver); }
public void EditCompanyTests() { //obj init and define for home page HomePage homepageobj = new HomePage(); homepageobj.NavigateToCompany(driver); // Test 2- check if the user is able to edit company successfully CompanyPage editCompanyObj = new CompanyPage(); editCompanyObj.EditCompany(driver); }
public void CreateNewCompanyTests() { //obj init and define for home page HomePage homepageobj = new HomePage(); homepageobj.NavigateToCompany(driver); // Test 1- check if the user is able to create company successfully //obj init and define for createTM CompanyPage createCompanyObj = new CompanyPage(); createCompanyObj.CreateCompany(driver); }
public async Task GetCompany(int id) { string userId = AuthJWT.GetCurrentId(HttpContext, out int status); if (status != 0 || userId == null) { userId = null; } var company = await Company.Get(_db, id);//(int) CompanyPage res = await CompanyPage.LoadAllForView(_db, company, userId); Response.ContentType = "application/json"; await Response.WriteAsync(JsonConvert.SerializeObject(res, new JsonSerializerSettings { Formatting = Formatting.Indented })); }
/// <summary> /// Run the code example. /// </summary> /// <param name="user">The DFP user object running the code example.</param> public void Run(DfpUser user) { CompanyService companyService = (CompanyService)user.GetService(DfpService.v201608.CompanyService); // Create a statement to select companies. StatementBuilder statementBuilder = new StatementBuilder() .Where("type = :type") .OrderBy("id ASC") .Limit(StatementBuilder.SUGGESTED_PAGE_LIMIT) .AddValue("type", CompanyType.ADVERTISER.ToString()); // Retrieve a small amount of companies at a time, paging through // until all companies have been retrieved. CompanyPage page = new CompanyPage(); try { do { page = companyService.getCompaniesByStatement(statementBuilder.ToStatement()); if (page.results != null) { // Print out some information for each company. int i = page.startIndex; foreach (Company company in page.results) { Console.WriteLine("{0}) Company with ID \"{1}\", name \"{2}\", " + "and type \"{3}\" was found.", i++, company.id, company.name, company.type); } } statementBuilder.IncreaseOffsetBy(StatementBuilder.SUGGESTED_PAGE_LIMIT); } while (statementBuilder.GetOffset() < page.totalResultSetSize); Console.WriteLine("Number of results found: {0}", page.totalResultSetSize); } catch (Exception e) { Console.WriteLine("Failed to get companies. Exception says \"{0}\"", e.Message); } }
public void TestGetCompaniesByStatement() { Statement statement = new Statement(); statement.query = string.Format("WHERE id = {0} ORDER BY name LIMIT 1", testCompany1.id); CompanyPage page = null; Assert.DoesNotThrow(delegate() { page = companyService.getCompaniesByStatement(statement); }); Assert.NotNull(page); Assert.NotNull(page.results); Assert.AreEqual(page.results.Length, 1); Assert.NotNull(page.results[0]); Assert.AreEqual(page.results[0].id, testCompany1.id); Assert.AreEqual(page.results[0].name, testCompany1.name); }
/// <summary> /// Run the code example. /// </summary> public void Run(DfpUser dfpUser) { CompanyService companyService = (CompanyService)dfpUser.GetService(DfpService.v201611.CompanyService); // Create a statement to select companies. int pageSize = StatementBuilder.SUGGESTED_PAGE_LIMIT; StatementBuilder statementBuilder = new StatementBuilder() .Where("type = :type") .OrderBy("id ASC") .Limit(pageSize) .AddValue("type", CompanyType.ADVERTISER.ToString()); // Retrieve a small amount of companies at a time, paging through until all // companies have been retrieved. int totalResultSetSize = 0; do { CompanyPage page = companyService.getCompaniesByStatement( statementBuilder.ToStatement()); // Print out some information for each company. if (page.results != null) { totalResultSetSize = page.totalResultSetSize; int i = page.startIndex; foreach (Company company in page.results) { Console.WriteLine( "{0}) Company with ID {1}, name \"{2}\", and type \"{3}\" was found.", i++, company.id, company.name, company.type ); } } statementBuilder.IncreaseOffsetBy(pageSize); } while (statementBuilder.GetOffset() < totalResultSetSize); Console.WriteLine("Number of results found: {0}", totalResultSetSize); }
public App() { Page p; if (!IsUserLoggedIn) { p = new LoginPage(); } else { p = new CompanyPage(); } MainPage = new NavigationPage(p) { BarBackgroundColor = Color.FromHex("#222222"), BarTextColor = Color.FromHex("#EEEEEE") }; }
static void Main(string[] args) { Console.WriteLine("Input your quickfs email: "); var email = Console.ReadLine(); Console.WriteLine("Input your quickfs password: "******"Enter a comma seperated list of tickers: "); var commaSeperatedTickers = Console.ReadLine().Replace(" ", ""); List <string> tickers = commaSeperatedTickers.Split(",").ToList(); var loginModel = new LoginModel { Email = email, Password = password }; _shortPause = 3 * 1000; _driver = new ChromeDriver(); _driver.Manage().Window.Maximize(); //quickfs _homePageQuickFs = new Backend.Pages.QuickFs.HomePage(_driver); _searchResultsPage = new SearchResultsPage(_driver); _companyPage = new CompanyPage(_driver); _loginPage = new LoginPage(_driver); _balanceSheetPage = new BalanceSheetPage(_driver); //yahoo _homePageYahoo = new Backend.Pages.Yahoo.HomePage(_driver); _summaryPageYahoo = new Backend.Pages.Yahoo.SummaryPage(_driver); _analysisPageYahoo = new Backend.Pages.Yahoo.AnalysisPage(_driver); //msm money _homePageMsmMoney = new Backend.Pages.MsmMoney.HomePage(_driver); _companiesAndMarketsPage = new CompaniesAndMarketsPage(_driver); _summaryPageMsmMoney = new Backend.Pages.MsmMoney.SummaryPage(_driver); _analysisPageMsmMoney = new Backend.Pages.MsmMoney.AnalysisPage(_driver); TickersToStickers(tickers, loginModel); _driver.Dispose(); }
public List <PlacementsAccount> GetAccounts() { var accts = new List <PlacementsAccount>(); DfpUser user = new DfpUser(); CompanyService companyService = (CompanyService)user.GetService(DfpService.v201411.CompanyService); // Set defaults for page and statement. CompanyPage page = new CompanyPage(); StatementBuilder statementBuilder = new StatementBuilder() .OrderBy("id ASC") .Limit(StatementBuilder.SUGGESTED_PAGE_LIMIT); try { do { // Get companies by statement. page = companyService.getCompaniesByStatement(statementBuilder.ToStatement()); if (page.results != null && page.results.Length > 0) { int i = page.startIndex; foreach (Company company in page.results) { accts.Add(ConvertGoogleCompanyToPlacementsAccount(company)); i++; } } statementBuilder.IncreaseOffsetBy(StatementBuilder.SUGGESTED_PAGE_LIMIT); } while (statementBuilder.GetOffset() < page.totalResultSetSize); } catch (Exception ex) { Console.WriteLine("Failed to get companies. Exception says \"{0}\"", ex.Message); } return(accts); }
/// <summary> /// Run the code example. /// </summary> /// <param name="user">The DFP user object running the code example.</param> public override void Run(DfpUser user) { // Get the CompanyService. CompanyService companyService = (CompanyService)user.GetService(DfpService.v201408.CompanyService); // Create a Statement to only select companies that are advertisers sorted // by name. StatementBuilder statementBuilder = new StatementBuilder() .Where("type = :advertiser") .OrderBy("name ASC") .Limit(StatementBuilder.SUGGESTED_PAGE_LIMIT) .AddValue("advertiser", CompanyType.ADVERTISER.ToString()); CompanyPage page = new CompanyPage(); try { do { // Get companies by Statement. page = companyService.getCompaniesByStatement(statementBuilder.ToStatement()); if (page.results != null && page.results.Length > 0) { int i = page.startIndex; foreach (Company company in page.results) { Console.WriteLine("{0}) Company with ID = {1}, name = {2} and type = {3} was found", i, company.id, company.name, company.type); i++; } } statementBuilder.IncreaseOffsetBy(StatementBuilder.SUGGESTED_PAGE_LIMIT); } while (statementBuilder.GetOffset() < page.totalResultSetSize); Console.WriteLine("Number of results found: {0}", page.totalResultSetSize); } catch (Exception ex) { Console.WriteLine("Failed to get companies. Exception says \"{0}\"", ex.Message); } }
/// <summary> /// Run the code example. /// </summary> /// <param name="user">The DFP user object running the code example.</param> public override void Run(DfpUser user) { // Get the CompanyService. CompanyService companyService = (CompanyService)user.GetService(DfpService.v201311.CompanyService); // Set defaults for page and Statement. CompanyPage page = new CompanyPage(); Statement statement = new Statement(); int offset = 0; try { do { // Create a Statement to get all companies. statement.query = string.Format("LIMIT 500 OFFSET {0}", offset); // Get companies by Statement. page = companyService.getCompaniesByStatement(statement); if (page.results != null && page.results.Length > 0) { int i = page.startIndex; foreach (Company company in page.results) { Console.WriteLine("{0}) Company with ID = {1}, name = {2} and type = {3} was found", i, company.id, company.name, company.type); i++; } } offset += 500; } while (offset < page.totalResultSetSize); Console.WriteLine("Number of results found: {0}", page.totalResultSetSize); } catch (Exception ex) { Console.WriteLine("Failed to get companies. Exception says \"{0}\"", ex.Message); } }
/// <summary> /// Run the code example. /// </summary> /// <param name="user">The DFP user object running the code example.</param> public override void Run(DfpUser user) { // Get the CompanyService. CompanyService companyService = (CompanyService)user.GetService(DfpService.v201405.CompanyService); // Set defaults for page and Statement. CompanyPage page = new CompanyPage(); StatementBuilder statementBuilder = new StatementBuilder() .OrderBy("id ASC") .Limit(StatementBuilder.SUGGESTED_PAGE_LIMIT); try { do { // Get companies by Statement. page = companyService.getCompaniesByStatement(statementBuilder.ToStatement()); if (page.results != null && page.results.Length > 0) { int i = page.startIndex; foreach (Company company in page.results) { Console.WriteLine("{0}) Company with ID = {1}, name = {2} and type = {3} was found", i, company.id, company.name, company.type); i++; } } statementBuilder.IncreaseOffsetBy(StatementBuilder.SUGGESTED_PAGE_LIMIT); } while (statementBuilder.GetOffset() < page.totalResultSetSize); Console.WriteLine("Number of results found: {0}", page.totalResultSetSize); } catch (Exception ex) { Console.WriteLine("Failed to get companies. Exception says \"{0}\"", ex.Message); } }
protected void onGetCompaniesButtonClick() { ConfigureUserForOAuth(); try { // Get the CompanyService. CompanyService companyService = (CompanyService)user.GetService(DfpService.v201602.CompanyService); // Set defaults for page and statement. CompanyPage page = new CompanyPage(); StatementBuilder statementBuilder = new StatementBuilder() .OrderBy("id ASC") .Limit(StatementBuilder.SUGGESTED_PAGE_LIMIT); DataTable dataTable = new DataTable(); dataTable.Columns.AddRange(new DataColumn[] { new DataColumn("N°", typeof(int)), new DataColumn("Comp Id", typeof(long)), new DataColumn("Nombre", typeof(string)), new DataColumn("Tipo", typeof(string)), new DataColumn("Correo Electronico", typeof(string)) }); do { // Get companies by statement. page = companyService.getCompaniesByStatement(statementBuilder.ToStatement()); if (page.results != null && page.results.Length > 0) { int i = page.startIndex; foreach (Company company in page.results) { DataRow dataRow = dataTable.NewRow(); dataRow.ItemArray = new object[] { i + 1, company.id, company.name, company.type, company.email }; dataTable.Rows.Add(dataRow); i++; } } statementBuilder.IncreaseOffsetBy(StatementBuilder.SUGGESTED_PAGE_LIMIT); } while (statementBuilder.GetOffset() < page.totalResultSetSize); if (dataTable.Rows.Count > 0) { String vListaCompanias = ""; for (int i = 0; i < dataTable.Rows.Count; i++) { vListaCompanias += "<li><a href=\"Campaigns.aspx?id=123456\">" + dataTable.Rows[i][2].ToString() + "</a></li>"; } LitCompañias.Text = vListaCompanias; } else { Response.Write("No se encontraron compañias"); } } catch (Exception ex) { Response.Write(string.Format("Error en obtener compañias \"{0}\"", ex.Message)); } }
public ActionResult CreateCompanyPage(CompanyPage type) { Company company = db.Companies.Find(type.CompanyId); if (company == null) HttpNotFound(); CompanyPage page = new CompanyPage(); page = type; page.UserName = User.Identity.Name; //page.PublishDate = ; page.EditDate = DateTime.Now; if (type.CompanyPageId == 0) { //Create the new page var value = (from a in db.CompanyPages select a.PageId); if (value.Count() == 0) page.PageId = 1; else page.PageId = value.Max() + 1; page.Revision = 0; } else { page.Revision = (from a in db.CompanyPages where a.PageId == page.PageId select a.Revision).Max() + 1; } db.CompanyPages.Add(page); company.Revision++; db.Entry(company).State = EntityState.Modified; db.SaveChanges(); return RedirectToAction("Details", new { id = type.CompanyId }); }
public ActionResult CreateCompanyPage(int id = 0, int companyid = 0, int languageid=0) { CompanyPage page = new CompanyPage(); if (id == 0) { Company company = db.Companies.Find(companyid); if (company == null) HttpNotFound(); Language language = db.Language.Find(languageid); if (language == null) HttpNotFound(); //Create the new page page.CompanyId = company.CompanyId; page.LanguageId = language.LanguageId; page.Enabled = false; page.PublishDate = DateTime.Now; } else { //Edit the page page = db.CompanyPages.Find(id); if (page == null) HttpNotFound(); } return View(page); }
public void WhenIDeteteEditedCompany() { var deletecompanyPage = new CompanyPage(); deletecompanyPage.DeleteCreatedCompanyWithValues(driver); }
public void eFRLogin_1() { CompanyPage cmp = new CompanyPage(driver); cmp.EnterCompany("optum"); }
public void WhenIEditCreatedCompanyWithAnotherCompanyNameAndGroupName() { var editcompanyPage = new CompanyPage(); editcompanyPage.EditCreateCompanyWithValues(driver); }
public void WhenIAmAbleToVarifyCreatedCompanyWithCompanyName() { var companyPage = new CompanyPage(); companyPage.ValidateCreateCompanyWithValues(driver); }
public void WhenICreateNewCompanyUsingCompanyName() { var companyPage = new CompanyPage(); companyPage.CreateCompanyWithValues(driver); }