public ActionResult EditXmlFileForm(int id)
        {
            var xl = xmlRepository.GetXmlFileById(id);
            ConversionXmlModel model = new ConversionXmlModel()
            {
                Xml_id     = xl.Xml_Id,
                Xml_TypeId = xl.Xml_TypeId,
                XmlFile    = xl.XmlFile
            };

            return(PartialView("_EditXmlFileForm", model));
        }
Beispiel #2
0
        public ConversionXml UpdateXmlFile(ConversionXmlModel xmlFile)
        {
            var node     = xmlFile.XmlModel;
            var nodelist = xmlFile.XmlModel.Where(s => s.NodeId != 1);

            XDocument xdoc = new XDocument(new XElement(node[0].NodeName,
                                                        from item in nodelist
                                                        select new XElement(item.NodeName, item.NodeValue)));

            var selectedXml = _context.ConversionXmls.Where(x => x.Xml_Id == xmlFile.Xml_id).FirstOrDefault();

            selectedXml.Xml_TypeId = xmlFile.Xml_TypeId;
            selectedXml.XmlFile    = xdoc.ToString();
            _context.SaveChanges();
            return(selectedXml);
        }
 public ActionResult UpdateXMLFile(ConversionXmlModel xmlfile)
 {
     xmlRepository.UpdateXmlFile(xmlfile);
     return(Json("success"));
 }