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 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); }
public Response AddSharing(DocumentSharingRequest request) { Response response = default; try { IDBParameter p1 = new SqlParameterAdapter(); IDBParameter p2 = new SqlParameterAdapter(); p1.ParameterName = "DocId"; p1.Value = request.DocID; p2.ParameterName = "userId"; p2.Value = request.UserId; var con = dal.Connect("Server=LAPTOP-B6F4SVRM;Database=DocumentProject;" + "Trusted_Connection=True;"); var dataset = dal.ExecSPQuery("CreateShare", con, p1, p2); if (dataset != null) { response = new DocumentSharingResponseAddOK(); } } catch (Exception e) { response = new ResponseError(); } return(response); }
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 DataSet CreateDocument(Document document) { var p = _paramConverter.ConvertToParameter(document, "UserID"); var p1 = _paramConverter.ConvertToParameter(document, "ImageURL"); var p2 = _paramConverter.ConvertToParameter(document, "DocumentName"); var data = dal.ExecSPQuery("CreateDocument", con, p, p1, p2); return(data); }
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); }
public Response Exec(IDBConnection con, string SP, params IDBParameter[] parameters) { Response response = default; try { var dataset = dal.ExecSPQuery(SP, con, parameters); if (dataset != null) { response = new ResponseOK(); } //IDBParameter p1 = new SqlParameterAdapter(); //IDBParameter p2 = new SqlParameterAdapter(); //IDBParameter p3 = new SqlParameterAdapter(); //IDBParameter p4 = new SqlParameterAdapter(); //IDBParameter p5 = new SqlParameterAdapter(); //IDBParameter p6 = new SqlParameterAdapter(); //IDBParameter p7 = new SqlParameterAdapter(); //IDBParameter p8 = new SqlParameterAdapter(); //p1.ParameterName = "DocID"; //p1.Value = request.DocID; //p2.ParameterName = "MarkerType"; //p2.Value = request.MarkerType; //p3.ParameterName = "MarkerLocation1X"; //p3.Value = request.MarkerLocation1X; //p4.ParameterName = "MarkerLocation1Y"; //p4.Value = request.MarkerLocation1Y; //p5.ParameterName = "MarkerLocation2X"; //p5.Value = request.MarkerLocation2X; //p6.ParameterName = "MarkerLocation2Y"; //p6.Value = request.MarkerLocation2Y; //p7.ParameterName = "Fore_backColor"; //p7.Value = request.Fore_backColor; //p8.ParameterName = "userId"; //p8.Value = request.userId; //con = dal.Connect("Server=LAPTOP-B6F4SVRM;Database=DocumentProject;" + // "Trusted_Connection=True;"); //var dataset = dal.ExecSPQuery("CreateMarker", con, p1, p2, p3, p4, p5, p6, p7, p8); //if (dataset != null) //{ // response = new MarkersResponseAddOK(); //} } catch (Exception e) { response = new ResponseError(); } return(response); }
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); }
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); }
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 DataSet CreateMarker(Marker marker) { var p = _paramConverter.ConvertToParameter(marker, "docID"); var p1 = _paramConverter.ConvertToParameter(marker, "MarkerType"); var p2 = _paramConverter.ConvertToParameter(marker, "cx"); var p3 = _paramConverter.ConvertToParameter(marker, "cy"); var p4 = _paramConverter.ConvertToParameter(marker, "rx"); var p5 = _paramConverter.ConvertToParameter(marker, "ry"); var p6 = _paramConverter.ConvertToParameter(marker, "Fore"); var p7 = _paramConverter.ConvertToParameter(marker, "userID"); var p8 = _paramConverter.ConvertToParameter(marker, "text"); var data = dal.ExecSPQuery("CreateMarker", con, p, p1, p2, p3, p4, p5, p6, p7, p8); return(data); }
public void CreateShare(Sharing sharing) { var parameters = _paramConverter.ConvertToParameters(sharing); dal.ExecSPQuery("CreateShare", con, parameters); }
public void CreateUser(User user) { var parameters = _paramConverter.ConvertToParameters(user); dal.ExecSPQuery("CreateUser", con, parameters); }