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);
        }
Пример #2
0
        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);
        }
Пример #4
0
        public MarkerRsponse AddMarker(MarkerRequestAdd request)
        {
            MarkerRsponse response = default;

            //------------
            try
            {
                var con        = _SQLdal.Connect("Server=LAPTOP-B6F4SVRM;Database=DocumentProject;" + "Trusted_Connection=True;");
                var parameters = _paramConverter.ConvertToParameters(request.MarkerDTO);
                var dataset    = _SQLdal.ExecSPQuery("CreateMarker", con, parameters);
                if (dataset.Tables[0].Rows.Count != 0)
                {
                    var markers = new List <MarkerDTO>();
                    markers.Add(new MarkerDTO()
                    {
                        BackColor  = request.MarkerDTO.BackColor,
                        CenterX    = request.MarkerDTO.CenterX,
                        CenterY    = request.MarkerDTO.CenterY,
                        DocID      = request.MarkerDTO.DocID,
                        ForeColor  = request.MarkerDTO.ForeColor,
                        MarkerID   = dataset.Tables[0].Rows[0].Field <Guid>("MarkerID"),
                        MarkerType = request.MarkerDTO.MarkerType,
                        RadiusX    = request.MarkerDTO.RadiusX,
                        RadiusY    = request.MarkerDTO.RadiusY,
                        userId     = request.MarkerDTO.userId
                    });
                    response = new MarkersResponseAddOK()
                    {
                        Markers = markers
                    };
                }
            }
            catch (Exception e)
            {
                response = new MarkerRsponseDontAdd();
                throw;
            }
            return(response);
        }
Пример #5
0
        public MarkerRsponse AddMarker(MarkerRequestAdd request)
        {
            MarkerRsponse response = default;

            //------------
            try
            {
                var con        = _SQLdal.Connect("Server=LAPTOP-B6F4SVRM;Database=DocumentProject;" + "Trusted_Connection=True;");
                var parameters = _paramConverter.ConvertToParameters(request.MarkerDTO);
                var dataset    = _SQLdal.ExecSPQuery("CreateMarker", con, parameters);
                if (dataset != null)
                {
                    response = new MarkersResponseAddOK();
                }
            }
            catch (Exception e)
            {
                response = new MarkerRsponseDontAdd();
                throw;
            }
            return(response);
        }
 public MarkerRsponse AddMarker(MarkerRequestAdd request)
 {
     return(_service.AddMarker(request));
 }
 public MarkerRsponse AddMarker([FromBody] MarkerRequestAdd request) => _service.AddMarker(request);