Beispiel #1
0
        public ActionResult Approval(ExpenseApprovalModel expenseapprovalmodel)
        {
            try
            {
                if (expenseapprovalmodel.Comment == null)
                {
                    return(Json(false));
                }

                if (string.IsNullOrEmpty(Convert.ToString(expenseapprovalmodel.ExpenseID)))
                {
                    return(Json(false));
                }

                _IExpense.UpdateExpenseStatus(expenseapprovalmodel, 2); //Approve

                if (_IExpense.IsExpenseALreadyProcessed(expenseapprovalmodel.ExpenseID))
                {
                    _IExpense.UpdateExpenseAuditStatus(expenseapprovalmodel.ExpenseID, expenseapprovalmodel.Comment, 2);
                }
                else
                {
                    _IExpense.InsertExpenseAuditLog(InsertExpenseAudit(expenseapprovalmodel, 2));
                }


                return(Json(true));
            }
            catch (Exception)
            {
                throw;
            }
        }