Ejemplo n.º 1
0
        public virtual void InitBinding()
        {
            mvvmContext.RegisterService(DialogService.Create(this, DefaultDialogServiceType.RibbonDialog, "Eidt " + typeof(TEntity).Name));
            var fluantapi = mvvmContext.OfType <CollectionViewModel <TParentModelView, TParentEntity, TEntity> >();

            fluantapi.WithEvent <ColumnView, FocusedRowObjectChangedEventArgs>(gridMainView, "FocusedRowObjectChanged")
            .SetBinding(x => x.SelectedEntity, args => args.Row as TEntity, (gView, entity) => gView.FocusedRowHandle = gView.FindRow(entity));
            fluantapi.SetBinding(gridControl, t => t.DataSource, m => m.Model);
            fluantapi.BindCommand(btnNew, m => m.CreateNewEntity());
            fluantapi.BindCommand(btnDelete, m => m.DeleteEntity());
            fluantapi.BindCommand(btnEdit, m => m.EditEntity());
        }
Ejemplo n.º 2
0
 public ActionResult Create([FromBody] Dialog log)
 {
     try
     {
         dialogservice.Create(log);
         return(Ok());
     }
     catch
     {
         return(StatusCode(500));
     }
 }
        public JsonResult Create(DialogCreateViewModel model)
        {
            DialogService service = new DialogService();

            try
            {
                service.Create(model);
                return(Json(new ResponseMessage()
                {
                    Message = "Đã tạo thành công", Success = true
                }));
            }
            catch (Exception e)
            {
                return(Json(new ResponseMessage()
                {
                    Message = "Đã có lỗi xảy ra", Success = false
                }));
            }
        }