public static MST_ARTICLE ToEntity(VIEW_MST_ARTICLE model) { MST_ARTICLE item = new MST_ARTICLE(); item.ARTICLE_ID = model.ARTICLE_ID; item.CODE = model.CODE; item.SUBTITLE = model.SUBTITLE; item.WRITER = model.WRITER; item.RESOURCE = model.RESOURCE; item.TAG = model.TAG; item.KEYWORDS = model.KEYWORDS; item.ARTICLE_IMAGE = model.ARTICLE_IMAGE; item.TEMPLATE = model.TEMPLATE; item.DESC = model.DESC; item.ACTIVE = model.ACTIVE; item.ARTICLE_URL = model.ARTICLE_URL; item.SEQ_NO = model.SEQ_NO; item.SCRIPT = model.SCRIPT; item.ICON = model.ICON; 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.CATALOG_CD = model.CATALOG_CD; return(item); }
public static IEnumerable <VIEW_MST_ARTICLE> ToListViewModel(IEnumerable <MST_ARTICLE> list) { var listModel = new List <VIEW_MST_ARTICLE>(); foreach (MST_ARTICLE item in list) { listModel.Add(VIEW_MST_ARTICLE.ToViewModel(item)); } return(listModel); }
public ActionResult Detail(int id) { ViewBag.CATALOG_CDS = DataSelect.ToListViewModel(VIEW_MST_CATALOG.ToListViewModel(CatalogManager.GetListBy(m => m.SYNCOPERATION != "D"))); //执行状态 var article = new MODEL.ViewModel.VIEW_MST_ARTICLE(); var model = ArticleManager.Get(a => a.ARTICLE_ID == id); if (model != null) {//转化为视图UI层的实体对象 ViewBag.ParentID = model.ARTICLE_ID; article = VIEW_MST_ARTICLE.ToViewModel(model); ViewBag.Images = JsonHelper.ToJson(VIEW_MST_ATTACHMENTS.ToListViewModel(AttachmentsManager.GetListBy(at => at.ITEM_ID == id && at.ISIMAGE == "Y")), true); } return(View(article)); }