Ejemplo n.º 1
0
        public static void CreateIndexFromDb()
        {
            using (var luceneDirectory = LuceneDirectory)
                using (var analyzer = new RussianAnalyzer(Version))
                    using (var writer = new IndexWriter(luceneDirectory, analyzer, true, IndexWriter.MaxFieldLength.UNLIMITED))
                    {
                        writer.SetRAMBufferSizeMB(20);

                        // add data to lucene search index (replaces older entries if any)
                        var source = SQLDataAccess.ExecuteReadIEnumerable("select Product.productId, Product.ArtNo, Name, " +
                                                                          // "(select ' ' + Offer.Artno from Catalog.Offer where Offer.ProductID=Product.productid FOR XML path('')) as OfferArtno, " +
                                                                          @"(select Value from[Catalog].[PropertyValue] join[Catalog].[ProductPropertyValue] on [Catalog].[PropertyValue].PropertyValueID =[Catalog].[ProductPropertyValue].PropertyValueID
                                                                                 where[PropertyID] = 333
                                                                                  and
                                                                                  [Catalog].[ProductPropertyValue].ProductID =[Catalog].[Product].ProductId)  as Article " +
                                                                          "from [Catalog].[Product] where CategoryEnabled=1 and Enabled=1", CommandType.Text,
                                                                          reader => new SampleData(
                                                                              SQLDataHelper.GetInt(reader, "productId"),
                                                                              //SQLDataHelper.GetString(reader, "ArtNo") + " " + SQLDataHelper.GetString(reader, "Article") ,
                                                                              SQLDataHelper.GetString(reader, "Article"),
                                                                              SQLDataHelper.GetString(reader["Name"])
                                                                              )
                                                                          );
                        foreach (var item in source)
                        {
                            AddToLuceneIndex(item, writer);
                        }
                        // close handles
                        writer.Optimize();
                    }
        }
Ejemplo n.º 2
0
        public static string GetCustomerEmailById(Guid custId)
        {
            var result = SQLDataAccess.ExecuteReadOne <string>("[Customers].[sp_GetCustomerByID]", CommandType.StoredProcedure,
                                                               reader => SQLDataHelper.GetString(reader, "Email"), new SqlParameter("@CustomerID", custId));

            return(result);
        }
Ejemplo n.º 3
0
 public static List<Brand> GetBrandsByProductOnMain(ProductOnMain.TypeFlag type)
 {
     var subCmd = string.Empty;
     switch (type)
     {
         case ProductOnMain.TypeFlag.New:
             subCmd = "New=1";
             break;
         case ProductOnMain.TypeFlag.Bestseller:
             subCmd = "Bestseller=1";
             break;
         case ProductOnMain.TypeFlag.Discount:
             subCmd = "Discount>0";
             break;
     }
     string cmd =
         "Select Brand.BrandID, Brand.BrandName, UrlPath, Brand.SortOrder from Catalog.Brand where BrandID in (select BrandID from Catalog.Product where " + subCmd + " ) order by Brand.BrandName";
     return SQLDataAccess.ExecuteReadList<Brand>(cmd, CommandType.Text,
                                                  reader => new Brand
                                                  {
                                                      BrandId = SQLDataHelper.GetInt(reader, "BrandID"),
                                                      Name = SQLDataHelper.GetString(reader, "BrandName"),
                                                      UrlPath = SQLDataHelper.GetString(reader, "UrlPath")
                                                  });
 }
Ejemplo n.º 4
0
        public bool ProcessCloseRollbackOperation(int orderId, string type)
        {
            var rollbackParams = SQLDataAccess.ExecuteReadOne <RollbackParams>(
                "Select * From [ModulePayment].[MasterBank] Where OrderId = @OrderId",
                CommandType.Text,
                reader => new RollbackParams
            {
                orderId = SQLDataHelper.GetInt(reader, "OrderId"),
                order   = SQLDataHelper.GetString(reader, "StringOrderId"),
                amount  = SQLDataHelper.GetString(reader, "Amount"),
                rrn     = SQLDataHelper.GetString(reader, "RRN"),
                int_ref = SQLDataHelper.GetString(reader, "INT_REF")
            },
                new SqlParameter("@OrderId", orderId));

            if (rollbackParams == null)
            {
                return(false);
            }

            var        post_data = "AMOUNT={0}&ORDER={1}&RRN={2}&INT_REF={3}&TIMESTAMP={4}&TERMINAL={5}&SIGN={6}";
            var        timeStamp = DateTime.Now.ToString("yyyyMMddHHmmss");
            WebRequest request   = WebRequest.Create("https://pay.masterbank.ru/acquiring/" + type + "?");

            byte[] data = Encoding.UTF8.GetBytes(string.Format(post_data,
                                                               rollbackParams.amount,
                                                               rollbackParams.order,
                                                               rollbackParams.rrn,
                                                               rollbackParams.int_ref,
                                                               timeStamp,
                                                               Terminal,
                                                               GetMd5Hash(MD5.Create(), Terminal + timeStamp + rollbackParams.order + rollbackParams.amount + SecretWord)
                                                               ));

            request.Method        = "POST";
            request.ContentType   = "application/x-www-form-urlencoded";
            request.ContentLength = data.Length;

            using (var stream = request.GetRequestStream())
            {
                stream.Write(data, 0, data.Length);
            }

            request.Method = "POST";
            request.GetResponse();
            if (string.Equals(type, "close"))
            {
                OrderService.PayOrder(rollbackParams.orderId, true);
            }
            else if (string.Equals(type, "rollback"))
            {
            }

            SQLDataAccess.ExecuteNonQuery(
                "Delete From [ModulePayment].[MasterBank] Where OrderId = @OrderId",
                CommandType.Text,
                new SqlParameter("@OrderId", orderId));

            return(true);
        }
Ejemplo n.º 5
0
        public static List <PropertyGroupView> GetGroupsByProduct(int productID)
        {
            return(SQLDataAccess.ExecuteReadList(
                       @"SELECT [PropertyGroup].[PropertyGroupId]
	            ,[PropertyGroup].[GroupName] AS GroupName
	            ,Property.[PropertyId]
	            ,[Property].[Name] AS PropertyName
	            ,Type
                FROM [catalog].[ProductPropertyValue]
                    INNER JOIN [Catalog].[PropertyValue] on [ProductPropertyValue].PropertyValueID = [PropertyValue].PropertyValueID
                    INNER JOIN [Catalog].[Property] ON [Property].[PropertyID] = [PropertyValue].[PropertyID]
                    LEFT JOIN [Catalog].[PropertyGroup] on [PropertyGroup].PropertyGroupId = [Property].GroupId
                WHERE [ProductPropertyValue].ProductID = productID
                ORDER BY case when PropertyGroup.GroupSortOrder is null then 1 else 0 end, PropertyGroup.GroupSortOrder, Property.SortOrder",
                       CommandType.Text,
                       reader => new PropertyGroupView()
            {
                PropertyId = SQLDataHelper.GetInt(reader, "PropertyId"),
                PropertyGroupId = SQLDataHelper.GetInt(reader, "PropertyGroupId"),
                GroupName = SQLDataHelper.GetString(reader, "GroupName"),
                PropertyName = SQLDataHelper.GetString(reader, "PropertyName"),
                Type = SQLDataHelper.GetInt(reader, "Type"),
            },
                       new SqlParameter("@productID", productID)));
        }
Ejemplo n.º 6
0
    public static List <string> GetPaymentMethods()
    {
        var result = new List <string>();

        try
        {
            using (var db = new SQLDataAccess())
            {
                db.cmd.CommandText = "SELECT distinct Name FROM [Order].[PaymentMethod]";
                db.cmd.CommandType = CommandType.Text;
                db.cnOpen();

                using (var reader = db.cmd.ExecuteReader())
                {
                    while (reader.Read())
                    {
                        result.Add(SQLDataHelper.GetString(reader, "Name").Trim());
                    }
                }
                db.cnClose();
            }
        }
        catch (Exception ex)
        {
            Debug.LogError(ex);
        }
        return(result);
    }
Ejemplo n.º 7
0
 private static GiftCertificate GetFromReader(SqlDataReader reader)
 {
     return(new GiftCertificate
     {
         CertificateId = SQLDataHelper.GetInt(reader, "CertificateID"),
         CertificateCode = SQLDataHelper.GetString(reader, "CertificateCode"),
         FromName = SQLDataHelper.GetString(reader, "FromName"),
         ToName = SQLDataHelper.GetString(reader, "ToName"),
         OrderNumber = SQLDataHelper.GetString(reader, "OrderNumber"),
         Sum = SQLDataHelper.GetDecimal(reader, "Sum"),
         Paid = SQLDataHelper.GetBoolean(reader, "Paid"),
         Used = SQLDataHelper.GetBoolean(reader, "Used"),
         Enable = SQLDataHelper.GetBoolean(reader, "Enable"),
         Type = (CertificatePostType)(SQLDataHelper.GetInt(reader, "Type")),
         CertificateMessage = SQLDataHelper.GetString(reader, "Message"),
         Email = SQLDataHelper.GetString(reader, "Email"),
         Country = SQLDataHelper.GetString(reader, "Country"),
         Zone = SQLDataHelper.GetString(reader, "Zone"),
         City = SQLDataHelper.GetString(reader, "City"),
         Zip = SQLDataHelper.GetString(reader, "Zip"),
         Address = SQLDataHelper.GetString(reader, "Address"),
         CreationDate = SQLDataHelper.GetDateTime(reader, "CreationDate"),
         CurrencyCode = SQLDataHelper.GetString(reader, "CurrencyCode"),
         CurrencyValue = SQLDataHelper.GetDecimal(reader, "CurrencyValue"),
         FromEmail = SQLDataHelper.GetString(reader, "FromEmail")
     });
 }
Ejemplo n.º 8
0
 private static PropertyValue GetPropertyValueFromReader(SqlDataReader reader)
 {
     return(new PropertyValue
     {
         PropertyValueId = SQLDataHelper.GetInt(reader, "PropertyValueID"),
         PropertyId = SQLDataHelper.GetInt(reader, "PropertyID"),
         Value = SQLDataHelper.GetString(reader, "Value"),
         SortOrder = SQLDataHelper.GetInt(reader, "SortOrder"),
         Property = new Property
         {
             GroupId = SQLDataHelper.GetNullableInt(reader, "GroupId"),
             PropertyId = SQLDataHelper.GetInt(reader, "PropertyID"),
             Name = SQLDataHelper.GetString(reader, "PropertyName"),
             SortOrder = SQLDataHelper.GetInt(reader, "PropertySortOrder"),
             Expanded = SQLDataHelper.GetBoolean(reader, "Expanded"),
             UseInDetails = SQLDataHelper.GetBoolean(reader, "UseInDetails"),
             UseInFilter = SQLDataHelper.GetBoolean(reader, "UseInFilter"),
             UseInBrief = SQLDataHelper.GetBoolean(reader, "UseInBrief"),
             Type = SQLDataHelper.GetInt(reader, "Type"),
             Group = SQLDataHelper.GetNullableInt(reader, "GroupId") != null ? new PropertyGroup()
             {
                 PropertyGroupId = SQLDataHelper.GetInt(reader, "GroupId"),
                 Name = SQLDataHelper.GetString(reader, "GroupName"),
                 SortOrder = SQLDataHelper.GetInt(reader, "GroupSortOrder")
             }
                                :null
         }
     });
 }
Ejemplo n.º 9
0
        protected void lvModules_ItemCommand(object source, ListViewCommandEventArgs e)
        {
            var moduleVersion          = ((HiddenField)e.Item.FindControl("hfLastVersion")).Value;
            var moduleIdOnRemoteServer = ((HiddenField)e.Item.FindControl("hfId")).Value;

            if (e.CommandName == "InstallLastVersion")
            {
                var message = ModulesService.GetModuleArchiveFromRemoteServer(moduleIdOnRemoteServer);

                if (message.IsNullOrEmpty())
                {
                    HttpRuntime.UnloadAppDomain();

                    Context.ApplicationInstance.CompleteRequest();
                    Response.Redirect(
                        UrlService.GetAdminAbsoluteLink("modulesmanager.aspx?installModule=" + e.CommandArgument + "&version=" +
                                                        moduleVersion), false);
                }
                else
                {
                    //вывести message
                }
            }

            if (e.CommandName == "Uninstall")
            {
                ModulesService.UninstallModule(SQLDataHelper.GetString(e.CommandArgument));
                HttpRuntime.UnloadAppDomain();
                Response.Redirect(Request.Url.AbsoluteUri);
            }
        }
Ejemplo n.º 10
0
        private void CreateBrands()
        {
            using (var db = new SQLDataAccess())
            {
                db.cmd.CommandText = "SELECT [BrandName], [BrandID], [UrlPath] FROM [Catalog].[Brand] Where enabled=1 ORDER BY BrandName";
                db.cnOpen();
                using (var read = db.cmd.ExecuteReader())
                {
                    bool tempHaveItem = read.HasRows;

                    if (tempHaveItem)
                    {
                        _sw.WriteLine("<b>" + Resource.Client_Sitemap_Brands + " </b> <ul>");
                    }

                    while (read.Read())
                    {
                        _sw.WriteLine("<li><a href='{0}'>{1}</a></li>",
                                      _prefUrl +
                                      UrlService.GetLink(ParamType.Brand, SQLDataHelper.GetString(read["UrlPath"]),
                                                         SQLDataHelper.GetInt(read["BrandID"])), read["BrandName"]);
                    }

                    if (tempHaveItem)
                    {
                        _sw.WriteLine("</ul>");
                    }
                }
            }
        }
Ejemplo n.º 11
0
        public static CustomerContact GetSellerContact()
        {
            var result = new CustomerContact();

            using (var db = new SQLDataAccess())
            {
                db.cmd.CommandText =
                    "SELECT [Name], [Value] FROM [Settings].[Settings] WHERE [Name] = 'SalerCountryID' or [Name] = 'SalerRegionID'";
                db.cmd.CommandType = CommandType.Text;
                db.cnOpen();
                using (SqlDataReader reader = db.cmd.ExecuteReader())
                    while (reader.Read())
                    {
                        if (SQLDataHelper.GetString(reader, "Name") == "SalerCountryID")
                        {
                            result.CountryId = int.Parse(SQLDataHelper.GetString(reader, "Value"));
                        }
                        else
                        {
                            result.RegionId = int.Parse(SQLDataHelper.GetString(reader, "Value"));
                        }
                    }
                db.cnClose();
            }
            return(result);
        }
Ejemplo n.º 12
0
 public static List <KeyValuePair <string, int> > GetTopShippings()
 {
     return(SQLDataAccess.ExecuteReadList("[Order].[sp_GetShippingRating]", CommandType.StoredProcedure,
                                          reader =>
                                          new KeyValuePair <string, int>(SQLDataHelper.GetString(reader, "ShippingMethod"),
                                                                         SQLDataHelper.GetInt(reader, "Rating"))));
 }
Ejemplo n.º 13
0
        private static SiteMapData GetSiteMapDataFromReader(SqlDataReader reader)
        {
            var prefUrl = SettingsMain.SiteUrl;

            prefUrl = prefUrl.Contains("http://") ? prefUrl : "http://" + prefUrl;

            var siteMapData = new SiteMapData
            {
                Changefreq = DefaultChangeFreq,
                Priority   = DefaultPriority
            };

            if (reader.FieldCount == 1)
            {
                siteMapData.Loc     = prefUrl + UrlService.GetLink(ParamType.Category, SQLDataHelper.GetString(reader, "UrlPath"), SQLDataHelper.GetInt(reader, "CategoryId"));
                siteMapData.Lastmod = DateTime.Now;
            }
            else if (reader.GetName(0).ToLower() == "productid")
            {
                siteMapData.Loc     = prefUrl + UrlService.GetLink(ParamType.Product, SQLDataHelper.GetString(reader, "UrlPath"), SQLDataHelper.GetInt(reader, "Productid"));
                siteMapData.Lastmod = SQLDataHelper.GetDateTime(reader, "DateModified");
            }
            else if (reader.GetName(0).ToLower() == "newsid")
            {
                siteMapData.Loc     = prefUrl + UrlService.GetLink(ParamType.News, SQLDataHelper.GetString(reader, "UrlPath"), SQLDataHelper.GetInt(reader, "NewsID"));
                siteMapData.Lastmod = SQLDataHelper.GetDateTime(reader, "AddingDate");
            }
            else if (reader.GetName(0).ToLower() == "staticpageid")
            {
                siteMapData.Loc     = prefUrl + UrlService.GetLink(ParamType.StaticPage, SQLDataHelper.GetString(reader, "UrlPath"), SQLDataHelper.GetInt(reader, "StaticPageID"));
                siteMapData.Lastmod = SQLDataHelper.GetDateTime(reader, "ModifyDate");
            }
            return(siteMapData);
        }
Ejemplo n.º 14
0
        public static ReviewEntity GetReviewEntity(int reviewId)
        {
            var type = (EntityType)SQLDataAccess.ExecuteScalar <int>("Select Type From CMS.Review Where ReviewId=@ReviewId", CommandType.Text,
                                                                     new SqlParameter()
            {
                ParameterName = "@ReviewId", Value = reviewId
            });

            switch (type)
            {
            case EntityType.Product:
                return(SQLDataAccess.ExecuteReadOne("Select Product.ProductID, Name, Photo.Description, PhotoName From Catalog.Product left join catalog.Photo on Product.ProductID = Photo.ObjId and Type=@type and main = 1 Where Product.ProductID = (Select EntityID From CMS.Review Where ReviewId=@ReviewId )",
                                                    CommandType.Text,
                                                    reader => new ReviewEntity()
                {
                    Type = EntityType.Product,
                    Name = SQLDataHelper.GetString(reader, "Name"),
                    ReviewEntityId = SQLDataHelper.GetInt(reader, "ProductID"),
                    Photo = SQLDataHelper.GetString(reader, "PhotoName"),
                    PhotoDescription = SQLDataHelper.GetString(reader, "Description")
                },
                                                    new SqlParameter()
                {
                    ParameterName = "@ReviewId", Value = reviewId
                },
                                                    new SqlParameter("@type", PhotoType.Product.ToString())));

            default:
                throw new NotImplementedException();
            }
        }
Ejemplo n.º 15
0
        /// <summary>
        /// Get list of products by categoryId
        /// </summary>
        /// <param name="categoryId"></param>
        /// <param name="inDepth">param set use recurse or not</param>
        /// <returns></returns>
        public static IList <Product> GetProductsByCategoryId(int categoryId, bool inDepth)
        {
            var query = inDepth
                ? "SELECT * FROM [Catalog].[Product] INNER JOIN [Catalog].[ProductCategories] on ProductCategories.ProductID = Product.ProductID WHERE [ProductCategories].CategoryID  IN (SELECT id FROM [Settings].[GetChildCategoryByParent](@categoryId)) AND [Product].[Enabled] = 1  AND [Product].[CategoryEnabled] = 1"
                : "SELECT * FROM [Catalog].[Product] INNER JOIN [Catalog].[ProductCategories] on ProductCategories.ProductID = Product.ProductID WHERE [ProductCategories].CategoryID = @categoryId AND [Product].[Enabled] = 1 AND [Product].[CategoryEnabled] = 1";

            var prouducts = SQLDataAccess.ExecuteReadList(query, CommandType.Text,
                                                          reader => new Product
            {
                ProductId        = SQLDataHelper.GetInt(reader, "ProductId"),
                Name             = SQLDataHelper.GetString(reader, "Name"),
                BriefDescription = SQLDataHelper.GetString(reader, "BriefDescription", null),
                Description      = SQLDataHelper.GetString(reader, "Description", null),
                Discount         = SQLDataHelper.GetFloat(reader, "Discount"),
                //ShippingPrice = SQLDataHelper.GetFloat(reader, "ShippingPrice"),
                Size       = SQLDataHelper.GetString(reader, "Size"),
                Weight     = SQLDataHelper.GetFloat(reader, "Weight"),
                Ratio      = SQLDataHelper.GetDouble(reader, "Ratio"),
                Enabled    = SQLDataHelper.GetBoolean(reader, "Enabled", true),
                Recomended = SQLDataHelper.GetBoolean(reader, "Recomended"),
                New        = SQLDataHelper.GetBoolean(reader, "New"),
                BestSeller = SQLDataHelper.GetBoolean(reader, "Bestseller"),
                OnSale     = SQLDataHelper.GetBoolean(reader, "OnSale")
            },
                                                          new SqlParameter("@categoryId", categoryId));

            return(prouducts ?? new List <Product>());
        }
Ejemplo n.º 16
0
 public static Product GetProductFromReader(SqlDataReader reader)
 {
     return(new Product
     {
         ProductId = SQLDataHelper.GetInt(reader, "ProductId"),
         ArtNo = SQLDataHelper.GetString(reader, "ArtNo"),
         Name = SQLDataHelper.GetString(reader, "Name"),
         BriefDescription = SQLDataHelper.GetString(reader, "BriefDescription", string.Empty),
         Description = SQLDataHelper.GetString(reader, "Description", string.Empty),
         Photo = SQLDataHelper.GetString(reader, "Photo"),
         Discount = SQLDataHelper.GetDecimal(reader, "Discount"),
         Size = SQLDataHelper.GetString(reader, "Size"),
         Weight = SQLDataHelper.GetDecimal(reader, "Weight"),
         Ratio = SQLDataHelper.GetDouble(reader, "Ratio"),
         Enabled = SQLDataHelper.GetBoolean(reader, "Enabled", true),
         OrderByRequest = SQLDataHelper.GetBoolean(reader, "OrderByRequest"),
         Recomended = SQLDataHelper.GetBoolean(reader, "Recomended"),
         New = SQLDataHelper.GetBoolean(reader, "New"),
         BestSeller = SQLDataHelper.GetBoolean(reader, "Bestseller"),
         OnSale = SQLDataHelper.GetBoolean(reader, "OnSale"),
         BrandId = SQLDataHelper.GetInt(reader, "BrandID", 0),
         UrlPath = SQLDataHelper.GetString(reader, "UrlPath"),
         HirecalEnabled = SQLDataHelper.GetBoolean(reader, "HirecalEnabled"),
         //Added by Evgeni to add EAN and SubbrandiD
         EAN = SQLDataHelper.GetString(reader, "EAN"),
         SubBrandId = SQLDataHelper.GetInt(reader, "SubBrandID", 0),
         ManufactureArtNo = SQLDataHelper.GetString(reader, "ManufactureArtNo")
                            //
     });
 }
Ejemplo n.º 17
0
 /// <summary>
 /// return child categories by parent categoryId
 /// </summary>
 /// <param name="categoryId"></param>
 /// <returns></returns>
 public static IList <Category> GetChildCategoriesByCategoryIdForMenu(int categoryId)
 {
     return(SQLDataAccess.ExecuteReadList(
                "[Catalog].[sp_GetChildCategoriesByParentIDForMenu]",
                CommandType.StoredProcedure,
                reader =>
     {
         var category = new Category
         {
             CategoryId = SQLDataHelper.GetInt(reader, "CategoryId"),
             Name = SQLDataHelper.GetString(reader, "Name"),
             //Picture = SQLDataHelper.GetString(reader, "Picture"),
             SortOrder = SQLDataHelper.GetInt(reader, "SortOrder"),
             ParentCategoryId = SQLDataHelper.GetInt(reader, "ParentCategory"),
             ProductsCount = SQLDataHelper.GetInt(reader, "Products_Count"),
             BriefDescription = SQLDataHelper.GetString(reader, "BriefDescription"),
             Description = SQLDataHelper.GetString(reader, "Description"),
             Enabled = SQLDataHelper.GetBoolean(reader, "Enabled"),
             DisplayStyle = SQLDataHelper.GetString(reader, "DisplayStyle"),
             UrlPath = SQLDataHelper.GetString(reader, "UrlPath"),
             DisplayBrandsInMenu = SQLDataHelper.GetBoolean(reader, "DisplayBrandsInMenu"),
             DisplaySubCategoriesInMenu = SQLDataHelper.GetBoolean(reader, "DisplaySubCategoriesInMenu"),
         };
         var childCounts = SQLDataHelper.GetInt(reader, "ChildCategories_Count");
         category.HasChild = childCounts > 0;
         return category;
     },
                new SqlParameter("@CurrentCategoryID", categoryId)));
 }
Ejemplo n.º 18
0
        // render navigation on admin side
        public void BuildNavigationAdmin(int categoryID) // Modify for Admin
        {
            pnlNavi.Controls.Clear();
            var hlM = new HyperLink
            {
                NavigateUrl = UrlService.GetAdminAbsoluteLink("catalog.aspx?CategoryID=0"),
                CssClass    = "Link",
                Text        = Resource.Client_MasterPage_Catalog
            };

            pnlNavi.Controls.Add(hlM);
            var categoryList = CategoryService.GetParentCategories(categoryID);

            for (var i = categoryList.Count - 1; i >= 0; i--)
            {
                var lblSeparator = new Label {
                    CssClass = "Link", Text = @" > "
                };

                pnlNavi.Controls.Add(lblSeparator);

                var hl = new HyperLink
                {
                    NavigateUrl = UrlService.GetAdminAbsoluteLink("catalog.aspx?CategoryID=" + categoryList[i].CategoryId),
                    CssClass    = "Link",
                    Text        = SQLDataHelper.GetString(categoryList[i].Name)
                };
                pnlNavi.Controls.Add(hl);
            }
        }
Ejemplo n.º 19
0
 public static List <string> GetRegionsByName(string name)
 {
     return
         (SQLDataAccess.ExecuteReadList <string>(
              "Select RegionName From [Customers].[Region] WHERE RegionName like @name + '%'",
              CommandType.Text, reader => SQLDataHelper.GetString(reader, "RegionName"),
              new SqlParameter("@name", name)));
 }
Ejemplo n.º 20
0
 public static List <string> GetCountriesByName(string name)
 {
     return
         (SQLDataAccess.ExecuteReadList(
              "Select CountryName From Customers.Country Where CountryName like @name + '%'",
              CommandType.Text,
              reader => SQLDataHelper.GetString(reader, "CountryName"), new SqlParameter("@name", name)));
 }
Ejemplo n.º 21
0
 private static RoleAction GetCustomerRoleActionFromReader(SqlDataReader reader)
 {
     return(new RoleAction
     {
         Key = (RoleActionKey)Enum.Parse(typeof(RoleActionKey), SQLDataHelper.GetString(reader, "RoleActionKey")),
         Enabled = SQLDataHelper.GetBoolean(reader, "Enabled")
     });
 }
Ejemplo n.º 22
0
 private static PropertyGroup GetPropertyGroupFromReader(SqlDataReader reader)
 {
     return(new PropertyGroup
     {
         PropertyGroupId = SQLDataHelper.GetInt(reader, "PropertyGroupId"),
         Name = SQLDataHelper.GetString(reader, "GroupName"),
         SortOrder = SQLDataHelper.GetInt(reader, "GroupSortOrder")
     });
 }
Ejemplo n.º 23
0
 private static CustomerGroup GetCustomerGroupFromReader(SqlDataReader reader)
 {
     return(new CustomerGroup
     {
         CustomerGroupId = SQLDataHelper.GetInt(reader, "CustomerGroupId"),
         GroupName = SQLDataHelper.GetString(reader, "GroupName"),
         GroupDiscount = SQLDataHelper.GetFloat(reader, "GroupDiscount")
     });
 }
Ejemplo n.º 24
0
 private static Size GetFromReader(SqlDataReader reader)
 {
     return(new Size()
     {
         SizeId = SQLDataHelper.GetInt(reader, "sizeID"),
         SizeName = SQLDataHelper.GetString(reader, "SizeName"),
         SortOrder = SQLDataHelper.GetInt(reader, "SortOrder")
     });
 }
Ejemplo n.º 25
0
 public static List<Brand> GetBrandsNames()
 {
     return SQLDataAccess.ExecuteReadList<Brand>("Select BrandName, BrandID from Catalog.Brand order by SortOrder", CommandType.Text,
          (reader) => new Brand
                         {
                             Name = SQLDataHelper.GetString(reader, "BrandName"),
                             BrandId = SQLDataHelper.GetInt(reader, "BrandID")
                         });
 }
Ejemplo n.º 26
0
 public static List <ListItem> GetRegions(string countryId)
 {
     return(SQLDataAccess.ExecuteReadList(
                "SELECT [RegionName], [RegionID] FROM [Customers].[Region] WHERE CountryID = @Id ORDER BY [RegionSort]",
                CommandType.Text,
                reader => new ListItem(SQLDataHelper.GetString(reader, "RegionName"),
                                       SQLDataHelper.GetInt(reader, "RegionID").ToString()),
                new SqlParameter("@Id", countryId)));
 }
Ejemplo n.º 27
0
 private static Color GetFromReader(SqlDataReader reader)
 {
     return(new Color()
     {
         ColorId = SQLDataHelper.GetInt(reader, "ColorId"),
         ColorCode = SQLDataHelper.GetString(reader, "ColorCode"),
         ColorName = SQLDataHelper.GetString(reader, "ColorName"),
         SortOrder = SQLDataHelper.GetInt(reader, "SortOrder")
     });
 }
Ejemplo n.º 28
0
 /// <summary>
 /// clear all categories in cache
 /// </summary>
 public static void ClearCategoryCache()
 {
     foreach (DictionaryEntry e in CacheManager.CacheObject)
     {
         if (SQLDataHelper.GetString(e.Key).StartsWith(CacheNames.GetCategoryCacheObjectPrefix()))
         {
             CacheManager.Remove(SQLDataHelper.GetString(e.Key));
         }
     }
 }
Ejemplo n.º 29
0
 private static RedirectSeo GetRedirectSeoFromReader(SqlDataReader reader)
 {
     return(new RedirectSeo
     {
         ID = SQLDataHelper.GetInt(reader, "ID"),
         RedirectFrom = SQLDataHelper.GetString(reader, "RedirectFrom"),
         RedirectTo = SQLDataHelper.GetString(reader, "RedirectTo"),
         ProductArtNo = SQLDataHelper.GetString(reader, "ProductArtNo")
     });
 }
Ejemplo n.º 30
0
 private static Carousel GetCarouselFromReader(IDataReader reader)
 {
     return(new Carousel
     {
         CarouselID = SQLDataHelper.GetInt(reader, "CarouselID"),
         URL = SQLDataHelper.GetString(reader, "URL"),
         SortOrder = SQLDataHelper.GetInt(reader, "SortOrder"),
         Enabled = SQLDataHelper.GetBoolean(reader, "Enabled")
     });
 }