コード例 #1
0
        public ActionResult DeleteConfirmed(long id)
        {
            MessageFunctionsPost messagefunctions = _messagefunctionsService.GetPost(id);

            messagefunctions.UserName = User.Identity.Name;
            _messagefunctionsService.Delete(messagefunctions);
            return(RedirectToAction("Index"));
        }
コード例 #2
0
        public ActionResult Edit([Bind("ixMessageFunction,sMessageFunction,sMessageFunctionCode")] MessageFunctionsPost messagefunctions)
        {
            if (ModelState.IsValid)
            {
                messagefunctions.UserName = User.Identity.Name;
                _messagefunctionsService.Edit(messagefunctions);
                return(RedirectToAction("Index"));
            }

            return(View(messagefunctions));
        }
コード例 #3
0
        public ActionResult Edit(long id)
        {
            MessageFunctionsPost messagefunctions = _messagefunctionsService.GetPost(id);

            if (messagefunctions == null)
            {
                return(NotFound());
            }

            return(View(messagefunctions));
        }
コード例 #4
0
        public Task Delete(MessageFunctionsPost messagefunctionsPost)
        {
            // Additional validations

            // Pre-process

            // Process
            this._messagefunctionsRepository.RegisterDelete(messagefunctionsPost);
            try
            {
                this._messagefunctionsRepository.Commit();
            }
            catch (Exception ex)
            {
                this._messagefunctionsRepository.Rollback();
                // Log exception
                throw;
            }

            // Post-process

            return(Task.CompletedTask);
        }
コード例 #5
0
        public Task <Int64> Create(MessageFunctionsPost messagefunctionsPost)
        {
            // Additional validations

            // Pre-process

            // Process
            this._messagefunctionsRepository.RegisterCreate(messagefunctionsPost);
            try
            {
                this._messagefunctionsRepository.Commit();
            }
            catch (Exception ex)
            {
                this._messagefunctionsRepository.Rollback();
                // Log exception
                throw;
            }

            // Post-process

            return(Task.FromResult(messagefunctionsPost.ixMessageFunction));
        }
コード例 #6
0
 public void RegisterDelete(MessageFunctionsPost messagefunctionsPost)
 {
     _context.MessageFunctionsPost.Remove(messagefunctionsPost);
 }
コード例 #7
0
 public void RegisterEdit(MessageFunctionsPost messagefunctionsPost)
 {
     _context.Entry(messagefunctionsPost).State = EntityState.Modified;
 }
コード例 #8
0
 public void RegisterCreate(MessageFunctionsPost messagefunctionsPost)
 {
     _context.MessageFunctionsPost.Add(messagefunctionsPost);
 }