public MarkerRsponse AddMarker(MarkerRequestAdd request) { MarkerRsponse response = default; List <DocumentSharingDTO> shared = default; List <string> mylist = new List <string>(); try { response = _dal.AddMarker(request); shared = _documentSharingService.GetShareForDoc(new DocumentSharingRequestGetForDoc() { DocID = request.MarkerDTO.DocID }).DocumentSharingDTO; if (shared != null) { //create list type string for send to all shared.ForEach(s => mylist.Add(s.UserId)); //add the usrid of the usr whose document he owns mylist.Remove(request.MarkerDTO.userId); _messanger.SendMarkerToAll(mylist, response); } } catch (Exception e) { //log e response = new MarkerRsponseDontAdd(); } return(response); }
public MarkerRsponse AddMarker(MarkerRequestAdd request) { MarkerRsponse response = default; try { //if available response = _dal.AddMarker(request); } catch (Exception e) { //log response = new MarkerRsponseDontAdd(); throw; } return(response); }
public void AddMarker() { var req = new MarkerRequestAdd(); req.MarkerDTO = new MarkerDTO(); req.MarkerDTO.DocID = new Guid("58EE74C3-0DFA-4BA9-A8F6-FAC6943DAF61") { }; req.MarkerDTO.userId = "*****@*****.**"; req.MarkerDTO.Fore_backColor = "green"; req.MarkerDTO.MarkerLocation1X = 1; req.MarkerDTO.MarkerLocation1Y = 2; req.MarkerDTO.MarkerLocation2X = 3; req.MarkerDTO.MarkerLocation2Y = 4; req.MarkerDTO.MarkerType = "ellipse"; var res = _MarkerDal.AddMarker(req); Assert.IsInstanceOf(typeof(MarkersResponseAddOK), res); }