Beispiel #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);
         }
     }
 }
Beispiel #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);
             }
         }
     }
 }
Beispiel #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);
                    //}
                }
            }
        }
Beispiel #4
0
        public IHttpActionResult GetOTPROfUZ_DOC(string num)
        {
            try
            {
                UZ.UZ_Convert convert = new UZ.UZ_Convert();
                UZ.OTPR       otpr    = null;

                UZ_DOC uz_doc = this.ef_ids
                                .Context
                                .Where(s => s.num_doc == num)
                                .ToList()
                                .Select(c => c.GetUZ_DOC()).FirstOrDefault();
                if (uz_doc != null)
                {
                    otpr = convert.XMLToOTPR(uz_doc.xml_doc);
                }
                return(Ok(otpr));
            }
            catch (Exception e)
            {
                return(BadRequest(e.Message));
            }
        }