Beispiel #1
0
        private void btnDelete_Click(object sender, RoutedEventArgs e)
        {
            Operator op = (Operator)gridOperator.SelectedItem;

            if (op == null)
            {
                MessageBox.Show("请选择要删除的对象!");
                return;
            }
            if (MessageBox.Show("你真的要删除" + op.RealName + "吗?", "提醒", MessageBoxButton.YesNo) == MessageBoxResult.Yes)
            {
                Guid OperatorId = CommonHelper.GetOperatorId();
                T_OperationLogDAL.Insert(OperatorId, "删除" + op.UserName);
                OperatorDAL.DeleteById(op.Id);
                LoadData();
            }
        }
Beispiel #2
0
        private void btnDelete_Click(object sender, RoutedEventArgs e)
        {
            Operator op = (Operator)gridOperators.SelectedItem;

            if (op == null)
            {
                MessageBox.Show("没有选中任何行!");
                return;
            }
            if (MessageBox.Show("真的要删除" + op.UserName + "吗?", "提醒",
                                MessageBoxButton.YesNo) == MessageBoxResult.Yes)
            {
                OperatorDAL dal = new OperatorDAL();
                dal.DeleteById(op.Id);//软删除

                Guid operatorId = CommonHelper.GetOperatorId();
                new T_OperationLogDAL().Insert(operatorId, "删除管理员" + op.UserName);
                LoadData();
            }
        }