Ejemplo n.º 1
0
        public Response CreateShare(ShareRequest request)
        {
            Response retval;

            try
            {
                var dsShare = _dal.CreateShare(request);
                retval = new ResponseOk <string>("Share was Created!");
            }
            catch (Exception ex)
            {
                retval = new AppResponseError("Sharing not created\n" + ex.Message);
            }
            return(retval);
        }
        public Response removeShare(ShareRequest request)
        {
            Response retval;

            try
            {
                var dsShare = _dal.RemoveShare(request);
                retval = new ResponseOk <string>("Remove share for this user");
            }
            catch (Exception ex)
            {
                retval = new AppResponseError("Can't remove now\n" + ex.Message);
            }
            return(retval);
        }
        public Response GetMySharedDocs(Login request)
        {
            Response retval;

            try
            {
                var dsSharing = _dal.GetMySharedDocs(request);
                if (dsSharing.Tables[0].Rows.Count > 0)
                {
                    var listResult = ConvertDataToShareList(dsSharing);
                    retval = new ResponseOk <List <ShareRequest> >(listResult);
                }
                else
                {
                    retval = new ResponseError <string>("There is no Share docs to present!");
                }
            }
            catch
            {
                retval = new AppResponseError("Error, can't fetch documents");
            }
            return(retval);
        }