Ejemplo n.º 1
0
        public ActionResult Save(string ID)
        {
            int id = 0;

            if (ID != "0")//ID=0 for new record
            {
                id = Convert.ToInt32(Helpers.CommonMethods.Decrypt(HttpUtility.UrlDecode(ID)));
            }
            Expenses expense = new Expenses();

            try
            {
                if (ModelState.IsValid)
                {
                    ExpensesServiceClient service = new ExpensesServiceClient();
                    expense          = service.GetExpenses(id);
                    ViewBag.PageName = "Create Expense Master";
                }
            }
            catch (Exception e)
            {
                ModelState.AddModelError("error", "something went wrong");
                expense = null;
                throw e;
            }
            return(View(expense));
        }
Ejemplo n.º 2
0
        public ActionResult Delete(string ID)
        {
            int      id      = Convert.ToInt32(Helpers.CommonMethods.Decrypt(HttpUtility.UrlDecode(ID)));
            Expenses expense = new Expenses();

            try
            {
                if (ModelState.IsValid)
                {
                    ExpensesServiceClient service = new ExpensesServiceClient();
                    expense = service.GetExpenses(id);
                }
            }
            catch (Exception e)
            {
                ModelState.AddModelError("error", "Something Went Wrong");
                expense = null;
                throw e;
            }
            return(View(expense));
        }