示例#1
0
        public static CommerceReportItem GetByGuid(Guid itemGuid)
        {
            CommerceReportItem item = new CommerceReportItem();

            using (IDataReader reader = DBCommerceReport.GetItemSummary(itemGuid))
            {
                if (reader.Read())
                {
                    item.itemGuid     = new Guid(reader["ItemGuid"].ToString());
                    item.moduleGuid   = new Guid(reader["ModuleGuid"].ToString());
                    item.siteGuid     = new Guid(reader["SiteGuid"].ToString());
                    item.itemName     = reader["ItemName"].ToString();
                    item.moduleTitle  = reader["ModuleTitle"].ToString();
                    item.totalRevenue = Convert.ToDecimal(reader["Revenue"]);
                }
            }

            return(item);
        }
        public static CommerceReportItem GetByGuid(Guid itemGuid)
        {
            CommerceReportItem item = new CommerceReportItem();
            using (IDataReader reader = DBCommerceReport.GetItemSummary(itemGuid))
            {
                if (reader.Read())
                {
                    item.itemGuid = new Guid(reader["ItemGuid"].ToString());
                    item.moduleGuid = new Guid(reader["ModuleGuid"].ToString());
                    item.siteGuid = new Guid(reader["SiteGuid"].ToString());
                    item.itemName = reader["ItemName"].ToString();
                    item.moduleTitle = reader["ModuleTitle"].ToString();
                    item.totalRevenue = Convert.ToDecimal(reader["Revenue"]);

                }

            }

            return item;
        }
示例#3
0
        private void LoadSettings()
        {
            isSiteEditor = SiteUtils.UserIsSiteEditor();
            isCommerceReportViewer = WebUser.IsInRoles(siteSettings.CommerceReportViewRoles);

            currencyCulture = ResourceHelper.GetCurrencyCulture(siteSettings.GetCurrency().Code);
            itemGuid = WebUtils.ParseGuidFromQueryString("i", itemGuid);
            if (itemGuid != Guid.Empty)
            {
                reportItem = CommerceReportItem.GetByGuid(itemGuid);

                if (reportItem.SiteGuid != siteSettings.SiteGuid) { reportItem = null; }
            }

            AddClassToBody("administration");
            AddClassToBody("commercereports");
        }