コード例 #1
0
        public ActionResult Delete(int id)
        {
            bool status = true;

            try
            {
                if (id > 0 && id != null)
                {
                    AccountPartyServiceClient service = new AccountPartyServiceClient();
                    status = service.Delete(id);
                }
            }
            catch (Exception e)
            {
                ModelState.AddModelError("error", "something went wrong");
                status = false;
                throw e;
            }
            return(Json(status, JsonRequestBehavior.AllowGet));
        }
コード例 #2
0
        public ActionResult GetAccountListData()
        {
            dynamic accountList = 0;

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

                    accountList = service.GetAccountListData();
                }
            }
            catch (Exception ex)
            {
                ModelState.AddModelError("error", "Something Wrong");
                accountList = null;
                throw ex;
            }
            return(Json(accountList, JsonRequestBehavior.AllowGet));
        }
コード例 #3
0
        public ActionResult SaveEdit(AccountPartyModel acntPartyModel)
        {
            bool status = true;

            try
            {
                if (ModelState.IsValid)
                {
                    AccountPartyServiceClient service = new AccountPartyServiceClient();
                    status = service.SaveEdit(acntPartyModel);
                }
            }
            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 }
            });
        }