예제 #1
0
        private bool SaveEntity()
        {
            View.PostEditors();
            if (!View.ValidateData())
            {
                return(false);
            }
            bool isAdd = false;

            if (EntityId == Guid.Empty)
            {
                isAdd           = true;
                EntityId        = Guid.NewGuid();
                entity.EntityId = EntityId;
            }
            metadataServiceClient.SaveEntity(entity, isAdd);
            if (WorkingMode == EntityDetailWorkingMode.Add)
            {
                WorkingMode = EntityDetailWorkingMode.Edit;
            }
            OnEntitySaved(EventArgs.Empty);
            WorkItem.Commands["Refresh"].Execute();
            BindList();
            return(true);
        }