public ActionResult Detailxx(int id = 0) { RetrieveRequest request = new RetrieveRequest(); RetrieveResponse <TbGaleryRow> response = new RetrieveResponse <TbGaleryRow>(); TbGaleryRepository repository = new TbGaleryRepository(); using (var connection = SqlConnections.NewByKey("Rukuntangga")) { request.EntityId = id; response = repository.Retrieve(connection, request); } return(View(MVC.Views.Rukuntangga.Galery.Detail, response.Entity)); }
public ListResponse <TbGaleryRow> FunctionGetBerita(int id) { ListRequest request = new ListRequest(); ListResponse <TbGaleryRow> response = new ListResponse <TbGaleryRow>(); TbGaleryRepository repository = new TbGaleryRepository(); var ud = (UserDefinition)Serenity.Authorization.UserDefinition; var kodeRt = ud.Ktp.KodeRt; //ViewBag.IdJenisInformasi = id; using (var connection = SqlConnections.NewByKey("Rukuntangga")) { if (id > 0) { request.Criteria = new Criteria("Id") == id & new Criteria("KodeRt") == kodeRt; } else { request.Criteria = new Criteria("KodeRt") == kodeRt; } response = repository.List(connection, request); } return(response); }