Ejemplo n.º 1
0
        public ActionResult GetAllTransactionsByDate(DateTime fromDate, DateTime toDate)
        {
            dynamic transactions = 0;

            try
            {
                if (ModelState.IsValid)
                {
                    cashTransactionServiceClient service = new cashTransactionServiceClient();

                    transactions = service.GetAllTransactionsByDate(fromDate, toDate);
                    //if (customer.Count == 0 || customer == null)
                    //{
                    //    ModelState.AddModelError("error", "No Record Found");
                    //}
                }
            }
            catch (Exception e)
            {
                ModelState.AddModelError("error", "Something Wrong");
                transactions = null;
                throw e;
            }
            return(Json(transactions, JsonRequestBehavior.AllowGet));
        }
Ejemplo n.º 2
0
        public ActionResult DeleteTransaction(int ID)
        {
            bool status = false;

            try
            {
                if (ModelState.IsValid)
                {
                    cashTransactionServiceClient Service = new cashTransactionServiceClient();

                    status = Service.Delete(ID);
                }
            }
            catch (Exception e)
            {
                ModelState.AddModelError("error", "Something Went Wrong");

                throw e;
            }
            return(View("Index"));
        }
Ejemplo n.º 3
0
        public ActionResult SaveEdit(CashTransactionModel cashModel)
        {
            bool status = true;

            try
            {
                if (ModelState.IsValid)
                {
                    cashTransactionServiceClient service = new cashTransactionServiceClient();
                    status = service.SaveEdit(cashModel);
                }
            }
            catch (Exception e)
            {
                ModelState.AddModelError("error", "Something Went Wrong");
                status = false;
                throw e;
            }
            //return RedirectToAction("Index");
            //return View();
            return(new JsonResult {
                Data = new { status = status }
            });
        }