public ActionResult DeleteConfirmed(long id) { PurchaseTextMessagesPost purchasetextmessages = _purchasetextmessagesService.GetPost(id); purchasetextmessages.UserName = User.Identity.Name; _purchasetextmessagesService.Delete(purchasetextmessages); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind("ixPurchaseTextMessage,sPurchaseTextMessage,ixPurchase,ixSendTextMessage")] PurchaseTextMessagesPost purchasetextmessages) { if (ModelState.IsValid) { purchasetextmessages.UserName = User.Identity.Name; _purchasetextmessagesService.Edit(purchasetextmessages); return(RedirectToAction("Index")); } ViewBag.ixPurchase = new SelectList(_purchasetextmessagesService.selectPurchases().Select(x => new { x.ixPurchase, x.sPurchase }), "ixPurchase", "sPurchase", purchasetextmessages.ixPurchase); ViewBag.ixSendTextMessage = new SelectList(_purchasetextmessagesService.selectSendTextMessages().Select(x => new { x.ixSendTextMessage, x.sSendTextMessage }), "ixSendTextMessage", "sSendTextMessage", purchasetextmessages.ixSendTextMessage); return(View(purchasetextmessages)); }
public ActionResult Edit(long id) { PurchaseTextMessagesPost purchasetextmessages = _purchasetextmessagesService.GetPost(id); if (purchasetextmessages == null) { return(NotFound()); } ViewBag.ixPurchase = new SelectList(_purchasetextmessagesService.selectPurchases().Select(x => new { x.ixPurchase, x.sPurchase }), "ixPurchase", "sPurchase", purchasetextmessages.ixPurchase); ViewBag.ixSendTextMessage = new SelectList(_purchasetextmessagesService.selectSendTextMessages().Select(x => new { x.ixSendTextMessage, x.sSendTextMessage }), "ixSendTextMessage", "sSendTextMessage", purchasetextmessages.ixSendTextMessage); return(View(purchasetextmessages)); }
public Task Delete(PurchaseTextMessagesPost purchasetextmessagesPost) { // Additional validations // Pre-process // Process this._purchasetextmessagesRepository.RegisterDelete(purchasetextmessagesPost); try { this._purchasetextmessagesRepository.Commit(); } catch (Exception ex) { this._purchasetextmessagesRepository.Rollback(); // Log exception throw; } // Post-process return(Task.CompletedTask); }
public Task <Int64> Create(PurchaseTextMessagesPost purchasetextmessagesPost) { // Additional validations // Pre-process // Process this._purchasetextmessagesRepository.RegisterCreate(purchasetextmessagesPost); try { this._purchasetextmessagesRepository.Commit(); } catch (Exception ex) { this._purchasetextmessagesRepository.Rollback(); // Log exception throw; } // Post-process return(Task.FromResult(purchasetextmessagesPost.ixPurchaseTextMessage)); }
public void RegisterDelete(PurchaseTextMessagesPost purchasetextmessagesPost) { _context.PurchaseTextMessagesPost.Remove(purchasetextmessagesPost); }
public void RegisterEdit(PurchaseTextMessagesPost purchasetextmessagesPost) { _context.Entry(purchasetextmessagesPost).State = EntityState.Modified; }
public void RegisterCreate(PurchaseTextMessagesPost purchasetextmessagesPost) { _context.PurchaseTextMessagesPost.Add(purchasetextmessagesPost); }