public void WhenIClickMarketPlaceICanSeeAllTheJobsAndApplyJobs() { test = extent.StartTest("Validating Marketplace"); MarketPlace ObjMar = new MarketPlace(); ObjMar.ApplyJob(); }
public IActionResult BlackList(string Asin, string modifer, MarketPlace marketPlace) { Amazon currAsin = new Amazon(); var amazon = _context.Amazon.Where(x => x.Asin == Asin && x.marketPlace == marketPlace.ToString()); currAsin.id = Convert.ToInt32(amazon.Select(x => x.id).FirstOrDefault()); currAsin.Asin = Convert.ToString(amazon.Select(x => x.Asin).FirstOrDefault()); currAsin.sku = Convert.ToString(amazon.Select(x => x.sku).FirstOrDefault()); currAsin.wholesaler = Convert.ToString(amazon.Select(x => x.wholesaler).FirstOrDefault()); currAsin.price = Convert.ToDouble(amazon.Select(x => x.price).FirstOrDefault()); currAsin.marketPlace = marketPlace.ToString(); try { if (currAsin != null) { currAsin.blackList = Convert.ToBoolean(modifer); _context.Amazon.Update(currAsin); _context.SaveChanges(); } } catch { ViewData["Error"] = "The ASIN and/or Market Place is NOT in the database."; return(View(_context.Amazon.ToList().Where(x => x.blackList == true))); } ViewData["Success"] = "ASIN added to the database successfully."; return(View(_context.Amazon.ToList().Where(x => x.blackList == true))); }
public ActionResult Market(int?id) { Auction auction = null; if (id == null || id == 0) { auction = unitOfWork.Auctions.GetActiveAuction(); } else { auction = unitOfWork.Auctions.GetAuction(id); } if (auction == null) { return(HttpNotFound()); } var viewModel = new MarketPlace { Id = auction.Id, IsActive = auction.AuctionEndDate > DateTime.Now, EndTime = auction.AuctionEndDate.ToString(), EndTimeGreek = auction.AuctionEndDate.AddSeconds(-1).ToString("D", CultureInfo.CreateSpecificCulture("el-GR")), HasEntries = auction.MarketEntries.Any() }; return(View(viewModel)); }
// PUT api/Market/5 public HttpResponseMessage PutMarketPlace(int id, MarketPlace marketplace) { if (!ModelState.IsValid) { return(Request.CreateErrorResponse(HttpStatusCode.BadRequest, ModelState)); } if (id != marketplace.InvId) { return(Request.CreateResponse(HttpStatusCode.BadRequest)); } db.Entry(marketplace).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException ex) { return(Request.CreateErrorResponse(HttpStatusCode.NotFound, ex)); } return(Request.CreateResponse(HttpStatusCode.OK)); }
public void Po_AddQuote() { test = extent.StartTest("Add My quote"); MarketPlace obj = new MarketPlace(); obj.AddQuote(); }
public void Job_Apply() { // creates a toggle for the given test, adds all log events under it test = extent.StartTest("Check whether user is able to apply for a job in marketplace"); MarketPlace obj = new MarketPlace(); obj.Apply_Quote_Job(); }
public ActionResult DeleteConfirmed(Guid id) { MarketPlace group = db.MarketPlaces.Find(id); db.MarketPlaces.Remove(group); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult DeleteConfirmed(int id) { MarketPlace marketPlace = db.MarketPlaces.Find(id); db.MarketPlaces.Remove(marketPlace); db.SaveChanges(); return(RedirectToAction("Index")); }
public void Run() { var weaponArsenal = new List <Weapon>(); var input = Console.ReadLine().Split(";"); while (input[0] != "END") { var command = input[0]; if (command == "Create") { var weaponToCreate = input[1].Split(" "); var weaponRarity = weaponToCreate[0]; var marketPlace = new MarketPlace(); var rarityLevel = marketPlace.EstimateRarityLevel(weaponRarity); var weaponType = weaponToCreate[1]; var weaponName = input[2]; var forge = new WeaponsForge(); var weapon = forge.ForgeAWeapon(weaponType, rarityLevel, weaponName); weapon.CalculateWeaponRarity(); weaponArsenal.Add(weapon); } else if (command == "Add") { var weaponName = input[1]; var socketIndex = int.Parse(input[2]); var gemInfo = input[3].Split(" "); var gemClarity = gemInfo[0]; var gemClarifier = new GemClarifier(); var currentGemClarity = gemClarifier.InspectClarity(gemClarity); var gemType = gemInfo[1]; var gemsMine = new GemsMine(); var gem = gemsMine.MineAGem(currentGemClarity, gemType); var currentWeapon = weaponArsenal.FirstOrDefault(x => x.Name == weaponName); currentWeapon.Add(gem, socketIndex); } else if (command == "Remove") { var weaponName = input[1]; var socketIndex = int.Parse(input[2]); var currentWeapon = weaponArsenal.FirstOrDefault(x => x.Name == weaponName); currentWeapon.Remove(socketIndex); } else if (command == "Print") { var name = input[1]; var weapon = weaponArsenal.FirstOrDefault(x => x.Name == name); var weaponToPrint = weapon; weaponToPrint.CalculateWeaponTotalPower(); weaponToPrint.CalculateFinalWeaponDamage(); Console.WriteLine(weaponToPrint); } input = Console.ReadLine().Split(";"); } }
public void BuyTradeOffer(TradeOffer offer) { selectedWidget.SetProductAmount(offer.player.resourcesAmountForTrade[offer.productId] - offer.amount); Player.LocalPlayer.CmdTradeWithPlayer(Player.LocalPlayer.PlayerID, offer.player.PlayerID, offer.productId, offer.amount); MarketPlace.OnTradeOfferBought(offer); buyWidget.gameObject.SetActive(false); PlayerResources.Instance.RemoveMoney(offer.totalValue); //RefreshTradeOffersList(); }
public ActionResult Edit([Bind(Include = "Id,Name")] MarketPlace group) { if (ModelState.IsValid) { db.Entry(group).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(group)); }
public ActionResult Edit([Bind(Include = "Id,Timestamp,Topic,Items_For_Sale,UserId")] MarketPlace marketPlace) { if (ModelState.IsValid) { db.Entry(marketPlace).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.UserId = new SelectList(db.Users, "Id", "UserRole", marketPlace.UserId); return(View(marketPlace)); }
// GET api/Market/5 public MarketPlace GetMarketPlace(int id) { MarketPlace marketplace = db.MarketPlace.Find(id); if (marketplace == null) { throw new HttpResponseException(Request.CreateResponse(HttpStatusCode.NotFound)); } return(marketplace); }
public void AcceptOffer() { tradeOfferWidgets[tradeOfferSelectionID].SetAmount(playerInspecting.resourcesAmountForTrade[tradeOfferSelectionID] - amount); Player.LocalPlayer.CmdTradeWithPlayer(Player.LocalPlayer.PlayerID, playerInspecting.PlayerID, tradeOfferSelectionID, amount); TradeOffer tradeOffer = new TradeOffer(PlayerList.Instance.Players[playerInspecting.PlayerID], tradeOfferSelectionID, amount, cost); MarketPlace.OnTradeOfferBought(tradeOffer); tradeInfoObject.gameObject.SetActive(false); PlayerResources.Instance.RemoveMoney(tradeOffer.totalValue); //Init(cityObject, playerInspecting); }
// GET: MarketPlaces/Details/5 public ActionResult Details(Guid?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } MarketPlace group = db.MarketPlaces.Find(id); Session["groupId"] = id; if (group == null) { return(HttpNotFound()); } //Pego todas as Postagens que foram feitas neste grupo ViewBag.Posts = db.Posts .Include(p => p.Sender) .Include(p => p.MarketPlace) .Where(p => p.MarketPlace != null) .Where(p => p.MarketPlace.Id == id).ToList(); //Pego todos os comentários por PostId do Banco de Dados var comments = db.Comments .Include(c => c.Post) .Include(c => c.Post.Sender) .OrderBy(p => p.PublishDateTime) .ToList(); var postIdComments = new Dictionary <Guid, List <Comment> >(); foreach (var comment in comments) { Guid postId = comment.Post.Id; if (!postIdComments.ContainsKey(comment.Post.Id)) { postIdComments[postId] = new List <Comment>(); } postIdComments[postId].Add(comment); } foreach (var postIdComment in postIdComments) { postIdComment.Value.Sort((a, b) => a.PublishDateTime.CompareTo(b.PublishDateTime)); } ViewBag.PostIdComments = postIdComments; //Pego todos os membros de um grupo ViewBag.Members = db.ProfilesGroups .Include(p => p.Profile) .Include(p => p.MarketPlace) .Where(p => p.MarketPlace.Id == id) .Select(p => p.Profile).ToList(); return(View(group)); }
public ActionResult Create([Bind(Include = "Id,Name")] MarketPlace group) { if (ModelState.IsValid) { group.Id = Guid.NewGuid(); db.MarketPlaces.Add(group); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(group)); }
public ActionResult Create([Bind(Include = "Id,Date,Description,ItemsForSale,UserId,Price")] MarketPlace marketPlace) { if (ModelState.IsValid) { db.MarketPlaces.Add(marketPlace); db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.UserId = new SelectList(db.Users, "Id", "UserRole", marketPlace.UserId); return(View(marketPlace)); }
public AmazonDBUploader(string _path, Dictionary <string, Wholesaler_AzImporter> _azImporter, Dictionary <int, Wholesaler_Fragrancex> _fragracex , List <Amazon> _amazon, Dictionary <int, double> _shipping, MarketPlace _marketPlace, int _AmazonCount) { path = _path; fragrancexList = _fragracex; azImporterList = _azImporter; //perfumeWorldWideList = _perfumeWorldWide; amazonList = new List <Amazon>(); ShippingList = _shipping; amazonPrintList = _amazon; marketPlace = _marketPlace; AmazonCount = _AmazonCount; }
public void WhenIFillAllTheMandatoryDetailsOnApplyJobApplication(Table table) { MarketPlace details = table.CreateInstance <MarketPlace>(); var MarketDetails = MarketPlace.ToDictionary(table); //Enter Amount Driver.driver.FindElement(By.XPath("//*[@id='applyDetail']/div/div[4]/form/div[1]/div[1]/input")).SendKeys(MarketDetails["Amount"]); Thread.Sleep(2000); //Enter Note Driver.driver.FindElement(By.XPath("//*[@id='applyDetail']/div/div[4]/form/div[2]/div[1]/textarea")).SendKeys(MarketDetails["Note"]); Thread.Sleep(2000); }
public ActionResult ManageAuctions() { var currentAuction = unitOfWork.Auctions.GetActiveAuction(); var viewModel = new MarketPlace { IsActive = currentAuction.AuctionEndDate > DateTime.Now, EndTime = currentAuction.AuctionEndDate.ToString(), EndTimeGreek = currentAuction.AuctionEndDate.AddSeconds(-1).ToString("D", CultureInfo.CreateSpecificCulture("el-GR")) }; return(View(viewModel)); }
public AmazonExcelUpdator(string _path, Dictionary <int, Wholesaler_Fragrancex> _fragrancex , Dictionary <string, Wholesaler_AzImporter> _azImporter, Dictionary <string, bool> _blackListed , Dictionary <int, double> _shipping, Dictionary <string, PerfumeWorldWide> _perfumeWorldWide , MarketPlace _marketPlace) { this.path = _path; fragrancexList = _fragrancex; azImporterList = _azImporter; blackListedList = _blackListed; ShippingList = _shipping; perfumeWorldWideList = _perfumeWorldWide; marketPlace = _marketPlace; }
// GET: MarketPlaces/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } MarketPlace marketPlace = db.MarketPlaces.Find(id); if (marketPlace == null) { return(HttpNotFound()); } return(View(marketPlace)); }
// GET: MarketPlaces/Delete/5 public ActionResult Delete(Guid?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } MarketPlace group = db.MarketPlaces.Find(id); if (group == null) { return(HttpNotFound()); } return(View(group)); }
// GET: MarketPlaces/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } MarketPlace marketPlace = db.MarketPlaces.Find(id); if (marketPlace == null) { return(HttpNotFound()); } ViewBag.UserId = new SelectList(db.Users, "Id", "UserRole", marketPlace.UserId); return(View(marketPlace)); }
public async Task <IActionResult> Index(string file, MarketPlace marketPlace) { try { var path = Path.Combine( Directory.GetCurrentDirectory(), "wwwroot", file + ".xlsx"); var blackListed = _context.Amazon.Where(z => z.blackList == true).ToDictionary(x => x.Asin, y => y.blackList); var fragancex = _context.Wholesaler_Fragrancex.ToDictionary(x => x.Sku, x => x); var azImporter = _context.Wholesaler_AzImporter.ToDictionary(x => x.Sku, x => x); var shipping = _context.Shipping.ToDictionary(x => x.weightId, x => x.ItemPrice); var perfumeWorldWide = _context.PerfumeWorldWide.ToDictionary(x => x.sku, x => x); AmazonExcelUpdator amazonExcelUpdator = new AmazonExcelUpdator(path, fragancex, azImporter , blackListed, shipping, perfumeWorldWide, marketPlace); amazonExcelUpdator.ExcelGenerator(); var memory = new MemoryStream(); using (var stream = new FileStream(path, FileMode.Open)) { await stream.CopyToAsync(memory); } memory.Position = 0; FileStreamResult returnFile = File(memory, Helper.GetContentType(path), "Amazon" + "_Converted_" + DateTime.Today.GetDateTimeFormats()[10] + Path.GetExtension(path).ToLowerInvariant()); System.IO.File.Delete(path); return(returnFile); } catch (Exception e) { ViewData["Error"] = e.Message.ToString(); return(View()); } }
// POST api/Market public HttpResponseMessage PostMarketPlace(MarketPlace marketplace) { if (ModelState.IsValid) { db.MarketPlace.Add(marketplace); db.SaveChanges(); HttpResponseMessage response = Request.CreateResponse(HttpStatusCode.Created, marketplace); response.Headers.Location = new Uri(Url.Link("MarketApi", new { id = marketplace.InvId })); return(response); } else { return(Request.CreateErrorResponse(HttpStatusCode.BadRequest, ModelState)); } }
public static MarketPlace GenerateMarket(MarketPlace building, BuildingStyle style = BuildingStyle.stone) { int width = building.Width; int height = building.Height; Vec2i entr = GenerateWallsFloorAndEntrance(width, height, building.BuildingObjects, building.BuildingTiles, 0, style, tileType: Tile.TEST_YELLOW); building.SetEntrancePoint(entr); MarketStall s1 = new MarketStall(new Vec2i(3, 3)); MarketStall s2 = new MarketStall(new Vec2i(building.Width - 3, building.Height - 3)); AddObject(building, s1, 3, 3); AddObject(building, s2, building.Width - 3, building.Height - 3); NPCJob[] jobs = new NPCJob[] { new NPCJobMarketStall("Market runner", building, s1), new NPCJobMarketStall("Market runner", building, s2) }; building.SetWorkBuildingData(new WorkBuildingData(jobs)); return(building); }
private void SellTradeOffer(int tradeAcceptant, int resourceID, int amount) { resourcesAmountForTrade[resourceID] -= amount; if (resourcesAmountForTrade[resourceID] < 0) { resourcesAmountForTrade[resourceID] = 0; } float value = resourcesCostForTrade[resourceID] * amount; TradeOffer tradeOffer = new TradeOffer(this, resourceID, amount, value); MarketPlace.OnTradeOfferSold(tradeOffer); if (isLocalPlayer) { EventLogManager.AddNewTradeOfferSoldLog(tradeOffer); } }
public async Task Get_all_accounts_in_marketplace_with_success() { // Arrange var request = new AccountRequestMessage { Name = "*****@*****.**", CommissionPercent = 10 }; MarketplaceAccoutsResponse response; // Act using (var client = new MarketPlace()) { response = await client.GetAllSubAccountsAsync().ConfigureAwait(false); } // Assert Assert.That(response, Is.Not.Null); }
public async Task Get_all_accounts_in_marketplace_paggeed_with_success() { // Arrange PaggedResponseMessage <MarketPlaceAccountItem> response; var filter = new QueryStringFilter { MaxResults = 1000, SortBy = new OrderingFilter(FieldSort.AccountName, ResultOrderType.Ascending) }; // Act using (var client = new MarketPlace()) { response = await client.GetAllSubAccountsAsync("74c265aedbfaea379bc0148fae9b5526", filter).ConfigureAwait(false); } // Assert Assert.That(response, Is.Not.Null); }
public override Settlement List(MarketPlace marketPlace) { return new Settlement(); }