Пример #1
0
 public void GetActs()
 {
     UZ.UZ_Convert           convert   = new UZ.UZ_Convert();
     EFIDS.Concrete.EFUZ_DOC ef_uz_doc = new EFIDS.Concrete.EFUZ_DOC(new EFIDS.Concrete.EFDbContext());
     foreach (EFIDS.Entities.UZ_DOC doc in ef_uz_doc.Context.ToList())
     {
         string  xml_final = convert.XMLToFinalXML(doc.xml_doc);
         UZ.OTPR otpr      = convert.FinalXMLToOTPR(xml_final);
         if (otpr != null && otpr.acts != null && otpr.acts.Count() > 0)
         {
             Console.WriteLine("num_doc = {0}", doc.num_doc);
         }
     }
 }
Пример #2
0
 public void GetDocs()
 {
     UZ.UZ_Convert           convert   = new UZ.UZ_Convert();
     EFIDS.Concrete.EFUZ_DOC ef_uz_doc = new EFIDS.Concrete.EFUZ_DOC(new EFIDS.Concrete.EFDbContext());
     foreach (EFIDS.Entities.UZ_DOC doc in ef_uz_doc.Context.ToList())
     {
         string  xml_final = convert.XMLToFinalXML(doc.xml_doc);
         UZ.OTPR otpr      = convert.FinalXMLToOTPR(xml_final);
         if (otpr != null && otpr.sender_doc != null && otpr.sender_doc.Count() > 0)
         {
             foreach (UZ.SENDER_DOC sd in otpr.sender_doc.ToList())
             {
                 Console.WriteLine("num_doc = {0}, сылка на документ : {1}", doc.num_doc, sd.id);
             }
         }
     }
 }
Пример #3
0
        public void SetNum_UZ()
        {
            UZ.UZ_Convert                convert   = new UZ.UZ_Convert();
            EFIDS.Concrete.EFUZ_DOC      ef_uz_doc = new EFIDS.Concrete.EFUZ_DOC(new EFIDS.Concrete.EFDbContext());
            List <EFIDS.Entities.UZ_DOC> list_docs = ef_uz_doc.Context.Where(d => d.num_uz == null).ToList();
            int count = list_docs.Count();

            foreach (EFIDS.Entities.UZ_DOC doc in list_docs)
            {
                count--;
                string  xml_final = convert.XMLToFinalXML(doc.xml_doc);
                UZ.OTPR otpr      = convert.FinalXMLToOTPR(xml_final);
                if (otpr != null && otpr.nom_doc != null)
                {
                    doc.num_uz = otpr.nom_doc;
                    int result = ef_uz_doc.Save();
                    //foreach (UZ.SENDER_DOC sd in otpr.sender_doc.ToList()) {
                    Console.WriteLine("num_doc = {0}, результат сохранения : {1}, осталось {2}", doc.num_doc, result, count);
                    //}
                }
            }
        }