public IActionResult DeleteConfirmed(int id, int GameId) { var offer = _offerService.Get(x => x.Id == id); _offerService.Delete(offer); return(RedirectToAction(nameof(Index), new { GameId = GameId })); }
public ActionResult Delete(int id, OfferVM ovm) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Offer o = OService.GetById(id); //OfferVM ovm = new OfferVM() //{ // OfferId = o.OfferId, // Offer_Title = o.Offer_Title, // Offer_description = o.Offer_description, // Offre_Duration = o.Offre_Duration, // Offre_Salary = o.Offre_Salary, // Offer_Contract_Type = (ContractTypeVM)o.Offer_Contract_Type, // Offer_Level_Of_Expertise = (OfferLevelVM)o.Offer_Level_Of_Expertise, // Offer_DatePublished = o.Offer_DatePublished, // Vues = o.Vues, // CompanyId = o.CompanyId //}; if (o == null) { return(HttpNotFound()); } OService.Delete(o); OService.Commit(); return(RedirectToAction("Index")); }
public async Task <IActionResult> Delete([FromRoute] long offerId) { var result = _service.Delete(offerId); result = MessageHelper <OfferDto> .GetResponse(result); return(Ok(result)); }
public ActionResult Expiredclient(int id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Offer p = service.GetById(id); service.Delete(p); service.Commit(); return(RedirectToAction("Index")); if (p == null) { return(HttpNotFound()); } }
public ActionResult Delete(Guid id) { var offers = offerItemService.GetMany(d => d.OfferId == id); foreach (var item in offers) { offerItemService.Delete(item); } offerService.Delete(id); return(RedirectToAction("Index")); }
public async Task <bool> DeleteOfferAsync(int offerId) { using (var uow = UnitOfWorkProvider.Create()) { if ((await offerService.GetAsync(offerId, false)) == null) { return(false); } offerService.Delete(offerId); await uow.Commit(); return(true); } }
public ActionResult Delete(int?id = 1) { if (id != null) { var offer = _offerService.GetOffers(o => o.Id == id.Value, o => o.UserProfile).SingleOrDefault(); if (offer != null && offer.UserProfileId == User.Identity.GetUserId() && offer.State == OfferState.inactive) { _offerService.Delete(offer); _offerService.SaveOffer(); return(View()); } } return(HttpNotFound()); }
public async Task <ActionResult> Delete(int?id) { if (id != null) { var userId = User.Identity.GetUserId <int>(); Offer offer = await offerService.GetOfferAsync(id.Value, i => i.UserProfile); UserProfile user = offer.UserProfile; if (offer != null && user != null && user.Id == userId) { offerService.Delete(offer); await offerService.SaveOfferAsync(); return(View()); } } return(HttpNotFound()); }
public ActionResult DeleteOffer(int id) { var offer = _offerService.GetOffer(id, i => i.Order, i => i.Order.AccountInfos, i => i.Order.Transactions, i => i.Order.StatusLogs, i => i.ScreenshotPathes, i => i.Order.Feedbacks); if (offer != null) { if (offer.Order != null && offer.Order.JobId != null) { BackgroundJob.Delete(offer.Order.JobId); } if (offer.JobId != null) { BackgroundJob.Delete(offer.JobId); } _offerService.Delete(offer); TempData["message"] = "Предложение удалено"; _offerService.SaveOffer(); } return(RedirectToAction("OfferList")); }
public List <Model.Offer> Delete(int id) { return(_offer.Delete(id)); }
public IActionResult Delete(Guid id) { offerService.Delete(id); return(Ok()); }
internal void DeleteOffer(string offerID) { OfferServices.Delete(offerID); OfferServices.SaveData(); }
public void Delete(int id) { _service.Delete(id); }
public async Task Consume(ConsumeContext <ListingDeletedMessage> context) { var message = context.Message.ListingId; await offerService.Delete(message); }
public string Delete(int id) { return(_repos.Delete(id)); }