Example #1
0
        public ActionResult Update(DatabaseUpdateInput input)
        {
            var responseResult = new ResponseData {
                success = true, id = input.Id
            };

            if (ModelState.IsValid)
            {
                AcDomain.Handle(input.ToCommand(AcSession));
            }
            else
            {
                responseResult.success = false;
                string msg = ModelState.Aggregate(string.Empty, (current1, item) => item.Value.Errors.Aggregate(current1, (current, e) => current + e.ErrorMessage));

                responseResult.msg = msg;
            }

            return(this.JsonResult(responseResult));
        }
        public ActionResult Update(DatabaseUpdateInput input)
        {
            var responseResult = new ResponseData { success = true, id = input.Id };
            if (ModelState.IsValid)
            {
                AcDomain.Handle(input.ToCommand(AcSession));
            }
            else
            {
                responseResult.success = false;
                string msg = ModelState.Aggregate(string.Empty, (current1, item) => item.Value.Errors.Aggregate(current1, (current, e) => current + e.ErrorMessage));

                responseResult.msg = msg;
            }

            return this.JsonResult(responseResult);
        }