public ActionResult TransactionLogAddEdit(int?id)
        {
            BackEndTransactionLogAddEdit transactionLogAddEdit = new BackEndTransactionLogAddEdit();

            if (id.IsNotNull())
            {
                TransactionLogs transactionLogs = new TransactionLogs();
                var             transactionLog  = transactionLogs.FilterById(id);
                if (transactionLog.IsNotNull())
                {
                    transactionLogAddEdit.Id             = transactionLog.Id;
                    transactionLogAddEdit.Id_Fighting    = transactionLog.Id_Fighting;
                    transactionLogAddEdit.TransationDate = transactionLog.TransationDate.ToDateTimeString();
                    transactionLogAddEdit.ReceiveAccount = transactionLog.ReceiveAccount;
                    transactionLogAddEdit.TransationType = transactionLog.TransationType;
                    transactionLogAddEdit.Amount         = transactionLog.Amount;
                    transactionLogAddEdit.UserId         = transactionLog.UserId;
                    transactionLogAddEdit.Nick           = transactionLog.Nick;
                    transactionLogAddEdit.Reason         = transactionLog.Reason;
                    transactionLogAddEdit.Status         = transactionLog.Status;
                    transactionLogAddEdit.ErrorMessage   = transactionLog.ErrorMessage;
                    transactionLogAddEdit.Created_At     = transactionLog.Created_At.ToDateTimeString();
                    transactionLogAddEdit.Updated_At     = transactionLog.Updated_At.ToDateTimeString();
                }
            }
            return(View(transactionLogAddEdit));
        }
        public ActionResult TransactionLogAddEdit(BackEndTransactionLogAddEdit transactionLogAddEdit)
        {
            string          username   = BackEndSessions.CurrentUser.UserName;
            TransactionLogs categories = new TransactionLogs();
            long?           currentId  = transactionLogAddEdit.Id;

            if (ModelState.IsValidOrRefresh())
            {
                var rs = categories.AddEdit(
                    currentId,
                    transactionLogAddEdit.Id_Fighting,
                    transactionLogAddEdit.TransationDate.ToDateTime(),
                    transactionLogAddEdit.ReceiveAccount,
                    transactionLogAddEdit.TransationType,
                    transactionLogAddEdit.Amount,
                    transactionLogAddEdit.UserId,
                    transactionLogAddEdit.Nick,
                    transactionLogAddEdit.Reason,
                    transactionLogAddEdit.Status,
                    transactionLogAddEdit.ErrorMessage,
                    transactionLogAddEdit.Created_At.ToDateTime(),
                    transactionLogAddEdit.Updated_At.ToDateTime(),
                    username
                    );
                switch (rs)
                {
                case 0:
                    ModelState.AddResult(ViewData, ModelStateResult.Success, Resources.Strings.ItemSuccessfullyAddEdit);
                    break;

                case 2:
                    ModelState.AddResult(ViewData, ModelStateResult.Error, Resources.Strings.ItemDoesNotExist);
                    break;

                default:
                    ModelState.AddResult(ViewData, ModelStateResult.Error, Resources.Strings.UnexpectedError);
                    break;
                }
            }
            return(View(transactionLogAddEdit));
        }