public async Task <Response> GetMarker(GetMarkerRequest request) { Response response = new GetMarkerResponseInvalid(request); try { Marker marker = new Marker(); DataSet ds = _dal.GetMarker(request.MarkerID); var markerData = ds.Tables[0].Rows[0]; marker.DocID = (string)markerData["DOC_ID"]; marker.MarkerID = (string)markerData["MARKER_ID"]; marker.UserID = (string)markerData["USER_ID"]; marker.MarkerType = (string)markerData["MARKER_TYPE"]; marker.StrokeColor = (string)markerData["STROKE_COLOR"]; marker.BackgroundColor = (string)markerData["BACKGROUND_COLOR"]; marker.X = (string)markerData["X"]; marker.Y = (string)markerData["Y"]; marker.XRadius = (string)markerData["XRADIUS"]; marker.YRadius = (string)markerData["YRADIUS"]; response = new GetMarkerResponseOK(marker); } catch (Exception ex) { response = new AppResponseError(ex.Message); } return(response); }
public Response GetMarker(GetMarkerRequest request) { try { var ds = _dal.GetMarker(request.DocID); List <Marker> dl = new List <Marker>(); GetMarkerResponse retval = new GetMarkerResponse(); if (ds.Tables.Count > 0) { var tbl = ds.Tables[0]; if (tbl.Rows.Count > 0) { for (int i = 0; i < tbl.Rows.Count; i++) { if (request.DocID == (string)tbl.Rows[0][0]) { Marker dc = new Marker((string)tbl.Rows[i][0], (string)tbl.Rows[i][1], (string)tbl.Rows[i][2], (Decimal)tbl.Rows[i][3], (Decimal)tbl.Rows[i][4], (Decimal)tbl.Rows[i][5], (Decimal)tbl.Rows[i][6], (string)tbl.Rows[i][7], (string)tbl.Rows[i][8], (string)tbl.Rows[i][9]); dl.Add(dc); } } retval = new GetMarkerResponseOK(dl); } } return(retval); } catch (Exception ex) { return(new AppResponseError(ex.Message)); } }
public Response GetMarker([FromBody] GetMarkerRequest request) { return(_getMarkerService.GetMarker(request)); }
public async Task <Response> GetMarker(GetMarkerRequest request) { return(await _markerService.GetMarker(request)); }