Пример #1
0
        private void remove_attention_buttom_Click(object sender, EventArgs e)
        {
            AttentionService attentionService = new AttentionService();

            if (attentionDataGridView.CurrentRow != null)
            {
                String listener  = attentionDataGridView.CurrentRow.Cells[0].Value.ToString();
                String group     = attentionDataGridView.CurrentRow.Cells[1].Value.ToString();
                String attention = attentionDataGridView.CurrentRow.Cells[2].Value.ToString();
                attentionService.Remove(listener, attention, group);
                search_attention_buttom_Click(sender, e);
            }
            bindingSource_attentionUser.ResetBindings(true);
            bindingSource_attentionUser.DataSource = attentionService.Listeners;
        }
        public override int HandleImpl()
        {
            try
            {
                String[]         temp             = message.Split(' ');
                String           AttentionPoint   = temp[1];
                String           GroupNum         = temp[2];
                AttentionService attentionService = new AttentionService();
                if (attentionService.Remove(fromQQ, AttentionPoint, GroupNum))
                {
                    CQ.Api.SendPrivateMessage(Convert.ToInt64(fromQQ), "删除关注成功!");
                }
                else
                {
                    CQ.Api.SendPrivateMessage(Convert.ToInt64(fromQQ), "【删除失败】只能删除已关注内容");
                }
            }
            catch (Exception e)
            {
                CQ.Api.SendPrivateMessage(Convert.ToInt64(fromQQ), "无法删除:没有关注或者不是该群!");
            }

            return(0);
        }