public ActionResult List(bool? showInactive, Guid? brandId, int page = 1, int itemsperpage = 10, string searchText = "")
        {
            try
            {
                var user = (CustomIdentity)this.User.Identity;
                Guid? supplierId = user.SupplierId != null ? user.SupplierId : (Guid?) null;
                
                if (itemsperpage != null)
                {
                    ViewModelBase.ItemsPerPage = itemsperpage;
                }
                bool showinactive = false;
                if (showInactive != null)
                    showinactive = (bool)showInactive;
                ViewBag.showInactive = showinactive;
                if (TempData["msg"] != null)
                {
                    ViewBag.msg = TempData["msg"].ToString();
                    TempData["msg"] = null;
                }
                ViewBag.BrandList = _focViewModelBuilder.BrandList();
                ViewBag.searchParam = searchText;

                int currentPageIndex = page < 0 ? 0 : page - 1;
                int take = itemsperpage;
                int skip = currentPageIndex*take;

                var query = new QueryFOCDiscount()
                    {
                        Name = searchText,
                        Skip = skip,
                        Take = take,
                        SupplierId = supplierId,
                        BrandId = brandId
                    };

                var ls = _focViewModelBuilder.QueryResult(query);
                var data = ls.Data;
                var count = ls.Count;

                return View(data.ToPagedList(currentPageIndex,  ViewModelBase.ItemsPerPage, count));
              
            }
            catch (Exception ex)
            {
               return View();
            }
        }
       public QueryResult<FreeOfChargeDiscountViewModel> QueryResult(QueryFOCDiscount query)
       {
           var result = _freeOfChargeDiscountRepository.QueryResult(query);

           var data = new QueryResult<FreeOfChargeDiscountViewModel>();

           data.Count = result.Count;
           data.Data = result.Data.Select(Map).ToList();

           return data;
       }