public ActionResult Index(DrugBrandViewModel model)
        {
            ModelState.Clear();
            model.Name = model.SeachByBrandName;
            //if (!model.IsSearch)
            //{
            //    model.IsSearch = true;
            //    return View(model);
            //}

            var totalrecords = 0;



            model.DrugGenerics = DrugGenericManager.GettAllGenericDrug();

            model.DrugBrands   = DrugBrandManager.GetAllDrugBrand(out totalrecords, model);
            model.TotalRecords = totalrecords;

            return(View(model));
        }
        //private readonly int _pageSize = AppConfig.PageSize;

        public ActionResult Index(DrugBrandViewModel model)
        {
            ModelState.Clear();


            //var startPage = 0;

            //if (model.Page.HasValue && model.Page.Value > 0)
            //{
            //    startPage = model.Page.Value - 1;
            //}

            var totalrecords = 0;

            model.Name = model.SeachByBrandName;

            //model.DrugGenerics = DrugGenericManager.GettAllGenericDrug();

            //var   drugGenericsList = DrugGenericManager.GettAllGenericDrug();

            //var drugGenericsList = DrugGenericManager.GetAllGenericDrug((startPage, _pageSize, out totalrecords , model);

            //model.DrugGenerics = drugGenericsList.Where(x=>x.GenericId==model.GenericId|| model.GenericId==0).ToList();

            //ViewBag.SearchByGenericDSrug=new SelectList(drugGenericsList,"GenericId","Name");
            //var genericId = model.SearchByGenericDSrug;
            //var genericId = model.SearchByGenericDSrug;

            // var drugBrandlist = DrugBrandManager.GetAllDrugBrandByGeneric(genericId);

            // ViewBag.SearchByDrugBrand=new SelectList(drugBrandlist,"BrandId","Name",model.SearchByDrugBrand);
            model.DrugGenerics = DrugGenericManager.GettAllGenericDrug();

            //model.DrugBrands = DrugBrandManager.GetAllDrugBrand(startPage, _pageSize, out totalrecords, model);
            model.DrugBrands   = DrugBrandManager.GetAllDrugBrand(out totalrecords, model);
            model.TotalRecords = totalrecords;

            return(View(model));
        }