Exemple #1
0
        public override bool SaveStep(ref System.Collections.Specialized.NameValueCollection queryString)
        {
            Page.Validate("WizardStep1");
            if (Page.IsValid)
            {
                page.Title       = Common.Extensions.StripHTMLTags(this.TxtTitle.Text);
                page.VirtualURL  = this.txtCommName.Text;
                page.PageType    = (PageType)Enum.Parse(typeof(PageType), RCBPageType.SelectedValue);
                page.Description = this.RadEditor1.Content;
                page.TagList     = Common.Extensions.StripHTMLTags(this.HFTagWords.Value);
                page.ShowState   = ObjectShowState.Published;
                InsertRoles();
                page.Status    = (ObjectStatus)Enum.Parse(typeof(ObjectStatus), this.HFStatus.Value);
                page.Copyright = int.Parse(this.HFCopyright.Value);
                double geoLat;
                if (double.TryParse(this.HFGeoLat.Value, out geoLat))
                {
                    page.Geo_Lat = geoLat;
                }
                double geoLong;
                if (double.TryParse(this.HFGeoLong.Value, out geoLong))
                {
                    page.Geo_Long = geoLong;
                }
                page.Zip                = this.HFZip.Value;
                page.City               = this.HFCity.Value;
                page.Street             = this.HFStreet.Value;
                page.CountryCode        = this.HFCountry.Value;
                community.CtyVirtualUrl = page.VirtualURL;

                using (TransactionScope scope = new TransactionScope())
                {
                    page.Update(UserDataContext.GetUserDataContext());

                    if (community.CtyStatus == (int)CommunityStatus.Initializing)
                    {
                        var thePage = PagesConfig.CreateNewPage(ObjectID.Value, "Page", "Start", "Home");
                        // TODO: Insert Default Widgets
                    }
                    community.CtyStatus = (int)CommunityStatus.Ready;
                    community.Save();
                    scope.Complete();
                }

                return(true);
            }
            else
            {
                return(false);
            }
        }
Exemple #2
0
        private void OnNewPageClick(object sender, EventArgs e)
        {
            string pageType = "Community";

            if (PageOrCommunity.ObjectType == Helper.GetObjectTypeNumericID("ProfileCommunity"))
            {
                pageType = "Profile";
            }
            else if (PageOrCommunity.ObjectType == Helper.GetObjectTypeNumericID("Page"))
            {
                pageType = "Page";
            }

            var subSonicPage = PagesConfig.CreateNewPage(PageOrCommunity.ObjectID.Value, pageType, "NewPage", language.GetString("TextTabUnnamed"));
            var page         = WDC.hitbl_Page_PAGs.Where(x => x.PAG_ID == subSonicPage.PagId).Single();

            Pages.Add(page);

            LoadTabBar();
        }
Exemple #3
0
        public override bool SaveStep(ref System.Collections.Specialized.NameValueCollection queryString)
        {
            if (Page.IsValid)
            {
                currDatatObjectCommunity.Title       = Common.Extensions.StripHTMLTags(this.TxtTitle.Text);
                currDatatObjectCommunity.VirtualURL  = this.txtCommName.Text;
                currDatatObjectCommunity.Description = this.RadEditor1.Content;
                currDatatObjectCommunity.TagList     = Common.Extensions.StripHTMLTags(this.HFTagWords.Value);
                currDatatObjectCommunity.ShowState   = ObjectShowState.Published;
                currDatatObjectCommunity.Managed     = Convert.ToBoolean(Convert.ToInt32((string)this.HFManaged.Value));
                currDatatObjectCommunity.Status      = (ObjectStatus)Enum.Parse(typeof(ObjectStatus), this.HFStatus.Value);
                currDatatObjectCommunity.Copyright   = int.Parse(this.HFCopyright.Value);
                double geoLat;
                if (double.TryParse(this.HFGeoLat.Value, out geoLat))
                {
                    currDatatObjectCommunity.Geo_Lat = geoLat;
                }
                double geoLong;
                if (double.TryParse(this.HFGeoLong.Value, out geoLong))
                {
                    currDatatObjectCommunity.Geo_Long = geoLong;
                }
                currDatatObjectCommunity.Zip         = this.HFZip.Value;
                currDatatObjectCommunity.City        = this.HFCity.Value;
                currDatatObjectCommunity.Street      = this.HFStreet.Value;
                currDatatObjectCommunity.CountryCode = this.HFCountry.Value;
                currComm.CtyVirtualUrl = currDatatObjectCommunity.VirtualURL;

                using (TransactionScope scope = new TransactionScope())
                {
                    currDatatObjectCommunity.Update(UserDataContext.GetUserDataContext());

                    if (currComm.CtyStatus == (int)CommunityStatus.Initializing)
                    {
                        var privatePage = PagesConfig.CreateNewPage(ObjectID.Value, "Community", "Private", "Dashboard");
                        var thePage     = PagesConfig.CreateNewPage(ObjectID.Value, "Community", "Start", "Home");
                        HirelCommunityUserCur.Insert(currComm.CtyId, udc.UserID, true, 0, DateTime.Now, Guid.Empty);
                        SPs.HispDataObjectAddMemberCount(currComm.CtyId, 1).Execute();
                        try
                        {
                            if (udc.UserID != Constants.ADMIN_USERID.ToGuid())
                            {
                                HirelCommunityUserCur.Insert(currComm.CtyId, new Guid(Constants.ADMIN_USERID), true, 0, DateTime.Now, Guid.Empty);
                                SPs.HispDataObjectAddMemberCount(currComm.CtyId, 1).Execute();
                            }
                        }
                        catch
                        {
                        }
                    }
                    currComm.CtyStatus = (int)CommunityStatus.Ready;
                    currComm.Save();
                    _4screen.CSB.Extensions.Business.IncentivePointsManager.AddIncentivePointEvent("COMMUNITY_UPLOAD", udc, ObjectID.Value.ToString());
                    scope.Complete();
                }

                return(true);
            }
            else
            {
                return(false);
            }
        }