private void GetDefaultData() { curencies = curencies ?? stockReceivingService.GetAllCurencies(); if (currencyList == null) { currencyList = new SelectList(curencies, "Id", "Code"); } ViewData["Currency"] = currencyList; ViewBag.vStatus = VoucherStatus.Pending; ViewBag.Islook = ""; warehouses = warehouses == null || !warehouses.Any() ? warehouseSevices.GetAll() : warehouses; var stocks = warehouses.Select(x => new SelectListItem { Text = x.Name, Value = x.Id.ToString() }).ToList(); stocks.Insert(0, new SelectListItem() { Text = "--All--", Value = "0" }); var userTrading = salesServices.GetAllUserTrading(); var users = userTrading.Select(x => new SelectListItem { Text = x.FullName, Value = x.Id.ToString() }).ToList(); users.Insert(0, new SelectListItem() { Text = "--All--", Value = "0" }); ViewData["UserTrading"] = users; ViewData["Warehouses"] = stocks; ViewBag.SearchingMode = filterModel ?? new TradingStockSearch(); }