public void GetStockType() { try { var listParam = new List <KeyValuePair <string, string> >(); listParam.Add(new KeyValuePair <string, string>("stockTypeId", "0")); string errorMessage = string.Empty; var response = new CallService().GetResponse <List <StockTypeRes> >("getMasterStockTypes", listParam, ref errorMessage); response.Add(new StockTypeRes { stockTypeId = "0", stockType = "All Stocks" }); if (string.IsNullOrEmpty(errorMessage)) { ViewBag.StockType = response.OrderBy(m => m.stockTypeId).ToList(); } else { ViewBag.StockType = response; } } catch (Exception) { } }