示例#1
0
        public ActionResult DeleteConfirmed(long id)
        {
            RequestsForInformationPost requestsforinformation = _requestsforinformationService.GetPost(id);

            requestsforinformation.UserName = User.Identity.Name;
            _requestsforinformationService.Delete(requestsforinformation);
            return(RedirectToAction("Index"));
        }
示例#2
0
        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));
        }
示例#3
0
        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));
        }
示例#4
0
        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);
        }
示例#5
0
        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));
        }
示例#6
0
 public void RegisterDelete(RequestsForInformationPost requestsforinformationPost)
 {
     _context.RequestsForInformationPost.Remove(requestsforinformationPost);
 }
示例#7
0
 public void RegisterEdit(RequestsForInformationPost requestsforinformationPost)
 {
     _context.Entry(requestsforinformationPost).State = EntityState.Modified;
 }
示例#8
0
 public void RegisterCreate(RequestsForInformationPost requestsforinformationPost)
 {
     _context.RequestsForInformationPost.Add(requestsforinformationPost);
 }