protected void Page_Load(object sender, EventArgs e)
 {
     if (!this.Page.IsPostBack)
     {
         int    result = 0;
         string s      = base.Request.QueryString["id"];
         bool   isMarketplaceAdministrator = base.CurrentSueetieUser.IsMarketplaceAdministrator;
         if ((s != null) && int.TryParse(s, out result))
         {
             base.CurrentSueetieProduct = Products.GetSueetieProduct(result);
         }
         if ((base.CurrentSueetieProduct != null) && ((base.CurrentSueetieProduct.UserID == base.CurrentSueetieUser.UserID) || isMarketplaceAdministrator))
         {
             this.AdTitleLabel.Text = base.CurrentSueetieProduct.Title;
             string str2 = "id=" + base.Server.UrlEncode(s);
             this.ShowProductLink.NavigateUrl  = "/" + SueetieApplications.Get().Marketplace.ApplicationKey + "/ShowProduct.aspx?" + str2;
             this.ShowProductLink.Target       = "_blank";
             this.BackToEditAdLink.NavigateUrl = "EditProduct.aspx?" + str2;
             this.BackToEditAdLink.Visible     = isMarketplaceAdministrator;
         }
         else
         {
             base.Response.Redirect("/default.aspx", true);
         }
         this.MainUploadsPanel.Visible = true;
         this.NoUploadsPanel.Visible   = false;
     }
 }
Ejemplo n.º 2
0
        protected void Submit_Click(object sender, EventArgs e)
        {
            string _theme       = txtTheme.Text.ToLower().Trim();
            string _mobileTheme = txtMobileTheme.Text.ToLower().Trim();

            // Update Application and Group Themes
            // Each theme has to have an associated blog theme

            foreach (SueetieApplication _sueetieApplication in SueetieApplications.Get().All)
            {
                if (_sueetieApplication.ApplicationTypeID == (int)SueetieApplicationType.Blog && _sueetieApplication.GroupID == 0)
                {
                    try
                    {
                        SueetieBlogUtils.UpdateBlogTheme(_sueetieApplication.ApplicationKey, _theme);
                    }
                    catch (Exception ex)
                    {
                        SueetieLogs.LogException("Blog Theme Update Error: " + ex.Message + " Stacktrace: " + ex.StackTrace);
                    }
                }
            }
            SueetieForums.UpdateForumTheme(_theme);
            WikiThemes.UpdateWikiTheme(SueetieApplications.Get().Wiki.ApplicationKey, _theme);

            //// Update BlogEngine Group Themes - Will add to SueetieApplications logic
            // SueetieBlogUtils.UpdateBlogTheme("groups/demo/blog", _theme);
            // WikiThemes.UpdateWikiTheme("groups/demo/wiki", _theme);

            SueetieCommon.UpdateSiteSetting(new SiteSetting("Theme", _theme));
            SueetieCommon.UpdateSiteSetting(new SiteSetting("MobileTheme", _mobileTheme));

            if (SueetieUIHelper.GetCurrentTrustLevel() >= AspNetHostingPermissionLevel.High)
            {
                HttpRuntime.UnloadAppDomain();
            }
            else
            {
                SueetieLogs.LogException("Unable to restart Sueetie. Must have High/Unrestricted Trust to Unload Application.");
            }

            lblResults.Visible        = true;
            lblResults.Text           = "Current Themes updated!";
            lblResultsDetails.Visible = true;
            lblResultsDetails.Text    = "New application themes may not appear right away. Touch web.configs to restart the app if this is the case.";
        }
Ejemplo n.º 3
0
        public static string ShoppingCartLink()
        {
            string str = string.Empty;

            if (!SueetieContext.Current.IsAnonymousUser)
            {
                PaymentService primaryPaymentService = CommerceContext.Current.PrimaryPaymentService;
                return(string.Format(primaryPaymentService.CartUrl, primaryPaymentService.AccountName, primaryPaymentService.ReturnUrl, primaryPaymentService.ShoppingUrl));
            }
            str = "/members/login.aspx";
            if (CommerceContext.Current.CurrentSueetieProduct != null)
            {
                string str2 = str;
                return(str2 + "?ReturnUrl=/" + SueetieApplications.Get().Marketplace.ApplicationKey + "/ShowProduct.aspx" + HttpContext.Current.Request.Url.Query);
            }
            return(str + "?ReturnUrl=/" + SueetieApplications.Get().Marketplace.ApplicationKey + "/default.aspx");
        }
Ejemplo n.º 4
0
        protected void AdDataSource_Selected(object sender, ObjectDataSourceStatusEventArgs e)
        {
            var returnValue = e.ReturnValue as SueetieProduct;

            if (returnValue != null && this.CurrentSueetieUser.IsMarketplaceAdministrator)
            {
                var productId = returnValue.ProductID.ToString();
                this.CategoryDropDown.CurrentCategoryId = returnValue.CategoryID;
                this.ManagePhotosLink.NavigateUrl       = "ManagePhotos.aspx?id=" + productId;
                this.ShowProductLink.NavigateUrl        = string.Format("/{0}/ShowProduct.aspx?id={1}", SueetieApplications.Get().Marketplace.ApplicationKey, productId);
                this.ShowProductLink.Target             = "_blank";
            }
        }
Ejemplo n.º 5
0
        protected void PostAdWizard_FinishButtonClick(object sender, WizardNavigationEventArgs e)
        {
            if (this.Page.IsValid)
            {
                var purchaseType = PurchaseType.Commercial;
                if (Enum.IsDefined(typeof(PurchaseType), Convert.ToInt32(this.rblPurchaseTypes.SelectedValue)))
                {
                    purchaseType = (PurchaseType)Enum.Parse(typeof(PurchaseType), this.rblPurchaseTypes.SelectedValue);
                }

                var sueetieProduct = new SueetieProduct
                {
                    UserID             = this.CurrentSueetieUserID,
                    CategoryID         = this.CategoryPath.CurrentCategoryId,
                    Title              = this.TitleTextBox.Text,
                    SubTitle           = this.SubTitleTextBox.Text,
                    ProductDescription = this.DescriptionTextBox.Text,
                    DateCreated        = DateTime.Now,
                    DownloadURL        = this.UrlTextBox.Text,
                    Price              = decimal.Parse(this.PriceTextBox.Text),
                    PurchaseTypeID     = (int)purchaseType,
                    ProductTypeID      = int.Parse(this.rblProductTypes.SelectedValue.ToString()),
                    StatusTypeID       = 100
                };

                if (this.FileUploadControl != null && string.IsNullOrWhiteSpace(sueetieProduct.DownloadURL) && !string.IsNullOrWhiteSpace(this.FileUploadControl.FileName))
                {
                    sueetieProduct.DownloadURL = this.FileUploadControl.FileName;
                }

                int id = Products.CreateSueetieProduct(sueetieProduct);

                if (this.FileUploadControl != null && this.FileUploadControl.FileBytes != null && this.FileUploadControl.FileBytes.Length != 0)
                {
                    var localPath = sueetieProduct.ResolveFilePath(this.Server);
                    var directory = Path.GetDirectoryName(localPath);
                    if (!Directory.Exists(directory))
                    {
                        Directory.CreateDirectory(directory);
                    }

                    this.FileUploadControl.SaveAs(localPath);
                }

                var sueetieContent = new SueetieContent
                {
                    ContentTypeID = 0x12,
                    ApplicationID = SueetieApplications.Get().Marketplace.ApplicationID,
                    IsRestricted  = false,
                    SourceID      = id,
                    UserID        = base.CurrentSueetieUserID,
                    Permalink     = string.Concat(new object[] { "/", SueetieApplications.Get().Marketplace.ApplicationKey, "/ShowProduct.aspx?id=", id })
                };

                var contentId = SueetieCommon.AddSueetieContent(sueetieContent);
                SueetieLogs.LogUserEntry(UserLogCategoryType.MarketplaceProduct, contentId, base.CurrentSueetieUserID);

                this.UploadImagesLink.Visible     = true;
                this.UploadImagesLink.NavigateUrl = "ManagePhotos.aspx?id=" + id.ToString();

                CommerceCommon.ClearMarketplaceCache();
            }
        }