Exemplo n.º 1
0
        /// <summary>
        ///     Deletes the action.
        /// </summary>
        /// <param name="model">The model.</param>
        public void DeleteAction(T model)
        {
            MessageBoxResult msg = MessageBox.Show("确定要删除吗?", "删除", MessageBoxButton.YesNo, MessageBoxImage.Question);

            if (msg == MessageBoxResult.Yes)
            {
                IBaseDataService <T> service = GetDataService();
                ResultMsg            r       = service.Delete(model);
                if (r.IsSuccess)
                {
                    _Collection.Remove(model);
                }
                else
                {
                    MessageBox.Show("删除失败", "删除", MessageBoxButton.OK, MessageBoxImage.Error);
                }
            }
        }
Exemplo n.º 2
0
        public void DeleteOrg()
        {
            MessageBoxResult msg = MessageBox.Show("确定要删除吗?", "删除", MessageBoxButton.YesNo, MessageBoxImage.Question);

            if (msg == MessageBoxResult.Yes)
            {
                IBaseDataService <OPC_OrgInfo> service = GetDataService();
                ResultMsg r = service.Delete(OPC_OrgInfo);
                if (r.IsSuccess)
                {
                    Remove();
                }
                else
                {
                    MessageBox.Show("删除失败", "删除", MessageBoxButton.OK, MessageBoxImage.Error);
                }
            }
        }