예제 #1
0
        public IActionResult CreateDashBoard()
        {
            EditDashBoardModel model = new EditDashBoardModel();

            model.SolutionId = SolutionId.Value;
            model.EntityId   = Guid.Empty;
            return(View(model));
        }
예제 #2
0
 public IActionResult EditDashBoard([FromBody] EditDashBoardModel model)
 {
     if (ModelState.IsValid)
     {
         var entity = _systemFormFinder.FindById(model.SystemFormId);
         model.CopyTo(entity);
         entity.ModifiedBy = CurrentUser.SystemUserId;
         entity.ModifiedOn = DateTime.Now;
         _systemFormUpdater.Update(entity, true);
         return(UpdateSuccess());
     }
     return(JError(GetModelErrors()));
 }
예제 #3
0
        public IActionResult EditDashBoard(Guid id)
        {
            EditDashBoardModel model = new EditDashBoardModel();

            if (!id.Equals(Guid.Empty))
            {
                var entity = _systemFormFinder.FindById(id);
                if (entity != null)
                {
                    entity.CopyTo(model);
                    model.SystemFormId = id;
                    return(View(model));
                }
            }
            return(NotFound());
        }
예제 #4
0
 public IActionResult CreateDashBoard([FromBody] EditDashBoardModel model)
 {
     if (ModelState.IsValid)
     {
         var entity = new SystemForm();
         model.CopyTo(entity);
         entity.SystemFormId = Guid.NewGuid();
         entity.SolutionId   = SolutionId.Value;
         entity.EntityId     = Guid.Empty;
         entity.StateCode    = Core.RecordState.Enabled;
         entity.FormType     = (int)FormType.Dashboard;
         entity.CreatedBy    = CurrentUser.SystemUserId;
         entity.CreatedOn    = DateTime.Now;
         return(_systemFormCreater.Create(entity).CreateResult(T, new { id = entity.SystemFormId }));
     }
     return(CreateFailure(GetModelErrors()));
 }