public ActionResult DeleteConfirmed(long id) { RequestsForInformationPost requestsforinformation = _requestsforinformationService.GetPost(id); requestsforinformation.UserName = User.Identity.Name; _requestsforinformationService.Delete(requestsforinformation); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind("ixRequestForInformation,sRequestForInformation,ixLanguage,ixLanguageStyle,ixTopic,sInformationRequest,sInformationRequestResponse,ixResponseType,bActive")] RequestsForInformationPost requestsforinformation) { if (ModelState.IsValid) { requestsforinformation.UserName = User.Identity.Name; _requestsforinformationService.Edit(requestsforinformation); return(RedirectToAction("Index")); } ViewBag.ixLanguage = new SelectList(_requestsforinformationService.selectLanguages().Select(x => new { x.ixLanguage, x.sLanguage }), "ixLanguage", "sLanguage", requestsforinformation.ixLanguage); ViewBag.ixLanguageStyle = new SelectList(_requestsforinformationService.selectLanguageStyles().Select(x => new { x.ixLanguageStyle, x.sLanguageStyle }), "ixLanguageStyle", "sLanguageStyle", requestsforinformation.ixLanguageStyle); ViewBag.ixResponseType = new SelectList(_requestsforinformationService.selectResponseTypes().Select(x => new { x.ixResponseType, x.sResponseType }), "ixResponseType", "sResponseType", requestsforinformation.ixResponseType); ViewBag.ixTopic = new SelectList(_requestsforinformationService.selectTopics().Select(x => new { x.ixTopic, x.sTopic }), "ixTopic", "sTopic", requestsforinformation.ixTopic); return(View(requestsforinformation)); }
public ActionResult Edit(long id) { RequestsForInformationPost requestsforinformation = _requestsforinformationService.GetPost(id); if (requestsforinformation == null) { return(NotFound()); } ViewBag.ixLanguage = new SelectList(_requestsforinformationService.selectLanguages().Select(x => new { x.ixLanguage, x.sLanguage }), "ixLanguage", "sLanguage", requestsforinformation.ixLanguage); ViewBag.ixLanguageStyle = new SelectList(_requestsforinformationService.selectLanguageStyles().Select(x => new { x.ixLanguageStyle, x.sLanguageStyle }), "ixLanguageStyle", "sLanguageStyle", requestsforinformation.ixLanguageStyle); ViewBag.ixResponseType = new SelectList(_requestsforinformationService.selectResponseTypes().Select(x => new { x.ixResponseType, x.sResponseType }), "ixResponseType", "sResponseType", requestsforinformation.ixResponseType); ViewBag.ixTopic = new SelectList(_requestsforinformationService.selectTopics().Select(x => new { x.ixTopic, x.sTopic }), "ixTopic", "sTopic", requestsforinformation.ixTopic); return(View(requestsforinformation)); }
public Task Delete(RequestsForInformationPost requestsforinformationPost) { // Additional validations // Pre-process // Process this._requestsforinformationRepository.RegisterDelete(requestsforinformationPost); try { this._requestsforinformationRepository.Commit(); } catch (Exception ex) { this._requestsforinformationRepository.Rollback(); // Log exception throw; } // Post-process return(Task.CompletedTask); }
public Task <Int64> Create(RequestsForInformationPost requestsforinformationPost) { // Additional validations // Pre-process // Process this._requestsforinformationRepository.RegisterCreate(requestsforinformationPost); try { this._requestsforinformationRepository.Commit(); } catch (Exception ex) { this._requestsforinformationRepository.Rollback(); // Log exception throw; } // Post-process return(Task.FromResult(requestsforinformationPost.ixRequestForInformation)); }
public void RegisterDelete(RequestsForInformationPost requestsforinformationPost) { _context.RequestsForInformationPost.Remove(requestsforinformationPost); }
public void RegisterEdit(RequestsForInformationPost requestsforinformationPost) { _context.Entry(requestsforinformationPost).State = EntityState.Modified; }
public void RegisterCreate(RequestsForInformationPost requestsforinformationPost) { _context.RequestsForInformationPost.Add(requestsforinformationPost); }