예제 #1
0
        public static MST_CATALOG ToEntity(VIEW_MST_CATALOG model)
        {
            MST_CATALOG item = new MST_CATALOG();

            item.CATALOG_CD    = model.CATALOG_CD;
            item.CATALOG_PCD   = model.CATALOG_PCD;
            item.NAME          = model.NAME;
            item.PREVIEW       = model.PREVIEW;
            item.REMARK        = model.REMARK;
            item.SEQ_NO        = model.SEQ_NO;
            item.TEMPLATE      = model.TEMPLATE;
            item.ICON          = model.ICON;
            item.SCRIPT        = model.SCRIPT;
            item.CATALOG_URL   = model.CATALOG_URL;
            item.ISSHOW        = model.ISSHOW;
            item.ACTIVE        = model.ACTIVE;
            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;
            return(item);
        }
예제 #2
0
        /// <summary>
        /// 将实体转为为Select列表
        /// </summary>
        /// <param name="department"></param>
        /// <returns></returns>



        public static DataSelect ToViewModel(VIEW_MST_CATALOG catalog)
        {
            DataSelect item = new DataSelect();

            item.id    = catalog.CATALOG_CD;
            item.value = catalog.CATALOG_CD;
            item.text  = catalog.NAME;
            return(item);
        }
예제 #3
0
        public static IEnumerable <VIEW_MST_CATALOG> ToListViewModel(IEnumerable <MST_CATALOG> list)
        {
            var listModel = new List <VIEW_MST_CATALOG>();

            foreach (MST_CATALOG item in list)
            {
                listModel.Add(VIEW_MST_CATALOG.ToViewModel(item));
            }
            return(listModel);
        }
예제 #4
0
        public static DataTree ToEntity(VIEW_MST_CATALOG Catalog)
        {
            DataTree item = new DataTree();

            item.id   = Catalog.CATALOG_CD;
            item.text = Catalog.NAME;
            item.desc = Catalog.REMARK;
            if (Catalog.children != null)
            {
                item.children = ToListViewModel(Catalog.children);
            }
            return(item);
        }
예제 #5
0
        public static SelectListItem ToEntity(VIEW_MST_CATALOG catalog, string style)
        {
            //   '<div><span  class="' + state .style+ '"></span> ' + state.text + 'c'
            SelectListItem item = new SelectListItem();

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