Esempio n. 1
0
        public FilterParameters2 CopyByAttr(long attrId, string attrVal)
        {
            FilterParameters2 fp = new FilterParameters2(this);

            string newAttr = "";

            if (!string.IsNullOrEmpty(fp.Attribute))
            {
                if (fp.Attribute.IndexOf('@') != -1)
                {
                    string[] Attributes = fp.Attribute.Split('@');
                    foreach (string Attr_Item in Attributes)
                    {
                        if (!string.IsNullOrEmpty(Attr_Item))
                        {
                            if (Attr_Item.IndexOf('_') != -1)
                            {
                                string[] Attr_Value = Attr_Item.Split('_');
                                if (!string.IsNullOrEmpty(Attr_Value[0]) && !string.IsNullOrEmpty(Attr_Value[1]))
                                {
                                    if (long.Parse(Attr_Value[0]) != attrId)
                                    {
                                        newAttr += $"@{ Attr_Value[0]}_{ Attr_Value[1]}";
                                    }
                                }
                            }
                        }
                    }
                }
            }
            newAttr     += $"@{attrId}_{attrVal}";
            fp.Attribute = newAttr;
            return(fp);
        }
Esempio n. 2
0
        public FilterParameters2 CopyByPrice(string price1, string price2)
        {
            FilterParameters2 fp = new FilterParameters2(this);

            fp.Price = $"{price1}-{price2}";
            return(fp);
        }
Esempio n. 3
0
        public FilterParameters2 CopyByOrderBy(int orderBy)
        {
            FilterParameters2 fp = new FilterParameters2(this);

            fp.OrderBy = orderBy;
            return(fp);
        }
Esempio n. 4
0
        public FilterParameters2 CopyByStore(int storeid)
        {
            FilterParameters2 fp = new FilterParameters2(this);

            fp.StoreId = storeid;
            return(fp);
        }
Esempio n. 5
0
        public FilterParameters2 CopyByBrand(int brand)
        {
            FilterParameters2 fp = new FilterParameters2(this);

            fp.Brand = brand;
            return(fp);
        }
Esempio n. 6
0
        public FilterParameters2 CopyByPage(long page)
        {
            FilterParameters2 fp = new FilterParameters2(this);

            fp.Page = page;
            return(fp);
        }
Esempio n. 7
0
 private FilterParameters2(FilterParameters2 value)
 {
     _page            = 1;
     _size            = value._size;
     _brand           = value._brand;
     _orderBy         = value._orderBy;
     _keyword         = value._keyword;
     _attribute       = value._attribute;
     _suppliertype    = value._suppliertype;
     _storeid         = value._storeid;
     _storecategoryid = value._storecategoryid;
     _price           = value._price;
     _province        = value._province;
     _city            = value._city;
     _county          = value._county;
     _parameters      = new SortedDictionary <long, object>(value._parameters);
 }