public Response GetMarkers(GetMarkersRequest request) { try { var docDs = _dal.GetMarkers(request.DocId); GetMarkersResponseOK retval = new GetMarkersResponseOK(); if (docDs.Tables.Count > 0) { var tbl = docDs.Tables[0]; foreach (DataRow row in tbl.Rows) { Marker marker = new Marker(); marker.MarkerId = (string)row[0]; marker.DocId = (string)row[1]; marker.UserID = (string)row[2]; marker.MarkerType = (string)row[3]; marker.CenterX = (decimal)row[4]; marker.CenterY = (decimal)row[5]; marker.RadiusX = (decimal)row[6]; marker.RadiusY = (decimal)row[7]; marker.ForeColor = (string)row[8]; marker.BackColor = (string)row[9]; retval.Markers.Add(marker); } } return(retval); } catch (Exception ex) { return(new ResponseError(ex.Message)); } }
public Response GetMarkers(DocumentRequest documentRequest) { try { var data = _dalMarker.GetMarkers(documentRequest); ResponseListMarkers responseListMarkers = new ResponseListMarkers(); if (data.Tables[0].Rows.Count >= 1) { responseListMarkers.lst = new List <Marker>(); foreach (DataRow row in data.Tables[0].Rows) { responseListMarkers.lst.Add(new Marker() { cx = (double)row[3], cy = (double)row[4], docID = (int)row[0], MarkerID = (int)row[1], rx = (double)row[5], ry = (double)row[6], Fore = (string)row[7], MarkerType = (string)row[2], text = (string)row[10], userID = (string)row[8] }); } return(responseListMarkers); } return(responseListMarkers); } catch { return(new ResponseErr()); } }