Ejemplo n.º 1
0
        public string New()
        {
            string        path = "D:\\Users\\Public\\MyVLib\\My Virtual Subject Library\\";
            string        name = "xml/dir.xml";
            RQBookmarkDAL VLD  = new RQBookmarkDAL();

            System.IO.DirectoryInfo VLDir = new System.IO.DirectoryInfo(path);

            if (VLDir.Exists)
            {
                VLD.LoadBookmarks(ref path, ref name);
            }
            else
            {
                throw new HttpResponseException(JsonErrorResponse.Create(System.Net.HttpStatusCode.NotFound, Mvc5RQ.Areas.DataManagement.Resources.DataManagement.dm_new_err_directory_not_found));
            }
            return(Mvc5RQ.Areas.DataManagement.Resources.DataManagement.dm_new_ok);
        }
Ejemplo n.º 2
0
        public RQKosBranch Delete(string id, [FromBody] IEnumerable <RQKosTransfer> RQKosTransferBranch)
        {
            if (ModelState.IsValid)
            {
                RQKosEditModel editModel = new RQKosEditModel(RQKosTransferBranch);

                if (editModel.Delete())
                {
                    return(editModel.RQKosEditSet);
                }
                else
                {
                    throw new HttpResponseException(JsonErrorResponse.Create(editModel.RQKosEditStatus));
                }
            }
            else
            {
                throw new HttpResponseException(JsonErrorResponse.InvalidData());
            }
        }
Ejemplo n.º 3
0
        private void WriteXhtmlList(Mvc5RQ.Models.RQItemModel rqItemModel, Stream writeStream)
        {
            if (rqItemModel != null)
            {
                System.Xml.XmlTextReader r = rqItemModel.RQItems.ConvertTo("rqi", 1, 0);

                try
                {
                    var xTrf = new System.Xml.Xsl.XslCompiledTransform(true);
                    var xSet = new System.Xml.Xsl.XsltSettings(enableDocumentFunction: true, enableScript: true);

                    r.MoveToContent();
                    xTrf.Load(rqItemModel.RQItems.FormatPreprocessor.XmlTransformPath, xSet, new System.Xml.XmlUrlResolver());
                    xTrf.Transform(new System.Xml.XPath.XPathDocument(r), rqItemModel.RQItems.FormatPreprocessor.XslTransformArg, writeStream);
                }
                catch (Exception ex)
                {
                    //throw new NotImplementedException("Could not find a RiQuest item with requested document number.");
                    throw new HttpResponseException(JsonErrorResponse.Create(ex, "Add operation failed."));
                }
            }
        }