Пример #1
0
        public static VIEW_MST_CATEGORY ToViewModel(MST_CATEGORY model)
        {
            VIEW_MST_CATEGORY item = new VIEW_MST_CATEGORY();

            item.CATE_CD       = model.CATE_CD;
            item.CATEGORY_NAME = model.CATEGORY_NAME;
            item.PARENT_CD     = model.PARENT_CD;
            item.ISSHOW        = model.ISSHOW;
            item.CATE_MAPS     = model.CATE_MAPS;
            item.CATE_URL      = model.CATE_URL;
            item.ACTIVE        = model.ACTIVE;
            item.ISLEAVES      = model.ISLEAVES;
            item.VERSION       = model.VERSION;
            item.SYNCOPERATION = model.SYNCOPERATION;
            item.SYNCVERSION   = model.SYNCVERSION;
            item.SYNCFLAG      = model.SYNCFLAG;
            item.CREATE_DT     = model.CREATE_DT;
            item.CREATE_BY     = model.CREATE_BY;
            item.MODIFY_DT     = model.MODIFY_DT;
            item.MODIFY_BY     = model.MODIFY_BY;
            item.ISHOT         = model.ISHOT;
            item.CATE_TYPE     = model.CATE_TYPE;
            item.FLAT1         = model.FLAT1;
            item.FLAT2         = model.FLAT2;
            item.REMARK1       = model.REMARK1;
            item.REMARK2       = model.REMARK2;
            item.REMARK3       = model.REMARK3;
            item.REMARK4       = model.REMARK4;
            return(item);
        }
Пример #2
0
        public static DataSelect ToViewModel(VIEW_MST_CATEGORY category)
        {
            DataSelect item = new DataSelect();

            item.id    = category.CATE_CD;
            item.value = category.CATE_CD;
            item.text  = category.CATEGORY_NAME;
            return(item);
        }
Пример #3
0
        public static IEnumerable <VIEW_MST_CATEGORY> ToListViewModel(IEnumerable <MST_CATEGORY> list)
        {
            var listModel = new List <VIEW_MST_CATEGORY>();

            foreach (MST_CATEGORY item in list)
            {
                listModel.Add(VIEW_MST_CATEGORY.ToViewModel(item));
            }
            return(listModel);
        }
Пример #4
0
        public static DataTree ToEntity(VIEW_MST_CATEGORY Category)
        {
            DataTree item = new DataTree();

            item.id   = Category.CATE_CD;
            item.text = Category.CATEGORY_NAME;
            item.desc = Category.CATEGORY_NAME;
            if (Category.children != null)
            {
                item.children = ToListViewModel(Category.children);
            }
            return(item);
        }
Пример #5
0
        public static SelectListItem ToEntity(VIEW_MST_CATEGORY category, string style)
        {
            //   '<div><span  class="' + state .style+ '"></span> ' + state.text + 'c'
            SelectListItem item = new SelectListItem();

            item.Value = category.CATE_CD;
            if (string.IsNullOrEmpty(style))
            {
                item.Text = category.CATEGORY_NAME;
            }
            else
            {
                item.Text = "<div><span  class='" + style + "'></span>" + category.CATEGORY_NAME + "</div>";
            }
            return(item);
        }