Example #1
0
 public ImagePush(String contentID)
 {
     try
     {
         ImagePush obj = new ImagePush();
         MongoDatabase md = MongoDBHelper.MongoDB;
         MongoCollection<ImagePush> mc = md.GetCollection<ImagePush>(ImagePush.GetCollectionName());
         obj = mc.FindOne(Query.EQ("_id", ObjectId.Parse(contentID)));
         this._id = obj._id;
         this.ContentID = obj.ContentID;
         this.MemberID = obj.MemberID;
         this.Creater = new Creater.Creater(obj.MemberID);
         this.ImageList = obj.ImageList;
         this.ImageContent = obj.ImageContent;
         this.ImagePushCount = obj.ImagePushCount;
         this.CreatedTime = obj.CreatedTime;
         this.DeleteFlag = obj.DeleteFlag;
     }
     catch (System.Exception err)
     {
         throw new CBB.ExceptionHelper.OperationException(
             CBB.ExceptionHelper.ErrType.SystemErr,
             CBB.ExceptionHelper.ErrNo.DBOperationError,
             err);
     }
 }
Example #2
0
 /// <summary>
 /// 内容回复的添加或更新
 /// </summary>
 /// <param name="obj">回复对象</param>
 /// <returns>添加或更新操作是否成功</returns>
 public ImagePush Save(ImagePush obj)
 {
     try
     {
         MongoDatabase md = MongoDBHelper.MongoDB;
         MongoCollection<ImagePush> mc = md.GetCollection<ImagePush>(ImagePush.GetCollectionName());
         mc.Save(obj);
         return obj;
     }
     catch (System.Exception err)
     {
         throw new CBB.ExceptionHelper.OperationException(
             CBB.ExceptionHelper.ErrType.SystemErr,
             CBB.ExceptionHelper.ErrNo.DBOperationError,
             err);
     }
 }
Example #3
0
 /// <summary>
 /// 回复删除
 /// </summary>
 /// <param name="ID">回复编号</param>
 /// <returns>删除是否成功</returns>
 public static Boolean Remove(String ID)
 {
     try
     {
         ImagePush imagePush = new ImagePush(ID);
         imagePush.DeleteFlag = Comm.DeletedFlag.No;
         imagePush.Save(imagePush);
         return true;
     }
     catch (System.Exception err)
     {
         throw new CBB.ExceptionHelper.OperationException(
             CBB.ExceptionHelper.ErrType.SystemErr,
             CBB.ExceptionHelper.ErrNo.DBOperationError,
             err);
     }
 }