public void CreatingANewJsonStatusResultShouldInitializeResultCorrecty()
 {
     var result = new JsonStatusResult();
     Assert.IsNotNull(((dynamic)result.Data));
     Assert.IsFalse(((dynamic)result.Data).Success);
     Assert.IsNull(((dynamic)result.Message));
 }
Example #2
0
        public JsonResult SaveData(EntityServiceCollection records)
        {
            JsonStatusResult status = new JsonStatusResult();

            if (records.IsEmpty())
            {
                status.Message = StrixIT.Platform.Modules.Cms.Resources.Interface.NoRecordsToSave;
                return(this.Json(status));
            }

            status.Success = this._service.SaveActionRecords(records);

            if (!status.Success)
            {
                status.Message = StrixIT.Platform.Modules.Cms.Resources.Interface.ErrorSavingServiceAction;
            }

            return(status);
        }