示例#1
0
 /// <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);
     }
 }
示例#2
0
 /// <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);
     }
 }
示例#3
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 /// <param name="model"></param>
 /// <returns></returns>
 public bool Update(Securety model)
 {
     return(dal.Update(model));
 }
示例#4
0
 /// <summary>
 /// 添加一条数据
 /// </summary>
 /// <param name="model"></param>
 /// <returns></returns>
 public bool Add(Securety model)
 {
     dal.Add(model);
     return(true);
 }