Exemplo n.º 1
0
 /// <summary>
 /// Code to add or edit an article from article master
 /// </summary>
 /// <param name="ObjEArticle"></param>
 /// <returns></returns>
 public EArticles SaveArticle(EArticles ObjEArticle)
 {
     try
     {
         XmlDocument Xdoc  = new XmlDocument();
         string      XPath = "/Nouns/Article";
         Xdoc = XMLBuilder.XmlConstruct(Xdoc, XPath, "WGID", ObjEArticle.WGID.ToString());
         Xdoc = XMLBuilder.XmlConstruct(Xdoc, XPath, "WG", ObjEArticle.WG);
         Xdoc = XMLBuilder.XmlConstruct(Xdoc, XPath, "WA", ObjEArticle.WA);
         Xdoc = XMLBuilder.XmlConstruct(Xdoc, XPath, "WGDescription", ObjEArticle.WGDescription);
         Xdoc = XMLBuilder.XmlConstruct(Xdoc, XPath, "WADescription", ObjEArticle.WADescription);
         Xdoc = XMLBuilder.XmlConstruct(Xdoc, XPath, "WIID", ObjEArticle.WIID.ToString());
         Xdoc = XMLBuilder.XmlConstruct(Xdoc, XPath, "WI", ObjEArticle.WI);
         Xdoc = XMLBuilder.XmlConstruct(Xdoc, XPath, "WIDescription", ObjEArticle.WIDescription);
         Xdoc = XMLBuilder.XmlConstruct(Xdoc, XPath, "Fabrikate", ObjEArticle.Fabrikate);
         Xdoc = XMLBuilder.XmlConstruct(Xdoc, XPath, "Typ", ObjEArticle.Typ);
         Xdoc = XMLBuilder.XmlConstruct(Xdoc, XPath, "Masseinheit", ObjEArticle.Masseinheit);
         Xdoc = XMLBuilder.XmlConstruct(Xdoc, XPath, "Dimension", ObjEArticle.Dimension);
         Xdoc = XMLBuilder.XmlConstruct(Xdoc, XPath, "Menegenheit", ObjEArticle.Menegenheit);
         Xdoc = XMLBuilder.XmlConstruct(Xdoc, XPath, "Remarks", ObjEArticle.Remarks);
         Xdoc = XMLBuilder.XmlConstruct(Xdoc, XPath, "TextKZ", ObjEArticle.TextKZ);
         Xdoc = XMLBuilder.XmlConstruct(Xdoc, XPath, "ValidityDate", ObjEArticle.ValidityDate.ToString("yyyy-MM-dd"));
         Xdoc = XMLBuilder.XmlConstruct(Xdoc, XPath, "Multi1", ObjEArticle.Multi1.ToString(CInfo));
         Xdoc = XMLBuilder.XmlConstruct(Xdoc, XPath, "Multi2", ObjEArticle.Multi2.ToString(CInfo));
         Xdoc = XMLBuilder.XmlConstruct(Xdoc, XPath, "Multi3", ObjEArticle.Multi3.ToString(CInfo));
         Xdoc = XMLBuilder.XmlConstruct(Xdoc, XPath, "Multi4", ObjEArticle.Multi4.ToString(CInfo));
         Xdoc = XMLBuilder.XmlConstruct(Xdoc, XPath, "DataNormNumber", Convert.ToString(ObjEArticle.DataNormNumber));
         Xdoc = XMLBuilder.XmlConstruct(Xdoc, XPath, "CreatedBy", Convert.ToString(ObjEArticle.CreatedBy));
         Xdoc = XMLBuilder.XmlConstruct(Xdoc, XPath, "LastUpdatedBy", Convert.ToString(ObjEArticle.LastUpdatedBy));
         if (ObjDArticles == null)
         {
             ObjDArticles = new DArticles();
         }
         ObjEArticle = ObjDArticles.SaveArticle(Xdoc, ObjEArticle);
     }
     catch (Exception ex)
     {
         throw;
     }
     return(ObjEArticle);
 }