/// <summary> /// 添加一条数据 /// </summary> /// <param name="model"></param> /// <returns></returns> public bool Add(Securety model) { try { WriteConcernResult wcr = mc.Insert(model); return(!wcr.HasLastErrorMessage); } catch (Exception ex) { return(false); } }
/// <summary> /// 更新一条数据 /// </summary> /// <param name="model"></param> /// <returns></returns> public bool Update(Securety model) { try { var query = Query.EQ("_id", model.Id); BsonDocument bd = BsonExtensionMethods.ToBsonDocument(model); WriteConcernResult wcr = mc.Update(query, new UpdateDocument(bd)); return(!wcr.HasLastErrorMessage); } catch (Exception ex) { return(false); } }
/// <summary> /// 更新一条数据 /// </summary> /// <param name="model"></param> /// <returns></returns> public bool Update(Securety model) { return(dal.Update(model)); }
/// <summary> /// 添加一条数据 /// </summary> /// <param name="model"></param> /// <returns></returns> public bool Add(Securety model) { dal.Add(model); return(true); }