示例#1
0
 public InterViewContent(String MemberID, ContentPermissions ContentPermissions, List<String> InterestID, IList<InterView.InterView> InterviewList)
 {
     PublicContent obj = new PublicContent(MemberID, ContentPermissions, InterestID, ContentType.InterView);
     this.MemberID = obj.MemberID;
     this.Creater = obj.Creater;
     this.ContentPermissions = obj.ContentPermissions;
     this.MyFriends = obj.MyFriends;
     this.City = obj.City;
     this.Sex = obj.Sex;
     this.InterestID = obj.InterestID;
     this.ContentType = obj.ContentType;
     this.CreatedTime = obj.CreatedTime;
     this.UpdateTime = obj.UpdateTime;
     this.AnswerCount = obj.AnswerCount;
     this.AnswerList = obj.AnswerList;
     this.LikeCount = obj.LikeCount;
     this.LikeList = obj.LikeList;
     this.DeleteFlag = obj.DeleteFlag;
     this.InterviewList = InterviewList;
 }
示例#2
0
 public MemberContent(String MemberID, ContentPermissions ContentPermissions, List<String> InterestID, Double Lat, Double Lng, String Type)
 {
     PublicContent obj = new PublicContent(MemberID, ContentPermissions, InterestID, ContentType.Member);
     this.MemberID = obj.MemberID;
     this.Creater = obj.Creater;
     this.ContentPermissions = obj.ContentPermissions;
     this.MyFriends = obj.MyFriends;
     this.City = obj.City;
     this.Sex = obj.Sex;
     this.InterestID = obj.InterestID;
     this.ContentType = obj.ContentType;
     this.CreatedTime = obj.CreatedTime;
     this.UpdateTime = obj.UpdateTime;
     this.AnswerCount = obj.AnswerCount;
     this.AnswerList = obj.AnswerList;
     this.LikeCount = obj.LikeCount;
     this.LikeList = obj.LikeList;
     this.DeleteFlag = obj.DeleteFlag;
     this.Lat = Lat;
     this.Lng = Lng;
     this.Type = Type;
 }
示例#3
0
 public SuiSuiNianContent(String MemberID, ContentPermissions ContentPermissions, List<String> InterestID, String Content, List<Image> ImageList, ImageLayoutType LayOutType, String Type)
 {
     PublicContent obj = new PublicContent(MemberID, ContentPermissions, InterestID, ContentType.SuiSuiNian);
     this.MemberID = obj.MemberID;
     this.Creater = obj.Creater;
     this.ContentPermissions = obj.ContentPermissions;
     this.MyFriends = obj.MyFriends;
     this.City = obj.City;
     this.Sex = obj.Sex;
     this.InterestID = obj.InterestID;
     this.ContentType = obj.ContentType;
     this.CreatedTime = obj.CreatedTime;
     this.UpdateTime = obj.UpdateTime;
     this.AnswerCount = obj.AnswerCount;
     this.AnswerList = obj.AnswerList;
     this.LikeCount = obj.LikeCount;
     this.LikeList = obj.LikeList;
     this.DeleteFlag = obj.DeleteFlag;
     this.Content = Content;
     this.ImageList = ImageList;
     this.LayOutType = LayOutType;
     this.Type = Type;
 }
示例#4
0
 /// <summary>
 /// 更新内容的回复显示集合,工厂方法
 /// </summary>
 /// <param name="ID">回复对象</param>
 /// <returns>操作是否成功</returns>
 public Boolean UpdateCommentList(Comment.Comment comment)
 {
     try
     {
         PublicContent obj = new PublicContent();
         obj = obj.getPublicContent(comment.CommentToID);
         if (obj.AnswerList.Count >= 6)
         {
             obj.AnswerList.Insert(0, comment);
             obj.AnswerList.RemoveAt(obj.AnswerList.Count - 1);
         }
         else
         {
             obj.AnswerList.Insert(0, comment);
         }
         obj.AnswerCount = Comment.CommentProvider.findForContentCount(comment.CommentToID, Comm.DeletedFlag.No);
         obj.UpdateTime = DateTime.Now;
         obj.savePublicContent(obj);
         return true;
     }
     catch (System.Exception err)
     {
         throw new CBB.ExceptionHelper.OperationException(
             CBB.ExceptionHelper.ErrType.SystemErr,
             CBB.ExceptionHelper.ErrNo.DBOperationError,
             err);
     }
 }
示例#5
0
 public PublicContent savePublicContent(PublicContent obj)
 {
     switch (obj.ContentType)
     {
         case ContentType.CallFor:
             CallForContent callfor = (CallForContent)obj;
             callfor.Save(callfor);
             break;
         case ContentType.Image:
             ImageContent image = (ImageContent)obj;
             image.Save(image);
             break;
         case ContentType.InterView:
             InterViewContent interview = (InterViewContent)obj;
             interview.Save(interview);
             break;
         case ContentType.IWant:
             IWantContent iwant = (IWantContent)obj;
             iwant.Save(iwant);
             break;
         case ContentType.Mood:
             MoodContent mood = (MoodContent)obj;
             mood.Save(mood);
             break;
         case ContentType.SuiSuiNian:
             SuiSuiNianContent suisuinian = (SuiSuiNianContent)obj;
             suisuinian.Save(suisuinian);
             break;
         case ContentType.Interest:
             InterestContent interest = (InterestContent)obj;
             interest.Save(interest);
             break;
         case ContentType.Member:
             MemberContent member = (MemberContent)obj;
             member.Save(member);
             break;
     }
     return obj;
 }
示例#6
0
 public PublicContent getPublicContent(String id)
 {
     PublicContent obj = new PublicContent();
     switch (ContentProvider.GetContentType(id))
     {
         case ContentType.CallFor:
             obj = (PublicContent)(new CallForContent(id));
             break;
         case ContentType.Image:
             obj = (PublicContent)(new ImageContent(id));
             break;
         case ContentType.InterView:
             obj = (PublicContent)(new InterViewContent(id));
             break;
         case ContentType.IWant:
             obj = (PublicContent)(new IWantContent(id));
             break;
         case ContentType.Mood:
             obj = (PublicContent)(new MoodContent(id));
             break;
         case ContentType.SuiSuiNian:
             obj = (PublicContent)(new SuiSuiNianContent(id));
             break;
         case ContentType.Interest:
             obj = (PublicContent)(new InterestContent(id));
             break;
         case ContentType.Member:
             obj = (PublicContent)(new MemberContent(id));
             break;
     }
     return obj;
 }
示例#7
0
 /// <summary>
 /// 更新喜欢的数量
 /// </summary>
 /// <param name="contentID">内容编号</param>
 /// <returns></returns>
 public static Boolean UpdateLikeCount(String contentID)
 {
     try
     {
         PublicContent obj = new PublicContent();
         obj = obj.getPublicContent(contentID);
         obj.LikeCount = Like.LikeDataFactory.GetLike<Like.LikeData>(null, contentID, Like.LikeType.Content, Like.LikeData.GetCollectionName()).Count;
         obj.UpdateTime = DateTime.Now;
         obj.savePublicContent(obj);
         return true;
     }
     catch (System.Exception err)
     {
         throw new CBB.ExceptionHelper.OperationException(
             CBB.ExceptionHelper.ErrType.SystemErr,
             CBB.ExceptionHelper.ErrNo.DBOperationError,
             err);
     }
 }
示例#8
0
 /*
 /// <summary>
 /// 更新喜欢的集合
 /// </summary>
 /// <param name="comment">回复的内容</param>
 /// <returns>操作是否成功</returns>
 public static Boolean UpdateLikeList(Comment.Comment comment)
 {
     try
     {
         PublicContent obj = new PublicContent();
         obj = obj.getPublicContent(comment.CommentToID);
         obj.LikeList.Insert(0, comment);
         obj.savePublicContent(obj);
         return true;
     }
     catch (System.Exception err)
     {
         throw new CBB.ExceptionHelper.OperationException(
             CBB.ExceptionHelper.ErrType.SystemErr,
             CBB.ExceptionHelper.ErrNo.DBOperationError,
             err);
     }
 }*/
 /// <summary>
 /// 更新访谈内容的访谈集合
 /// </summary>
 /// <param name="contentID">内容编号</param>
 /// <param name="interviewID">访谈编号</param>
 /// <returns></returns>
 public static Boolean UpdateInterViewList(String contentID, String interviewID)
 {
     try
     {
         PublicContent obj = new PublicContent();
         InterViewContent interviewcontent = (InterViewContent)obj.getPublicContent(contentID);
         InterView.InterView interview = InterView.InterViewProvider.GetInterView(interviewID);
         for (int i = 0; i < interviewcontent.InterviewList.Count; i++)
         {
             if (interviewcontent.InterviewList[i].ID == interviewID)
             {
                 interviewcontent.InterviewList.RemoveAt(i);
                 interviewcontent.InterviewList.Insert(i, interview);
                 break;
             }
         }
         obj.savePublicContent((PublicContent)interviewcontent);
         return true;
     }
     catch (System.Exception err)
     {
         throw new CBB.ExceptionHelper.OperationException(
             CBB.ExceptionHelper.ErrType.SystemErr,
             CBB.ExceptionHelper.ErrNo.DBOperationError,
             err);
     }
 }