private LinCControl GetProductName(string parentId, string[] itemArray) { List <LinCComonModel> productNameList = new List <LinCComonModel>(); if (itemArray.Length > 0) { int cnt = 0; foreach (var prdName in itemArray) { LinCComonModel item = new LinCComonModel() { Name = prdName, Value = prdName, ItemId = (++cnt).ToString() }; productNameList.Add(item); } } var productName = new LinCControl() { ControlValues = productNameList, SelectedIndex = 0, Title = "Product Name", DefaultItem = productNameList?[0], ParentId = parentId }; productName.SelectedIndex = 0; return(productName); }
private (LinCControl, List <LinCControl>) GetProductTypes() { var productTypes = new LinCControl(); var productNames = new List <LinCControl>(); List <LinCComonModel> productList = new List <LinCComonModel>(); LinCComonModel prdItem = new LinCComonModel() { Name = "Grocery", Value = "Grocery", ItemId = "1" }; productList.Add(prdItem); string[] prdNameArray = new string[] { "Rice", "Dal", "Soyabin" }; productNames.Add(GetProductName(prdItem.ItemId, prdNameArray)); prdItem = new LinCComonModel() { Name = "Medical", Value = "Medical", ItemId = "2" }; productList.Add(prdItem); prdNameArray = new string[] { "Sanitizer", "Syringe", "Gauze" }; productNames.Add(GetProductName(prdItem.ItemId, prdNameArray)); prdItem = new LinCComonModel() { Name = "Cloth", Value = "Cloth", ItemId = "3" }; productList.Add(prdItem); prdNameArray = new string[] { "Coat", "Trouser", "Skirt" }; productNames.Add(GetProductName(prdItem.ItemId, prdNameArray)); productTypes.ControlValues = productList; productTypes.SelectedIndex = 0; productTypes.Title = "Product Type"; productTypes.DefaultItem = productList?[0]; productTypes.SelectedIndex = 0; return(productTypes, productNames); }