Пример #1
0
        public static MvcHtmlString ProductNameCbo(this HtmlHelper helper, string id, string firstElement, object attribute = null)
        {
            List <tbm_Product> list           = new List <tbm_Product>();
            string             strDisplayName = "ProductNameEN";

            try
            {
                IMasterHandler handler = ServiceContainer.GetService <IMasterHandler>() as IMasterHandler;
                list = handler.GetTbm_Product(null, null);
                foreach (var items in list)
                {
                    items.ProductNameEN = items.ProductCode + " - " + items.ProductNameEN;
                    items.ProductNameJP = items.ProductCode + " - " + items.ProductNameJP;
                    items.ProductNameLC = items.ProductCode + " - " + items.ProductNameLC;
                }

                if (CommonUtil.GetCurrentLanguage() == CommonValue.DEFAULT_LANGUAGE_EN)
                {
                    strDisplayName = "ProductNameEN";
                }
                else if (CommonUtil.GetCurrentLanguage() == CommonValue.DEFAULT_LANGUAGE_JP)
                {
                    strDisplayName = "ProductNameJP";
                }
                else
                {
                    strDisplayName = "ProductNameLC";
                }
            }
            catch
            {
                list = new List <tbm_Product>();
            }

            return(CommonUtil.CommonComboBoxWithCustomFirstElement <tbm_Product>(id, list, strDisplayName, "ProductCode", firstElement, attribute));
        }