コード例 #1
0
        public static MultiDropDownItem ConvertToMultiDropDownItem(this MasterDataViewModel model)
        {
            var item = new MultiDropDownItem()
            {
                Value = model.MasterId.ToString(),
                Text  = model.GetLocalizedName()
            };

            return(item);
        }
コード例 #2
0
        public static SelectListItem ConvertToSelectListItems(this MasterDataViewModel item, string language = null, bool code = false)
        {
            if (language == null)
            {
                language = Localization.CurrentLanguage;
            }

            var result = new SelectListItem()
            {
                Value = item.MasterId.ToString(),
                Text  = code ? item.Code : item.GetLocalizedName(language)
            };

            return(result);
        }