Exemplo n.º 1
0
        void btnDelete_Click(object sender, EventArgs e)
        {
            CommerceReport.DeleteOrder(order.OrderGuid);
            FullfillDownloadTicket.DeleteByOrder(order.OrderGuid);
            Order.Delete(orderGuid);

            string redirectUrl = "AdminOrderHistory.aspx?pageid="
                                 + pageId.ToInvariantString()
                                 + "&mid=" + moduleId.ToInvariantString();

            WebUtils.SetupRedirect(this, redirectUrl);
        }
        private void PopulateControls()
        {
            if (ticketGuid == Guid.Empty)
            {
                return;
            }

            using (IDataReader reader = FullfillDownloadTicket.GetDownloadHistory(ticketGuid))
            {
                grdDownloadHistory.DataSource = reader;
                grdDownloadHistory.DataBind();
            }
        }
Exemplo n.º 3
0
        private void LoadSettings()
        {
            ticketGuid  = WebUtils.ParseGuidFromQueryString("ticket", ticketGuid);
            productGuid = WebUtils.ParseGuidFromQueryString("prod", productGuid);

            // these are only used for edit users downloads
            pageId   = WebUtils.ParseInt32FromQueryString("pageid", -1);
            moduleId = WebUtils.ParseInt32FromQueryString("mid", true, -1);

            if (pageId > -1)
            {
                userCanEdit = UserCanEditModule(moduleId, Store.FeatureGuid);
            }

            currentUser = SiteUtils.GetCurrentSiteUser();

            if (ticketGuid != Guid.Empty)
            {
                downloadTicket = new FullfillDownloadTicket(ticketGuid);
                if (downloadTicket.UserGuid != currentUser.UserGuid)
                {
                    downloadTicket = null;
                    log.Info("downloadTicket UserGuid did not match the current user so not allowing the download.");
                }
            }


            upLoadPath = "~/Data/Sites/" + siteSettings.SiteId.ToString() + "/webstoreproductfiles/";



            FileSystemProvider p = FileSystemManager.Providers[WebConfigSettings.FileSystemProvider];

            if (p == null)
            {
                log.Error("Could not load file system provider " + WebConfigSettings.FileSystemProvider);
                return;
            }

            fileSystem = p.GetFileSystem();
            if (fileSystem == null)
            {
                log.Error("Could not load file system from provider " + WebConfigSettings.FileSystemProvider);
                return;
            }
        }
Exemplo n.º 4
0
        void btnSaveStatusChange_Click(object sender, EventArgs e)
        {
            if (order != null)
            {
                ISettingControl setting = orderStatusControl as ISettingControl;
                string          status  = setting.GetValue();
                if (status.Length == 36)
                {
                    Guid newStatusGuid = new Guid(status);
                    order.StatusGuid = newStatusGuid;
                    order.Save();

                    if ((newStatusGuid == OrderStatus.OrderStatusCancelledGuid) || (newStatusGuid == OrderStatus.OrderStatusNoneGuid))
                    {
                        FullfillDownloadTicket.DeleteByOrder(order.OrderGuid);
                        CommerceReport.DeleteOrder(order.OrderGuid);
                    }
                }
            }

            WebUtils.SetupRedirect(this, Request.RawUrl);
        }