Example #1
0
        public void Update(Guid CtyId, string CtyVirtualUrl, DateTime?CtyStartDate, DateTime?CtyEndDate, int?CtyStatus, int?CtyPriority, DateTime?CtyLastBatchRunning, DateTime CtyInsertedDate, DateTime?CtyUpdatedDate, string CtyLayout, string CtyTheme, Guid?UsrIdInserted, Guid?UsrIdUpdated, string CtyBodyStyle, string CtyHeaderStyle, string CtyFooterStyle, bool CtyIsProfile)
        {
            HitblCommunityCty item = new HitblCommunityCty();

            item.MarkOld();
            item.IsLoaded = true;

            item.CtyId = CtyId;

            item.CtyVirtualUrl = CtyVirtualUrl;

            item.CtyStartDate = CtyStartDate;

            item.CtyEndDate = CtyEndDate;

            item.CtyStatus = CtyStatus;

            item.CtyPriority = CtyPriority;

            item.CtyLastBatchRunning = CtyLastBatchRunning;

            item.CtyInsertedDate = CtyInsertedDate;

            item.CtyUpdatedDate = CtyUpdatedDate;

            item.CtyLayout = CtyLayout;

            item.CtyTheme = CtyTheme;

            item.UsrIdInserted = UsrIdInserted;

            item.UsrIdUpdated = UsrIdUpdated;

            item.CtyBodyStyle = CtyBodyStyle;

            item.CtyHeaderStyle = CtyHeaderStyle;

            item.CtyFooterStyle = CtyFooterStyle;

            item.CtyIsProfile = CtyIsProfile;

            item.Save(UserName);
        }
Example #2
0
        public static Guid CreateUserProfileCommunity(UserDataContext udc, UserProfile userProfile)
        {
            string layoutName    = CustomizationSection.CachedInstance.DefaultLayouts.ProfileCommunity;
            Guid   communityIdD  = Guid.NewGuid();
            Guid   currentPageId = Guid.NewGuid();
            string strUserKey    = userProfile.UserId.ToString();

            DataObjectProfileCommunity dataObjectCommunity = new DataObjectProfileCommunity(UserDataContext.GetUserDataContext(userProfile.Nickname));

            dataObjectCommunity.Status      = ObjectStatus.Public;
            dataObjectCommunity.Title       = userProfile.Nickname;
            dataObjectCommunity.CommunityID = communityIdD;
            dataObjectCommunity.Insert(udc);

            HitblCommunityCty community = new HitblCommunityCty();

            community.CtyInsertedDate = DateTime.Now;
            community.CtyUpdatedDate  = DateTime.Now;
            community.CtyVirtualUrl   = userProfile.Nickname;
            community.UsrIdInserted   = userProfile.UserId;
            community.UsrIdUpdated    = userProfile.UserId;
            community.CtyIsProfile    = true;
            community.CtyStatus       = (int)CommunityStatus.Initializing;
            community.CtyLayout       = layoutName;
            community.CtyTheme        = Constants.DEFAULT_THEME;
            community.CtyId           = communityIdD;
            community.Save();

            HirelCommunityUserCur.Insert(communityIdD, userProfile.UserId, true, 0, DateTime.Now, Guid.Empty);
            HirelCommunityUserCur.Insert(community.CtyId, new Guid(Constants.ADMIN_USERID), true, 0, DateTime.Now, Guid.Empty);

            userProfile.ProfileCommunityID = communityIdD;
            userProfile.Save();
            currentPageId       = PagesConfig.CreateNewPage(communityIdD, "Profile", "Private", "Dashboard").PagId;
            currentPageId       = PagesConfig.CreateNewPage(communityIdD, "Profile", "Start", "Home").PagId;
            community.CtyStatus = (int)CommunityStatus.Ready;
            community.Save();

            FriendHandler.TransferFriendAsCommunityMember(communityIdD, userProfile.UserId);

            return(communityIdD);
        }
Example #3
0
        public static Guid GetIDByVirtualUrl(string virtualUrl)
        {
            Guid        communityID = Guid.Empty;
            IDataReader idr         = null;

            try
            {
                idr = HitblCommunityCty.FetchByParameter(HitblCommunityCty.Columns.CtyVirtualUrl, SubSonic.Comparison.Like, virtualUrl);
                if (idr.Read())
                {
                    communityID = new Guid(idr[HitblCommunityCty.Columns.CtyId].ToString());
                }
            }
            finally
            {
                if (idr != null && !idr.IsClosed)
                {
                    idr.Close();
                }
            }
            return(communityID);
        }
Example #4
0
        private void LoadProperties(string communityName)
        {
            string      strStyleInfo = string.Empty;
            IDataReader idr          = null;

            try
            {
                if (!string.IsNullOrEmpty(communityName))
                {
                    idr = HitblCommunityCty.FetchByParameter(HitblCommunityCty.Columns.CtyVirtualUrl, SubSonic.Comparison.Equals, communityName);
                    FillProperties(idr);
                }
            }
            catch
            {
            }
            finally
            {
                if (idr != null && !idr.IsClosed)
                {
                    idr.Close();
                }
            }
        }
Example #5
0
        private void LoadProperties(Guid communityId)
        {
            string      strStyleInfo = string.Empty;
            IDataReader idr          = null;

            try
            {
                if (!communityId.Equals(Guid.Empty))
                {
                    idr = HitblCommunityCty.FetchByParameter(HitblCommunityCty.Columns.CtyId, SubSonic.Comparison.Equals, communityId);
                    FillProperties(idr);
                }
            }
            catch
            {
            }
            finally
            {
                if (idr != null && !idr.IsClosed)
                {
                    idr.Close();
                }
            }
        }
Example #6
0
 public bool Destroy(object CtyId)
 {
     return(HitblCommunityCty.Destroy(CtyId) == 1);
 }
Example #7
0
 public bool Delete(object CtyId)
 {
     return(HitblCommunityCty.Delete(CtyId) == 1);
 }