public ActionResult Index() { ViewBag.msgSuccess = TempData["msgSuccess"]; ViewBag.msgError = TempData["msgError"]; List <SBH_TM_SOSMED> sosmedRes = new List <SBH_TM_SOSMED>(); sosmedRes = repo.GridBind(); return(View(sosmedRes)); }
public IHttpActionResult GridBind() { ApiResData res = new ApiResData(); try { List <TOURIS_TM_SOSMED> sosmed = repo.GridBind(); List <TOURIS_TV_SOSMED> sosmedViews = new List <TOURIS_TV_SOSMED>(); if (sosmed.Count > 0) { foreach (var item in sosmed) { TOURIS_TV_SOSMED sosmedView = new TOURIS_TV_SOSMED(); sosmedView.ID = item.ID; sosmedView.TYPE = item.TYPE; sosmedView.NAME = item.NAME; sosmedView.DESCRIPTION = item.DESCRIPTION; sosmedView.ICON = item.ICON; sosmedView.URL = item.URL; sosmedView.DATA_EMBED = item.DATA_EMBED; sosmedView.HEIGHT = item.HEIGHT; sosmedView.WIDTH = item.WIDTH; sosmedView.DATA_WIDGET_ID = item.DATA_WIDGET_ID; sosmedView.CREATED_BY = item.CREATED_BY; sosmedView.CREATED_TIME = item.CREATED_TIME; sosmedView.LAST_MODIFIED_BY = item.LAST_MODIFIED_BY; sosmedView.LAST_MODIFIED_TIME = item.LAST_MODIFIED_TIME; sosmedViews.Add(sosmedView); } rs.SetSuccessStatus(); } resObj = JObject.FromObject(res.ResGetDataTable(new object[] { sosmedViews }, null)); return(Content(HttpStatusCode.OK, resObj)); } catch (Exception ex) { rs.SetErrorStatus(ex.Message); resObj = JObject.FromObject(res.ResGetDataTable(new object[] { rs }, new Exception(eFunc.fg.DataNf))); return(Content(HttpStatusCode.BadRequest, resObj)); } }