public bool DeleteCharactor(MsgInformationEx MsgDTO, object[] param) { var charactor = param[0] as string; var query = MongoService <CharactorSetting> .Get(c => c.GroupNumber == MsgDTO.FromGroup && c.Charactor == charactor); if (query.IsNullOrEmpty()) { MsgSender.PushMsg(MsgDTO, "这个人物还没有被创建呢!"); return(false); } if (query.First().Creator != MsgDTO.FromQQ) { MsgSender.PushMsg(MsgDTO, "你只能删除自己创建的人物噢!"); return(false); } foreach (var c in query) { MongoService <CharactorSetting> .Delete(c); } MsgSender.PushMsg(MsgDTO, "删除成功!"); return(true); }
public void Delete(ObjectId id) { var ad = GetById(id); if (ad != null) { _mongoService.Delete(colName, ad); } }
public void Die(int count) { if (count >= Count) { MongoService <SoldierGroup> .Delete(this); } else { Count -= count; MongoService <SoldierGroup> .Update(this); } }
public bool DeleteHello(MsgInformationEx MsgDTO, object[] param) { var query = HelloList.FirstOrDefault(h => h.GroupNum == MsgDTO.FromGroup && h.QQNum == MsgDTO.FromQQ); if (query == null) { MsgSender.PushMsg(MsgDTO, "你还没有设定过招呼内容哦~"); return(false); } MongoService <HelloRecord> .Delete(query); HelloList.Remove(query); MsgSender.PushMsg(MsgDTO, "删除成功!"); return(true); }
public bool FreeBlackList(MsgInformationEx MsgDTO, object[] param) { var qqNum = (long)param[0]; var query = MongoService <BlackList> .GetOnly(b => b.QQNum == qqNum); if (query == null) { MsgSender.PushMsg(MsgDTO, "Not In BlackList"); return(false); } MongoService <BlackList> .Delete(query); DirtyFilterSvc.RefreshData(); MsgSender.PushMsg(MsgDTO, "Success"); return(true); }
public async Task <ActionResult <int> > DeleteCostAttribute(int bidId) { const string logMessage = "Delete costattribute, "; try { Log.Information($"{logMessage}begin"); await _mongoService.Delete(bidId); Log.Information($"{logMessage}end"); return(Ok()); } catch (Exception ex) { Log.Error($"{logMessage}error, {ex.Message}"); return(BadRequest()); } }
public void Delete() { MongoService <AliveStateCache> .Delete(this); }
public void Remove() { MongoService <HelloRecord> .Delete(this); }
public void Delete() { MongoService <SignInSuccessiveRecord> .Delete(this); }
public void Remove() { MongoService <OSPersonBuff> .Delete(this); }
public void Remove() { MongoService <BonusCodeRef> .Delete(this); }
public static void Refresh(long QQNum) { var rec = GetToday(QQNum); MongoService <DailyVipGoodsRecord> .Delete(rec); }