Exemple #1
0
        public ActionResult RefundExpense(int ExpenseID)
        {
            try
            {
                AHDDManagerClass.Expense objE = new AHDDManagerClass.Expense(ExpenseID);

                if (!objE.ExpenseExists)
                {
                    return(Json("0"));
                }

                objE.Refunded   = true;
                objE.RefundedBy = base.Associate.AssociateID;

                if (objE.Update())
                {
                    return(Json("1"));
                }
                else
                {
                    return(Json("0"));
                }
            }
            catch
            {
                return(Json("0"));
            }
        }
Exemple #2
0
        public ActionResult UpdateExpense(AHDDManagerClass.Expense expense)
        {
            expense.DateEntered = DateTime.Now;
            expense.Refunded    = false;
            expense.TakenBy     = base.Associate.AssociateID;
            expense.BusinessID  = base.Business.BusinessID;

            if (expense.Update())
            {
                return(Json("1"));
            }
            else
            {
                return(Json("There was an error adding the expense."));
            }
        }
Exemple #3
0
        public ActionResult DeleteExpense(int ExpenseID)
        {
            try
            {
                AHDDManagerClass.Expense objE = new AHDDManagerClass.Expense();
                objE.ExpenseID = ExpenseID;

                if (objE.Delete(base.Associate.AssociateID))
                {
                    return(Json("1"));
                }
                else
                {
                    return(Json("0"));
                }
            }
            catch
            {
                return(Json("0"));
            }
        }