Esempio n. 1
0
        /// <summary>
        /// SupplReport() - Debugging report: output list of Supplier companies in TSmatch.xlsx/Suppliers
        /// </summary>
        public static void SupplReport()
        {
            List <Supplier> Suppliers = new List <Supplier>();
            Docs            docSupl   = Docs.getDoc(Decl.SUPPLIERS);

            for (int i = docSupl.i0; i <= docSupl.il; i++)
            {
                Suppliers.Add(new Supplier(i));
            }
            Docs doc = Docs.getDoc("SupplReport");

            doc.Reset("Now");
            foreach (var s in Suppliers)
            {
                doc.wrDoc(1, s.date, s.name, s.Url, s.City, s.index, s.street, s.telephone, s.CompSets.Count);
                foreach (var cs in s.CompSets)
                {
                    //11.1.17                    cs.getCompSet();
                    //////CmpSet.getCompSet(cs.name, s);
                    //////Docs w = Docs.getDoc(cs.doc.name);
                    //////cs.doc = w;
                    Docs   w  = cs.doc;
                    string nm = w.Wb.Name + "/" + w.Sheet.Name;
                    doc.wrDoc(2, w.name, nm, w.i0, w.il, w.LoadDescription);
                }
                foreach (var cs in s.CompSets)
                {
                    cs.doc.Close();
                }
            }
            doc.saveDoc();
            doc.Close();
        }
Esempio n. 2
0
        public void CheckAll()
        {
            Docs toc = Docs.getDoc();

            //-- Check TSmach.xlsx/Suppliers consystancy
            Docs SupList = Docs.getDoc(Decl.SUPPLIERS);

            for (int i = SupList.i0; i <= SupList.il; i++)
            {
                Supl s         = new Supl(i);
                int  nCompSets = SupList.Body.Int(i, Decl.SUPL_LISTCOUNT);
                for (int n = 0; n < nCompSets; n++)
                {
                    string csName = SupList.Body.Strng(i, Decl.SUPL_LISTCOUNT + n + 1);
                    CS     cs     = null;
                    try { cs = new CS(csName, s); }
                    catch { }
                    var    ruleLst = Rule.Rule.getList(s.Name);
                    string msg     = string.Format("PriceList \"{0}\" "
                                                   + " not awalable from Supplier \"{1}\"", csName, s.Name);
                    if (ruleLst.Count == 0)
                    {
                        msg += ", and no Rule for him";
                    }
                    else
                    {
                        msg += string.Format(", however, available {0} for him", ruleLst.Count);
                    }
                    log.Info(msg);
                    if (cs == null)
                    {
                        continue;
                    }
                    cs.doc.Close();
                }
            }
            return;

            //-- check toc and close open price-lists
            for (int i = toc.i0; i <= toc.il; i++)
            {
                string type = toc.Body.Strng(i, Decl.DOC_TYPE);
                if (!type.Contains("Comp"))
                {
                    continue;
                }
                string doc_name = toc.Body.Strng(i, Decl.DOC_NAME);
                Docs   doc      = Docs.getDoc(doc_name, fatal: false);
                if (doc == null)
                {
                    continue;
                }
                doc.Close();
            }
        }