public DocumentsharingResponse AddSharing(DocumentSharingRequest request)
        {
            DocumentsharingResponse retval = default;

            try
            {
                var con        = _SQLDAL.Connect("Server=LAPTOP-B6F4SVRM;Database=DocumentProject;" + "Trusted_Connection=True;");
                var parameters = _paramConverter.ConvertToParameters(request.sharingDTO);
                var dataset    = _SQLDAL.ExecSPQuery("CreateShare", con, parameters);

                if (dataset.Tables[0].Rows.Count != 0)
                {
                    retval = new DocumentSharingResponseAddOK();
                    retval.DocumentSharingDTO = new List <DocumentSharingDTO>();
                    retval.DocumentSharingDTO.Add(new DocumentSharingDTO()
                    {
                        DocID = request.sharingDTO.DocID, UserId = request.sharingDTO.UserId
                    });
                }
            }
            catch (Exception e)
            {
                retval = new DocumentSharingResponseDontAdd();
                //log
            }
            return(retval);
        }
示例#2
0
        public RegisterUserResponse Login(RegisterUserRequest request)
        {
            RegisterUserResponse retval = default;
            var parameters = _DalParametersConverter.ConvertToParameters(request.UserDTO);
            var dataset    = _SQLDAL.ExecSPQuery("LoginUser", con, parameters);

            if (dataset.Tables[0].Rows.Count != 0)
            {
                retval = new RegisterUserExistsResponse();
            }
            return(retval);
        }
示例#3
0
        public CommentResponse CreateComment(CommentRequest request)
        {
            CommentResponse retval = default;

            try
            {
                var parameters = _paramConverter.ConvertToParameters(request.commentDTO);
                var dataset    = _SQLDAL.ExecSPQuery("CreateComment", con, parameters);
                if (dataset.Tables[0].Rows.Count != 0)
                {
                    retval = new CommentResponseAddOK()
                    {
                        comments = new List <CommentDTO>()
                        {
                            request.commentDTO
                        }
                    };
                    return(retval);
                }
            }
            catch (Exception e)
            {
                retval = new CommentResponseDontAdd();
                //log
            }

            return(retval);
        }
        public DocumentResponse AddDocument(DocumentRequest req)
        {
            DocumentResponse retval = default;

            try
            {
                var parameters = _paramConverter.ConvertToParameters(req.documentDTO);
                var dataset    = _SQLDAL.ExecSPQuery("CreateDocument", con, parameters);

                if (dataset.Tables[0].Rows.Count != 0)
                {
                    retval = new DocumentResponseAddOK()
                    {
                        documentDTO = new List <DocumentDTO>()
                        {
                            new DocumentDTO()
                            {
                                DocID = dataset.Tables[0].Rows[0].Field <Guid>("DocID")
                            }
                        }
                    };
                }
            }
            catch (Exception e)
            {
                retval = new DocumentResponseDontAdd();
                //log
            }
            return(retval);
        }
        public DocumentsharingResponse AddSharing(DocumentSharingRequest request)
        {
            DocumentsharingResponse retval = default;

            try
            {
                var con        = _SQLDAL.Connect("Server=LAPTOP-B6F4SVRM;Database=DocumentProject;" + "Trusted_Connection=True;");
                var parameters = _paramConverter.ConvertToParameters(request.sharingDTO);
                var dataset    = _SQLDAL.ExecSPQuery("CreateShare", con, parameters);

                if (dataset != null)
                {
                    retval = new DocumentSharingResponseAddOK();
                }
            }
            catch (Exception e)
            {
                retval = new DocumentSharingResponseDontAdd();
                //log
            }
            return(retval);
        }
示例#6
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);
        }
示例#7
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 void CreateShare(Sharing sharing)
        {
            var parameters = _paramConverter.ConvertToParameters(sharing);

            dal.ExecSPQuery("CreateShare", con, parameters);
        }
示例#9
0
        public void UpdateText(RequestText requestText)
        {
            var parameters = _paramConverter.ConvertToParameters(requestText);

            dal.ExecSPQuery("updatetxt", con, parameters);
        }
示例#10
0
        public void CreateUser(User user)
        {
            var parameters = _paramConverter.ConvertToParameters(user);

            dal.ExecSPQuery("CreateUser", con, parameters);
        }